[Scummvm-cvs-logs] CVS: scummvm/saga saga.h,1.63,1.64 scene.h,1.30,1.31 scene.cpp,1.70,1.71 sprite.cpp,1.36,1.37 sprite.h,1.11,1.12 xref.txt,1.16,1.17

Eugene Sandulenko sev at users.sourceforge.net
Tue Jan 4 09:17:26 CET 2005


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

Modified Files:
	saga.h scene.h scene.cpp sprite.cpp sprite.h xref.txt 
Log Message:
o Fix regression with Win32 CD ITE at wyrmkeep logo
o Support for sprites in Mac versions
o Improvements on scene flags
o More code on proper interface modes handling. Just a tiny bit was committed
  as other stuff breaks intro due to incompleteness.


Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- saga.h	2 Jan 2005 20:29:27 -0000	1.63
+++ saga.h	4 Jan 2005 17:15:53 -0000	1.64
@@ -139,24 +139,24 @@
 	GID_ITE_DISK_DE,
 	GID_ITE_AMIGACD_DE, // TODO
 	GID_ITE_OLDMAC_DE,  // TODO
-	GID_ITE_AMIGA_FL_DE,
+	GID_ITE_AMIGA_FL_DE,// TODO
 	GID_ITE_CD_DE,      // don't have it
-	GID_ITE_AMIGA_AGA_DEMO,
-	GID_ITE_AMIGA_ECS_DEMO,
+	GID_ITE_AMIGA_AGA_DEMO, // TODO
+	GID_ITE_AMIGA_ECS_DEMO, // TODO
 
 	GID_IHNM_DEMO,
 	GID_IHNM_CD
 };
 
 enum GAME_FILETYPES {
-	GAME_RESOURCEFILE = 0x01,
-	GAME_SCRIPTFILE = 0x02,
-	GAME_SOUNDFILE = 0x04,
-	GAME_VOICEFILE = 0x08,
-	GAME_DEMOFILE = 0x10,
-	GAME_MUSICFILE = 0x20,
-	GAME_MUSICFILE_GM = 0x40,
-	GAME_MUSICFILE_FM = 0x80
+	GAME_RESOURCEFILE = 1 << 0,
+	GAME_SCRIPTFILE   = 1 << 1,
+	GAME_SOUNDFILE    = 1 << 2,
+	GAME_VOICEFILE    = 1 << 3,
+	GAME_DEMOFILE     = 1 << 4,
+	GAME_MUSICFILE    = 1 << 5,
+	GAME_MUSICFILE_GM = 1 << 6,
+	GAME_MUSICFILE_FM = 1 << 7
 };
 
 enum GAME_SOUNDINFO_TYPES {
@@ -177,11 +177,11 @@
 };
 
 enum GAME_FEATURES {
-	GF_VOX_VOICES = 1,
-	GF_BIG_ENDIAN_DATA = 2,
-	GF_MAC_RESOURCES = 4,
-	GF_LANG_DE = 8,
-	GF_WYRMKEEP = 16
+	GF_VOX_VOICES      = 1 << 0,
+	GF_BIG_ENDIAN_DATA = 1 << 1,
+	GF_MAC_RESOURCES   = 1 << 2,
+	GF_LANG_DE         = 1 << 3,
+	GF_WYRMKEEP        = 1 << 4
 };
 
 struct GAME_DISPLAYINFO {

Index: scene.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- scene.h	4 Jan 2005 16:10:43 -0000	1.30
+++ scene.h	4 Jan 2005 17:15:53 -0000	1.31
@@ -209,6 +209,11 @@
 };
 
 
