diff options
-rw-r--r-- | backends/platform/gp2x/gp2x-common.h | 15 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x.cpp | 25 | ||||
-rw-r--r-- | backends/platform/gp2x/graphics.cpp | 14 |
3 files changed, 19 insertions, 35 deletions
diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h index 7341b0646f..2b8f7c091e 100644 --- a/backends/platform/gp2x/gp2x-common.h +++ b/backends/platform/gp2x/gp2x-common.h @@ -29,13 +29,15 @@ #include <SDL.h> #include <SDL_gp2x.h> -#include "backends/base-backend.h" +#include "common/scummsys.h" +#include "common/system.h" #include "graphics/scaler.h" #define __GP2X__ #define USE_OSD -/* #define DISABLE_SCALERS */ -#define MIXER_DOUBLE_BUFFERING 1 +/* #define DISABLE_SCALERS +#define MIXER_DOUBLE_BUFFERING 1 */ + namespace Audio { class MixerImpl; @@ -57,7 +59,7 @@ enum { }; -class OSystem_GP2X : public BaseBackend { +class OSystem_GP2X : public OSystem { public: OSystem_GP2X(); virtual ~OSystem_GP2X(); @@ -187,8 +189,8 @@ public: virtual FilesystemFactory *getFilesystemFactory(); virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); - virtual Common::SeekableReadStream *createConfigReadStream(); - virtual Common::WriteStream *createConfigWriteStream(); + virtual Common::SeekableReadStream *openConfigFileForReading(); + virtual Common::WriteStream *openConfigFileForWriting(); protected: bool _inited; @@ -283,7 +285,6 @@ protected: enum { NUM_DIRTY_RECT = 100, - MAX_MOUSE_W = 80, MAX_MOUSE_H = 80, MAX_SCALING = 3 diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp index 039f72e02f..5aac6be768 100644 --- a/backends/platform/gp2x/gp2x.cpp +++ b/backends/platform/gp2x/gp2x.cpp @@ -37,7 +37,6 @@ #include "common/events.h" #include "common/util.h" -#include "common/debug.h" #include "common/file.h" #include "base/main.h" @@ -377,22 +376,6 @@ void OSystem_GP2X::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) } #endif -#if defined(MACOSX) || defined(IPHONE) - // Get URL of the Resource directory of the .app bundle - CFURLRef fileUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); - if (fileUrl) { - // Try to convert the URL to an absolute path - UInt8 buf[MAXPATHLEN]; - if (CFURLGetFileSystemRepresentation(fileUrl, true, buf, sizeof(buf))) { - // Success: Add it to the search path - Common::String bundlePath((const char *)buf); - s.add("__OSX_BUNDLE__", new Common::FSDirectory(bundlePath), priority); - } - CFRelease(fileUrl); - } - -#endif - } static Common::String getDefaultConfigFileName() { @@ -401,14 +384,14 @@ static Common::String getDefaultConfigFileName() { return configFile; } -Common::SeekableReadStream *OSystem_GP2X::createConfigReadStream() { +Common::SeekableReadStream *OSystem_GP2X::openConfigFileForReading() { Common::FSNode file(getDefaultConfigFileName()); - return file.createReadStream(); + return file.openForReading(); } -Common::WriteStream *OSystem_GP2X::createConfigWriteStream() { +Common::WriteStream *OSystem_GP2X::openConfigFileForWriting() { Common::FSNode file(getDefaultConfigFileName()); - return file.createWriteStream(); + return file.openForWriting(); } bool OSystem_GP2X::hasFeature(Feature f) { diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp index 775c3afb73..3f99e6dc16 100644 --- a/backends/platform/gp2x/graphics.cpp +++ b/backends/platform/gp2x/graphics.cpp @@ -739,18 +739,18 @@ void OSystem_GP2X::setFullscreenMode(bool enable) { } void OSystem_GP2X::setAspectRatioCorrection(bool enable) { + if ((_videoMode.screenHeight == 200 && _videoMode.aspectRatio != enable) || _transactionMode == kTransactionActive) { - Common::StackLock lock(_graphicsMutex); + } - if (_oldVideoMode.setup && _oldVideoMode.aspectRatio == enable) - return; + if (_oldVideoMode.setup && _oldVideoMode.aspectRatio == enable) + return; - if (_transactionMode == kTransactionActive) { - _videoMode.aspectRatio = enable; - _transactionDetails.needHotswap = true; - } + if (_transactionMode == kTransactionActive) { + _videoMode.aspectRatio = enable; + _transactionDetails.needHotswap = true; } } |