diff options
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/android/audio_driver_jandroid.cpp | 2 | ||||
| -rw-r--r-- | platform/android/export/export.cpp | 28 | ||||
| -rw-r--r-- | platform/android/godot_android.cpp | 1 | ||||
| -rw-r--r-- | platform/android/java/src/org/godotengine/godot/Godot.java | 12 | ||||
| -rw-r--r-- | platform/android/java_glue.cpp | 4 | ||||
| -rw-r--r-- | platform/haiku/audio_driver_media_kit.cpp | 2 | ||||
| -rw-r--r-- | platform/iphone/view_controller.mm | 2 | ||||
| -rw-r--r-- | platform/osx/audio_driver_osx.cpp | 102 | ||||
| -rw-r--r-- | platform/osx/audio_driver_osx.h | 4 | ||||
| -rw-r--r-- | platform/osx/os_osx.mm | 11 | ||||
| -rw-r--r-- | platform/uwp/app.cpp | 2 | ||||
| -rw-r--r-- | platform/uwp/export/export.cpp | 2 | ||||
| -rw-r--r-- | platform/windows/detect.py | 61 | ||||
| -rw-r--r-- | platform/windows/os_windows.cpp | 7 | ||||
| -rw-r--r-- | platform/x11/context_gl_x11.cpp | 14 | ||||
| -rw-r--r-- | platform/x11/os_x11.cpp | 11 |
16 files changed, 145 insertions, 120 deletions
diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp index d293f3ed30..763eff2863 100644 --- a/platform/android/audio_driver_jandroid.cpp +++ b/platform/android/audio_driver_jandroid.cpp @@ -81,7 +81,7 @@ Error AudioDriverAndroid::init() { int latency = GLOBAL_DEF("audio/output_latency", 25); latency = 50; - unsigned int buffer_size = nearest_power_of_2(latency * mix_rate / 1000); + unsigned int buffer_size = next_power_of_2(latency * mix_rate / 1000); if (OS::get_singleton()->is_stdout_verbose()) { print_line("audio buffer size: " + itos(buffer_size)); } diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 3c52834d92..ee93c29577 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1220,10 +1220,10 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d /*String host = EditorSettings::get_singleton()->get("filesystem/file_server/host"); int port = EditorSettings::get_singleton()->get("filesystem/file_server/post"); String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password"); - cl.push_back("-rfs"); + cl.push_back("--remote-fs"); cl.push_back(host+":"+itos(port)); if (passwd!="") { - cl.push_back("-rfs_pass"); + cl.push_back("--remote-fs-password"); cl.push_back(passwd); }*/ @@ -1243,10 +1243,10 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d err = save_pack(pf); memdelete(pf); - cl.push_back("-use_apk_expansion"); - cl.push_back("-apk_expansion_md5"); + cl.push_back("--use_apk_expansion"); + cl.push_back("--apk_expansion_md5"); cl.push_back(FileAccess::get_md5(fullpath)); - cl.push_back("-apk_expansion_key"); + cl.push_back("--apk_expansion_key"); cl.push_back(apk_expansion_pkey.strip_edges()); } else { @@ -1262,10 +1262,10 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d } if (use_32_fb) - cl.push_back("-use_depth_32"); + cl.push_back("--use_depth_32"); if (immersive) - cl.push_back("-use_immersive"); + cl.push_back("--use_immersive"); if (cl.size()) { //add comandline @@ -3330,10 +3330,10 @@ public: /*String host = EditorSettings::get_singleton()->get("filesystem/file_server/host"); int port = EditorSettings::get_singleton()->get("filesystem/file_server/post"); String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password"); - cl.push_back("-rfs"); + cl.push_back("--remote-fs"); cl.push_back(host+":"+itos(port)); if (passwd!="") { - cl.push_back("-rfs_pass"); + cl.push_back("--remote-fs-password"); cl.push_back(passwd); }*/ @@ -3350,10 +3350,10 @@ public: return OK; } - cl.push_back("-use_apk_expansion"); - cl.push_back("-apk_expansion_md5"); + cl.push_back("--use_apk_expansion"); + cl.push_back("--apk_expansion_md5"); cl.push_back(FileAccess::get_md5(fullpath)); - cl.push_back("-apk_expansion_key"); + cl.push_back("--apk_expansion_key"); cl.push_back(apk_expansion_pkey.strip_edges()); } else { @@ -3367,10 +3367,10 @@ public: } if (use_32_fb) - cl.push_back("-use_depth_32"); + cl.push_back("--use_depth_32"); if (immersive) - cl.push_back("-use_immersive"); + cl.push_back("--use_immersive"); if (cl.size()) { //add comandline diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index 6fbd42d7b3..5933b83d06 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -616,7 +616,6 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) { //do initialization here, when there's OpenGL! hackish but the only way engine->os = new OS_Android(_gfx_init, engine); - //char *args[]={"-test","gui",NULL}; __android_log_print(ANDROID_LOG_INFO, "godot", "pre asdasd setup..."); #if 0 Error err = Main::setup("apk",2,args); diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index d620b2b9c4..d444d37c2f 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -387,7 +387,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC new_cmdline = new String[ 2 ]; } - new_cmdline[cll]="-main_pack"; + new_cmdline[cll]="--main_pack"; new_cmdline[cll+1]=expansion_pack_path; command_line=new_cmdline; } @@ -452,9 +452,9 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC for(int i=0;i<command_line.length;i++) { boolean has_extra = i< command_line.length -1; - if (command_line[i].equals("-use_depth_32")) { + if (command_line[i].equals("--use_depth_32")) { use_32_bits=true; - } else if (command_line[i].equals("-use_immersive")) { + } else if (command_line[i].equals("--use_immersive")) { use_immersive=true; if(Build.VERSION.SDK_INT >= 19.0){ // check if the application runs on an android 4.4+ window.getDecorView().setSystemUiVisibility( @@ -467,12 +467,12 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC UiChangeListener(); } - } else if (command_line[i].equals("-use_apk_expansion")) { + } else if (command_line[i].equals("--use_apk_expansion")) { use_apk_expansion=true; - } else if (has_extra && command_line[i].equals("-apk_expansion_md5")) { + } else if (has_extra && command_line[i].equals("--apk_expansion_md5")) { main_pack_md5=command_line[i+1]; i++; - } else if (has_extra && command_line[i].equals("-apk_expansion_key")) { + } else if (has_extra && command_line[i].equals("--apk_expansion_key")) { main_pack_key=command_line[i+1]; SharedPreferences prefs = getSharedPreferences("app_data_keys", MODE_PRIVATE); Editor editor = prefs.edit(); diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 683e1cfb22..eb139fb471 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -844,7 +844,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en } else { //__android_log_print(ANDROID_LOG_INFO,"godot","cmdline arg %i is: %s\n",i,rawString); - if (strcmp(rawString, "-main_pack") == 0) + if (strcmp(rawString, "--main_pack") == 0) use_apk_expansion = true; } @@ -867,7 +867,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en __android_log_print(ANDROID_LOG_INFO, "godot", "**SETUP"); #if 0 - char *args[]={"-test","render",NULL}; + char *args[]={"--test","render",NULL}; __android_log_print(ANDROID_LOG_INFO,"godot","pre asdasd setup..."); Error err = Main::setup("apk",2,args,false); #else diff --git a/platform/haiku/audio_driver_media_kit.cpp b/platform/haiku/audio_driver_media_kit.cpp index 93351e0799..802f6b2d32 100644 --- a/platform/haiku/audio_driver_media_kit.cpp +++ b/platform/haiku/audio_driver_media_kit.cpp @@ -43,7 +43,7 @@ Error AudioDriverMediaKit::init() { channels = 2; int latency = GLOBAL_DEF("audio/output_latency", 25); - buffer_size = nearest_power_of_2(latency * mix_rate / 1000); + buffer_size = next_power_of_2(latency * mix_rate / 1000); samples_in = memnew_arr(int32_t, buffer_size * channels); media_raw_audio_format format; diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index 574598e1d3..921ef8f607 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -42,7 +42,7 @@ int add_path(int p_argc, char **p_args) { if (!str) return p_argc; - p_args[p_argc++] = "-path"; + p_args[p_argc++] = "--path"; [str retain]; // memory leak lol (maybe make it static here and delete it in ViewController destructor? @todo p_args[p_argc++] = (char *)[str cString]; p_args[p_argc] = NULL; diff --git a/platform/osx/audio_driver_osx.cpp b/platform/osx/audio_driver_osx.cpp index d7a91b1653..da5cd8f65e 100644 --- a/platform/osx/audio_driver_osx.cpp +++ b/platform/osx/audio_driver_osx.cpp @@ -30,6 +30,10 @@ #ifdef OSX_ENABLED #include "audio_driver_osx.h" +#include "core/project_settings.h" +#include "os/os.h" + +#define kOutputBus 0 static OSStatus outputDeviceAddressCB(AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses, void *__nullable inClientData) { AudioDriverOSX *driver = (AudioDriverOSX *)inClientData; @@ -40,42 +44,69 @@ static OSStatus outputDeviceAddressCB(AudioObjectID inObjectID, UInt32 inNumberA } Error AudioDriverOSX::initDevice() { + AudioComponentDescription desc; + zeromem(&desc, sizeof(desc)); + desc.componentType = kAudioUnitType_Output; + desc.componentSubType = kAudioUnitSubType_HALOutput; + desc.componentManufacturer = kAudioUnitManufacturer_Apple; + + AudioComponent comp = AudioComponentFindNext(NULL, &desc); + ERR_FAIL_COND_V(comp == NULL, FAILED); + + OSStatus result = AudioComponentInstanceNew(comp, &audio_unit); + ERR_FAIL_COND_V(result != noErr, FAILED); + AudioStreamBasicDescription strdesc; + + // TODO: Implement this + /*zeromem(&strdesc, sizeof(strdesc)); + UInt32 size = sizeof(strdesc); + result = AudioUnitGetProperty(audio_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, kOutputBus, &strdesc, &size); + ERR_FAIL_COND_V(result != noErr, FAILED); + + switch (strdesc.mChannelsPerFrame) { + case 2: // Stereo + case 6: // Surround 5.1 + case 8: // Surround 7.1 + channels = strdesc.mChannelsPerFrame; + break; + + default: + // Unknown number of channels, default to stereo + channels = 2; + break; + }*/ + + mix_rate = GLOBAL_DEF("audio/mix_rate", 44100); + + zeromem(&strdesc, sizeof(strdesc)); strdesc.mFormatID = kAudioFormatLinearPCM; strdesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked; strdesc.mChannelsPerFrame = channels; - strdesc.mSampleRate = 44100; + strdesc.mSampleRate = mix_rate; strdesc.mFramesPerPacket = 1; strdesc.mBitsPerChannel = 16; strdesc.mBytesPerFrame = strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8; strdesc.mBytesPerPacket = strdesc.mBytesPerFrame * strdesc.mFramesPerPacket; - OSStatus result; - AURenderCallbackStruct callback; - AudioComponentDescription desc; - AudioComponent comp = NULL; - const AudioUnitElement output_bus = 0; - const AudioUnitElement bus = output_bus; - const AudioUnitScope scope = kAudioUnitScope_Input; - - zeromem(&desc, sizeof(desc)); - desc.componentType = kAudioUnitType_Output; - desc.componentSubType = kAudioUnitSubType_HALOutput; - desc.componentManufacturer = kAudioUnitManufacturer_Apple; + result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, kOutputBus, &strdesc, sizeof(strdesc)); + ERR_FAIL_COND_V(result != noErr, FAILED); - comp = AudioComponentFindNext(NULL, &desc); - ERR_FAIL_COND_V(comp == NULL, FAILED); + int latency = GLOBAL_DEF("audio/output_latency", 25); + unsigned int buffer_size = closest_power_of_2(latency * mix_rate / 1000); - result = AudioComponentInstanceNew(comp, &audio_unit); - ERR_FAIL_COND_V(result != noErr, FAILED); + if (OS::get_singleton()->is_stdout_verbose()) { + print_line("audio buffer size: " + itos(buffer_size) + " calculated latency: " + itos(buffer_size * 1000 / mix_rate)); + } - result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_StreamFormat, scope, bus, &strdesc, sizeof(strdesc)); - ERR_FAIL_COND_V(result != noErr, FAILED); + samples_in.resize(buffer_size); + buffer_frames = buffer_size / channels; + AURenderCallbackStruct callback; zeromem(&callback, sizeof(AURenderCallbackStruct)); callback.inputProc = &AudioDriverOSX::output_callback; callback.inputProcRefCon = this; - result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, scope, bus, &callback, sizeof(callback)); + result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, kOutputBus, &callback, sizeof(callback)); ERR_FAIL_COND_V(result != noErr, FAILED); result = AudioUnitInitialize(audio_unit); @@ -114,15 +145,10 @@ Error AudioDriverOSX::init() { result = AudioObjectAddPropertyListener(kAudioObjectSystemObject, &outputDeviceAddress, &outputDeviceAddressCB, this); ERR_FAIL_COND_V(result != noErr, FAILED); - const int samples = 1024; - samples_in = memnew_arr(int32_t, samples); // whatever - buffer_frames = samples / channels; - return initDevice(); }; Error AudioDriverOSX::reopen() { - Error err; bool restart = false; lock(); @@ -131,7 +157,7 @@ Error AudioDriverOSX::reopen() { restart = true; } - err = finishDevice(); + Error err = finishDevice(); if (err != OK) { ERR_PRINT("finishDevice failed"); unlock(); @@ -179,7 +205,7 @@ OSStatus AudioDriverOSX::output_callback(void *inRefCon, while (frames_left) { int frames = MIN(frames_left, ad->buffer_frames); - ad->audio_server_process(frames, ad->samples_in); + ad->audio_server_process(frames, ad->samples_in.ptr()); for (int j = 0; j < frames * ad->channels; j++) { @@ -232,29 +258,33 @@ bool AudioDriverOSX::try_lock() { } void AudioDriverOSX::finish() { - OSStatus result; - finishDevice(); - result = AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &outputDeviceAddress, &outputDeviceAddressCB, this); + OSStatus result = AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &outputDeviceAddress, &outputDeviceAddressCB, this); if (result != noErr) { ERR_PRINT("AudioObjectRemovePropertyListener failed"); } + AURenderCallbackStruct callback; + zeromem(&callback, sizeof(AURenderCallbackStruct)); + result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, kOutputBus, &callback, sizeof(callback)); + if (result != noErr) { + ERR_PRINT("AudioUnitSetProperty failed"); + } + if (mutex) { memdelete(mutex); mutex = NULL; } - - if (samples_in) { - memdelete_arr(samples_in); - samples_in = NULL; - } }; AudioDriverOSX::AudioDriverOSX() { + active = false; mutex = NULL; - samples_in = NULL; + + mix_rate = 44100; + channels = 2; + samples_in.clear(); }; AudioDriverOSX::~AudioDriverOSX(){}; diff --git a/platform/osx/audio_driver_osx.h b/platform/osx/audio_driver_osx.h index 287c9d6cbf..4576100690 100644 --- a/platform/osx/audio_driver_osx.h +++ b/platform/osx/audio_driver_osx.h @@ -44,10 +44,12 @@ class AudioDriverOSX : public AudioDriver { bool active; Mutex *mutex; + int mix_rate; int channels; - int32_t *samples_in; int buffer_frames; + Vector<int32_t> samples_in; + static OSStatus output_callback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 6d8a6eca66..33b1e64dd4 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1514,9 +1514,14 @@ Point2 OS_OSX::get_window_position() const { void OS_OSX::set_window_position(const Point2 &p_position) { - Point2 size = p_position; - size /= display_scale; - [window_object setFrame:NSMakeRect(size.x, size.y, [window_object frame].size.width, [window_object frame].size.height) display:YES]; + Size2 scr = get_screen_size(); + NSPoint pos; + + pos.x = p_position.x / display_scale; + // For OS X the y starts at the bottom + pos.y = (scr.height - p_position.y) / display_scale; + + [window_object setFrameTopLeftPoint:pos]; _update_window(); }; diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp index c773c0b746..8824d1c1d0 100644 --- a/platform/uwp/app.cpp +++ b/platform/uwp/app.cpp @@ -512,7 +512,7 @@ void App::UpdateWindowSize(Size size) { char **App::get_command_line(unsigned int *out_argc) { - static char *fail_cl[] = { "-path", "game", NULL }; + static char *fail_cl[] = { "--path", "game", NULL }; *out_argc = 2; FILE *f = _wfopen(L"__cl__.cl", L"rb"); diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 39717196aa..68307c4e90 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1330,7 +1330,7 @@ public: } if (!(p_flags & DEBUG_FLAG_DUMB_CLIENT)) { - cl.push_back("-path"); + cl.push_back("--path"); cl.push_back("game"); } diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 4d93b3f244..882e1a808e 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -14,69 +14,56 @@ def get_name(): def can_build(): if (os.name == "nt"): - # building natively on windows! - if (os.getenv("VCINSTALLDIR")): + # Building natively on Windows + if (os.getenv("VCINSTALLDIR")): # MSVC return True - else: - print("\nMSVC not detected, attempting MinGW.") - mingw32 = "" - mingw64 = "" - if (os.getenv("MINGW32_PREFIX")): - mingw32 = os.getenv("MINGW32_PREFIX") - if (os.getenv("MINGW64_PREFIX")): - mingw64 = os.getenv("MINGW64_PREFIX") - - test = "gcc --version > NUL 2>&1" - if os.system(test) != 0 and os.system(mingw32 + test) != 0 and os.system(mingw64 + test) != 0: - print("- could not detect gcc.") - print("Please, make sure a path to a MinGW /bin directory is accessible into the environment PATH.\n") - return False - else: - print("- gcc detected.") + print("MSVC not detected (no VCINSTALLDIR environment variable), attempting MinGW.") + mingw32 = "" + mingw64 = "" + if (os.getenv("MINGW32_PREFIX")): + mingw32 = os.getenv("MINGW32_PREFIX") + if (os.getenv("MINGW64_PREFIX")): + mingw64 = os.getenv("MINGW64_PREFIX") + + test = "gcc --version > NUL 2>&1" + if (os.system(test) == 0 or os.system(mingw32 + test) == 0 or os.system(mingw64 + test) == 0): return True if (os.name == "posix"): - - mingw = "i586-mingw32msvc-" - mingw64 = "x86_64-w64-mingw32-" + # Cross-compiling with MinGW-w64 (old MinGW32 is not supported) mingw32 = "i686-w64-mingw32-" + mingw64 = "x86_64-w64-mingw32-" if (os.getenv("MINGW32_PREFIX")): mingw32 = os.getenv("MINGW32_PREFIX") - mingw = mingw32 if (os.getenv("MINGW64_PREFIX")): mingw64 = os.getenv("MINGW64_PREFIX") test = "gcc --version > /dev/null 2>&1" - if (os.system(mingw + test) == 0 or os.system(mingw64 + test) == 0 or os.system(mingw32 + test) == 0): + if (os.system(mingw64 + test) == 0 or os.system(mingw32 + test) == 0): return True + print("Could not detect MinGW. Ensure its binaries are in your PATH or that MINGW32_PREFIX or MINGW64_PREFIX are properly defined.") return False def get_opts(): - mingw = "" mingw32 = "" mingw64 = "" if (os.name == "posix"): - mingw = "i586-mingw32msvc-" mingw32 = "i686-w64-mingw32-" mingw64 = "x86_64-w64-mingw32-" - if os.system(mingw32 + "gcc --version > /dev/null 2>&1") != 0: - mingw32 = mingw - if (os.getenv("MINGW32_PREFIX")): mingw32 = os.getenv("MINGW32_PREFIX") - mingw = mingw32 if (os.getenv("MINGW64_PREFIX")): mingw64 = os.getenv("MINGW64_PREFIX") return [ - ('mingw_prefix', 'MinGW Prefix', mingw32), - ('mingw_prefix_64', 'MinGW Prefix 64 bits', mingw64), + ('mingw_prefix_32', 'MinGW prefix (Win32)', mingw32), + ('mingw_prefix_64', 'MinGW prefix (Win64)', mingw64), ] @@ -88,12 +75,10 @@ def get_flags(): def build_res_file(target, source, env): - cmdbase = "" if (env["bits"] == "32"): - cmdbase = env['mingw_prefix'] + cmdbase = env['mingw_prefix_32'] else: cmdbase = env['mingw_prefix_64'] - CPPPATH = env['CPPPATH'] cmdbase = cmdbase + 'windres --include-dir . ' import subprocess for x in range(len(source)): @@ -111,8 +96,10 @@ def configure(env): env.Append(CPPPATH=['#platform/windows']) - # Targeted Windows version: Vista (and later) - winver = "0x0600" # Windows Vista is the minimum target for windows builds + # Targeted Windows version: 7 (and later), minimum supported version + # XP support dropped after EOL due to missing API for IPv6 and other issues + # Vista support dropped after EOL due to GH-10243 + winver = "0x0601" if (os.name == "nt" and os.getenv("VCINSTALLDIR")): # MSVC @@ -247,7 +234,7 @@ def configure(env): env.Append(LINKFLAGS=['-static']) env.Append(LINKFLAGS=['-static-libgcc']) env.Append(LINKFLAGS=['-static-libstdc++']) - mingw_prefix = env["mingw_prefix"] + mingw_prefix = env["mingw_prefix_32"] else: env.Append(LINKFLAGS=['-static']) mingw_prefix = env["mingw_prefix_64"] diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 54021b8172..72f6068eb6 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -63,12 +63,11 @@ __attribute__((visibility("default"))) DWORD NvOptimusEnablement = 0x00000001; #endif } -#ifndef WM_MOUSEHWHEEL -#define WM_MOUSEHWHEEL 0x020e +// Workaround mingw-w64 < 4.0 bug +#ifndef WM_TOUCH +#define WM_TOUCH 576 #endif -//#define STDOUT_FILE - extern HINSTANCE godot_hinstance; void RedirectIOToConsole() { diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index ddf17481b1..f055d730db 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -83,6 +83,19 @@ static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) { return 0; } +static void set_class_hint(Display *p_display, Window p_window) { + XClassHint *classHint; + + /* set the name and class hints for the window manager to use */ + classHint = XAllocClassHint(); + if (classHint) { + classHint->res_name = (char *)"Godot_Engine"; + classHint->res_class = (char *)"Godot"; + } + XSetClassHint(p_display, p_window, classHint); + XFree(classHint); +} + Error ContextGL_X11::initialize() { GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL; @@ -127,6 +140,7 @@ Error ContextGL_X11::initialize() { */ x11_window = XCreateWindow(x11_display, RootWindow(x11_display, vi->screen), 0, 0, OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &swa); ERR_FAIL_COND_V(!x11_window, ERR_UNCONFIGURED); + set_class_hint(x11_display, x11_window); XMapWindow(x11_display, x11_window); //}; diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index ade3a0a0c5..a23f2f1320 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -351,20 +351,9 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au XChangeWindowAttributes(x11_display, x11_window, CWEventMask, &new_attr); - XClassHint *classHint; - /* set the titlebar name */ XStoreName(x11_display, x11_window, "Godot"); - /* set the name and class hints for the window manager to use */ - classHint = XAllocClassHint(); - if (classHint) { - classHint->res_name = (char *)"Godot_Engine"; - classHint->res_class = (char *)"Godot"; - } - XSetClassHint(x11_display, x11_window, classHint); - XFree(classHint); - wm_delete = XInternAtom(x11_display, "WM_DELETE_WINDOW", true); XSetWMProtocols(x11_display, x11_window, &wm_delete, 1); |