[Scummvm-cvs-logs] CVS: scummvm/scumm/smush chunk.cpp,1.20,1.21 chunk.h,1.10,1.11 insane.cpp,1.2,1.3 insane.h,1.1,1.2 smush_player.cpp,1.67,1.68 smush_player.h,1.13,1.14

Eugene Sandulenko sev at users.sourceforge.net
Sun Dec 7 20:17:01 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1:/tmp/cvs-serv21570

Modified Files:
	chunk.cpp chunk.h insane.cpp insane.h smush_player.cpp 
	smush_player.h 
Log Message:
First INSANE scene started to show up things. Actually you can control
Ben by keyboard and crash. Video looping is still buggy and may crash
scummvm. Also whole scene looping is disabled and you get forwarded to 
next scene.

Graphics glitches, Ben has just corpse and opponent is not drawn at all.

Smush player was extended with video seeking methods, although incomplete.


Index: chunk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/chunk.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- chunk.cpp	3 Oct 2003 18:33:56 -0000	1.20
+++ chunk.cpp	8 Dec 2003 04:16:41 -0000	1.21
@@ -189,6 +189,13 @@
 	return _data->readUint32LE();
 }
 
+void FileChunk::reinit() {
+	_offset = sizeof(Chunk::type) + sizeof(uint32);
+	_type = _data->readUint32BE();
+	_size = _data->readUint32BE();
+	_curPos = 0;
+}
+
 MemoryChunk::MemoryChunk(byte *data) {
 	if (data == 0)
 		error("Chunk() called with NULL pointer");

Index: chunk.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/chunk.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- chunk.h	3 Oct 2003 18:33:56 -0000	1.10
+++ chunk.h	8 Dec 2003 04:16:41 -0000	1.11
@@ -83,6 +83,7 @@
 	short getShort();
 	uint16 getWord();
 	uint32 getDword();
+	void reinit();
 };
 
 class MemoryChunk : public BaseChunk {

Index: insane.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/insane.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- insane.cpp	6 Dec 2003 06:53:14 -0000	1.2
+++ insane.cpp	8 Dec 2003 04:16:41 -0000	1.3
@@ -53,6 +53,9 @@
 	73,  75,  77,  79,  81,  83,  85,  89,  93,  95,  97,  99, 101, 103, 105, 107,
 	109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137};
 
+static const int actorAnimationData[21] = {20, 21, 22, 23, 24, 25, 26, 13, 14, 15, 16, 17, 
+	18, 19, 6, 7, 8, 9, 10, 11, 12};
+
 
 Insane::Insane(ScummEngine *scumm) {
 	_scumm = scumm;
@@ -72,11 +75,17 @@
 	readFileToMem("toranch.flu", &_smush_toranchFlu);
[...1370 lines suppressed...]
 	smush_setupSanFile(filename, 8);
 	_smush_isSanFileSetup = 1;
 	smush_setFrameSteps(step1, step2);
+
+	_smush_curFrame = 0; // HACK
 }
 
 void Insane::smush_setFrameSteps(int32 step1, int32 step2) {
@@ -4944,8 +5326,9 @@
 }
 
 void Insane::smush_setupSanFile(const char *filename, int32 offset) {
-	// FIXME: implement
-	warning("stub Insane::smush_setupSanFile(%s, %d)", filename, offset);
+	debug(0, "smush_setupSanFile(%s, %d)", filename, offset);
+
+	_player->seekSan(filename, _scumm->getGameDataPath(), offset);
 }
 
 }

Index: insane.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/insane.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- insane.h	6 Dec 2003 05:47:24 -0000	1.1
+++ insane.h	8 Dec 2003 04:16:41 -0000	1.2
@@ -24,6 +24,7 @@
 
 #include "base/engine.h"
 #include "scumm/scumm.h"
+#include "scumm/nut_renderer.h"
 
 #include "scumm/smush/smush_player.h"
 
@@ -49,7 +50,7 @@
 #define EN_VULTM2    6 // vulture (initialized as rottwheeler) (male)
 #define EN_CAVEFISH  7 // Cavefish Maximum Fish
 #define EN_TORQUE    8 // Father Torque
-#define EN_ENEMY9    9 // default, used only with handler
+#define EN_BEN       9 // used only with handler
 
 class Insane {
  public:
@@ -105,7 +106,15 @@
 	int32 _idx2Exceeded;
 	bool _memoryAllocatedNotOK;
 	int32 _lastKey;
-	int32 _val4_;
+	bool _beenCheated;
+	bool _tearsRustle;
+	int _keybOldDx;
+	int _keybOldDy;
+	int _velocityX;
+	int _velocityY;
+	int _keybX;
+	int _keybY;
+	int32 _firstBattle;
 	int32 _val8d;
 	byte _val10b;
 	int32 _val11d;
@@ -128,7 +137,6 @@
 	int32 _val114d16[16];
 	int16 _val115w;
 	int16 _val116w;
-	bool _val118_;
 	bool _val119_;
 	bool _val120_;
 	bool _val121_;
@@ -184,9 +192,9 @@
 	int32 _val200d;
 	int32 _val201d;
 	byte _val202b;
-	int32 _val210d;
 	int32 _val211d;
 	int32 _val212_;
+	int32 _val213d;
 	int32 _trsFilePtr; // FIXME: we don't need it
 	int32 _smlayer_room;
 	int32 _smlayer_room2;
@@ -199,10 +207,10 @@
 	byte *_smush_toranchFlu;
 	byte *_smush_minedrivFlu;
 	byte *_smush_minefiteFlu;
-	byte *_smush_bencutNut;
-	byte *_smush_bensgoggNut;
-	byte *_smush_iconsNut;
-	byte *_smush_icons2Nut;
+	NutRenderer *_smush_bencutNut;
+	NutRenderer *_smush_bensgoggNut;
+	NutRenderer *_smush_iconsNut;
+	NutRenderer *_smush_icons2Nut;
 	bool _smush_isSanFileSetup;
 	bool _isBenCut;
 	int _smush_smushState;
@@ -293,7 +301,7 @@
 		int32 field_30;
 		int32 field_34;
 		int32 field_38;
-		bool  dead;
+		bool  lost;
 		bool  field_40;
 		bool  field_44;
 		int32 field_48;
@@ -303,7 +311,7 @@
 		int32 runningSound;
 		int32 weapon;
 		bool inventory[8];
-		int32 field_80;
+		int32 probability;
 		int32 enemyHandler;
 		struct act act[4];
 	};
