summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/power_android.cpp6
-rw-r--r--platform/haiku/haiku_application.cpp4
-rw-r--r--platform/haiku/haiku_direct_window.cpp4
-rw-r--r--platform/haiku/haiku_gl_view.cpp4
-rw-r--r--platform/haiku/os_haiku.cpp1
-rw-r--r--platform/haiku/power_haiku.cpp6
-rw-r--r--platform/iphone/app_delegate.mm3
-rw-r--r--platform/iphone/export/export.cpp11
-rw-r--r--platform/iphone/os_iphone.cpp12
-rw-r--r--platform/iphone/power_iphone.cpp6
-rw-r--r--platform/javascript/dom_keys.h12
-rw-r--r--platform/javascript/power_javascript.cpp6
-rw-r--r--platform/osx/export/export.cpp1
-rw-r--r--platform/osx/os_osx.mm4
-rw-r--r--platform/osx/power_osx.cpp6
-rw-r--r--platform/uwp/app.cpp18
-rw-r--r--platform/uwp/gl_context_egl.cpp14
-rw-r--r--platform/uwp/joypad_uwp.cpp6
-rw-r--r--platform/uwp/os_uwp.cpp1
-rw-r--r--platform/uwp/power_uwp.cpp6
-rw-r--r--platform/windows/crash_handler_win.cpp8
-rw-r--r--platform/windows/detect.py2
-rw-r--r--platform/windows/export/export.cpp126
-rw-r--r--platform/windows/os_windows.cpp2
-rw-r--r--platform/windows/power_windows.cpp6
-rw-r--r--platform/x11/context_gl_x11.cpp4
-rw-r--r--platform/x11/os_x11.cpp9
-rw-r--r--platform/x11/power_x11.cpp6
28 files changed, 220 insertions, 74 deletions
diff --git a/platform/android/power_android.cpp b/platform/android/power_android.cpp
index 48c9377a5a..54fb435b62 100644
--- a/platform/android/power_android.cpp
+++ b/platform/android/power_android.cpp
@@ -245,8 +245,10 @@ int power_android::get_power_percent_left() {
}
}
-power_android::power_android()
- : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
+power_android::power_android() :
+ nsecs_left(-1),
+ percent_left(-1),
+ power_state(OS::POWERSTATE_UNKNOWN) {
}
power_android::~power_android() {
diff --git a/platform/haiku/haiku_application.cpp b/platform/haiku/haiku_application.cpp
index d23b9e27d8..e2649b15a4 100644
--- a/platform/haiku/haiku_application.cpp
+++ b/platform/haiku/haiku_application.cpp
@@ -29,6 +29,6 @@
/*************************************************************************/
#include "haiku_application.h"
-HaikuApplication::HaikuApplication()
- : BApplication("application/x-vnd.godot") {
+HaikuApplication::HaikuApplication() :
+ BApplication("application/x-vnd.godot") {
}
diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp
index 24a8a4b17b..aa25064ccb 100644
--- a/platform/haiku/haiku_direct_window.cpp
+++ b/platform/haiku/haiku_direct_window.cpp
@@ -34,8 +34,8 @@
#include "main/main.h"
#include "os/keyboard.h"
-HaikuDirectWindow::HaikuDirectWindow(BRect p_frame)
- : BDirectWindow(p_frame, "Godot", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE) {
+HaikuDirectWindow::HaikuDirectWindow(BRect p_frame) :
+ BDirectWindow(p_frame, "Godot", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE) {
last_mouse_pos_valid = false;
last_buttons_state = 0;
last_button_mask = 0;
diff --git a/platform/haiku/haiku_gl_view.cpp b/platform/haiku/haiku_gl_view.cpp
index d898bd1a5d..bb9c439e94 100644
--- a/platform/haiku/haiku_gl_view.cpp
+++ b/platform/haiku/haiku_gl_view.cpp
@@ -30,8 +30,8 @@
#include "haiku_gl_view.h"
#include "main/main.h"
-HaikuGLView::HaikuGLView(BRect frame, uint32 type)
- : BGLView(frame, "GodotGLView", B_FOLLOW_ALL_SIDES, 0, type) {
+HaikuGLView::HaikuGLView(BRect frame, uint32 type) :
+ BGLView(frame, "GodotGLView", B_FOLLOW_ALL_SIDES, 0, type) {
}
void HaikuGLView::AttachedToWindow(void) {
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp
index ef5a065107..f7196755af 100644
--- a/platform/haiku/os_haiku.cpp
+++ b/platform/haiku/os_haiku.cpp
@@ -105,6 +105,7 @@ void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_
context_gl = memnew(ContextGL_Haiku(window));
context_gl->initialize();
context_gl->make_current();
+ context_gl->set_use_vsync(current_video_mode.use_vsync);
/* Port to GLES 3 rasterizer */
//rasterizer = memnew(RasterizerGLES2);
diff --git a/platform/haiku/power_haiku.cpp b/platform/haiku/power_haiku.cpp
index 8718b317a3..73d60e9fec 100644
--- a/platform/haiku/power_haiku.cpp
+++ b/platform/haiku/power_haiku.cpp
@@ -64,8 +64,10 @@ int PowerX11::get_power_percent_left() {
}
}
-PowerHaiku::PowerHaiku()
- : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
+PowerHaiku::PowerHaiku() :
+ nsecs_left(-1),
+ percent_left(-1),
+ power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerHaiku::~PowerHaiku() {
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm
index 8f2893e69e..b591f80aa7 100644
--- a/platform/iphone/app_delegate.mm
+++ b/platform/iphone/app_delegate.mm
@@ -564,7 +564,7 @@ static int frame_count = 0;
MainLoop::NOTIFICATION_OS_MEMORY_WARNING);
};
-- (void)applicationDidFinishLaunching:(UIApplication *)application {
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
printf("**************** app delegate init\n");
CGRect rect = [[UIScreen mainScreen] bounds];
@@ -671,6 +671,7 @@ static int frame_count = 0;
isAdvertisingTrackingEnabled]];
#endif
+ return TRUE;
};
- (void)applicationWillTerminate:(UIApplication *)application {
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index b05bb9ab09..1833bdf2b3 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -69,8 +69,9 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
String name;
bool is_default;
- ExportArchitecture()
- : name(""), is_default(false) {
+ ExportArchitecture() :
+ name(""),
+ is_default(false) {
}
ExportArchitecture(String p_name, bool p_is_default) {
@@ -453,8 +454,9 @@ struct CodesignData {
const Ref<EditorExportPreset> &preset;
bool debug;
- CodesignData(const Ref<EditorExportPreset> &p_preset, bool p_debug)
- : preset(p_preset), debug(p_debug) {
+ CodesignData(const Ref<EditorExportPreset> &p_preset, bool p_debug) :
+ preset(p_preset),
+ debug(p_debug) {
}
};
@@ -972,6 +974,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset
if (!err.empty())
r_error = err;
+ r_missing_templates = !valid;
return valid;
}
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index f06657cd7b..1c7f41b464 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -117,7 +117,7 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_
*/
visual_server->init();
- // visual_server->cursor_set_visible(false, 0);
+ //visual_server->cursor_set_visible(false, 0);
// reset this to what it should be, it will have been set to 0 after visual_server->init() is called
RasterizerStorageGLES3::system_fbo = gl_view_base_fb;
@@ -127,14 +127,6 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_
input = memnew(InputDefault);
-/*
-#ifdef IOS_SCORELOOP_ENABLED
- scoreloop = memnew(ScoreloopIOS);
- Engine::get_singleton()->add_singleton(Engine::Singleton("Scoreloop", scoreloop));
- scoreloop->connect();
-#endif
- */
-
#ifdef GAME_CENTER_ENABLED
game_center = memnew(GameCenter);
Engine::get_singleton()->add_singleton(Engine::Singleton("GameCenter", game_center));
@@ -149,7 +141,7 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_
#ifdef ICLOUD_ENABLED
icloud = memnew(ICloud);
Engine::get_singleton()->add_singleton(Engine::Singleton("ICloud", icloud));
-//icloud->connect();
+ //icloud->connect();
#endif
Engine::get_singleton()->add_singleton(Engine::Singleton("iOS", memnew(iOS)));
};
diff --git a/platform/iphone/power_iphone.cpp b/platform/iphone/power_iphone.cpp
index 055d31ef0a..03afdb15f9 100644
--- a/platform/iphone/power_iphone.cpp
+++ b/platform/iphone/power_iphone.cpp
@@ -58,8 +58,10 @@ int PowerIphone::get_power_percent_left() {
}
}
-PowerIphone::PowerIphone()
- : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
+PowerIphone::PowerIphone() :
+ nsecs_left(-1),
+ percent_left(-1),
+ power_state(OS::POWERSTATE_UNKNOWN) {
// TODO Auto-generated constructor stub
}
diff --git a/platform/javascript/dom_keys.h b/platform/javascript/dom_keys.h
index d63f165382..bd15cec603 100644
--- a/platform/javascript/dom_keys.h
+++ b/platform/javascript/dom_keys.h
@@ -262,7 +262,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_CAPS_LOCK:
return KEY_CAPSLOCK;
- /*
+ /*
case DOM_VK_KANA: return KEY_UNKNOWN;
case DOM_VK_HANGUL: return KEY_UNKNOWN;
case DOM_VK_EISU: return KEY_UNKNOWN;
@@ -274,7 +274,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_ESCAPE:
return KEY_ESCAPE;
- /*
+ /*
case DOM_VK_CONVERT: return KEY_UNKNOWN;
case DOM_VK_NONCONVERT: return KEY_UNKNOWN;
case DOM_VK_ACCEPT: return KEY_UNKNOWN;
@@ -292,7 +292,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_DOWN:
return KEY_DOWN;
- //case DOM_VK_SELECT: return KEY_UNKNOWN;
+ //case DOM_VK_SELECT: return KEY_UNKNOWN;
case DOM_VK_PRINTSCREEN: // this is the usual printScreen key
case DOM_VK_PRINT: // maybe for alt+printScreen or physical printers?
@@ -320,7 +320,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_DIVIDE:
return KEY_KP_DIVIDE;
- /*
+ /*
case DOM_VK_F17: return KEY_UNKNOWN;
case DOM_VK_F18: return KEY_UNKNOWN;
case DOM_VK_F19: return KEY_UNKNOWN;
@@ -335,7 +335,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_SCROLL_LOCK:
return KEY_SCROLLLOCK;
- /*
+ /*
case DOM_VK_WIN_OEM_FJ_JISHO: return KEY_UNKNOWN;
case DOM_VK_WIN_OEM_FJ_MASSHOU: return KEY_UNKNOWN;
case DOM_VK_WIN_OEM_FJ_TOUROKU: return KEY_UNKNOWN;
@@ -375,7 +375,7 @@ int dom2godot_scancode(int dom_keycode) {
case DOM_VK_QUOTE:
return KEY_APOSTROPHE;
- // rest is OEM/unusual
+ // rest is OEM/unusual
default: return KEY_UNKNOWN;
};
diff --git a/platform/javascript/power_javascript.cpp b/platform/javascript/power_javascript.cpp
index 10964502d4..54fceb75f4 100644
--- a/platform/javascript/power_javascript.cpp
+++ b/platform/javascript/power_javascript.cpp
@@ -63,8 +63,10 @@ int PowerJavascript::get_power_percent_left() {
}
}
-PowerJavascript::PowerJavascript()
- : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
+PowerJavascript::PowerJavascript() :
+ nsecs_left(-1),
+ percent_left(-1),
+ power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerJavascript::~PowerJavascript() {
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index 8091a38adb..d3b763b42e 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -605,6 +605,7 @@ bool EditorExportPlatformOSX::can_export(const Ref<EditorExportPreset> &p_preset
if (!err.empty())
r_error = err;
+ r_missing_templates = !valid;
return valid;
}
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 732ec910c0..75d0bd1648 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1028,7 +1028,7 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
// OS X needs non-zero color size, so set resonable values
int colorBits = 32;
-// Fail if a robustness strategy was requested
+ // Fail if a robustness strategy was requested
#define ADD_ATTR(x) \
{ attributes[attributeCount++] = x; }
@@ -1089,6 +1089,8 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
[context makeCurrentContext];
+ set_use_vsync(p_desired.use_vsync);
+
[NSApp activateIgnoringOtherApps:YES];
_update_window();
diff --git a/platform/osx/power_osx.cpp b/platform/osx/power_osx.cpp
index eed03e63c1..bd5f9fe65f 100644
--- a/platform/osx/power_osx.cpp
+++ b/platform/osx/power_osx.cpp
@@ -242,8 +242,10 @@ int power_osx::get_power_percent_left() {
}
}
-power_osx::power_osx()
- : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
+power_osx::power_osx() :
+ nsecs_left(-1),
+ percent_left(-1),
+ power_state(OS::POWERSTATE_UNKNOWN) {
}
power_osx::~power_osx() {
diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp
index c565999d82..b47b99744e 100644
--- a/platform/uwp/app.cpp
+++ b/platform/uwp/app.cpp
@@ -77,15 +77,15 @@ public:
return 0;
}
-App::App()
- : mWindowClosed(false),
- mWindowVisible(true),
- mWindowWidth(0),
- mWindowHeight(0),
- mEglDisplay(EGL_NO_DISPLAY),
- mEglContext(EGL_NO_CONTEXT),
- mEglSurface(EGL_NO_SURFACE),
- number_of_contacts(0) {
+App::App() :
+ mWindowClosed(false),
+ mWindowVisible(true),
+ mWindowWidth(0),
+ mWindowHeight(0),
+ mEglDisplay(EGL_NO_DISPLAY),
+ mEglContext(EGL_NO_CONTEXT),
+ mEglSurface(EGL_NO_SURFACE),
+ number_of_contacts(0) {
}
// The first method called when the IFrameworkView is being created.
diff --git a/platform/uwp/gl_context_egl.cpp b/platform/uwp/gl_context_egl.cpp
index dafe5d5e25..2130af6d60 100644
--- a/platform/uwp/gl_context_egl.cpp
+++ b/platform/uwp/gl_context_egl.cpp
@@ -108,7 +108,8 @@ Error ContextEGL::initialize() {
EGL_NONE,*/
// These are the default display attributes, used to request ANGLE's D3D11 renderer.
// eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+.
- EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
+ EGL_PLATFORM_ANGLE_TYPE_ANGLE,
+ EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
// EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices.
// Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it.
@@ -117,7 +118,8 @@ Error ContextEGL::initialize() {
// EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call
// the IDXGIDevice3::Trim method on behalf of the application when it gets suspended.
// Calling IDXGIDevice3::Trim when an application is suspended is a Windows Store application certification requirement.
- EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
+ EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE,
+ EGL_TRUE,
EGL_NONE,
};
@@ -190,10 +192,10 @@ void ContextEGL::cleanup() {
}
};
-ContextEGL::ContextEGL(CoreWindow ^ p_window)
- : mEglDisplay(EGL_NO_DISPLAY),
- mEglContext(EGL_NO_CONTEXT),
- mEglSurface(EGL_NO_SURFACE) {
+ContextEGL::ContextEGL(CoreWindow ^ p_window) :
+ mEglDisplay(EGL_NO_DISPLAY),
+ mEglContext(EGL_NO_CONTEXT),
+ mEglSurface(EGL_NO_SURFACE) {
window = p_window;
};
diff --git a/platform/uwp/joypad_uwp.cpp b/platform/uwp/joypad_uwp.cpp
index 0f84bd55a3..088d232e04 100644
--- a/platform/uwp/joypad_uwp.cpp
+++ b/platform/uwp/joypad_uwp.cpp
@@ -54,7 +54,7 @@ void JoypadUWP::process_controllers() {
case ControllerType::GAMEPAD_CONTROLLER: {
- GamepadReading reading = ((Gamepad ^)joy.controller_reference)->GetCurrentReading();
+ GamepadReading reading = ((Gamepad ^) joy.controller_reference)->GetCurrentReading();
int button_mask = (int)GamepadButtons::Menu;
for (int j = 0; j < 14; j++) {
@@ -161,7 +161,7 @@ void JoypadUWP::joypad_vibration_start(int p_device, float p_weak_magnitude, flo
GamepadVibration vibration;
vibration.LeftMotor = p_strong_magnitude;
vibration.RightMotor = p_weak_magnitude;
- ((Gamepad ^)joy.controller_reference)->Vibration = vibration;
+ ((Gamepad ^) joy.controller_reference)->Vibration = vibration;
joy.ff_timestamp = p_timestamp;
joy.ff_end_timestamp = p_duration == 0 ? 0 : p_timestamp + (uint64_t)(p_duration * 1000000.0);
@@ -175,7 +175,7 @@ void JoypadUWP::joypad_vibration_stop(int p_device, uint64_t p_timestamp) {
GamepadVibration vibration;
vibration.LeftMotor = 0.0;
vibration.RightMotor = 0.0;
- ((Gamepad ^)joy.controller_reference)->Vibration = vibration;
+ ((Gamepad ^) joy.controller_reference)->Vibration = vibration;
joy.ff_timestamp = p_timestamp;
joy.vibrating = false;
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index 1655caf04b..659f162724 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -241,6 +241,7 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
+ gl_context->set_use_vsync(vm.use_vsync);
visual_server = memnew(VisualServerRaster);
// FIXME: Reimplement threaded rendering? Or remove?
diff --git a/platform/uwp/power_uwp.cpp b/platform/uwp/power_uwp.cpp
index 81e97b1391..14fce8b133 100644
--- a/platform/uwp/power_uwp.cpp
+++ b/platform/uwp/power_uwp.cpp
@@ -30,8 +30,10 @@
#include "power_uwp.h"
-PowerUWP::PowerUWP()
- : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
+PowerUWP::PowerUWP() :
+ nsecs_left(-1),
+ percent_left(-1),
+ power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerUWP::~PowerUWP() {
diff --git a/platform/windows/crash_handler_win.cpp b/platform/windows/crash_handler_win.cpp
index feea3911b2..5657036693 100644
--- a/platform/windows/crash_handler_win.cpp
+++ b/platform/windows/crash_handler_win.cpp
@@ -61,8 +61,8 @@ class symbol {
static const int max_name_len = 1024;
public:
- symbol(HANDLE process, DWORD64 address)
- : sym((sym_type *)::operator new(sizeof(*sym) + max_name_len)) {
+ symbol(HANDLE process, DWORD64 address) :
+ sym((sym_type *)::operator new(sizeof(*sym) + max_name_len)) {
memset(sym, '\0', sizeof(*sym) + max_name_len);
sym->SizeOfStruct = sizeof(*sym);
sym->MaxNameLength = max_name_len;
@@ -85,8 +85,8 @@ class get_mod_info {
HANDLE process;
public:
- get_mod_info(HANDLE h)
- : process(h) {}
+ get_mod_info(HANDLE h) :
+ process(h) {}
module_data operator()(HMODULE module) {
module_data ret;
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 890decf962..d85e1b061c 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -270,7 +270,7 @@ def configure(env):
env.Append(CCFLAGS=['-DOPENGL_ENABLED'])
env.Append(CCFLAGS=['-DRTAUDIO_ENABLED'])
env.Append(CCFLAGS=['-DWASAPI_ENABLED'])
- env.Append(CCFLAGS=['-DWINVER=%s' % winver, '-D_WIN32_WINNT=%s' % winver])
+ env.Append(CCFLAGS=['-DWINVER=%s' % env['target_win_version'], '-D_WIN32_WINNT=%s' % env['target_win_version']])
env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser'])
env.Append(CPPFLAGS=['-DMINGW_ENABLED'])
diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp
index 5301aa9e95..1b6a8f4a60 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -28,11 +28,135 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "editor/editor_export.h"
+#include "editor/editor_settings.h"
+#include "os/file_access.h"
+#include "os/os.h"
#include "platform/windows/logo.gen.h"
+class EditorExportPlatformWindows : public EditorExportPlatformPC {
+
+public:
+ virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
+ virtual void get_export_options(List<ExportOption> *r_options);
+};
+
+Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
+ Error err = EditorExportPlatformPC::export_project(p_preset, p_debug, p_path, p_flags);
+
+ if (err != OK) {
+ return err;
+ }
+
+ String rcedit_path = EditorSettings::get_singleton()->get("export/windows/rcedit");
+
+ if (rcedit_path == String()) {
+ return OK;
+ }
+
+ if (!FileAccess::exists(rcedit_path)) {
+ ERR_PRINTS("Could not find rcedit executable at " + rcedit_path + ", aborting.");
+ return ERR_FILE_NOT_FOUND;
+ }
+
+#ifndef WINDOWS_ENABLED
+ // On non-Windows we need WINE to run rcedit
+ String wine_path = EditorSettings::get_singleton()->get("export/windows/wine");
+
+ if (wine_path != String() && !FileAccess::exists(wine_path)) {
+ ERR_PRINTS("Could not find wine executable at " + wine_path + ", aborting.");
+ return ERR_FILE_NOT_FOUND;
+ }
+
+ if (wine_path == String()) {
+ wine_path = "wine"; // try to run wine from PATH
+ }
+#endif
+
+ String icon_path = p_preset->get("application/icon");
+ String file_verion = p_preset->get("application/file_version");
+ String product_version = p_preset->get("application/product_version");
+ String company_name = p_preset->get("application/company_name");
+ String product_name = p_preset->get("application/product_name");
+ String file_description = p_preset->get("application/file_description");
+ String copyright = p_preset->get("application/copyright");
+ String trademarks = p_preset->get("application/trademarks");
+ String comments = p_preset->get("application/comments");
+
+ List<String> args;
+ args.push_back(p_path);
+ if (icon_path != String()) {
+ args.push_back("--set-icon");
+ args.push_back(icon_path);
+ }
+ if (file_verion != String()) {
+ args.push_back("--set-file-version");
+ args.push_back(file_verion);
+ }
+ if (product_version != String()) {
+ args.push_back("--set-product-version");
+ args.push_back(product_version);
+ }
+ if (company_name != String()) {
+ args.push_back("--set-version-string");
+ args.push_back("CompanyName");
+ args.push_back(company_name);
+ }
+ if (product_name != String()) {
+ args.push_back("--set-version-string");
+ args.push_back("ProductName");
+ args.push_back(product_name);
+ }
+ if (file_description != String()) {
+ args.push_back("--set-version-string");
+ args.push_back("FileDescription");
+ args.push_back(file_description);
+ }
+ if (copyright != String()) {
+ args.push_back("--set-version-string");
+ args.push_back("LegalCopyright");
+ args.push_back(copyright);
+ }
+ if (trademarks != String()) {
+ args.push_back("--set-version-string");
+ args.push_back("LegalTrademarks");
+ args.push_back(trademarks);
+ }
+
+#ifdef WINDOWS_ENABLED
+ OS::get_singleton()->execute(rcedit_path, args, true);
+#else
+ // On non-Windows we need WINE to run rcedit
+ args.push_front(rcedit_path);
+ OS::get_singleton()->execute(wine_path, args, true);
+#endif
+
+ return OK;
+}
+
+void EditorExportPlatformWindows::get_export_options(List<ExportOption> *r_options) {
+ EditorExportPlatformPC::get_export_options(r_options);
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_GLOBAL_FILE, "*.ico"), String()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/file_version"), String()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/product_version"), String()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/company_name"), String()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/product_name"), String()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/file_description"), String()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), String()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/trademarks"), String()));
+}
+
void register_windows_exporter() {
- Ref<EditorExportPlatformPC> platform;
+ EDITOR_DEF("export/windows/rcedit", "");
+ EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/rcedit", PROPERTY_HINT_GLOBAL_FILE, "*.exe"));
+#ifndef WINDOWS_ENABLED
+ // On non-Windows we need WINE to run rcedit
+ EDITOR_DEF("export/windows/wine", "");
+ EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/wine", PROPERTY_HINT_GLOBAL_FILE));
+#endif
+
+ Ref<EditorExportPlatformWindows> platform;
platform.instance();
Ref<Image> img = memnew(Image(_windows_logo));
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 79a760f055..41730d33af 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1074,6 +1074,8 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
+
+ gl_context->set_use_vsync(video_mode.use_vsync);
#endif
visual_server = memnew(VisualServerRaster);
diff --git a/platform/windows/power_windows.cpp b/platform/windows/power_windows.cpp
index 8d86f160f1..cc452d774d 100644
--- a/platform/windows/power_windows.cpp
+++ b/platform/windows/power_windows.cpp
@@ -121,8 +121,10 @@ int PowerWindows::get_power_percent_left() {
}
}
-PowerWindows::PowerWindows()
- : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
+PowerWindows::PowerWindows() :
+ nsecs_left(-1),
+ percent_left(-1),
+ power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerWindows::~PowerWindows() {
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index 4f9d4a84b9..61c6b3c9dd 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -228,8 +228,8 @@ bool ContextGL_X11::is_using_vsync() const {
return use_vsync;
}
-ContextGL_X11::ContextGL_X11(::Display *p_x11_display, ::Window &p_x11_window, const OS::VideoMode &p_default_video_mode, bool p_opengl_3_context)
- : x11_window(p_x11_window) {
+ContextGL_X11::ContextGL_X11(::Display *p_x11_display, ::Window &p_x11_window, const OS::VideoMode &p_default_video_mode, bool p_opengl_3_context) :
+ x11_window(p_x11_window) {
default_video_mode = p_default_video_mode;
x11_display = p_x11_display;
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index bf63921b06..263ff012d4 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -132,10 +132,9 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
// Try to support IME if detectable auto-repeat is supported
if (xkb_dar == True) {
-// Xutf8LookupString will be used later instead of XmbLookupString before
-// the multibyte sequences can be converted to unicode string.
-
#ifdef X_HAVE_UTF8_STRING
+ // Xutf8LookupString will be used later instead of XmbLookupString before
+ // the multibyte sequences can be converted to unicode string.
modifiers = XSetLocaleModifiers("");
#endif
}
@@ -287,6 +286,8 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
RasterizerGLES3::make_current();
+ context_gl->set_use_vsync(current_videomode.use_vsync);
+
#endif
visual_server = memnew(VisualServerRaster);
@@ -548,7 +549,7 @@ void OS_X11::finalize() {
memdelete(main_loop);
main_loop = NULL;
-/*
+ /*
if (debugger_connection_console) {
memdelete(debugger_connection_console);
}
diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp
index 76ff7f91fb..0ef2629cb0 100644
--- a/platform/x11/power_x11.cpp
+++ b/platform/x11/power_x11.cpp
@@ -542,8 +542,10 @@ bool PowerX11::UpdatePowerInfo() {
return false;
}
-PowerX11::PowerX11()
- : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
+PowerX11::PowerX11() :
+ nsecs_left(-1),
+ percent_left(-1),
+ power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerX11::~PowerX11() {