diff --git a/README.md b/README.md index b1c4caa47..39cf65918 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ This is the current big issue with the library. Since i'm solo working, it's rea **How to build it?** ------------------------ -The library has very few external dependencies. Most of the time you will only need SDL2 and OpenAL libraries with the headers installed. Also **premake4** is needed to generate the Makefiles or project files to build the library. I will assume that you know what you are doing and skip the basics. +The library has very few external dependencies. Most of the time you will only need SDL2 and OpenAL libraries with the headers installed. Also **premake4** or **premake5** is needed to generate the Makefiles or project files to build the library. I will assume that you know what you are doing and skip the basics. **_GNU/Linux_** @@ -243,8 +243,8 @@ In a Ubuntu system it would be something like ( also you will need gcc and freet `sudo apt-get install premake4 libsdl2-2.0-0 libsdl2-dev libopenal1 libopenal-dev` -Clone the repository and on the repository root run: -`premake4 --with-ssl gmake` +Clone the repository and on the repository root directory run: +`premake4 gmake` Then just build the library: `cd make/linux` @@ -259,10 +259,12 @@ You have two options: build with *Visual Studio* or with *mingw*. To build with any of both options first you will need to build the project files with [premake4](https://premake.github.io/download.html). Then add the premake4.exe file to any of the executable paths defined in `PATH` ( or add one ). For *Visual Studio*: -`premake4.exe --with-ssl --with-static-freetype vs2010` +`premake5.exe vs2019` +or +`premake4.exe vs2010` For *mingw*: -`premake4.exe --with-ssl --with-static-freetype gmake` +`premake4.exe gmake` Then you will need the prebuild binaries and development libraries of [*SDL2*](http://libsdl.org/download-2.0.php) and [*openal-soft*](http://kcat.strangesoft.net/openal.html#download). Download the ones needed ( *VS* or *mingw* ). @@ -280,7 +282,7 @@ Then you will need the prebuild binaries and development libraries of [*SDL2*](h For a CLI build you can use the `projects/osx/make.sh` script, that generates the *Makefiles* and builds the project, also fix the dylibs generated. For *XCode* : -`premake4 --with-ssl --with-static-freetype xcode4` +`premake4 xcode4` And open the XCode project generated in `make/osx/` diff --git a/include/eepp/config.hpp b/include/eepp/config.hpp index 1e5c110a2..d84deebfb 100644 --- a/include/eepp/config.hpp +++ b/include/eepp/config.hpp @@ -98,9 +98,13 @@ #define EE_BACKEND_SDL_ACTIVE #endif -#if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS +#if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS || (EE_PLATFORM == EE_PLATFORM_WIN && defined(EE_COMPILER_MSVC)) #if defined( EE_BACKEND_SDL_ACTIVE ) - #define main EE_SDL_main + #if EE_PLATFORM == EE_PLATFORM_WIN && defined(EE_COMPILER_MSVC) + #define main SDL_main + #else + #define main EE_SDL_main + #endif #endif #endif diff --git a/include/eepp/math/easing.hpp b/include/eepp/math/easing.hpp index 673a104ed..1bddff9be 100644 --- a/include/eepp/math/easing.hpp +++ b/include/eepp/math/easing.hpp @@ -118,7 +118,7 @@ inline double sineOut( double t, double b, double c, double d ) { * @return The value of the interpolated property at the specified time. */ inline double sineInOut( double t, double b, double c, double d ) { - return -c / 2 * ( eecos( EE_PI * t / d ) - 1 ) + b; + return -c / 2 * ( cos( EE_PI * t / d ) - 1 ) + b; } /** @@ -132,7 +132,7 @@ inline double sineInOut( double t, double b, double c, double d ) { * @return Number corresponding to the position of the component. */ inline double exponentialIn( double t, double b, double c, double d ) { - return t == 0 ? b : c * eepow( 2, 10 * ( t / d - 1 ) ) + b; + return t == 0 ? b : c * pow( 2, 10 * ( t / d - 1 ) ) + b; } /** @@ -146,7 +146,7 @@ inline double exponentialIn( double t, double b, double c, double d ) { * @return The value of the interpolated property at the specified time. */ inline double exponentialOut( double t, double b, double c, double d ) { - return t == d ? b + c : c * ( -eepow( 2, -10 * t / d ) + 1 ) + b; + return t == d ? b + c : c * ( -pow( 2, -10 * t / d ) + 1 ) + b; } /** @@ -169,9 +169,9 @@ inline double exponentialInOut( double t, double b, double c, double d ) { return b + c; if ( ( t /= d / 2 ) < 1 ) - return c / 2 * eepow( 2, 10 * (t - 1) ) + b; + return c / 2 * pow( 2, 10 * (t - 1) ) + b; - return c / 2 * ( -eepow( 2, -10 * --t ) + 2 ) + b; + return c / 2 * ( -pow( 2, -10 * --t ) + 2 ) + b; } inline double quarticIn( double t, double b, double c, double d ) { @@ -223,24 +223,24 @@ inline double quinticInOut( double t, double b, double c, double d ) { inline double circularIn( double t, double b, double c, double d ) { t /= d; - return -c * ( eesqrt( 1 - t * t ) - 1) + b; + return -c * ( sqrt( 1 - t * t ) - 1) + b; } inline double circularOut( double t, double b, double c, double d ) { t = t / d - 1; - return c * eesqrt( 1 - t * t ) + b; + return c * sqrt( 1 - t * t ) + b; } inline double circularInOut( double t, double b, double c, double d ) { t /= d / 2; if ( t < 1 ) - return -c / 2 * ( eesqrt( 1 - t * t ) - 1 ) + b; + return -c / 2 * ( sqrt( 1 - t * t ) - 1 ) + b; t -= 2; - return c / 2 * ( eesqrt( 1 - t * t ) + 1) + b; + return c / 2 * ( sqrt( 1 - t * t ) + 1) + b; } inline double cubicIn( double t, double b, double c, double d ) { @@ -283,7 +283,7 @@ inline double backOut( double t, double b, double c, double d ) { } inline double backInOut( double t, double b, double c, double d ) { - float s = 1.70158f; + double s = 1.70158f; t /= d / 2; s *= ( 1.525f ); @@ -370,7 +370,7 @@ inline double elasticInOut( double t, double b, double c, double d ) { if ( t == 2 ) return b + c; - double p = d * ( 0.3f * 1.5f ); + double p = d * ( 0.3 * 1.5 ); double a = c; double s = p / 4.f; diff --git a/include/eepp/physics/space.hpp b/include/eepp/physics/space.hpp index d28c4db23..5891a59ad 100644 --- a/include/eepp/physics/space.hpp +++ b/include/eepp/physics/space.hpp @@ -64,6 +64,7 @@ class CP_API Space { class BBQuery { public: BBQuery() : + Space( NULL ), Data( NULL ) {} @@ -74,7 +75,9 @@ class CP_API Space { class SegmentQuery { public: - SegmentQuery() + SegmentQuery() : + Space( NULL ), + Data( NULL ) {} Physics::Space * Space; @@ -85,6 +88,7 @@ class CP_API Space { class PointQuery { public: PointQuery() : + Space( NULL ), Data( NULL ) {} diff --git a/include/eepp/system/virtualfilesystem.hpp b/include/eepp/system/virtualfilesystem.hpp index 5fdeab204..6ebdf3487 100644 --- a/include/eepp/system/virtualfilesystem.hpp +++ b/include/eepp/system/virtualfilesystem.hpp @@ -27,7 +27,7 @@ class EE_API VirtualFileSystem : protected Container { std::string path; Pack * pack; - vfsFile() {} + vfsFile() : pack( NULL ) {} vfsFile( const std::string& path, Pack * pack ) : path( path ), diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index 06c7dd6aa..e6134ef72 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -114,9 +114,12 @@ class WindowInfo { public: inline WindowInfo() : + Backend( WindowBackend::Default ), + Flags(0), ClearColor(0,0,0), Created( false ), - Maximized( false ) + Maximized( false ), + Context(0) {} WindowSettings WindowConfig; diff --git a/premake4.lua b/premake4.lua index 0e7cc96c4..9d1d66755 100644 --- a/premake4.lua +++ b/premake4.lua @@ -137,9 +137,8 @@ if _OPTIONS.platform then premake.gcc.platforms['Native'] = premake.gcc.platforms[_OPTIONS.platform] end -newoption { trigger = "with-ssl", description = "Enables SSL support for the Network module ( by default uses mbedtls. )" } newoption { trigger = "with-openssl", description = "Enables OpenSSL support ( and disables mbedtls backend )." } -newoption { trigger = "with-static-freetype", description = "Build freetype as a static library." } +newoption { trigger = "with-dynamic-freetype", description = "Dynamic link against freetype." } newoption { trigger = "with-static-eepp", description = "Force to build the demos and tests with eepp compiled statically" } newoption { trigger = "with-static-backend", description = "It will try to compile the library with a static backend (only for gcc and mingw).\n\t\t\t\tThe backend should be placed in libs/your_platform/libYourBackend.a" } newoption { trigger = "with-gles2", description = "Compile with GLES2 support" } @@ -505,8 +504,7 @@ function add_static_links() end end - if _OPTIONS["with-static-freetype"] or not os_findlib("freetype") then - print("Enabled static freetype") + if not _OPTIONS["with-dynamic-freetype"] then links { "freetype-static" } end @@ -520,7 +518,7 @@ function add_static_links() "vorbis-static" } - if _OPTIONS["with-ssl"] and not _OPTIONS["with-openssl"] then + if not _OPTIONS["with-openssl"] then links { "mbedtls-static" } end @@ -666,29 +664,25 @@ function select_backend() end function check_ssl_support() - if _OPTIONS["with-ssl"] then - print("Enabled SSL support") - - if _OPTIONS["with-openssl"] then - if os.is("windows") then - table.insert( link_list, get_backend_link_name( "libssl" ) ) - table.insert( link_list, get_backend_link_name( "libcrypto" ) ) - else - table.insert( link_list, get_backend_link_name( "ssl" ) ) - table.insert( link_list, get_backend_link_name( "crypto" ) ) - end - - files { "src/eepp/network/ssl/backend/openssl/*.cpp" } - - defines { "EE_OPENSSL" } + if _OPTIONS["with-openssl"] then + if os.is("windows") then + table.insert( link_list, get_backend_link_name( "libssl" ) ) + table.insert( link_list, get_backend_link_name( "libcrypto" ) ) else - files { "src/eepp/network/ssl/backend/mbedtls/*.cpp" } - - defines { "EE_MBEDTLS" } + table.insert( link_list, get_backend_link_name( "ssl" ) ) + table.insert( link_list, get_backend_link_name( "crypto" ) ) end - defines { "EE_SSL_SUPPORT" } + files { "src/eepp/network/ssl/backend/openssl/*.cpp" } + + defines { "EE_OPENSSL" } + else + files { "src/eepp/network/ssl/backend/mbedtls/*.cpp" } + + defines { "EE_MBEDTLS" } end + + defines { "EE_SSL_SUPPORT" } end function build_eepp( build_name ) @@ -742,7 +736,7 @@ function build_eepp( build_name ) select_backend() - if not _OPTIONS["with-static-freetype"] and os_findlib("freetype") then + if _OPTIONS["with-dynamic-freetype"] and os_findlib("freetype") then table.insert( link_list, get_backend_link_name( "freetype" ) ) end @@ -818,7 +812,7 @@ solution "eepp" build_base_configuration( "glew" ) end - if _OPTIONS["with-ssl"] and not _OPTIONS["with-openssl"] then + if not _OPTIONS["with-openssl"] then project "mbedtls-static" kind "StaticLib" language "C" diff --git a/premake5.lua b/premake5.lua index f62d677c2..c86fb4bee 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,8 +1,7 @@ require "premake/modules/androidmk" -newoption { trigger = "with-ssl", description = "Enables SSL support for the Network module ( by default uses mbedtls. )" } newoption { trigger = "with-openssl", description = "Enables OpenSSL support ( and disables mbedtls backend )." } -newoption { trigger = "with-static-freetype", description = "Build freetype as a static library." } +newoption { trigger = "with-dynamic-freetype", description = "Dynamic link against freetype." } newoption { trigger = "with-static-eepp", description = "Force to build the demos and tests with eepp compiled statically" } newoption { trigger = "with-static-backend", description = "It will try to compile the library with a static backend (only for gcc and mingw).\n\t\t\t\tThe backend should be placed in libs/your_platform/libYourBackend.a" } newoption { trigger = "with-gles2", description = "Compile with GLES2 support" } @@ -276,6 +275,10 @@ function build_link_configuration( package_name, use_ee_icon ) configuration "windows" add_cross_config_links() + + if is_vs() and table.contains( backends, "SDL2" ) then + links { "SDL2", "SDL2main" } + end configuration "emscripten" linkoptions{ "-O2 -s TOTAL_MEMORY=67108864 -s ASM_JS=1 -s VERBOSE=1 -s DISABLE_EXCEPTION_CATCHING=0 -s USE_SDL=2 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s FULL_ES3=1 -s \"BINARYEN_TRAP_MODE='clamp'\"" } @@ -340,8 +343,7 @@ function add_static_links() end end - if _OPTIONS["with-static-freetype"] or not os_findlib("freetype") then - print("Enabled static freetype") + if not _OPTIONS["with-dynamic-freetype"] then links { "freetype-static" } end @@ -355,7 +357,7 @@ function add_static_links() "vorbis-static" } - if _OPTIONS["with-ssl"] and not _OPTIONS["with-openssl"] then + if not _OPTIONS["with-openssl"] then links { "mbedtls-static" } end @@ -385,6 +387,8 @@ function add_sdl2() else insert_static_backend( "SDL2" ) end + + table.insert( backends, "SDL2" ) end function add_sfml() @@ -399,6 +403,8 @@ function add_sfml() insert_static_backend( "libsfml-system" ) insert_static_backend( "libsfml-window" ) end + + table.insert( backends, "SFML" ) end function set_xcode_config() @@ -495,35 +501,31 @@ function select_backend() add_sfml() else print("ERROR: Couldnt find any backend. Forced SDL2.") - add_sdl2( true ) + add_sdl2() end end end function check_ssl_support() - if _OPTIONS["with-ssl"] then - print("Enabled SSL support") - - if _OPTIONS["with-openssl"] then - if os.istarget("windows") then - table.insert( link_list, get_backend_link_name( "libssl" ) ) - table.insert( link_list, get_backend_link_name( "libcrypto" ) ) - else - table.insert( link_list, get_backend_link_name( "ssl" ) ) - table.insert( link_list, get_backend_link_name( "crypto" ) ) - end - - files { "src/eepp/network/ssl/backend/openssl/*.cpp" } - - defines { "EE_OPENSSL" } + if _OPTIONS["with-openssl"] then + if os.istarget("windows") then + table.insert( link_list, get_backend_link_name( "libssl" ) ) + table.insert( link_list, get_backend_link_name( "libcrypto" ) ) else - files { "src/eepp/network/ssl/backend/mbedtls/*.cpp" } - - defines { "EE_MBEDTLS" } + table.insert( link_list, get_backend_link_name( "ssl" ) ) + table.insert( link_list, get_backend_link_name( "crypto" ) ) end - defines { "EE_SSL_SUPPORT" } + files { "src/eepp/network/ssl/backend/openssl/*.cpp" } + + defines { "EE_OPENSSL" } + else + files { "src/eepp/network/ssl/backend/mbedtls/*.cpp" } + + defines { "EE_MBEDTLS" } end + + defines { "EE_SSL_SUPPORT" } end function build_eepp( build_name ) @@ -577,7 +579,7 @@ function build_eepp( build_name ) select_backend() - if not _OPTIONS["with-static-freetype"] and os_findlib("freetype") then + if _OPTIONS["with-dynamic-freetype"] and os_findlib("freetype") then table.insert( link_list, get_backend_link_name( "freetype" ) ) end @@ -660,7 +662,7 @@ workspace "eepp" build_base_configuration( "glew" ) end - if _OPTIONS["with-ssl"] and not _OPTIONS["with-openssl"] then + if not _OPTIONS["with-openssl"] then project "mbedtls-static" kind "StaticLib" language "C" diff --git a/projects/emscripten/make.sh b/projects/emscripten/make.sh index b21c78c91..91bba1597 100755 --- a/projects/emscripten/make.sh +++ b/projects/emscripten/make.sh @@ -1,6 +1,6 @@ #!/bin/sh cd $(dirname "$0") -premake4 --file=../../premake4.lua --with-gles1 --with-gles2 --with-static-eepp --with-static-freetype --platform=emscripten --with-backend=SDL2 gmake +premake4 --file=../../premake4.lua --with-gles1 --with-gles2 --with-static-eepp --platform=emscripten --with-backend=SDL2 gmake cd ../../make/emscripten/ ln -sf ../../bin/assets/ ./ sed -i 's/-rcs/rcs/g' *.make diff --git a/projects/ios/compile-arm7.sh b/projects/ios/compile-arm7.sh index 7cfd933dd..5fcabb786 100755 --- a/projects/ios/compile-arm7.sh +++ b/projects/ios/compile-arm7.sh @@ -12,7 +12,7 @@ if [ -z "$SYSROOTPATH" ]; then export SYSROOTPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$IOSVERSION.sdk/ fi -premake4 --file=../../premake4.lua --platform=ios-arm7 --with-static-freetype --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake +premake4 --file=../../premake4.lua --platform=ios-arm7 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake cd ../../make/ios-arm7/ make $@ eepp-static diff --git a/projects/ios/compile-x86.sh b/projects/ios/compile-x86.sh index 35cc48b5f..f75a75113 100755 --- a/projects/ios/compile-x86.sh +++ b/projects/ios/compile-x86.sh @@ -12,7 +12,7 @@ if [ -z "$SYSROOTPATH" ]; then export SYSROOTPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$IOSVERSION.sdk/ fi -premake4 --file=../../premake4.lua --platform=ios-x86 --with-static-freetype --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake +premake4 --file=../../premake4.lua --platform=ios-x86 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake cd ../../make/ios-x86/ make $@ eepp-static diff --git a/projects/ios/cross-compile-arm7.sh b/projects/ios/cross-compile-arm7.sh index 3581967f9..08352d300 100755 --- a/projects/ios/cross-compile-arm7.sh +++ b/projects/ios/cross-compile-arm7.sh @@ -1,7 +1,7 @@ #!/bin/sh cd $(dirname "$0") -premake4 --file=../../premake4.lua --platform=ios-cross-arm7 --with-static-freetype --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake +premake4 --file=../../premake4.lua --platform=ios-cross-arm7 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake cd ../../make/ios-cross-arm7/ make $@ diff --git a/projects/ios/cross-compile-x86.sh b/projects/ios/cross-compile-x86.sh index 5c223e881..e993ace18 100755 --- a/projects/ios/cross-compile-x86.sh +++ b/projects/ios/cross-compile-x86.sh @@ -1,7 +1,7 @@ #!/bin/sh cd $(dirname "$0") -premake4 --file=../../premake4.lua --platform=ios-cross-x86 --with-static-freetype --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake +premake4 --file=../../premake4.lua --platform=ios-cross-x86 --with-static-eepp --with-gles1 --with-gles2 --with-static-backend gmake cd ../../make/ios-cross-x86/ make $@ diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 36e5518d5..703cbe9a0 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -80,7 +80,7 @@ true - --with-static-backend --with-ssl gmake + gmake premake4 %{buildDir}../../../ Custom Process Step @@ -171,7 +171,7 @@ true - --with-static-backend --with-ssl --with-backend=SDL2,SFML gmake + --with-backend=SDL2,SFML gmake premake4 %{buildDir}../../../ Custom Process Step @@ -221,7 +221,7 @@ true - --with-static-backend --with-ssl gmake + gmake premake4 %{buildDir}../../../ Custom Process Step @@ -640,7 +640,7 @@ true - --with-static-backend --with-ssl gmake + gmake premake4 %{buildDir}../../../ Custom Process Step @@ -813,7 +813,7 @@ true - --with-static-backend --with-ssl gmake + gmake premake4 %{buildDir}../../../ Custom Process Step diff --git a/projects/mingw32/make.sh b/projects/mingw32/make.sh index 620123acb..d1030d815 100755 --- a/projects/mingw32/make.sh +++ b/projects/mingw32/make.sh @@ -1,6 +1,6 @@ #!/bin/sh cd $(dirname "$0") -premake4 --file=../../premake4.lua --os=windows --platform=mingw32 --with-static-freetype --with-ssl gmake +premake4 --file=../../premake4.lua --os=windows --platform=mingw32 gmake cd ../../make/mingw32/ make $@ diff --git a/projects/osx/make.sh b/projects/osx/make.sh index baab901fe..007e79b83 100755 --- a/projects/osx/make.sh +++ b/projects/osx/make.sh @@ -1,6 +1,6 @@ #!/bin/sh cd $(dirname "$0") -/usr/local/bin/premake4 --file=../../premake4.lua --with-static-freetype --use-frameworks gmake +/usr/local/bin/premake4 --file=../../premake4.lua --use-frameworks gmake cd ../../make/macosx/ sed -e "s/-Wl,-x//g" -i .make diff --git a/projects/windows/ee.config b/projects/windows/ee.config index e41d720ed..0ad67c1e2 100644 --- a/projects/windows/ee.config +++ b/projects/windows/ee.config @@ -12,3 +12,4 @@ #define EE_GL3_ENABLED #define EE_SHADERS_SUPPORTED #define EE_BACKEND_SDL_ACTIVE +#define EE_EXPORTS diff --git a/src/eepp/system/filesystem.cpp b/src/eepp/system/filesystem.cpp index c42e4b1bd..260f17124 100644 --- a/src/eepp/system/filesystem.cpp +++ b/src/eepp/system/filesystem.cpp @@ -231,7 +231,11 @@ bool FileSystem::isDirectory( const std::string& path ) { struct stat st; return ( stat( path.c_str(), &st ) == 0 ) && S_ISDIR( st.st_mode ); #else + #if UNICODE + return 0 != (GetFileAttributes(String::fromUtf8(path).toWideString().c_str()) & FILE_ATTRIBUTE_DIRECTORY); + #else return 0 != ( GetFileAttributes( (LPCTSTR) path.c_str() ) & FILE_ATTRIBUTE_DIRECTORY ); + #endif #endif } @@ -537,7 +541,7 @@ std::string FileSystem::getCurrentWorkingDirectory() { #ifdef EE_COMPILER_MSVC #if defined( UNICODE ) && !defined( EE_NO_WIDECHAR ) wchar_t dir[_MAX_PATH]; - return ( 0 != GetCurrentDirectoryW( _MAX_PATH, dir ) ) ? String( dir )::toUtf8() : std::string(); + return ( 0 != GetCurrentDirectoryW( _MAX_PATH, dir ) ) ? String( dir ).toUtf8() : std::string(); #else char dir[_MAX_PATH]; return ( 0 != GetCurrentDirectory( _MAX_PATH, dir ) ) ? String( dir, std::locale() ).toUtf8() : std::string(); diff --git a/src/eepp/system/log.cpp b/src/eepp/system/log.cpp index d76aa4a60..6d3d1489e 100755 --- a/src/eepp/system/log.cpp +++ b/src/eepp/system/log.cpp @@ -66,7 +66,11 @@ void Log::write( std::string Text, const bool& newLine ) { #if EE_PLATFORM == EE_PLATFORM_ANDROID __android_log_print( ANDROID_LOG_INFO, "eepp", "%s", Text.c_str() ); #elif defined( EE_COMPILER_MSVC ) + #ifdef UNICODE + OutputDebugString( String::fromUtf8( Text ).toWideString().c_str() ); + #else OutputDebugString( Text.c_str() ); + #endif #else std::cout << Text; #endif @@ -124,7 +128,11 @@ void Log::writef( const char* format, ... ) { #if EE_PLATFORM == EE_PLATFORM_ANDROID __android_log_print( ANDROID_LOG_INFO, "eepp", "%s", tstr.c_str() ); #elif defined( EE_COMPILER_MSVC ) - OutputDebugString( tstr.c_str() ); + #ifdef UNICODE + OutputDebugString( String::fromUtf8(tstr).toWideString().c_str() ); + #else + OutputDebugString(tstr.c_str()); + #endif #else std::cout << tstr; #endif diff --git a/src/eepp/system/sys.cpp b/src/eepp/system/sys.cpp index c319b17d3..e15950ee6 100644 --- a/src/eepp/system/sys.cpp +++ b/src/eepp/system/sys.cpp @@ -753,9 +753,12 @@ void * Sys::loadObject( const std::string& sofile ) { return (handle); #elif EE_PLATFORM == EE_PLATFORM_WIN - LPTSTR tstr = const_cast( sofile.c_str() ); - void * handle = (void *) LoadLibrary(tstr); - + #ifdef UNICODE + void* handle = (void*)LoadLibrary(String::fromUtf8(sofile).toWideString().c_str()); + #else + LPTSTR tstr = const_cast(sofile.c_str()); + void* handle = (void*)LoadLibrary(tstr); + #endif /* Generate an error message if all loads failed */ if ( handle == NULL ) { WIN_SetError( "Failed loading " + sofile ); diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index f39ecf05b..3751a7e8f 100755 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -51,6 +51,7 @@ Engine::Engine() : mSharedGLContext( true ), mMainThreadId( 0 ), mPlatformHelper( NULL ), + mZip( NULL ), mDisplayManager( NULL ) { #if EE_PLATFORM == EE_PLATFORM_ANDROID diff --git a/src/eepp/window/platform/win/winimpl.cpp b/src/eepp/window/platform/win/winimpl.cpp index 880cf430c..8762a1464 100644 --- a/src/eepp/window/platform/win/winimpl.cpp +++ b/src/eepp/window/platform/win/winimpl.cpp @@ -21,9 +21,15 @@ static BOOL WIN_showWindow( HWND hWnd, int nCmdShow ) { namespace EE { namespace Window { namespace Platform { +#ifdef UNICODE +#define WIN_CHAR_TYPE LPWSTR +#else +#define WIN_CHAR_TYPE LPCSTR +#endif + static HCURSOR SYS_CURSORS[ Cursor::SysCursorCount ] = {0}; -static HCURSOR GetLoadCursor( const Cursor::SysType& cursor, LPCSTR syscur ) { +static HCURSOR GetLoadCursor( const Cursor::SysType& cursor, WIN_CHAR_TYPE syscur ) { if ( 0 == SYS_CURSORS[ cursor ] ) { SYS_CURSORS[ cursor ] = LoadCursor( NULL, syscur ); }