[Scummvm-git-logs] scummvm master -> 09bdd77215bca6000e0c33b1e4fc0c06e3a2c9da

dreammaster noreply at scummvm.org
Mon Jun 5 00:04:13 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
09bdd77215 MM: MM1: Fit combat monster list when all monsters slots are filled


Commit: 09bdd77215bca6000e0c33b1e4fc0c06e3a2c9da
    https://github.com/scummvm/scummvm/commit/09bdd77215bca6000e0c33b1e4fc0c06e3a2c9da
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-06-04T17:03:59-07:00

Commit Message:
MM: MM1: Fit combat monster list when all monsters slots are filled

Changed paths:
    engines/mm/mm1/views_enh/combat.cpp


diff --git a/engines/mm/mm1/views_enh/combat.cpp b/engines/mm/mm1/views_enh/combat.cpp
index d2c61ad7dd1..71824b20fc9 100644
--- a/engines/mm/mm1/views_enh/combat.cpp
+++ b/engines/mm/mm1/views_enh/combat.cpp
@@ -33,6 +33,7 @@ namespace ViewsEnh {
 #define MONSTERS_X 120
 #define BOTTOM_Y 120
 #define LINE_H 8
+#define MONSTER_H 7
 
 Combat::Combat() : ScrollView("Combat") {
 }
@@ -400,7 +401,7 @@ bool Combat::msgMouseUp(const MouseUpMessage &msg) {
 		// Check for entries in the monster list being pressed
 		if (msg._pos.x >= MONSTERS_X && msg._pos.x < 310
 				&& msg._pos.y >= _innerBounds.top && msg._pos.y < 100) {
-			uint monsterNum = (msg._pos.y - _innerBounds.top) / LINE_H;
+			uint monsterNum = (msg._pos.y - _innerBounds.top) / MONSTER_H;
 			if (monsterNum < _remainingMonsters.size()) {
 				char c = 'a' + monsterNum;
 				msgKeypress(KeypressMessage(Common::KeyState(
@@ -640,16 +641,16 @@ void Combat::writeMonsters() {
 	clearArea(Common::Rect(MONSTERS_X, 0, 320, 100));
 
 	for (int i = 0; i < (int)_remainingMonsters.size(); ++i) {
-		writeString(MONSTERS_X, i * LINE_H, (i < _attackersCount) ? "+" : " ");
+		writeString(MONSTERS_X, i * MONSTER_H, (i < _attackersCount) ? "+" : " ");
 
 		unsigned char c = 'A' + i;
 		if ((i == _activeMonsterNum) && (_mode == MONSTER_ADVANCES ||
 			_mode == MONSTER_ATTACK || _mode == MONSTER_SPELL))
 			c |= 0x80;
 		mStr.setChar(c, 0);
-		writeString(MONSTERS_X + 16, i * LINE_H, mStr, ALIGN_RIGHT);
+		writeString(MONSTERS_X + 16, i * MONSTER_H, mStr, ALIGN_RIGHT);
 
-		writeString(MONSTERS_X + 22, i * LINE_H, _remainingMonsters[i]->_name);
+		writeString(MONSTERS_X + 22, i * MONSTER_H, _remainingMonsters[i]->_name);
 		writeMonsterStatus(i);
 	}
 }




More information about the Scummvm-git-logs mailing list