[Scummvm-cvs-logs] SF.net SVN: scummvm: [21773] scummvm/trunk/engines/simon

kirben at users.sourceforge.net kirben at users.sourceforge.net
Mon Apr 10 16:45:12 CEST 2006


Revision: 21773
Author:   kirben
Date:     2006-04-10 16:44:17 -0700 (Mon, 10 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21773&view=rev

Log Message:
-----------
Cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/vga.cpp
Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-04-10 23:22:26 UTC (rev 21772)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-04-10 23:44:17 UTC (rev 21773)
@@ -330,11 +330,11 @@
 	_scrollUpHitArea = 0;
 	_scrollDownHitArea = 0;
 
-	_videoVar7 = 0xFFFF;
+	_noOverWrite = 0xFFFF;
 	_paletteColorCount = 0;
 
-	_videoVar4 = 0;
-	_videoVar5 = 0;
+	_rejectCount = 0;
+	_rejectBlock = 0;
 	_fastFadeOutFlag = 0;
 	_unkPalFlag = 0;
 	_exitCutscene = 0;
@@ -367,9 +367,9 @@
 
 	_frameRate = 1;
 
-	_vgaCurFile2 = 0;
+	_zoneNumber = 0;
 	_vgaWaitFor = 0;
-	_vgaCurFileId = 0;
+	_vgaCurZoneNum = 0;
 	_vgaCurSpriteId = 0;
 	_vgaCurSpritePriority = 0;
 
@@ -2140,29 +2140,29 @@
 		vpe->sfxFile = read_vga_from_datfile_2(vga_res * 2, 3);
 }
 
