[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.112,1.113 akos.cpp,1.53,1.54 akos.h,1.13,1.14 gfx.cpp,2.120,2.121 gfx.h,1.30,1.31 object.cpp,1.107,1.108 object.h,1.4,1.5 resource.cpp,1.92,1.93 resource.h,1.2,1.3 script.cpp,1.103,1.104 scumm.h,1.217,1.218 scummvm.cpp,2.184,2.185 verbs.cpp,1.48,1.49

Max Horn fingolfin at users.sourceforge.net
Wed May 28 13:02:03 CEST 2003


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

Modified Files:
	actor.cpp akos.cpp akos.h gfx.cpp gfx.h object.cpp object.h 
	resource.cpp resource.h script.cpp scumm.h scummvm.cpp 
	verbs.cpp 
Log Message:
const as const can!

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- actor.cpp	26 May 2003 02:26:13 -0000	1.112
+++ actor.cpp	28 May 2003 20:01:37 -0000	1.113
@@ -1004,7 +1004,7 @@
 		if (costume == 0)
 			return;
 
-		byte *aksq, *akfo;
+		const byte *aksq, *akfo;
 		uint size;
 		byte *akos = _vm->getResourceAddress(rtCostume, costume);
 		assert(akos);
@@ -1016,7 +1016,7 @@
 	
 		while (f--) {
 			if (cost.active[limb] != 0)
-				_vm->akos_increaseAnim(this, limb, aksq, (uint16 *)akfo, size);
+				_vm->akos_increaseAnim(this, limb, aksq, (const uint16 *)akfo, size);
 		}
 
 //		needRedraw = true;
@@ -1422,7 +1422,7 @@
 }
 
 void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold) {
-	byte *akos, *rgbs, *akpl;
+	const byte *akos, *rgbs, *akpl;
 	int akpl_size, i;
 	int r, g, b;
 	byte akpl_color;

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- akos.cpp	23 May 2003 13:24:39 -0000	1.53
+++ akos.cpp	28 May 2003 20:01:40 -0000	1.54
@@ -101,12 +101,12 @@
 
 bool Scumm::akos_hasManyDirections(Actor *a) {
 	byte *akos;
-	AkosHeader *akhd;
+	const AkosHeader *akhd;
 
 	akos = getResourceAddress(rtCostume, a->costume);
 	assert(akos);
 
-	akhd = (AkosHeader *) findResourceData(MKID('AKHD'), akos);
+	akhd = (const AkosHeader *)findResourceData(MKID('AKHD'), akos);
 	return (akhd->flags & 2) != 0;
 }
 
@@ -119,8 +119,8 @@
 
 void Scumm::akos_decodeData(Actor *a, int frame, uint usemask) {
 	uint anim;
-	byte *akos, *r;
-	AkosHeader *akhd;
+	const byte *akos, *r;
+	const AkosHeader *akhd;
 	uint offs;
 	int i;
 	byte code;
@@ -135,7 +135,7 @@
 	akos = getResourceAddress(rtCostume, a->costume);
 	assert(akos);
 
-	akhd = (AkosHeader *) findResourceData(MKID('AKHD'), akos);
+	akhd = (const AkosHeader *)findResourceData(MKID('AKHD'), akos);
 
 	if (anim >= READ_LE_UINT16(&akhd->num_anims))
 		return;
@@ -193,7 +193,7 @@
 }
 
 void AkosRenderer::setPalette(byte *new_palette) {
-	byte *the_akpl;
+	const byte *the_akpl;
 	uint size, i;
 
 	the_akpl = _vm->findResourceData(MKID('AKPL'), akos);
@@ -220,8 +220,8 @@
 	akos = _vm->getResourceAddress(rtCostume, costume);
 	assert(akos);
 
-	akhd = (AkosHeader *) _vm->findResourceData(MKID('AKHD'), akos);
-	akof = (AkosOffset *) _vm->findResourceData(MKID('AKOF'), akos);
+	akhd = (const AkosHeader *) _vm->findResourceData(MKID('AKHD'), akos);
+	akof = (const AkosOffset *) _vm->findResourceData(MKID('AKOF'), akos);
 	akci = _vm->findResourceData(MKID('AKCI'), akos);
 	aksq = _vm->findResourceData(MKID('AKSQ'), akos);
 	akcd = _vm->findResourceData(MKID('AKCD'), akos);
@@ -237,9 +237,9 @@
 
 byte AkosRenderer::drawLimb(const CostumeData &cost, int limb) {
 	uint code;
-	byte *p;
-	AkosOffset *off;
-	AkosCI *the_akci;
+	const byte *p;
+	const AkosOffset *off;
+	const AkosCI *the_akci;
 	uint i, extra;
 
 	if (!cost.active[limb] || cost.stopped & (1 << limb))
@@ -257,11 +257,11 @@
 	if (code != AKC_ComplexChan) {
 		off = akof + (code & 0xFFF);
 
-		assert((code & 0xFFF) * 6 < READ_BE_UINT32_UNALIGNED((byte *)akof - 4) - 8);
+		assert((code & 0xFFF) * 6 < READ_BE_UINT32_UNALIGNED((const byte *)akof - 4) - 8);
 		assert((code & 0x7000) == 0);
 
 		srcptr = akcd + READ_LE_UINT32(&off->akcd);
-		the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci));
+		the_akci = (const AkosCI *) (akci + READ_LE_UINT16(&off->akci));
 
 		_xmoveCur = _xmove + (int16)READ_LE_UINT16(&the_akci->rel_x);
 		_ymoveCur = _ymove + (int16)READ_LE_UINT16(&the_akci->rel_y);
@@ -294,7 +294,7 @@
 			off = akof + code;
 
 			srcptr = akcd + READ_LE_UINT32(&off->akcd);
-			the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci));
+			the_akci = (const AkosCI *) (akci + READ_LE_UINT16(&off->akci));
 
 			_xmoveCur = _xmove + (int16)READ_LE_UINT16(p + 0);
 			_ymoveCur = _ymove + (int16)READ_LE_UINT16(p + 2);
