WINTERMUTE: Remove/comment out all ifdef __IPHONE occurences

This commit is contained in:
Einar Johan Trøan Sømåen 2012-07-17 23:16:04 +02:00
parent 10c4aa8cec
commit 642714dc19
5 changed files with 15 additions and 78 deletions

View File

@ -300,33 +300,6 @@ ERRORCODE CBFileManager::initPaths() {
// package files paths
addPath(PATH_PACKAGE, "./");
/*#ifdef __APPLE__
// search .app path and Resources dir in the bundle
CFURLRef appUrlRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFStringRef macPath = CFURLCopyFileSystemPath(appUrlRef, kCFURLPOSIXPathStyle);
const char *pathPtr = CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding());
#ifdef __IPHONE__
AddPath(PATH_PACKAGE, pathPtr);
AddPath(PATH_SINGLE, pathPtr);
#else
char bundlePath[MAX_PATH_LENGTH];
sprintf(bundlePath, "%s/../", pathPtr);
AddPath(PATH_PACKAGE, bundlePath);
AddPath(PATH_SINGLE, bundlePath);
sprintf(bundlePath, "%s/Contents/Resources/", pathPtr);
AddPath(PATH_PACKAGE, bundlePath);
AddPath(PATH_SINGLE, bundlePath);
CFRelease(appUrlRef);
CFRelease(macPath);
#endif
#endif*/
pathList = Game->_registry->readString("Resource", "PackagePaths", "");
numPaths = CBUtils::strNumEntries(pathList.c_str(), ';');

View File

@ -68,10 +68,6 @@
#include "common/system.h"
#include "common/file.h"
#ifdef __IPHONEOS__
# include "ios_utils.h"
#endif
namespace WinterMute {
//////////////////////////////////////////////////////////////////////
@ -262,13 +258,13 @@ CBGame::CBGame(): CBObject(this) {
_autoSaveSlot = 999;
_cursorHidden = false;
#ifdef __IPHONEOS__
/*#ifdef __IPHONEOS__
_touchInterface = true;
_constrainedMemory = true; // TODO differentiate old and new iOS devices
#else
#else*/
_touchInterface = false;
_constrainedMemory = false;
#endif
//#endif
}
@ -512,19 +508,6 @@ ERRORCODE CBGame::initialize3() { // renderer is initialized
void CBGame::DEBUG_DebugEnable(const char *filename) {
_dEBUG_DebugMode = true;
#ifndef __IPHONEOS__
//if (filename)_dEBUG_LogFile = fopen(filename, "a+");
//else _dEBUG_LogFile = fopen("./zz_debug.log", "a+");
if (!_dEBUG_LogFile) {
AnsiString safeLogFileName = PathUtil::getSafeLogFileName();
//_dEBUG_LogFile = fopen(safeLogFileName.c_str(), "a+");
}
//if (_dEBUG_LogFile != NULL) fprintf((FILE *)_dEBUG_LogFile, "\n");
warning("BGame::DEBUG_DebugEnable - No logfile is currently created"); //TODO: Use a dumpfile?
#endif
/* time_t timeNow;
time(&timeNow);
struct tm *tm = localtime(&timeNow);
@ -2139,9 +2122,9 @@ ERRORCODE CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "ShowStatusLine") == 0) {
stack->correctParams(0);
#ifdef __IPHONEOS__
/*#ifdef __IPHONEOS__
IOS_ShowStatusLine(TRUE);
#endif
#endif*/
stack->pushNULL();
return STATUS_OK;
@ -2152,9 +2135,9 @@ ERRORCODE CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "HideStatusLine") == 0) {
stack->correctParams(0);
#ifdef __IPHONEOS__
/*#ifdef __IPHONEOS__
IOS_ShowStatusLine(FALSE);
#endif
#endif*/
stack->pushNULL();
return STATUS_OK;
@ -3839,12 +3822,8 @@ ERRORCODE CBGame::getSaveSlotFilename(int slot, char *buffer) {
//////////////////////////////////////////////////////////////////////////
AnsiString CBGame::getDataDir() {
AnsiString userDir = PathUtil::getUserDirectory();
#ifdef __IPHONEOS__
return userDir;
#else
AnsiString baseDir = _registry->getBasePath();
return PathUtil::combine(userDir, baseDir);
#endif
}
@ -4453,11 +4432,6 @@ bool CBGame::isDoubleClick(int buttonIndex) {
int maxMoveX = 4;
int maxMoveY = 4;
#if __IPHONEOS__
maxMoveX = 16;
maxMoveY = 16;
#endif
Point32 pos;
CBPlatform::getCursorPos(&pos);
@ -4494,13 +4468,7 @@ void CBGame::addMem(int bytes) {
//////////////////////////////////////////////////////////////////////////
AnsiString CBGame::getDeviceType() const {
#ifdef __IPHONEOS__
char devType[128];
IOS_GetDeviceType(devType);
return AnsiString(devType);
#else
return "computer";
#endif
}
} // end of namespace WinterMute

View File

@ -138,7 +138,7 @@ ERRORCODE CBRenderSDL::initRenderer(int width, int height, bool windowed) {
// find suitable resolution
#ifdef __IPHONEOS__
/*#ifdef __IPHONEOS__
_realWidth = 480;
_realHeight = 320;
@ -153,10 +153,10 @@ ERRORCODE CBRenderSDL::initRenderer(int width, int height, bool windowed) {
break;
}
}
#else
#else*/
_realWidth = Game->_registry->readInt("Debug", "ForceResWidth", _width);
_realHeight = Game->_registry->readInt("Debug", "ForceResHeight", _height);
#endif
//#endif
/*
_realWidth = 480;
@ -191,7 +191,7 @@ ERRORCODE CBRenderSDL::initRenderer(int width, int height, bool windowed) {
Uint32 flags = SDL_WINDOW_SHOWN;
#endif
#ifdef __IPHONEOS__
flags |= SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS;
//flags |= SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS;
#endif
//_windowed = Game->_registry->readBool("Video", "Windowed", true);
@ -220,7 +220,7 @@ ERRORCODE CBRenderSDL::initRenderer(int width, int height, bool windowed) {
#ifdef __IPHONEOS__
// SDL defaults to OGL ES2, which doesn't work on old devices
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengles");
//SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengles");
#else
//SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
#endif

View File

@ -133,14 +133,14 @@ void CBPlatform::handleEvent(Common::Event *event) {
*/
case Common::EVENT_QUIT:
case Common::EVENT_RTL:
#ifdef __IPHONEOS__
/*#ifdef __IPHONEOS__
if (Game) {
Game->AutoSaveOnExit();
Game->_quitting = true;
}
#else
#else*/
if (Game) Game->onWindowClose();
#endif
//#endif
break;
default:

View File

@ -219,10 +219,6 @@ int WinterMuteEngine::init() {
_game->initialize3();
#ifdef __IPHONEOS__
SDL_AddEventWatch(CBPlatform::SDLEventWatcher, NULL);
#endif
// initialize sound manager (non-fatal if we fail)
ret = _game->_soundMgr->initialize();
if (DID_FAIL(ret)) {