Implement the freeze-frame for .ani-based ship spins.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2798 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2007-07-08 23:15:36 +00:00
parent 3834011d08
commit bda96e731e
2 changed files with 55 additions and 13 deletions
+22 -7
View File
@@ -58,19 +58,34 @@ DoShipSpin (COUNT index, MUSIC_REF hMusic)
sprintf (snbuf, "slides/spins/ship%02u.aif", (unsigned)index);
if (optWhichIntro == OPT_PC || !DoFMVEx (vnbuf, "slides/spins/spin.aif", snbuf, SHIP_SPIN_LOOP_FRAME))
{
FRAME f;
FRAME p, f;
/* Display Standby frame */
p = CaptureDrawable (LoadGraphicFile ("slides/spins/ship.0.ani"));
if (p)
{
STAMP prologue;
prologue.origin.x = SCREEN_WIDTH >> 1;
prologue.origin.y = SCREEN_HEIGHT >> 1;
prologue.frame = p;
DrawStamp (&prologue);
}
clut_buf[0] = FadeAllToColor;
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 20);
FlushColorXForms ();
sprintf (vnbuf, "slides/spins/ship%02u.ani", (unsigned)index);
f = CaptureDrawable (LoadGraphicFile (vnbuf));
if (f)
{
clut_buf[0] = FadeAllToColor;
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 20);
FlushColorXForms ();
ShowShipAnim (f);
DestroyDrawable (ReleaseDrawable (f));
}
DestroyDrawable (ReleaseDrawable (f));
DestroyDrawable (ReleaseDrawable (p));
clut_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 4));
FlushColorXForms ();
+33 -6
View File
@@ -76,6 +76,7 @@ typedef struct {
/* Spinanim state */
STAMP anim;
TimeCount last_time;
int debounce;
} SPINANIM_INPUT_STATE;
static BOOLEAN DoPresentation (void *pIS);
@@ -775,18 +776,43 @@ DoSpinAnim (void *pIS)
{
SPINANIM_INPUT_STATE *pSIS = (SPINANIM_INPUT_STATE *)pIS;
STAMP *s = &pSIS->anim;
int f = GetFrameIndex (s->frame);
if (AnyButtonPress (FALSE)
|| (GLOBAL (CurrentActivity) & CHECK_ABORT))
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
{
return FALSE;
}
DrawStamp (s);
s->frame = SetRelFrameIndex (s->frame, 1);
if (AnyButtonPress (FALSE) && !pSIS->debounce)
{
pSIS->debounce = 15;
if (f < 299)
{
f = 299;
s->frame = SetAbsFrameIndex (s->frame, 299);
}
else if (f == 299)
{
f = 300;
s->frame = SetAbsFrameIndex (s->frame, 300);
}
else
{
return FALSE;
}
}
else
{
if (pSIS->debounce) --pSIS->debounce;
}
if (GetFrameIndex(s->frame) == 0)
DrawStamp (s);
if (f != 299)
{
s->frame = SetRelFrameIndex (s->frame, 1);
}
if (GetFrameIndex (s->frame) == 0)
{
return FALSE;
}
@@ -805,6 +831,7 @@ ShowShipAnim (FRAME anim)
is.anim.origin.y = SCREEN_HEIGHT >> 1;
is.anim.frame = anim;
is.last_time = GetTimeCounter ();
is.debounce = 15;
is.InputFunc = DoSpinAnim;
is.MenuRepeatDelay = 0;