-byte *SimonEngine::setup_vga_destination(uint32 size) {
-	byte *dest, *end;
+byte *SimonEngine::allocBlock(uint32 size) {
+	byte *block, *blockEnd;
 
-	_videoVar4 = 0;
+	_rejectCount = 0;
 
 	for (;;) {
-		dest = _vgaBufFreeStart;
+		block = _vgaBufFreeStart;
 
-		end = dest + size;
+		blockEnd = block + size;
 
-		if (end >= _vgaBufEnd) {
+		if (blockEnd >= _vgaBufEnd) {
 			_vgaBufFreeStart = _vgaBufStart;
 		} else {
-			_videoVar5 = false;
-			vga_buf_unk_proc3(end);
-			if (_videoVar5)
+			_rejectBlock = false;
+			checkNoOverWrite(blockEnd);
+			if (_rejectBlock)
 				continue;
-			vga_buf_unk_proc1(end);
-			if (_videoVar5)
+			checkRunningAnims(blockEnd);
+			if (_rejectBlock)
 				continue;
-			delete_memptr_range(end);
-			_vgaBufFreeStart = end;
-			return dest;
+			checkZonePtrs(blockEnd);
+			_vgaBufFreeStart = blockEnd;
+			return block;
 		}
 	}
 }
@@ -2179,40 +2179,40 @@
 	_vgaBufEnd = alloced + VGA_MEM_SIZE;
 }
 
-void SimonEngine::vga_buf_unk_proc3(byte *end) {
+void SimonEngine::checkNoOverWrite(byte *end) {
 	VgaPointersEntry *vpe;
 
-	if (_videoVar7 == 0xFFFF)
+	if (_noOverWrite == 0xFFFF)
 		return;
 
-	if (_videoVar4 == 2)
-		error("vga_buf_unk_proc3: _videoVar4 == 2");
+	if (_rejectCount == 2)
+		error("checkNoOverWrite: _rejectCount == 2");
 
-	vpe = &_vgaBufferPointers[_videoVar7];
+	vpe = &_vgaBufferPointers[_noOverWrite];
 
 	if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 ||
 			_vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) {
-		_videoVar5 = 1;
-		_videoVar4++;
+		_rejectBlock = 1;
+		_rejectCount++;
 		_vgaBufFreeStart = vpe->vgaFile1 + 0x5000;
 	} else {
-		_videoVar5 = 0;
+		_rejectBlock = 0;
 	}
 }
 
-void SimonEngine::vga_buf_unk_proc1(byte *end) {
+void SimonEngine::checkRunningAnims(byte *end) {
 	VgaSprite *vsp;
 	if (_lockWord & 0x20)
 		return;
 
 	for (vsp = _vgaSprites; vsp->id; vsp++) {
-		vga_buf_unk_proc2(vsp->fileId, end);
-		if (_videoVar5 == true)
+		checkAnims(vsp->zoneNum, end);
+		if (_rejectBlock == true)
 			return;
 	}
 }
 
-void SimonEngine::delete_memptr_range(byte *end) {
+void SimonEngine::checkZonePtrs(byte *end) {
 	uint count = ARRAYSIZE(_vgaBufferPointers);
 	VgaPointersEntry *vpe = _vgaBufferPointers;
 	do {
@@ -2226,18 +2226,18 @@
 	} while (++vpe, --count);
 }
 
-void SimonEngine::vga_buf_unk_proc2(uint a, byte *end) {
+void SimonEngine::checkAnims(uint a, byte *end) {
 	VgaPointersEntry *vpe;
 
 	vpe = &_vgaBufferPointers[a];
 
 	if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 ||
 			_vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) {
-		_videoVar5 = true;
-		_videoVar4++;
+		_rejectBlock = true;
+		_rejectCount++;
 		_vgaBufFreeStart = vpe->vgaFile1 + 0x5000;
 	} else {
-		_videoVar5 = false;
+		_rejectBlock = false;
 	}
 }
 
@@ -2254,13 +2254,13 @@
 	if (vga_res_id == 0) {
 		if (getGameType() == GType_SIMON1) {
 			_unkPalFlag = true;
-		} else {
+		} else if (getGameType() == GType_SIMON2) {
 			_dxUse3Or4ForLock = true;
 			_restoreWindow6 = true;
 		}
 	}
 
-	_vgaCurFile2 = num = vga_res_id / 100;
+	_zoneNumber = num = vga_res_id / 100;
 
 	for (;;) {
 		vpe = &_vgaBufferPointers[num];
@@ -2410,7 +2410,7 @@
 	while (vte->delay) {
 		if (!--vte->delay) {
 			uint16 cur_file = vte->cur_vga_file;
-			uint16 cur_unk = vte->sprite_id;
+			uint16 cur_sprite = vte->sprite_id;
 			const byte *script_ptr = vte->script_pointer;
 
 			_nextVgaTimerToProcess = vte + 1;
@@ -2420,7 +2420,7 @@
 				// special scroll timer
 				scroll_timeout();
 			} else {
-				vcResumeSprite(script_ptr, cur_file, cur_unk);
+				vcResumeSprite(script_ptr, cur_file, cur_sprite);
 			}
 			vte = _nextVgaTimerToProcess;
 		} else {
@@ -2470,8 +2470,8 @@
 
 	_vgaCurSpriteId = cur_sprite;
 
-	_vgaCurFileId = cur_file;
-	_vgaCurFile2 = cur_file;
+	_vgaCurZoneNum = cur_file;
+	_zoneNumber = cur_file;
 	vpe = &_vgaBufferPointers[cur_file];
 
 	_curVgaFile1 = vpe->vgaFile1;
@@ -2588,7 +2588,7 @@
 	while (vsp->id != 0) {
 		vsp->windowNum &= 0x7FFF;
 
-		vpe = &_vgaBufferPointers[vsp->fileId];
+		vpe = &_vgaBufferPointers[vsp->zoneNum];
 		_curVgaFile1 = vpe->vgaFile1;
 		_curVgaFile2 = vpe->vgaFile2;
 		_curSfxFile = vpe->sfxFile;
@@ -2688,7 +2688,7 @@
 	while (vsp->id != 0) {
 		vsp->windowNum &= 0x7FFF;
 
-		vpe = &_vgaBufferPointers[vsp->fileId];
+		vpe = &_vgaBufferPointers[vsp->zoneNum];
 		_curVgaFile1 = vpe->vgaFile1;
 		_curVgaFile2 = vpe->vgaFile2;
 		_curSfxFile = vpe->sfxFile;
@@ -2961,7 +2961,7 @@
 			if (vsp->id == _vgaCurSpriteId)
 				break;
 		} else {
-			if (vsp->id == _vgaCurSpriteId && vsp->fileId == _vgaCurFileId)
+			if (vsp->id == _vgaCurSpriteId && vsp->zoneNum == _vgaCurZoneNum)
 				break;
 		}
 		vsp++;
@@ -2969,14 +2969,14 @@
 	return vsp;
 }
 
-bool SimonEngine::isSpriteLoaded(uint16 id, uint16 fileId) {
+bool SimonEngine::isSpriteLoaded(uint16 id, uint16 zoneNum) {
 	VgaSprite *vsp = _vgaSprites;
 	while (vsp->id) {
 		if (getGameType() == GType_SIMON1) {
 			if (vsp->id == id)
 				return true;
 		} else {
-			if (vsp->id == id && vsp->fileId == fileId)
+			if (vsp->id == id && vsp->zoneNum == zoneNum)
 				return true;
 		}
 		vsp++;
@@ -3017,6 +3017,10 @@
 		if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)
 			_exitCutscene = true;
 		break;
+	case 65: // F7
+		if (getGameType() == GType_FF && getBitFlag(76))
+			_variableArray[254] = 70;
+		break;
 	case 'p':
 		pause();
 		break;
@@ -3136,7 +3140,7 @@
 	window->mode = 0;
 }
 
-void SimonEngine::loadSprite(uint windowNum, uint fileId, uint vgaSpriteId, uint x, uint y, uint palette) {
+void SimonEngine::loadSprite(uint windowNum, uint zoneNum, uint vgaSpriteId, uint x, uint y, uint palette) {
 	VgaSprite *vsp;
 	VgaPointersEntry *vpe;
 	byte *p, *pp;
@@ -3144,7 +3148,7 @@
 
 	_lockWord |= 0x40;
 
-	if (isSpriteLoaded(vgaSpriteId, fileId)) {
+	if (isSpriteLoaded(vgaSpriteId, zoneNum)) {
 		_lockWord &= ~0x40;
 		return;
 	}
@@ -3163,18 +3167,18 @@
 	vsp->palette = palette;
 	vsp->id = vgaSpriteId;
 	if (getGameType() == GType_SIMON1)
-		vsp->fileId = fileId = vgaSpriteId / 100;
+		vsp->zoneNum = zoneNum = vgaSpriteId / 100;
 	else
-		vsp->fileId = fileId;
+		vsp->zoneNum = zoneNum;
 
 
 	for (;;) {
-		vpe = &_vgaBufferPointers[fileId];
-		_vgaCurFile2 = fileId;
+		vpe = &_vgaBufferPointers[zoneNum];
+		_zoneNumber = zoneNum;
 		_curVgaFile1 = vpe->vgaFile1;
 		if (vpe->vgaFile1 != NULL)
 			break;
-		loadZone(fileId);
+		loadZone(zoneNum);
 	}
 
 	pp = _curVgaFile1;
@@ -3192,18 +3196,18 @@
 		if (getGameType() == GType_FF) {
 			if (READ_LE_UINT16(&((AnimationHeader_Feeble *) p)->id) == vgaSpriteId) {
 				if (_startVgaScript)
-					dump_vga_script(pp + READ_LE_UINT16(&((AnimationHeader_Feeble*)p)->scriptOffs), fileId, vgaSpriteId);
+					dump_vga_script(pp + READ_LE_UINT16(&((AnimationHeader_Feeble*)p)->scriptOffs), zoneNum, vgaSpriteId);
 
-				add_vga_timer(VGA_DELAY_BASE, pp + READ_LE_UINT16(&((AnimationHeader_Feeble *) p)->scriptOffs), vgaSpriteId, fileId);
+				add_vga_timer(VGA_DELAY_BASE, pp + READ_LE_UINT16(&((AnimationHeader_Feeble *) p)->scriptOffs), vgaSpriteId, zoneNum);
 				break;
 			}
 			p += sizeof(AnimationHeader_Feeble);
 		} else {
 			if (READ_BE_UINT16(&((AnimationHeader_Simon *) p)->id) == vgaSpriteId) {
 				if (_startVgaScript)
-					dump_vga_script(pp + READ_BE_UINT16(&((AnimationHeader_Simon*)p)->scriptOffs), fileId, vgaSpriteId);
+					dump_vga_script(pp + READ_BE_UINT16(&((AnimationHeader_Simon*)p)->scriptOffs), zoneNum, vgaSpriteId);
 
-				add_vga_timer(VGA_DELAY_BASE, pp + READ_BE_UINT16(&((AnimationHeader_Simon *) p)->scriptOffs), vgaSpriteId, fileId);
+				add_vga_timer(VGA_DELAY_BASE, pp + READ_BE_UINT16(&((AnimationHeader_Simon *) p)->scriptOffs), vgaSpriteId, zoneNum);
 				break;
 			}
 			p += sizeof(AnimationHeader_Simon);
@@ -3457,7 +3461,7 @@
 		if (in.isOpen() == false)
 			error("read_vga_from_datfile_2: can't open %s", buf);
 
-		dst = setup_vga_destination(dstSize);
+		dst = allocBlock(dstSize);
 
 		in.seek(offset, SEEK_SET);
 		if (srcSize != dstSize) {
@@ -3509,11 +3513,11 @@
 			byte *buffer = new byte[size];
 			if (in.read(buffer, size) != size)
 				error("read_vga_from_datfile_2: read failed");
-			dst = setup_vga_destination (READ_BE_UINT32(buffer + size - 4) + extraBuffer);
+			dst = allocBlock (READ_BE_UINT32(buffer + size - 4) + extraBuffer);
 			decrunchFile(buffer, dst, size);
 			delete[] buffer;
 		} else {
-			dst = setup_vga_destination(size + extraBuffer);
+			dst = allocBlock(size + extraBuffer);
 			if (in.read(dst, size) != size)
 				error("read_vga_from_datfile_2: read failed");
 		}
@@ -3525,7 +3529,7 @@
 		uint32 size = _gameOffsetsPtr[id + 1] - offs_a;
 		byte *dst;
 
-		dst = setup_vga_destination(size + extraBuffer);
+		dst = allocBlock(size + extraBuffer);
 		resfile_read(dst, offs_a, size);
 
 		return dst;

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-10 23:22:26 UTC (rev 21772)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-10 23:44:17 UTC (rev 21773)
@@ -89,7 +89,7 @@
 	uint16 x, y;									/* actually signed numbers */
 	uint16 flags;
 	uint16 priority;
-	uint16 windowNum, fileId;
+	uint16 windowNum, zoneNum;
 	VgaSprite() { memset(this, 0, sizeof(*this)); }
 };
 
@@ -329,13 +329,13 @@
 	uint16 _scrollUpHitArea;
 	uint16 _scrollDownHitArea;
 
-	uint16 _videoVar7;
+	uint16 _noOverWrite;
 	volatile uint16 _paletteColorCount;
 
 	int _screenWidth, _screenHeight;
 
-	byte _videoVar4;
-	bool _videoVar5;
+	byte _rejectCount;
+	bool _rejectBlock;
 	bool _fastFadeOutFlag;
 	bool _unkPalFlag;
 	bool _exitCutscene;
@@ -363,8 +363,8 @@
 
 	uint16 _frameRate;
 
-	uint16 _vgaCurFile2;
-	uint16 _vgaWaitFor, _vgaCurFileId;
+	uint16 _zoneNumber;
+	uint16 _vgaWaitFor, _vgaCurZoneNum;
 	uint16 _vgaCurSpriteId;
 	uint16 _vgaCurSpritePriority;
 
@@ -418,7 +418,7 @@
 
 	byte _videoBuf1[3000];
 
-	VgaTimerEntry _vgaTimerList[95];
+	VgaTimerEntry _vgaTimerList[900];
 
 	WindowBlock *_windowList;
 
@@ -692,11 +692,11 @@
 	void renderStringAmiga(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
 	void renderString(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
 
-	byte *setup_vga_destination(uint32 size);
-	void vga_buf_unk_proc3(byte *end);
-	void vga_buf_unk_proc1(byte *end);
-	void vga_buf_unk_proc2(uint a, byte *end);
-	void delete_memptr_range(byte *end);
+	byte *allocBlock(uint32 size);
+	void checkNoOverWrite(byte *end);
+	void checkRunningAnims(byte *end);
+	void checkAnims(uint a, byte *end);
+	void checkZonePtrs(byte *end);
 
 	void setup_vga_file_buf_pointers();
 
@@ -1013,7 +1013,7 @@
 
 	void expire_vga_timers();
 
-	bool isSpriteLoaded(uint16 id, uint16 fileId);
+	bool isSpriteLoaded(uint16 id, uint16 zoneNum);
 
 	void resetWindow(WindowBlock *window);
 	void delete_hitarea_by_index(uint index);

Modified: scummvm/trunk/engines/simon/vga.cpp
===================================================================
--- scummvm/trunk/engines/simon/vga.cpp	2006-04-10 23:22:26 UTC (rev 21772)
+++ scummvm/trunk/engines/simon/vga.cpp	2006-04-10 23:44:17 UTC (rev 21773)
@@ -130,7 +130,7 @@
 
 		if (_continousVgaScript) {
 			if (_vcPtr != (const byte *)&_vc_get_out_of_code) {
-				fprintf(_dumpFile, "%.5d %.5X: %5d %4d ", _vgaTickCounter, _vcPtr - _curVgaFile1, _vgaCurSpriteId, _vgaCurFileId);
+				fprintf(_dumpFile, "%.5d %.5X: %5d %4d ", _vgaTickCounter, _vcPtr - _curVgaFile1, _vgaCurSpriteId, _vgaCurZoneNum);
 				dump_video_script(_vcPtr, true);
 			}
 		}
@@ -251,11 +251,11 @@
 		_curVgaFile2 = vpe->vgaFile2;
 		if (vpe->vgaFile1 != NULL)
 			break;
-		if (_vgaCurFile2 != res)
-			_videoVar7 = _vgaCurFile2;
+		if (_zoneNumber != res)
+			_noOverWrite = _zoneNumber;
 
 		loadZone(res);
-		_videoVar7 = 0xFFFF;
+		_noOverWrite = 0xFFFF;
 	}
 
 
@@ -292,7 +292,7 @@
 }
 
 void SimonEngine::vc3_loadSprite() {
-	uint16 windowNum, fileId, palette, x, y, vgaSpriteId;
+	uint16 windowNum, zoneNum, palette, x, y, vgaSpriteId;
 	uint16 res;
 	VgaSprite *vsp;
 	VgaPointersEntry *vpe;
@@ -303,9 +303,9 @@
 
 	if (getGameType() == GType_SIMON1) {
 		vgaSpriteId = vcReadNextWord();	/* 2 */
-		fileId = vgaSpriteId / 100;
+		zoneNum = vgaSpriteId / 100;
 	} else {
-		fileId = vcReadNextWord();	/* 0 */
+		zoneNum = vcReadNextWord();	/* 0 */
 		vgaSpriteId = vcReadNextWord();	/* 2 */
 	}
 
@@ -314,7 +314,7 @@
 	palette = vcReadNextWord();		/* 8 */
 
 	/* 2nd param ignored with simon1 */
-	if (isSpriteLoaded(vgaSpriteId, fileId))
+	if (isSpriteLoaded(vgaSpriteId, zoneNum))
 		return;
 
 	vsp = _vgaSprites;
@@ -329,7 +329,7 @@
 	vsp->x = x;
 	vsp->y = y;
 	vsp->id = vgaSpriteId;
-	vsp->fileId = res = fileId;
+	vsp->zoneNum = res = zoneNum;
 
 	old_file_1 = _curVgaFile1;
 	for (;;) {
@@ -338,11 +338,11 @@
 
 		if (vpe->vgaFile1 != NULL)
 			break;
-		if (_vgaCurFile2 != res)
-			_videoVar7 = _vgaCurFile2;
+		if (_zoneNumber != res)
+			_noOverWrite = _zoneNumber;
 
 		loadZone(res);
-		_videoVar7 = 0xFFFF;
+		_noOverWrite = 0xFFFF;
 	}
 
 	pp = _curVgaFile1;
@@ -723,7 +723,7 @@
 		return;
 
 	if (_dumpImages)
-		dump_single_bitmap(_vgaCurFileId, state.image, state.depack_src, width, height,
+		dump_single_bitmap(_vgaCurZoneNum, state.image, state.depack_src, width, height,
 											 state.palette);
 	// Check if image is compressed
 	if (getGameType() == GType_FF) {
@@ -1424,7 +1424,7 @@
 	else
 		num += VGA_DELAY_BASE;
 
-	add_vga_timer(num, _vcPtr, _vgaCurSpriteId, _vgaCurFileId);
+	add_vga_timer(num, _vcPtr, _vgaCurSpriteId, _vgaCurZoneNum);
 	_vcPtr = (byte *)&_vc_get_out_of_code;
 }
 
@@ -1469,7 +1469,7 @@
 	vfs->ident = vcReadNextWord();
 	vfs->code_ptr = _vcPtr;
 	vfs->sprite_id = _vgaCurSpriteId;
-	vfs->cur_vga_file = _vgaCurFileId;
+	vfs->cur_vga_file = _vgaCurZoneNum;
 
 	_vcPtr = (byte *)&_vc_get_out_of_code;
 }
@@ -1816,7 +1816,7 @@
 	uint val = vcReadVar(vcReadNextWord());
 	if (val != vcReadNextWord()) {
 
-		add_vga_timer(_frameRate + 1, _vcPtr - 4, _vgaCurSpriteId, _vgaCurFileId);
+		add_vga_timer(_frameRate + 1, _vcPtr - 4, _vgaCurSpriteId, _vgaCurZoneNum);
 		_vcPtr = (byte *)&_vc_get_out_of_code;
 	}
 }
@@ -2007,7 +2007,7 @@
 void SimonEngine::vc56_delay() {
 	uint num = vcReadVarOrWord() * _frameRate;
 
-	add_vga_timer(num + VGA_DELAY_BASE, _vcPtr, _vgaCurSpriteId, _vgaCurFileId);
+	add_vga_timer(num + VGA_DELAY_BASE, _vcPtr, _vgaCurSpriteId, _vgaCurZoneNum);
 	_vcPtr = (byte *)&_vc_get_out_of_code;
 }
 
@@ -2028,11 +2028,11 @@
 
 void SimonEngine::vc58() {
 	uint sprite = _vgaCurSpriteId;
-	uint file = _vgaCurFileId;
+	uint file = _vgaCurZoneNum;
 	const byte *vc_ptr_org;
 	uint16 tmp;
 
-	_vgaCurFileId = vcReadNextWord();
+	_vgaCurZoneNum = vcReadNextWord();
 	_vgaCurSpriteId = vcReadNextWord();
 
 	tmp = to16Wrapper(vcReadNextWord());
@@ -2043,7 +2043,7 @@
 
 	_vcPtr = vc_ptr_org;
 	_vgaCurSpriteId = sprite;
-	_vgaCurFileId = file;
+	_vgaCurZoneNum = file;
 }
 
 void SimonEngine::vc57_no_op() {
@@ -2058,15 +2058,15 @@
 	const byte *vc_ptr_org;
 
 	old_sprite_id = _vgaCurSpriteId;
-	old_cur_file_id = _vgaCurFileId;
+	old_cur_file_id = _vgaCurZoneNum;
 	vc_ptr_org = _vcPtr;
 
-	_vgaCurFileId = file;
+	_vgaCurZoneNum = file;
 	_vgaCurSpriteId = sprite;
 
 	vfs = _vgaSleepStructs;
 	while (vfs->ident != 0) {
-		if (vfs->sprite_id == _vgaCurSpriteId && ((getGameType() == GType_SIMON1) || vfs->cur_vga_file == _vgaCurFileId)) {
+		if (vfs->sprite_id == _vgaCurSpriteId && ((getGameType() == GType_SIMON1) || vfs->cur_vga_file == _vgaCurZoneNum)) {
 			while (vfs->ident != 0) {
 				memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct));
 				vfs++;
@@ -2082,7 +2082,7 @@
 
 		vte = _vgaTimerList;
 		while (vte->delay != 0) {
-			if (vte->sprite_id == _vgaCurSpriteId && ((getGameType() == GType_SIMON1) || vte->cur_vga_file == _vgaCurFileId)) {
+			if (vte->sprite_id == _vgaCurSpriteId && ((getGameType() == GType_SIMON1) || vte->cur_vga_file == _vgaCurZoneNum)) {
 				delete_vga_timer(vte);
 				break;
 			}
@@ -2090,7 +2090,7 @@
 		}
 	}
 
-	_vgaCurFileId = old_cur_file_id;
+	_vgaCurZoneNum = old_cur_file_id;
 	_vgaCurSpriteId = old_sprite_id;
 	_vcPtr = vc_ptr_org;
 }
@@ -2099,7 +2099,7 @@
 	uint file;
 
 	if (getGameType() == GType_SIMON1) {
-		file = _vgaCurFileId;
+		file = _vgaCurZoneNum;
 	} else {
 		file = vcReadNextWord();
 	}
@@ -2114,7 +2114,7 @@
 
 	vsp->x += vcReadNextWord();
 	vsp->y += vcReadNextWord();
-	vsp->flags = kDFMasked | 0x4;
+	vsp->flags = kDFMasked | kDFUseFrontBuf;
 
 	_vgaSpriteChanged++;
 }
@@ -2155,7 +2155,7 @@
 					byte *old_file_2 = _curVgaFile2;
 					uint palmode = _windowNum;
 
-					vpe = &_vgaBufferPointers[vsp->fileId];
+					vpe = &_vgaBufferPointers[vsp->zoneNum];
 					_curVgaFile1 = vpe->vgaFile1;
 					_curVgaFile2 = vpe->vgaFile2;
 					_windowNum = vsp->windowNum;
@@ -2518,7 +2518,6 @@
 		if (_scrollCount != 0) {
 			if (_scrollCount >= 0)
 				return;
-			_scrollCount = 0;
 		} else {
 			if (_scrollFlag != 0)
 				return;
@@ -2534,7 +2533,6 @@
 		if (_scrollCount != 0) {
 			if (_scrollCount < 0)
 				return;
-			_scrollCount = 0;
 		} else {
 			if (_scrollFlag != 0)
 				return;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list