[Scummvm-cvs-logs] SF.net SVN: scummvm:[54880] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Sun Dec 12 08:40:01 CET 2010


Revision: 54880
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54880&view=rev
Author:   strangerke
Date:     2010-12-12 07:40:00 +0000 (Sun, 12 Dec 2010)

Log Message:
-----------
HUGO: Fix "mouse" bug in H3 Dos, TPS tuning

- Fix "mouse" bug in H3 DOS. Game is still not completable
- Use variable normal TPS, as it was slightly different in
some DOS versions

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/game.h
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/hugo.h
    scummvm/trunk/engines/hugo/object_v1d.cpp
    scummvm/trunk/engines/hugo/object_v1w.cpp
    scummvm/trunk/engines/hugo/object_v2d.cpp
    scummvm/trunk/engines/hugo/object_v3d.cpp
    scummvm/trunk/engines/hugo/parser.cpp
    scummvm/trunk/engines/hugo/schedule.cpp

Modified: scummvm/trunk/engines/hugo/game.h
===================================================================
--- scummvm/trunk/engines/hugo/game.h	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/game.h	2010-12-12 07:40:00 UTC (rev 54880)
@@ -56,7 +56,6 @@
 
 // Game specific equates
 #define MAX_TUNES      16                           // Max number of tunes
-#define NORMAL_TPS     9                            // Number of ticks (frames) per second
 #define TURBO_TPS      16                           // This many in turbo mode
 #define DX             5                            // Num pixels moved in x by HERO per step
 #define DY             4                            // Num pixels moved in y by HERO per step
@@ -99,9 +98,6 @@
 #define DROP           4
 #define LOOK_S         8                            // Description depends on state of object
 
-// Macros:
-#define TPS           ((_config.turboFl) ? TURBO_TPS : NORMAL_TPS)
-
 #define NUM_COLORS  16                              // Num colors to save in palette
 #define MAX_UIFS   32                               // Max possible uif items in hdr
 #define NUM_FONTS  3                                // Number of dib fonts

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2010-12-12 07:40:00 UTC (rev 54880)
@@ -203,6 +203,7 @@
 		_screen = new Screen_v1w(this);
 		_parser = new Parser_v1w(this);
 		_object = new ObjectHandler_v1w(this);
+		_normalTPS = 9;
 		break;
 	case 1:
 		_file = new FileManager_v2d(this);
@@ -211,6 +212,7 @@
 		_screen = new Screen_v1w(this);
 		_parser = new Parser_v1w(this);
 		_object = new ObjectHandler_v1w(this);
+		_normalTPS = 9;
 		break;
 	case 2:
 		_file = new FileManager_v2d(this);
@@ -219,6 +221,7 @@
 		_screen = new Screen_v1w(this);
 		_parser = new Parser_v1w(this);
 		_object = new ObjectHandler_v1w(this);
+		_normalTPS = 9;
 		break;
 	case 3: // H1 DOS
 		_file = new FileManager_v1d(this);
@@ -227,6 +230,7 @@
 		_screen = new Screen_v1d(this);
 		_parser = new Parser_v1d(this);
 		_object = new ObjectHandler_v1d(this);
+		_normalTPS = 8;
 		break;
 	case 4:
 		_file = new FileManager_v2d(this);
@@ -235,6 +239,7 @@
 		_screen = new Screen_v1d(this);
 		_parser = new Parser_v2d(this);
 		_object = new ObjectHandler_v2d(this);
+		_normalTPS = 8;
 		break;
 	case 5:
 		_file = new FileManager_v3d(this);
@@ -242,7 +247,8 @@
 		_intro = new intro_v3d(this);
 		_screen = new Screen_v1d(this);
 		_parser = new Parser_v3d(this);
-		_object = new ObjectHandler_v1d(this);
+		_object = new ObjectHandler_v3d(this);
+		_normalTPS = 9;
 		break;
 	}
 
@@ -335,7 +341,7 @@
 		return;
 
 	// Process machine once every tick
-	if (g_system->getMillis() - lastTime < (uint32)(1000 / TPS))
+	if (g_system->getMillis() - lastTime < (uint32)(1000 / getTPS()))
 		return;
 	lastTime = g_system->getMillis();
 
@@ -1267,4 +1273,7 @@
 	return (_status.viewState == V_PLAY);
 }
 
+int8 HugoEngine::getTPS() {
+	return ((_config.turboFl) ? TURBO_TPS : _normalTPS);
+}
 } // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/hugo.h	2010-12-12 07:40:00 UTC (rev 54880)
@@ -127,7 +127,10 @@
 	int8   _soundTest;
 	int8   _tunesNbr;
 	uint16 _numScreens;
+	int8   _normalTPS;                              // Number of ticks (frames) per second. 
+	                                                //8 for Win versions, 9 for DOS versions
 