+enum SceneFlags {
+	kSceneFlagISO        = 1,
+	kSceneFlagShowCursor = 2
+};
+
 class Scene {
  public:
 	Scene(SagaEngine *vm);
@@ -228,6 +233,7 @@
 	int queueScene(SCENE_QUEUE *scene_queue);
 	int draw(SURFACE *);
 	int getMode();
+	int getFlags() { return _desc.flags; }
 	
 	void getBGMaskInfo(int &width, int &height, byte *&buffer, size_t &bufferLength);
 	int isBGMaskPresent() {

Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- scene.cpp	4 Jan 2005 16:10:43 -0000	1.70
+++ scene.cpp	4 Jan 2005 17:15:53 -0000	1.71
@@ -678,6 +678,9 @@
 	
 	_vm->_actor->updateActorsScene();
 
+	if (_desc.flags & kSceneFlagShowCursor)
+		_vm->_interface->activate();
+
 	return SUCCESS;
 }
 

Index: sprite.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sprite.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- sprite.cpp	2 Jan 2005 14:52:02 -0000	1.36
+++ sprite.cpp	4 Jan 2005 17:15:53 -0000	1.37
@@ -98,7 +98,10 @@
 
 	for (i = 0; i < sprite_count; i++) {
 		new_slist->offset_list[i].data_idx = 0;
-		new_slist->offset_list[i].offset = readS.readUint16();
+		if (_vm->_features & GF_MAC_RESOURCES)
+			new_slist->offset_list[i].offset = readS.readUint32();
+		else
+			new_slist->offset_list[i].offset = readS.readUint16();
 	}
 
 	new_slist->slist_rn = resource_num;
@@ -200,7 +203,7 @@
 
 	assert(sprite_p);
 
-	MemoryReadStreamEndian readS(sprite_p, 8, IS_BIG_ENDIAN);
+	MemoryReadStream readS(sprite_p, 8);
 	if (!(_vm->_features & GF_MAC_RESOURCES)) {
 		x_align = readS.readSByte();
 		y_align = readS.readSByte();
@@ -208,11 +211,11 @@
 		so_width = s_width = readS.readByte();
 		so_height = s_height = readS.readByte();
 	} else {
-		x_align = readS.readSint16();
-		y_align = readS.readSint16();
+		x_align = readS.readSint16BE();
+		y_align = readS.readSint16BE();
 
-		so_width = s_width = readS.readUint16();
-		so_height = s_height = readS.readUint16();
+		so_width = s_width = readS.readUint16BE();
+		so_height = s_height = readS.readUint16BE();
 	}
 	spr_pt.x = screenCoord.x + x_align;
 	spr_pt.y = screenCoord.y + y_align;
@@ -314,15 +317,23 @@
 	sprite_p = sprite_list->sprite_data[offset_idx];
 	sprite_p += offset;
 
-	MemoryReadStreamEndian readS(sprite_p, 5, IS_BIG_ENDIAN);
+	MemoryReadStream readS(sprite_p, 8);
 
 	// Read sprite dimensions -- should probably cache this stuff in 
 	// sprite list
-	x_align = readS.readSByte();
-	y_align = readS.readSByte();
+	if (!(_vm->_features & GF_MAC_RESOURCES)) {
+		x_align = readS.readSByte();
+		y_align = readS.readSByte();
 
-	so_width = s_width = readS.readByte();
-	so_height = s_height = readS.readByte();
+		so_width = s_width = readS.readByte();
+		so_height = s_height = readS.readByte();
+	} else {
+		x_align = readS.readSint16BE();
+		y_align = readS.readSint16BE();
+
+		so_width = s_width = readS.readUint16BE();
+		so_height = s_height = readS.readUint16BE();
+	}
 
 	sprite_data_p = sprite_p + readS.pos();
 
@@ -384,48 +395,29 @@
 		mask_row_p += maskWidth;
 		src_row_p += s_width;
 	}
-/*
-	{
-		char buf[1024] = { 0 };
-		sprintf(buf, "dw: %d, dh: %d.", ci.draw_w, ci.draw_h);
 
-		_vm->textDraw(2, ds, buf, spr_x - x_align, spr_y - y_align, 255, 0, FONT_OUTLINE);
-	}
-*/
 	return SUCCESS;
 }
 
 int Sprite::decodeRLESprite(const byte *inbuf, size_t inbuf_len, byte *outbuf, size_t outbuf_len) {
 	int bg_runcount;
 	int fg_runcount;
-	const byte *inbuf_ptr;
 	byte *outbuf_ptr;
-	const byte *inbuf_end;
 	byte *outbuf_end;
 	int c;
 
-	inbuf_ptr = inbuf;
 	outbuf_ptr = outbuf;
 
-	inbuf_end = inbuf + (inbuf_len);
-	inbuf_end--;
-
 	outbuf_end = outbuf + outbuf_len;
 	outbuf_end--;
 
 	memset(outbuf, 0, outbuf_len);
 
-	while ((inbuf_ptr < inbuf_end) && (outbuf_ptr < outbuf_end)) {
-		bg_runcount = *inbuf_ptr;
-		if (inbuf_ptr < inbuf_end)
-			inbuf_ptr++;
-		else
-			return 0;
-		fg_runcount = *inbuf_ptr;
-		if (inbuf_ptr < inbuf_end)
-			inbuf_ptr++;
-		else
-			return 0;
+	MemoryReadStream readS(inbuf, inbuf_len);
+
+	while (!readS.eof() && (outbuf_ptr < outbuf_end)) {
+		bg_runcount = readS.readByte();
+		fg_runcount = readS.readByte();
 
 		for (c = 0; c < bg_runcount; c++) {
 			*outbuf_ptr = (byte) 0;
@@ -436,11 +428,7 @@
 		}
 
 		for (c = 0; c < fg_runcount; c++) {
-			*outbuf_ptr = *inbuf_ptr;
-			if (inbuf_ptr < inbuf_end)
-				inbuf_ptr++;
-			else
-				return 0;
+			*outbuf_ptr = readS.readByte();
 			if (outbuf_ptr < outbuf_end)
 				outbuf_ptr++;
 			else

Index: sprite.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sprite.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- sprite.h	1 Jan 2005 16:18:36 -0000	1.11
+++ sprite.h	4 Jan 2005 17:15:53 -0000	1.12
@@ -45,7 +45,7 @@
 
 struct SPRITELIST_OFFSET {
 	uint16 data_idx;
-	size_t offset;
+	uint32 offset;
 };
 
 struct SPRITELIST {

Index: xref.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/xref.txt,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- xref.txt	21 Dec 2004 06:49:07 -0000	1.16
+++ xref.txt	4 Jan 2005 17:15:53 -0000	1.17
@@ -115,3 +115,7 @@
  PicHeader.width           IMAGE_HEADER.width
  PicHeader.height          IMAGE_HEADER.height
 
+
+Process.c
+=========
+ mainPanelMode             Interface::_inMainMode





More information about the Scummvm-git-logs mailing list