Sfoglia il codice sorgente

Start porting the engine to the Nintendo Switch.

legacy
Sam Hocevar 5 anni fa
parent
commit
d7fc121faf
11 ha cambiato i file con 57 aggiunte e 31 eliminazioni
  1. +3
    -0
      .gitmodules
  2. +6
    -0
      build/msbuild/lol.config.props
  3. +30
    -23
      build/msbuild/lol.rules.props
  4. +1
    -2
      doc/tutorial/05_easymesh.vcxproj
  5. +1
    -2
      doc/tutorial/14_lua.vcxproj
  6. +2
    -2
      src/3rdparty/lol-bullet.vcxproj
  7. +3
    -2
      src/3rdparty/lol-lua.vcxproj
  8. +3
    -0
      src/lol-core.vcxproj
  9. +5
    -0
      src/lol/engine.h
  10. +1
    -0
      src/private/nx
  11. +2
    -0
      src/ui/sdl-input.h

+ 3
- 0
.gitmodules Vedi File

@@ -22,3 +22,6 @@
path = src/3rdparty/mingw-std-threads
url = ../../lolengine/ext-mingw-std-threads.git
branch = master
[submodule "src/private/nx"]
path = src/private/nx
url = ../../samhocevar/lol-nx.git

+ 6
- 0
build/msbuild/lol.config.props Vedi File

@@ -47,6 +47,12 @@
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>

<!--
- Secret stuff for platforms under NDA
-->
<Import Condition="Exists('$(LolDir)\src\private\nx\msbuild\nx.config.props')"
Project="$(LolDir)\src\private\nx\msbuild\nx.config.props" />

<!--
- Import final settings from Visual Studio
-->


+ 30
- 23
build/msbuild/lol.rules.props Vedi File

@@ -4,6 +4,13 @@
<LinkIncremental Condition="'$(Configuration)'=='Debug'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)'=='Release'">false</LinkIncremental>
</PropertyGroup>

<!--
- Secret stuff for platforms under NDA
-->
<Import Condition="Exists('$(LolDir)\src\private\nx\msbuild\nx.rules.props')"
Project="$(LolDir)\src\private\nx\msbuild\nx.rules.props" />

<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@@ -37,20 +44,18 @@
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>

<PreprocessorDefinitions>
<AdditionalPreprocessorDefinitions>
NOMINMAX;
_CRT_SECURE_NO_WARNINGS;
B3_USE_CLEW;
LUA_ANSI;
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
</AdditionalPreprocessorDefinitions>

<!-- Escape backslashes for C++, but replace \ with / on the PS4
because the SCE VSI seems to have trouble with backslashes -->
<PreprocessorDefinitions Condition="'$(Platform)'!='Orbis'">LOL_CONFIG_PROJECTDIR="$(ProjectDir.Replace('\','\\'))";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'!='Orbis'">LOL_CONFIG_SOLUTIONDIR="$(SolutionDir.Replace('\','\\'))";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='Orbis'">LOL_CONFIG_PROJECTDIR="$(ProjectDir.Replace('\','/'))";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='Orbis'">LOL_CONFIG_SOLUTIONDIR="$(SolutionDir.Replace('\','/'))";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>$(AdditionalPreprocessorDefinitions.Replace('\n',''));%(PreprocessorDefinitions)</PreprocessorDefinitions>

<!-- Trim trailing backslashes and escape them for C++ -->
<PreprocessorDefinitions>LOL_CONFIG_PROJECTDIR="$(ProjectDir.Trim('\').Replace('\','/'))";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>LOL_CONFIG_SOLUTIONDIR="$(SolutionDir.Trim('\').Replace('\','/'))";%(PreprocessorDefinitions)</PreprocessorDefinitions>

