[Scummvm-cvs-logs] CVS: scummvm/sword2/driver animation.cpp,1.33,1.34 animation.h,1.25,1.26
Max Horn
fingolfin at users.sourceforge.net
Mon Mar 22 12:57:10 CET 2004
Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20964/sword2/driver
Modified Files:
animation.cpp animation.h
Log Message:
share 'init' method, too
Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- animation.cpp 22 Mar 2004 15:57:51 -0000 1.33
+++ animation.cpp 22 Mar 2004 20:46:30 -0000 1.34
@@ -41,110 +41,6 @@
AnimationState::~AnimationState() {
}
-bool AnimationState::init(const char *name) {
-#ifdef USE_MPEG2
- char tempFile[512];
-
- decoder = NULL;
- mpgfile = NULL;
- sndfile = NULL;
- bgSoundStream = NULL;
-
-#ifdef BACKEND_8BIT
-
- uint i, p;
-
- // Load lookup palettes
- // TODO: Binary format so we can use File class
- sprintf(tempFile, "%s/%s.pal", _vm->getGameDataPath(), name);
- FILE *f = fopen(tempFile, "r");
-
- if (!f) {
- warning("Cutscene: %s.pal palette missing", name);
- return false;
- }
-
- p = 0;
- while (!feof(f)) {
- int end, cnt;
-
- if (fscanf(f, "%i %i", &end, &cnt) != 2)
- break;
-
- palettes[p].end = (uint) end;
- palettes[p].cnt = (uint) cnt;
-
- for (i = 0; i < palettes[p].cnt; i++) {
- int r, g, b;
- fscanf(f, "%i", &r);
- fscanf(f, "%i", &g);
- fscanf(f, "%i", &b);
- palettes[p].pal[4 * i] = r;
- palettes[p].pal[4 * i + 1] = g;
- palettes[p].pal[4 * i + 2] = b;
- palettes[p].pal[4 * i + 3] = 0;
- }
- for (; i < 256; i++) {
- palettes[p].pal[4 * i] = 0;
- palettes[p].pal[4 * i + 1] = 0;
- palettes[p].pal[4 * i + 2] = 0;
- palettes[p].pal[4 * i + 3] = 0;
- }
- p++;
- }
- fclose(f);
-
- palnum = 0;
- maxPalnum = p;
- setPalette(palettes[palnum].pal);
- lut = lut2 = lookup[0];
- curpal = -1;
- cr = 0;
- buildLookup(palnum, 256);
- lut2 = lookup[1];
- lutcalcnum = (BITDEPTH + palettes[palnum].end + 2) / (palettes[palnum].end + 2);
-#else
- buildLookup();
- overlay = (OverlayColor*)calloc(MOVIE_WIDTH * MOVIE_HEIGHT, sizeof(OverlayColor));
- _sys->show_overlay();
-#endif
-
- // Open MPEG2 stream
- mpgfile = new File();
- sprintf(tempFile, "%s.mp2", name);
- if (!mpgfile->open(tempFile)) {
- warning("Cutscene: Could not open %s", tempFile);
- return false;
- }
-
- // Load and configure decoder
- decoder = mpeg2_init();
- if (decoder == NULL) {
- warning("Cutscene: Could not allocate an MPEG2 decoder");
- return false;
- }
-
- info = mpeg2_info(decoder);
- framenum = 0;
- frameskipped = 0;
- ticks = _sys->get_msecs();
-
- // Play audio
- sndfile = new File();
- bgSoundStream = AudioStream::openStreamFile(name, sndfile);
-
- if (bgSoundStream != NULL) {
- _snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false);
- } else {
- warning("Cutscene: Could not open Audio Track for %s", name);
- }
-
- return true;
-#else /* USE_MPEG2 */
- return false;
-#endif
-}
-
#ifdef BACKEND_8BIT
Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- animation.h 22 Mar 2004 01:28:45 -0000 1.25
+++ animation.h 22 Mar 2004 20:46:30 -0000 1.26
@@ -37,7 +37,6 @@
AnimationState(Sword2Engine *vm);
~AnimationState();
- bool init(const char *name);
bool decodeFrame();
#ifndef BACKEND_8BIT
More information about the Scummvm-git-logs
mailing list