aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/avalanche/dropdown2.cpp36
-rw-r--r--engines/avalanche/dropdown2.h2
-rw-r--r--engines/avalanche/gyro2.cpp12
-rw-r--r--engines/avalanche/gyro2.h23
-rw-r--r--engines/avalanche/lucerna2.cpp26
-rw-r--r--engines/avalanche/scrolls2.cpp5
-rw-r--r--engines/avalanche/sequence2.cpp4
-rw-r--r--engines/avalanche/trip6.cpp16
-rw-r--r--engines/avalanche/trip6.h4
9 files changed, 56 insertions, 72 deletions
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 82a5228ed3..f0b1194c67 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -350,11 +350,11 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
ander = 170;
fontType font;
- for (byte fv = 0; fv < z.size(); fv++)
+ for (byte idx = 0; idx < z.size(); idx++)
for (byte ff = 0; ff < 8; ff++) {
- font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander;
+ font[z[idx]][ff] = _vm->_gyro->characters[z[idx]][ff] & ander;
for (byte i = 0; i < 8; i++)
- *(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + fv * 8 + i, y + ff) = lightgray;
+ *(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + idx * 8 + i, y + ff) = lightgray;
}
_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, black);
@@ -363,14 +363,15 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
if (! z.contains(t))
return;
else {
- byte fv;
- for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
+ byte idx = 0;
+ for (; z[idx] != t; idx++)
+ ; // Search for the character in the string.
byte pixel = ander;
for (byte bit = 0; bit < 8; bit++) {
byte pixelBit = (pixel >> bit) & 1;
if (pixelBit)
- *_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = black;
+ *_vm->_graphics->getPixel(x * 8 + idx * 8 + 7 - bit, y + 8) = black;
}
}
@@ -385,26 +386,27 @@ void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
ander = 170;
fontType font;
- for (byte fv = 0; fv < z.size(); fv++)
+ for (byte idx = 0; idx < z.size(); idx++) {
for (byte ff = 0; ff < 8; ff++) {
- font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander; // Set the font.
+ font[z[idx]][ff] = _vm->_gyro->characters[z[idx]][ff] & ander; // Set the font.
// And set the background of the text to black.
for (byte i = 0; i < 8; i++)
- *(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + fv * 8 + i, y + ff) = black;
+ *(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + idx * 8 + i, y + ff) = black;
}
+ }
_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, white);
// Underline the selected character.
if (z.contains(t)) {
- byte fv;
- for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
+ byte idx;
+ for (idx = 0; z[idx] != t; idx++); // Search for the character in the string.
byte pixel = ander;
for (byte bit = 0; bit < 8; bit++) {
byte pixelBit = (pixel >> bit) & 1;
if (pixelBit)
- *_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = white;
+ *_vm->_graphics->getPixel(x * 8 + idx * 8 + 7 - bit, y + 8) = white;
}
}
@@ -422,11 +424,11 @@ void Dropdown::bleep() {
warning("STUB: Dropdown::bleep()");
}
-void Dropdown::parsekey(char r, char re) {
- switch (r) {
+void Dropdown::parsekey(char key1, char key2) {
+ switch (key1) {
case 0:
case 224: {
- switch (re) {
+ switch (key2) {
case 'K':
if (ddm_o.menunum > 1) {
ddm_o.wipe();
@@ -454,7 +456,7 @@ void Dropdown::parsekey(char r, char re) {
ddm_o.movehighlight(1);
break;
default:
- ddm_m.extd(re);
+ ddm_m.extd(key2);
}
}
break;
@@ -463,7 +465,7 @@ void Dropdown::parsekey(char r, char re) {
break;
default: {
if (ddm_o.menunow)
- ddm_o.keystroke(r);
+ ddm_o.keystroke(key1);
}
}
}
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 105b2b8339..3963579356 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -133,7 +133,7 @@ public:
void find_what_you_can_do_with_it();
- void parsekey(char r, char re);
+ void parsekey(char key1, char key2);
void menu_link(); /* DDM menu-bar funcs */
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 1653159937..47f8b72b0d 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -267,12 +267,12 @@ Common::String Gyro::strf(int32 x) {
return q;
}
-void Gyro::newpointer(byte m) {
- if (m == cmp)
+void Gyro::newpointer(byte id) {
+ if (id == cmp)
return;
- cmp = m;
+ cmp = id;
- load_a_mouse(m);
+ load_a_mouse(id);
}
void Gyro::wait() {
@@ -388,8 +388,8 @@ bool Gyro::flagset(char x) {
}
void Gyro::force_numlock() {
- if ((locks & num) > 0)
- locks -= num;
+ if ((locks & numlockCode) > 0)
+ locks -= numlockCode;
}
bool Gyro::pennycheck(uint16 howmuchby) {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 3caa946eb2..971fbbdfc0 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -45,16 +45,10 @@ class AvalancheEngine;
static const char numobjs = 18; /* always preface with a # */
static const int16 maxobjs = 12; /* carry limit */
-static const byte howlong = 1/*8*/; /* 18 ticks. */
-
-static const int16 num = 32; /* Code for Num Lock */
+static const int16 numlockCode = 32; /* Code for Num Lock */
static const int16 mouse_size = 134;
-
-
-typedef void (*proc)();
-
struct postype {
uint16 x, y, datapos;
byte length;
@@ -282,17 +276,6 @@ struct ednahead { /* Edna header */
/* DNA values follow, then footer (which is ignored) */
};
-/* Possible values of edhead.os:
- 1 = DOS 4 = Mac
- 2 = Windows 5 = Amiga
- 3 = OS/2 6 = ST
- 7 = Archimedes */
-
-
-
-
-
-
class Gyro {
public:
static const char *vernum;
@@ -535,7 +518,7 @@ public:
Common::String flags;
Common::String listen;
- uint16 oh, onh, om, h, m, s, s1;
+ uint16 oh, onh, om, hour, minutes, seconds;
Common::String atkey; /* For XTs, set to "alt-". For ATs, set to "f1". */
@@ -612,7 +595,7 @@ public:
Common::String strf(int32 x);
- void newpointer(byte m);
+ void newpointer(byte id);
void wait(); // Makes hourglass.
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 389aa2e23d..7bd4ca57c7 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -61,8 +61,10 @@ Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
void Lucerna::init() {
_vm->_gyro->oh = 17717;
_vm->_gyro->om = 17717;
- if (_vm->_enhanced->atbios) _vm->_gyro->atkey = "f1";
- else _vm->_gyro->atkey = "alt-";
+ if (_vm->_enhanced->atbios)
+ _vm->_gyro->atkey = "f1";
+ else
+ _vm->_gyro->atkey = "alt-";
}
void Lucerna::callverb(byte n) {
@@ -1234,7 +1236,7 @@ void Lucerna::plothands() {
hand(am, brown);
calchand(nh, 14, ah, brown);
- calchand(_vm->_gyro->m * 6, 17, am, brown);
+ calchand(_vm->_gyro->minutes * 6, 17, am, brown);
hand(ah, yellow);
hand(am, yellow);
@@ -1253,26 +1255,26 @@ void Lucerna::clock_lucerna() {
/* ...Clock. */
TimeDate t;
_vm->_system->getTimeAndDate(t);
- _vm->_gyro->h = t.tm_hour;
- _vm->_gyro->m = t.tm_min;
- _vm->_gyro->s = t.tm_sec;
+ _vm->_gyro->hour = t.tm_hour;
+ _vm->_gyro->minutes = t.tm_min;
+ _vm->_gyro->seconds = t.tm_sec;
- nh = (_vm->_gyro->h % 12) * 30 + _vm->_gyro->m / 2;
+ nh = (_vm->_gyro->hour % 12) * 30 + _vm->_gyro->minutes / 2;
- if (_vm->_gyro->oh != _vm->_gyro->h) {
+ if (_vm->_gyro->oh != _vm->_gyro->hour) {
plothands();
chime();
}
- if (_vm->_gyro->om != _vm->_gyro->m)
+ if (_vm->_gyro->om != _vm->_gyro->minutes)
plothands();
- if ((_vm->_gyro->h == 0) && (_vm->_gyro->oh != 0) && (_vm->_gyro->oh != 17717))
+ if ((_vm->_gyro->hour == 0) && (_vm->_gyro->oh != 0) && (_vm->_gyro->oh != 17717))
_vm->_scrolls->display(Common::String("Good morning!") + 13 + 13 + "Yes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!");
- _vm->_gyro->oh = _vm->_gyro->h;
+ _vm->_gyro->oh = _vm->_gyro->hour;
_vm->_gyro->onh = nh;
- _vm->_gyro->om = _vm->_gyro->m;
+ _vm->_gyro->om = _vm->_gyro->minutes;
}
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 65c4faaae0..51d47a9e4d 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -464,7 +464,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
void Scrolls::bubble(func2 gotoit) {
int16 xl, yl, my, xw, yw;
- byte fv;
Common::Point p[3];
// byte *rp1, *rp2; /* replace: 1=bubble, 2=pointer */
int16 xc; /* x correction */
@@ -478,7 +477,7 @@ void Scrolls::bubble(func2 gotoit) {
xl = 0;
yl = _vm->_gyro->scrolln * 5;
- for (int8 fv = 0; fv < _vm->_gyro->scrolln; fv++) {
+ for (byte fv = 0; fv < _vm->_gyro->scrolln; fv++) {
uint16 textWidth = _vm->_gyro->scroll[fv].size() * 8;
if (textWidth > xl)
xl = textWidth;
@@ -527,7 +526,7 @@ void Scrolls::bubble(func2 gotoit) {
// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
// It's almost the same, only notable differences are '?', '!', etc.
- for (fv = 0; fv < _vm->_gyro->scrolln; fv++) {
+ for (byte fv = 0; fv < _vm->_gyro->scrolln; fv++) {
int16 x = xc + _vm->_gyro->talkx - _vm->_gyro->scroll[fv].size() / 2 * 8;
bool offset = _vm->_gyro->scroll[fv].size() % 2;
_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->talkf);
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 68a8ea33e3..d5983c8784 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -45,7 +45,7 @@ Sequence::Sequence(AvalancheEngine *vm) {
void Sequence::first_show(byte what) {
/* First, we need to blank out the entire array. */
- for (int i = 0; i < sizeof(seq); i++)
+ for (uint i = 0; i < sizeof(seq); i++)
seq[i] = 0;
/* Then it's just the same as then_show. */
@@ -54,7 +54,7 @@ void Sequence::first_show(byte what) {
}
void Sequence::then_show(byte what) {
- for (byte fv = 0; fv < seq_length; fv++) {
+ for (int16 fv = 0; fv < seq_length; fv++) {
if (seq[fv] == 0) {
seq[fv] = what;
return;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index e07607a4d5..31ff07b5b7 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -271,10 +271,10 @@ void triptype::bounce() {
_tr->_vm->_gyro->oncandopageswap = true;
}
-int8 triptype::sgn(int16 x) {
- if (x > 0)
+int8 triptype::sgn(int16 val) {
+ if (val > 0)
return 1;
- else if (x < 0)
+ else if (val < 0)
return -1;
else
return 0;
@@ -465,12 +465,10 @@ Trip::Trip(AvalancheEngine *vm) {
}
void Trip::loadtrip() {
- byte gm;
-
- for (gm = 0; gm < numtr; gm++)
+ for (int16 gm = 0; gm < numtr; gm++)
tr[gm].original();
- for (int i = 0; i < sizeof(aa); i++)
+ for (uint16 i = 0; i < sizeof(aa); i++)
aa[i] = 0;
}
@@ -1084,8 +1082,8 @@ void Trip::newspeed() {
}
-void Trip::rwsp(byte t, byte r) {
- switch (r) {
+void Trip::rwsp(byte t, byte dir) {
+ switch (dir) {
case up:
tr[t].speed(0, -tr[t].ys);
break;
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index a4316336cd..1f2b83d009 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -121,7 +121,7 @@ private:
bool collision_check();
- int8 sgn(int16 x);
+ int8 sgn(int16 val);
};
@@ -198,7 +198,7 @@ public:
void tripkey(char dir);
- void rwsp(byte t, byte r);
+ void rwsp(byte t, byte dir);
void apped(byte trn, byte np);