@@ -324,7 +324,8 @@
 }
 
 void AkosRenderer::codec1_genericDecode() {
-	byte *src, *dst;
+	const byte *src;
+	byte *dst;
 	byte len, maskbit;
 	uint y, color, height;
 	const byte *scaleytab, *mask;
@@ -386,7 +387,8 @@
 }
 
 void AkosRenderer::codec1_spec1() {
-	byte *src, *dst;
+	const byte *src;
+	byte *dst;
 	byte len, maskbit;
 	uint y, color, height;
 	byte pcolor;
@@ -456,7 +458,8 @@
 }
 
 void AkosRenderer::codec1_spec3() {
-	byte *src, *dst;
+	const byte *src;
+	byte *dst;
 	byte len, maskbit;
 	uint y, color, height;
 	uint pcolor;
@@ -876,7 +879,7 @@
 	int n;
 	byte repcolor;
 	byte replen;
-	byte *src;
+	const byte *src;
 
 	n = _height;
 	if (num > 1)
@@ -980,7 +983,7 @@
 	_vm->_bompActorPalletePtr = NULL;
 }
 
-void AkosRenderer::akos16SetupBitReader(byte *src) {
+void AkosRenderer::akos16SetupBitReader(const byte *src) {
 	akos16.unk5 = 0;
 	akos16.numbits = 16;
 	akos16.mask = (1 << *src) - 1;
@@ -990,7 +993,7 @@
 	akos16.dataptr = src + 4;
 }
 
-void AkosRenderer::akos16PutOnScreen(byte *dest, byte *src, byte transparency, int32 count) {
+void AkosRenderer::akos16PutOnScreen(byte *dest, const byte *src, byte transparency, int32 count) {
 	byte tmp_data;
 
 	if (count == 0)
@@ -1152,7 +1155,7 @@
 	}
 }
 
-void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency) {
+void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency) {
 	byte *tmp_buf = akos16.buffer;
 
 	if (dir < 0) {
@@ -1179,7 +1182,7 @@
 	}
 }
 
