[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.85,1.86 font.cpp,1.23,1.24 saga.cpp,1.83,1.84

Andrew Kurushin h00ligan at users.sourceforge.net
Sun Jan 9 13:37:04 CET 2005


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

Modified Files:
	actor.cpp font.cpp saga.cpp 
Log Message:
small fixes:
- actor barrier rects
- unreachable code

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- actor.cpp	9 Jan 2005 21:07:18 -0000	1.85
+++ actor.cpp	9 Jan 2005 21:36:20 -0000	1.86
@@ -162,7 +162,7 @@
 	
 
 	_pathRect.left = 0;
-	_pathRect.right = _vm->getDisplayWidth() - 1;
+	_pathRect.right = _vm->getDisplayWidth();
 	_pathRect.top = _vm->getPathYOffset();
 	_pathRect.bottom = _vm->getStatusYOffset();
 
@@ -1217,23 +1217,22 @@
 
 					anotherActorScreenPosition = anotherActor->screenPosition;
 					testBox.left = anotherActorScreenPosition.x - collision.x;
-					testBox.right = anotherActorScreenPosition.x + collision.x;
+					testBox.right = anotherActorScreenPosition.x + collision.x + 1;
 					testBox.top = anotherActorScreenPosition.y - collision.y;
-					testBox.bottom = anotherActorScreenPosition.y + collision.y;
+					testBox.bottom = anotherActorScreenPosition.y + collision.y + 1;
 					testBox2 = testBox;
-					testBox2.right += 2;
+					testBox2.right += 1;
 					testBox2.left -= 1;
-					testBox2.bottom += 1;
 
 					if (testBox2.contains(pointFrom)) {
 						if (pointFrom.x > anotherActorScreenPosition.x + 4) {
-							testBox.right = pointFrom.x - 2;
+							testBox.right = pointFrom.x - 1;
 						} else {
 							if (pointFrom.x < anotherActorScreenPosition.x - 4) {
 								testBox.left = pointFrom.x + 2;
 							} else {
 								if (pointFrom.y > anotherActorScreenPosition.y) {
-									testBox.bottom = pointFrom.y - 1; 
+									testBox.bottom = pointFrom.y; 
 								} else {
 									testBox.top = pointFrom.y + 1 ;
 								}
@@ -1241,7 +1240,7 @@
 						}
 					}
 
-					if ((testBox.left <= testBox.right) && (testBox.top <= testBox.bottom)) {
+					if ((testBox.width() > 0) && (testBox.height() > 0)) {
 						_barrierList[_barrierCount++] = testBox;
 					}
 				}
@@ -1416,8 +1415,8 @@
 		intersect.bottom = MIN(_pathRect.bottom, _barrierList[i].bottom);
 		
 
-		for (iteratorPoint.y = intersect.top; iteratorPoint.y <= intersect.bottom; iteratorPoint.y++) {
-			for (iteratorPoint.x = intersect.left; iteratorPoint.x <= intersect.right; iteratorPoint.x++) {
+		for (iteratorPoint.y = intersect.top; iteratorPoint.y < intersect.bottom; iteratorPoint.y++) {
+			for (iteratorPoint.x = intersect.left; iteratorPoint.x < intersect.right; iteratorPoint.x++) {
 				setPathCell(iteratorPoint, kPathCellBarrier);
 			}
 		}

Index: font.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/font.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- font.cpp	2 Jan 2005 14:52:00 -0000	1.23
+++ font.cpp	9 Jan 2005 21:36:20 -0000	1.24
@@ -98,7 +98,6 @@
 	// Load font resource
 	if (RSC_LoadResource(_fontContext, font_rn, &fontres_p, &fontres_len) != SUCCESS) {
 		error("Font::loadFont(): Couldn't load font resource.");
-		return FAILURE;
 	}
 
 	if (fontres_len < FONT_DESCSIZE) {
@@ -112,7 +111,6 @@
 	font = (FONT *)malloc(sizeof(*font));
 	if (font == NULL) {
 		error("Font:loadFont(): Memory allocation error.");
-		return MEM;
 	}
 
 	// Read font header
@@ -130,8 +128,6 @@
 	normal_font = (FONT_STYLE *)malloc(sizeof(*normal_font));
 	if (normal_font == NULL) {
 		error("Font::loadFont(): Memory allocation error.");
-		free(font);
-		return MEM;
 	}
 
 	normal_font->font_free_p = fontres_p;
@@ -185,7 +181,6 @@
 
 	if ((font_id < 0) || (font_id >= _nFonts) || (_fonts[font_id] == NULL)) {
 		error("Font::getHeight(): Invalid font id.");
-		return FAILURE;
 	}
 
 	font = _fonts[font_id];
@@ -219,7 +214,6 @@
 
 	if (new_font == NULL) {
 		error("Font::createOutline(): Memory allocation error.");
-		return NULL;
 	}
 
 	memset(new_font, 0, sizeof(*new_font));
@@ -263,7 +257,6 @@
 
 	if (new_font_data == NULL) {
 		error("Font::createOutline(): Memory allocation error.");
-		return NULL;
 	}
 
 	memset(new_font_data, 0, new_font_data_len);
@@ -351,7 +344,6 @@
 
 	if ((font_id < 0) || (font_id >= _nFonts) || (_fonts[font_id] == NULL)) {
 		error("Font::getStringWidth(): Invalid font id.");
-		return FAILURE;
 	}
 
 	font = _fonts[font_id];
@@ -380,13 +372,10 @@
 
 	if (!_initialized) {
 		error("Font::draw(): Font Module not initialized.");
-
-		return FAILURE;
 	}
 
 	if ((font_id < 0) || (font_id >= _nFonts) || (_fonts[font_id] == NULL)) {
 		error("Font::draw(): Invalid font id.");
-		return FAILURE;
 	}
 
 	font = _fonts[font_id];

Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- saga.cpp	8 Jan 2005 21:06:06 -0000	1.83
+++ saga.cpp	9 Jan 2005 21:36:20 -0000	1.84
@@ -258,7 +258,7 @@
 		_system->delayMillis(10);
 	}
 	
-	return 0;
+	//return 0;
 }
 
 void SagaEngine::shutdown() {





More information about the Scummvm-git-logs mailing list