[Scummvm-cvs-logs] SF.net SVN: scummvm: [27646] scummvm/trunk/engines/agos/vga_e2.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sat Jun 23 09:40:26 CEST 2007


Revision: 27646
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27646&view=rev
Author:   Kirben
Date:     2007-06-23 00:40:25 -0700 (Sat, 23 Jun 2007)

Log Message:
-----------
Minor cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/agos/vga_e2.cpp

Modified: scummvm/trunk/engines/agos/vga_e2.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga_e2.cpp	2007-06-23 07:25:50 UTC (rev 27645)
+++ scummvm/trunk/engines/agos/vga_e2.cpp	2007-06-23 07:40:25 UTC (rev 27646)
@@ -69,40 +69,36 @@
 }
 
 void AGOSEngine::vc45_setWindowPalette() {
-	uint num = vcReadNextWord();
-	uint color = vcReadNextWord();
+	uint16 num = vcReadNextWord();
+	uint16 color = vcReadNextWord();
 
+	const uint16 *vlut = &_videoWindows[num * 4];
+	uint8 width = vlut[2] * 8;
+	uint8 height = vlut[3];
+
 	if (num == 4) {
-		const uint16 *vlut = &_videoWindows[num * 4];
 		byte *dst = _window4BackScn;
-		uint width = vlut[2] * 16;
-		uint height = vlut[3];
 
-		for (uint h = 0; h < height; h++) {
-			for (uint w = 0; w < width; w++) {
+		for (uint8 h = 0; h < height; h++) {
+			for (uint8 w = 0; w < width; w++) {
 				uint16 val = READ_LE_UINT16(dst + w * 2);
 				val &= 0xF0F;
 				val |= color * 16;
 				WRITE_LE_UINT16(dst + w * 2, val);
 			}
-			dst += width;
+			dst += width * 2;
 		}
 	} else {
-		const uint16 *vlut = &_videoWindows[num * 4];
-
 		Graphics::Surface *screen = _system->lockScreen();
 		byte *dst = (byte *)screen->pixels + vlut[0] * 16 + vlut[1] * _dxSurfacePitch;
 
-		uint width = vlut[2] * 16 / 2;
-		uint height = vlut[3];
-
 		if (getGameType() == GType_ELVIRA2 && num == 7) {
 			dst -= 4;
 			width += 4;
 		}
 
-		for (uint h = 0; h < height; h++) {
-			for (uint w = 0; w < width; w++) {
+		for (uint8 h = 0; h < height; h++) {
+			for (uint8 w = 0; w < width; w++) {
 				uint16 val = READ_LE_UINT16(dst + w * 2);
 				val &= 0xF0F;
 				val |= color * 16;


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