From 00dad6a7b0b6dd1b9caf2c744fd83fc95da2f22e Mon Sep 17 00:00:00 2001 From: mcmartin Date: Fri, 7 Sep 2007 15:34:51 +0000 Subject: [PATCH] Shift the PC Ship "spins" to use Presentations. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2849 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/fmv.c | 40 +++++++--------------- sc2/src/sc2code/fmv.h | 2 -- sc2/src/sc2code/intro.c | 75 +---------------------------------------- 4 files changed, 15 insertions(+), 103 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 19ec8f8f1..e45d8c2f0 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Non-3DO Shipspin anims now use Presentations - Michael - Added presentaion commands TEXT, TE (text effect), MOVIE - Alex - Increased the size of display queue (elements were sometimes missing in e.g. Nemesis vs. Nemesis battles with many marines out) - Alex diff --git a/sc2/src/sc2code/fmv.c b/sc2/src/sc2code/fmv.c index 2965a5acb..d4b87495b 100644 --- a/sc2/src/sc2code/fmv.c +++ b/sc2/src/sc2code/fmv.c @@ -45,9 +45,12 @@ DoShipSpin (COUNT index, MUSIC_REF hMusic) SetGraphicUseOtherExtra (1); LoadIntoExtraScreen (0); +#if 0 + /* This is cut out right now but should be part of the 3DO side */ clut_buf[0] = FadeAllToBlack; SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 4)); FlushColorXForms (); +#endif if (hMusic) StopMusic (); @@ -58,37 +61,20 @@ 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 p, f; - /* Display Standby frame */ - p = CaptureDrawable (LoadGraphicFile ("slides/spins/ship.0.ani")); - if (p) - { - STAMP prologue; + STRING f; - 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)); + sprintf (vnbuf, "slides/spins/ship%02u.txt", (unsigned)index); + f = CaptureStringTable (LoadStringTableFile (contentDir, vnbuf)); if (f) { - ShowShipAnim (f); + ShowPresentation (f); + /* BUG: Leak? This is also in ShowPresentationFile */ + /* DestroyStringTable (ReleaseStringTable (f)); */ + + clut_buf[0] = FadeAllToBlack; + SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 4)); + FlushColorXForms (); } - - DestroyDrawable (ReleaseDrawable (f)); - DestroyDrawable (ReleaseDrawable (p)); - - clut_buf[0] = FadeAllToBlack; - SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 4)); - FlushColorXForms (); } GetContextClipRect (&old_r); diff --git a/sc2/src/sc2code/fmv.h b/sc2/src/sc2code/fmv.h index e76a595e8..9e1393383 100644 --- a/sc2/src/sc2code/fmv.h +++ b/sc2/src/sc2code/fmv.h @@ -36,7 +36,5 @@ extern BOOLEAN DoFMVEx (const char *name, const char *audname, extern BOOLEAN ShowPresentation (STRING PresStr); extern BOOLEAN ShowPresentationFile (const char *name); -extern BOOLEAN ShowShipAnim (FRAME anim); - #endif /* _FMV_H */ diff --git a/sc2/src/sc2code/intro.c b/sc2/src/sc2code/intro.c index 850b1e929..8427527ac 100644 --- a/sc2/src/sc2code/intro.c +++ b/sc2/src/sc2code/intro.c @@ -512,7 +512,7 @@ DoPresentation (void *pIS) { TEXT t; - t.align = ALIGN_LEFT; + t.align = ALIGN_CENTER; t.pStr = pPIS->Buffer; t.CharCount = (COUNT)~0; t.baseline.x = x; @@ -839,76 +839,3 @@ ShowPresentation (STRING PresStr) return TRUE; } - -/* This needs expansion; in particular, it needs to handle pause - * frames and annotations */ - -static BOOLEAN -DoSpinAnim (void *pIS) -{ - SPINANIM_INPUT_STATE *pSIS = (SPINANIM_INPUT_STATE *)pIS; - STAMP *s = &pSIS->anim; - int f = GetFrameIndex (s->frame); - - if (GLOBAL (CurrentActivity) & CHECK_ABORT) - { - return FALSE; - } - - 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; - } - - DrawStamp (s); - if (f != 299) - { - s->frame = SetRelFrameIndex (s->frame, 1); - } - - if (GetFrameIndex (s->frame) == 0) - { - return FALSE; - } - - SleepThread (pSIS->last_time + ONE_SECOND / 30 - GetTimeCounter ()); - pSIS->last_time = GetTimeCounter (); - return TRUE; -} - -BOOLEAN -ShowShipAnim (FRAME anim) -{ - SPINANIM_INPUT_STATE is; - - is.anim.origin.x = SCREEN_WIDTH >> 1; - is.anim.origin.y = SCREEN_HEIGHT >> 1; - is.anim.frame = anim; - is.last_time = GetTimeCounter (); - is.debounce = 15; - - is.InputFunc = DoSpinAnim; - is.MenuRepeatDelay = 0; - - DoInput (&is, TRUE); - - return TRUE; -}