[Scummvm-cvs-logs] CVS: scummvm/simon intern.h,1.38,1.39 simon.cpp,1.515,1.516 simon.h,1.144,1.145 vga.cpp,1.135,1.136

kirben kirben at users.sourceforge.net
Fri Oct 7 00:36:55 CEST 2005


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

Modified Files:
	intern.h simon.cpp simon.h vga.cpp 
Log Message:

Adjust for larger resolution.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/intern.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- intern.h	6 Oct 2005 14:34:24 -0000	1.38
+++ intern.h	7 Oct 2005 07:36:09 -0000	1.39
@@ -64,8 +64,8 @@
 };
 
 struct Subroutine {
-	uint16 id;										/* subroutine ID */
-	uint16 first;									/* offset from subroutine start to first subroutine line */
+	uint16 id;								/* subroutine ID */
+	uint16 first;								/* offset from subroutine start to first subroutine line */
 	Subroutine *next;							/* next subroutine in linked list */
 };
 

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.515
retrieving revision 1.516
diff -u -d -r1.515 -r1.516
--- simon.cpp	7 Oct 2005 06:59:49 -0000	1.515
+++ simon.cpp	7 Oct 2005 07:36:09 -0000	1.516
@@ -687,6 +687,14 @@
 	_vc10BasePtrOld = 0;
 	memcpy (_hebrew_char_widths,
 		"\x5\x5\x4\x6\x5\x3\x4\x5\x6\x3\x5\x5\x4\x6\x5\x3\x4\x6\x5\x6\x6\x6\x5\x5\x5\x6\x5\x6\x6\x6\x6\x6", 32);
+
+	if (_game == GAME_FEEBLEFILES) {
+		_screenWidth = 640;
+		_screenHeight = 480;
+	} else {
+		_screenWidth = 320;
+		_screenHeight = 200;
+	}
 }
 
 int SimonEngine::init(GameDetector &detector) {
@@ -699,7 +707,9 @@
 
 	_system->beginGFXTransaction();
 		initCommonGFX(detector);
-		_system->initSize(320, 200);
+		_system->initSize(_screenWidth, _screenHeight);
+		if (_game == GAME_FEEBLEFILES)
+			_system->setGraphicsMode("1x");
 	_system->endGFXTransaction();
 
 	// Setup midi driver
@@ -2558,7 +2568,7 @@
 		if (!_dxUse3Or4ForLock) {
 			num_lines = _windowNum == 4 ? 134 : 200;
 			_vgaVar8 = num_lines;
-			dx_copy_from_attached_to_2(0, 0, 320, num_lines);
+			dx_copy_from_attached_to_2(0, 0, _screenWidth, num_lines);
 			dx_copy_from_attached_to_3(num_lines);
 			_syncFlag2 = 1;
 		}
@@ -2570,7 +2580,7 @@
 			num_lines = 200;
 		else
 			num_lines = _windowNum == 4 ? 134 : 200;
-		dx_copy_from_attached_to_2(0, 0, 320, num_lines);
+		dx_copy_from_attached_to_2(0, 0, _screenWidth, num_lines);
 		dx_copy_from_attached_to_3(num_lines);
 		_syncFlag2 = 1;
 		_timer5 = 0;
@@ -2822,7 +2832,7 @@
 	}
 
 	if (_drawImagesDebug)
-		memset(_sdl_buf_attached, 0, 320 * 200);
+		memset(_sdl_buf_attached, 0, _screenWidth * _screenHeight);
 
 	_videoVar8++;
 	_vcPtr = vc_ptr_org;
@@ -2834,15 +2844,15 @@
 	uint x;
 
 	if (_scrollFlag < 0) {
-		memmove(dst + 8, dst, 320 * _scrollHeight - 8);
+		memmove(dst + 8, dst, _screenWidth * _scrollHeight - 8);
 	} else {
-		memmove(dst, dst + 8, 320 * _scrollHeight - 8);
+		memmove(dst, dst + 8, _screenWidth * _scrollHeight - 8);
 	}
 
 	x = _scrollX - 1;
 
 	if (_scrollFlag > 0) {
-		dst += 320 - 8;
+		dst += _screenWidth - 8;
 		x += 41;
 	}
 
@@ -2852,7 +2862,7 @@
 	dx_unlock_2();
 
 