-void AkosRenderer::akos16DecompressMask(byte *dest, int32 pitch, byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, byte * maskptr, int32 bitpos_start) {
+void AkosRenderer::akos16DecompressMask(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, byte * maskptr, int32 bitpos_start) {
 	byte *tmp_buf = akos16.buffer;
 	int maskpitch;
 
@@ -1334,8 +1337,8 @@
 	akos16DecompressMask(dest, pitch, srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency, ptr, clip_left / 8);
 }
 
-bool Scumm::akos_increaseAnims(byte *akos, Actor *a) {
-	byte *aksq, *akfo;
+bool Scumm::akos_increaseAnims(const byte *akos, Actor *a) {
+	const byte *aksq, *akfo;
 	int i;
 	uint size;
 	bool result;
@@ -1348,7 +1351,7 @@
 	result = false;
 	for (i = 0; i < 16; i++) {
 		if (a->cost.active[i] != 0)
-			result |= akos_increaseAnim(a, i, aksq, (uint16 *)akfo, size);
+			result |= akos_increaseAnim(a, i, aksq, (const uint16 *)akfo, size);
 	}
 	return result;
 }
@@ -1357,7 +1360,7 @@
 #define GUW(o) READ_LE_UINT16(aksq+curpos+(o))
 #define GB(o) aksq[curpos+(o)]
 
-bool Scumm::akos_increaseAnim(Actor *a, int chan, byte *aksq, uint16 *akfo, int numakfo) {
+bool Scumm::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const uint16 *akfo, int numakfo) {
 	byte active;
 	uint old_curpos, curpos, end;
 	uint code;

Index: akos.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- akos.h	12 May 2003 17:50:09 -0000	1.13
+++ akos.h	28 May 2003 20:01:43 -0000	1.14
@@ -36,7 +36,7 @@
 
 protected:
 	uint16 codec;
-	byte *srcptr;
+	const byte *srcptr;
 
 	// movement of cel to decode
 	int _xmoveCur, _ymoveCur;
@@ -45,12 +45,12 @@
 	byte palette[256];
 
 	// pointer to various parts of the costume resource
-	byte *akos;
-	AkosHeader *akhd;
+	const byte *akos;
+	const AkosHeader *akhd;
 
-	byte *akpl, *akci, *aksq;
-	AkosOffset *akof;
-	byte *akcd;
+	const byte *akpl, *akci, *aksq;
+	const AkosOffset *akof;
+	const byte *akcd;
 
 	struct {
 		/* codec stuff */
@@ -77,7 +77,7 @@
 		byte shift;
 		uint16 bits;
 		byte numbits;
-		byte *dataptr;
+		const byte *dataptr;
 		byte buffer[336];
 	} akos16;
 
@@ -111,13 +111,13 @@
 	void codec5();
 
 	void codec16();
-	void akos16SetupBitReader(byte *src);
-	void akos16PutOnScreen(byte *dest, byte *src, byte transparency, int32 count);
+	void akos16SetupBitReader(const byte *src);
+	void akos16PutOnScreen(byte *dest, const byte *src, byte transparency, int32 count);
 	void akos16SkipData(int32 numskip);
 	void akos16DecodeLine(byte *buf, int32 numbytes, int32 dir);
 	void akos16ApplyMask(byte *dest, byte *maskptr, byte bits, int32 count, byte fillwith);
-	void akos16Decompress(byte *dest, int32 pitch, byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency);
-	void akos16DecompressMask(byte *dest, int32 pitch, byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, byte *maskptr, int32 bitpos_start);
+	void akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency);
+	void akos16DecompressMask(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, byte *maskptr, int32 bitpos_start);
 };
 
 #endif

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.120
retrieving revision 2.121
diff -u -d -r2.120 -r2.121
--- gfx.cpp	27 May 2003 23:23:26 -0000	2.120
+++ gfx.cpp	28 May 2003 20:01:43 -0000	2.121
@@ -586,7 +586,7 @@
 #pragma mark -
 
 void Scumm::initBGBuffers(int height) {
-	byte *ptr;
+	const byte *ptr;
 	int size, itemsize, i;
 	byte *room;
 
@@ -923,15 +923,17 @@
 #pragma mark --- Image drawing ---
 #pragma mark -
 
-void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
+void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
                      int stripnr, int numstrip, byte flag) {
 	assert(ptr);
 	assert(height > 0);
-	byte *backbuff_ptr, *bgbak_ptr, *smap_ptr;
+	byte *backbuff_ptr, *bgbak_ptr;
+	const byte *smap_ptr;
+	const byte *z_plane_ptr;
 	byte *mask_ptr;
 
 	int i;
-	byte *zplane_list[9];
+	const byte *zplane_list[9];
 
 	int bottom;
 	int numzbuf;
@@ -976,7 +978,7 @@
 			}
 		} else if (_vm->_features & GF_AFTER_V8) {
 			// Find the OFFS chunk of the ZPLN chunk
-			byte *zplnOffsChunkStart = smap_ptr + READ_BE_UINT32(smap_ptr + 12) + 24;
+			const byte *zplnOffsChunkStart = smap_ptr + READ_BE_UINT32(smap_ptr + 12) + 24;
 			
 			// Each ZPLN contains a WRAP chunk, which has (as always) an OFFS subchunk pointing
 			// at ZSTR chunks. These once more contain a WRAP chunk which contains nothing but
@@ -1039,7 +1041,7 @@
 		const int left = (stripnr << 3);
 		const int right = left + (numstrip << 3);
 		byte *dst = bgbak_ptr;
-		byte *src = smap_ptr;
+		const byte *src = smap_ptr;
 		byte color = 0, data = 0;
 		int run = 1;
 		bool dither = false;
@@ -1202,7 +1204,6 @@
 			// don't know what for. At the time of writing, these games
 			// are still too unstable for me to investigate.
 
-			byte *z_plane_ptr;
 			if (_vm->_features & GF_AFTER_V8)
 				z_plane_ptr = zplane_list[1] + READ_LE_UINT32(zplane_list[1] + stripnr * 4 + 8);
 			else
@@ -1235,7 +1236,7 @@
 				mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + y * _numStrips + x + _imgBufOffs[i];
 
 				if (offs) {
-					byte *z_plane_ptr = zplane_list[i] + offs;
+					z_plane_ptr = zplane_list[i] + offs;
 
 					if (useOrDecompress && (flag & dbAllowMaskOr)) {
 						decompressMaskImgOr(mask_ptr, z_plane_ptr, height);
@@ -1339,10 +1340,10 @@
 	}
 }
 
-bool Gdi::decompressBitmap(byte *bgbak_ptr, byte *smap_ptr, int numLinesToProcess) {
+bool Gdi::decompressBitmap(byte *bgbak_ptr, const byte *src, int numLinesToProcess) {
 	assert(numLinesToProcess);
 
-	byte code = *smap_ptr++;
+	byte code = *src++;
 
 	if (_vm->_features & GF_AMIGA)
 		_palette_mod = 16;
@@ -1355,23 +1356,23 @@
 	
 	switch (code) {
 	case 1:
-		unkDecode7(bgbak_ptr, smap_ptr, numLinesToProcess);
+		unkDecode7(bgbak_ptr, src, numLinesToProcess);
 		break;
 
 	case 2:
-		unkDecode8(bgbak_ptr, smap_ptr, numLinesToProcess);       /* Ender - Zak256/Indy256 */
+		unkDecode8(bgbak_ptr, src, numLinesToProcess);       /* Ender - Zak256/Indy256 */
 		break;
 
 	case 3:
-		unkDecode9(bgbak_ptr, smap_ptr, numLinesToProcess);       /* Ender - Zak256/Indy256 */
+		unkDecode9(bgbak_ptr, src, numLinesToProcess);       /* Ender - Zak256/Indy256 */
 		break;
 
 	case 4:
-		unkDecode10(bgbak_ptr, smap_ptr, numLinesToProcess);      /* Ender - Zak256/Indy256 */
+		unkDecode10(bgbak_ptr, src, numLinesToProcess);      /* Ender - Zak256/Indy256 */
 		break;
 
 	case 7:
-		unkDecode11(bgbak_ptr, smap_ptr, numLinesToProcess);      /* Ender - Zak256/Indy256 */
+		unkDecode11(bgbak_ptr, src, numLinesToProcess);      /* Ender - Zak256/Indy256 */
 		break;
 
 	case 14:
@@ -1379,7 +1380,7 @@
 	case 16:
 	case 17:
 	case 18:
-		unkDecodeC(bgbak_ptr, smap_ptr, numLinesToProcess);
+		unkDecodeC(bgbak_ptr, src, numLinesToProcess);
 		break;
 
 	case 24:
@@ -1387,7 +1388,7 @@
 	case 26:
 	case 27:
 	case 28:
-		unkDecodeB(bgbak_ptr, smap_ptr, numLinesToProcess);
+		unkDecodeB(bgbak_ptr, src, numLinesToProcess);
 		break;
 
 	case 34:
@@ -1396,7 +1397,7 @@
 	case 37:
 	case 38:
 		useOrDecompress = true;
-		unkDecodeC_trans(bgbak_ptr, smap_ptr, numLinesToProcess);
+		unkDecodeC_trans(bgbak_ptr, src, numLinesToProcess);
 		break;
 
 	case 44:
@@ -1405,7 +1406,7 @@
 	case 47:
 	case 48:
 		useOrDecompress = true;
-		unkDecodeB_trans(bgbak_ptr, smap_ptr, numLinesToProcess);
+		unkDecodeB_trans(bgbak_ptr, src, numLinesToProcess);
 		break;
 
 	case 64:
@@ -1418,7 +1419,7 @@
 	case 106:
 	case 107:
 	case 108:
-		unkDecodeA(bgbak_ptr, smap_ptr, numLinesToProcess);
+		unkDecodeA(bgbak_ptr, src, numLinesToProcess);
 		break;
 
 	case 84:
@@ -1432,7 +1433,7 @@
 	case 127:
 	case 128:
 		useOrDecompress = true;
-		unkDecodeA_trans(bgbak_ptr, smap_ptr, numLinesToProcess);
+		unkDecodeA_trans(bgbak_ptr, src, numLinesToProcess);
 		break;
 
 	default:
@@ -2791,7 +2792,7 @@
 		_palDirtyMax = max;
 }
 
-void Scumm::initCycl(byte *ptr) {
+void Scumm::initCycl(const byte *ptr) {
 	int j;
 	ColorCycle *cycl;
 
@@ -3011,9 +3012,9 @@
 }
 
 void Scumm::setupShadowPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) {
-	byte *basepal = getPalettePtr();
-	byte *pal = basepal;
-	byte *compareptr;
+	const byte *basepal = getPalettePtr();
+	const byte *pal = basepal;
+	const byte *compareptr;
 	byte *table = _shadowPalette;
 	int i;
 
@@ -3086,9 +3087,8 @@
 /* Yazoo: This function create the specialPalette used for semi-transparency in SamnMax */
 void Scumm::createSpecialPalette(int16 from, int16 to, int16 redScale, int16 greenScale, int16 blueScale,
 			int16 startColor, int16 endColor) {
-	byte *palPtr;
-	byte *curPtr;
-	byte *searchPtr;
+	const byte *palPtr, *curPtr;
+	const byte *searchPtr;
 
 	uint bestResult;
 	uint currentResult;
@@ -3141,7 +3141,8 @@
 		return;
 
 	if (startColor <= endColor) {
-		byte *cptr, *cur;
+		const byte *cptr;
+		byte *cur;
 		int j;
 		int color;
 
@@ -3199,7 +3200,8 @@
 	// FIXME: Rewrite using integer arithmetics only?
 
 	if (startColor <= endColor) {
-		byte *cptr, *cur;
+		const byte *cptr;
+		byte *cur;
 		int j;
 
 		cptr = getPalettePtr() + startColor * 3;
@@ -3380,15 +3382,15 @@
 }
 
 void Scumm::setPalette(int palindex) {
-	byte *pals;
+	const byte *pals;
 
 	_curPalIndex = palindex;
 	pals = getPalettePtr();
 	setPaletteFromPtr(pals);
 }
 
-byte *Scumm::findPalInPals(byte *pal, int idx) {
-	byte *offs;
+const byte *Scumm::findPalInPals(const byte *pal, int idx) {
+	const byte *offs;
 	uint32 size;
 
 	pal = findResource(MKID('WRAP'), pal);
@@ -3407,8 +3409,8 @@
 	return offs + READ_LE_UINT32(offs + idx * sizeof(uint32));
 }
 
-byte *Scumm::getPalettePtr() {
-	byte *cptr;
+const byte *Scumm::getPalettePtr() {
+	const byte *cptr;
 
 	cptr = getResourceAddress(rtRoom, _roomResource);
 	assert(cptr);
@@ -3459,9 +3461,10 @@
 	updateCursor();
 }
 
-void Scumm::useIm01Cursor(byte *im, int w, int h) {
+void Scumm::useIm01Cursor(const byte *im, int w, int h) {
 	VirtScreen *vs = &virtscr[0];
-	byte *buf, *src, *dst;
+	byte *buf, *dst;
+	const byte *src;
 	int i;
 
 	w <<= 3;
@@ -3529,7 +3532,7 @@
 	}
 }
 
-void Scumm::useBompCursor(byte *im, int width, int height) {
+void Scumm::useBompCursor(const byte *im, int width, int height) {
 	uint size;
 
 	width <<= 3;
@@ -3830,7 +3833,7 @@
 		clip_bottom -= tmp_y - bd->outheight;
 	}
 
-	byte *src = bd->dataptr;
+	const byte *src = bd->dataptr;
 	byte *dst = bd->out + bd->y * bd->outwidth + bd->x + clip_left;
 
 	mask_pitch = _screenWidth / 8;

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- gfx.h	26 May 2003 13:14:55 -0000	1.30
+++ gfx.h	28 May 2003 20:01:44 -0000	1.31
@@ -104,7 +104,7 @@
 	int outwidth, outheight;
 	int x, y;
 	byte scale_x, scale_y;
-	byte *dataptr;
+	const byte *dataptr;
 	int srcwidth, srcheight;
 	uint16 shadowMode;
 };
@@ -133,7 +133,7 @@
 	bool _zbufferDisabled;
 
 	/* Bitmap decompressors */
-	bool decompressBitmap(byte *bgbak_ptr, byte *smap_ptr, int numLinesToProcess);
+	bool decompressBitmap(byte *bgbak_ptr, const byte *src, int numLinesToProcess);
 	void decodeStripEGA(byte *dst, const byte *src, int height);
 	void decodeStripOldEGA(byte *dst, const byte *src, int height, int stripnr);
 	void decompressMaskImgOld(byte *dst, const byte *src, int stripnr);
@@ -161,7 +161,7 @@
 	void updateDirtyScreen(VirtScreen *vs);
 
 public:
-	void drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
+	void drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
 	                int stripnr, int numstrip, byte flag);
 	void clearUpperMask();
 

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- object.cpp	26 May 2003 14:44:03 -0000	1.107
+++ object.cpp	28 May 2003 20:01:44 -0000	1.108
@@ -190,8 +190,8 @@
 void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir) {
 	ObjectData *od = &_objs[getObjectIndex(object)];
 	int state;
-	byte *ptr;
-	ImageHeader *imhd;
+	const byte *ptr;
+	const ImageHeader *imhd;
 
 	if (_features & GF_AFTER_V6) {
 		state = getState(object) - 1;
@@ -206,7 +206,7 @@
 			ptr += od->OBIMoffset;
 		}
 		assert(ptr);
-		imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr);
+		imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), ptr);
 		if (_features & GF_AFTER_V8) {
 			x = od->x_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].x);
 			y = od->y_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].y);
@@ -343,7 +343,7 @@
 void Scumm::drawObject(int obj, int arg) {
 	ObjectData *od;
 	int xpos, ypos, height, width;
-	byte *ptr;
+	const byte *ptr;
 	int x, a, numstrip;
 	int tmp;
 
@@ -451,16 +451,16 @@
 void Scumm::loadRoomObjects() {
 	int i, j;
 	ObjectData *od;
-	byte *ptr;
+	const byte *ptr;
 	uint16 obim_id;
-	byte *room, *searchptr, *rootptr;
-	ImageHeader *imhd;
-	RoomHeader *roomhdr;
-	CodeHeader *cdhd;
+	const byte *room, *searchptr, *rootptr;
+	const ImageHeader *imhd;
+	const RoomHeader *roomhdr;
+	const CodeHeader *cdhd;
 
 	CHECK_HEAP
 	room = getResourceAddress(rtRoom, _roomResource);
-	roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room);
+	roomhdr = (const RoomHeader *)findResourceData(MKID('RMHD'), room);
 
 	if (_features & GF_AFTER_V8)
 		_numObjectsInRoom = (byte)READ_LE_UINT32(&(roomhdr->v8.numObjects));
@@ -490,7 +490,7 @@
 			error("Room %d missing object code block(s)", _roomResource);
 
 		od->OBCDoffset = ptr - rootptr;
-		cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), ptr);
+		cdhd = (const CodeHeader *)findResourceData(MKID('CDHD'), ptr);
 
 		if (_features & GF_AFTER_V7)
 			od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id));
