From 2a4da03f103448a69c48ee66e415f8dd2d617f58 Mon Sep 17 00:00:00 2001 From: Antony Jones Date: Sun, 3 May 2015 15:18:56 -0600 Subject: Added Visual Studio project generation. Use "vsproj=yes" in command line. This does not set up NMAKE properly. --- platform/windows/SCsub | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'platform/windows') diff --git a/platform/windows/SCsub b/platform/windows/SCsub index a77428e954..1ad32e7989 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -12,3 +12,9 @@ common_win=[ ] env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX"]) + +# Microsoft Visual Studio Project Generation +if (env['vsproj'])=="yes": + env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] + for x in common_win: + env.vs_srcs = env.vs_srcs + ["platform/windows/" + x] -- cgit v1.2.3 From 7f5b744b92256e42aa3c700ee88d8318732935c6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 4 May 2015 13:12:05 -0300 Subject: small unicode fixes --- platform/windows/os_windows.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'platform/windows') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 414c250bd4..534d62664b 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2110,12 +2110,13 @@ bool OS_Windows::has_environment(const String& p_var) const { String OS_Windows::get_environment(const String& p_var) const { - char* val = getenv(p_var.utf8().get_data()); - if (val) - return val; - + wchar_t wval[0x7Fff]; // MSDN says 32767 char is the maximum + int wlen = GetEnvironmentVariableW(p_var.c_str(),wval,0x7Fff); + if ( wlen > 0 ) { + return wval; + } return ""; -}; +} String OS_Windows::get_stdin_string(bool p_block) { -- cgit v1.2.3 From 43c41fc9f9f96a2e30224a2b454af109ce07fbb1 Mon Sep 17 00:00:00 2001 From: yg2f Date: Mon, 4 May 2015 20:26:49 +0200 Subject: fixes issue #1693 winmain and main unicode makes WinMain() and main() accepts unicode characters into arguments --- platform/windows/godot_win.cpp | 107 ++++++++++------------------------------- 1 file changed, 25 insertions(+), 82 deletions(-) (limited to 'platform/windows') diff --git a/platform/windows/godot_win.cpp b/platform/windows/godot_win.cpp index 0e74f63510..81c90d9dd0 100644 --- a/platform/windows/godot_win.cpp +++ b/platform/windows/godot_win.cpp @@ -115,29 +115,24 @@ PCHAR* return argv; } -char* mb_to_utf8(const char* mbs) { - - int wlen = MultiByteToWideChar(CP_ACP,0,mbs,-1,NULL,0); // returns 0 if failed - wchar_t *wbuf = new wchar_t[wlen + 1]; - MultiByteToWideChar(CP_ACP,0,mbs,-1,wbuf,wlen); - wbuf[wlen]=0; - - int ulen = WideCharToMultiByte(CP_UTF8,0,wbuf,-1,NULL,0,NULL,NULL); +char* wc_to_utf8(const wchar_t* wc) { + int ulen = WideCharToMultiByte(CP_UTF8,0,wc,-1,NULL,0,NULL,NULL); char * ubuf = new char[ulen + 1]; - WideCharToMultiByte(CP_UTF8,0,wbuf,-1,ubuf,ulen,NULL,NULL); + WideCharToMultiByte(CP_UTF8,0,wc,-1,ubuf,ulen,NULL,NULL); ubuf[ulen] = 0; return ubuf; } -int main(int argc, char** argv) { +int widechar_main(int argc, wchar_t** argv) { OS_Windows os(NULL); setlocale(LC_CTYPE, ""); char ** argv_utf8 = new char*[argc]; + for(int i=0; i Date: Sat, 9 May 2015 15:46:59 -0600 Subject: Change windows build to use CFlag /Od so that you get the full debug experience. Without this flag set, Visual Studio lets you use breakpoints, but the watch and locals is pretty much useless. --- platform/windows/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/windows') diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 9cdf04797c..298fa3bc78 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -204,7 +204,7 @@ def configure(env): elif (env["target"]=="debug"): - env.Append(CCFLAGS=['/Zi','/DDEBUG_ENABLED','/DDEBUG_MEMORY_ENABLED','/DD3D_DEBUG_INFO','/O1']) + env.Append(CCFLAGS=['/Zi','/DDEBUG_ENABLED','/DDEBUG_MEMORY_ENABLED','/DD3D_DEBUG_INFO','/Od']) env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) env.Append(LINKFLAGS=['/DEBUG']) -- cgit v1.2.3