From d570df7decd9a4f19c66b2d2d57a54652f0f9b7e Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 19 Jan 2019 22:02:41 +0800 Subject: *misc --- Build/Asura.Engine/Asura.Engine.vcxproj | 10 +++--- Build/Asura.Engine/Asura.Engine.vcxproj.filters | 36 ++++++++++++--------- Build/Asura.Framework/Asura.Framework.vcxproj | 1 + .../Asura.Framework.vcxproj.filters | 6 ++++ "Docs/\350\256\260\345\275\225.docx" | Bin 13368 -> 14777 bytes Samples/Hello/gfx/icon.png.asr | 1 + Samples/Hello/gfx/mt_thunder.axm | 3 ++ Samples/Hello/scripts/hello.lua.asr | 3 -- Samples/Hello/scripts/hello.lua.axm | 3 ++ Samples/Hello/scripts/tiledmapimporter.lua | 7 ++++ Samples/Hello/scripts/tiledmapimporter.lua.axm | 0 Samples/Hello/shaders/sh_thunder.axm | 4 +++ Source/Asura.Engine/FileSystem/AnimationImpoter.h | 20 ------------ Source/Asura.Engine/FileSystem/Asset.h | 2 +- Source/Asura.Engine/FileSystem/ImageImpoter.h | 20 ------------ .../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 | 4 +++ .../FileSystem/ParticleSystemImpoter.h | 20 ------------ Source/Asura.Engine/FileSystem/SpriteImpoter.h | 20 ------------ Source/Asura.Framework/Filesystem/Impoter.lua | 22 +++++++++++++ Source/Asura.Framework/Graphics/Animator.lua | 7 ++-- 26 files changed, 87 insertions(+), 105 deletions(-) create mode 100644 Samples/Hello/gfx/mt_thunder.axm delete mode 100644 Samples/Hello/scripts/hello.lua.asr create mode 100644 Samples/Hello/scripts/hello.lua.axm create mode 100644 Samples/Hello/scripts/tiledmapimporter.lua create mode 100644 Samples/Hello/scripts/tiledmapimporter.lua.axm create mode 100644 Samples/Hello/shaders/sh_thunder.axm delete mode 100644 Source/Asura.Engine/FileSystem/AnimationImpoter.h delete mode 100644 Source/Asura.Engine/FileSystem/ImageImpoter.h create mode 100644 Source/Asura.Engine/FileSystem/Importer.Animation.cpp create mode 100644 Source/Asura.Engine/FileSystem/Importer.Asset.cpp create mode 100644 Source/Asura.Engine/FileSystem/Importer.Image.cpp create mode 100644 Source/Asura.Engine/FileSystem/Importer.Sprite.cpp create mode 100644 Source/Asura.Engine/FileSystem/Importer.StateMap.cpp create mode 100644 Source/Asura.Engine/FileSystem/Importer.cpp delete mode 100644 Source/Asura.Engine/FileSystem/ParticleSystemImpoter.h delete mode 100644 Source/Asura.Engine/FileSystem/SpriteImpoter.h create mode 100644 Source/Asura.Framework/Filesystem/Impoter.lua diff --git a/Build/Asura.Engine/Asura.Engine.vcxproj b/Build/Asura.Engine/Asura.Engine.vcxproj index 15cd8ea..ec7d561 100644 --- a/Build/Asura.Engine/Asura.Engine.vcxproj +++ b/Build/Asura.Engine/Asura.Engine.vcxproj @@ -122,11 +122,7 @@ - - - - @@ -171,6 +167,12 @@ + + + + + + diff --git a/Build/Asura.Engine/Asura.Engine.vcxproj.filters b/Build/Asura.Engine/Asura.Engine.vcxproj.filters index 8ead2f8..d86417b 100644 --- a/Build/Asura.Engine/Asura.Engine.vcxproj.filters +++ b/Build/Asura.Engine/Asura.Engine.vcxproj.filters @@ -167,24 +167,12 @@ Graphics - - FileSystem - - - FileSystem - - - FileSystem - - - FileSystem - - - FileSystem - AI + + FileSystem + @@ -293,5 +281,23 @@ AI + + FileSystem + + + FileSystem + + + FileSystem + + + FileSystem + + + FileSystem + + + FileSystem + \ No newline at end of file diff --git a/Build/Asura.Framework/Asura.Framework.vcxproj b/Build/Asura.Framework/Asura.Framework.vcxproj index 3d4f04a..8672930 100644 --- a/Build/Asura.Framework/Asura.Framework.vcxproj +++ b/Build/Asura.Framework/Asura.Framework.vcxproj @@ -118,6 +118,7 @@ + diff --git a/Build/Asura.Framework/Asura.Framework.vcxproj.filters b/Build/Asura.Framework/Asura.Framework.vcxproj.filters index a747f28..8284576 100644 --- a/Build/Asura.Framework/Asura.Framework.vcxproj.filters +++ b/Build/Asura.Framework/Asura.Framework.vcxproj.filters @@ -10,6 +10,9 @@ {ec999168-9049-4261-b25f-0849f622693e} + + {19d37542-9fd8-4574-9a0b-4138478cc324} + @@ -40,5 +43,8 @@ AI + + Filesystem + \ No newline at end of file diff --git "a/Docs/\350\256\260\345\275\225.docx" "b/Docs/\350\256\260\345\275\225.docx" index fbe9233..419fc1d 100644 Binary files "a/Docs/\350\256\260\345\275\225.docx" and "b/Docs/\350\256\260\345\275\225.docx" differ diff --git a/Samples/Hello/gfx/icon.png.asr b/Samples/Hello/gfx/icon.png.asr index 93d6d58..7951698 100644 --- a/Samples/Hello/gfx/icon.png.asr +++ b/Samples/Hello/gfx/icon.png.asr @@ -1,3 +1,4 @@ icon.png + 1 \ No newline at end of file diff --git a/Samples/Hello/gfx/mt_thunder.axm b/Samples/Hello/gfx/mt_thunder.axm new file mode 100644 index 0000000..a50afa1 --- /dev/null +++ b/Samples/Hello/gfx/mt_thunder.axm @@ -0,0 +1,3 @@ + + /shaders/sh_thunder + \ No newline at end of file diff --git a/Samples/Hello/scripts/hello.lua.asr b/Samples/Hello/scripts/hello.lua.asr deleted file mode 100644 index 87e3c43..0000000 --- a/Samples/Hello/scripts/hello.lua.asr +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/Samples/Hello/scripts/hello.lua.axm b/Samples/Hello/scripts/hello.lua.axm new file mode 100644 index 0000000..c1395fc --- /dev/null +++ b/Samples/Hello/scripts/hello.lua.axm @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Samples/Hello/scripts/tiledmapimporter.lua b/Samples/Hello/scripts/tiledmapimporter.lua new file mode 100644 index 0000000..244aceb --- /dev/null +++ b/Samples/Hello/scripts/tiledmapimporter.lua @@ -0,0 +1,7 @@ +local tiledMapImporter = AsuraEngine.Importer.New("tiledmap") --tiledmap是tag,表明了tiledmap +local TiledMapManager = require "TiledMapManager.lua" +function tiledMapImporter:Load( data ) + +end + +return tiledMapImporter \ No newline at end of file diff --git a/Samples/Hello/scripts/tiledmapimporter.lua.axm b/Samples/Hello/scripts/tiledmapimporter.lua.axm new file mode 100644 index 0000000..e69de29 diff --git a/Samples/Hello/shaders/sh_thunder.axm b/Samples/Hello/shaders/sh_thunder.axm new file mode 100644 index 0000000..e7ec04b --- /dev/null +++ b/Samples/Hello/shaders/sh_thunder.axm @@ -0,0 +1,4 @@ + + default.vert + thunder.frag + \ No newline at end of file diff --git a/Source/Asura.Engine/FileSystem/AnimationImpoter.h b/Source/Asura.Engine/FileSystem/AnimationImpoter.h deleted file mode 100644 index 57fdfdb..0000000 --- a/Source/Asura.Engine/FileSystem/AnimationImpoter.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __AE_IMAGE_IMPORTER_H__ -#define __AE_IMAGE_IMPORTER_H___ - -namespace AsuraEngine -{ - namespace Filesystem - { - - /// - /// 从.asr导入animation - /// - class AnimationImporter - { - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/FileSystem/Asset.h b/Source/Asura.Engine/FileSystem/Asset.h index 9fc6607..e96d36b 100644 --- a/Source/Asura.Engine/FileSystem/Asset.h +++ b/Source/Asura.Engine/FileSystem/Asset.h @@ -9,7 +9,7 @@ namespace AsuraEngine { /// - /// Asset不会作为组件。 + /// Asset不会作为组件,一个asset从文件中读取。 /// class Asset : public Object { diff --git a/Source/Asura.Engine/FileSystem/ImageImpoter.h b/Source/Asura.Engine/FileSystem/ImageImpoter.h deleted file mode 100644 index ca7cb9a..0000000 --- a/Source/Asura.Engine/FileSystem/ImageImpoter.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __AE_IMAGE_IMPORTER_H__ -#define __AE_IMAGE_IMPORTER_H___ - -namespace AsuraEngine -{ - namespace Filesystem - { - - /// - /// 从.asr导入image - /// - class ImageImporter - { - - }; - - } -} - -#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 new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/FileSystem/Importer.Asset.cpp b/Source/Asura.Engine/FileSystem/Importer.Asset.cpp new file mode 100644 index 0000000..0af7436 --- /dev/null +++ b/Source/Asura.Engine/FileSystem/Importer.Asset.cpp @@ -0,0 +1,3 @@ +#include "Importer.h" + +// 导入自定义资源 diff --git a/Source/Asura.Engine/FileSystem/Importer.Image.cpp b/Source/Asura.Engine/FileSystem/Importer.Image.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/FileSystem/Importer.Sprite.cpp b/Source/Asura.Engine/FileSystem/Importer.Sprite.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/FileSystem/Importer.StateMap.cpp b/Source/Asura.Engine/FileSystem/Importer.StateMap.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/FileSystem/Importer.cpp b/Source/Asura.Engine/FileSystem/Importer.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/FileSystem/Importer.h b/Source/Asura.Engine/FileSystem/Importer.h index b343a92..16689e9 100644 --- a/Source/Asura.Engine/FileSystem/Importer.h +++ b/Source/Asura.Engine/FileSystem/Importer.h @@ -6,6 +6,10 @@ namespace AsuraEngine namespace Filesystem { + /// + /// 把外部资源导入为Asset,存放在各自资源的manager里。区别不同的importer方法的是根据.asr文件的根tag,如果是image + /// 就用importImage导入,如果是asset就以importAsset导入。对于自定义资源,如果没有指定importer,就以asset导入。 + /// class Importer { diff --git a/Source/Asura.Engine/FileSystem/ParticleSystemImpoter.h b/Source/Asura.Engine/FileSystem/ParticleSystemImpoter.h deleted file mode 100644 index 92796f3..0000000 --- a/Source/Asura.Engine/FileSystem/ParticleSystemImpoter.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __AE_IMAGE_IMPORTER_H__ -#define __AE_IMAGE_IMPORTER_H___ - -namespace AsuraEngine -{ - namespace Filesystem - { - - /// - /// 从.asr导入particle system - /// - class ParticleSystemImporter - { - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Engine/FileSystem/SpriteImpoter.h b/Source/Asura.Engine/FileSystem/SpriteImpoter.h deleted file mode 100644 index 0e157c1..0000000 --- a/Source/Asura.Engine/FileSystem/SpriteImpoter.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __AE_IMAGE_IMPORTER_H__ -#define __AE_IMAGE_IMPORTER_H___ - -namespace AsuraEngine -{ - namespace Filesystem - { - - /// - /// 从.asr导入sprite - /// - class SpriteImporter - { - - }; - - } -} - -#endif \ No newline at end of file diff --git a/Source/Asura.Framework/Filesystem/Impoter.lua b/Source/Asura.Framework/Filesystem/Impoter.lua new file mode 100644 index 0000000..fbbd68a --- /dev/null +++ b/Source/Asura.Framework/Filesystem/Impoter.lua @@ -0,0 +1,22 @@ +--[[ +基类,自定义的资源可以通过继承此类导入。自定义的资源的标记方法: + + ./resource.maptile + +在指定了导入impoter之后,自定义的资源允许通过下列方法标记: + + ./resource.maptile + +引擎会使用对应内部资源类型的importer导入资源 + +]] + +local importer = Class() + +function importer:InnerResource( data ) + + + +end + +return importer \ No newline at end of file diff --git a/Source/Asura.Framework/Graphics/Animator.lua b/Source/Asura.Framework/Graphics/Animator.lua index eb33e49..1dca9f4 100644 --- a/Source/Asura.Framework/Graphics/Animator.lua +++ b/Source/Asura.Framework/Graphics/Animator.lua @@ -1,11 +1,14 @@ -local Animator = Class() +local Animator = Class(function(go) + self.gameobject = go + self.spriteRenderer = go:GetSpriteRenderer() +end) Animator.animation = AsuraEngine.Animation.None local animation = AsuraEngine.Animation.New() function Animator:OnUpdate(dt) - + end function Animator:OnRender() -- cgit v1.1-26-g67d0