[Scummvm-tracker] [ScummVM] #10765: QFG4 floppy: Assertion Error celobj32.cpp:179 at the swamp
Vhati
trac at scummvm.org
Sun Dec 9 20:25:10 CET 2018
#10765: QFG4 floppy: Assertion Error celobj32.cpp:179 at the swamp
--------------------------------+-------------------------
Reporter: Vhati | Owner: (none)
Type: defect | Status: new
Priority: high | Component: Engine: SCI
Resolution: | Keywords: SCI32
Game: Quest for Glory 4 |
--------------------------------+-------------------------
Comment (by Vhati):
The only functional difference I'm seeing between Scaler versions is CD
avoids recalculating if the y position hasn't changed since last time. And
I don't think hands ever move.
\\
\\
script 10 - Swamp::init()
{{{
(= local7 (IntArray with: 54 48 95 158 132))
(= local8 (IntArray with: 175 108 119 142 178))
# ...
(switch g11_myCurrentRoomNum
# ...
(535
(= temp0 0)
(while (< temp0 5)
((hands new:)
init: temp0 (local7 at: temp0) (local8 at:
temp0)
)
(++ temp0)
)
)
# ...
)
}}}
\\
\\
script 10 - hands::init()
{{{
(method (init param1 param2 param3)
(super init:)
(= x param2)
(= y param3)
(= loop (Random 0 5))
((Timer new:) setReal: self (Random 5 25))
(self
signal: (| (self signal?) $0001)
setScaler: Scaler 100 60 125 65
)
)
}}}
\\
\\
hands is a TargActor, whose ancestry is Feature/View/Prop/Actor.
Prop::setScaler() basically forwards args to Scaler::init(self, &rest).
\\
\\
script 64935 - Scaler::init()
{{{
(method (init param1 param2 param3 param4 param5)
(if argc
(= client param1)
(= frontSize param2)
(= backSize param3)
(= frontY param4)
(= backY param5)
)
(= slopeNum (- frontSize backSize))
(if (not (= slopeDen (- frontY backY)))
(proc64921_0 {<Scaler> frontY cannot be equal to backY})
(return 0)
)
(= const (- backSize (/ (* slopeNum backY) slopeDen)))
(return (self doit:))
)
}}}
\\
\\
A hands scaler would have...
* frontSize = 100
* backSize = 60
* frontY = 125
* backY = 65
* slopeNum = 100 - 60 = 40
* slopeDen = 125 - 65 = 60
* const = 60 - (100 * 65 / 60) = -48
Okay. frontY & backY are capping the scale. If a client moves lower/higher
than those values, it won't get any bigger/smaller.
The problem hand earlier was at y:108.
{{{
(else (= temp1 (+ (/ (* slopeNum temp0) slopeDen) const)))
}}}
40 * 108 / 60 + -48 = 24
If the client's "scaleY" property isn't already 24...
(Debugger says a hands at that position has scaleY:113. Dunno where 113
came from.)
... the scaler will attempt to set scaleY to 24.
The assertion doesn't abort anything though.
"bp_write hands.3::scaleY" isn't stopping as the hand bobs up and down, so
scaleY isn't constantly being set (or it is constantly set to 113?).
Confused.
--
Ticket URL: <https://bugs.scummvm.org/ticket/10765#comment:9>
ScummVM <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list