From e79f6a631474a49b9e92d3d0c8c5f2a7dc72d123 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 22 Feb 2012 02:30:44 +0100 Subject: [PATCH] IPHONE: Move ObjC code files (.m) to ObjC++ files (.mm). --- backends/platform/iphone/iphone_common.h | 24 +++---------------- .../{iphone_keyboard.m => iphone_keyboard.mm} | 0 .../iphone/{iphone_main.m => iphone_main.mm} | 0 .../{iphone_video.m => iphone_video.mm} | 2 +- backends/platform/iphone/osys_video.cpp | 2 +- 5 files changed, 5 insertions(+), 23 deletions(-) rename backends/platform/iphone/{iphone_keyboard.m => iphone_keyboard.mm} (100%) rename backends/platform/iphone/{iphone_main.m => iphone_main.mm} (100%) rename backends/platform/iphone/{iphone_video.m => iphone_video.mm} (99%) diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h index 3c2d4143049..5a46a6dde69 100644 --- a/backends/platform/iphone/iphone_common.h +++ b/backends/platform/iphone/iphone_common.h @@ -50,27 +50,13 @@ enum UIViewSwipeDirection { kUIViewSwipeRight = 8 }; -typedef enum { +enum GraphicsModes { kGraphicsModeLinear = 0, kGraphicsModeNone = 1 -} GraphicsModes; - -#ifdef IPHONE_OFFICIAL -void iphone_main(int argc, char **argv); -#endif - -// We need this to be able to call functions from/in Objective-C. -#ifdef __cplusplus -extern "C" { -#endif - -// On the C++ side -#ifndef IPHONE_OFFICIAL -void iphone_main(int argc, char *argv[]); -#endif +}; // On the ObjC side -void iPhone_setGraphicsMode(int mode); +void iPhone_setGraphicsMode(GraphicsModes mode); void iPhone_updateScreen(int mouseX, int mouseY); void iPhone_updateScreenRect(unsigned short *screen, int x1, int y1, int x2, int y2); void iPhone_updateOverlayRect(unsigned short *screen, int x1, int y1, int x2, int y2); @@ -87,8 +73,4 @@ void iPhone_setMouseCursor(unsigned short *buffer, int width, int height, int ho uint getSizeNextPOT(uint size); -#ifdef __cplusplus -} -#endif - #endif diff --git a/backends/platform/iphone/iphone_keyboard.m b/backends/platform/iphone/iphone_keyboard.mm similarity index 100% rename from backends/platform/iphone/iphone_keyboard.m rename to backends/platform/iphone/iphone_keyboard.mm diff --git a/backends/platform/iphone/iphone_main.m b/backends/platform/iphone/iphone_main.mm similarity index 100% rename from backends/platform/iphone/iphone_main.m rename to backends/platform/iphone/iphone_main.mm diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.mm similarity index 99% rename from backends/platform/iphone/iphone_video.m rename to backends/platform/iphone/iphone_video.mm index 5adf594a156..2dcca3592c1 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.mm @@ -83,7 +83,7 @@ int printOglError(const char *file, int line) { return retCode; } -void iPhone_setGraphicsMode(int mode) { +void iPhone_setGraphicsMode(GraphicsModes mode) { _graphicsMode = mode; [sharedInstance performSelectorOnMainThread:@selector(setGraphicsMode) withObject:nil waitUntilDone: YES]; diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp index 2b45b5568ca..e26c360c822 100644 --- a/backends/platform/iphone/osys_video.cpp +++ b/backends/platform/iphone/osys_video.cpp @@ -39,7 +39,7 @@ bool OSystem_IPHONE::setGraphicsMode(int mode) { case kGraphicsModeNone: case kGraphicsModeLinear: _currentGraphicsMode = mode; - iPhone_setGraphicsMode(mode); + iPhone_setGraphicsMode((GraphicsModes)mode); return true; default: