diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/3rdParty/SDL2/src/main/windows/SDL_windows_main.c | 2 | ||||
-rw-r--r-- | Source/Asura.Engine/Graphics/Canvas.h | 3 | ||||
-rw-r--r-- | Source/Asura.Engine/Graphics/Color.h | 22 | ||||
-rw-r--r-- | Source/Asura.Framework/scripts/ai/state_graph.lua | 11 | ||||
-rw-r--r-- | Source/Asura.Framework/scripts/ai/state_machine.lua | 4 | ||||
-rw-r--r-- | Source/Asura.Framework/scripts/ai/state_map.lua | 12 | ||||
-rw-r--r-- | Source/Asura.Framework/scripts/framework.lua | 21 | ||||
-rw-r--r-- | Source/Asura.Framework/scripts/graphics/image.lua | 4 | ||||
-rw-r--r-- | Source/Asura.Framework/scripts/graphics/renderer.lua | 8 | ||||
-rw-r--r-- | Source/Asura.Framework/scripts/graphics/sprite_renderer.lua | 2 | ||||
-rw-r--r-- | Source/Asura.Framework/scripts/managers/scene_manager.lua | 2 | ||||
-rw-r--r-- | Source/Asura.Runner/main.cpp | 2 | ||||
-rw-r--r-- | Source/Samples/CursorTest/main.cpp | 4 |
13 files changed, 67 insertions, 30 deletions
diff --git a/Source/3rdParty/SDL2/src/main/windows/SDL_windows_main.c b/Source/3rdParty/SDL2/src/main/windows/SDL_windows_main.c index 32f6727..9c07cda 100644 --- a/Source/3rdParty/SDL2/src/main/windows/SDL_windows_main.c +++ b/Source/3rdParty/SDL2/src/main/windows/SDL_windows_main.c @@ -121,7 +121,7 @@ OutOfMemory(void) static int main_getcmdline() { - char **argv; + char **argv = 0; int argc; char *cmdline = NULL; int retval = 0; diff --git a/Source/Asura.Engine/Graphics/Canvas.h b/Source/Asura.Engine/Graphics/Canvas.h index 67d7a63..fab9cba 100644 --- a/Source/Asura.Engine/Graphics/Canvas.h +++ b/Source/Asura.Engine/Graphics/Canvas.h @@ -16,8 +16,7 @@ namespace AsuraEngine private: - // AsuraEngine.SimCanvas - LUAX_DECL_FACTORY(SimCanvas); + LUAX_DECL_FACTORY(SimCanvas); // AsuraEngine.SimCanvas }; diff --git a/Source/Asura.Engine/Graphics/Color.h b/Source/Asura.Engine/Graphics/Color.h index 40b55e4..f07919c 100644 --- a/Source/Asura.Engine/Graphics/Color.h +++ b/Source/Asura.Engine/Graphics/Color.h @@ -8,20 +8,36 @@ namespace AsuraEngine namespace Graphics { + class Color; + /// /// 32bitsɫ /// - class Color + class Color32 { public: - Color(byte r, byte g, byte b, byte a); - ~Color(); + Color32(Color c); + Color32(byte r, byte g, byte b, byte a); byte r, g, b, a; private: + LUAX_DECL_FACTORY(Color32); + + }; + + class Color + { + public: + + Color(Color32 c32); + + float r, g, b, a; + + private: + LUAX_DECL_FACTORY(Color); }; diff --git a/Source/Asura.Framework/scripts/ai/state_graph.lua b/Source/Asura.Framework/scripts/ai/state_graph.lua new file mode 100644 index 0000000..a699e76 --- /dev/null +++ b/Source/Asura.Framework/scripts/ai/state_graph.lua @@ -0,0 +1,11 @@ +local StateGraph = AsuraEngine.Asset.Sub("StateGraph") + +AsuraEngine.StateGraph = StateGraph + +function StateGraph.Ctor(self) + +end + +function StateGraph.ToAsset() + +end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/ai/state_machine.lua b/Source/Asura.Framework/scripts/ai/state_machine.lua index b1ff849..66276a0 100644 --- a/Source/Asura.Framework/scripts/ai/state_machine.lua +++ b/Source/Asura.Framework/scripts/ai/state_machine.lua @@ -1,6 +1,6 @@ local StateMachine = Class() AsuraEngine.StateMachine = StateMachine -function StateMachine.Ctor(self, statemap) - self.statemap = statemap +function StateMachine.Ctor(self, stategraph) + self.stategraph = stategraph end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/ai/state_map.lua b/Source/Asura.Framework/scripts/ai/state_map.lua deleted file mode 100644 index 7e986de..0000000 --- a/Source/Asura.Framework/scripts/ai/state_map.lua +++ /dev/null @@ -1,12 +0,0 @@ -local StateMap = AsuraEngine.Asset.Sub("StateMap") - -AsuraEngine.StateMap = StateMap - -function StateMap.Ctor(self) - -end - -function StateMap.ToAsset() - -end - diff --git a/Source/Asura.Framework/scripts/framework.lua b/Source/Asura.Framework/scripts/framework.lua index 14e7b24..5da0020 100644 --- a/Source/Asura.Framework/scripts/framework.lua +++ b/Source/Asura.Framework/scripts/framework.lua @@ -1,2 +1,21 @@ ---框架入口文件 +package.path = "scripts\\?.lua" + +--loader +local loadfn = function(modulename) + local errmsg = "" + local modulepath = string.gsub(modulename, "%.", "/") + for path in string.gmatch(package.path, "([^;]+)") do + local filename = string.gsub(path, "%?", modulepath) + filename = string.gsub(filename, "\\", "/") + local result = kleiloadlua(filename) + if result then + return result + end + errmsg = errmsg.."\n\tno file '"..filename.."' (checked with custom loader)" + end + return errmsg +end + +table.insert(package.loaders, 1, loadfn) + require "" diff --git a/Source/Asura.Framework/scripts/graphics/image.lua b/Source/Asura.Framework/scripts/graphics/image.lua index ae91466..c96906b 100644 --- a/Source/Asura.Framework/scripts/graphics/image.lua +++ b/Source/Asura.Framework/scripts/graphics/image.lua @@ -35,4 +35,6 @@ end --image不可再编辑器编辑,所以没有ToAsset方法 --function Image.ToAsset() ---end
\ No newline at end of file +--end + +return Image
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/graphics/renderer.lua b/Source/Asura.Framework/scripts/graphics/renderer.lua index 46fd548..a7091b0 100644 --- a/Source/Asura.Framework/scripts/graphics/renderer.lua +++ b/Source/Asura.Framework/scripts/graphics/renderer.lua @@ -2,9 +2,9 @@ local Renderer = AsuraEngine.Component.Sub("Renderer") AsuraEngine.Renderer = Renderer function Renderer.Ctor(self) - self.mMaterials = {} - self.mMaterial = nil - self.mIsMultiMaterials = false + self.materials = {} + self.material = nil + self.isMultiMaterials = false end --取材质,如果是shared,那么从此材质clone一个 @@ -13,7 +13,7 @@ function Renderer.GetMaterial(self) end function Renderer.IsMultiMaterials(self) - return self.mIsMultiMaterials + return self.isMultiMaterials end return Renderer
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua b/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua index 2d1fae5..93937d7 100644 --- a/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua +++ b/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua @@ -4,7 +4,7 @@ local SpriteRenderer = AsuraEngine.Renderer.Sub("Spriterenderer") AsuraEngine.SpriteRenderer = SpriteRenderer function SpriteRenderer.Ctor(self) - self.mMaterials = {} + self.materials = {} end function SpriteRenderer:OnRender() diff --git a/Source/Asura.Framework/scripts/managers/scene_manager.lua b/Source/Asura.Framework/scripts/managers/scene_manager.lua index fc5a6ba..8c4e24f 100644 --- a/Source/Asura.Framework/scripts/managers/scene_manager.lua +++ b/Source/Asura.Framework/scripts/managers/scene_manager.lua @@ -13,4 +13,4 @@ function SceneManager.GetSceneByGUID() end -return SceneManager
\ No newline at end of file +return SceneManager
\ No newline at end of file diff --git a/Source/Asura.Runner/main.cpp b/Source/Asura.Runner/main.cpp index 218b1a9..2501188 100644 --- a/Source/Asura.Runner/main.cpp +++ b/Source/Asura.Runner/main.cpp @@ -1,3 +1,5 @@ +#include "SDl2/SDL.h" + // ϷᱻһԴļrunnerȡݣϷ // RunnerֻܶȡpackerϷļeditorֱϷassetsRunnerһСл int main() diff --git a/Source/Samples/CursorTest/main.cpp b/Source/Samples/CursorTest/main.cpp index c41b83a..803503a 100644 --- a/Source/Samples/CursorTest/main.cpp +++ b/Source/Samples/CursorTest/main.cpp @@ -4,7 +4,7 @@ #include "SDL2/SDL.h" -int main() +int main(int argc, char* args[]) { - + return 0; }
\ No newline at end of file |