Windows fixes and some changes in the premake projects.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2019-06-19 03:15:47 -03:00
parent 208efb5436
commit dd9d2021f2
22 changed files with 125 additions and 93 deletions

View File

@@ -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/`

View File

@@ -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

View File

@@ -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;

View File

@@ -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 )
{}

View File

@@ -27,7 +27,7 @@ class EE_API VirtualFileSystem : protected Container<Pack> {
std::string path;
Pack * pack;
vfsFile() {}
vfsFile() : pack( NULL ) {}
vfsFile( const std::string& path, Pack * pack ) :
path( path ),

View File

@@ -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;

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 $@

View File

@@ -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 $@

View File

@@ -80,7 +80,7 @@
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--with-static-backend --with-ssl gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Command">premake4</value>
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}../../../</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
@@ -171,7 +171,7 @@
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--with-static-backend --with-ssl --with-backend=SDL2,SFML gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--with-backend=SDL2,SFML gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Command">premake4</value>
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}../../../</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
@@ -221,7 +221,7 @@
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--with-static-backend --with-ssl gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Command">premake4</value>
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}../../../</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
@@ -640,7 +640,7 @@
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--with-static-backend --with-ssl gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Command">premake4</value>
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}../../../</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
@@ -813,7 +813,7 @@
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--with-static-backend --with-ssl gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">gmake</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Command">premake4</value>
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}../../../</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>

View File

@@ -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 $@

View File

@@ -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

View File

@@ -12,3 +12,4 @@
#define EE_GL3_ENABLED
#define EE_SHADERS_SUPPORTED
#define EE_BACKEND_SDL_ACTIVE
#define EE_EXPORTS

View File

@@ -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();

View File

@@ -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

View File

@@ -753,9 +753,12 @@ void * Sys::loadObject( const std::string& sofile ) {
return (handle);
#elif EE_PLATFORM == EE_PLATFORM_WIN
LPTSTR tstr = const_cast<char*>( 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<char*>(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 );

View File

@@ -51,6 +51,7 @@ Engine::Engine() :
mSharedGLContext( true ),
mMainThreadId( 0 ),
mPlatformHelper( NULL ),
mZip( NULL ),
mDisplayManager( NULL )
{
#if EE_PLATFORM == EE_PLATFORM_ANDROID

View File

@@ -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 );
}