@@ -515,7 +515,7 @@
 		if (ptr == NULL)
 			error("Room %d missing image blocks(s)", _roomResource);
 
-		imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr);
+		imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), ptr);
 		if (_features & GF_AFTER_V8)
 			// In V8, IMHD has no obj_id, but rather a name string. We map the name
 			// back to an object id using a table derived from the DOBJ resource.
@@ -543,7 +543,7 @@
 void Scumm::loadRoomObjectsOldBundle() {
 	int i;
 	ObjectData *od;
-	byte *room, *ptr;
+	const byte *room, *ptr;
 
 	CHECK_HEAP
 	room = getResourceAddress(rtRoom, _roomResource);
@@ -583,14 +583,14 @@
 void Scumm::loadRoomObjectsSmall() {
 	int i, j;
 	ObjectData *od;
-	byte *ptr;
+	const byte *ptr;
 	uint16 obim_id;
-	byte *room, *searchptr;
-	RoomHeader *roomhdr;
+	const byte *room, *searchptr;
+	const RoomHeader *roomhdr;
 
 	CHECK_HEAP
 	room = getResourceAddress(rtRoom, _roomResource);
-	roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room);
+	roomhdr = (const RoomHeader *)findResourceData(MKID('RMHD'), room);
 
 	_numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects));
 
