Difference between revisions of "SCI/Specifications/SCI in action/Views and animation in SCI"

Jump to navigation Jump to search
m
Text replacement - "<source lang=" to "<syntaxhighlight lang="
(Merging of the SCI documentation. Done)
 
m (Text replacement - "<source lang=" to "<syntaxhighlight lang=")
 
(4 intermediate revisions by 3 users not shown)
Line 8: Line 8:
An animation cycle is done entirely in SCI code (with the aid of some kernel calls). It involves two other objects; the mover and the cycler. The mover is responsible for controlling the motion of an actor towards a specific point, while the cycler changes the image of the actor, making him appear to walk, for instance.
An animation cycle is done entirely in SCI code (with the aid of some kernel calls). It involves two other objects; the mover and the cycler. The mover is responsible for controlling the motion of an actor towards a specific point, while the cycler changes the image of the actor, making him appear to walk, for instance.


The behaviour of a view is controlled by its signal property. This property contains a bitfield which describes a lot of animation-related stuff. The bits can be roughly divided into two groups; the script and interpreter bits (I had called them Option and State bits at first, but that is not entirely accurate). The first group allows the script to influence the drawing pro- cess somewhat, the other are used internally by the interpreter. The two groups overlap a bit, though.
The behavior of a view is controlled by its signal property. This property contains a bitfield which describes a lot of animation-related stuff. The bits can be roughly divided into two groups; the script and interpreter bits (I had called them Option and State bits at first, but that is not entirely accurate). The first group allows the script to influence the drawing pro- cess somewhat, the other are used internally by the interpreter. The two groups overlap a bit, though.


<p><strong>Table 6-1. SCI and FreeSCI signal bits</strong></p>
<p><strong>Table 6-1. SCI and FreeSCI signal bits</strong></p>
Line 101: Line 101:
|  align="left" valign="top" | _K_VIEW_SIG_FLAG_IGNORE_ACTOR
|  align="left" valign="top" | _K_VIEW_SIG_FLAG_IGNORE_ACTOR
|  align="left" valign="top" | Actors can walk in the rectangle occupied by the view. The
|  align="left" valign="top" | Actors can walk in the rectangle occupied by the view. The
behaviour of this bit is odd, and best expressed by example. The Guild Master in QfG1 has
behavior of this bit is odd, and best expressed by example. The Guild Master in QfG1 has
his bit 14 set. This means that ego (or someone else) can walk all the way to his chair
his bit 14 set. This means that ego (or someone else) can walk all the way to his chair
(try sneaking in on him from behind). If we clear this bit, we can't sneak in on
(try sneaking in on him from behind). If we clear this bit, we can't sneak in on
Line 134: Line 134:
Animate (see the Section called Kernel function 0x0b: Animate([DblList], [word]) in Chapter 5) can be called in two ways:
Animate (see the Section called Kernel function 0x0b: Animate([DblList], [word]) in Chapter 5) can be called in two ways:


<syntax type="C">
<syntaxhighlight lang="c">
Animate(DblList cast, bool cycle)
Animate(DblList cast, bool cycle)
Animate()</syntax>
Animate()</syntaxhighlight>


If the second syntax is used, the two parameters are assumed to be zero.
If the second syntax is used, the two parameters are assumed to be zero.
Line 144: Line 144:
The general pseudocode for Animate goes as follows:
The general pseudocode for Animate goes as follows:


<syntax type="?">
<pre>
0. Backup PicNotValid: PicNotValid' := PicNotValid
0. Backup PicNotValid: PicNotValid' := PicNotValid
1. If we don't have a new cast:
1. If we don't have a new cast:
Line 195: Line 195:
         22.1.2. Clear the underbits
         22.1.2. Clear the underbits
     22.2. [24] if DISPOSE_ME is set, call view::dispose to dispose it
     22.2. [24] if DISPOSE_ME is set, call view::dispose to dispose it
</syntax>
</pre>


With the sub-algorithm being:
With the sub-algorithm being:


<syntax type="?">
<pre>
1. For each view from the cast list:
1. For each view from the cast list:
     1.1. [2] If NO_UPDATE is set:
     1.1. [2] If NO_UPDATE is set:
Line 223: Line 223:
     14.1. If NO_UPDATE is set and IS_HIDDEN is clear:
     14.1. If NO_UPDATE is set and IS_HIDDEN is clear:
         14.1.1. [15] Draw the view
         14.1.1. [15] Draw the view
</syntax>
</pre>


Note that the ReAnimate subfunction (0x0D) of the Graph kernel call redraws parts of the maps using the cast list created by Animate, whereas the ShowBits call (0x0C) copies parts of the active map to the physical screen.
Note that the ReAnimate subfunction (0x0D) of the Graph kernel call redraws parts of the maps using the cast list created by Animate, whereas the ShowBits call (0x0C) copies parts of the active map to the physical screen.
TrustedUser
2,147

edits

Navigation menu