-	memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200);
+	memcpy(_sdl_buf_attached, _sdl_buf, _screenWidth * _screenHeight);
 	dx_copy_from_attached_to_3(_scrollHeight);
 
 
@@ -2939,7 +2949,7 @@
 
 	if (_copyPartialMode == 2) {
 		// copy partial from attached to 2
-		dx_copy_from_attached_to_2(176, 61, 320 - 176, 134 - 61);
+		dx_copy_from_attached_to_2(176, 61, _screenWidth - 176, 134 - 61);
 		_copyPartialMode = 0;
 	}
 
@@ -3375,7 +3385,7 @@
 	// Works around bug in original Simon the Sorcerer 2
 	// Animations continue in background when load/save dialog is open
 	// often causing the savegame name highlighter to be cut short
-	if (!(h > 0 && w > 0 && ha->x + w <= 320 && ha->y + h <= 200)) {
+	if (!(h > 0 && w > 0 && ha->x + w <= _screenWidth && ha->y + h <= _screenHeight)) {
 		debug(1,"Invalid coordinates in video_toggle_colors (%d,%d,%d,%d)", ha->x, ha->y, ha->width, ha->height);
 		_lockWord &= ~0x8000;
 		return;
@@ -3887,46 +3897,46 @@
 }
 
 void SimonEngine::dx_clear_surfaces(uint num_lines) {
-	memset(_sdl_buf_attached, 0, num_lines * 320);
+	memset(_sdl_buf_attached, 0, num_lines * _screenWidth);
 
-	_system->copyRectToScreen(_sdl_buf_attached, 320, 0, 0, 320, 200);
+	_system->copyRectToScreen(_sdl_buf_attached, _screenWidth, 0, 0, _screenWidth, _screenHeight);
 
 	if (_dxUse3Or4ForLock) {
-		memset(_sdl_buf, 0, num_lines * 320);
-		memset(_sdl_buf_3, 0, num_lines * 320);
+		memset(_sdl_buf, 0, num_lines * _screenWidth);
+		memset(_sdl_buf_3, 0, num_lines * _screenWidth);
 	}
 }
 
 void SimonEngine::dx_clear_attached_from_top(uint lines) {
-	memset(_sdl_buf_attached, 0, lines * 320);
+	memset(_sdl_buf_attached, 0, lines * _screenWidth);
 }
 
 void SimonEngine::dx_copy_from_attached_to_2(uint x, uint y, uint w, uint h) {
-	uint offs = x + y * 320;
+	uint offs = x + y * _screenWidth;
 	byte *s = _sdl_buf_attached + offs;
 	byte *d = _sdl_buf + offs;
 
 	do {
 		memcpy(d, s, w);
-		d += 320;
-		s += 320;
+		d += _screenWidth;
+		s += _screenWidth;
 	} while (--h);
 }
 
 void SimonEngine::dx_copy_from_2_to_attached(uint x, uint y, uint w, uint h) {
-	uint offs = x + y * 320;
+	uint offs = x + y * _screenWidth;
 	byte *s = _sdl_buf + offs;
 	byte *d = _sdl_buf_attached + offs;
 
 	do {
 		memcpy(d, s, w);
-		d += 320;
-		s += 320;
+		d += _screenWidth;
+		s += _screenWidth;
 	} while (--h);
 }
 
 void SimonEngine::dx_copy_from_attached_to_3(uint lines) {
-	memcpy(_sdl_buf_3, _sdl_buf_attached, lines * 320);
+	memcpy(_sdl_buf_3, _sdl_buf_attached, lines * _screenWidth);
 }
 
 void SimonEngine::dx_update_screen_and_palette() {
@@ -3940,10 +3950,10 @@
 		}
 	}
 
-	_system->copyRectToScreen(_sdl_buf_attached, 320, 0, 0, 320, 200);
+	_system->copyRectToScreen(_sdl_buf_attached, _screenWidth, 0, 0, _screenWidth, _screenHeight);
 	_system->updateScreen();
 
