From 922495098aea1ca569369da664dddb9780d07768 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 19 Oct 2021 19:52:29 +0800 Subject: *misc --- .../Libraries/Framework/Animation/Animation.lua | 0 .../DefaultContent/Libraries/Framework/Class.lua | 3 --- .../Libraries/Framework/Core/Camera.lua | 5 ----- .../Libraries/Framework/Core/Component.lua | 11 ----------- .../Libraries/Framework/Core/Game.lua | 14 ------------- .../Libraries/Framework/Core/GameObject.lua | 7 ------- .../Libraries/Framework/Core/Sprite.lua | 21 -------------------- .../Libraries/Framework/Math/Matrix44.lua | 7 ------- .../Libraries/Framework/Math/Quaternion.lua | 0 .../Libraries/Framework/Math/Vector2.lua | 0 .../Libraries/Framework/Math/Vector3.lua | 0 .../Libraries/Framework/Math/Vector4.lua | 0 .../Libraries/Framework/Utils/EventCenter.lua | 23 ---------------------- .../Libraries/Framework/Utils/StateMachine.lua | 0 .../Libraries/Framework/Utils/Util.lua | 0 .../DefaultContent/Libraries/Framework/init.lua | 2 -- .../DefaultContent/Libraries/GameLab/Class.lua | 5 +++++ .../GameLab/Engine/Animation/Animation.lua | 0 .../Libraries/GameLab/Engine/Core/Camera.lua | 5 +++++ .../Libraries/GameLab/Engine/Core/Component.lua | 11 +++++++++++ .../Libraries/GameLab/Engine/Core/Game.lua | 14 +++++++++++++ .../Libraries/GameLab/Engine/Core/GameObject.lua | 7 +++++++ .../Libraries/GameLab/Engine/Core/Sprite.lua | 21 ++++++++++++++++++++ .../Libraries/GameLab/Engine/Math/Euler.lua | 0 .../Libraries/GameLab/Engine/Math/Matrix44.lua | 7 +++++++ .../Libraries/GameLab/Engine/Math/Matrix4x4.lua | 0 .../Libraries/GameLab/Engine/Math/Quaternion.lua | 4 ++++ .../Libraries/GameLab/Engine/Math/Vector2.lua | 0 .../Libraries/GameLab/Engine/Math/Vector3.lua | 0 .../Libraries/GameLab/Engine/Math/Vector4.lua | 0 .../Libraries/GameLab/Engine/Math/init.lua | 4 ++++ .../Libraries/GameLab/Engine/Utils/EventCenter.lua | 23 ++++++++++++++++++++++ .../GameLab/Engine/Utils/StateMachine.lua | 0 .../Libraries/GameLab/Engine/Utils/Util.lua | 0 Resources/DefaultContent/Scripts/Math/Euler.lua | 0 .../DefaultContent/Scripts/Math/Matrix4x4.lua | 0 .../DefaultContent/Scripts/Math/Quaternion.lua | 4 ---- Resources/DefaultContent/Scripts/Math/Vector2.lua | 0 Resources/DefaultContent/Scripts/Math/Vector3.lua | 0 Resources/Scripts/EditorApplication.lua | 7 +++++-- Resources/boot.lua | 18 +++++++++++++++++ 41 files changed, 124 insertions(+), 99 deletions(-) delete mode 100644 Resources/DefaultContent/Libraries/Framework/Animation/Animation.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Class.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Core/Camera.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Core/Component.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Core/Game.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Core/GameObject.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Core/Sprite.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Math/Matrix44.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Math/Quaternion.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Math/Vector2.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Math/Vector3.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Math/Vector4.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Utils/EventCenter.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Utils/StateMachine.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/Utils/Util.lua delete mode 100644 Resources/DefaultContent/Libraries/Framework/init.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Class.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Animation/Animation.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Core/Camera.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Core/Component.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Core/Game.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Core/GameObject.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Core/Sprite.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Math/Euler.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Math/Matrix44.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Math/Matrix4x4.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Math/Quaternion.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector2.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector3.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector4.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Math/init.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Utils/EventCenter.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Utils/StateMachine.lua create mode 100644 Resources/DefaultContent/Libraries/GameLab/Engine/Utils/Util.lua delete mode 100644 Resources/DefaultContent/Scripts/Math/Euler.lua delete mode 100644 Resources/DefaultContent/Scripts/Math/Matrix4x4.lua delete mode 100644 Resources/DefaultContent/Scripts/Math/Quaternion.lua delete mode 100644 Resources/DefaultContent/Scripts/Math/Vector2.lua delete mode 100644 Resources/DefaultContent/Scripts/Math/Vector3.lua create mode 100644 Resources/boot.lua (limited to 'Resources') diff --git a/Resources/DefaultContent/Libraries/Framework/Animation/Animation.lua b/Resources/DefaultContent/Libraries/Framework/Animation/Animation.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Libraries/Framework/Class.lua b/Resources/DefaultContent/Libraries/Framework/Class.lua deleted file mode 100644 index 78c577c..0000000 --- a/Resources/DefaultContent/Libraries/Framework/Class.lua +++ /dev/null @@ -1,3 +0,0 @@ -function Class() - -end \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/Framework/Core/Camera.lua b/Resources/DefaultContent/Libraries/Framework/Core/Camera.lua deleted file mode 100644 index 5fcfbe7..0000000 --- a/Resources/DefaultContent/Libraries/Framework/Core/Camera.lua +++ /dev/null @@ -1,5 +0,0 @@ -local Camera = {} - - - -return Camera \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/Framework/Core/Component.lua b/Resources/DefaultContent/Libraries/Framework/Core/Component.lua deleted file mode 100644 index 00bf2ca..0000000 --- a/Resources/DefaultContent/Libraries/Framework/Core/Component.lua +++ /dev/null @@ -1,11 +0,0 @@ -local Component = {} - -Component.New = function() - -end - -Component.GetGameObject = function() - -end - -Jin.Component = Component \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/Framework/Core/Game.lua b/Resources/DefaultContent/Libraries/Framework/Core/Game.lua deleted file mode 100644 index 51ce25f..0000000 --- a/Resources/DefaultContent/Libraries/Framework/Core/Game.lua +++ /dev/null @@ -1,14 +0,0 @@ - --- Game entry - -local Game = {} - -Game.OnEvent = function(e) - -end - -Game.MainLoop = function() - -end - -return Game \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/Framework/Core/GameObject.lua b/Resources/DefaultContent/Libraries/Framework/Core/GameObject.lua deleted file mode 100644 index ee0d143..0000000 --- a/Resources/DefaultContent/Libraries/Framework/Core/GameObject.lua +++ /dev/null @@ -1,7 +0,0 @@ -local GameObject = {} - -GameObject.AddComponent = function(self, comp) - -end - -Jin.GameObject = GameObject diff --git a/Resources/DefaultContent/Libraries/Framework/Core/Sprite.lua b/Resources/DefaultContent/Libraries/Framework/Core/Sprite.lua deleted file mode 100644 index 47cb50d..0000000 --- a/Resources/DefaultContent/Libraries/Framework/Core/Sprite.lua +++ /dev/null @@ -1,21 +0,0 @@ --- 对Quad的封装,更能适合2D游戏开发 -local Sprite = {} - -Sprite.New = function(quad) - local spr = {} - spr.quad = Jin.Quad.New(quad) - spr.pivot = Jin.Vector2.New(0.5, 0) - spr.transform = Jin.Transform.New() - spr.depth = 0 - return spr -end - -Sprite.SetDepth = function(self, depth) - spr.depth = depth -end - -Sprite.SetTexture = function(self, tex, reset_quad) - -end - -Jin.Sprite = Sprite \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/Framework/Math/Matrix44.lua b/Resources/DefaultContent/Libraries/Framework/Math/Matrix44.lua deleted file mode 100644 index b572f74..0000000 --- a/Resources/DefaultContent/Libraries/Framework/Math/Matrix44.lua +++ /dev/null @@ -1,7 +0,0 @@ -local Matrix44 = {} - -Matrix44.New = function() - -end - -return Matrix44 \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/Framework/Math/Quaternion.lua b/Resources/DefaultContent/Libraries/Framework/Math/Quaternion.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Libraries/Framework/Math/Vector2.lua b/Resources/DefaultContent/Libraries/Framework/Math/Vector2.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Libraries/Framework/Math/Vector3.lua b/Resources/DefaultContent/Libraries/Framework/Math/Vector3.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Libraries/Framework/Math/Vector4.lua b/Resources/DefaultContent/Libraries/Framework/Math/Vector4.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Libraries/Framework/Utils/EventCenter.lua b/Resources/DefaultContent/Libraries/Framework/Utils/EventCenter.lua deleted file mode 100644 index 664ecba..0000000 --- a/Resources/DefaultContent/Libraries/Framework/Utils/EventCenter.lua +++ /dev/null @@ -1,23 +0,0 @@ -local EventCenter = {} - -EventCenter.Subscribe = function(event, callback) - -end - -EventCenter.Unsubscribe = function(event, callback) - -end - -EventCenter.UnsubscribeAll = function(event) - -end - -EventCenter.Publish = function(event, ...) - -end - -EventCenter.Clear = function() - -end - -Jin.EventCenter = EventCenter \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/Framework/Utils/StateMachine.lua b/Resources/DefaultContent/Libraries/Framework/Utils/StateMachine.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Libraries/Framework/Utils/Util.lua b/Resources/DefaultContent/Libraries/Framework/Utils/Util.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Libraries/Framework/init.lua b/Resources/DefaultContent/Libraries/Framework/init.lua deleted file mode 100644 index 8b96176..0000000 --- a/Resources/DefaultContent/Libraries/Framework/init.lua +++ /dev/null @@ -1,2 +0,0 @@ ---Jin游戏框架 ---可选,用户可以自行决定是否使用此框架 diff --git a/Resources/DefaultContent/Libraries/GameLab/Class.lua b/Resources/DefaultContent/Libraries/GameLab/Class.lua new file mode 100644 index 0000000..346d807 --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Class.lua @@ -0,0 +1,5 @@ +-- GameLab Class +local Class = {} +GameLab.Class = Class + + diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Animation/Animation.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Animation/Animation.lua new file mode 100644 index 0000000..e69de29 diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Camera.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Camera.lua new file mode 100644 index 0000000..5fcfbe7 --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Camera.lua @@ -0,0 +1,5 @@ +local Camera = {} + + + +return Camera \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Component.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Component.lua new file mode 100644 index 0000000..00bf2ca --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Component.lua @@ -0,0 +1,11 @@ +local Component = {} + +Component.New = function() + +end + +Component.GetGameObject = function() + +end + +Jin.Component = Component \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Game.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Game.lua new file mode 100644 index 0000000..51ce25f --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Game.lua @@ -0,0 +1,14 @@ + +-- Game entry + +local Game = {} + +Game.OnEvent = function(e) + +end + +Game.MainLoop = function() + +end + +return Game \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Core/GameObject.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/GameObject.lua new file mode 100644 index 0000000..ee0d143 --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/GameObject.lua @@ -0,0 +1,7 @@ +local GameObject = {} + +GameObject.AddComponent = function(self, comp) + +end + +Jin.GameObject = GameObject diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Sprite.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Sprite.lua new file mode 100644 index 0000000..47cb50d --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Core/Sprite.lua @@ -0,0 +1,21 @@ +-- 对Quad的封装,更能适合2D游戏开发 +local Sprite = {} + +Sprite.New = function(quad) + local spr = {} + spr.quad = Jin.Quad.New(quad) + spr.pivot = Jin.Vector2.New(0.5, 0) + spr.transform = Jin.Transform.New() + spr.depth = 0 + return spr +end + +Sprite.SetDepth = function(self, depth) + spr.depth = depth +end + +Sprite.SetTexture = function(self, tex, reset_quad) + +end + +Jin.Sprite = Sprite \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Euler.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Euler.lua new file mode 100644 index 0000000..e69de29 diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Matrix44.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Matrix44.lua new file mode 100644 index 0000000..b572f74 --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Matrix44.lua @@ -0,0 +1,7 @@ +local Matrix44 = {} + +Matrix44.New = function() + +end + +return Matrix44 \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Matrix4x4.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Matrix4x4.lua new file mode 100644 index 0000000..e69de29 diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Quaternion.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Quaternion.lua new file mode 100644 index 0000000..4c71f52 --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Quaternion.lua @@ -0,0 +1,4 @@ +local Quaternion = {} + +return Quaternion + diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector2.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector2.lua new file mode 100644 index 0000000..e69de29 diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector3.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector3.lua new file mode 100644 index 0000000..e69de29 diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector4.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/Vector4.lua new file mode 100644 index 0000000..e69de29 diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Math/init.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/init.lua new file mode 100644 index 0000000..ef33c08 --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Math/init.lua @@ -0,0 +1,4 @@ +GameLab = GameLab or {} +GameLab.Math = GameLab.Math or {} + + diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Utils/EventCenter.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Utils/EventCenter.lua new file mode 100644 index 0000000..664ecba --- /dev/null +++ b/Resources/DefaultContent/Libraries/GameLab/Engine/Utils/EventCenter.lua @@ -0,0 +1,23 @@ +local EventCenter = {} + +EventCenter.Subscribe = function(event, callback) + +end + +EventCenter.Unsubscribe = function(event, callback) + +end + +EventCenter.UnsubscribeAll = function(event) + +end + +EventCenter.Publish = function(event, ...) + +end + +EventCenter.Clear = function() + +end + +Jin.EventCenter = EventCenter \ No newline at end of file diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Utils/StateMachine.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Utils/StateMachine.lua new file mode 100644 index 0000000..e69de29 diff --git a/Resources/DefaultContent/Libraries/GameLab/Engine/Utils/Util.lua b/Resources/DefaultContent/Libraries/GameLab/Engine/Utils/Util.lua new file mode 100644 index 0000000..e69de29 diff --git a/Resources/DefaultContent/Scripts/Math/Euler.lua b/Resources/DefaultContent/Scripts/Math/Euler.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Scripts/Math/Matrix4x4.lua b/Resources/DefaultContent/Scripts/Math/Matrix4x4.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Scripts/Math/Quaternion.lua b/Resources/DefaultContent/Scripts/Math/Quaternion.lua deleted file mode 100644 index 4c71f52..0000000 --- a/Resources/DefaultContent/Scripts/Math/Quaternion.lua +++ /dev/null @@ -1,4 +0,0 @@ -local Quaternion = {} - -return Quaternion - diff --git a/Resources/DefaultContent/Scripts/Math/Vector2.lua b/Resources/DefaultContent/Scripts/Math/Vector2.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/DefaultContent/Scripts/Math/Vector3.lua b/Resources/DefaultContent/Scripts/Math/Vector3.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/Scripts/EditorApplication.lua b/Resources/Scripts/EditorApplication.lua index d7beb3c..a01778d 100644 --- a/Resources/Scripts/EditorApplication.lua +++ b/Resources/Scripts/EditorApplication.lua @@ -1,4 +1,5 @@ -require("LuaPanda").start("127.0.0.1",8818); + +require "GameLab.Engine.Math" local Debug = GameLab.Debug local GUI = GameLab.Editor.GUI @@ -19,7 +20,9 @@ local guiWindow = GUI.GUIWindow.New() guiWindow:SetContainnerWindow(mainWindow) guiWindow:SetPosition({0,0, 500, 400}) -Debug.Log(package.cpath) + +Debug.Log(GameLab.Path.GetRootDirectory()) + while true do diff --git a/Resources/boot.lua b/Resources/boot.lua new file mode 100644 index 0000000..66cc78f --- /dev/null +++ b/Resources/boot.lua @@ -0,0 +1,18 @@ + +-- 妯″潡鎼滅储鐩綍 +local engineLuaLibs = "./DefaultContent/Libraries/?.lua" .. ";./DefaultContent/Libraries/?/init.lua" +local editorLuaLibs = "./Libraries/?.lua" .. ";./Libraries/?/init.lua" +local editorScripts = "./Scripts/?.lua" +package.path=package.path .. ";" .. editorScripts .. ";" .. engineLuaLibs .. ";" .. editorLuaLibs + +local engineCLibs = "./DefaultContent/Libraries/?.dll" +local editorCLibs = "./Libraries/?.dll" +package.cpath=package.cpath .. ";" .. engineCLibs .. ";" .. editorCLibs + + +-- redirect +print = GameLab.Debug.Log + + + +require("LuaPanda").start("127.0.0.1",8818); -- cgit v1.1-26-g67d0