diff options
Diffstat (limited to 'Source')
61 files changed, 389 insertions, 479 deletions
diff --git a/Source/Asura.Editor/Source/Window.h b/Source/Asura.Editor/Source/Window.h index f9f8d43..7b265ef 100644 --- a/Source/Asura.Editor/Source/Window.h +++ b/Source/Asura.Editor/Source/Window.h @@ -4,10 +4,10 @@ namespace AsuraEditor { - class Window - { + class Window + { - }; + }; } diff --git a/Source/Asura.Engine/Factory.h b/Source/Asura.Engine/Factory.h index bc536d7..0ffaccf 100644 --- a/Source/Asura.Engine/Factory.h +++ b/Source/Asura.Engine/Factory.h @@ -4,11 +4,11 @@ namespace AsuraEngine { - class Factory - { + class Factory + { - }; + }; } - + #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Canvas.h b/Source/Asura.Engine/Graphics/Canvas.h index fab9cba..ca745ab 100644 --- a/Source/Asura.Engine/Graphics/Canvas.h +++ b/Source/Asura.Engine/Graphics/Canvas.h @@ -10,15 +10,15 @@ namespace AsuraEngine class Canvas : public Texture { - public: + public: - private: + private: - LUAX_DECL_FACTORY(SimCanvas); // AsuraEngine.SimCanvas + LUAX_DECL_FACTORY(SimCanvas); // AsuraEngine.SimCanvas - }; + }; } } diff --git a/Source/Asura.Engine/Graphics/Color.h b/Source/Asura.Engine/Graphics/Color.h index f07919c..f62f9b8 100644 --- a/Source/Asura.Engine/Graphics/Color.h +++ b/Source/Asura.Engine/Graphics/Color.h @@ -5,44 +5,44 @@ namespace AsuraEngine { - namespace Graphics - { + namespace Graphics + { - class Color; + class Color; - /// - /// 32bitsɫ - /// - class Color32 - { - public: + /// + /// 32bitsɫ + /// + class Color32 + { + public: - Color32(Color c); - Color32(byte r, byte g, byte b, byte a); + Color32(Color c); + Color32(byte r, byte g, byte b, byte a); - byte r, g, b, a; + byte r, g, b, a; - private: + private: - LUAX_DECL_FACTORY(Color32); + LUAX_DECL_FACTORY(Color32); - }; + }; - class Color - { - public: + class Color + { + public: - Color(Color32 c32); + Color(Color32 c32); - float r, g, b, a; + float r, g, b, a; - private: + private: - LUAX_DECL_FACTORY(Color); + LUAX_DECL_FACTORY(Color); - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Image.h b/Source/Asura.Engine/Graphics/Image.h index e84dd6c..553df21 100644 --- a/Source/Asura.Engine/Graphics/Image.h +++ b/Source/Asura.Engine/Graphics/Image.h @@ -12,52 +12,52 @@ namespace AsuraEngine { - namespace Graphics - { + namespace Graphics + { - class ImageFactory; + class ImageFactory; - /// - /// ImageͼƬڴȡϷĽһImageڴ桢ԴֻᱣһݣҪ - /// imageêλãźתǶȣʹspriteһֻࡣ - /// - class Image final : public Texture - { - public: + /// + /// ImageͼƬڴȡϷĽһImageڴ桢ԴֻᱣһݣҪ + /// imageêλãźתǶȣʹspriteһֻࡣ + /// + class Image final : public Texture + { + public: - uint GetWidth(); - uint GetHeight(); + uint GetWidth(); + uint GetHeight(); - /// - /// ijһλõ - /// - Color GetPixel(uint x, uint y); + /// + /// ijһλõ + /// + Color GetPixel(uint x, uint y); - private: + private: - friend class ImageFactory; + friend class ImageFactory; - Image(Color* pixels, int width, int height); - ~Image(); + Image(Color* pixels, int width, int height); + ~Image(); - /// - /// СΪλ - /// - uint mWidth, mHeight; - Color* mPixels; + /// + /// СΪλ + /// + uint mWidth, mHeight; + Color* mPixels; /// /// ID /// uint mID; - //---------------------------------------------------------------------------------------------------- + //---------------------------------------------------------------------------------------------------- - LUAX_DECL_FACTORY(SimImage); //AsuraEngine.SimImage + LUAX_DECL_FACTORY(SimImage); //AsuraEngine.SimImage - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Mesh2D.h b/Source/Asura.Engine/Graphics/Mesh2D.h index cff66c4..0d5113a 100644 --- a/Source/Asura.Engine/Graphics/Mesh2D.h +++ b/Source/Asura.Engine/Graphics/Mesh2D.h @@ -3,18 +3,18 @@ namespace AsuraEngine { - namespace Graphics - { + namespace Graphics + { - /// - /// 2D meshһЩ㶯 - /// - class Mesh2D - { + /// + /// 2D meshһЩ㶯 + /// + class Mesh2D + { - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/OpenGL.cpp b/Source/Asura.Engine/Graphics/OpenGL.cpp index ec23f52..dac2ea4 100644 --- a/Source/Asura.Engine/Graphics/OpenGL.cpp +++ b/Source/Asura.Engine/Graphics/OpenGL.cpp @@ -2,10 +2,10 @@ namespace AsuraEngine { - namespace Graphics - { + namespace Graphics + { - } + } }
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/OpenGL.h b/Source/Asura.Engine/Graphics/OpenGL.h index 34d662b..315c09b 100644 --- a/Source/Asura.Engine/Graphics/OpenGL.h +++ b/Source/Asura.Engine/Graphics/OpenGL.h @@ -3,15 +3,15 @@ namespace AsuraEngine { - namespace Graphics - { + namespace Graphics + { - class OpenGL - { + class OpenGL + { - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Shader.h b/Source/Asura.Engine/Graphics/Shader.h index e15c6e0..e22fc66 100644 --- a/Source/Asura.Engine/Graphics/Shader.h +++ b/Source/Asura.Engine/Graphics/Shader.h @@ -11,56 +11,56 @@ namespace AsuraEngine { - namespace Graphics - { + namespace Graphics + { - class Material; + class Material; - /// - /// һshaderһڲʼ乲ijShaderuniformsͶݣֻuniforms location - /// - class Shader - { - public: + /// + /// һshaderһڲʼ乲ijShaderuniformsͶݣֻuniforms location + /// + class Shader + { + public: - Shader(); - ~Shader(); + Shader(); + ~Shader(); - private: + private: - friend class Material; + friend class Material; - /// - /// shaderuniformsIDӳ䡣 - /// - static StringMap<int> sUniformsID; + /// + /// shaderuniformsIDӳ䡣 + /// + static StringMap<int> sUniformsID; - /// - /// uniformID - /// - static int GetUniformID(const String& name); + /// + /// uniformID + /// + static int GetUniformID(const String& name); - /// - /// ñ - /// vec2 Asura_Time xֵΪ뵱ǰʼʱ䣬yֵΪһ֡ʱ - /// vec2 Asura_RenderTargetSize RTĴСΪλ - /// Texture Asura_MainTexture - /// - void SetBuiltInUniforms(); + /// + /// ñ + /// vec2 Asura_Time xֵΪ뵱ǰʼʱ䣬yֵΪһ֡ʱ + /// vec2 Asura_RenderTargetSize RTĴСΪλ + /// Texture Asura_MainTexture + /// + void SetBuiltInUniforms(); - /// - /// ӳuniforms IDlocation - /// - Map<int, int> mLocations; + /// + /// ӳuniforms IDlocation + /// + Map<int, int> mLocations; - }; + }; - class ShaderManager final : public Manager - { + class ShaderManager final : public Manager + { - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/SpriteBatch.h b/Source/Asura.Engine/Graphics/SpriteBatch.h index e69de29..17d5e75 100644 --- a/Source/Asura.Engine/Graphics/SpriteBatch.h +++ b/Source/Asura.Engine/Graphics/SpriteBatch.h @@ -0,0 +1,20 @@ +#ifndef __ASURA_ENGINE_SPRITE_BATCH_H__ +#define __ASURA_ENGINE_SPRITE_BATCH_H__ + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// Sprite batchȾͼƬĵطϵͳ + /// + class SpriteBatch + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Texture.h b/Source/Asura.Engine/Graphics/Texture.h index b50467a..db5c72e 100644 --- a/Source/Asura.Engine/Graphics/Texture.h +++ b/Source/Asura.Engine/Graphics/Texture.h @@ -6,18 +6,18 @@ namespace AsuraEngine { - namespace Graphics - { + namespace Graphics + { - /// - /// 2Dࣩ2d meshrender targetбʹ - /// - class Texture : public Object - { + /// + /// 2Dࣩ2d meshrender targetбʹ + /// + class Texture : public Object + { - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Window.h b/Source/Asura.Engine/Graphics/Window.h index 0f6ca92..3a09266 100644 --- a/Source/Asura.Engine/Graphics/Window.h +++ b/Source/Asura.Engine/Graphics/Window.h @@ -3,23 +3,23 @@ namespace AsuraEngine { - namespace Graphics - { + namespace Graphics + { - /// - /// ڣֶ֧രڡڱ༭Ҫ֧֣runnerֻҪһڡ - /// - class Window - { - public: + /// + /// ڣֶ֧രڡڱ༭Ҫ֧֣runnerֻҪһڡ + /// + class Window + { + public: - private: + private: - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Manager.hpp b/Source/Asura.Engine/Manager.hpp index fb32491..7b4e272 100644 --- a/Source/Asura.Engine/Manager.hpp +++ b/Source/Asura.Engine/Manager.hpp @@ -4,10 +4,10 @@ namespace AsuraEngine { - class Manager - { + class Manager + { - }; + }; } diff --git a/Source/Asura.Engine/Map.cpp b/Source/Asura.Engine/Map.cpp deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Engine/Map.cpp +++ /dev/null diff --git a/Source/Asura.Engine/Map.h b/Source/Asura.Engine/Map.h deleted file mode 100644 index 3c538d4..0000000 --- a/Source/Asura.Engine/Map.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __ASURA_ENGINE_MAP_H__ -#define __ASURA_ENGINE_MAP_H__ - -#include <map> - -namespace AsuraEngine -{ - - template<typename key_type, typename value_type> - using Map = std::map<key_type, value_type>; - -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Math/Matrix44.h b/Source/Asura.Engine/Math/Matrix44.h index 2741430..4ab3c0b 100644 --- a/Source/Asura.Engine/Math/Matrix44.h +++ b/Source/Asura.Engine/Math/Matrix44.h @@ -3,22 +3,22 @@ namespace AsuraEngine { - namespace Math - { + namespace Math + { - /// - /// 4x4 - /// - class Matrix44 - { - public: + /// + /// 4x4 + /// + class Matrix44 + { + public: - private: - + private: + - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Math/Vector2.h b/Source/Asura.Engine/Math/Vector2.h index 99fe71b..875cef3 100644 --- a/Source/Asura.Engine/Math/Vector2.h +++ b/Source/Asura.Engine/Math/Vector2.h @@ -3,15 +3,15 @@ namespace AsuraEngine { - namespace Math - { + namespace Math + { - class Vector2 - { + class Vector2 + { - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Math/Vector3.h b/Source/Asura.Engine/Math/Vector3.h index f450527..f0e48e4 100644 --- a/Source/Asura.Engine/Math/Vector3.h +++ b/Source/Asura.Engine/Math/Vector3.h @@ -3,15 +3,15 @@ namespace AsuraEngine { - namespace Math - { + namespace Math + { - class Vector3 - { + class Vector3 + { - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Math/Vector4.h b/Source/Asura.Engine/Math/Vector4.h index 818274e..3739f83 100644 --- a/Source/Asura.Engine/Math/Vector4.h +++ b/Source/Asura.Engine/Math/Vector4.h @@ -3,15 +3,15 @@ namespace AsuraEngine { - namespace Math - { + namespace Math + { - class Vector4 - { + class Vector4 + { - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Object.cpp b/Source/Asura.Engine/Object.cpp index 587dca7..56fc164 100644 --- a/Source/Asura.Engine/Object.cpp +++ b/Source/Asura.Engine/Object.cpp @@ -3,21 +3,21 @@ namespace AsuraEngine { - Object::Object() - : mRC(0) - { + Object::Object() + : mRC(0) + { - } + } - void Object::Retain(Object* obj) - { - ++obj->mRC; - } + void Object::Retain(Object* obj) + { + ++obj->mRC; + } - void Object::Release(Object* obj) - { - if (--obj->mRC == 0) - delete obj; - } + void Object::Release(Object* obj) + { + if (--obj->mRC == 0) + delete obj; + } }
\ No newline at end of file diff --git a/Source/Asura.Engine/Object.h b/Source/Asura.Engine/Object.h index 7efe74b..40ea7fe 100644 --- a/Source/Asura.Engine/Object.h +++ b/Source/Asura.Engine/Object.h @@ -6,26 +6,26 @@ namespace AsuraEngine { - /// - /// - /// + /// + /// + /// class Object { - public: + public: - Object(); + Object(); - virtual ~Object(); + virtual ~Object(); - static void Retain(Object* obj); + static void Retain(Object* obj); - static void Release(Object* obj); + static void Release(Object* obj); - private: + private: - int mRC; // + int mRC; // - }; + }; } diff --git a/Source/Asura.Engine/Physics/World.h b/Source/Asura.Engine/Physics/World.h index 36b55a8..71984f5 100644 --- a/Source/Asura.Engine/Physics/World.h +++ b/Source/Asura.Engine/Physics/World.h @@ -6,20 +6,20 @@ namespace AsuraEngine { - namespace Physics - { + namespace Physics + { - class World - { - public: + class World + { + public: - private: + private: - LUAX_DECL_FACTORY(SimWorld); //AsuraEngine.SimWorld + LUAX_DECL_FACTORY(SimWorld); //AsuraEngine.SimWorld - }; + }; - } + } } #endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Stack.cpp b/Source/Asura.Engine/Stack.cpp deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Engine/Stack.cpp +++ /dev/null diff --git a/Source/Asura.Engine/Stack.h b/Source/Asura.Engine/Stack.h deleted file mode 100644 index f51017f..0000000 --- a/Source/Asura.Engine/Stack.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASURA_ENGINE_STACK_H__ -#define __ASURA_ENGINE_STACK_H__ - -namespace AsuraEngine -{ - - - -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/String.cpp b/Source/Asura.Engine/String.cpp deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Engine/String.cpp +++ /dev/null diff --git a/Source/Asura.Engine/String.h b/Source/Asura.Engine/String.h deleted file mode 100644 index 6d0ec3a..0000000 --- a/Source/Asura.Engine/String.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ASURA_ENGINE_STRING_H__ -#define __ASURA_ENGINE_STRING_H__ - -#include <string> - -namespace AsuraEngine -{ - - /// - /// װstd::string - /// - class String : public std::string - { - public: - inline String() - : std::string() - { - } - - inline String(const std::string& str) - : std::string(str) - { - } - - inline String(const String& str) - : std::string(str) - { - } - - inline String(const char* str) - : std::string(str) - { - } - - inline String& operator = (const String& str) - { - std::string::operator=(str); - return *this; - } - - inline operator const char* () const - { - return this->c_str(); - } - - inline const char* str() const - { - return this->c_str(); - } - - inline String(const String& s2, size_type pos2, size_type len2) - : std::string(s2, pos2, len2) - { - } - - inline String(const char* buf, size_type bufsize) - : std::string(buf, bufsize) - { - } - - inline String(size_type repetitions, char c) - : std::string(repetitions, c) - { - } - - inline int length() const - { - return size(); - } - - }; - -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/StringMap.hpp b/Source/Asura.Engine/StringMap.hpp index 92a157f..971a890 100644 --- a/Source/Asura.Engine/StringMap.hpp +++ b/Source/Asura.Engine/StringMap.hpp @@ -6,23 +6,23 @@ namespace AsuraEngine { - /// - /// һ˫һһӦӳ䣬shader uniformsstatemathine state parameterID - /// - template<typename key_type> - class StringMap - { - public: + /// + /// һ˫һһӦӳ䣬shader uniformsstatemathine state parameterID + /// + template<typename key_type> + class StringMap + { + public: - bool ContainsKey(const key_type& key); + bool ContainsKey(const key_type& key); - bool ContainsString(const String& str); + bool ContainsString(const String& str); - String GetStringByKey(const key_type& key); + String GetStringByKey(const key_type& key); - key_type GetKeyByString(const String& str); + key_type GetKeyByString(const String& str); - }; + }; } diff --git a/Source/Asura.Engine/Type.h b/Source/Asura.Engine/Type.h index 36ee9e7..5159ee2 100644 --- a/Source/Asura.Engine/Type.h +++ b/Source/Asura.Engine/Type.h @@ -6,18 +6,18 @@ namespace AsuraEngine { - typedef int8_t int8; - typedef uint8_t uint8; - typedef uint8 byte; - typedef int16_t int16; - typedef uint16_t uint16; - typedef int32_t int32; - typedef uint32_t uint32; - typedef int64_t int64; - typedef uint64_t uint64; + typedef int8_t int8; + typedef uint8_t uint8; + typedef uint8 byte; + typedef int16_t int16; + typedef uint16_t uint16; + typedef int32_t int32; + typedef uint32_t uint32; + typedef int64_t int64; + typedef uint64_t uint64; - typedef uint32_t uint; - typedef int32_t sint; + typedef uint32_t uint; + typedef int32_t sint; } diff --git a/Source/Asura.Engine/UnorderedMap.hpp b/Source/Asura.Engine/UnorderedMap.hpp deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Engine/UnorderedMap.hpp +++ /dev/null diff --git a/Source/Asura.Engine/Vector.hpp b/Source/Asura.Engine/Vector.hpp deleted file mode 100644 index 5e35312..0000000 --- a/Source/Asura.Engine/Vector.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __ASURA_ENGINE_VECTOR_HPP__ -#define __ASURA_ENGINE_VECTOR_HPP__ - -#include <vector> - -namespace AsuraEngine -{ - - template<typename T> - using Vector = std::vector<T>; - -} - -#endif
\ 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 66276a0..6dc5e14 100644 --- a/Source/Asura.Framework/scripts/ai/state_machine.lua +++ b/Source/Asura.Framework/scripts/ai/state_machine.lua @@ -2,5 +2,5 @@ local StateMachine = Class() AsuraEngine.StateMachine = StateMachine function StateMachine.Ctor(self, stategraph) - self.stategraph = stategraph + self.stategraph = stategraph end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/audio/source.lua b/Source/Asura.Framework/scripts/audio/source.lua index ccbc946..8269842 100644 --- a/Source/Asura.Framework/scripts/audio/source.lua +++ b/Source/Asura.Framework/scripts/audio/source.lua @@ -4,15 +4,15 @@ AsuraEngine.Source = AsuraEngine.Component.Sub("SoundPlayer") local Source = AsuraEngine.Source function Source.Ctor(self) - self.mSound = nil + self.mSound = nil end function Source.SetSound(sound) - self.mSound = sound + self.mSound = sound end function Source.GetSource() - return self.mSound + return self.mSound end function Source.OnUpdate(dt) diff --git a/Source/Asura.Framework/scripts/class.lua b/Source/Asura.Framework/scripts/class.lua index a280371..d5ed5cd 100644 --- a/Source/Asura.Framework/scripts/class.lua +++ b/Source/Asura.Framework/scripts/class.lua @@ -4,14 +4,14 @@ local Class = AsuraEngine.Class Class.__index = Class function Class.Sub(base, classname) - local subclass = {} - base.__index = base - setmetatable(subclass, base) - return c + local subclass = {} + base.__index = base + setmetatable(subclass, base) + return c end function Class.New(cls) - local obj = {} - setmetatable(obj, cls) - cls.__index = cls + local obj = {} + setmetatable(obj, cls) + cls.__index = cls end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/component.lua b/Source/Asura.Framework/scripts/component.lua index ad29efa..0eb7fc1 100644 --- a/Source/Asura.Framework/scripts/component.lua +++ b/Source/Asura.Framework/scripts/component.lua @@ -6,13 +6,13 @@ local Component = AsuraEngine.Component Component.gameobject = AsuraEngine.Type.GameObject function Component.Sub(cname) - self.base(cname) - assert(Component.components[cname] == nil) - + self.base(cname) + assert(Component.components[cname] == nil) + end function Component:Ctor(gameobject) - self.gameobject = gameobject + self.gameobject = gameobject end function Component:OnEvent(e) diff --git a/Source/Asura.Framework/scripts/filesystem/animation_loader.lua b/Source/Asura.Framework/scripts/filesystem/animation_loader.lua index e9fe7f3..9c57c43 100644 --- a/Source/Asura.Framework/scripts/filesystem/animation_loader.lua +++ b/Source/Asura.Framework/scripts/filesystem/animation_loader.lua @@ -6,5 +6,5 @@ local manager = AsuraEngine.AnimationManager local Animation = AsuraEngine.Animation function AnimationLoader.OnLoad(asset) - local animation = AsuraEngine.Class() + local animation = AsuraEngine.Class() end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/filesystem/asset.lua b/Source/Asura.Framework/scripts/filesystem/asset.lua index afe4ea6..7cf3905 100644 --- a/Source/Asura.Framework/scripts/filesystem/asset.lua +++ b/Source/Asura.Framework/scripts/filesystem/asset.lua @@ -7,7 +7,7 @@ AsuraEngine.Asset = AsuraEngine.Class("Asset") local Asset = AsuraEngine.Asset function Asset.Ctor(self) - self.guid = nil + self.guid = nil end --获得资源编号 diff --git a/Source/Asura.Framework/scripts/filesystem/image_loader.lua b/Source/Asura.Framework/scripts/filesystem/image_loader.lua index 15d1a2d..3c2e5da 100644 --- a/Source/Asura.Framework/scripts/filesystem/image_loader.lua +++ b/Source/Asura.Framework/scripts/filesystem/image_loader.lua @@ -2,12 +2,12 @@ require "graphics.image" local loader = AsuraEngine.Loader.New("image") function loader.OnLoad(asset) - assert(asset ~= nil) - local path = asset.extern - local image = AusraEngine.Image.New(path) - if image == nil then - AsuraEngine.LogError("") - return - end - return image + assert(asset ~= nil) + local path = asset.extern + local image = AusraEngine.Image.New(path) + if image == nil then + AsuraEngine.LogError("") + return + end + return image end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/filesystem/loader.lua b/Source/Asura.Framework/scripts/filesystem/loader.lua index c7b8b8a..e192e30 100644 --- a/Source/Asura.Framework/scripts/filesystem/loader.lua +++ b/Source/Asura.Framework/scripts/filesystem/loader.lua @@ -4,9 +4,9 @@ local Loader = AsuraEngine.Loader Loader.Loaders = {} function Loader.New(type) - assert(Loader.Loaders[type] == nil) - local loader = {} - Loader[type] = loader - return loader + assert(Loader.Loaders[type] == nil) + local loader = {} + Loader[type] = loader + return loader end diff --git a/Source/Asura.Framework/scripts/filesystem/material_loader.lua b/Source/Asura.Framework/scripts/filesystem/material_loader.lua index 07fdd84..07ca4e9 100644 --- a/Source/Asura.Framework/scripts/filesystem/material_loader.lua +++ b/Source/Asura.Framework/scripts/filesystem/material_loader.lua @@ -3,5 +3,5 @@ require "MaterialManager" local loader = AsuraEngine.Loader.New("material") function loader.OnLoad(asset) - + end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/filesystem/path_loader.lua b/Source/Asura.Framework/scripts/filesystem/path_loader.lua index 8cdd1a3..986e42c 100644 --- a/Source/Asura.Framework/scripts/filesystem/path_loader.lua +++ b/Source/Asura.Framework/scripts/filesystem/path_loader.lua @@ -3,7 +3,7 @@ require "Path/PathManager" local loader = AsuraEngine.Loader.New("path") function loader.OnLoad(asset) - if asset.type ~= "path" then - return nil - end + if asset.type ~= "path" then + return nil + end end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/filesystem/shader_loader.lua b/Source/Asura.Framework/scripts/filesystem/shader_loader.lua index 7afcee8..12d88bb 100644 --- a/Source/Asura.Framework/scripts/filesystem/shader_loader.lua +++ b/Source/Asura.Framework/scripts/filesystem/shader_loader.lua @@ -1,5 +1,5 @@ local loader = AsuraEngine.Loader.New("shader") function loader.OnLoad(asset) - + end
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/framework.lua b/Source/Asura.Framework/scripts/framework.lua index 5da0020..4643221 100644 --- a/Source/Asura.Framework/scripts/framework.lua +++ b/Source/Asura.Framework/scripts/framework.lua @@ -2,18 +2,18 @@ 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 + 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) diff --git a/Source/Asura.Framework/scripts/gameobject.lua b/Source/Asura.Framework/scripts/gameobject.lua index cd984ee..fb287fb 100644 --- a/Source/Asura.Framework/scripts/gameobject.lua +++ b/Source/Asura.Framework/scripts/gameobject.lua @@ -8,26 +8,26 @@ AsuraEngine.GameObject = AsuraEngine.Asset.Sub("GameObject") local GameObject = AsuraEngine.GameObject function GameObject:Ctor() - self.transform = AsuraEngine.Transform.New() - self.subentities = {} -- Sub node entities + self.transform = AsuraEngine.Transform.New() + self.subentities = {} -- Sub node entities end function GameObject:AddChild(gameobject) - table.insert(self.child, gameobject) + table.insert(self.child, gameobject) end function GameObject:AddComponent(type, name) - local cname = type - if name == nil then - cname = name - end - local component = AsuraEngine.Component.GetComponent(type) - self.components[cname] = compoennt + local cname = type + if name == nil then + cname = name + end + local component = AsuraEngine.Component.GetComponent(type) + self.components[cname] = compoennt end -- 根据组件名拿到组件 function GameObject:GetComponent(name) - return self.components[name] + return self.components[name] end -- 根据组件类型拿到组件 @@ -36,47 +36,47 @@ function GameObject:GetComponentByType(tname) end function GameObject:OnEnable() - + end function GameObject:OnEvent(e) - if self.components == nil or type(self.components) ~= "table" then - AsuraEditor.LogError("") - return - end - for name, component in self.components do - if component.OnEvent ~= nil then - component:OnEvent(e) - end - end + if self.components == nil or type(self.components) ~= "table" then + AsuraEditor.LogError("") + return + end + for name, component in self.components do + if component.OnEvent ~= nil then + component:OnEvent(e) + end + end end function GameObject:OnUpdate(dt) - for name, component in self.components do - if component.OnUpdate ~= nil then - component:OnUpdate(dt) - end - end + for name, component in self.components do + if component.OnUpdate ~= nil then + component:OnUpdate(dt) + end + end end function GameObject:OnRender() - for name, component in self.components do - if component.OnRender ~= nil then - component.OnRender() - end - end + for name, component in self.components do + if component.OnRender ~= nil then + component.OnRender() + end + end end function GameObject:OnDisable() - for name, component in self.components do - if component.OnDisable ~= nil then - component.OnDisable() - end - end + for name, component in self.components do + if component.OnDisable ~= nil then + component.OnDisable() + end + end end function GameObject:GetTrasform() - return self.transform + return self.transform end function GameObject:GetPosition() diff --git a/Source/Asura.Framework/scripts/graphics/animator.lua b/Source/Asura.Framework/scripts/graphics/animator.lua index 02f67ff..170d31f 100644 --- a/Source/Asura.Framework/scripts/graphics/animator.lua +++ b/Source/Asura.Framework/scripts/graphics/animator.lua @@ -7,17 +7,17 @@ Animator.spriteRenderer = AsuraEngine.Type.SpriteRenderer Animator.animation = AsuraEngine.Type.Animation function Animator:Ctor(gameobject, animation) - self.base(gameobject) - self.spriteRenderer = gameobject:GetSpriteRenderer() - self.animation = animation + self.base(gameobject) + self.spriteRenderer = gameobject:GetSpriteRenderer() + self.animation = animation end function Animator:SetAnimation(animation) - self.animation = animation + self.animation = animation end function Animator:GetAnimation() - return self.animation + return self.animation end function Animator:OnUpdate(dt) @@ -25,7 +25,7 @@ function Animator:OnUpdate(dt) end function Animator:OnRender() - + end return Animator
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/graphics/camera.lua b/Source/Asura.Framework/scripts/graphics/camera.lua index c8176f8..383c328 100644 --- a/Source/Asura.Framework/scripts/graphics/camera.lua +++ b/Source/Asura.Framework/scripts/graphics/camera.lua @@ -6,8 +6,8 @@ Camera.isCulling = AsuraEngine.Type.Bool Camera.isOnScreen = AsuraEngine.Type.Bool function Camera.Ctor(self) - self.isCulling = false - self.isOnScreen = false + self.isCulling = false + self.isOnScreen = false end function Camera.OnUpdate(dt) diff --git a/Source/Asura.Framework/scripts/graphics/canvas.lua b/Source/Asura.Framework/scripts/graphics/canvas.lua index 248c3ab..11e71f3 100644 --- a/Source/Asura.Framework/scripts/graphics/canvas.lua +++ b/Source/Asura.Framework/scripts/graphics/canvas.lua @@ -3,32 +3,32 @@ AsuraEngine.Canvas = AsuraEngine.Component.Sub("Canvas") local Canvas = AsuraEngine.Canvas function Canvas.Ctor(self, width, height) - self.simCanvas = AsuraEngine.SimCanvas.New(width, height) - self.width = width - self.height = height + self.simCanvas = AsuraEngine.SimCanvas.New(width, height) + self.width = width + self.height = height end function Canvas.GetWidth(self) - return self.width + return self.width end function Canvas.GetHeight(self) - return self.height + return self.height end function Canvas.GetSize(self) - return self.width, self.height + return self.width, self.height end function Canvas.OnEnable(self) - if self.simCanvas == nil then - return - end - self.simCanvas:Begin() + if self.simCanvas == nil then + return + end + self.simCanvas:Begin() end function Canvas.OnDisable(self) - + end return Canvas
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/graphics/image.lua b/Source/Asura.Framework/scripts/graphics/image.lua index c96906b..dcdb4c3 100644 --- a/Source/Asura.Framework/scripts/graphics/image.lua +++ b/Source/Asura.Framework/scripts/graphics/image.lua @@ -4,33 +4,33 @@ AsuraEngine.Image = AsuraEngine.Asset.Sub("Image") local Image = AsuraEngine.Image function Image.Ctor(self, path) - local simImage = AsuraEngine.SimImage.New(path) - local w, h = simImage:GetSize() - self.simImage = simImage - self.width = w - self.height = h + local simImage = AsuraEngine.SimImage.New(path) + local w, h = simImage:GetSize() + self.simImage = simImage + self.width = w + self.height = h end function Image.GetWidth(self) - return self.simImage.GetWidth() + return self.simImage.GetWidth() end function Image.GetHeight(self) - return self.simImage.GetHeight() + return self.simImage.GetHeight() end function Image.GetSize(self) - return self.simImage.GetSize() + return self.simImage.GetSize() end --获得x,y位置的颜色值 function Image.GetColor(self, x, y) - return self.simImage.GetColor(x, y) + return self.simImage.GetColor(x, y) end --获得所有像素,返回到一个table里 function Image.GetPixels(self) - return self.simImage:GetPixels() + return self.simImage:GetPixels() end --image不可再编辑器编辑,所以没有ToAsset方法 diff --git a/Source/Asura.Framework/scripts/graphics/material.lua b/Source/Asura.Framework/scripts/graphics/material.lua index 37d42e3..f347789 100644 --- a/Source/Asura.Framework/scripts/graphics/material.lua +++ b/Source/Asura.Framework/scripts/graphics/material.lua @@ -4,8 +4,8 @@ AsuraEngine.Material = AsuraEngine.Asset.Sub("Material") local Material = AsuraEngine.Material function Material.Ctor(self) - self.uniforms = {} --uniform变量和值 - self.isShared = false + self.uniforms = {} --uniform变量和值 + self.isShared = false end function Material.Clone(self) @@ -21,7 +21,7 @@ function Material:GetUniform(name) end function Material:SetFloat(uniform, value) - + end function Material:SetTexture(uniform, tex) diff --git a/Source/Asura.Framework/scripts/graphics/mesh2d_renderer.lua b/Source/Asura.Framework/scripts/graphics/mesh2d_renderer.lua index 67577bc..ca97283 100644 --- a/Source/Asura.Framework/scripts/graphics/mesh2d_renderer.lua +++ b/Source/Asura.Framework/scripts/graphics/mesh2d_renderer.lua @@ -3,7 +3,7 @@ AsuraEngine.Mesh2DRenderer = AsuraEngine.Renderer.Sub("Mesh2DRenderer") local Mesh2DRenderer = AsuraEngine.Mesh2DRenderer function Mesh2DRenderer.Ctor(self, material) - self.base(material) + self.base(material) end function Mesh2DRenderer.OnRender(self) diff --git a/Source/Asura.Framework/scripts/graphics/particle_system.lua b/Source/Asura.Framework/scripts/graphics/particle_system.lua index 055d1b2..a2e3c26 100644 --- a/Source/Asura.Framework/scripts/graphics/particle_system.lua +++ b/Source/Asura.Framework/scripts/graphics/particle_system.lua @@ -5,8 +5,8 @@ AsuraEngine.ParticleSystem = AsuraEngine.Component.Sub("ParticleSystem") local ParticleSystem = AsuraEngine.ParticleSystem function ParticleSystem.Ctor(self, gameobject, def) - self.base(gameobject) - self.spriteRenderer = AsuraEngine.SpriteRenderer.New() + self.base(gameobject) + self.spriteRenderer = AsuraEngine.SpriteRenderer.New() end function ParticleSystem.OnRenderer() diff --git a/Source/Asura.Framework/scripts/graphics/renderer.lua b/Source/Asura.Framework/scripts/graphics/renderer.lua index a7091b0..189c9d1 100644 --- a/Source/Asura.Framework/scripts/graphics/renderer.lua +++ b/Source/Asura.Framework/scripts/graphics/renderer.lua @@ -2,18 +2,18 @@ local Renderer = AsuraEngine.Component.Sub("Renderer") AsuraEngine.Renderer = Renderer function Renderer.Ctor(self) - self.materials = {} - self.material = nil - self.isMultiMaterials = false + self.materials = {} + self.material = nil + self.isMultiMaterials = false end --取材质,如果是shared,那么从此材质clone一个 function Renderer.GetMaterial(self) - + end function Renderer.IsMultiMaterials(self) - return self.isMultiMaterials + return self.isMultiMaterials end return Renderer
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/graphics/shader.lua b/Source/Asura.Framework/scripts/graphics/shader.lua index e427b1b..a886481 100644 --- a/Source/Asura.Framework/scripts/graphics/shader.lua +++ b/Source/Asura.Framework/scripts/graphics/shader.lua @@ -3,8 +3,8 @@ AsuraEngine.Shader = AsuraEngine.Asset.Sub("Shader") local Shader = AsuraEngine.Shader function Shader.Ctor(self, vert, frag) - local simShader = AsuraEngine.simShader(vert, frag) - self.simShader = shader + local simShader = AsuraEngine.simShader(vert, frag) + self.simShader = shader end diff --git a/Source/Asura.Framework/scripts/graphics/sprite.lua b/Source/Asura.Framework/scripts/graphics/sprite.lua index 745138e..da116fc 100644 --- a/Source/Asura.Framework/scripts/graphics/sprite.lua +++ b/Source/Asura.Framework/scripts/graphics/sprite.lua @@ -2,7 +2,7 @@ local Sprite = AsuraEngine.Asset.Sub("Sprite") AsuraEngine.Sprite = Sprite function Sprite.Ctor(self, image) - self.image = image + self.image = image end function Sprite.ToAsset(self) diff --git a/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua b/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua index 93937d7..5ceafd2 100644 --- a/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua +++ b/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua @@ -4,11 +4,11 @@ local SpriteRenderer = AsuraEngine.Renderer.Sub("Spriterenderer") AsuraEngine.SpriteRenderer = SpriteRenderer function SpriteRenderer.Ctor(self) - self.materials = {} + self.materials = {} end function SpriteRenderer:OnRender() - + end return SpriteRenderer
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/gui/widget.lua b/Source/Asura.Framework/scripts/gui/widget.lua index 7a049bd..98876e6 100644 --- a/Source/Asura.Framework/scripts/gui/widget.lua +++ b/Source/Asura.Framework/scripts/gui/widget.lua @@ -1,7 +1,7 @@ local Widget = AsuraEngine.Component("Widget") function Widget.Ctor(self) - + end function Widget.OnEvent(self, e) diff --git a/Source/Asura.Framework/scripts/managers/scene_manager.lua b/Source/Asura.Framework/scripts/managers/scene_manager.lua index 8c4e24f..7886dc6 100644 --- a/Source/Asura.Framework/scripts/managers/scene_manager.lua +++ b/Source/Asura.Framework/scripts/managers/scene_manager.lua @@ -10,7 +10,7 @@ function SceneManager.Ctor() end function SceneManager.GetSceneByGUID() - + end return SceneManager
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/path/path.lua b/Source/Asura.Framework/scripts/path/path.lua index 3b6079d..1fc9b3a 100644 --- a/Source/Asura.Framework/scripts/path/path.lua +++ b/Source/Asura.Framework/scripts/path/path.lua @@ -6,8 +6,8 @@ end -- ToAssetѶpathתΪ.assetļʽ function Path.ToAsset(path) - local builder = AsuraEngine.AssetBuilder.Get() - + local builder = AsuraEngine.AssetBuilder.Get() + end return Path
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/path/path_calculator.lua b/Source/Asura.Framework/scripts/path/path_calculator.lua index 1a564b8..d44da08 100644 --- a/Source/Asura.Framework/scripts/path/path_calculator.lua +++ b/Source/Asura.Framework/scripts/path/path_calculator.lua @@ -6,7 +6,7 @@ local PathCalculator = AsuraEngine.Component.New("PathCalculator") PathCalculator.path = AsuraEngine.Asset.Type("path", "·") function PathCalculator:ctor(path) - self.path = path + self.path = path end return PathCalculator
\ No newline at end of file diff --git a/Source/Asura.Framework/scripts/scene.lua b/Source/Asura.Framework/scripts/scene.lua index c0eaaa8..2adbf53 100644 --- a/Source/Asura.Framework/scripts/scene.lua +++ b/Source/Asura.Framework/scripts/scene.lua @@ -6,7 +6,7 @@ AsuraEngine.Scene = AsuraEngine.Asset.Sub("Scene") local Scene = AsuraEngine.Scene function Scene.Ctor(self) - self.rootGameObjects = {} --当前场景的所有root gameobject + self.rootGameObjects = {} --当前场景的所有root gameobject end --获取当前的场景 diff --git a/Source/Asura.Framework/scripts/transform.lua b/Source/Asura.Framework/scripts/transform.lua index a415921..1d34ae6 100644 --- a/Source/Asura.Framework/scripts/transform.lua +++ b/Source/Asura.Framework/scripts/transform.lua @@ -3,7 +3,11 @@ AsuraEngine.Transform = AsuraEngine.Class("Transform") local Transform = AsuraEngine.Transform function Transform.Ctor(self) - self.position = {x=0, y=0} - self.rotation = 0 - self.size = {w=0, h=0} + self.position = {x=0, y=0} + self.rotation = 0 + self.size = {w=0, h=0} end + +function Transform.Move(self) + +end
\ No newline at end of file diff --git a/Source/Samples/CursorTest/main.cpp b/Source/Samples/CursorTest/main.cpp index 803503a..f8946d9 100644 --- a/Source/Samples/CursorTest/main.cpp +++ b/Source/Samples/CursorTest/main.cpp @@ -6,5 +6,5 @@ int main(int argc, char* args[]) { - return 0; + return 0; }
\ No newline at end of file |