From 402c24ec8baf10d6445213f1552cbeaaf0b55643 Mon Sep 17 00:00:00 2001 From: Aren Villanueva Date: Mon, 16 Nov 2015 11:07:21 +1100 Subject: [PATCH] iOS compile fixes. --- drivers/gles2/rasterizer_gles2.h | 4 ++-- drivers/gles2/shader_compiler_gles2.h | 2 +- platform/iphone/app_delegate.mm | 2 ++ platform/iphone/game_center.mm | 2 +- platform/iphone/gl_view.mm | 10 +++++++++- platform/iphone/godot_iphone.cpp | 2 ++ platform/iphone/icloud.mm | 2 -- platform/iphone/sem_iphone.cpp | 5 +++++ platform/iphone/view_controller.mm | 3 +++ 9 files changed, 25 insertions(+), 7 deletions(-) diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index 507e46ae750..4b512cc3a96 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -111,7 +111,7 @@ class RasterizerGLES2 : public Rasterizer { Image _get_gl_image_and_format(const Image& p_image, Image::Format p_format, uint32_t p_flags,GLenum& r_gl_format,GLenum& r_gl_internal_format,int &r_gl_components,bool &r_has_alpha_cache,bool &r_compressed); - class RenderTarget; + struct RenderTarget; struct Texture { @@ -305,7 +305,7 @@ class RasterizerGLES2 : public Rasterizer { virtual ~GeometryOwner() {} }; - class Mesh; + struct Mesh; struct Surface : public Geometry { diff --git a/drivers/gles2/shader_compiler_gles2.h b/drivers/gles2/shader_compiler_gles2.h index 43902a75367..19c24757bab 100644 --- a/drivers/gles2/shader_compiler_gles2.h +++ b/drivers/gles2/shader_compiler_gles2.h @@ -34,7 +34,7 @@ class ShaderCompilerGLES2 { class Uniform; public: - class Flags; + struct Flags; private: ShaderLanguage::ProgramNode *program_node; diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 647bf1a2d10..e5bd7a96b45 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -56,6 +56,8 @@ #import "Appirater.h" #endif +Error _shell_open(String); + Error _shell_open(String p_uri) { NSString* url = [[NSString alloc] initWithUTF8String:p_uri.utf8().get_data()]; diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index 79c056776d5..1e46d9f014b 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -30,8 +30,8 @@ #include "game_center.h" -extern "C" { #import +extern "C" { #import "app_delegate.h" }; diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 279fbdafa88..f19e16f3f62 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -54,6 +54,14 @@ static bool video_playing = false; static float video_previous_volume = 0.0f; static CMTime video_current_time; +void _show_keyboard(String); +void _hide_keyboard(); +bool _play_video(String, float, String, String); +bool _is_video_playing(); +void _focus_out_video(); +void _unpause_video(); +void _stop_video(); + void _show_keyboard(String p_existing) { keyboard_text = p_existing; printf("instance on show is %p\n", _instance); @@ -618,7 +626,7 @@ static void clear_touches() { - (void)audioRouteChangeListenerCallback:(NSNotification*)notification { - printf("*********** route changed!%i\n"); + printf("*********** route changed!\n"); NSDictionary *interuptionDict = notification.userInfo; NSInteger routeChangeReason = [[interuptionDict valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue]; diff --git a/platform/iphone/godot_iphone.cpp b/platform/iphone/godot_iphone.cpp index b7b9b747b46..f0cb929429a 100644 --- a/platform/iphone/godot_iphone.cpp +++ b/platform/iphone/godot_iphone.cpp @@ -40,6 +40,8 @@ int add_path(int p_argc, char** p_args); int add_cmdline(int p_argc, char** p_args); }; +int iphone_main(int, int, int, char**); + int iphone_main(int width, int height, int argc, char** argv) { int len = strlen(argv[0]); diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index 2dc2f7d9c16..a35d8ecd696 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -30,10 +30,8 @@ #include "icloud.h" -extern "C" { #import #import "app_delegate.h" -}; ICloud* ICloud::instance = NULL; diff --git a/platform/iphone/sem_iphone.cpp b/platform/iphone/sem_iphone.cpp index 5afaa7b308f..36baa404271 100644 --- a/platform/iphone/sem_iphone.cpp +++ b/platform/iphone/sem_iphone.cpp @@ -31,6 +31,11 @@ #include #include +void cgsem_init(cgsem_t*); +void cgsem_post(cgsem_t*); +void cgsem_wait(cgsem_t*); +void cgsem_destroy(cgsem_t*); + void cgsem_init(cgsem_t *cgsem) { int flags, fd, i; diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index 6a9c3ac9ec7..f98fb7c3556 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -32,6 +32,9 @@ extern "C" { +int add_path(int, char**); +int add_cmdline(int, char**); + int add_path(int p_argc, char** p_args) { NSString* str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"];