diff options
author | chai <chaifix@163.com> | 2018-12-08 11:53:02 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-08 11:53:02 +0800 |
commit | d34e5c9d7c6135e805f2cc231411cdcc9910190c (patch) | |
tree | 4ebb6e0b438269f8fe557de5ef85e82487febfc7 | |
parent | 39f653eb882dffa2f69209d192093f23588ff176 (diff) |
*misc
-rw-r--r-- | bin/SDL2.dll | bin | 771072 -> 1279488 bytes | |||
-rw-r--r-- | bin/jin.exe | bin | 554496 -> 1944576 bytes | |||
-rw-r--r-- | bin/lua51.dll | bin | 364544 -> 364544 bytes | |||
-rw-r--r-- | src/3rdparty/LuaJIT-2.0.5/src/buildvm.lib | bin | 33996 -> 33996 bytes | |||
-rw-r--r-- | src/3rdparty/LuaJIT-2.0.5/src/minilua.lib | bin | 33996 -> 33996 bytes | |||
-rw-r--r-- | src/lua/common/je_lua_object.cpp | 2 | ||||
-rw-r--r-- | src/lua/common/je_lua_object.h | 2 | ||||
-rw-r--r-- | src/lua/common/je_lua_runtime.cpp | 2 | ||||
-rw-r--r-- | src/lua/common/je_lua_shared.hpp | 10 | ||||
-rw-r--r-- | src/lua/embed/embed.h | 12 | ||||
-rw-r--r-- | src/lua/je_lua_jin.cpp | 3 | ||||
-rw-r--r-- | src/lua/modules/graphics/je_lua_graphics.cpp | 8 | ||||
-rw-r--r-- | src/lua/modules/graphics/je_lua_particle_system.cpp | 4 | ||||
-rw-r--r-- | src/lua/modules/thread/je_lua_thread.cpp | 2 |
14 files changed, 19 insertions, 26 deletions
diff --git a/bin/SDL2.dll b/bin/SDL2.dll Binary files differindex 3f6f1d5..d0d6ca5 100644 --- a/bin/SDL2.dll +++ b/bin/SDL2.dll diff --git a/bin/jin.exe b/bin/jin.exe Binary files differindex 0bd7bc7..9be0a6f 100644 --- a/bin/jin.exe +++ b/bin/jin.exe diff --git a/bin/lua51.dll b/bin/lua51.dll Binary files differindex 175f5c1..7499e13 100644 --- a/bin/lua51.dll +++ b/bin/lua51.dll diff --git a/src/3rdparty/LuaJIT-2.0.5/src/buildvm.lib b/src/3rdparty/LuaJIT-2.0.5/src/buildvm.lib Binary files differindex c7be727..be22bd4 100644 --- a/src/3rdparty/LuaJIT-2.0.5/src/buildvm.lib +++ b/src/3rdparty/LuaJIT-2.0.5/src/buildvm.lib diff --git a/src/3rdparty/LuaJIT-2.0.5/src/minilua.lib b/src/3rdparty/LuaJIT-2.0.5/src/minilua.lib Binary files differindex e2b3ac3..1a4ed3f 100644 --- a/src/3rdparty/LuaJIT-2.0.5/src/minilua.lib +++ b/src/3rdparty/LuaJIT-2.0.5/src/minilua.lib diff --git a/src/lua/common/je_lua_object.cpp b/src/lua/common/je_lua_object.cpp index d98099e..de3270a 100644 --- a/src/lua/common/je_lua_object.cpp +++ b/src/lua/common/je_lua_object.cpp @@ -38,7 +38,7 @@ namespace JinEngine return object->getType(); } - SharedBase* LuaObject::getSharedBase() + SharedBase* LuaObject::getShared() { return object; } diff --git a/src/lua/common/je_lua_object.h b/src/lua/common/je_lua_object.h index 15fa6e4..296ee03 100644 --- a/src/lua/common/je_lua_object.h +++ b/src/lua/common/je_lua_object.h @@ -23,7 +23,7 @@ namespace JinEngine const char* getObjectType(); - SharedBase* getSharedBase(); + SharedBase* getShared(); template<class T> Shared<T>& getShared() diff --git a/src/lua/common/je_lua_runtime.cpp b/src/lua/common/je_lua_runtime.cpp index 73f671c..055073d 100644 --- a/src/lua/common/je_lua_runtime.cpp +++ b/src/lua/common/je_lua_runtime.cpp @@ -54,7 +54,7 @@ namespace JinEngine luax_copyinstance(to, luaObj); luax_pop(to, 1); // Pop reference object. } - SharedBase * shr = src->getSharedBase(); + SharedBase * shr = src->getShared(); LuaObject* obj = luax_newinstance(to, src->getObjectType(), shr); (*obj->dependencies) = (*src->dependencies); // Add to objects_table. diff --git a/src/lua/common/je_lua_shared.hpp b/src/lua/common/je_lua_shared.hpp index f89783d..86ee9be 100644 --- a/src/lua/common/je_lua_shared.hpp +++ b/src/lua/common/je_lua_shared.hpp @@ -29,10 +29,12 @@ namespace JinEngine SharedBase(const SharedBase&); - // ͬһ̵߳lua_StateУLuaObjectEngineObjectӦһһӦLuaObject(lua runtime)ü - // աEngine-sideüΪά̵ͬ߳lua_StateͬһEngineObjectÿLuaObjectһ - // Sharedʱһüͬһ߳УһEngineObjectֻһLuaObjectnew - // instanceУômCountͱEngineObjectĹ߳ + /// + /// ͬһ̵߳lua_StateУLuaObjectEngineObjectӦһһӦLuaObject(lua runtime)ü + /// ͻաEngine-sideüΪά̵ͬ߳lua_StateͬһEngineObjectÿLuaObjectһ + /// Sharedʱһüͬһ߳УһEngineObjectֻһLuaObjectnew + /// instanceУômCountͱEngineObjectĹ߳ + /// void retain(); void release(); diff --git a/src/lua/embed/embed.h b/src/lua/embed/embed.h index 4b1c6d9..b5e1334 100644 --- a/src/lua/embed/embed.h +++ b/src/lua/embed/embed.h @@ -24,12 +24,11 @@ namespace JinEngine { "graphics.lua", graphics_lua }, { "keyboard.lua", keyboard_lua }, { "mouse.lua", mouse_lua }, + { "boot.lua", boot_lua }, { 0, 0 } }; - static const jin_Embed boot_script = { "boot", boot_lua }; - - static void load(lua_State* L) + static void run(lua_State* L) { for (int i = 0; modules[i].file; ++i) { @@ -39,13 +38,6 @@ namespace JinEngine } } - static void run(lua_State* L) - { - const char* file = boot_script.file, *source = boot_script.source; - if (luax_loadbuffer(L, source, strlen(source), file) == 0) - lua_call(L, 0, 0); - } - } // namespace Embed } // namespace JinEngine diff --git a/src/lua/je_lua_jin.cpp b/src/lua/je_lua_jin.cpp index 3e80015..e3af169 100644 --- a/src/lua/je_lua_jin.cpp +++ b/src/lua/je_lua_jin.cpp @@ -31,7 +31,7 @@ namespace JinEngine luax_pushstring(L, "macos"); #endif return 1; - } + } LUA_IMPLEMENT int l_revision(lua_State* L) { @@ -95,7 +95,6 @@ namespace JinEngine luax_newtable(L); luax_setfieldstring(L, "cwd", cwd); luax_setfield(L, -2, "args"); - Embed::load(L); luax_clearstack(L); Embed::run(L); } diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp index c6e6e13..40bb4fa 100644 --- a/src/lua/modules/graphics/je_lua_graphics.cpp +++ b/src/lua/modules/graphics/je_lua_graphics.cpp @@ -737,7 +737,7 @@ namespace JinEngine int o = luax_checkinteger(L, 3); Origin origin = static_cast<Origin>(o); LuaObject* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(new Sprite(graphic, quad, origin), Jin_Lua_Sprite)); - p->setDependency((int)SpriteDependency::DEP_GRAPHIC, objGraphic->getSharedBase()); + p->setDependency((int)SpriteDependency::DEP_GRAPHIC, objGraphic->getShared()); } else if (n == 4) { @@ -749,21 +749,21 @@ namespace JinEngine int ox = luax_checkinteger(L, 3); int oy = luax_checkinteger(L, 4); LuaObject* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(new Sprite(graphic, quad, ox, oy), Jin_Lua_Sprite)); - p->setDependency((int)SpriteDependency::DEP_GRAPHIC, objGraphic->getSharedBase()); + p->setDependency((int)SpriteDependency::DEP_GRAPHIC, objGraphic->getShared()); } else if (n == 2) { int o = luax_checkinteger(L, 2); Origin origin = static_cast<Origin>(o); LuaObject* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(new Sprite(graphic, origin), Jin_Lua_Sprite)); - p->setDependency((int)SpriteDependency::DEP_GRAPHIC, objGraphic->getSharedBase()); + p->setDependency((int)SpriteDependency::DEP_GRAPHIC, objGraphic->getShared()); } else if (n == 3) { int ox = luax_checkinteger(L, 2); int oy = luax_checkinteger(L, 3); LuaObject* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(new Sprite(graphic, ox, oy), Jin_Lua_Sprite)); - p->setDependency((int)SpriteDependency::DEP_GRAPHIC, objGraphic->getSharedBase()); + p->setDependency((int)SpriteDependency::DEP_GRAPHIC, objGraphic->getShared()); } else { diff --git a/src/lua/modules/graphics/je_lua_particle_system.cpp b/src/lua/modules/graphics/je_lua_particle_system.cpp index 8c2e4c7..05be4b7 100644 --- a/src/lua/modules/graphics/je_lua_particle_system.cpp +++ b/src/lua/modules/graphics/je_lua_particle_system.cpp @@ -244,7 +244,7 @@ namespace JinEngine Sprite* spr = objSpr->getObject<Sprite>(); ps->addParticleSprite(spr); int depn = (*obj).getDependenciesCount(); - (*obj).setDependency((int)ParticleSystemDependency::DEP_SPRITES + depn, objSpr->getSharedBase()); + (*obj).setDependency((int)ParticleSystemDependency::DEP_SPRITES + depn, objSpr->getShared()); return 0; } @@ -266,7 +266,7 @@ namespace JinEngine luax_pop(L, 1); Sprite* spr = objSpr->getObject<Sprite>(); ps->addParticleSprite(spr); - (*obj).setDependency((int)ParticleSystemDependency::DEP_SPRITES + depn + i - 1, objSpr->getSharedBase()); + (*obj).setDependency((int)ParticleSystemDependency::DEP_SPRITES + depn + i - 1, objSpr->getShared()); } return 0; } diff --git a/src/lua/modules/thread/je_lua_thread.cpp b/src/lua/modules/thread/je_lua_thread.cpp index dc6a27a..566d0ff 100644 --- a/src/lua/modules/thread/je_lua_thread.cpp +++ b/src/lua/modules/thread/je_lua_thread.cpp @@ -1,7 +1,7 @@ #include "common/je_lua_object.h" #include "libjin/jin.h" -#include "lua/jin.h" +#include "lua/je_lua_jin.h" #include "common/je_lua_common.h" #include "je_lua_thread.h" |