-	memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200);
+	memcpy(_sdl_buf_attached, _sdl_buf, _screenWidth * _screenHeight);
 
 	if (_paletteColorCount != 0) {
 		if (!(_game & GF_SIMON2) && _usePaletteDelay) {
@@ -4030,9 +4040,9 @@
 		_dumpFile = stdout;
 
 	// allocate buffers
-	_sdl_buf_3 = (byte *)calloc(320 * 200, 1);
-	_sdl_buf = (byte *)calloc(320 * 200, 1);
-	_sdl_buf_attached = (byte *)calloc(320 * 200, 1);
+	_sdl_buf_3 = (byte *)calloc(_screenWidth * _screenHeight, 1);
+	_sdl_buf = (byte *)calloc(_screenWidth * _screenHeight, 1);
+	_sdl_buf_attached = (byte *)calloc(_screenWidth * _screenHeight, 1);
 
 	allocItemHeap();
 	allocTablesHeap();
@@ -4278,7 +4288,7 @@
 }
 
 byte *SimonEngine::dx_lock_2() {
-	_dxSurfacePitch = 320;
+	_dxSurfacePitch = _screenWidth;
 	return _sdl_buf;
 }
 
@@ -4286,7 +4296,7 @@
 }
 
 byte *SimonEngine::dx_lock_attached() {
-	_dxSurfacePitch = 320;
+	_dxSurfacePitch = _screenWidth;
 	return _dxUse3Or4ForLock ? _sdl_buf_3 : _sdl_buf_attached;
 }
 

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- simon.h	5 Oct 2005 12:16:49 -0000	1.144
+++ simon.h	7 Oct 2005 07:36:09 -0000	1.145
@@ -260,6 +260,8 @@
 	uint16 _videoVar7;
 	volatile uint16 _paletteColorCount;
 
+	uint _screenWidth, _screenHeight;
+
 	byte _videoVar4;
 	bool _videoVar5;
 	bool _videoVar3;

Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- vga.cpp	7 Oct 2005 07:06:21 -0000	1.135
+++ vga.cpp	7 Oct 2005 07:36:09 -0000	1.136
@@ -694,7 +694,7 @@
 	vlut = &_video_windows[_windowNum * 4];
 
 	state.draw_width = width << 1;	/* cl */
-	state.draw_height = height;		/* ch */
+	state.draw_height = height;	/* ch */
 
 	state.x_skip = 0;							/* colums to skip = bh */
 	state.y_skip = 0;							/* rows to skip   = bl */
@@ -825,7 +825,7 @@
 				h = state.draw_height;
 				do {
 					memcpy(dst, src, state.draw_width);
-					dst += 320;
+					dst += _screenWidth;
 					src += width * 16;
 				} while (--h);
 			} else {
@@ -835,7 +835,7 @@
 					for (i = 0; i != state.draw_width; i++)
 						if (src[i])
 							dst[i] = src[i];
-					dst += 320;
+					dst += _screenWidth;
 					src += width * 16;
 				} while (--h);
 			}
@@ -871,7 +871,7 @@
 						dst += 8;
 						src += 5;
 					} while (--count);
-					dst_org += 320;
+					dst_org += _screenWidth;
 				} while (--state.draw_height);
 			} else {
 				/* transparency */
@@ -914,7 +914,7 @@
 						dst += 8;
 						src += 5;
 					} while (--count);
-					dst_org += 320;
+					dst_org += _screenWidth;
 				} while (--state.draw_height);
 			}
 		}
@@ -946,7 +946,7 @@
 					do {
 						dst[0] = (*src >> 4) | state.palette;
 						dst[1] = (*src & 15) | state.palette;
-						dst += 320;
+						dst += _screenWidth;
 						src++;
 					} while (++h != state.draw_height);
 					dst_org += 2;
@@ -971,7 +971,7 @@
 						color = (*src & 15);
 						if (color)
 							dst[1] = color | state.palette;
-						dst += 320;
+						dst += _screenWidth;
 						src++;
 					} while (++h != state.draw_height);
 					dst_org += 2;
@@ -992,7 +992,7 @@
 						dst[count * 2] = (src[count + state.x_skip] >> 4) | state.palette;
 						dst[count * 2 + 1] = (src[count + state.x_skip] & 15) | state.palette;
 					}
-					dst += 320;
+					dst += _screenWidth;
 					src += width * 8;
 				} while (--state.draw_height);
 			} else {
@@ -1006,7 +1006,7 @@
 						if (color)
 							dst[count * 2 + 1] = color | state.palette;
 					}
-					dst += 320;
+					dst += _screenWidth;
 					src += width * 8;
 				} while (--state.draw_height);
 





More information about the Scummvm-git-logs mailing list