[Scummvm-tracker] [ScummVM :: Bugs] #13834: TRECISION: Nightlong: Union City Conspiracy - Unable to save

ScummVM :: Bugs trac at scummvm.org
Fri Nov 24 11:09:06 UTC 2023


#13834: TRECISION: Nightlong: Union City Conspiracy - Unable to save
-----------------------+-----------------------------------------------
Reporter:  ameurenand  |       Owner:  (none)
    Type:  defect      |      Status:  new
Priority:  high        |   Component:  Engine: Trecision
 Version:              |  Resolution:
Keywords:              |        Game:  Nightlong: Union City Conspiracy
-----------------------+-----------------------------------------------
Comment (by eriktorbjorn):

 I think it creates the thumbnail in advance for the built-in save dialog
 so that it won't get a thumbnail of its control panel. Perhaps something
 like this would be a solution:

 {{{
 diff --git a/engines/trecision/logic.cpp b/engines/trecision/logic.cpp
 index 062c11b208a..77c9e284552 100644
 --- a/engines/trecision/logic.cpp
 +++ b/engines/trecision/logic.cpp
 @@ -3988,7 +3988,9 @@ void LogicManager::handleClickControlPanel(uint16
 curObj) {
                 if (_vm->_oldRoom == kRoomControlPanel)
                         break;
                 _vm->_curRoom = _vm->_obj[o00EXIT]._goRoom;
 +               _vm->_controlPanelSave = true;
                 _vm->dataSave();
 +               _vm->_controlPanelSave = false;
                 _vm->showInventoryName(NO_OBJECTS, false);
                 _vm->showIconName();
                 _vm->changeRoom(_vm->_obj[o00EXIT]._goRoom);
 diff --git a/engines/trecision/metaengine.cpp
 b/engines/trecision/metaengine.cpp
 index dcf356e9765..674a0a628d4 100644
 --- a/engines/trecision/metaengine.cpp
 +++ b/engines/trecision/metaengine.cpp
 @@ -68,7 +68,10 @@ void
 TrecisionMetaEngine::getSavegameThumbnail(Graphics::Surface &thumb) {
         // We are referencing g_engine here, but this should be safe, as
 this
         // method is only used while the engine is running.
         // TODO: Is there a better way to do this?
 -       thumb.copyFrom(((Trecision::TrecisionEngine
 *)g_engine)->_thumbnail);
 +       if (((Trecision::TrecisionEngine *)g_engine)->_controlPanelSave)
 +               thumb.copyFrom(((Trecision::TrecisionEngine
 *)g_engine)->_thumbnail);
 +       else
 +               MetaEngine::getSavegameThumbnail(thumb);
  }

  SaveStateDescriptor TrecisionMetaEngine::querySaveMetaInfos(const char
 *target, int slot) const {
 diff --git a/engines/trecision/trecision.h b/engines/trecision/trecision.h
 index 82cf0b1f929..139545cc086 100644
 --- a/engines/trecision/trecision.h
 +++ b/engines/trecision/trecision.h
 @@ -243,6 +243,7 @@ public:
         const ADGameDescription *_gameDescription;

         Graphics::Surface _thumbnail;
 +       bool _controlPanelSave = false;

         uint16 _curRoom;
         uint16 _oldRoom;
 }}}

 That way, it only uses the pre-made thumbnail if the save is triggered
 from the control panel. For other saves, it creates a new thumbnail.

 But I'm not familiar with the engine, and I don't know if there's a better
 way.
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/13834#comment:5>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list