Opened 3 years ago

Closed 3 years ago

#12079 closed defect (fixed)

Return to Launcher crash with RGB rendering on and different graphic mode from global opengl

Reported by: Tucky27 Owned by: criezy
Priority: normal Component: Engine: SCI
Version: Keywords: has-pull-request
Cc: Game:

Description

Instead of returning to launcher when I quit SQ4 and SQ3 both crashed . I have opengl set globally and when I select a different graphic mode and have RGB on for these games it seems to cause a crash. I am using Windows 7 b4 bit. When I don't have opengl set globally the return function works fine.

Change History (4)

comment:1 by raziel-, 3 years ago

ScummVM 2.3.0git (Jan 21 2021 13:13:34)
Features compiled in: Vorbis FLAC MP3 RGB zLib MPEG2 Theora AAC A/52 FreeType2 FriBiDi JPEG PNG cloud (servers, local) TinyGL OpenGL

Here is some more information.

Global gfx mode is set to OpenGL
Game's gfx mode is set to Normal (No scaling) (or anything other than OpenGL)
Game's engine setting RGB rendering is checked

All other settings remain the same.

On Return to Launcher i get an assertion:
assertion "_transactionMode != kTransactionNone" failed: file "backends/graphics/opengl/opengl-graphics.cpp", line 111

It doesn't matter if i'm in window or fullscreen mode.

SDL Audio and SDL thread timer is crashing afterwards, but i guess that it because SDL is going doen, so i didn't attach crashlogs.

Space Quest IV: Roger Wilco and the Time Rippers (CD/Windows/English)

AmigaOS4 - SDL2 - PPC -BE
gcc (adtools build 10.1.0) 10.1.0

comment:2 by criezy, 3 years ago

Here is what I found when investigating this: when switching between SDL and OpenGL graphics mode, the call to g_system->setGraphicsMode executes OSystem_SDL::setGraphicsMode which copies the state of the old graphics manager, deletes that manager, creates the new one, and sets its state. In this specific setting the state in the new OpenGLGraphicsManager fails, and that results in the assert on the next line trying to set the stretch mode.

The reason it fails is that the game was using format ARGB8888 with the SDL graphics manager. But the OpenGL graphics manager does not support that format, and as a result trying to set it fails.

My suggestion to fix that would be in SdlGraphicsManager::setState to not blindly use the pixel format from the state, but check that it is supported and if not use the first format from getSupportedFormats().

comment:3 by criezy, 3 years ago

Keywords: has-pull-request added

comment:4 by criezy, 3 years ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

The pull request has been merged.

Note: See TracTickets for help on using tickets.