@@ -643,15 +643,15 @@
 	CHECK_HEAP
 }
 
-void Scumm::setupRoomObject(ObjectData *od, byte *room, byte *searchptr) {
-	CodeHeader *cdhd = NULL;
-	ImageHeader *imhd = NULL;
+void Scumm::setupRoomObject(ObjectData *od, const byte *room, const byte *searchptr) {
+	const CodeHeader *cdhd = NULL;
+	const ImageHeader *imhd = NULL;
 
 	assert(room);
 
 	if (_features & GF_SMALL_HEADER) {
 
-		byte *ptr = room + od->OBCDoffset;
+		const byte *ptr = room + od->OBCDoffset;
 
 		if (_features & GF_OLD_BUNDLE)
 			ptr -= 2;
@@ -691,7 +691,7 @@
 			searchptr = room;
 	}
 		
-	cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), searchptr + od->OBCDoffset);
+	cdhd = (const CodeHeader *)findResourceData(MKID('CDHD'), searchptr + od->OBCDoffset);
 	if (cdhd == NULL)
 		error("Room %d missing CDHD blocks(s)", _roomResource);
 
@@ -701,7 +701,7 @@
 		od->parent = cdhd->v7.parent;
 		od->parentstate = cdhd->v7.parentstate;
 
-		imhd = (ImageHeader *)findResourceData(MKID('IMHD'), room + od->OBIMoffset);
+		imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), room + od->OBIMoffset);
 		od->x_pos = (int)READ_LE_UINT32(&imhd->v8.x_pos);
 		od->y_pos = (int)READ_LE_UINT32(&imhd->v8.y_pos);
 		od->width = (uint)READ_LE_UINT32(&imhd->v8.width);
@@ -715,7 +715,7 @@
 		od->parent = cdhd->v7.parent;
 		od->parentstate = cdhd->v7.parentstate;
 
-		imhd = (ImageHeader *)findResourceData(MKID('IMHD'), room + od->OBIMoffset);
+		imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), room + od->OBIMoffset);
 		od->x_pos = READ_LE_UINT16(&imhd->v7.x_pos);
 		od->y_pos = READ_LE_UINT16(&imhd->v7.y_pos);
 		od->width = READ_LE_UINT16(&imhd->v7.width);
