From: <mcm...@us...> - 2008-11-29 04:09:29
|
Revision: 3102 http://sc2.svn.sourceforge.net/sc2/?rev=3102&view=rev Author: mcmartin Date: 2008-11-29 04:09:20 +0000 (Sat, 29 Nov 2008) Log Message: ----------- Move DoFMV and its friends into the video library. Modified Paths: -------------- trunk/sc2/src/sc2code/fmv.c trunk/sc2/src/sc2code/fmv.h trunk/sc2/src/sc2code/intro.c trunk/sc2/src/sc2code/libs/video/Makeinfo trunk/sc2/src/sc2code/libs/vidlib.h Added Paths: ----------- trunk/sc2/src/sc2code/libs/video/legacyplayer.c Modified: trunk/sc2/src/sc2code/fmv.c =================================================================== --- trunk/sc2/src/sc2code/fmv.c 2008-11-29 03:32:51 UTC (rev 3101) +++ trunk/sc2/src/sc2code/fmv.c 2008-11-29 04:09:20 UTC (rev 3102) @@ -30,10 +30,6 @@ #include "libs/graphics/gfx_common.h" #include "libs/inplib.h" - -/* Some ship spin animations contain extra frames that must be discarded. */ -#define SHIP_SPIN_LOOP_FRAME 89 - void DoShipSpin (COUNT index, MUSIC_REF hMusic) { @@ -168,7 +164,7 @@ void Logo (void) { - DoFMV ("logo"); + ShowPresentation ("slides.logo"); } Modified: trunk/sc2/src/sc2code/fmv.h =================================================================== --- trunk/sc2/src/sc2code/fmv.h 2008-11-29 03:32:51 UTC (rev 3101) +++ trunk/sc2/src/sc2code/fmv.h 2008-11-29 04:09:20 UTC (rev 3102) @@ -26,15 +26,9 @@ extern void SplashScreen (void (* DoProcessing)(DWORD TimeOut)); extern void Introduction (void); extern void Victory (void); - extern void DoShipSpin (COUNT index, MUSIC_REF hMusic); -extern BOOLEAN DoFMV (const char *name); -extern BOOLEAN DoFMVEx (const char *name, const char *audname, - const char *speechname, DWORD loopframe); - extern BOOLEAN ShowPresentation (RESOURCE presentation); -extern BOOLEAN ShowPresentationFile (const char *name); #endif /* _FMV_H */ Modified: trunk/sc2/src/sc2code/intro.c =================================================================== --- trunk/sc2/src/sc2code/intro.c 2008-11-29 03:32:51 UTC (rev 3101) +++ trunk/sc2/src/sc2code/intro.c 2008-11-29 04:09:20 UTC (rev 3102) @@ -31,9 +31,6 @@ #include "libs/inplib.h" #include "libs/log.h" -// TODO: Fold DoFMV and friends into libs/video; then we can get rid of this. -#include "libs/video/vidintrn.h" - #include <ctype.h> static BOOLEAN ShowSlidePresentation (STRING PresStr); @@ -90,41 +87,6 @@ static BOOLEAN DoPresentation (void *pIS); -BOOLEAN -DoFMVEx (const char *name, const char *audname, const char *speechname, - DWORD loopframe) -{ - VIDEO_REF VidRef; - MUSIC_REF AudRef = 0; - MUSIC_REF SpeechRef = 0; - - VidRef = LoadVideoFile (name); - if (!VidRef) - return FALSE; - if (audname) - AudRef = LoadMusicFile (audname); - if (speechname) - SpeechRef = LoadMusicFile (speechname); - - VidPlayEx (VidRef, AudRef, SpeechRef, loopframe); - VidDoInput (); - VidStop (); - - DestroyVideo (VidRef); - if (SpeechRef) - DestroyMusic (SpeechRef); - if (AudRef) - DestroyMusic (AudRef); - - return TRUE; -} - -BOOLEAN -DoFMV (const char *name) -{ - return DoFMVEx (name, NULL, NULL, VID_NO_LOOP); -} - static BOOLEAN ParseColorString (const char *Src, COLOR* pColor) { @@ -860,8 +822,9 @@ else if (!strcmp (resType, "3DOVID")) { LEGACY_VIDEO vid = LoadLegacyVideoInstance (res); - return DoFMVEx (vid->video, vid->audio, vid->speech, vid->loop); + BOOLEAN result = PlayLegacyVideo (vid); DestroyLegacyVideo (vid); + return result; } log_add (log_Warning, "Tried to present '%s', of non-presentable type '%s'", res, resType); Modified: trunk/sc2/src/sc2code/libs/video/Makeinfo =================================================================== --- trunk/sc2/src/sc2code/libs/video/Makeinfo 2008-11-29 03:32:51 UTC (rev 3101) +++ trunk/sc2/src/sc2code/libs/video/Makeinfo 2008-11-29 04:09:20 UTC (rev 3102) @@ -1 +1,2 @@ -uqm_CFILES="vfileins.c vresins.c video.c videodec.c vidplayer.c dukvid.c" +uqm_CFILES="vfileins.c vresins.c video.c videodec.c vidplayer.c dukvid.c \ + legacyplayer.c" Added: trunk/sc2/src/sc2code/libs/video/legacyplayer.c =================================================================== --- trunk/sc2/src/sc2code/libs/video/legacyplayer.c (rev 0) +++ trunk/sc2/src/sc2code/libs/video/legacyplayer.c 2008-11-29 04:09:20 UTC (rev 3102) @@ -0,0 +1,39 @@ +#include "vidintrn.h" + +BOOLEAN +PlayLegacyVideo (LEGACY_VIDEO vid) +{ + const char *name, *audname, *speechname; + DWORD loopframe; + VIDEO_REF VidRef; + MUSIC_REF AudRef = 0; + MUSIC_REF SpeechRef = 0; + + if (!vid) + return FALSE; + name = vid->video; + audname = vid->audio; + speechname = vid->speech; + loopframe = vid->loop; + + VidRef = LoadVideoFile (name); + if (!VidRef) + return FALSE; + if (audname) + AudRef = LoadMusicFile (audname); + if (speechname) + SpeechRef = LoadMusicFile (speechname); + + VidPlayEx (VidRef, AudRef, SpeechRef, loopframe); + VidDoInput (); + VidStop (); + + DestroyVideo (VidRef); + if (SpeechRef) + DestroyMusic (SpeechRef); + if (AudRef) + DestroyMusic (AudRef); + + return TRUE; +} + Modified: trunk/sc2/src/sc2code/libs/vidlib.h =================================================================== --- trunk/sc2/src/sc2code/libs/vidlib.h 2008-11-29 03:32:51 UTC (rev 3101) +++ trunk/sc2/src/sc2code/libs/vidlib.h 2008-11-29 04:09:20 UTC (rev 3102) @@ -49,6 +49,7 @@ extern void VidDoInput (void); LEGACY_VIDEO LoadLegacyVideoInstance (RESOURCE res); +BOOLEAN PlayLegacyVideo (LEGACY_VIDEO vid); BOOLEAN DestroyLegacyVideo (LEGACY_VIDEO vid); #endif /* _VIDLIB_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |