From b1dfdae7a071407ef5e2d56f2203f96e6ba6068d Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 9 Dec 2018 18:26:17 +0800 Subject: *misc --- bin/SDL2.dll | Bin 1279488 -> 1279488 bytes bin/game/main.lua | 5 +++-- bin/jin.exe | Bin 1925632 -> 1925632 bytes bin/lua51.dll | Bin 364544 -> 364544 bytes build/vc++/3rdparty/Lua51/Lua51.vcxproj | 3 ++- build/vc++/3rdparty/luax/luax.vcxproj | 2 +- build/vc++/jin.sln | 3 +++ build/vc++/jin/jin.vcxproj | 5 +++-- src/jin/main.cpp | 14 ++------------ src/lua/je_lua_jin.cpp | 22 ++++++++++------------ 10 files changed, 24 insertions(+), 30 deletions(-) diff --git a/bin/SDL2.dll b/bin/SDL2.dll index d0d6ca5..0272536 100644 Binary files a/bin/SDL2.dll and b/bin/SDL2.dll differ diff --git a/bin/game/main.lua b/bin/game/main.lua index fd54a7d..2cc8bcc 100644 --- a/bin/game/main.lua +++ b/bin/game/main.lua @@ -130,6 +130,7 @@ function jin.core.onUpdate(dt) ps:update(dt) local mx, my = jin.mouse.getPosition() ps:setPosition(mx, my) + ps:setEmitDirection(t - 0.3, t + 0.3) end function jin.core.onDraw() @@ -140,8 +141,8 @@ function jin.core.onDraw() jin.graphics.unuseShader() --jin.graphics.draw(sprs[2], 150, 150, 1, 1, 0) local x, y = jin.mouse.getPosition() - animator:render(50, 150, 1, 1, 0) - --jin.graphics.print(#sprs, 10, 10) + animator:render(350, 150, 1, 1, 0) + jin.graphics.print("* Particle system test\n* Animation test", 10, 10) jin.graphics.draw(spr, 100, 200, 1, 1, 0) --jin.graphics.useShader(shader_program2) --jin.graphics.draw(tex, 0, 0,0.2, 0.2) diff --git a/bin/jin.exe b/bin/jin.exe index d997d7b..55f6a91 100644 Binary files a/bin/jin.exe and b/bin/jin.exe differ diff --git a/bin/lua51.dll b/bin/lua51.dll index 7499e13..a2793ba 100644 Binary files a/bin/lua51.dll and b/bin/lua51.dll differ diff --git a/build/vc++/3rdparty/Lua51/Lua51.vcxproj b/build/vc++/3rdparty/Lua51/Lua51.vcxproj index 64eef69..40aa665 100644 --- a/build/vc++/3rdparty/Lua51/Lua51.vcxproj +++ b/build/vc++/3rdparty/Lua51/Lua51.vcxproj @@ -32,7 +32,7 @@ MultiByte - Application + StaticLibrary false v141 true @@ -98,6 +98,7 @@ true true true + _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true diff --git a/build/vc++/3rdparty/luax/luax.vcxproj b/build/vc++/3rdparty/luax/luax.vcxproj index 354e437..2fb5520 100644 --- a/build/vc++/3rdparty/luax/luax.vcxproj +++ b/build/vc++/3rdparty/luax/luax.vcxproj @@ -22,7 +22,7 @@ 15.0 {C6B16179-5640-4D41-8756-0525D25EB569} luax - 10.0.17134.0 + 8.1 diff --git a/build/vc++/jin.sln b/build/vc++/jin.sln index 2fa044e..4962f97 100644 --- a/build/vc++/jin.sln +++ b/build/vc++/jin.sln @@ -50,6 +50,9 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lua51", "3rdparty\Lua51\Lua51.vcxproj", "{4156CD69-6FC4-4B32-B008-BB94C8AE17F5}" EndProject Global + GlobalSection(Performance) = preSolution + HasPerformanceSessions = true + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 diff --git a/build/vc++/jin/jin.vcxproj b/build/vc++/jin/jin.vcxproj index 1a0ca08..7c0c145 100644 --- a/build/vc++/jin/jin.vcxproj +++ b/build/vc++/jin/jin.vcxproj @@ -81,17 +81,18 @@ Level3 - MaxSpeed + MinSpace true true true false $(SolutionDir)..\..\src\;$(SolutionDir)..\..\src\3rdparty\SDL2\include;$(SolutionDir)..\..\src\3rdparty\LuaJIT-2.0.5\include;$(SolutionDir)..\..\src\3rdparty\ + Size true true - Console + Windows opengl32.lib;%(AdditionalDependencies) diff --git a/src/jin/main.cpp b/src/jin/main.cpp index 0a37b32..91a4e7c 100644 --- a/src/jin/main.cpp +++ b/src/jin/main.cpp @@ -3,7 +3,6 @@ #ifdef _WIN32 #include - #include #include #include #endif @@ -14,22 +13,13 @@ using namespace std; using namespace JinEngine::Filesystem; -// Load game under cwd. static void load(const char* cwd) { - // Main thread lua runtime. + // Main thread lua state. lua_State* L = luax_newstate(); - - // Open lua standard module. luax_openlibs(L); - - // Open jin module. JinEngine::Lua::open(L); - - // Boot jin and run it. JinEngine::Lua::boot(L, cwd); - - // Close lua lib. luax_close(L); } @@ -45,7 +35,7 @@ std::string wstrtostr(const std::wstring &wstr) delete[] szTo; return strTo; } -#endif +#endif bool BrowseFolder(string& cwd) { diff --git a/src/lua/je_lua_jin.cpp b/src/lua/je_lua_jin.cpp index e3af169..8d79415 100644 --- a/src/lua/je_lua_jin.cpp +++ b/src/lua/je_lua_jin.cpp @@ -39,23 +39,21 @@ namespace JinEngine return 1; } - LUA_IMPLEMENT const luax_Str s[] = { - { "version", VERSION }, - { "author", AUTHOR }, - { "codename", CODE_NAME }, - { 0, 0 } - }; - - LUA_IMPLEMENT const luax_Num n[] = { - { "revision", REVISION }, - { 0, 0 } - }; - // Register jin module, keep it on the top of stack. LUA_EXPORT void open(lua_State* L) { luax_globaltable(L, MODULE_NAME); + const luax_Str s[] = { + { "version", VERSION }, + { "author", AUTHOR }, + { "codename", CODE_NAME }, + { 0, 0 } + }; + const luax_Num n[] = { + { "revision", REVISION }, + { 0, 0 } + }; // Register values. luax_setfieldstrings(L, s); luax_setfieldnumbers(L, n); -- cgit v1.1-26-g67d0