IPHONE: Implement very basic GFX transaction support.

This allows for AR ratio correction changes to take place, even when the AR
setting is set after initSize for example.
This commit is contained in:
Johannes Schickel 2012-02-25 19:49:05 +01:00
parent 273df3c075
commit 97e486dee3
2 changed files with 15 additions and 8 deletions

View File

@ -121,6 +121,10 @@ public:
virtual bool setGraphicsMode(int mode);
virtual int getGraphicsMode() const;
virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format);
virtual void beginGFXTransaction();
virtual TransactionError endGFXTransaction();
virtual int16 getHeight();
virtual int16 getWidth();

View File

@ -44,7 +44,6 @@ bool OSystem_IPHONE::setGraphicsMode(int mode) {
case kGraphicsModeNone:
case kGraphicsModeLinear:
_videoContext->graphicsMode = (GraphicsModes)mode;
[g_iPhoneViewInstance performSelectorOnMainThread:@selector(setGraphicsMode) withObject:nil waitUntilDone: YES];
return true;
default:
@ -68,17 +67,21 @@ void OSystem_IPHONE::initSize(uint width, uint height, const Graphics::PixelForm
_gameScreenRaw = (byte *)malloc(width * height);
bzero(_gameScreenRaw, width * height);
updateOutputSurface();
clearOverlay();
_fullScreenIsDirty = false;
dirtyFullScreen();
_videoContext->mouseIsVisible = false;
_mouseCursorPaletteEnabled = false;
_screenChangeCount++;
}
updateScreen();
void OSystem_IPHONE::beginGFXTransaction() {
}
OSystem::TransactionError OSystem_IPHONE::endGFXTransaction() {
_screenChangeCount++;
updateOutputSurface();
[g_iPhoneViewInstance performSelectorOnMainThread:@selector(setGraphicsMode) withObject:nil waitUntilDone: YES];
// TODO: Can we return better error codes?
return kTransactionSuccess;
}
void OSystem_IPHONE::updateOutputSurface() {