AGI: show.obj priority error
|Reported by:||SF/agibugs||Owned by:||SF/buddha_|
Version: ScummVM 0.10.0 (Jun 17 2007 18:01:36)
OS: Mac OS X 10.4
Games affected: all AGI games
There seems to be an occasional graphics glitch when inventory items are displayed with show.obj or show.obj.v. Items should be shown in front of all sprites and background objects but sometimes the item appears behind them.
Apparently the problem is related to the width of the view (sprite) depicting the inventory item. The issue probably exists in all games where the horizontal size of an item is <15px.
To reproduce in the fanmade game "AGI Quest":
- start game
- activate debug mode
- type "gimme gimme" to get all inventory items
- walk two screens east to the waterfall screen
- type "look bottle"
- bottom part of item is obscured by rock (error)
I'm unfamiliar with the code but I would guess that the problem is in /scummvm/trunk/engines/agi/sprite.cpp at SpritesMgr::showObj at the following line:
blitCel(x1, y1, s.xSize, c, _vm->_game.views[n].agi256_2);
Looks like the third argument sets the priority which here depends on the width (xSize) of the view. Perhaps s.xSize should be replaced with the value 15?
Ticket imported from: #1858037. Ticket imported from: bugs/3534.