@@ -330,7 +338,7 @@
 	int loadSceneData(int scene, int flag, int phase);
 	void setSceneCostumes(int sceneId);
 	void setupValues(void);
-	void setOtherCostumes (void);
+	void setEnemyCostumes (void);
 	void smlayer_stopSound (int idx);
 	int smlayer_loadSound(int id, int flag, int phase);
 	int smlayer_loadCostume(int id, int phase);
@@ -412,7 +420,7 @@
 	int32 enemy7initializer(int32, int32, int32);
 	int32 enemy8handler(int32, int32, int32);
 	int32 enemy8initializer(int32, int32, int32);
-	int32 enemyDefHandler(int32, int32, int32);
+	int32 enemyBenHandler(int32, int32, int32);
 	void IMUSE_shutVolume(void);
 	void IMUSE_restoreVolume(void);
 	bool smlayer_isSoundRunning(int32 sound);
@@ -421,8 +429,8 @@
 	void smlayer_soundSetPan(int32 sound, int32 pan);
 	void smlayer_soundSetPriority(int32 sound, int32 priority);
 	void smlayer_drawSomething(byte *renderBitmap, int32 codecparam, 
-							   int32 arg_8, int32 arg_C, int32 arg_10, byte *nutfileptr, 
-							   int32 arg_18, int32 arg_1C, int32 arg_20);
+			   int32 arg_8, int32 arg_C, int32 arg_10, NutRenderer *nutfileptr, 
+			   int32 arg_18, int32 arg_1C, int32 arg_20);
 	void smlayer_overrideDrawActorAt(byte *, byte, byte);
 	void queueSceneSwitch(int32 sceneId, byte *fluPtr, const char *filename, 
 						  int32 arg_C, int32 arg_10, int32 startFrame, int32 numFrames);
@@ -439,10 +447,10 @@
 	void actor2Reaction(int32 arg_4);
 	void actor3Reaction(int32 arg_4);
 	void actor8Reaction(int32 arg_4);
-	void checkEnemyDeath(int);
-	int32 func5(void);
+	void checkEnemyLoose(int);
+	int32 processBattle(void);
 	void proc12(int arg_0);
-	void proc23(int actornum, int arg_4);
+	void setEnemyAnimation(int actornum, int arg_4);
 	int speedTranslator(int value);
 	bool smush_eitherNotStartNewFrame(void);
 	void smlayer_setActorFacing(int actornum, int actnum, int frame, int direction);
@@ -473,13 +481,15 @@
 								 int32 step2, int32 setupsan1);
 	void smush_setFrameSteps(int32 step1, int32 step2);
 	void smush_setupSanFile(const char *filename, int32 offset);
-	int32 smush_func23(bool arg_0);
+	int32 getLastKey(bool arg_0);
 	void drawSpeedyActor(int32 arg_0);
 	void proc59(int32 actornum, int32 actnum, int32 arg_8);
 	void proc51(int32 actornum, int32 actnum, int32 arg_8);
 	void proc54(int32 actornum, int32 actnum, int32 arg_8);
 	void proc55(int32 actornum, int32 actnum, int32 arg_8);
 	int32 func60(void);
+	int32 processKeyboard(void);
+	int32 func75(void);
 
 	void blah(void);
 

Index: smush_player.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- smush_player.cpp	6 Dec 2003 06:53:14 -0000	1.67
+++ smush_player.cpp	8 Dec 2003 04:16:41 -0000	1.68
@@ -972,6 +972,29 @@
 	_insanity = flag;
 }
 
+// FIXME: now it will work with offsets = 8. No Flu files are supported
+void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos) {
+	Chunk *sub;
+
+	if (file) {
+		if (_base)
+			delete _base;
+
+		_base = new FileChunk(file, directory);
+	} else {
+		_base->reinit();
+		// FIXME: this doesn't work as expected
+		//		_base->seek(pos, FileChunk::seek_start);
+	}
+
+	sub = _base->subBlock();
+	checkBlock(*sub, TYPE_AHDR);
+	handleAnimHeader(*sub);
+
+	if (pos != 8)
+		_base->seek(pos, FileChunk::seek_start);
+}
+
 void SmushPlayer::play(const char *filename, const char *directory) {
 
 	// Verify the specified file exists
@@ -1002,6 +1025,7 @@
 			start_time = _scumm->_system->get_msecs();
 			_scumm->_system->update_screen();
 			_updateNeeded = false;
+
 			end_time = _scumm->_system->get_msecs();
 
 			debug(4, "Smush stats: BackendUpdateScreen( %03d )", end_time - start_time);

Index: smush_player.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- smush_player.h	6 Dec 2003 05:47:24 -0000	1.13
+++ smush_player.h	8 Dec 2003 04:16:41 -0000	1.14
@@ -80,6 +80,7 @@
 protected:
 	void insanity(bool);
 	void setPalette(const byte *palette);
+	void seekSan(const char *file, const char *directory, int32 pos);
 
 private:
 	void updatePalette(void);





More information about the Scummvm-git-logs mailing list