void DINGUXSdlGraphicsManager::initSize(uint w, uint h) { assert(_transactionMode == kTransactionActive); // Avoid redundant res changes if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight) return; _videoMode.screenWidth = w; _videoMode.screenHeight = h; if (w > 320 || h > 240) { setGraphicsMode(GFX_HALF); setGraphicsModeIntern(); _window->toggleMouseGrab(); } _transactionDetails.sizeChanged = true; }
void GPHGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) { assert(_transactionMode == kTransactionActive); #ifdef USE_RGB_COLOR // Avoid redundant format changes Graphics::PixelFormat newFormat; if (!format) newFormat = Graphics::PixelFormat::createFormatCLUT8(); else newFormat = *format; assert(newFormat.bytesPerPixel > 0); if (newFormat != _videoMode.format) { _videoMode.format = newFormat; _transactionDetails.formatChanged = true; _screenFormat = newFormat; } #endif // Avoid redundant res changes if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight) return; _videoMode.screenWidth = w; _videoMode.screenHeight = h; if (w > 320 || h > 240) { setGraphicsMode(GFX_HALF); setGraphicsModeIntern(); _eventSource->toggleMouseGrab(); } _videoMode.overlayWidth = 320; _videoMode.overlayHeight = 240; _transactionDetails.sizeChanged = true; }