Skip to content

Commit 79f2010

Browse files
committed
[NANCY] skip unneeded Screen::Screen() constructor call
That call would store a dirty rectangle potentially wider than engine target screen size (640x480), in cases where g_system->getWidth(), g_system->getHeight() are bigger for any reason, causing assertions failures on rectangle rendering to screen later.
1 parent 67d66f4 commit 79f2010

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

engines/nancy/graphics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ GraphicsManager::GraphicsManager() :
3838
_screenPixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0),
3939
_clut8Format(Graphics::PixelFormat::createFormatCLUT8()),
4040
_transparentPixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0),
41-
_isSuppressed(false) {}
41+
_isSuppressed(false),
42+
_screen(640, 480, _screenPixelFormat){}
4243

4344
void GraphicsManager::init() {
4445
auto *bsum = GetEngineData(BSUM);
@@ -54,7 +55,6 @@ void GraphicsManager::init() {
5455
}
5556

5657
initGraphics(640, 480, &_screenPixelFormat);
57-
_screen.create(640, 480, _screenPixelFormat);
5858
_screen.setTransparentColor(getTransColor());
5959
_screen.clear();
6060

0 commit comments

Comments
 (0)