@@ -874,7 +874,7 @@
 	}
 
 	if (_features & GF_AFTER_V6) {
-		for (i = 1; i < 50; i++) {
+		for (i = 0; i < _numNewNames; i++) {
 			if (_newNames[i] == obj) {
 				debug(5, "Found new name for object %d at _newNames[i]", obj, i);
 				return getResourceAddress(rtObjectName, i);
@@ -887,7 +887,50 @@
 	if (objptr == NULL)
 		return NULL;
 
+#if 0
 	return findResourceData(MKID('OBNA'), objptr);
+#else
+	// FIXME: we can't use findResourceData anymore, because it returns const
+	// data, while this function *must* return a non-const pointer. That is so
+	// because in o2_setObjectName / o5_setObjectName we directly modify this
+	// data. Now, we could add a non-const version of findResourceData, too
+	// (C++ makes that easy); but this here is really the *only* place in all
+	// of ScummVM where it wold be needed! That seems kind of a waste...
+	//
+	// So for now, I duplicate some code from findResourceData / findResource
+	// here. However, a much nicer solution might be (with stress on "might")
+	// to use the same technique as in V6 games: that is, use a seperate
+	// resource for changed names. That would be the cleanest solution, but
+	// might proof to be infeasible, as it might lead to unforseen regressions.
+	
+	uint32 tag = MKID('OBNA');
+	byte *searchin = objptr;
+	uint32 curpos, totalsize, size;
+
+	assert(searchin);
+
+	searchin += 4;
+	totalsize = READ_BE_UINT32_UNALIGNED(searchin);
+	curpos = 8;
+	searchin += 4;
+
+	while (curpos < totalsize) {
+		if (READ_UINT32_UNALIGNED(searchin) == tag)
+			return searchin + _resourceHeaderSize;
+
+		size = READ_BE_UINT32_UNALIGNED(searchin + 4);
+		if ((int32)size <= 0) {
+			error("(%c%c%c%c) Not found in %d... illegal block len %d",
+						tag & 0xFF, (tag >> 8) & 0xFF, (tag >> 16) & 0xFF, (tag >> 24) & 0xFF, 0, size);
+			return NULL;
+		}
+
+		curpos += size;
+		searchin += size;
+	}
+
+	return NULL;
+#endif
 }
 
 uint32 Scumm::getOBCDOffs(int object) {
@@ -931,7 +974,8 @@
 void Scumm::addObjectToInventory(uint obj, uint room) {
 	int i, slot;
 	uint32 size;
-	byte *ptr, *dst;
+	const byte *ptr;
+	byte *dst;
 	FindObjectInRoom foir;
 
 	debug(1, "Adding object %d from room %d into inventory", obj, room);
@@ -963,10 +1007,10 @@
 
 void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint room) {
 
-	CodeHeader *cdhd;
+	const CodeHeader *cdhd;
 	int i, numobj;
-	byte *roomptr, *obcdptr, *obimptr, *searchptr;
-	ImageHeader *imhd;
+	const byte *roomptr, *obcdptr, *obimptr, *searchptr;
+	const ImageHeader *imhd;
 	int id2;
 	int id3;
 
@@ -978,10 +1022,10 @@
 			error("findObjectInRoom foCheckAlreadyLoaded NYI for GF_OLD_BUNDLE (id = %d, room = %d)", id, room);
 		}
 		fo->obcd = obcdptr = getOBCDFromObject(id);
-		assert((byte *)obcdptr > (byte *)256);
+		assert((const byte *)obcdptr > (byte *)256);
 		fo->obim = obimptr = obcdptr + RES_SIZE(obcdptr);
-		fo->cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), obcdptr);
-		fo->imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obimptr);
+		fo->cdhd = (const CodeHeader *)findResourceData(MKID('CDHD'), obcdptr);
+		fo->imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), obimptr);
 		return;
 	}
 
@@ -992,7 +1036,7 @@
 	if (_features & GF_OLD_BUNDLE) {
 		numobj = roomptr[20];
 	} else {
-		RoomHeader *roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), roomptr);
+		const RoomHeader *roomhdr = (const RoomHeader *)findResourceData(MKID('RMHD'), roomptr);
 	
 		if (_features & GF_AFTER_V8)
 			numobj = READ_LE_UINT32(&(roomhdr->v8.numObjects));
@@ -1021,7 +1065,7 @@
 			if (id2 == (uint16)id) {
 				if (findWhat & foCodeHeader) {
 					fo->obcd = obcdptr;
-					fo->cdhd = (CodeHeader *)(obcdptr + 10);	// TODO - FIXME
+					fo->cdhd = (const CodeHeader *)(obcdptr + 10);	// TODO - FIXME
 				}
 				if (findWhat & foImageHeader) {
 					fo->obim = obimptr;
@@ -1047,7 +1091,7 @@
 				obcdptr = findResource(MKID('OBCD'), searchptr);
 			if (obcdptr == NULL)
 				error("findObjectInRoom: Not enough code blocks in room %d", room);
-			cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), obcdptr);
+			cdhd = (const CodeHeader *)findResourceData(MKID('CDHD'), obcdptr);
 
 			if (_features & GF_SMALL_HEADER)
 				id2 = READ_LE_UINT16(obcdptr + 6);
@@ -1080,7 +1124,7 @@
 				obimptr = findResource(MKID('OBIM'), searchptr);
 			if (obimptr == NULL)
 				error("findObjectInRoom: Not enough image blocks in room %d", room);
-			imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obimptr);
+			imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), obimptr);
 			if (_features & GF_SMALL_HEADER)
 				id3 = READ_LE_UINT16(obimptr + 6);
 			else if (_features & GF_AFTER_V8)
