diff --git a/build/msbuild/lol.rules.props b/build/msbuild/lol.rules.props index 8662e5b6..fd9d77c5 100644 --- a/build/msbuild/lol.rules.props +++ b/build/msbuild/lol.rules.props @@ -65,7 +65,7 @@ true Disabled MultiThreadedDebugDLL - _DEBUG;LOL_DEBUG;%(PreprocessorDefinitions) + _DEBUG;LOL_BUILD_DEBUG;%(PreprocessorDefinitions) true @@ -78,7 +78,7 @@ true true Speed - NDEBUG;LOL_RELEASE;%(PreprocessorDefinitions) + NDEBUG;LOL_BUILD_RELEASE;%(PreprocessorDefinitions) diff --git a/build/msbuild/lol.vars.props b/build/msbuild/lol.vars.props index 410857e4..67126fda 100644 --- a/build/msbuild/lol.vars.props +++ b/build/msbuild/lol.vars.props @@ -143,14 +143,17 @@ $(XinputLibs) $(XinputDeps) $(Win32Defines) - $(Nx64Deps) - $(Nx64Libs) - $(Nx64Defines) $(OrbisDeps) $(OrbisLibs) $(OrbisDefines) + + + $(SolutionDir)\binaries $(LolDir)\binaries diff --git a/src/application/application.cpp b/src/application/application.cpp index 8e99a797..f6bfc382 100644 --- a/src/application/application.cpp +++ b/src/application/application.cpp @@ -20,6 +20,8 @@ #if __ANDROID__ # include "application/android-app.h" +#elif __NX__ +# include "private/nx/nx-app.h" #elif LOL_USE_SDL # include "application/sdl-app.h" #elif HAVE_GLES_2X @@ -136,6 +138,8 @@ class ApplicationData #if __ANDROID__ AndroidApp app; +#elif __NX__ + NxApp app; #elif LOL_USE_SDL sdl::app app; #elif HAVE_GLES_2X diff --git a/src/base/log.cpp b/src/base/log.cpp index dcf7ff21..415096c0 100644 --- a/src/base/log.cpp +++ b/src/base/log.cpp @@ -21,9 +21,11 @@ # undef WIN32_LEAN_AND_MEAN #endif -#if defined(__ANDROID__) +#if __ANDROID__ # include # include /* for gettid() */ +#elif __NX__ +# include "../private/nx/nx-log.h" #else # include #endif @@ -39,7 +41,7 @@ void msg::debug(char const *fmt, ...) { va_list ap; va_start(ap, fmt); - helper(MessageType::Debug, fmt, ap); + helper(message_type::debug, fmt, ap); va_end(ap); } @@ -47,7 +49,7 @@ void msg::info(char const *fmt, ...) { va_list ap; va_start(ap, fmt); - helper(MessageType::Info, fmt, ap); + helper(message_type::info, fmt, ap); va_end(ap); } @@ -55,7 +57,7 @@ void msg::warn(char const *fmt, ...) { va_list ap; va_start(ap, fmt); - helper(MessageType::Warning, fmt, ap); + helper(message_type::warning, fmt, ap); va_end(ap); } @@ -63,7 +65,7 @@ void msg::error(char const *fmt, ...) { va_list ap; va_start(ap, fmt); - helper(MessageType::Error, fmt, ap); + helper(message_type::error, fmt, ap); va_end(ap); } @@ -71,12 +73,12 @@ void msg::error(char const *fmt, ...) * 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 * 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 bool const disable_debug = !var || !var[0]; @@ -85,7 +87,7 @@ void msg::helper(MessageType type, char const *fmt, va_list ap) } #endif -#if defined __ANDROID__ +#if __ANDROID__ static int const prio[] = { ANDROID_LOG_DEBUG, @@ -97,6 +99,8 @@ void msg::helper(MessageType type, char const *fmt, va_list ap) std::string buf = vformat(fmt, ap); __android_log_print(prio[(int)type], "LOL", "[%d] %s", (int)gettid(), &buf[0]); +#elif __NX__ + nx::helper(type, fmt, ap); #else static char const * const prefix[] = { diff --git a/src/lol-core.vcxproj b/src/lol-core.vcxproj index dd97cb36..7f9d0d18 100644 --- a/src/lol-core.vcxproj +++ b/src/lol-core.vcxproj @@ -90,6 +90,7 @@ _LIB;%(PreprocessorDefinitions);LOL_INPUT_V2 + O1 @@ -186,6 +187,9 @@ true + + true + @@ -303,6 +307,12 @@ + + true + + + true + diff --git a/src/lol-core.vcxproj.filters b/src/lol-core.vcxproj.filters index 0a65eb08..f5ec1f79 100644 --- a/src/lol-core.vcxproj.filters +++ b/src/lol-core.vcxproj.filters @@ -258,6 +258,8 @@ + + @@ -551,6 +553,8 @@ lol\audio + + diff --git a/src/lol/base/log.h b/src/lol/base/log.h index 1a0cf0e8..f42d91cb 100644 --- a/src/lol/base/log.h +++ b/src/lol/base/log.h @@ -32,16 +32,16 @@ public: static void warn(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 */ diff --git a/src/private/nx b/src/private/nx index c2da1a20..840d8e58 160000 --- a/src/private/nx +++ b/src/private/nx @@ -1 +1 @@ -Subproject commit c2da1a20c6fa7b23efab7f1154d9d0ee49e7cd37 +Subproject commit 840d8e587789c51e51f76c603eb4e1fb30581eae