aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/SDL2.dllbin1279488 -> 1279488 bytes
-rw-r--r--bin/game/main.lua5
-rw-r--r--bin/jin.exebin1925632 -> 1925632 bytes
-rw-r--r--bin/lua51.dllbin364544 -> 364544 bytes
-rw-r--r--build/vc++/3rdparty/Lua51/Lua51.vcxproj3
-rw-r--r--build/vc++/3rdparty/luax/luax.vcxproj2
-rw-r--r--build/vc++/jin.sln3
-rw-r--r--build/vc++/jin/jin.vcxproj5
-rw-r--r--src/jin/main.cpp14
-rw-r--r--src/lua/je_lua_jin.cpp22
10 files changed, 24 insertions, 30 deletions
diff --git a/bin/SDL2.dll b/bin/SDL2.dll
index d0d6ca5..0272536 100644
--- a/bin/SDL2.dll
+++ b/bin/SDL2.dll
Binary files 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
--- a/bin/jin.exe
+++ b/bin/jin.exe
Binary files differ
diff --git a/bin/lua51.dll b/bin/lua51.dll
index 7499e13..a2793ba 100644
--- a/bin/lua51.dll
+++ b/bin/lua51.dll
Binary files 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 @@
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
+ <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
@@ -98,6 +98,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
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 @@
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{C6B16179-5640-4D41-8756-0525D25EB569}</ProjectGuid>
<RootNamespace>luax</RootNamespace>
- <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
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 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
- <Optimization>MaxSpeed</Optimization>
+ <Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>false</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src\;$(SolutionDir)..\..\src\3rdparty\SDL2\include;$(SolutionDir)..\..\src\3rdparty\LuaJIT-2.0.5\include;$(SolutionDir)..\..\src\3rdparty\</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
- <SubSystem>Console</SubSystem>
+ <SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</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 <Windows.h>
- #include <direct.h>
#include <shlobj.h>
#include <wchar.h>
#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);