@@ -65,7 +65,7 @@ | |||||
<GenerateDebugInformation>true</GenerateDebugInformation> | <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
<Optimization>Disabled</Optimization> | <Optimization>Disabled</Optimization> | ||||
<RuntimeLibrary Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">MultiThreadedDebugDLL</RuntimeLibrary> | <RuntimeLibrary Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">MultiThreadedDebugDLL</RuntimeLibrary> | ||||
<PreprocessorDefinitions>_DEBUG;LOL_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||||
<PreprocessorDefinitions>_DEBUG;LOL_BUILD_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||||
</ClCompile> | </ClCompile> | ||||
<ClCompile Condition="'$(Configuration)'=='Release'"> | <ClCompile Condition="'$(Configuration)'=='Release'"> | ||||
<GenerateDebugInformation>true</GenerateDebugInformation> | <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
@@ -78,7 +78,7 @@ | |||||
<FunctionLevelLinking>true</FunctionLevelLinking> | <FunctionLevelLinking>true</FunctionLevelLinking> | ||||
<IntrinsicFunctions>true</IntrinsicFunctions> | <IntrinsicFunctions>true</IntrinsicFunctions> | ||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | ||||
<PreprocessorDefinitions>NDEBUG;LOL_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||||
<PreprocessorDefinitions>NDEBUG;LOL_BUILD_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||||
</ClCompile> | </ClCompile> | ||||
<Link Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'"> | <Link Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'"> | ||||
@@ -143,14 +143,17 @@ | |||||
<BuildMacro Include="XinputLibs"><Value>$(XinputLibs)</Value></BuildMacro> | <BuildMacro Include="XinputLibs"><Value>$(XinputLibs)</Value></BuildMacro> | ||||
<BuildMacro Include="XinputDeps"><Value>$(XinputDeps)</Value></BuildMacro> | <BuildMacro Include="XinputDeps"><Value>$(XinputDeps)</Value></BuildMacro> | ||||
<BuildMacro Include="Win32Defines"><Value>$(Win32Defines)</Value></BuildMacro> | <BuildMacro Include="Win32Defines"><Value>$(Win32Defines)</Value></BuildMacro> | ||||
<BuildMacro Include="Nx64Deps"><Value>$(Nx64Deps)</Value></BuildMacro> | |||||
<BuildMacro Include="Nx64Libs"><Value>$(Nx64Libs)</Value></BuildMacro> | |||||
<BuildMacro Include="Nx64Defines"><Value>$(Nx64Defines)</Value></BuildMacro> | |||||
<BuildMacro Include="OrbisDeps"><Value>$(OrbisDeps)</Value></BuildMacro> | <BuildMacro Include="OrbisDeps"><Value>$(OrbisDeps)</Value></BuildMacro> | ||||
<BuildMacro Include="OrbisLibs"><Value>$(OrbisLibs)</Value></BuildMacro> | <BuildMacro Include="OrbisLibs"><Value>$(OrbisLibs)</Value></BuildMacro> | ||||
<BuildMacro Include="OrbisDefines"><Value>$(OrbisDefines)</Value></BuildMacro> | <BuildMacro Include="OrbisDefines"><Value>$(OrbisDefines)</Value></BuildMacro> | ||||
</ItemGroup> | </ItemGroup> | ||||
<!-- | |||||
- Secret stuff for platforms under NDA | |||||
--> | |||||
<Import Condition="Exists('$(LolDir)\src\private\nx\msbuild\nx.vars.props')" | |||||
Project="$(LolDir)\src\private\nx\msbuild\nx.vars.props" /> | |||||
<PropertyGroup> | <PropertyGroup> | ||||
<BinDir Condition="Exists('$(SolutionDir)\lol')">$(SolutionDir)\binaries</BinDir> | <BinDir Condition="Exists('$(SolutionDir)\lol')">$(SolutionDir)\binaries</BinDir> | ||||
<BinDir Condition="!Exists('$(SolutionDir)\lol')">$(LolDir)\binaries</BinDir> | <BinDir Condition="!Exists('$(SolutionDir)\lol')">$(LolDir)\binaries</BinDir> | ||||
@@ -20,6 +20,8 @@ | |||||
#if __ANDROID__ | #if __ANDROID__ | ||||
# include "application/android-app.h" | # include "application/android-app.h" | ||||
#elif __NX__ | |||||
# include "private/nx/nx-app.h" | |||||
#elif LOL_USE_SDL | #elif LOL_USE_SDL | ||||
# include "application/sdl-app.h" | # include "application/sdl-app.h" | ||||
#elif HAVE_GLES_2X | #elif HAVE_GLES_2X | ||||
@@ -136,6 +138,8 @@ class ApplicationData | |||||
#if __ANDROID__ | #if __ANDROID__ | ||||
AndroidApp app; | AndroidApp app; | ||||
#elif __NX__ | |||||
NxApp app; | |||||
#elif LOL_USE_SDL | #elif LOL_USE_SDL | ||||
sdl::app app; | sdl::app app; | ||||
#elif HAVE_GLES_2X | #elif HAVE_GLES_2X | ||||
@@ -21,9 +21,11 @@ | |||||
# undef WIN32_LEAN_AND_MEAN | # undef WIN32_LEAN_AND_MEAN | ||||
#endif | #endif | ||||
#if defined(__ANDROID__) | |||||
#if __ANDROID__ | |||||
# include <android/log.h> | # include <android/log.h> | ||||
# include <unistd.h> /* for gettid() */ | # include <unistd.h> /* for gettid() */ | ||||
#elif __NX__ | |||||
# include "../private/nx/nx-log.h" | |||||
#else | #else | ||||
# include <cstdarg> | # include <cstdarg> | ||||
#endif | #endif | ||||
@@ -39,7 +41,7 @@ void msg::debug(char const *fmt, ...) | |||||
{ | { | ||||
va_list ap; | va_list ap; | ||||
va_start(ap, fmt); | va_start(ap, fmt); | ||||
helper(MessageType::Debug, fmt, ap); | |||||
helper(message_type::debug, fmt, ap); | |||||
va_end(ap); | va_end(ap); | ||||
} | } | ||||
@@ -47,7 +49,7 @@ void msg::info(char const *fmt, ...) | |||||
{ | { | ||||
va_list ap; | va_list ap; | ||||
va_start(ap, fmt); | va_start(ap, fmt); | ||||
helper(MessageType::Info, fmt, ap); | |||||
helper(message_type::info, fmt, ap); | |||||
va_end(ap); | va_end(ap); | ||||
} | } | ||||
@@ -55,7 +57,7 @@ void msg::warn(char const *fmt, ...) | |||||
{ | { | ||||
va_list ap; | va_list ap; | ||||
va_start(ap, fmt); | va_start(ap, fmt); | ||||
helper(MessageType::Warning, fmt, ap); | |||||
helper(message_type::warning, fmt, ap); | |||||
va_end(ap); | va_end(ap); | ||||
} | } | ||||
@@ -63,7 +65,7 @@ void msg::error(char const *fmt, ...) | |||||
{ | { | ||||
va_list ap; | va_list ap; | ||||
va_start(ap, fmt); | va_start(ap, fmt); | ||||
helper(MessageType::Error, fmt, ap); | |||||
helper(message_type::error, fmt, ap); | |||||
va_end(ap); | va_end(ap); | ||||
} | } | ||||
@@ -71,12 +73,12 @@ void msg::error(char const *fmt, ...) | |||||
* Private helper function | * Private helper function | ||||
*/ | */ | ||||
void msg::helper(MessageType type, char const *fmt, va_list ap) | |||||
void msg::helper(message_type type, char const *fmt, va_list ap) | |||||
{ | { | ||||
/* Unless this is a debug build, ignore debug messages unless | /* Unless this is a debug build, ignore debug messages unless | ||||
* the LOL_DEBUG environment variable is set. */ | * the LOL_DEBUG environment variable is set. */ | ||||
#if !defined LOL_BUILD_DEBUG | |||||
if (type == MessageType::Debug) | |||||
#if !defined LOL_BUILD_DEBUG && !_DEBUG | |||||
if (type == message_type::debug) | |||||
{ | { | ||||
static char const *var = getenv("LOL_DEBUG"); | static char const *var = getenv("LOL_DEBUG"); | ||||
static bool const disable_debug = !var || !var[0]; | static bool const disable_debug = !var || !var[0]; | ||||
@@ -85,7 +87,7 @@ void msg::helper(MessageType type, char const *fmt, va_list ap) | |||||
} | } | ||||
#endif | #endif | ||||
#if defined __ANDROID__ | |||||
#if __ANDROID__ | |||||
static int const prio[] = | static int const prio[] = | ||||
{ | { | ||||
ANDROID_LOG_DEBUG, | ANDROID_LOG_DEBUG, | ||||
@@ -97,6 +99,8 @@ void msg::helper(MessageType type, char const *fmt, va_list ap) | |||||
std::string buf = vformat(fmt, ap); | std::string buf = vformat(fmt, ap); | ||||
__android_log_print(prio[(int)type], "LOL", "[%d] %s", (int)gettid(), &buf[0]); | __android_log_print(prio[(int)type], "LOL", "[%d] %s", (int)gettid(), &buf[0]); | ||||
#elif __NX__ | |||||
nx::helper(type, fmt, ap); | |||||
#else | #else | ||||
static char const * const prefix[] = | static char const * const prefix[] = | ||||
{ | { | ||||
@@ -90,6 +90,7 @@ | |||||
<ItemDefinitionGroup> | <ItemDefinitionGroup> | ||||
<ClCompile> | <ClCompile> | ||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions);LOL_INPUT_V2</PreprocessorDefinitions> | <PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions);LOL_INPUT_V2</PreprocessorDefinitions> | ||||
<OptimizationLevel Condition="'$(Configuration)|$(Platform)'=='Debug|NX64'">O1</OptimizationLevel> | |||||
</ClCompile> | </ClCompile> | ||||
</ItemDefinitionGroup> | </ItemDefinitionGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -186,6 +187,9 @@ | |||||
<ClCompile Include="private\nx\nx-app.cpp"> | <ClCompile Include="private\nx\nx-app.cpp"> | ||||
<ExcludedFromBuild Condition="'$(Platform)'!='NX64'">true</ExcludedFromBuild> | <ExcludedFromBuild Condition="'$(Platform)'!='NX64'">true</ExcludedFromBuild> | ||||
</ClCompile> | </ClCompile> | ||||
<ClCompile Include="private\nx\nx-log.cpp"> | |||||
<ExcludedFromBuild Condition="'$(Platform)'!='NX64'">true</ExcludedFromBuild> | |||||
</ClCompile> | |||||
<ClCompile Include="profiler.cpp" /> | <ClCompile Include="profiler.cpp" /> | ||||
<ClCompile Include="scene.cpp" /> | <ClCompile Include="scene.cpp" /> | ||||
<ClCompile Include="sprite.cpp" /> | <ClCompile Include="sprite.cpp" /> | ||||
@@ -303,6 +307,12 @@ | |||||
<ClInclude Include="messageservice.h" /> | <ClInclude Include="messageservice.h" /> | ||||
<ClInclude Include="numeric.h" /> | <ClInclude Include="numeric.h" /> | ||||
<ClInclude Include="platform.h" /> | <ClInclude Include="platform.h" /> | ||||
<ClInclude Include="private\nx\nx-app.h"> | |||||
<ExcludedFromBuild Condition="'$(Platform)'!='NX64'">true</ExcludedFromBuild> | |||||
</ClInclude> | |||||
<ClInclude Include="private\nx\nx-log.h"> | |||||
<ExcludedFromBuild Condition="'$(Platform)'!='NX64'">true</ExcludedFromBuild> | |||||
</ClInclude> | |||||
<ClInclude Include="profiler.h" /> | <ClInclude Include="profiler.h" /> | ||||
<ClInclude Include="scene.h" /> | <ClInclude Include="scene.h" /> | ||||
<ClInclude Include="sprite.h" /> | <ClInclude Include="sprite.h" /> | ||||
@@ -258,6 +258,8 @@ | |||||
<ClCompile Include="3rdparty\imgui\imgui_widgets.cpp" /> | <ClCompile Include="3rdparty\imgui\imgui_widgets.cpp" /> | ||||
<ClCompile Include="audio\audio.cpp" /> | <ClCompile Include="audio\audio.cpp" /> | ||||
<ClCompile Include="audio\sample.cpp" /> | <ClCompile Include="audio\sample.cpp" /> | ||||
<ClCompile Include="private\nx\nx-app.cpp" /> | |||||
<ClCompile Include="private\nx\nx-log.cpp" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ClInclude Include="application\application.h"> | <ClInclude Include="application\application.h"> | ||||
@@ -551,6 +553,8 @@ | |||||
<ClInclude Include="lol\audio\audio.h"> | <ClInclude Include="lol\audio\audio.h"> | ||||
<Filter>lol\audio</Filter> | <Filter>lol\audio</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="private\nx\nx-app.h" /> | |||||
<ClInclude Include="private\nx\nx-log.h" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<LolFxCompile Include="easymesh\shiny.lolfx"> | <LolFxCompile Include="easymesh\shiny.lolfx"> | ||||
@@ -32,16 +32,16 @@ public: | |||||
static void warn(char const *format, ...) LOL_ATTR_FORMAT(1, 2); | static void warn(char const *format, ...) LOL_ATTR_FORMAT(1, 2); | ||||
static void error(char const *format, ...) LOL_ATTR_FORMAT(1, 2); | static void error(char const *format, ...) LOL_ATTR_FORMAT(1, 2); | ||||
private: | |||||
enum class MessageType | |||||
enum class message_type | |||||
{ | { | ||||
Debug, | |||||
Info, | |||||
Warning, | |||||
Error | |||||
debug, | |||||
info, | |||||
warning, | |||||
error, | |||||
}; | }; | ||||
static void helper(MessageType type, char const *fmt, va_list ap); | |||||
private: | |||||
static void helper(message_type type, char const *fmt, va_list ap); | |||||
}; | }; | ||||
} /* namespace lol */ | } /* namespace lol */ | ||||
@@ -1 +1 @@ | |||||
Subproject commit c2da1a20c6fa7b23efab7f1154d9d0ee49e7cd37 | |||||
Subproject commit 840d8e587789c51e51f76c603eb4e1fb30581eae |