From 6c8788ed76e1ead173fdeb51caaa43d538fcfe21 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 27 Jan 2019 01:26:36 +0800 Subject: *misc --- Source/Asura.Engine/AI/BehaviorTree.cpp | 0 Source/Asura.Engine/AI/BehaviorTree.h | 0 Source/Asura.Engine/AI/StateMachine.cpp | 0 Source/Asura.Engine/AI/StateMachine.h | 33 ---- Source/Asura.Engine/AI/StateMap.cpp | 0 Source/Asura.Engine/AI/StateMap.h | 25 --- Source/Asura.Engine/Component.cpp | 0 Source/Asura.Engine/Component.h | 43 ----- .../Asura.Engine/FileSystem/Importer.Animation.cpp | 0 Source/Asura.Engine/FileSystem/Importer.Asset.cpp | 3 - Source/Asura.Engine/FileSystem/Importer.Image.cpp | 0 Source/Asura.Engine/FileSystem/Importer.Sprite.cpp | 0 .../Asura.Engine/FileSystem/Importer.StateMap.cpp | 0 Source/Asura.Engine/FileSystem/Importer.cpp | 0 Source/Asura.Engine/FileSystem/Importer.h | 21 --- Source/Asura.Engine/GameObject.cpp | 11 -- Source/Asura.Engine/GameObject.h | 56 ------ Source/Asura.Engine/Graphics/Animation.cpp | 21 --- Source/Asura.Engine/Graphics/Animation.h | 128 -------------- Source/Asura.Engine/Graphics/Animator.cpp | 0 Source/Asura.Engine/Graphics/Animator.h | 96 ----------- Source/Asura.Engine/Graphics/Camera.cpp | 0 Source/Asura.Engine/Graphics/Camera.h | 42 ----- Source/Asura.Engine/Graphics/CanvasRenderer.cpp | 0 Source/Asura.Engine/Graphics/CanvasRenderer.h | 30 ---- Source/Asura.Engine/Graphics/Image.h | 1 + Source/Asura.Engine/Graphics/Material.cpp | 18 -- Source/Asura.Engine/Graphics/Material.h | 189 --------------------- Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp | 0 Source/Asura.Engine/Graphics/Mesh2DRenderer.h | 19 --- Source/Asura.Engine/Graphics/ParticleSystem.cpp | 0 Source/Asura.Engine/Graphics/ParticleSystem.h | 22 --- Source/Asura.Engine/Graphics/Prefab.cpp | 0 Source/Asura.Engine/Graphics/Prefab.h | 30 ---- Source/Asura.Engine/Graphics/Renderer.cpp | 0 Source/Asura.Engine/Graphics/Renderer.h | 39 ----- Source/Asura.Engine/Graphics/ShapeRenderer.cpp | 0 Source/Asura.Engine/Graphics/ShapeRenderer.h | 0 Source/Asura.Engine/Graphics/Sprite.cpp | 0 Source/Asura.Engine/Graphics/Sprite.h | 71 -------- Source/Asura.Engine/Graphics/SpriteRenderer.cpp | 0 Source/Asura.Engine/Graphics/SpriteRenderer.h | 32 ---- Source/Asura.Engine/Graphics/Window.h | 7 +- Source/Asura.Engine/Layer.cpp | 0 Source/Asura.Engine/Layer.h | 0 Source/Asura.Engine/ObjectPool.cpp | 0 Source/Asura.Engine/ObjectPool.h | 14 -- Source/Asura.Engine/Scene.cpp | 0 Source/Asura.Engine/Scene.h | 28 --- Source/Asura.Engine/Transform.cpp | 0 Source/Asura.Engine/Transform.h | 24 --- 51 files changed, 7 insertions(+), 996 deletions(-) delete mode 100644 Source/Asura.Engine/AI/BehaviorTree.cpp delete mode 100644 Source/Asura.Engine/AI/BehaviorTree.h delete mode 100644 Source/Asura.Engine/AI/StateMachine.cpp delete mode 100644 Source/Asura.Engine/AI/StateMachine.h delete mode 100644 Source/Asura.Engine/AI/StateMap.cpp delete mode 100644 Source/Asura.Engine/AI/StateMap.h delete mode 100644 Source/Asura.Engine/Component.cpp delete mode 100644 Source/Asura.Engine/Component.h delete mode 100644 Source/Asura.Engine/FileSystem/Importer.Animation.cpp delete mode 100644 Source/Asura.Engine/FileSystem/Importer.Asset.cpp delete mode 100644 Source/Asura.Engine/FileSystem/Importer.Image.cpp delete mode 100644 Source/Asura.Engine/FileSystem/Importer.Sprite.cpp delete mode 100644 Source/Asura.Engine/FileSystem/Importer.StateMap.cpp delete mode 100644 Source/Asura.Engine/FileSystem/Importer.cpp delete mode 100644 Source/Asura.Engine/FileSystem/Importer.h delete mode 100644 Source/Asura.Engine/GameObject.cpp delete mode 100644 Source/Asura.Engine/GameObject.h delete mode 100644 Source/Asura.Engine/Graphics/Animation.cpp delete mode 100644 Source/Asura.Engine/Graphics/Animation.h delete mode 100644 Source/Asura.Engine/Graphics/Animator.cpp delete mode 100644 Source/Asura.Engine/Graphics/Animator.h delete mode 100644 Source/Asura.Engine/Graphics/Camera.cpp delete mode 100644 Source/Asura.Engine/Graphics/Camera.h delete mode 100644 Source/Asura.Engine/Graphics/CanvasRenderer.cpp delete mode 100644 Source/Asura.Engine/Graphics/CanvasRenderer.h delete mode 100644 Source/Asura.Engine/Graphics/Material.cpp delete mode 100644 Source/Asura.Engine/Graphics/Material.h delete mode 100644 Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp delete mode 100644 Source/Asura.Engine/Graphics/Mesh2DRenderer.h delete mode 100644 Source/Asura.Engine/Graphics/ParticleSystem.cpp delete mode 100644 Source/Asura.Engine/Graphics/ParticleSystem.h delete mode 100644 Source/Asura.Engine/Graphics/Prefab.cpp delete mode 100644 Source/Asura.Engine/Graphics/Prefab.h delete mode 100644 Source/Asura.Engine/Graphics/Renderer.cpp delete mode 100644 Source/Asura.Engine/Graphics/Renderer.h delete mode 100644 Source/Asura.Engine/Graphics/ShapeRenderer.cpp delete mode 100644 Source/Asura.Engine/Graphics/ShapeRenderer.h delete mode 100644 Source/Asura.Engine/Graphics/Sprite.cpp delete mode 100644 Source/Asura.Engine/Graphics/Sprite.h delete mode 100644 Source/Asura.Engine/Graphics/SpriteRenderer.cpp delete mode 100644 Source/Asura.Engine/Graphics/SpriteRenderer.h delete mode 100644 Source/Asura.Engine/Layer.cpp delete mode 100644 Source/Asura.Engine/Layer.h delete mode 100644 Source/Asura.Engine/ObjectPool.cpp delete mode 100644 Source/Asura.Engine/ObjectPool.h delete mode 100644 Source/Asura.Engine/Scene.cpp delete mode 100644 Source/Asura.Engine/Scene.h delete mode 100644 Source/Asura.Engine/Transform.cpp delete mode 100644 Source/Asura.Engine/Transform.h (limited to 'Source/Asura.Engine') diff --git a/Source/Asura.Engine/AI/BehaviorTree.cpp b/Source/Asura.Engine/AI/BehaviorTree.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/AI/BehaviorTree.h b/Source/Asura.Engine/AI/BehaviorTree.h deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/AI/StateMachine.cpp b/Source/Asura.Engine/AI/StateMachine.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/AI/StateMachine.h b/Source/Asura.Engine/AI/StateMachine.h deleted file mode 100644 index 17f8945..0000000 --- a/Source/Asura.Engine/AI/StateMachine.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __AE_STATEMACHINE_H__ -#define __AE_STATEMACHINE_H__ - -#include "StateMap.h" -#include "Component.h" - -namespace AsuraEngine -{ - namespace AI - { - - /// - /// 作为state map的代理 - /// - class StateMachine : public Component - { - public: - - - - private: - - /// - /// Statemachine 所使用的state图 - /// - StateMap* mStateMap; - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/AI/StateMap.cpp b/Source/Asura.Engine/AI/StateMap.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/AI/StateMap.h b/Source/Asura.Engine/AI/StateMap.h deleted file mode 100644 index 873e1d9..0000000 --- a/Source/Asura.Engine/AI/StateMap.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __AE_STATEMAP_H__ -#define __AE_STATEMAP_H__ - -#include "Filesystem/Asset.h" - -namespace AsuraEngine -{ - namespace AI - { - - class StateMap : public Filesystem::Asset - { - public: - - - private: - - - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Component.cpp b/Source/Asura.Engine/Component.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Component.h b/Source/Asura.Engine/Component.h deleted file mode 100644 index 807bbba..0000000 --- a/Source/Asura.Engine/Component.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __AE_COMPONENT_H__ -#define __AE_COMPONENT_H__ - -#include "GameObject.h" - -namespace AsuraEngine -{ - - class GameObject; - - /// - /// Component通过代码或者prefab附加在GameObject上。 - /// - class Component : public Object - { - public: - - virtual void OnEnable(); - virtual void OnEvent(); - virtual void OnUpdate(uint32 milliseconds); - virtual void OnRender(); - virtual void OnDisable(); - - protected: - - enum class EnableCallback - { - OnEnable = 1, - OnEvent = 1 << 1, - OnUpdate = 1 << 2, - OnRender = 1 << 3, - OnDisable = 1 << 4, - }; - - EnableCallback mEnabledCallbacks; - - GameObject* mGameObject; - - }; - -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/FileSystem/Importer.Animation.cpp b/Source/Asura.Engine/FileSystem/Importer.Animation.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/FileSystem/Importer.Asset.cpp b/Source/Asura.Engine/FileSystem/Importer.Asset.cpp deleted file mode 100644 index 0af7436..0000000 --- a/Source/Asura.Engine/FileSystem/Importer.Asset.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "Importer.h" - -// 导入自定义资源 diff --git a/Source/Asura.Engine/FileSystem/Importer.Image.cpp b/Source/Asura.Engine/FileSystem/Importer.Image.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/FileSystem/Importer.Sprite.cpp b/Source/Asura.Engine/FileSystem/Importer.Sprite.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/FileSystem/Importer.StateMap.cpp b/Source/Asura.Engine/FileSystem/Importer.StateMap.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/FileSystem/Importer.cpp b/Source/Asura.Engine/FileSystem/Importer.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/FileSystem/Importer.h b/Source/Asura.Engine/FileSystem/Importer.h deleted file mode 100644 index 16689e9..0000000 --- a/Source/Asura.Engine/FileSystem/Importer.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __AE_IMPORTER_H__ -#define __AE_IMPORTER_H__ - -namespace AsuraEngine -{ - namespace Filesystem - { - - /// - /// 把外部资源导入为Asset,存放在各自资源的manager里。区别不同的importer方法的是根据.asr文件的根tag,如果是image - /// 就用importImage导入,如果是asset就以importAsset导入。对于自定义资源,如果没有指定importer,就以asset导入。 - /// - class Importer - { - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/GameObject.cpp b/Source/Asura.Engine/GameObject.cpp deleted file mode 100644 index 322f798..0000000 --- a/Source/Asura.Engine/GameObject.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "GameObject.h" - -namespace AsuraEngine -{ - - void GameObject::OnUpdate(uint32 milliseconds) - { - - } - -} diff --git a/Source/Asura.Engine/GameObject.h b/Source/Asura.Engine/GameObject.h deleted file mode 100644 index 85dc87f..0000000 --- a/Source/Asura.Engine/GameObject.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __AE_GAMEOBJECT_H__ -#define __AE_GAMEOBJECT_H__ - -#include "./Containers/Vector.hpp" -#include "./Math/Vector2.h" - -#include "Object.h" -#include "Component.h" -#include "Transform.h" -#include "Manager.hpp" - -namespace AsuraEngine -{ - - /// - /// 游戏实体,由引擎管理。 - /// - class GameObject final : public Object - { - public: - - // 场景的回调函数 - - void OnEnable(); - void OnEvent(); - void OnUpdate(uint32 milliseconds); - void OnRender(); - void OnDisable(); - - // 设置transform,组件可以通过下列函数修改GameObject的位置、缩放和旋转 - - const Transform& GetTransform(); - const Math::Vector2& GetPosition(); - const Math::Vector2& GetScale(); - const Math::Vector2& GetRotation(); - void SetTransform(const Transform& transform); - void SetPosition(const Math::Vector2& position); - void SetScale(const Math::Vector2& scale); - void SetRotation(const Math::Vector2& rotation); - - template - inline T GetComponent() - { - return NULL; - } - - private: - - Transform mTransform; - Containers::Vector mComponents; - - }; - -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Animation.cpp b/Source/Asura.Engine/Graphics/Animation.cpp deleted file mode 100644 index 47643aa..0000000 --- a/Source/Asura.Engine/Graphics/Animation.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "Animation.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - void Animation::OnEnable() - { - mSpriteRenderer = mGameObject->GetComponent(); - } - - void Animation::OnUpdate(uint32 milliseconds) - { - if (!mSpriteRenderer) - return; - mSpriteRenderer->SetSprite(NULL); - } - - } -} diff --git a/Source/Asura.Engine/Graphics/Animation.h b/Source/Asura.Engine/Graphics/Animation.h deleted file mode 100644 index 391da22..0000000 --- a/Source/Asura.Engine/Graphics/Animation.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef __AE_ANIMATION_H__ -#define __AE_ANIMATION_H__ - -#include "Sprite.h" -#include "Component.h" -#include "Manager.hpp" -#include "SpriteRenderer.h" -#include "Containers/Map.h" -#include "Containers/Vector.hpp" -#include "Containers/StringMap.hpp" -#include "Filesystem/Asset.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// 关键帧 - /// - struct Frame - { - uint mask; // - float time; - Sprite* sprite; - }; - - /// - /// Sprite动画,可以改变的有sprite的大小、旋转、缩放、image。Animation通过animator修改。 - /// - class Animation final : public Filesystem::Asset - { - public: - - enum UpdateMask - { - Scale = 1, - Position = 1 << 1, - Rotation = 1 << 2, - Sprite = 1 << 3 - }; - - struct Definition - { - - }; - - /// - /// 根据时间获得一帧 - /// - Frame GetFrame(float t); - - /// - /// 获得关键帧数量 - /// - uint GetKeyFrameCount(); - - /// - /// 是否循环 - /// - uint GetLoop(); - - /// - /// 获取总时间 - /// - uint GetDuration(); - - private: - - /// - /// 关键帧 - /// - Containers::Vector mFrames; - - /// - /// 总时长 - /// - float mDuration; - - /// - /// 是否循环 - /// - bool mLoop; - - /// - /// ID - /// - uint mID; - - UpdateMask mUpdateMask; - - }; - - class AnimationManager : public Manager - { - public: - - Containers::String GetAnimationName(uint ID); - - uint GetAnimationID(const Containers::String& name); - - Animation* GetAnimation(uint ID); - - Animation* GetAnimation(const Containers::String& name); - - /// - /// 添加动画并返回ID - /// - uint AddAnimation(Animation* animation); - - private: - - /// - /// 映射ID到animation - /// - Containers::StringMap mAnimationIDs; - - /// - /// 映射key到animation - /// - Containers::Map mAnimations; - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Animator.cpp b/Source/Asura.Engine/Graphics/Animator.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/Animator.h b/Source/Asura.Engine/Graphics/Animator.h deleted file mode 100644 index 4d3d269..0000000 --- a/Source/Asura.Engine/Graphics/Animator.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __AE_ANIMATOR_H__ -#define __AE_ANIMATOR_H__ - -#include "Component.h" -#include "Animation.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// 控制animation的组件,主要是作为animation的代理 - /// - class Animator final : public Component - { - public: - - void OnEnable() override; - void OnUpdate(uint32 milliseconds) override; - - /// - /// 设置animation - /// - void SetAnimation(uint ID); - - /// - /// 设置animation - /// - void SetAnimation(Animation* animation); - - /// - /// 根据设置animation状态 - /// - void SetTime(float time); - - /// - /// 修改播放速度 - /// - void SetSpeed(float speed); - - /// - /// 设置是否循环 - /// - void SetLoop(bool isloop); - - /// - /// 根据关键帧修改animation - /// - void SetKeyFrame(uint keyFrame); - - /// - /// 设置到结束 - /// - void SetToBegin(); - - /// - /// 设置到开始 - /// - void SetToEnd(); - - /// - /// 暂停 - /// - void Pause(); - - private: - - /// - /// 当前的animation - /// - Animation* mAnimation; - - /// - /// Animation要求物体必须有一个sprite renderer组件 - /// - SpriteRenderer* mSpriteRenderer; - - /// - /// 播放速度,默认为1,dt = mSpeed * DELTA_TIME - /// - float mSpeed; - - /// - /// 当前执行的时间 - /// - float mTime; - - bool mLoop; - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Camera.cpp b/Source/Asura.Engine/Graphics/Camera.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/Camera.h b/Source/Asura.Engine/Graphics/Camera.h deleted file mode 100644 index 699d342..0000000 --- a/Source/Asura.Engine/Graphics/Camera.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef __AE_CAMERA_H__ -#define __AE_CAMERA_H__ - -#include "RenderTarget.h" -#include "Component.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// Orthographic Camera. - /// - class Camera : public Component - { - public: - - - private: - - /// - /// 渲染的目标 - /// - RenderTarget* mRenderTarget; - - /// - /// 是否渲染到屏幕上 - /// - bool mIsOnScreen; - - /// - /// 裁剪 - /// - bool mIsCulling; - - }; - - } -} - -#endif diff --git a/Source/Asura.Engine/Graphics/CanvasRenderer.cpp b/Source/Asura.Engine/Graphics/CanvasRenderer.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/CanvasRenderer.h b/Source/Asura.Engine/Graphics/CanvasRenderer.h deleted file mode 100644 index ef188a5..0000000 --- a/Source/Asura.Engine/Graphics/CanvasRenderer.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __AE_CANVAS_RENDERER_H__ -#define __AE_CANVAS_RENDERER_H__ - -#include "Canvas.h" -#include "Renderer.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class CanvasRenderer : public Renderer - { - public: - - void SetCanvas(Canvas* canvas); - Canvas* GetCanvas(); - - void SetBlendMode(); - - private: - - Canvas * mCanvas; - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Image.h b/Source/Asura.Engine/Graphics/Image.h index 5b27079..fc013e3 100644 --- a/Source/Asura.Engine/Graphics/Image.h +++ b/Source/Asura.Engine/Graphics/Image.h @@ -1,6 +1,7 @@ #ifndef __AE_IMAGE_H__ #define __AE_IMAGE_H__ +#include "Containers/String.h" #include "Math/Vector2.h" #include "Manager.hpp" #include "Texture.h" diff --git a/Source/Asura.Engine/Graphics/Material.cpp b/Source/Asura.Engine/Graphics/Material.cpp deleted file mode 100644 index eaf9742..0000000 --- a/Source/Asura.Engine/Graphics/Material.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "Material.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - - - //-------------------------------------------------------------------------------------------------------- - - int Material::l_SetColor(lua_State* L) - { - - } - - } -} diff --git a/Source/Asura.Engine/Graphics/Material.h b/Source/Asura.Engine/Graphics/Material.h deleted file mode 100644 index 68dfa1e..0000000 --- a/Source/Asura.Engine/Graphics/Material.h +++ /dev/null @@ -1,189 +0,0 @@ -#ifndef __AE_MATERIAL_H__ -#define __AE_MATERIAL_H__ - -#include "Containers/Vector.hpp" -#include "Containers/String.h" -#include "Math/Vector2.h" -#include "Math/Vector3.h" -#include "Math/Vector4.h" -#include "Math/Matrix44.h" -#include "Scripting/Luax.hpp" - -#include "Shader.h" -#include "Texture.h" -#include "Manager.hpp" - -namespace AsuraEngine -{ - namespace Graphics - { - - class MaterialFactory; - - /// - /// 通过材质调整Shader中的uniforms变量。Shader将可以修改的变量暴露给material,每个材质可以差异化配置相同着色器的 - /// 不同参数,通过数据文件(.mat)实现,而不是在代码里配置。所以在Asura中,Shader无法直接应用到渲染流程而必须和一个 - /// 材质关联,由材质修改shader的uniforms,material充当了shader的代理。 - /// - class Material final : public Filesystem::Asset - { - public: - - enum class UniformsType - { - None = 0, - Float, - Int, - Vector2, - Vector3, - Vector4, - Matrix44, - Texture, - Color, - }; - - struct UniformsInfo - { - uint ID; // uniform变量的ID - UniformsType type; // uniform变量的类型 - union - { - float f; - int i; - Math::Vector2 v2; - Math::Vector3 v3; - Math::Vector4 v4; - Math::Matrix44 m44; - Texture* tex; - Color col; - }value; // uniform变量的值 - }; - - void SetShader(Shader* shader); - - // 设置Uniform变量,保存在材质中,渲染时上传到GPU - - /// - /// 获得uniform变量的ID,ID和name的map在shader间共享。设置uniform变量的值时,通过ID查询uniform变量名,在 - /// shader中找到uniform location并对这个location赋值。 - /// - static int GetUniformID(const Containers::String& name); - - void SetTexture(uint ID, Texture* texture); - void SetVector2(uint ID, Math::Vector2* vector2); - void SetVector3(uint ID, Math::Vector3* vector3); - void SetVector4(uint ID, Math::Vector4* vector4); - void SetMatrix44(uint ID, Math::Matrix44* matrix44); - void SetFloat(uint ID, float value); - void SetInteger(uint ID, int value); - void SetColor(uint ID, Color color); - - UniformsInfo GetUniformInfo(uint ID); - float GetUniformInfof(uint ID); - int GetUniformInfoi(uint ID); - Math::Vector2 GetUniformInfov2(uint ID); - Math::Vector3 GetUniformInfov3(uint ID); - Math::Vector4 GetUniformInfov4(uint ID); - Math::Matrix44 GetUniformInfom44(uint ID); - Texture* GetUniformInfotex(uint ID); - Color GetUniformInfocol(uint ID); - - // 上传顶点数据 - - void SetVertexAttributes(); - - private: - - friend class MaterialFactory; - - Material(); - Material(const Material& src); - ~Material(); - - /// - /// - /// - uint mID; - - /// - /// - /// - Shader* mShader; - - /// - /// Uniforms变量的值,映射ID到值 - /// - Containers::Map mUniforms; - - /// - /// 是否是共享的材质 - /// - bool mIsShared; - - //---------------------------------------------------------------------------------------------------- - - LUAX_DECL_FACTORY(Material); - - LUAX_DECL_METHOD(l_Clone); - - LUAX_DECL_METHOD(l_SetShader); - - LUAX_DECL_METHOD(l_SetTexture); - LUAX_DECL_METHOD(l_SetVector2); - LUAX_DECL_METHOD(l_SetVector3); - LUAX_DECL_METHOD(l_SetVector4); - LUAX_DECL_METHOD(l_SetMatrix44); - LUAX_DECL_METHOD(l_SetFloat); - LUAX_DECL_METHOD(l_SetInteger); - LUAX_DECL_METHOD(l_SetColor); - - LUAX_DECL_METHOD(l_GetUniformInfo); - LUAX_DECL_METHOD(l_GetUniformInfof); - LUAX_DECL_METHOD(l_GetUniformInfoi); - LUAX_DECL_METHOD(l_GetUniformInfov2); - LUAX_DECL_METHOD(l_GetUniformInfov3); - LUAX_DECL_METHOD(l_GetUniformInfov4); - LUAX_DECL_METHOD(l_GetUniformInfom44); - LUAX_DECL_METHOD(l_GetUniformInfotex); - LUAX_DECL_METHOD(l_GetUniformInfocol); - - LUAX_DECL_METHOD(l_SetVertexAttributes); - - }; - - class MaterialManager : public Manager - { - public: - - private: - - /// - /// 所有的image - /// - Containers::Map mMaterials; - - /// - /// image,路径和ID的映射。针对从.asr导入的image,通过路径可以拿到image。所以并不是所有的image都在此map中。 - /// 由程序创建的image只能通过ID来获取,所以程序中需要保留ID。 - /// - Containers::StringMap mMaterialIDs; - - }; - - class MaterialFactory : public Factory - { - public: - - /// - /// 拷贝一个material - /// - Material* Clone(Material* src); - - Material* Create(); - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp b/Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/Mesh2DRenderer.h b/Source/Asura.Engine/Graphics/Mesh2DRenderer.h deleted file mode 100644 index fcbfd2c..0000000 --- a/Source/Asura.Engine/Graphics/Mesh2DRenderer.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __AE_MESH2D_H__ -#define __AE_MESH2D_H__ - -#include "FileSystem/Asset.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class Mesh2D : public Filesystem::Asset - { - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/ParticleSystem.cpp b/Source/Asura.Engine/Graphics/ParticleSystem.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/ParticleSystem.h b/Source/Asura.Engine/Graphics/ParticleSystem.h deleted file mode 100644 index 078427a..0000000 --- a/Source/Asura.Engine/Graphics/ParticleSystem.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __AE_PARTICLESYSTEM_H__ -#define __AE_PARTICLESYSTEM_H__ - -#include "Component.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// 粒子系统 - /// - class ParticleSystem final : public Component - { - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Prefab.cpp b/Source/Asura.Engine/Graphics/Prefab.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/Prefab.h b/Source/Asura.Engine/Graphics/Prefab.h deleted file mode 100644 index 82a8da2..0000000 --- a/Source/Asura.Engine/Graphics/Prefab.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __AE_PREFAB_H__ -#define __AE_PREFAB_H__ - -#include "Manager.hpp" -#include "FileSystem/Asset.h" - -namespace AsuraEngine -{ - - /// - /// Prefab用来构建GameObject - /// - class Prefab : public Filesystem::Asset - { - - }; - - class PrefabManager : public Manager - { - - }; - - class PrefabFactory - { - - }; - -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Renderer.cpp b/Source/Asura.Engine/Graphics/Renderer.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/Renderer.h b/Source/Asura.Engine/Graphics/Renderer.h deleted file mode 100644 index c3677a7..0000000 --- a/Source/Asura.Engine/Graphics/Renderer.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __AE_RENDERER_H__ -#define __AE_RENDERER_H__ - -#include "Component.h" -#include "Material.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// 抽象基类,渲染由Renderer类处理,每个Renderer必须具备一个材质。 - /// - class Renderer : public Component - { - public: - - /// - /// 一旦调用此方法,就会拷贝shared material,调用此方法意味着要对material的配置进行修改,如果此时使用的材质是 - /// shared material,则需要拷贝一份,避免影响其他共享的renderer。 - /// - Material* GetMaterial(); - - /// - /// 渲染回调函数 - /// - virtual void OnRender() = 0; - - protected: - - Material* mMaterial; - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/ShapeRenderer.cpp b/Source/Asura.Engine/Graphics/ShapeRenderer.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/ShapeRenderer.h b/Source/Asura.Engine/Graphics/ShapeRenderer.h deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/Sprite.cpp b/Source/Asura.Engine/Graphics/Sprite.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/Sprite.h b/Source/Asura.Engine/Graphics/Sprite.h deleted file mode 100644 index b621f1b..0000000 --- a/Source/Asura.Engine/Graphics/Sprite.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __AE_SPRITE_H__ -#define __AE_SPRITE_H__ - -#include "Math/Vector2.h" -#include "Transform.h" -#include "Component.h" -#include "Image.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// Sprite是控制image的代理,image是在sprite间共享的数据,sprite可以区别化处理image的属性,如旋转,缩放等。 - /// - class Sprite final : public Filesystem::Asset - { - public: - - enum Type - { - - }; - - /// - /// 对齐方式 - /// - enum Align - { - - }; - - struct SpriteDef - { - Image* image; - Align align; - Math::Vector2 anchor; - Math::Vector2 size; - }; - - Sprite(SpriteDef definition); - ~Sprite(); - - private: - - /// - /// 锚点坐标 - /// - Math::Vector2 mAnchor; - - /// - /// 大小 - /// - Math::Vector2 mSize; - - /// - /// 绑定的image - /// - Image* mImage; - - //---------------------------------------------------------------------------------------------------- - - - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/SpriteRenderer.cpp b/Source/Asura.Engine/Graphics/SpriteRenderer.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Graphics/SpriteRenderer.h b/Source/Asura.Engine/Graphics/SpriteRenderer.h deleted file mode 100644 index bd81509..0000000 --- a/Source/Asura.Engine/Graphics/SpriteRenderer.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __AE_SPRITE_RENDERER_H__ -#define __AE_SPRITE_RENDERER_H__ - -#include "Renderer.h" -#include "Sprite.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class SpriteRenderer final : public Renderer - { - public: - - void SetSprite(Sprite* sprite); - - void OnRender() override; - - private: - - /// - /// 用来渲染的sprite - /// - Sprite* mSprite; - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Window.h b/Source/Asura.Engine/Graphics/Window.h index 1707e3d..ab612fc 100644 --- a/Source/Asura.Engine/Graphics/Window.h +++ b/Source/Asura.Engine/Graphics/Window.h @@ -7,10 +7,15 @@ namespace AsuraEngine { /// - /// 游戏窗口 + /// 窗口,支持多窗口。在编辑器下需要多个窗口支持,runner只需要一个窗口。 /// class Window { + public: + + + private: + }; diff --git a/Source/Asura.Engine/Layer.cpp b/Source/Asura.Engine/Layer.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Layer.h b/Source/Asura.Engine/Layer.h deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/ObjectPool.cpp b/Source/Asura.Engine/ObjectPool.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/ObjectPool.h b/Source/Asura.Engine/ObjectPool.h deleted file mode 100644 index bf97858..0000000 --- a/Source/Asura.Engine/ObjectPool.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __AE_OBJECT_POOL_H__ -#define __AE_OBJECT_POOL_H__ - -namespace AsuraEngine -{ - - class ObjectPool - { - - }; - -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Scene.cpp b/Source/Asura.Engine/Scene.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Scene.h b/Source/Asura.Engine/Scene.h deleted file mode 100644 index 742d872..0000000 --- a/Source/Asura.Engine/Scene.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __AE_SCENE_H__ -#define __AE_SCENE_H__ - -#include "FileSystem/Asset.h" -#include "Containers/Vector.hpp" -#include "GameObject.h" - -namespace AsuraEngine -{ - - /// - /// 游戏场景 - /// - class Scene final : public Filesystem::Asset - { - public: - - // - - private: - - Containers::Vector mGameObjects; - - }; - -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/Transform.cpp b/Source/Asura.Engine/Transform.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/Transform.h b/Source/Asura.Engine/Transform.h deleted file mode 100644 index cca7575..0000000 --- a/Source/Asura.Engine/Transform.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __AE_TRANSFORM_H__ -#define __AE_TRANSFORM_H__ - -#include "Object.h" -#include "Math/Vector2.h" - -namespace AsuraEngine -{ - - /// - /// Transform作为基本属性,不作为组件处理 - /// - class Transform final : public Object - { - private: - Math::Vector2 position; - Math::Vector2 rotation; - Math::Vector2 scale; - - }; - -} - -#endif \ No newline at end of file -- cgit v1.1-26-g67d0