[Scummvm-cvs-logs] SF.net SVN: scummvm: [28941] scummvm/trunk/engines/agi

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Sep 18 19:01:45 CEST 2007


Revision: 28941
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28941&view=rev
Author:   sev
Date:     2007-09-18 10:01:45 -0700 (Tue, 18 Sep 2007)

Log Message:
-----------
Fix menu and tutorial it Troll's Tale

Modified Paths:
--------------
    scummvm/trunk/engines/agi/preagi.h
    scummvm/trunk/engines/agi/preagi_common.cpp
    scummvm/trunk/engines/agi/preagi_troll.cpp
    scummvm/trunk/engines/agi/preagi_troll.h

Modified: scummvm/trunk/engines/agi/preagi.h
===================================================================
--- scummvm/trunk/engines/agi/preagi.h	2007-09-18 16:46:32 UTC (rev 28940)
+++ scummvm/trunk/engines/agi/preagi.h	2007-09-18 17:01:45 UTC (rev 28941)
@@ -68,8 +68,9 @@
 	Common::String getTargetName() { return _targetName; }
 
 	// Screen
-	void clearScreen(int attr);
+	void clearScreen(int attr, bool overrideDefault = true);
 	void clearGfxScreen(int attr);
+	void setDefaultTextColor(int attr) { _defaultColor = attr; }
 
 	// Keyboard
 	int getSelection(SelectionTypes type);

Modified: scummvm/trunk/engines/agi/preagi_common.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_common.cpp	2007-09-18 16:46:32 UTC (rev 28940)
+++ scummvm/trunk/engines/agi/preagi_common.cpp	2007-09-18 17:01:45 UTC (rev 28941)
@@ -36,8 +36,9 @@
 namespace Agi {
 
 // Screen functions
-void PreAgiEngine::clearScreen(int attr) {
-	_defaultColor = attr;
+void PreAgiEngine::clearScreen(int attr, bool overrideDefault) {
+	if (overrideDefault)
+		_defaultColor = attr;
 
 	_gfx->clearScreen((attr & 0xF0) / 0x10); 
 }
@@ -85,7 +86,12 @@
 }
 
 void PreAgiEngine::clearTextArea() {
-	for (int row = IDI_MAX_ROW_PIC; row < 200 / 8; row++) {
+	int start = IDI_MAX_ROW_PIC;
+
+	if (getGameID() == GID_TROLL)
+		start = 21;
+
+	for (int row = start; row < 200 / 8; row++) {
 		clearRow(row);		
 	}
 }
@@ -126,7 +132,7 @@
 			case Common::EVENT_QUIT:
 				_system->quit();
 			case Common::EVENT_LBUTTONUP:
-				if (type == 0)
+				if (type == kSelYesNo)
 					return 1;
 			case Common::EVENT_RBUTTONUP:
 				return 0;
@@ -158,7 +164,7 @@
 				default:
 					if (type == kSelYesNo) {
 						return 2;
-					} else {
+					} else if (type == kSelNumber) {
 						return 10;
 					}
 				}

Modified: scummvm/trunk/engines/agi/preagi_troll.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_troll.cpp	2007-09-18 16:46:32 UTC (rev 28940)
+++ scummvm/trunk/engines/agi/preagi_troll.cpp	2007-09-18 17:01:45 UTC (rev 28941)
@@ -47,8 +47,8 @@
 
 void Troll::drawMenu(const char *szMenu, int iSel) {
 	_vm->clearTextArea();
-	_vm->drawStr(20, 0, kColorDefault, szMenu);
-	_vm->drawStr(21 + iSel, 0, kColorDefault, " *");
+	_vm->drawStr(21, 0, kColorDefault, szMenu);
+	_vm->drawStr(22 + iSel, 0, kColorDefault, " *");
 	_vm->_gfx->doUpdate();
 }
 
@@ -66,8 +66,9 @@
 			case Common::EVENT_MOUSEMOVE:
 				y = event.mouse.y / 8;
 
-				if (nSel > y - 21)
-					*iSel = y - 21;
+				if (y >= 22)
+					if (nSel > y - 22)
+						*iSel = y - 22;
 
 				drawMenu(szMenu, *iSel);
 				break;
@@ -239,20 +240,24 @@
 	//char szTreasure[16] = {0};
 
 	for (;;) {
-		//SetGfxMode();
+		_vm->clearScreen(0xFF);
+
 		_vm->printStr(IDS_TRO_TUTORIAL_0);
 		_vm->getSelection(kSelSpace);
 		
+		_vm->clearScreen(0x55);
+		_vm->setDefaultTextColor(0x0F);
+
 		done = false;
 		while (!done) {
 			getMenuSel(IDS_TRO_TUTORIAL_1, &iSel, IDI_TRO_MAX_OPTION);
 			switch(iSel) {
 			case IDI_TRO_SEL_OPTION_1:
-				_vm->clearGfxScreen(0x0B);
+				_vm->clearScreen(0x22, false);
 				_vm->_gfx->doUpdate();
 				break;
 			case IDI_TRO_SEL_OPTION_2:
-				_vm->clearGfxScreen(0x00);
+				_vm->clearScreen(0x00, false);
 				_vm->_gfx->doUpdate();
 				break;
 			case IDI_TRO_SEL_OPTION_3:

Modified: scummvm/trunk/engines/agi/preagi_troll.h
===================================================================
--- scummvm/trunk/engines/agi/preagi_troll.h	2007-09-18 16:46:32 UTC (rev 28940)
+++ scummvm/trunk/engines/agi/preagi_troll.h	2007-09-18 17:01:45 UTC (rev 28941)
@@ -115,6 +115,8 @@
 #define IDI_TRO_SEL_OPTION_2	1
 #define IDI_TRO_SEL_OPTION_3	2
 
+#define IDI_TRO_MAX_ROW_PIC	21
+
 // offsets
 
 #define IDA_TRO_BINNAME "troll.exe"


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