Opened 18 months ago

Closed 3 months ago

Last modified 3 months ago

#13834 closed defect (fixed)

TRECISION: Nightlong: Union City Conspiracy - Unable to save

Reported by: ameurenand Owned by: eriktorbjorn
Priority: high Component: Engine: Trecision
Version: Keywords:
Cc: ameurenand Game: Nightlong: Union City Conspiracy


I use ScummVM version 2.6.0 on my Android 8.0 device.
I added the game "Nightlong: Union City Conspiracy" but I can't save my game.
After selecting a slot and entering a save name , nothing happens.
Then when I try to reload a game, I have no saved game.
I tested the "original save/load screens" option but it still failed.
I tested the same ScummVM version on my Windows PC and the save button is working well.

ScummVM version : 2.6.0 (Android ARMv7a package)
Android version : 8.0

Change History (6)

comment:1 by antoniou79, 18 months ago

Component: --Unset--Port: Android
Summary: Nightlong: Union City Conspiracy - Unable to save on AndroidANDROID: TRECISION: Nightlong: Union City Conspiracy - Unable to save on Android

comment:2 by tag2015, 3 months ago

This is not an Android bug it also happens on Windows, and it's a bit weird.
Basically saving from the GMM (using CTRL-F5) does not work until you open the game menu (hitting ESC) at least once.

comment:3 by tag2015, 3 months ago

Component: Port: AndroidEngine: Trecision
Priority: normalhigh
Summary: ANDROID: TRECISION: Nightlong: Union City Conspiracy - Unable to save on AndroidTRECISION: Nightlong: Union City Conspiracy - Unable to save

comment:4 by eriktorbjorn, 3 months ago

The problem seems to be that when you save from the ScummVM menu, it never calls createThumbnailFromScreen(), so when it tries to save it fails with a "WARNING: trying to save thumbnail with bpp 0!"

When you bring up the game's own main menu, it does create the thumbnail.

comment:5 by eriktorbjorn, 3 months ago

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)
 		_vm->_curRoom = _vm->_obj[o00EXIT]._goRoom;
+		_vm->_controlPanelSave = true;
+		_vm->_controlPanelSave = false;
 		_vm->showInventoryName(NO_OBJECTS, false);
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.

comment:6 by bluegr, 3 months ago

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed

Fixed in the following PR:


Last edited 3 months ago by bluegr (previous) (diff)
Note: See TracTickets for help on using tickets.