+
 	object_t *_hero;
 	byte  *_screen_p;
 	byte  _heroImage;
@@ -198,6 +201,8 @@
 	int  deltaX(int x1, int x2, int vx, int y);
 	int  deltaY(int x1, int x2, int vy, int y);
 
+	int8 getTPS();
+
 	void initGame(const HugoGameDescription *gd);
 	void initGamePart(const HugoGameDescription *gd);
 	void boundaryCollision(object_t *obj);

Modified: scummvm/trunk/engines/hugo/object_v1d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v1d.cpp	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/object_v1d.cpp	2010-12-12 07:40:00 UTC (rev 54880)
@@ -236,7 +236,7 @@
 				break;
 				}
 			case WANDER:
-				if (!_vm->_rnd->getRandomNumber(3 * NORMAL_TPS)) {       // Kick on random interval
+				if (!_vm->_rnd->getRandomNumber(3 * _vm->_normalTPS)) {       // Kick on random interval
 					obj->vx = _vm->_rnd->getRandomNumber(obj->vxPath << 1) - obj->vxPath;
 					obj->vy = _vm->_rnd->getRandomNumber(obj->vyPath << 1) - obj->vyPath;
 

Modified: scummvm/trunk/engines/hugo/object_v1w.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v1w.cpp	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/object_v1w.cpp	2010-12-12 07:40:00 UTC (rev 54880)
@@ -247,7 +247,7 @@
 				}
 			case WANDER2:
 			case WANDER:
-				if (!_vm->_rnd->getRandomNumber(3 * NORMAL_TPS)) {       // Kick on random interval
+				if (!_vm->_rnd->getRandomNumber(3 * _vm->_normalTPS)) {       // Kick on random interval
 					obj->vx = _vm->_rnd->getRandomNumber(obj->vxPath << 1) - obj->vxPath;
 					obj->vy = _vm->_rnd->getRandomNumber(obj->vyPath << 1) - obj->vyPath;
 

Modified: scummvm/trunk/engines/hugo/object_v2d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v2d.cpp	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/object_v2d.cpp	2010-12-12 07:40:00 UTC (rev 54880)
@@ -250,7 +250,7 @@
 				}
 			case WANDER2:
 			case WANDER:
-				if (!_vm->_rnd->getRandomNumber(3 * NORMAL_TPS)) {       // Kick on random interval
+				if (!_vm->_rnd->getRandomNumber(3 * _vm->_normalTPS)) {       // Kick on random interval
 					obj->vx = _vm->_rnd->getRandomNumber(obj->vxPath << 1) - obj->vxPath;
 					obj->vy = _vm->_rnd->getRandomNumber(obj->vyPath << 1) - obj->vyPath;
 

Modified: scummvm/trunk/engines/hugo/object_v3d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v3d.cpp	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/object_v3d.cpp	2010-12-12 07:40:00 UTC (rev 54880)
@@ -131,7 +131,7 @@
 				}
 			case WANDER2:
 			case WANDER:
-				if (!_vm->_rnd->getRandomNumber(3 * NORMAL_TPS)) {       // Kick on random interval
+				if (!_vm->_rnd->getRandomNumber(3 * _vm->_normalTPS)) {       // Kick on random interval
 					obj->vx = _vm->_rnd->getRandomNumber(obj->vxPath << 1) - obj->vxPath;
 					obj->vy = _vm->_rnd->getRandomNumber(obj->vyPath << 1) - obj->vyPath;
 

Modified: scummvm/trunk/engines/hugo/parser.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser.cpp	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/parser.cpp	2010-12-12 07:40:00 UTC (rev 54880)
@@ -175,7 +175,7 @@
 	}
 
 	// See if time to blink cursor, set cursor character
-	if ((tick++ % (TPS / BLINKS)) == 0)
+	if ((tick++ % (_vm->getTPS() / BLINKS)) == 0)
 		cursor = (cursor == '_') ? ' ' : '_';
 
 	// See if recall button pressed

Modified: scummvm/trunk/engines/hugo/schedule.cpp
===================================================================
--- scummvm/trunk/engines/hugo/schedule.cpp	2010-12-12 07:17:13 UTC (rev 54879)
+++ scummvm/trunk/engines/hugo/schedule.cpp	2010-12-12 07:40:00 UTC (rev 54880)
@@ -134,9 +134,9 @@
 		return(tick);
 
 	if (t_old == 0) 
-		t_old = (uint32) floor((double) (g_system->getMillis() * TPS / 1000));
+		t_old = (uint32) floor((double) (g_system->getMillis() * _vm->getTPS() / 1000));
 	/* Calculate current wall time in ticks */
-	t_now = g_system->getMillis() * TPS / 1000	;
+	t_now = g_system->getMillis() * _vm->getTPS() / 1000	;
 
 	if ((t_now - t_old) > 0) {
 		t_old = t_now;


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