aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorStrangerke2012-05-23 07:57:16 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commit8c7395b947f8b729d29c01637d97540a5f955129 (patch)
tree681efaaa164ce6f24c7bab988a381d968aa0bbb1 /engines/lilliput
parentc8589eb488d20f893481fd7c8e4f4d9fa82bec72 (diff)
downloadscummvm-rg350-8c7395b947f8b729d29c01637d97540a5f955129.tar.gz
scummvm-rg350-8c7395b947f8b729d29c01637d97540a5f955129.tar.bz2
scummvm-rg350-8c7395b947f8b729d29c01637d97540a5f955129.zip
LILLIPUT: Some renaming
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/lilliput.cpp27
-rw-r--r--engines/lilliput/lilliput.h2
-rw-r--r--engines/lilliput/script.cpp12
3 files changed, 22 insertions, 19 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 7ed864aa34..8ab326ea21 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -1098,29 +1098,32 @@ void LilliputEngine::sub16CA0() {
}
}
-void LilliputEngine::displayCharacterStatBar(int8 var1, int16 var2, int8 var3, int16 var4) {
- debugC(2, kDebugEngineTBC, "displayCharacterStatBar(%d, %d, %d, %d)", var1, var2, var3, var4);
+void LilliputEngine::displayCharacterStatBar(int8 type, int16 averagePosX, int8 score, int16 posY) {
+ debugC(2, kDebugEngine, "displayCharacterStatBar(%d, %d, %d, %d)", type, averagePosX, score, posY);
restoreSurfaceUnderMousePointer();
- if (var1 == 45) {
- var2 += 35;
- var3 -= 35;
+ int16 posX = averagePosX;
- if (var3 < 0) {
- var2 += var3;
- var3 = -var3;
+ // If var equals 45 ('-'), score bar from -x to +x. If not (usually 43 '+'), score bar from 0 to x.
+ if (type == 45) {
+ posX += 35;
+ score -= 35;
+
+ if (score < 0) {
+ posX += score;
+ score = -score;
}
}
byte *vgaBuf = (byte *)_mainSurface->getPixels();
- int vgaIndex = var2 + (320 * var4);
+ int vgaIndex = posX + (320 * posY);
- if (var3 == 0)
- ++var3;
+ if (score == 0)
+ ++score;
for (int i = 0; i < 4; i++) {
- for (int j = 0; j < var3; j++) {
+ for (int j = 0; j < score; j++) {
vgaBuf[vgaIndex + j] = 2;
}
vgaIndex += 320;
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 3860d513c3..5bcc229db6 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -241,7 +241,7 @@ public:
void prepareGameArea();
void displayRefreshScreen();
void restoreSurfaceSpeech();
- void displayCharacterStatBar(int8 var1, int16 var2, int8 var3, int16 var4);
+ void displayCharacterStatBar(int8 type, int16 averagePosX, int8 score, int16 posY);
void displayCharacter(int index, Common::Point pos, int flags);
void displayString(byte *buf, Common::Point pos);
void displayChar(int index, int var1);
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 77063f826a..a6dd51c31a 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -3176,15 +3176,15 @@ void LilliputScript::OC_initGameAreaDisplay() {
}
void LilliputScript::OC_displayCharacterStatBar() {
- debugC(1, kDebugScriptTBC, "OC_displayCharacterStatBar()");
+ debugC(1, kDebugScript, "OC_displayCharacterStatBar()");
byte *tmpArr = getCharacterVariablePtr();
- int8 var1 = (_currScript->readUint16LE() & 0xFF);
- int8 var3 = (((70 * tmpArr[0]) / (_currScript->readUint16LE() & 0xFF)) & 0xFF);
- int16 var2 = _currScript->readSint16LE();
- int16 var4 = _currScript->readSint16LE();
+ int8 type = (_currScript->readUint16LE() & 0xFF);
+ int8 score = (((70 * tmpArr[0]) / (_currScript->readUint16LE() & 0xFF)) & 0xFF);
+ int16 posX = _currScript->readSint16LE();
+ int16 posY = _currScript->readSint16LE();
- _vm->displayCharacterStatBar(var1, var2, var3, var4);
+ _vm->displayCharacterStatBar(type, posX, score, posY);
}
void LilliputScript::OC_initSmallAnim() {