aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBendegúz Nagy2016-06-24 10:39:25 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitdad087454c87059736fa69543124c7ac44085085 (patch)
treeaaef47a60ad936c60a4e38fec5dbe30dbc9fc700 /engines
parentc392f7e9772ad2d5a23b6c8407afa0f32ce4ebbc (diff)
downloadscummvm-rg350-dad087454c87059736fa69543124c7ac44085085.tar.gz
scummvm-rg350-dad087454c87059736fa69543124c7ac44085085.tar.bz2
scummvm-rg350-dad087454c87059736fa69543124c7ac44085085.zip
DM: Add missing load display in ChampionMan::drawChampionState
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/champion.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index f1c3c5ee77..ef4257fff9 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -529,11 +529,27 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
}
}
- if (champAttributes & kChampionAttributeLoad) {
- warning("MISSING CODE: whole if branch, many F0052_TEXT_PrintToViewport-s");
-
-
-
+ if ((champAttributes & kChampionAttributeLoad) && isInventoryChamp) {
+ Color loadColor;
+ int16 champMaxLoad = getMaximumLoad(champ);
+ if (champ->_load > champMaxLoad) {
+ loadColor = kColorRed;
+ } else if (((int32)champ->_load) * 8 > ((int32)champMaxLoad) * 5) {
+ loadColor = kColorYellow;
+ } else {
+ loadColor = kColorLightestGray;
+ }
+ _vm->_textMan->printToViewport(104, 132, loadColor, "LOAD ");
+
+ int16 loadTmp = champ->_load / 10;
+ Common::String str = getStringFromInteger(loadTmp, true, 3);
+ str += '.';
+ loadTmp = champ->_load - (loadTmp * 10);
+ str += getStringFromInteger(loadTmp, false, 1);
+ str += '/';
+ loadTmp = (getMaximumLoad(champ) + 5) / 10;
+ str += "KG";
+ _vm->_textMan->printToViewport(148, 132, loadColor, str.c_str());
champAttributes |= kChampionAttributeViewport;
}