Opened 5 years ago

Closed 2 years ago

#10836 closed defect (fixed)

SHERLOCK: Scalpel - inventory glitch

Reported by: eriktorbjorn Owned by: dreammaster
Priority: normal Component: Engine: Sherlock
Version: Keywords:
Cc: Game: Sherlock Holmes: Case of the Serrated Scalpel

Description

This one is easy to reproduce, at least for me, in the current development version of ScummVM and an English version of the game.

  1. Start the game. Skip the intro.
  2. Open the inventory.
  3. With the inventory still open, look at an object in the room. (Don't look at an object in the inventory. That won't trigger the glitch.)
  4. Click to dismiss the object description.

All inventory icons are now blank.

This happen regardless of if you use the "Windows Appear" or the "Windows Slide" setting.

Change History (7)

comment:1 by eriktorbjorn, 5 years ago

Game: Sherlock Holmes: Case of the Serrated Scalpel

comment:2 by raziel-, 4 years ago

Summary: SHERLOCK: Serrated Scalpel inventory glitchSHERLOCK: Scalpel - inventory glitch

comment:3 by eriktorbjorn, 2 years ago

It seems to have something to do with the engine calling drawInventory(INVENTORY_DONT_DISPLAY), so that only the inventory graphics, not the objects, are redrawn.

I can work around it with this:

diff --git a/engines/sherlock/scalpel/scalpel_inventory.cpp b/engines/sherlock/scalpel/scalpel_inventory.cpp
index 07659b41f2..3cf130e406 100644
--- a/engines/sherlock/scalpel/scalpel_inventory.cpp
+++ b/engines/sherlock/scalpel/scalpel_inventory.cpp
@@ -116,7 +116,10 @@ void ScalpelInventory::drawInventory(InvNewMode mode) {
        }
 
        invCommands(0);
-       putInv(SLAM_DONT_DISPLAY);
+       if (tempMode == INVENTORY_DONT_DISPLAY)
+               putInv(SLAM_SECONDARY_BUFFER);
+       else
+               putInv(SLAM_DONT_DISPLAY);
 
        if (tempMode != INVENTORY_DONT_DISPLAY) {
                if (!ui._slideWindows) {

But I don't know enough about the engine to say if that's even close to a real solution. It probably isn't.

Last edited 2 years ago by eriktorbjorn (previous) (diff)

comment:4 by eriktorbjorn, 2 years ago

The glitch does not happen when I run the original game in DOSBox, by the way.

comment:5 by eriktorbjorn, 2 years ago

When looking at an inventory object, it will call putInv(2) (SLAM_SECONDARY_BUFFER) before banishWindow(). If I understand it correctly, this means it will redraw the inventory to the buffer it uses to display the inventory as the other window slides away.

When looking at a room object, it will call putInv(0) (SLAM_DONT_DISPLAY) instead before banishWindow().

But I keep going in circles when trying to figure out what to do about it.

comment:6 by eriktorbjorn, 2 years ago

I think I may have found the problem: In putInv() we explicitly refer to _backBuffer1 where we should probably refer to the current back buffer instead. I'll submit a pull request soon, I just want to investigate a bit further first.

Version 0, edited 2 years ago by eriktorbjorn (next)

comment:7 by dreammaster, 2 years ago

Owner: set to dreammaster
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.