@@ -1272,7 +1316,7 @@
 
 void Scumm::setCursorImg(uint img, uint room, uint imgindex) {
 	int w, h;
-	byte *dataptr, *bomp;
+	const byte *dataptr, *bomp;
 	uint32 size;
 	FindObjectInRoom foir;
 
@@ -1395,7 +1439,7 @@
 
 void Scumm::drawBlastObject(BlastObject *eo) {
 	VirtScreen *vs;
-	byte *bomp, *ptr;
+	const byte *bomp, *ptr;
 	int idx, objnum;
 	BompDrawData bdd;
 
@@ -1432,7 +1476,7 @@
 		// Get the address of the specified BOMP (we really should verify it's a BOMP and not a SMAP
 		bomp = ptr + READ_LE_UINT32(ptr + 4 + 4*eo->image) + 8;
 	} else {
-		byte *img = findResource(IMxx_tags[eo->image], ptr);
+		const byte *img = findResource(IMxx_tags[eo->image], ptr);
 		if (!img)
 			img = findResource(IMxx_tags[1], ptr);	// Backward compatibility with samnmax blast objects
 
@@ -1448,11 +1492,11 @@
 	//hexdump(bomp,32);
 
 	if (_features & GF_AFTER_V8) {
-		bdd.srcwidth = READ_LE_UINT32(&((BompHeader *)bomp)->v8.width);
-		bdd.srcheight = READ_LE_UINT32(&((BompHeader *)bomp)->v8.height);
+		bdd.srcwidth = READ_LE_UINT32(&((const BompHeader *)bomp)->v8.width);
+		bdd.srcheight = READ_LE_UINT32(&((const BompHeader *)bomp)->v8.height);
 	} else {
-		bdd.srcwidth = READ_LE_UINT16(&((BompHeader *)bomp)->old.width);
-		bdd.srcheight = READ_LE_UINT16(&((BompHeader *)bomp)->old.height);
+		bdd.srcwidth = READ_LE_UINT16(&((const BompHeader *)bomp)->old.width);
+		bdd.srcheight = READ_LE_UINT16(&((const BompHeader *)bomp)->old.height);
 	}
 	
 	bdd.out = vs->screenPtr + vs->xstart;
@@ -1746,7 +1790,7 @@
 	// Dump object script
 	if (_dumpScripts) {
 		char buf[32];
-		byte *ptr = foir.obcd;
+		const byte *ptr = foir.obcd;
 		sprintf(buf, "roomobj-%d-", room);
 		ptr = findResource(MKID('VERB'), ptr, 0);
 		dumpResource(buf, object, ptr);

Index: object.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- object.h	6 Mar 2003 21:46:07 -0000	1.4
+++ object.h	28 May 2003 20:01:45 -0000	1.5
@@ -136,11 +136,11 @@
 #endif
 
 struct FindObjectInRoom {
-	CodeHeader *cdhd;
-	byte *obcd;
-	ImageHeader *imhd;
-	byte *obim;
-	byte *roomptr;
+	const CodeHeader *cdhd;
+	const byte *obcd;
+	const ImageHeader *imhd;
+	const byte *obim;
+	const byte *roomptr;
 };
 
 enum FindObjectWhat {

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- resource.cpp	28 May 2003 11:56:50 -0000	1.92
+++ resource.cpp	28 May 2003 20:01:45 -0000	1.93
@@ -1344,7 +1344,7 @@
 	}
 }
 
-byte *Scumm::findResourceData(uint32 tag, byte *ptr) {
+const byte *Scumm::findResourceData(uint32 tag, const byte *ptr) {
 	if (_features & GF_OLD_BUNDLE)
 		error("findResourceData must not be used in GF_OLD_BUNDLE games");
 	else if (_features & GF_SMALL_HEADER)
@@ -1371,11 +1371,11 @@
 
 struct FindResourceState {
 	uint32 size, pos;
-	byte *ptr;
+	const byte *ptr;
 };
 
 /* just O(N) complexity when iterating with this function */
-byte *findResource(uint32 tag, byte *searchin) {
+const byte *findResource(uint32 tag, const byte *searchin) {
 	uint32 size;
 	static FindResourceState frs;
 	FindResourceState *f = &frs;	/* easier to make it thread safe like this */
@@ -1403,7 +1403,7 @@
 	return f->ptr;
 }
 
-byte *findResourceSmall(uint32 tag, byte *searchin) {
+const byte *findResourceSmall(uint32 tag, const byte *searchin) {
 	uint32 size;
 	static FindResourceState frs;
 	FindResourceState *f = &frs;	/* easier to make it thread safe like this */
@@ -1434,7 +1434,7 @@
 	return f->ptr;
 }
 
-byte *findResource(uint32 tag, byte *searchin, int idx) {
+const byte *findResource(uint32 tag, const byte *searchin, int idx) {
 	uint32 curpos, totalsize, size;
 
 	assert(searchin);
@@ -1462,7 +1462,7 @@
 	return NULL;
 }
 
-byte *findResourceSmall(uint32 tag, byte *searchin, int idx) {
+const byte *findResourceSmall(uint32 tag, const byte *searchin, int idx) {
 	uint32 curpos, totalsize, size;
 	uint16 smallTag;
 

Index: resource.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- resource.h	6 Mar 2003 21:46:10 -0000	1.2
+++ resource.h	28 May 2003 20:01:45 -0000	1.3
@@ -33,8 +33,8 @@
 	#pragma END_PACK_STRUCTS
 #endif
 
-#define RES_DATA(x) (((byte*)x) + sizeof(ResHdr))
-#define RES_SIZE(x) (READ_BE_UINT32_UNALIGNED(&((ResHdr* )x)->size))
+#define RES_DATA(x) (((const byte*)x) + sizeof(ResHdr))
+#define RES_SIZE(x) (READ_BE_UINT32_UNALIGNED(&((const ResHdr* )x)->size))
 
 enum {
 	OF_OWNER_MASK = 0x0F,
@@ -50,9 +50,9 @@
 };
 
 
-byte *findResource(uint32 tag, byte *searchin, int index);
-byte *findResourceSmall(uint32 tag, byte *searchin, int index);
-byte *findResource(uint32 tag, byte *searchin);
-byte *findResourceSmall(uint32 tag, byte *searchin);
+const byte *findResource(uint32 tag, const byte *searchin, int index);
+const byte *findResourceSmall(uint32 tag, const byte *searchin, int index);
+const byte *findResource(uint32 tag, const byte *searchin);
+const byte *findResourceSmall(uint32 tag, const byte *searchin);
 
 #endif

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- script.cpp	24 May 2003 17:07:50 -0000	1.103
+++ script.cpp	28 May 2003 20:01:45 -0000	1.104
@@ -128,7 +128,7 @@
 }
 
 int Scumm::getVerbEntrypoint(int obj, int entry) {
-	byte *objptr, *verbptr;
+	const byte *objptr, *verbptr;
 	int verboffs;
 
 	if (whereIsObject(obj) == WIO_NOT_FOUND)
@@ -154,7 +154,7 @@
 		verbptr += _resourceHeaderSize;
 
 	if (_features & GF_AFTER_V8) {
-		uint32 *ptr = (uint32 *)verbptr;
+		const uint32 *ptr = (const uint32 *)verbptr;
 		uint32 verb;
 		do {
 			verb = READ_LE_UINT32(ptr);
@@ -729,7 +729,7 @@
 			// FIXME: Oddly, Indy3 seems to contain exit scripts with only a size
 			// and a tag - not even a terminating NULL!
 			byte *roomptr = getResourceAddress(rtRoom, _roomResource);
-			byte *excd = findResourceData(MKID('EXCD'), roomptr) - _resourceHeaderSize;
+			const byte *excd = findResourceData(MKID('EXCD'), roomptr) - _resourceHeaderSize;
 			if (!excd || (getResourceDataSize(excd) < 1)) {
 				debug(2, "Exit-%d is empty", _roomResource);
 				return;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -d -r1.217 -r1.218
--- scumm.h	28 May 2003 18:13:30 -0000	1.217
+++ scumm.h	28 May 2003 20:01:46 -0000	1.218
@@ -622,9 +622,9 @@
 
 	int _lastLoadedRoom;
 public:
-	byte *findResourceData(uint32 tag, byte *ptr);
+	const byte *findResourceData(uint32 tag, const byte *ptr);
 	int getResourceDataSize(const byte *ptr) const;
-	void dumpResource(const char *tag, int index, byte *ptr, int length = -1);
+	void dumpResource(const char *tag, int index, const byte *ptr, int length = -1);
 
 protected:
 	int getArrayId();
@@ -651,7 +651,7 @@
 	ObjectIDMap _objectIDMap;
 	byte _numObjectsInRoom;
 
-	void setupRoomObject(ObjectData *od, byte *room, byte *searchptr = NULL);
+	void setupRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL);
 	void removeObjectFromRoom(int obj);
 	void loadFlObject(uint object, uint room);
 	void nukeFlObjects(int min, int max);
@@ -755,8 +755,8 @@
 	int cost_frameToAnim(Actor *a, int frame);
 
 	// Akos Class
-	bool akos_increaseAnims(byte *akos, Actor *a);
-	bool akos_increaseAnim(Actor *a, int i, byte *aksq, uint16 *akfo, int numakfo);
+	bool akos_increaseAnims(const byte *akos, Actor *a);
+	bool akos_increaseAnim(Actor *a, int i, const byte *aksq, const uint16 *akfo, int numakfo);
 	void akos_queCommand(byte cmd, Actor *a, int param_1, int param_2);
 	bool akos_compare(int a, int b, byte cmd);
 	void akos_decodeData(Actor *a, int frame, uint usemask);
@@ -804,7 +804,7 @@
 	void initScreens(int a, int b, int w, int h);
 	void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool scrollable);
 	void initBGBuffers(int height);
-	void initCycl(byte *ptr);	// Color cycle
+	void initCycl(const byte *ptr);	// Color cycle
 
 	void createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, int16 colorMin, int16 colorMax);
 
@@ -825,14 +825,14 @@
 	void setCameraFollows(Actor *a);
 	void clampCameraPos(ScummVM::Point *pt);
 
-	byte *getPalettePtr();
+	const byte *getPalettePtr();
 	void setupEGAPalette();
 	void setPalette(int pal);
 	void setPaletteFromPtr(const byte *ptr);
 	void setPaletteFromRes();
 	void setPalColor(int index, int r, int g, int b);
 	void setDirtyColors(int min, int max);
-	byte *findPalInPals(byte *pal, int index);
+	const byte *findPalInPals(const byte *pal, int index);
 	void swapPalColors(int a, int b);
 	void copyPalColor(int dst, int src);
 	void cyclePalette();
@@ -856,8 +856,8 @@
 	void makeCursorColorTransparent(int a);
 	void setupCursor() { _cursor.animate = 1; }
 	void decompressDefaultCursor(int index);
-	void useIm01Cursor(byte *im, int w, int h);
-	void useBompCursor(byte *im, int w, int h);
+	void useIm01Cursor(const byte *im, int w, int h);
+	void useBompCursor(const byte *im, int w, int h);
 
 
 public:

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.184
retrieving revision 2.185
diff -u -d -r2.184 -r2.185
--- scummvm.cpp	26 May 2003 23:34:06 -0000	2.184
+++ scummvm.cpp	28 May 2003 20:01:46 -0000	2.185
@@ -1244,9 +1244,9 @@
 
 void Scumm::initRoomSubBlocks() {
 	int i, offs;
-	byte *ptr;
+	const byte *ptr;
 	byte *roomptr, *searchptr, *roomResPtr;
-	RoomHeader *rmhd;
+	const RoomHeader *rmhd;
 
 	_ENCD_offs = 0;
 	_EXCD_offs = 0;
@@ -1274,9 +1274,9 @@
 	// Determine the room dimensions (width/height)
 	//
 	if (_features & GF_OLD_BUNDLE)
-		rmhd = (RoomHeader *)(roomptr + 4);
+		rmhd = (const RoomHeader *)(roomptr + 4);
 	else
-		rmhd = (RoomHeader *)findResourceData(MKID('RMHD'), roomptr);
+		rmhd = (const RoomHeader *)findResourceData(MKID('RMHD'), roomptr);
 	
 	if (_features & GF_AFTER_V8) {
 		_roomWidth = READ_LE_UINT32(&(rmhd->v8.width));
@@ -1610,7 +1610,7 @@
 	_scaleSlots[slot-1].scale1 = scale1;
 }
 
-void Scumm::dumpResource(const char *tag, int idx, byte *ptr, int length) {
+void Scumm::dumpResource(const char *tag, int idx, const byte *ptr, int length) {
 	char buf[256];
 	File out;
 

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- verbs.cpp	22 May 2003 05:44:18 -0000	1.48
+++ verbs.cpp	28 May 2003 20:01:47 -0000	1.49
@@ -287,12 +287,13 @@
 void Scumm::drawVerbBitmap(int verb, int x, int y) {
 	VirtScreen *vs;
 	VerbSlot *vst;
-	byte twobufs, *imptr = 0;
+	byte twobufs;
+	const byte *imptr = 0;
 	int ydiff, xstrip;
 	int imgw, imgh;
 	int i, tmp;
 	byte *obim;
-	ImageHeader *imhd;
+	const ImageHeader *imhd;
 	uint32 size;
 
 	if ((vs = findVirtScreen(y)) == NULL)
@@ -319,7 +320,7 @@
 		imgh = (*(obim + size + 17)) >> 3;
 		imptr = (obim + 8);
 	} else {
-		imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obim);
+		imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), obim);
 		if (_features & GF_AFTER_V7) {
 			imgw = READ_LE_UINT16(&imhd->v7.width) >> 3;
 			imgh = READ_LE_UINT16(&imhd->v7.height) >> 3;
@@ -393,8 +394,8 @@
 }
 
 void Scumm::setVerbObject(uint room, uint object, uint verb) {
-	byte *obimptr;
-	byte *obcdptr;
+	const byte *obimptr;
+	const byte *obcdptr;
 	uint32 size, size2;
 	FindObjectInRoom foir;
 	int i;





More information about the Scummvm-git-logs mailing list