[ scummvm-Patches-699980 ] Actor drawing hack

SourceForge.net noreply at sourceforge.net
Sat Mar 8 16:34:15 CET 2003


Patches item #699980, was opened at 2003-03-08 16:34
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=699980&group_id=37116

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Torbjörn Andersson (eriktorbjorn)
Assigned to: Nobody/Anonymous (nobody)
Summary: Actor drawing hack

Initial Comment:
I was hoping to do this differently, so it probably
shouldn't be applied right away, but for now here's the
hacky version:

We have a problem with actor drawing and camera
movement. When the camera moves, we call
redrawBGAreas(). This will mark the parts of the screen
that scrolled into view as dirty which should - in
theory - be enough to cause all actors in these areas
to be redrawn.

Problem is, when we draw actors we only set usage for
the strips that are actually in view. So if an actor
scrolls into view, he won't be drawn - not until he
moves anyway - since ScummVM doesn't realize the actor
is in a dirtied part of the screen.

In most cases this isn't a problem, because actors are
moving more-or-less constantly. But at least in CMI
there are some actors where it's very noticeable.
Kenny, for instance. If you enter the town from the
right and walk towards his booth, there's a good chance
that it will appear to be empty at first.

Once he has been drawn, scrolling him on/off screen
will work just fine. I believe this is because we also
only clear usage bits for strips that are in view.

I can see two possible solutions: Either we mark all
actors in the room for redraw when the camera moves,
like this patch does. This is very simple to implement,
and should be a completely safe thing to do. Still, it
doess seem like a hack to me.

Or we could set usage bits for off-screen strips. This
could be done from drawCostume(), if the information
about which strips the actor occupies was readily
available. Right now it doesn't seem to be. Just
checking _actorX and _width isn't quite enough since
you also have to take mirroring etc. into account. So
this is harder to implement, and I'm not entirely sure
whether or not it'd actually work.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=699980&group_id=37116




More information about the Scummvm-tracker mailing list