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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Fri May 12 23:29:07 CEST 2006


Revision: 22427
Author:   kirben
Date:     2006-05-12 23:18:47 -0700 (Fri, 12 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22427&view=rev

Log Message:
-----------
Split VGA resource management back into FF and Simon 1/2 versions

Modified Paths:
--------------
    scummvm/trunk/engines/simon/simon.cpp
Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-05-13 06:08:39 UTC (rev 22426)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-05-13 06:18:47 UTC (rev 22427)
@@ -1339,20 +1339,31 @@
 
 	vpe = &_vgaBufferPointers[_noOverWrite];
 
-	if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart) {
-		_rejectBlock = true;
-		_rejectCount++;
-		_vgaBufFreeStart = vpe->vgaFile1End;
-	} else if (vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart) {
-		_rejectBlock = true;
-		_rejectCount++;
-		_vgaBufFreeStart = vpe->vgaFile2End;
-	} else if (vpe->sfxFile && vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) {
-		_rejectBlock = true;
-		_rejectCount++;
-		_vgaBufFreeStart = vpe->sfxFileEnd;
+	if (getGameType() == GType_FF) {
+		if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart) {
+			_rejectBlock = true;
+			_rejectCount++;
+			_vgaBufFreeStart = vpe->vgaFile1End;
+		} else if (vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart) {
+			_rejectBlock = true;
+			_rejectCount++;
+			_vgaBufFreeStart = vpe->vgaFile2End;
+		} else if (vpe->sfxFile && vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) {
+			_rejectBlock = true;
+			_rejectCount++;
+			_vgaBufFreeStart = vpe->sfxFileEnd;
+		} else {
+			_rejectBlock = false;
+		}
 	} else {
-		_rejectBlock = false;
+		if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 ||
+			_vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) {
+			_rejectBlock = true;
+			_rejectCount++;
+			_vgaBufFreeStart = vpe->vgaFile1 + 0x5000;
+		} else {
+			_rejectBlock = false;
+		}
 	}
 }
 
@@ -1375,17 +1386,27 @@
 
 	vpe = &_vgaBufferPointers[a];
 
-	if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart) {
-		_rejectBlock = true;
-		_vgaBufFreeStart = vpe->vgaFile1End;
-	} else if (vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart) {
-		_rejectBlock = true;
-		_vgaBufFreeStart = vpe->vgaFile2End;
-	} else if (vpe->sfxFile && vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) {
-		_rejectBlock = true;
-		_vgaBufFreeStart = vpe->sfxFileEnd;
+	if (getGameType() == GType_FF) {
+		if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart) {
+			_rejectBlock = true;
+			_vgaBufFreeStart = vpe->vgaFile1End;
+		} else if (vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart) {
+			_rejectBlock = true;
+			_vgaBufFreeStart = vpe->vgaFile2End;
+		} else if (vpe->sfxFile && vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) {
+			_rejectBlock = true;
+			_vgaBufFreeStart = vpe->sfxFileEnd;
+		} else {
+			_rejectBlock = false;
+		}
 	} else {
-		_rejectBlock = false;
+		if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 ||
+				_vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) {
+			_rejectBlock = true;
+			_vgaBufFreeStart = vpe->vgaFile1 + 0x5000;
+		} else {
+			_rejectBlock = false;
+		}
 	}
 }
 
@@ -1393,17 +1414,24 @@
 	uint count = ARRAYSIZE(_vgaBufferPointers);
 	VgaPointersEntry *vpe = _vgaBufferPointers;
 	do {
-		if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart ||
-				vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart ||
-				vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) {
-			vpe->vgaFile1 = NULL;
-			vpe->vgaFile1End = NULL;
-			vpe->vgaFile2 = NULL;
-			vpe->vgaFile2End = NULL;
-			vpe->sfxFile = NULL;
-			vpe->sfxFileEnd = NULL;
+		if (getGameType() == GType_FF) {
+			if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart ||
+					vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart ||
+					vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) {
+				vpe->vgaFile1 = NULL;
+				vpe->vgaFile1End = NULL;
+				vpe->vgaFile2 = NULL;
+				vpe->vgaFile2End = NULL;
+				vpe->sfxFile = NULL;
+				vpe->sfxFileEnd = NULL;
+			}
+		} else {
+			if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 ||
+					_vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) {
+				vpe->vgaFile1 = NULL;
+				vpe->vgaFile2 = NULL;
+			}
 		}
-
 	} while (++vpe, --count);
 }
 


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