aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-11-16 21:53:50 +0100
committerWillem Jan Palenstijn2011-11-16 21:53:50 +0100
commit6c9ad26f1deff4cca56c462f74374c8ff100ac76 (patch)
treea06a3907614728a851e6f9e51ccfb7ca6165b4e0
parent304617db88d50389e2239756abd924378b88d655 (diff)
downloadscummvm-rg350-6c9ad26f1deff4cca56c462f74374c8ff100ac76.tar.gz
scummvm-rg350-6c9ad26f1deff4cca56c462f74374c8ff100ac76.tar.bz2
scummvm-rg350-6c9ad26f1deff4cca56c462f74374c8ff100ac76.zip
DREAMWEB: Comment and clean up twodigitnum
-rw-r--r--engines/dreamweb/stubs.cpp22
-rw-r--r--engines/dreamweb/stubs.h2
2 files changed, 11 insertions, 13 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 01b48438ea..6292882fa2 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2020,21 +2020,19 @@ void DreamGenContext::loadroom() {
getdimension();
}
-void DreamGenContext::twodigitnum(uint8 in1, uint8 in2, uint8 *out1, uint8 *out2) {
- *out1 = in1;
- *out2 = in2;
- while (*out1 >= 10) {
- ++(*out2);
- *out1 -= 10;
- }
- *out1 += in2;
+void DreamGenContext::twodigitnum(uint8 num, uint8 baseChar,
+ uint8 &digit1, uint8 &digit2) {
+ digit1 = baseChar + num/10;
+ digit2 = baseChar + num%10;
}
+// Convert a number between 0 and 99 into its two digits, either
+// ASCII (if cl/basechar == '0'), or raw (if cl/basechar == 0).
void DreamGenContext::twodigitnum() {
- uint8 out1, out2;
- twodigitnum(al, cl, &out1, &out2);
- al = out1;
- ah = out2;
+ uint8 digit1, digit2;
+ twodigitnum(al, cl, digit1, digit2);
+ ah = digit1;
+ al = digit2;
}
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 313c2f2393..dde31936f7 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -272,6 +272,6 @@
void putundermenu();
void textformonk();
void textforend();
- void twodigitnum(uint8 in1, uint8 in2, uint8 *out1, uint8 *out2);
+ void twodigitnum(uint8 num, uint8 baseChar, uint8 &digit1, uint8 &digit2);
void twodigitnum();