<PreprocessorDefinitions Condition="'$(Platform)'=='Win32'">WIN32;$(Win32Defines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='x64'">WIN32;$(Win32Defines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -76,24 +81,22 @@
<PreprocessorDefinitions>NDEBUG;LOL_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>

<Link>
<!-- FIXME: not for the static library! -->
<AdditionalDependencies Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;$(SdlDeps);$(FfmpegDeps);$(AssimpDeps);$(LibGccDeps);$(GdiDeps);$(XinputDeps);$(GlDeps);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(LibGccLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(SdlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(FfmpegLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(AssimpLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(GlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(XinputLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Orbis'">$(OrbisLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies Condition="'$(Platform)'=='Orbis'">$(OrbisDeps);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">
<!-- FIXME: not for the static library! -->
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;$(SdlDeps);$(FfmpegDeps);$(AssimpDeps);$(LibGccDeps);$(GdiDeps);$(XinputDeps);$(GlDeps);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(LibGccLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SdlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(FfmpegLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(AssimpLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(GlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(XinputLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem Condition="'$(enable_sdl)'!='no'">Windows</SubSystem>
<SubSystem Condition="'$(enable_sdl)'=='no'">Console</SubSystem>
</Link>
<Link Condition="'$(Platform)'=='Orbis'">
<AdditionalLibraryDirectories>$(OrbisLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(OrbisDeps);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link Condition="'$(Configuration)'=='Debug'">
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
@@ -102,6 +105,10 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>

<!-- Post-build hook to run commands -->
<PostBuildEvent Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">


+ 1
- 2
doc/tutorial/05_easymesh.vcxproj Vedi File

@@ -54,8 +54,7 @@
</ItemGroup>
<ItemGroup>
<None Include="05_easymesh.lua">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|NX64'">true</ExcludedFromBuild>
<ExcludedFromBuild>true</ExcludedFromBuild>
</None>
</ItemGroup>
<PropertyGroup Label="Globals">


+ 1
- 2
doc/tutorial/14_lua.vcxproj Vedi File

@@ -54,8 +54,7 @@
</ItemGroup>
<ItemGroup>
<None Include="14_lua.lua">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|NX64'">true</ExcludedFromBuild>
<ExcludedFromBuild>true</ExcludedFromBuild>
</None>
</ItemGroup>
<PropertyGroup Label="Globals">


+ 2
- 2
src/3rdparty/lol-bullet.vcxproj Vedi File

@@ -163,7 +163,7 @@
<ClInclude Include="bullet3/src/Bullet3Geometry/b3GeometryUtil.h" />
<ClInclude Include="bullet3/src/Bullet3Geometry/b3GrahamScan2dConvexHull.h" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(Platform)'!='NX64'">
<ClInclude Include="bullet3/src/Bullet3OpenCL/BroadphaseCollision/b3GpuBroadphaseInterface.h" />
<ClCompile Include="bullet3/src/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.cpp" />
<ClInclude Include="bullet3/src/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.h" />
@@ -721,7 +721,7 @@
<ClCompile Include="bullet3/src/LinearMath/btVector3.cpp" />
<ClInclude Include="bullet3/src/LinearMath/btVector3.h" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(Platform)'!='NX64'">
<ClCompile Include="bullet3/src/clew/clew.c" />
<ClInclude Include="bullet3/src/clew/clew.h" />
</ItemGroup>


+ 3
- 2
src/3rdparty/lol-lua.vcxproj Vedi File

@@ -63,6 +63,8 @@
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>LUA_ANSI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- disable the -std=c++17 flag on NX64 -->
<AdditionalOptions Condition="'$(Platform)'=='NX64'"></AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
@@ -130,8 +132,7 @@
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|NX64'">true</ExcludedFromBuild>
<ExcludedFromBuild>true</ExcludedFromBuild>
</None>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />


+ 3
- 0
src/lol-core.vcxproj Vedi File

@@ -183,6 +183,9 @@
<ClCompile Include="mesh\primitivemesh.cpp" />
<ClCompile Include="messageservice.cpp" />
<ClCompile Include="platform.cpp" />
<ClCompile Include="private\nx\nx-app.cpp">
<ExcludedFromBuild Condition="'$(Platform)'!='NX64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="profiler.cpp" />
<ClCompile Include="scene.cpp" />
<ClCompile Include="sprite.cpp" />


+ 5
- 0
src/lol/engine.h Vedi File

@@ -22,6 +22,11 @@
# define main lol_android_main
#endif

// If using NX, do that, too
#if NN_NINTENDO_SDK
# define main lol_nx_main
#endif

/* If using SDL on Windows or OS X, let it override main() */
#if LOL_USE_SDL && (_WIN32 || __APPLE__)
# include <SDL_main.h>


+ 1
- 0
src/private/nx

@@ -0,0 +1 @@
Subproject commit 659497041784fef0adff7b0ce7ab22b9379e5f66

+ 2
- 0
src/ui/sdl-input.h Vedi File

@@ -48,7 +48,9 @@ protected:
private:
void tick(float seconds);

#if LOL_USE_SDL
array<SDL_Joystick *, std::shared_ptr<class input::device::joystick>> m_joysticks;
#endif

vec2 m_app;
vec2 m_screen;


Caricamento…
Annulla
Salva