summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/detect.py2
-rw-r--r--platform/iphone/rasterizer_iphone.cpp16
-rw-r--r--platform/iphone/rasterizer_iphone.h20
-rw-r--r--platform/windows/export/export.cpp29
-rw-r--r--platform/windows/os_windows.cpp29
-rw-r--r--platform/windows/os_windows.h4
-rw-r--r--platform/x11/os_x11.cpp9
7 files changed, 64 insertions, 45 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 0e78a4618d..8d2ed59f17 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -175,6 +175,8 @@ def configure(env):
if env['android_arch'] == 'x86':
can_vectorize = True
target_opts = ['-target', 'i686-none-linux-android']
+ # The NDK adds this if targeting API < 21, so we can drop it when Godot targets it at least
+ env.Append(CPPFLAGS=['-mstackrealign'])
elif env["android_arch"] == "armv6":
can_vectorize = False
target_opts = ['-target', 'armv6-none-linux-androideabi']
diff --git a/platform/iphone/rasterizer_iphone.cpp b/platform/iphone/rasterizer_iphone.cpp
index 14288e4ba0..9563df5a2f 100644
--- a/platform/iphone/rasterizer_iphone.cpp
+++ b/platform/iphone/rasterizer_iphone.cpp
@@ -447,7 +447,7 @@ RID RasterizerIPhone::material_create() {
return material_owner.make_rid(memnew(Material));
}
-void RasterizerIPhone::fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant &p_value) {
+void RasterizerIPhone::fixed_material_set_parameter(RID p_material, VS::SpatialMaterialParam p_parameter, const Variant &p_value) {
Material *m = material_owner.get(p_material);
ERR_FAIL_COND(!m);
@@ -455,7 +455,7 @@ void RasterizerIPhone::fixed_material_set_parameter(RID p_material, VS::FixedSpa
m->parameters[p_parameter] = p_value;
}
-Variant RasterizerIPhone::fixed_material_get_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const {
+Variant RasterizerIPhone::fixed_material_get_parameter(RID p_material, VS::SpatialMaterialParam p_parameter) const {
Material *m = material_owner.get(p_material);
ERR_FAIL_COND_V(!m, Variant());
@@ -464,7 +464,7 @@ Variant RasterizerIPhone::fixed_material_get_parameter(RID p_material, VS::Fixed
return m->parameters[p_parameter];
}
-void RasterizerIPhone::fixed_material_set_texture(RID p_material, VS::FixedSpatialMaterialParam p_parameter, RID p_texture) {
+void RasterizerIPhone::fixed_material_set_texture(RID p_material, VS::SpatialMaterialParam p_parameter, RID p_texture) {
Material *m = material_owner.get(p_material);
ERR_FAIL_COND(!m);
@@ -472,7 +472,7 @@ void RasterizerIPhone::fixed_material_set_texture(RID p_material, VS::FixedSpati
m->textures[p_parameter] = p_texture;
}
-RID RasterizerIPhone::fixed_material_get_texture(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const {
+RID RasterizerIPhone::fixed_material_get_texture(RID p_material, VS::SpatialMaterialParam p_parameter) const {
Material *m = material_owner.get(p_material);
ERR_FAIL_COND_V(!m, RID());
@@ -496,7 +496,7 @@ VS::MaterialBlendMode RasterizerIPhone::fixed_material_get_detail_blend_mode(RID
return m->detail_blend_mode;
}
-void RasterizerIPhone::fixed_material_set_texcoord_mode(RID p_material, VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode) {
+void RasterizerIPhone::fixed_material_set_texcoord_mode(RID p_material, VS::SpatialMaterialParam p_parameter, VS::SpatialMaterialTexCoordMode p_mode) {
Material *m = material_owner.get(p_material);
ERR_FAIL_COND(!m);
@@ -504,7 +504,7 @@ void RasterizerIPhone::fixed_material_set_texcoord_mode(RID p_material, VS::Fixe
m->texcoord_mode[p_parameter] = p_mode;
}
-VS::FixedSpatialMaterialTexCoordMode RasterizerIPhone::fixed_material_get_texcoord_mode(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const {
+VS::SpatialMaterialTexCoordMode RasterizerIPhone::fixed_material_get_texcoord_mode(RID p_material, VS::SpatialMaterialParam p_parameter) const {
Material *m = material_owner.get(p_material);
ERR_FAIL_COND_V(!m, VS::FIXED_MATERIAL_TEXCOORD_TEXGEN);
@@ -513,7 +513,7 @@ VS::FixedSpatialMaterialTexCoordMode RasterizerIPhone::fixed_material_get_texcoo
return m->texcoord_mode[p_parameter]; // for now
}
-void RasterizerIPhone::fixed_material_set_texgen_mode(RID p_material, VS::FixedSpatialMaterialTexGenMode p_mode) {
+void RasterizerIPhone::fixed_material_set_texgen_mode(RID p_material, VS::SpatialMaterialTexGenMode p_mode) {
Material *m = material_owner.get(p_material);
ERR_FAIL_COND(!m);
@@ -521,7 +521,7 @@ void RasterizerIPhone::fixed_material_set_texgen_mode(RID p_material, VS::FixedS
m->texgen_mode = p_mode;
};
-VS::FixedSpatialMaterialTexGenMode RasterizerIPhone::fixed_material_get_texgen_mode(RID p_material) const {
+VS::SpatialMaterialTexGenMode RasterizerIPhone::fixed_material_get_texgen_mode(RID p_material) const {
Material *m = material_owner.get(p_material);
ERR_FAIL_COND_V(!m, VS::FIXED_MATERIAL_TEXGEN_SPHERE);
diff --git a/platform/iphone/rasterizer_iphone.h b/platform/iphone/rasterizer_iphone.h
index 02cb985dc8..5fee149e79 100644
--- a/platform/iphone/rasterizer_iphone.h
+++ b/platform/iphone/rasterizer_iphone.h
@@ -100,11 +100,11 @@ class RasterizerIPhone : public Rasterizer {
RID textures[VisualServer::FIXED_MATERIAL_PARAM_MAX];
Transform uv_transform;
- VS::FixedSpatialMaterialTexCoordMode texcoord_mode[VisualServer::FIXED_MATERIAL_PARAM_MAX];
+ VS::SpatialMaterialTexCoordMode texcoord_mode[VisualServer::FIXED_MATERIAL_PARAM_MAX];
VS::MaterialBlendMode detail_blend_mode;
- VS::FixedSpatialMaterialTexGenMode texgen_mode;
+ VS::SpatialMaterialTexGenMode texgen_mode;
Material() {
@@ -614,20 +614,20 @@ public:
virtual RID material_create();
- virtual void fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant &p_value);
- virtual Variant fixed_material_get_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const;
+ virtual void fixed_material_set_parameter(RID p_material, VS::SpatialMaterialParam p_parameter, const Variant &p_value);
+ virtual Variant fixed_material_get_parameter(RID p_material, VS::SpatialMaterialParam p_parameter) const;
- virtual void fixed_material_set_texture(RID p_material, VS::FixedSpatialMaterialParam p_parameter, RID p_texture);
- virtual RID fixed_material_get_texture(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const;
+ virtual void fixed_material_set_texture(RID p_material, VS::SpatialMaterialParam p_parameter, RID p_texture);
+ virtual RID fixed_material_get_texture(RID p_material, VS::SpatialMaterialParam p_parameter) const;
virtual void fixed_material_set_detail_blend_mode(RID p_material, VS::MaterialBlendMode p_mode);
virtual VS::MaterialBlendMode fixed_material_get_detail_blend_mode(RID p_material) const;
- virtual void fixed_material_set_texgen_mode(RID p_material, VS::FixedSpatialMaterialTexGenMode p_mode);
- virtual VS::FixedSpatialMaterialTexGenMode fixed_material_get_texgen_mode(RID p_material) const;
+ virtual void fixed_material_set_texgen_mode(RID p_material, VS::SpatialMaterialTexGenMode p_mode);
+ virtual VS::SpatialMaterialTexGenMode fixed_material_get_texgen_mode(RID p_material) const;
- virtual void fixed_material_set_texcoord_mode(RID p_material, VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode);
- virtual VS::FixedSpatialMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material, VS::FixedSpatialMaterialParam p_parameter) const;
+ virtual void fixed_material_set_texcoord_mode(RID p_material, VS::SpatialMaterialParam p_parameter, VS::SpatialMaterialTexCoordMode p_mode);
+ virtual VS::SpatialMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material, VS::SpatialMaterialParam p_parameter) const;
virtual void fixed_material_set_uv_transform(RID p_material, const Transform &p_transform);
virtual Transform fixed_material_get_uv_transform(RID p_material) const;
diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp
index bb51474a8c..df1605ae9e 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -26,28 +26,25 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "export.h"
#include "editor/editor_export.h"
#include "platform/windows/logo.h"
void register_windows_exporter() {
-#if 0
+ Ref<EditorExportPlatformPC> platform;
+ platform.instance();
+
Image img(_windows_logo);
- Ref<ImageTexture> logo = memnew( ImageTexture );
+ Ref<ImageTexture> logo;
+ logo.instance();
logo->create_from_image(img);
+ platform->set_logo(logo);
+ platform->set_name("Windows Desktop");
+ platform->set_extension("exe");
+ platform->set_release_32("windows_32_release.exe");
+ platform->set_debug_32("windows_32_debug.exe");
+ platform->set_release_64("windows_64_release.exe");
+ platform->set_debug_64("windows_64_debug.exe");
- {
- Ref<EditorExportPlatformPC> exporter = Ref<EditorExportPlatformPC>( memnew(EditorExportPlatformPC) );
- exporter->set_binary_extension("exe");
- exporter->set_release_binary32("windows_32_release.exe");
- exporter->set_debug_binary32("windows_32_debug.exe");
- exporter->set_release_binary64("windows_64_release.exe");
- exporter->set_debug_binary64("windows_64_debug.exe");
- exporter->set_name("Windows Desktop");
- exporter->set_logo(logo);
- EditorImportExport::get_singleton()->add_export_platform(exporter);
- }
-
-#endif
+ EditorExport::get_singleton()->add_export_platform(platform);
}
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 83a6aa6079..cfc97d57da 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1582,6 +1582,32 @@ bool OS_Windows::get_borderless_window() {
return video_mode.borderless_window;
}
+Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle) {
+ p_library_handle = (void *)LoadLibrary(p_path.utf8().get_data());
+ if (!p_library_handle) {
+ ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + String::num(GetLastError()));
+ ERR_FAIL_V(ERR_CANT_OPEN);
+ }
+ return OK;
+}
+
+Error OS_Windows::close_dynamic_library(void *p_library_handle) {
+ if (!FreeLibrary((HMODULE)p_library_handle)) {
+ return FAILED;
+ }
+ return OK;
+}
+
+Error OS_Windows::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle) {
+ char *error;
+ p_symbol_handle = (void *)GetProcAddress((HMODULE)p_library_handle, p_name.utf8().get_data());
+ if (!p_symbol_handle) {
+ ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + String::num(GetLastError()));
+ ERR_FAIL_V(ERR_CANT_RESOLVE);
+ }
+ return OK;
+}
+
void OS_Windows::request_attention() {
FLASHWINFO info;
@@ -2167,9 +2193,6 @@ void OS_Windows::run() {
if (!main_loop)
return;
- // Process all events before the main initialization so the cursor will get initialized properly
- process_events(); // get rid of pending events
-
main_loop->init();
uint64_t last_ticks = get_ticks_usec();
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 25c3102ee6..050067ad7d 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -222,6 +222,10 @@ public:
virtual void set_borderless_window(int p_borderless);
virtual bool get_borderless_window();
+ virtual Error open_dynamic_library(const String p_path, void *&p_library_handle);
+ virtual Error close_dynamic_library(void *p_library_handle);
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle);
+
virtual MainLoop *get_main_loop() const;
virtual String get_name();
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 4606a90835..6aeab21c7f 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1277,12 +1277,8 @@ void OS_X11::process_xevents() {
case EnterNotify: {
if (main_loop && !mouse_mode_grab)
main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
- if (input) {
- // Update mouse position. It is triggered before mouse motion.
- Point2i pos(event.xmotion.x, event.xmotion.y);
- input->set_mouse_pos(pos);
+ if (input)
input->set_mouse_in_window(true);
- }
} break;
case FocusIn:
minimized = false;
@@ -1904,9 +1900,6 @@ void OS_X11::run() {
if (!main_loop)
return;
- // Process all events before the main initialization so the cursor will get initialized properly
- process_xevents(); // get rid of pending events
-
main_loop->init();
//uint64_t last_ticks=get_ticks_usec();