[Scummvm-cvs-logs] CVS: scummvm/sword1 animation.cpp,1.18,1.19 animation.h,1.8,1.9

Max Horn fingolfin at users.sourceforge.net
Sun Mar 21 11:00:09 CET 2004


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29313/sword1

Modified Files:
	animation.cpp animation.h 
Log Message:
Unify a bit more...

Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/animation.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- animation.cpp	15 Mar 2004 00:55:43 -0000	1.18
+++ animation.cpp	21 Mar 2004 18:49:04 -0000	1.19
@@ -104,7 +104,7 @@
 
 	palnum = 0;
 	maxPalnum = p;
-	_sys->setPalette(palettes[palnum].pal, 0, 256);
+	setPalette(palettes[palnum].pal);
 	lut = lut2 = lookup[0];
 	curpal = -1;
 	cr = 0;
@@ -140,6 +140,7 @@
 	/* Play audio - TODO: Sync with video?*/
 	sndfile = new File();
 	bgSoundStream = AudioStream::openStreamFile(name, sndfile);
+
 	if (bgSoundStream != NULL) {
 		_snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false);
 	} else {
@@ -209,7 +210,7 @@
 	if (framenum == palettes[palnum].end) {
 		unsigned char *l = lut2;
 		palnum++;
-		_sys->setPalette(palettes[palnum].pal, 0, 256);
+		setPalette(palettes[palnum].pal);
 		lutcalcnum = (BITDEPTH + palettes[palnum].end - (framenum + 1) + 2) / (palettes[palnum].end - (framenum + 1) + 2);
 		lut2 = lut;
 		lut = l;
@@ -219,6 +220,10 @@
 	return false;
 }
 
+void AnimationState::setPalette(byte *pal) {
+	_sys->setPalette(pal, 0, 256);
+}
+
 #else
 
 OverlayColor *AnimationState::lookup = 0;
@@ -268,9 +273,9 @@
 			int i = ((((dat[2][cpos] + ROUNDADD) >> SHIFT) * (BITDEPTH+1)) + ((dat[1][cpos] + ROUNDADD)>>SHIFT)) * 256;
 			cpos++;
 
-			ptr[linepos               ] = lut[i + dat[0][        ypos  ]];
+			ptr[linepos                ] = lut[i + dat[0][        ypos  ]];
 			ptr[MOVIE_WIDTH + linepos++] = lut[i + dat[0][width + ypos++]];
-			ptr[linepos               ] = lut[i + dat[0][        ypos  ]];
+			ptr[linepos                ] = lut[i + dat[0][        ypos  ]];
 			ptr[MOVIE_WIDTH + linepos++] = lut[i + dat[0][width + ypos++]];
 
 		}
@@ -376,6 +381,10 @@
 	return false;
 }
 
+MoviePlayer::MoviePlayer(Screen *scr, SoundMixer *snd, OSystem *sys)
+	: _scr(scr), _snd(snd), _sys(sys) {
+}
+
 /**
  * Plays an animated cutscene.
  * @param filename the file name of the cutscene file

Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/animation.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- animation.h	4 Mar 2004 18:54:34 -0000	1.8
+++ animation.h	21 Mar 2004 18:49:04 -0000	1.9
@@ -129,6 +129,7 @@
 #ifdef BACKEND_8BIT
 	void buildLookup(int p, int lines);
 	bool checkPaletteSwitch();
+	void setPalette(byte *pal);
 #else
 	void buildLookup(void);
 	void plotYUV(OverlayColor *lut, int width, int height, byte *const *dat);
@@ -142,7 +143,7 @@
 	OSystem *_sys;
 
 public:
-	MoviePlayer(Screen *scr, SoundMixer *snd, OSystem *sys) : _scr(scr), _snd(snd), _sys(sys) {}
+	MoviePlayer(Screen *scr, SoundMixer *snd, OSystem *sys);
 	void play(const char *filename);
 };
 





More information about the Scummvm-git-logs mailing list