[Scummvm-tracker] [ScummVM :: Bugs] #14872: GRAPHICS: HQScaler crash when exiting Indy3-Mac in HQ3X

ScummVM :: Bugs trac at scummvm.org
Fri Jan 26 12:45:40 UTC 2024


#14872: GRAPHICS: HQScaler crash when exiting Indy3-Mac in HQ3X
---------------------+--------------------------------
Reporter:  dwatteau  |       Owner:  (none)
    Type:  defect    |      Status:  new
Priority:  normal    |   Component:  Graphics: Scalers
 Version:            |  Resolution:
Keywords:            |        Game:  Indiana Jones 3
---------------------+--------------------------------
Comment (by eriktorbjorn):

 It looks like when SurfaceSdlGraphicsManager creates a new _scalerPlugin
 and _scaler, it does not create a new _mouseScaler. So while the scaler
 changes from HQ3x (not allowed to scale the cursor) to Normal2x (allowed
 to scale the cursor), _mouseScaler will still be a HQ scaler.

 So it ought to be possible to reproduce this with other games, except
 perhaps it also requires the cursor to be a particular size?

 I'm not really familiar with the graphical backend, but something like
 this seems to fix it for me:

 {{{
 diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
 b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
 index 6990aa19c73..0eb3ee43d18 100644
 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
 +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
 @@ -683,6 +683,11 @@ void
 SurfaceSdlGraphicsManager::setGraphicsModeIntern() {

                 _scalerPlugin =
 &_scalerPlugins[_videoMode.scalerIndex]->get<ScalerPluginObject>();
                 _scaler = _scalerPlugin->createInstance(format);
 +
 +               if (_mouseScaler != nullptr) {
 +                       delete _mouseScaler;
 +                       _mouseScaler =
 _scalerPlugin->createInstance(_cursorFormat);
 +               }
         }

         _scaler->setFactor(_videoMode.scaleFactor);
 }}}

 Maybe it should also call _mouseScaler->setFactor(_videoMode.scaleFactor),
 but that's also done before the mouse is scaled in
 SurfaceSdlGraphicsManager::blitCursor(). As I said, I don't know...
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/14872#comment:7>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list