mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
GUI: Prefer Surface::create taking a PixelFormat over the one taking a byte depth.
This commit is contained in:
parent
23479d07f3
commit
2329a00873
@ -373,8 +373,8 @@ const char *ThemeEngine::findModeConfigName(GraphicsMode mode) {
|
||||
bool ThemeEngine::init() {
|
||||
// reset everything and reload the graphics
|
||||
_initOk = false;
|
||||
setGraphicsMode(_graphicsMode);
|
||||
_overlayFormat = _system->getOverlayFormat();
|
||||
setGraphicsMode(_graphicsMode);
|
||||
|
||||
if (_screen.pixels && _backBuffer.pixels) {
|
||||
_initOk = true;
|
||||
@ -499,10 +499,10 @@ void ThemeEngine::setGraphicsMode(GraphicsMode mode) {
|
||||
uint32 height = _system->getOverlayHeight();
|
||||
|
||||
_backBuffer.free();
|
||||
_backBuffer.create(width, height, _bytesPerPixel);
|
||||
_backBuffer.create(width, height, _overlayFormat);
|
||||
|
||||
_screen.free();
|
||||
_screen.create(width, height, _bytesPerPixel);
|
||||
_screen.create(width, height, _overlayFormat);
|
||||
|
||||
delete _vectorRenderer;
|
||||
_vectorRenderer = Graphics::createRenderer(mode);
|
||||
|
@ -573,11 +573,12 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
|
||||
if (h == -1)
|
||||
h = _h;
|
||||
|
||||
Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
|
||||
|
||||
_gfx.free();
|
||||
_gfx.create(w, h, sizeof(OverlayColor));
|
||||
_gfx.create(w, h, overlayFormat);
|
||||
|
||||
OverlayColor *dst = (OverlayColor *)_gfx.pixels;
|
||||
Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
|
||||
OverlayColor fillCol = overlayFormat.RGBToColor(r, g, b);
|
||||
while (h--) {
|
||||
for (int i = 0; i < w; ++i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user