From 666d3eecfcbb038d6b1b33f231c3a03bcbd726b4 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 10:14:12 +0200 Subject: AVALANCHE: Replace some British terms by American ones --- engines/avalanche/celer2.cpp | 6 +++--- engines/avalanche/dropdown2.cpp | 2 +- engines/avalanche/dropdown2.h | 2 +- engines/avalanche/graphics.cpp | 2 +- engines/avalanche/graphics.h | 2 +- engines/avalanche/lucerna2.cpp | 2 +- engines/avalanche/lucerna2.h | 2 +- engines/avalanche/scrolls2.cpp | 2 +- engines/avalanche/trip6.cpp | 2 +- engines/avalanche/trip6.h | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index ababd4a86d..2d16dc6de9 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -289,9 +289,9 @@ void Celer::loadBackgroundSprites(byte number) { sprite._yl = f.readSint16LE(); sprite._size = f.readSint32LE(); bool natural = f.readByte(); - bool memorise = f.readByte(); + bool memorize = f.readByte(); - if (memorise) { + if (memorize) { _sprites[i]._x = sprite._x; _sprites[i]._xl = sprite._xl; _sprites[i]._y = sprite._y; @@ -349,7 +349,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) { sprite._xl = f.readSint16LE(); sprite._yl = f.readSint16LE(); sprite._size = f.readSint32LE(); - f.skip(2); // For the now not existing natural and memorise data members of the SpriteType (called chunkblocktype in the original). + f.skip(2); // For the now not existing natural and memorize data members of the SpriteType (called chunkblocktype in the original). sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1); if (destX < 0) { diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp index 4ef65046cc..064af299dc 100644 --- a/engines/avalanche/dropdown2.cpp +++ b/engines/avalanche/dropdown2.cpp @@ -25,7 +25,7 @@ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. */ - /* DROPDOWN A customised version of Oopmenu (qv). */ + /* DROPDOWN A customized version of Oopmenu (qv). */ #include "avalanche/avalanche.h" diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h index f0f3917457..7b8f972330 100644 --- a/engines/avalanche/dropdown2.h +++ b/engines/avalanche/dropdown2.h @@ -25,7 +25,7 @@ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. */ -/* DROPDOWN A customised version of Oopmenu (qv). */ +/* DROPDOWN A customized version of Oopmenu (qv). */ #ifndef DROPDOWN2_H #define DROPDOWN2_H diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index b6dbe16c61..eaf547c018 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -77,7 +77,7 @@ Graphics::~Graphics() { } -void Graphics::flesh_colours() +void Graphics::flesh_colors() { g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1); g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1); diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index ca28772156..7f27186bac 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -84,7 +84,7 @@ public: ~Graphics(); - void flesh_colours(); + void flesh_colors(); byte *getPixel(int16 x, int16 y); diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 2b4c5fe363..8b278f05fc 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -219,7 +219,7 @@ void Lucerna::load(byte n) { /* Load2, actually */ CursorMan.showMouse(false); - _vm->_graphics->flesh_colours(); + _vm->_graphics->flesh_colors(); xx = _vm->_gyro->strf(n); Common::String filename; diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h index 8c497212b4..db9e43191f 100644 --- a/engines/avalanche/lucerna2.h +++ b/engines/avalanche/lucerna2.h @@ -102,7 +102,7 @@ public: uint16 bearing(byte whichped); // Returns the bearing from ped Whichped to Avvy, in degrees. - void flesh_colours(); + void flesh_colors(); void sprite_run(); diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 300d275346..6c1ef73d93 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -736,7 +736,7 @@ void Scrolls::calldrivers() { _vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->quasipeds[param - 10].whichped - 1].y; // Position. _vm->_gyro->talkf = _vm->_gyro->quasipeds[param - 10].fgc; - _vm->_gyro->talkb = _vm->_gyro->quasipeds[param - 10].bgc; // Colours. + _vm->_gyro->talkb = _vm->_gyro->quasipeds[param - 10].bgc; // Colors. } else { _vm->_lucerna->errorled(); // Not valid. natural(); diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index dc45c6c2d7..7e444dc1ee 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -447,7 +447,7 @@ triptype *triptype::done() { getsettype *getsettype::init() { - numleft = 0; /* initialise array pointer */ + numleft = 0; /* initialize array pointer */ return this; } diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h index cc13c9bf75..f91e72c2f3 100644 --- a/engines/avalanche/trip6.h +++ b/engines/avalanche/trip6.h @@ -44,7 +44,7 @@ struct adxtype { /* Second revision of ADX type */ Common::String comment/*[17]*/; /* comment */ // uruk: Same here, but 16. byte num; /* number of pictures */ byte seq; /* how many in one stride */ - byte fgc, bgc; /* foreground & background bubble colours */ + byte fgc, bgc; /* foreground & background bubble colors */ byte accinum; /* the number according to Acci (1=Avvy, etc.) */ }; -- cgit v1.2.3 From 543c4f59daabaf13a52f451d245adb44f391971c Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 10:43:51 +0200 Subject: AVALANCHE: Remove logger --- engines/avalanche/acci2.cpp | 1 - engines/avalanche/avalanche.cpp | 2 - engines/avalanche/avalanche.h | 2 - engines/avalanche/avalot.cpp | 1 - engines/avalanche/gyro2.h | 2 +- engines/avalanche/logger2.cpp | 289 ---------------------------------------- engines/avalanche/logger2.h | 92 ------------- engines/avalanche/lucerna2.cpp | 4 - engines/avalanche/module.mk | 1 - engines/avalanche/parser.cpp | 2 - engines/avalanche/scrolls2.cpp | 16 --- 11 files changed, 1 insertion(+), 411 deletions(-) delete mode 100644 engines/avalanche/logger2.cpp delete mode 100644 engines/avalanche/logger2.h diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 72653b276d..2d532bb570 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -1603,7 +1603,6 @@ void Acci::doThat() { _vm->_gyro->dna.playednim++; // You won - strange! - _vm->_logger->log_aside("You won."); _vm->_visa->dixi('Q', 7); // You won! Give us a lute! _vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = true; _vm->_lucerna->objectlist(); diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 68272c8c88..3d8ba61a38 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -66,7 +66,6 @@ AvalancheEngine::~AvalancheEngine() { delete _avalot; delete _gyro; delete _enhanced; - delete _logger; delete _pingo; delete _scrolls; delete _visa; @@ -88,7 +87,6 @@ Common::ErrorCode AvalancheEngine::initialize() { _avalot = new Avalot(this); _gyro = new Gyro(this); _enhanced = new Enhanced(this); - _logger = new Logger(this); _pingo = new Pingo(this); _scrolls = new Scrolls(this); _visa = new Visa(this); diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 3ef5bcf935..63f654f550 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -36,7 +36,6 @@ #include "avalanche/avalot.h" #include "avalanche/gyro2.h" #include "avalanche/enhanced2.h" -#include "avalanche/logger2.h" #include "avalanche/pingo2.h" #include "avalanche/scrolls2.h" #include "avalanche/visa2.h" @@ -77,7 +76,6 @@ public: Avalot *_avalot; Gyro *_gyro; Enhanced *_enhanced; - Logger *_logger; Pingo *_pingo; Scrolls *_scrolls; Visa *_visa; diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index e7a7a49fb1..c791a77ed6 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -38,7 +38,6 @@ #include "avalanche/scrolls2.h" #include "avalanche/dropdown2.h" #include "avalanche/pingo2.h" -#include "avalanche/logger2.h" #include "avalanche/timeout2.h" #include "avalanche/celer2.h" #include "avalanche/enid2.h" diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index 967034a7ed..3caa946eb2 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -559,7 +559,7 @@ public: Common::String roomname; /* Name of this room */ //text logfile; // http://wiki.freepascal.org/Text - bool logging, log_epson; + bool log_epson; bool cl_override; diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp deleted file mode 100644 index 24c6d55fe9..0000000000 --- a/engines/avalanche/logger2.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * This code is based on the original source code of Lord Avalot d'Argent version 1.3. - * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. - */ - -/* LOGGER Handles the logging. */ - -#include "avalanche/avalanche.h" - -#include "avalanche/logger2.h" -#include "avalanche/gyro2.h" -#include "avalanche/trip6.h" - -#include "common/textconsole.h" - -namespace Avalanche { -const char Logger::divide[] = "--- oOo ---"; - -/* Epson codes: - - startwith=''; - endwith=''; - double_width = #14; { shift out (SO) } - double_off = #20; { device control 4 (DC4) } - italic = #27+'4'; { switches italics on... } - italic_off = #27+'5'; { and off. } - emph_on = #27+#69; - emph_off = #27+#70; - divide_indent = 15; - -*/ - -/* L'jet codes: */ - -// Not sure if these will be needed at all... - -const Common::String startwith = Common::String(33) + 50 + "10J" + 130; -const Common::String endwith = Common::String(33) + 105; -const Common::String italic = Common::String(33) + 50 + 163 + 61 + 123; /* switches italics on... */ -const Common::String italic_off = Common::String(33) + 50 + 163 + 60 + 123; /* and off. */ -const Common::String emph_on = Common::String(33) + 50 + 163 + 63 + 102; -const Common::String emph_off = Common::String(33) + 50 + 163 + 60 + 102; - -const Common::String double_width = emph_on; /* There IS no double-width. */ -const Common::String double_off = emph_off; /* So we'll have to use bold. */ - - - -const Common::String Logger::quote = "ª"; -const Common::String Logger::unquote = "º"; -const Common::String Logger::copyright = "(c)"; -const int16 Logger::divide_indent = 30; - - - -Logger::Logger(AvalancheEngine *vm) { - _vm = vm; -} - -void Logger::centre(byte size, byte x) { /* Prints req'd number of spaces. */ - byte fv; - - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::centre()"); - /*for (fv = 1; fv <= size - (x / 2); fv++) - output << logfile << ' ';*/ -} - -void Logger::log_setup(Common::String name, bool printing) { /* Sets up. */ - - warning("STUB: Logger::log_setup()"); - - /* assign(logfile, name); - rewrite(logfile); - output << logfile << startwith; - log_epson = printing; - logging = true; - - if (!printing) { - quote = '"'; - unquote = '"'; - copyright = "(c)"; - }*/ -} - -void Logger::log_divider() { /* Prints the divider sign. */ - byte fv; - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::log_divider()"); - - /* - if (_vm->_gyro->log_epson) { - output << logfile << Common::String(' ') + double_width; - for (fv = 1; fv <= divide_indent; fv++) - output << logfile << ' '; - output << logfile << Common::String(' ') + double_off; - } else { - for (fv = 1; fv <= 36; fv++) - output << logfile << ' '; - } - output << logfile << divide << NL; - */ -} - -void Logger::log_command(Common::String x) { /* Prints a command */ - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::log_command()"); - - /*if (_vm->_gyro->log_epson) - output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL; - else - output << logfile << Common::String("> ") + x << NL;*/ -} - -void Logger::log_addstuff(Common::String x) { - if (!_vm->_gyro->logging) - return; - - scroll_line += x; -} - -void Logger::log_scrollchar(Common::String x) { /* print one character */ - Common::String z; - if (!_vm->_gyro->logging) - return; - - switch (x[0]) { - case '\'': - z = quote; - break; /* Open quotes: "66" */ - case '\"': - z = unquote; - break; /* Close quotes: "99" */ - case 239: - z = copyright; - break; /* Copyright sign. */ - default: - z = x; - } - log_addstuff(z); - scroll_line_length += z.size(); -} - -void Logger::log_italic() { - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::log_italic()"); - - /*if (_vm->_gyro->log_epson) - log_addstuff(italic); - else - log_addstuff("*");*/ -} - -void Logger::log_roman() { - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::log_roman()"); - - /* if (_vm->_gyro->log_epson) - log_addstuff(italic_off); - else - log_addstuff("*");*/ -} - -void Logger::log_epsonroman() { /* This only sends the Roman code if you're on Epson.*/ - if (!_vm->_gyro->logging) - return; - - if (_vm->_gyro->log_epson) - log_addstuff(italic_off); -} - -void Logger::log_scrollline() { /* Set up a line for the scroll driver */ - scroll_line_length = 0; - scroll_line = ""; -} - -void Logger::log_scrollendline(bool centred) { - byte x, fv; - if (!_vm->_gyro->logging) - return; - x = 17; - if (centred) - x += (50 - scroll_line_length) / 2; - - warning("STUB: Logger::log_scrollendline()"); - - /*for (fv = 1; fv <= x; fv++) - output << logfile << ' '; - output << logfile << scroll_line << NL;*/ -} - -void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) { - byte fv; - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::log_bubbleline()"); - - /*if (linenum == 1) { - for (fv = 1; fv <= 15; fv++) - output << logfile << ' '; - output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL; - } else { - for (fv = 1; fv <= 17; fv++) - output << logfile << ' '; - output << logfile << x << NL; - }*/ -} - -void Logger::log_newline() { - warning("STUB: Logger::log_newline()"); - - //if (_vm->_gyro->logging) - // output << logfile << NL; -} - -void Logger::log_newroom(Common::String where) { - byte fv; - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::log_newroom()"); - - /*for (fv = 1; fv <= 20; fv++) - output << logfile << ' '; - if (_vm->_gyro->log_epson) - output << logfile << emph_on; - output << logfile << Common::String('(') + where + ')'; - if (_vm->_gyro->log_epson) - output << logfile << emph_off; - output << logfile << NL;*/ -} - -void Logger::log_aside(Common::String what) { -/* This writes "asides" to the printer. For example, moves in Nim. */ - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::log_aside()"); - - //output << logfile << " (" << italic << what << italic_off << ')' << NL; - /* "What" is what to write. */ -} - -void Logger::log_score(uint16 credit, uint16 now) { - byte fv; - if (!_vm->_gyro->logging) - return; - - warning("STUB: Logger::log_score()"); - - /*for (fv = 1; fv <= 50; fv++) - output << logfile << ' '; - output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;*/ -} - -} // End of namespace Avalanche diff --git a/engines/avalanche/logger2.h b/engines/avalanche/logger2.h deleted file mode 100644 index 95e5ea849d..0000000000 --- a/engines/avalanche/logger2.h +++ /dev/null @@ -1,92 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * This code is based on the original source code of Lord Avalot d'Argent version 1.3. - * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. - */ - -/* LOGGER Handles the logging. */ - -#ifndef LOGGER2_H -#define LOGGER2_H - -#include "common/scummsys.h" -#include "common/str.h" - -namespace Avalanche { -class AvalancheEngine; - -class Logger { -public: - Logger(AvalancheEngine *vm); - - void log_setup(Common::String name, bool printing); - - void log_divider(); /* Prints the divider sign. */ - - void log_command(Common::String x); /* Prints a command */ - - void log_scrollchar(Common::String x); /* print one character */ - - void log_italic(); - - void log_roman(); - - void log_epsonroman(); - - void log_scrollline(); /* Set up a line for the scroll driver */ - - void log_scrollendline(bool centred); - - void log_bubbleline(byte linenum, byte whom, Common::String x); - - void log_newline(); - - void log_newroom(Common::String where); - - void log_aside(Common::String what); - - void log_score(uint16 credit, uint16 now); - -private: - AvalancheEngine *_vm; - - static const char divide[]; - - static const Common::String quote; - static const Common::String unquote; - static const Common::String copyright; - static const int16 divide_indent; - - Common::String scroll_line; - byte scroll_line_length; - - void centre(byte size, byte x); - - void log_addstuff(Common::String x); - -}; - -} // End of namespace Avalanche - -#endif // LOGGER2_H diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 8b278f05fc..f407c5cb5f 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -32,7 +32,6 @@ #include "avalanche/lucerna2.h" #include "avalanche/gyro2.h" #include "avalanche/scrolls2.h" -#include "avalanche/logger2.h" #include "avalanche/enhanced2.h" #include "avalanche/visa2.h" #include "avalanche/timeout2.h" @@ -266,8 +265,6 @@ void Lucerna::load(byte n) { /* Load2, actually */ bit = *_vm->_graphics->getPixel(0,0); - _vm->_logger->log_newroom(_vm->_gyro->roomname); - CursorMan.showMouse(true); } @@ -942,7 +939,6 @@ void Lucerna::points(byte num) { /* Add on no. of points */ } warning("STUB: Lucerna::points()"); - _vm->_logger->log_score(num, _vm->_gyro->dna.score); showscore(); } diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk index dbaa5460c6..9698025280 100644 --- a/engines/avalanche/module.mk +++ b/engines/avalanche/module.mk @@ -9,7 +9,6 @@ MODULE_OBJS = \ detection.o \ gyro2.o \ enhanced2.o \ - logger2.o \ pingo2.o \ scrolls2.o \ visa2.o \ diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 2457354e17..8bd6d52248 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -80,8 +80,6 @@ void Parser::handleReturn() { if (_vm->_dropdown->ddm_o.menunow) _vm->_parser->tryDropdown(); else { - _vm->_logger->log_command(_inputText); - if (!_inputText.empty()) { _inputTextBackup = _inputText; _vm->_acci->parse(); diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 6c1ef73d93..523c37bd8d 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -31,7 +31,6 @@ #include "avalanche/scrolls2.h" #include "avalanche/gyro2.h" -#include "avalanche/logger2.h" #include "avalanche/enhanced2.h" #include "avalanche/lucerna2.h" #include "avalanche/trip6.h" @@ -105,8 +104,6 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit fontType itw; byte lz = z.size(); - _vm->_logger->log_scrollline(); - bool offset = x % 8 == 4; x = x / 8; y++; @@ -115,12 +112,10 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit switch (z[xx]) { case kControlRoman: { cfont = roman; - _vm->_logger->log_roman(); } break; case kControlItalic: { cfont = italic; - _vm->_logger->log_italic(); } break; default: { @@ -131,8 +126,6 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit i++; Common::String chr(z[xx]); _vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, black); - - _vm->_logger->log_scrollchar(Common::String(z[xx])); } } } @@ -269,7 +262,6 @@ void Scrolls::music_scroll() { void Scrolls::resetscrolldriver() { /* phew */ _vm->_gyro->scrollbells = 0; cfont = roman; - _vm->_logger->log_epsonroman(); use_icon = 0; _vm->_gyro->interrogation = 0; /* always reset after a scroll comes up. */ } @@ -353,7 +345,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t //setvisualpage(cp); //setactivepage(1 - cp); _vm->_gyro->oncandopageswap = false; /* On can now no longer swap pages. So we can do what we want without its interference! */ - _vm->_logger->log_epsonroman(); /* Scrolls always START with Roman. */ lx = 0; ly = (_vm->_gyro->scrolln) * 6; @@ -459,7 +450,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t else say(mx + icon_indent, my, _vm->_gyro->scroll[b]); - _vm->_logger->log_scrollendline(centre); my += 12; } @@ -474,7 +464,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t undodgem(); _vm->_gyro->dropsok = true; - _vm->_logger->log_divider(); //setvisualpage(cp); //mousepage(cp); CursorMan.showMouse(false); @@ -562,11 +551,6 @@ void Scrolls::bubble(func2 gotoit) { _vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->talkf); } - for (fv = 0; fv < _vm->_gyro->scrolln; fv++) /* These should be separate loops. */ - _vm->_logger->log_bubbleline(fv, param, _vm->_gyro->scroll[fv]); - - _vm->_logger->log_divider(); - //setvisualpage(1 - cp); dingdongbell(); _vm->_gyro->oncandopageswap = false; -- cgit v1.2.3 From d418b2c50c47cb363035885b2b28fcb372c94253 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 11:18:09 +0200 Subject: AVALANCHE: Fix MSVC warnings in lucerna2 --- engines/avalanche/lucerna2.cpp | 61 +++++++++++------------------------------- 1 file changed, 15 insertions(+), 46 deletions(-) diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index f407c5cb5f..1406c444d3 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -81,20 +81,19 @@ void Lucerna::callverb(byte n) { void Lucerna::draw_also_lines() { byte ff; - byte squeaky_code; - CursorMan.showMouse(false); _vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0); _vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15); - for (ff = 0; ff < _vm->_gyro->lineNum; ff++) + for (ff = 0; ff < _vm->_gyro->lineNum; ff++) { // We had to check if the lines are within the borders of the screen. if ((_vm->_gyro->lines[ff].x1 >= 0) && (_vm->_gyro->lines[ff].x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y1 >= 0) && (_vm->_gyro->lines[ff].y1 < _vm->_graphics->kScreenHeight) - && (_vm->_gyro->lines[ff].x2 >= 0) && (_vm->_gyro->lines[ff].x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y2 >= 0) && (_vm->_gyro->lines[ff].y2 < _vm->_graphics->kScreenHeight)) - _vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col); - + && (_vm->_gyro->lines[ff].x2 >= 0) && (_vm->_gyro->lines[ff].x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y2 >= 0) && (_vm->_gyro->lines[ff].y2 < _vm->_graphics->kScreenHeight)) + _vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col); + } + CursorMan.showMouse(true); } @@ -111,13 +110,13 @@ Common::String Lucerna::nextstring() { } void Lucerna::scram1(Common::String &x) { - for (int fz = 0; fz < x.size(); fz ++) + for (uint fz = 0; fz < x.size(); fz++) x.setChar(x[fz] ^ 177, fz); } void Lucerna::unscramble() { for (byte fv = 0; fv < 31; fv ++) - for (byte ff = 0; ff < 2; ff ++) + for (byte ff = 0; ff < 2; ff++) if (_vm->_gyro->also[fv][ff] != 0) scram1(*_vm->_gyro->also[fv][ff]); scram1(_vm->_gyro->listen); @@ -149,7 +148,7 @@ void Lucerna::load_also(Common::String n) { _vm->_gyro->also[fv][ff] = new Common::String; *_vm->_gyro->also[fv][ff] = nextstring(); } - *_vm->_gyro->also[fv][0] = Common::String(157) + *_vm->_gyro->also[fv][0] + 157; + *_vm->_gyro->also[fv][0] = Common::String('\x9D') + *_vm->_gyro->also[fv][0] + Common::String('\x9D'); } memset(_vm->_gyro->lines, 0xFF, sizeof(_vm->_gyro->lines)); @@ -211,8 +210,6 @@ void Lucerna::load_also(Common::String n) { } void Lucerna::load(byte n) { /* Load2, actually */ - byte a0; /*absolute $A000:800;*/ - byte a1; /*absolute $A000:17184;*/ byte bit; Common::String xx; @@ -240,39 +237,22 @@ void Lucerna::load(byte n) { /* Load2, actually */ f.seek(177); - /*for (bit = 0; bit <= 3; bit++) { - port[0x3c4] = 2; - port[0x3ce] = 4; - port[0x3c5] = 1 << bit; - port[0x3cf] = bit; - blockread(f, a0, 12080); - move(a0, a1, 12080); - }*/ - - - _vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight); - _vm->_graphics->refreshBackground(); f.close(); - - load_also(xx); - _vm->_celer->loadBackgroundSprites(n); - bit = *_vm->_graphics->getPixel(0,0); - CursorMan.showMouse(true); } void Lucerna::zoomout(int16 x, int16 y) { - int16 x1, y1, x2, y2; - byte fv; +// int16 x1, y1, x2, y2; +// byte fv; warning("STUB: Lucerna::zoomout()"); } @@ -558,7 +538,6 @@ void Lucerna::enterroom(byte x, byte ped) { //setactivepage(1 - cp); { - dnatype &with = _vm->_gyro->dna; if ((_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]) && (_vm->_gyro->dna.winestate != 3)) { _vm->_visa->dixi('q', 9); /* Don't want to waste the wine! */ _vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false; @@ -986,9 +965,6 @@ void Lucerna::mouseway(const Common::Point &cursorPos) { } void Lucerna::inkey() { - char r; - - if (_vm->_gyro->demo) return; /* Demo handles this itself. */ @@ -1298,25 +1274,20 @@ void Lucerna::clock_lucerna() { void Lucerna::delavvy() { - byte page_; - CursorMan.showMouse(false); - triptype &with = _vm->_trip->tr[0]; - /*for (page_ = 0; page_ <= 1; page_ ++) - mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);*/ +// triptype &with = _vm->_trip->tr[0]; +// for (byte page_ = 0; page_ <= 1; page_ ++) +// mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_); CursorMan.showMouse(true); } void Lucerna::gameover() { - byte fv; - int16 sx, sy; - _vm->_gyro->dna.user_moves_avvy = false; - sx = _vm->_trip->tr[0].x; - sy = _vm->_trip->tr[0].y; + int16 sx = _vm->_trip->tr[0].x; + int16 sy = _vm->_trip->tr[0].y; _vm->_trip->tr[0].done(); _vm->_trip->tr[0].init(12, true, _vm->_trip); // 12 = Avalot falls @@ -1373,8 +1344,6 @@ void Lucerna::sprite_run() { sprites are still. It performs two fast cycles, only using a few of the links usually used, and without any extra animation. This should make the sprites the same on both pages. */ - byte fv; - _vm->_gyro->doing_sprite_run = true; _vm->_trip->get_back_loretta(); -- cgit v1.2.3 From cd808484aff158ccc8ec78a3898c4d5aff2d8e03 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 11:43:02 +0200 Subject: AVALANCHE: Fix some more MSVC warnings --- engines/avalanche/enid2.cpp | 4 ++-- engines/avalanche/pingo2.cpp | 5 ++--- engines/avalanche/scrolls2.cpp | 29 +++++++++++++---------------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp index 9841fa02e7..1e7c816947 100644 --- a/engines/avalanche/enid2.cpp +++ b/engines/avalanche/enid2.cpp @@ -263,8 +263,8 @@ void Enid::from_sundry(sundry sund) { } void Enid::restore_dna() { - uint16 here, fv; - sundry sund; +// uint16 here, fv; +// sundry sund; warning("STUB: Enid::restore_dna()"); } diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp index 4f3d17192b..096a8be084 100644 --- a/engines/avalanche/pingo2.cpp +++ b/engines/avalanche/pingo2.cpp @@ -109,8 +109,6 @@ void Pingo::zonk() { void Pingo::winning_pic() { Common::File f; - char r; - _vm->_lucerna->dusk(); if (!f.open("finale.avd")) { @@ -137,7 +135,8 @@ void Pingo::winning_pic() { /*do { _vm->_gyro->check(); } while (!(keypressed() || (mrelease > 0))); - while (keypressed()) r = readkey(); + while (keypressed()) + char r = readkey(); major_redraw();*/ warning("STUB: Pingo::winning_pic()"); } diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 523c37bd8d..fe345d8575 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -55,8 +55,6 @@ void Scrolls::init() { } void Scrolls::state(byte x) { /* Sets "Ready" light to whatever */ - byte page_; - if (_vm->_gyro->ledstatus == x) return; /* Already like that! */ @@ -136,8 +134,6 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit void Scrolls::normscroll() { Common::String egg = Common::String(kControlParagraph) + kControlLeftJustified + kControlNegative + kControlBell + kControlBackspace + "***"; Common::String e = "(c) 1994"; - char r; - bool oktoexit; state(3); _vm->_gyro->seescroll = true; @@ -165,6 +161,8 @@ void Scrolls::normscroll() { +// char r; +// bool oktoexit; // do { // do { // _vm->_gyro->check(); /* was "checkclick;" */ @@ -308,8 +306,6 @@ void Scrolls::geticon(int16 x, int16 y, byte which) { void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) { Common::File f; - byte bit; - int16 fv; uint16 st; st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop); @@ -321,14 +317,15 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) { return; } - /*for (fv = 1; fv <= yl; fv ++) - for (bit = 0; bit <= 3; bit ++) { - port[0x3c4] = 2; - port[0x3ce] = 4; - port[0x3c5] = 1 << bit; - port[0x3cf] = bit; - blockread(f, mem[0xa000 * st + (fv * 80)], xl); - } + /*byte bit; + for (uint16 fv = 1; fv <= yl; fv ++) + for (bit = 0; bit <= 3; bit ++) { + port[0x3c4] = 2; + port[0x3ce] = 4; + port[0x3c5] = 1 << bit; + port[0x3cf] = bit; + blockread(f, mem[0xa000 * st + (fv * 80)], xl); + } bit = getpixel(0, 0);*/ warning("STUB: Scrolls::block_drop()"); @@ -484,7 +481,7 @@ 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 */ +// byte *rp1, *rp2; /* replace: 1=bubble, 2=pointer */ int16 xc; /* x correction */ /*setvisualpage(cp); @@ -638,7 +635,7 @@ void Scrolls::calldrivers() { char nnn; bool mouthnext; bool call_spriterun; // Only call sprite_run the FIRST time. - bool was_virtual; // Was the mouse cursor virtual on entry to this proc? +// bool was_virtual; // Was the mouse cursor virtual on entry to this proc? //nosound(); -- cgit v1.2.3 From c3ce7d48401705b51fb4cbcd790020392da11cd9 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 12:02:01 +0200 Subject: AVALANCHE: Fix MSVC warnings in trip6 --- engines/avalanche/trip6.cpp | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index 7e444dc1ee..20c22e40e0 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -53,8 +53,7 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) { _tr = tr; const int32 idshould = -1317732048; - int16 gd, gm; - byte fv/*,nds*/; + byte fv; int32 id; Common::File inf; @@ -418,22 +417,17 @@ void triptype::load_data_from_mem(uint16 &where) { } triptype *triptype::done() { - int16 gd, gm; Common::String xx; - byte fv/*,nds*/; - byte aa, bb; - int32 id; - uint16 soa; /* nds:=num div seq;*/ totalnum--; _info.xw = _info.xl / 8; if ((_info.xl % 8) > 0) _info.xw++; - for (aa = 0; aa < /*nds*seq*/ a.num; aa++) { + for (byte aa = 0; aa < /*nds*seq*/ a.num; aa++) { totalnum--; - delete _info.mani[totalnum]; - delete _info.sil[totalnum]; + delete[] _info.mani[totalnum]; + delete[] _info.sil[totalnum]; } quick = false; @@ -441,11 +435,6 @@ triptype *triptype::done() { return this; } - - - - - getsettype *getsettype::init() { numleft = 0; /* initialize array pointer */ return this; @@ -528,6 +517,8 @@ byte Trip::geida_ped(byte which) { return 9; case 4: return 10; + default: + return 0; } } @@ -538,7 +529,7 @@ void Trip::catamove(byte ped) { int32 here; uint16 xy_uint16; - byte fv, ff; + byte fv; /* XY_uint16 is cat_x+cat_y*256. Thus, every room in the catacombs has a different number for it. */ @@ -1145,7 +1136,6 @@ bool Trip::overlaps_with_mouse() { } void Trip::getback() { - byte fv; bool endangered; @@ -1213,8 +1203,6 @@ void Trip::face_avvy(byte tripnum) { } void Trip::arrow_procs(byte tripnum) { - byte fv; - if (tr[tripnum].homing) { /* Arrow is still in flight. */ /* We must check whether or not the arrow has collided tr[tripnum] Avvy's head. @@ -1232,7 +1220,7 @@ void Trip::arrow_procs(byte tripnum) { /* tr[1].done; { Deallocate normal pic of Avvy. } off; - for fv:=0 to 1 do + for byte fv:=0 to 1 do begin cp:=1-cp; getback; @@ -1267,11 +1255,8 @@ begin end;*/ void Trip::grab_avvy(byte tripnum) { /* For Friar Tuck, in Nottingham. */ - byte fv; - int16 tox, toy; - - tox = tr[0].x + 17; - toy = tr[0].y - 1; + int16 tox = tr[0].x + 17; + int16 toy = tr[0].y - 1; if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) { tr[tripnum].call_eachstep = false; tr[tripnum].face = left; @@ -1471,7 +1456,7 @@ void Trip::getsetclear() { } void Trip::hide_in_the_cupboard() { - const char nowt = 250; /* As in Acci. */ + const char nowt = '\xFA'; /* As in Acci. */ if (_vm->_gyro->dna.avvys_in_the_cupboard) { if (_vm->_gyro->dna.wearing == nowt) -- cgit v1.2.3 From fce3fe83819f05cc2a0598c367124ea8c0ea2dac Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 12:32:10 +0200 Subject: AVALANCHE: Fix MSVC warnings in acci2 --- engines/avalanche/acci2.cpp | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 2d532bb570..4542910339 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -288,11 +288,10 @@ void Acci::number(Common::String &codes) { } void Acci::cheatParse(Common::String codes) { - uint16 num; - int16 e; - - char cmd; - int16 se, sx, sy; +// uint16 num; +// int16 e; +// char cmd; +// int16 se, sx, sy; warning("STUB: Acci::cheatParse()"); } @@ -522,39 +521,39 @@ void Acci::parse() { inputText.deleteChar(0); } - if (_vm->_parser->pos(Common::String(254), _thats) > -1) - _unknown = _realWords[_vm->_parser->pos(Common::String(254), _thats)]; + if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1) + _unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)]; else if (!_unknown.empty()) _unknown.clear(); // Replace words' codes that mean the same. - replace(Common::String(255), 0); /* zap noise words */ - replace(Common::String(13) + 226, 1); // "look at" = "examine" - replace(Common::String(13) + 228, 1); // "look in" = "examine" - replace(Common::String(4) + 230, 17); // "get up" = "stand" - replace(Common::String(4) + 231, 17); // "get down" = "stand"... well, why not? - replace(Common::String(18) + 228, 2); // "go in" = "open [door]" - replace(Common::String(28) + 229, 253); // "P' off" is a swear word - replace(Common::String(4) + 6, 6); // "Take inventory" (remember Colossal Adventure?) - replace(Common::String(40) + 232, 21); // "put on" = "don" - replace(Common::String(4) + 229, 20); // "take off" = "doff" + replace(Common::String('\xFF'), 0); /* zap noise words */ + replace(Common::String('\xD') + '\xE2', 1); // "look at" = "examine" + replace(Common::String('\xD') + '\xE4', 1); // "look in" = "examine" + replace(Common::String('\x4') + '\xE6', 17); // "get up" = "stand" + replace(Common::String('\x4') + '\xE7', 17); // "get down" = "stand"... well, why not? + replace(Common::String('\x12') + '\xE4', 2); // "go in" = "open [door]" + replace(Common::String('\x1C') + '\xE5', 253); // "P' off" is a swear word + replace(Common::String('\x4') + '\x6' , 6); // "Take inventory" (remember Colossal Adventure?) + replace(Common::String('\x28') + '\xE8', 21); // "put on" = "don" + replace(Common::String('\x4') + '\xE5', 20); // "take off" = "doff" // Words that could mean more than one _person if (_vm->_gyro->dna.room == r__nottspub) - replace(Common::String(204), 164); // Barman = Port + replace(Common::String('\xCC'), 164); // Barman = Port else - replace(Common::String(204), 154); // Barman = Malagauche + replace(Common::String('\xCC'), 154); // Barman = Malagauche switch (_vm->_gyro->dna.room) { case r__aylesoffice: - replace(Common::String(203), 163); // Monk = Ayles + replace(Common::String('\xCB'), 163); // Monk = Ayles break; case r__musicroom: - replace(Common::String(203), 166); // Monk = Jacques + replace(Common::String('\xCB'), 166); // Monk = Jacques break; default: - replace(Common::String(203), 162); // Monk = Ibythneth + replace(Common::String('\xCB'), 162); // Monk = Ibythneth } if (doPronouns()) { -- cgit v1.2.3 From 8e148213067a664f384c5eea0082660210ea0d26 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 12:35:26 +0200 Subject: AVALANCHE: Fix bug in verbOpt() --- engines/avalanche/acci2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 4542910339..a7dd24aa59 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -2016,7 +2016,7 @@ void Acci::verbOpt(byte verb, Common::String &answer, char &ansKey) { switch (verb) { case kVerbCodeExam: answer = "Examine"; - ansKey = 'word'; + ansKey = 'x'; break; // The ubiqutous one. // kVerbCodegive isn't dealt with by this procedure, but by ddm__with. case kVerbCodeDrink: -- cgit v1.2.3 From 8c8990368e84d154888e9754b992ff7a8db6393f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 12:36:48 +0200 Subject: AVALANCHE: Fix bug in lookAround() --- engines/avalanche/acci2.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index a7dd24aa59..cd244e6d95 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -865,34 +865,34 @@ void Acci::lookAround() { switch (_vm->_gyro->dna.room) { case r__spludwicks: if (_vm->_gyro->dna.avaricius_talk > 0) - _vm->_visa->dixi('pos', 23); + _vm->_visa->dixi('q', 23); else peopleInRoom(); break; case r__robins: if (_vm->_gyro->dna.tied_up) - _vm->_visa->dixi('pos', 38); + _vm->_visa->dixi('q', 38); if (_vm->_gyro->dna.mushroom_growing) - _vm->_visa->dixi('pos', 55); + _vm->_visa->dixi('q', 55); break; case r__insidecardiffcastle: if (!_vm->_gyro->dna.taken_pen) - _vm->_visa->dixi('pos', 49); + _vm->_visa->dixi('q', 49); break; case r__lustiesroom: if (_vm->_gyro->dna.lustie_is_asleep) - _vm->_visa->dixi('pos', 65); + _vm->_visa->dixi('q', 65); break; case r__catacombs: switch (_vm->_gyro->dna.cat_y * 256 + _vm->_gyro->dna.cat_x) { case 258 : - _vm->_visa->dixi('pos', 80); // Inside art gallery. + _vm->_visa->dixi('q', 80); // Inside art gallery. break; case 514 : - _vm->_visa->dixi('pos', 81); // Outside ditto. + _vm->_visa->dixi('q', 81); // Outside ditto. break; case 260 : - _vm->_visa->dixi('pos', 82); // Outside Geida's room. + _vm->_visa->dixi('q', 82); // Outside Geida's room. break; } break; -- cgit v1.2.3 From 53d9848f6625b390b3898c18cabf610439e2bba6 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 12:38:19 +0200 Subject: AVALANCHE: Fix bug in openDoor() --- engines/avalanche/acci2.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index cd244e6d95..d869fe46e3 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -915,7 +915,7 @@ void Acci::openDoor() { break; case r__spludwicks: if (_thing == 61) { - _vm->_visa->dixi('pos', 85); + _vm->_visa->dixi('q', 85); return; } break; @@ -932,7 +932,7 @@ void Acci::openDoor() { switch (_vm->_gyro->portals[fv].op) { case Gyro::exclaim: _vm->_trip->tr[0].bounce(); - _vm->_visa->dixi('word', _vm->_gyro->portals[fv].data); + _vm->_visa->dixi('x', _vm->_gyro->portals[fv].data); break; case Gyro::transport: _vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/); @@ -954,8 +954,7 @@ void Acci::openDoor() { if (_vm->_gyro->dna.room == r__map) _vm->_scrolls->display(Common::String("Avvy, you can complete the whole game without ever going " - "to anywhere other than Argent, Birmingham, Cardiff, " - "Nottingham and Norwich.")); + "to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.")); else _vm->_scrolls->display("Door? What door?"); } -- cgit v1.2.3 From c781727a03c0a7db10cf61944b54066199dbe838 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 12:42:27 +0200 Subject: AVALANCHE: Fix bug in giveToSpludwick, add doxygen comment --- engines/avalanche/acci2.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index d869fe46e3..9da26a80f4 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -1052,6 +1052,10 @@ void Acci::goToCauldron() { _vm->_trip->tr[1].walkto(2); } +/** + * Check is it's possible to give something to Spludwick + * @remarks Originally called 'give2spludwick' + */ bool Acci::giveToSpludwick() { if (_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick] != _thing) { notInOrder(); @@ -1062,10 +1066,10 @@ bool Acci::giveToSpludwick() { case Gyro::onion: _vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false; if (_vm->_gyro->dna.rotten_onion) - _vm->_visa->dixi('pos', 22); + _vm->_visa->dixi('q', 22); else { _vm->_gyro->dna.given2spludwick++; - _vm->_visa->dixi('pos', 20); + _vm->_visa->dixi('q', 20); goToCauldron(); _vm->_lucerna->points(3); } @@ -1075,13 +1079,13 @@ bool Acci::giveToSpludwick() { _vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = false; _vm->_lucerna->objectlist(); _vm->_gyro->dna.given2spludwick++; - _vm->_visa->dixi('pos', 24); + _vm->_visa->dixi('q', 24); goToCauldron(); _vm->_lucerna->points(3); break; case Gyro::mushroom: _vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = false; - _vm->_visa->dixi('pos', 25); + _vm->_visa->dixi('q', 25); _vm->_lucerna->points(5); _vm->_gyro->dna.given2spludwick++; goToCauldron(); -- cgit v1.2.3 From caeb46f3ce251e10f16cd86bd3d968e7c6c2a642 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 12:51:29 +0200 Subject: AVALANCHE: Fix bugs in getProc() and giveGeidaTheLute(), add doxygen comment --- engines/avalanche/acci2.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 9da26a80f4..1f7c86adf1 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -1190,7 +1190,7 @@ void Acci::getProc(char thing) { } else _vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box."); } else - _vm->_visa->dixi('pos', 57); + _vm->_visa->dixi('q', 57); break; case r__insidecardiffcastle: switch (thing) { @@ -1208,15 +1208,15 @@ void Acci::getProc(char thing) { _vm->_scrolls->display("Taken."); } } else if (_vm->_gyro->dna.standing_on_dais) - _vm->_visa->dixi('pos', 53); + _vm->_visa->dixi('q', 53); else - _vm->_visa->dixi('pos', 51); + _vm->_visa->dixi('q', 51); break; case Gyro::bolt: - _vm->_visa->dixi('pos', 52); + _vm->_visa->dixi('q', 52); break; default: - _vm->_visa->dixi('pos', 57); + _vm->_visa->dixi('q', 57); } break; case r__robins: @@ -1229,13 +1229,17 @@ void Acci::getProc(char thing) { _vm->_lucerna->objectlist(); _vm->_lucerna->points(3); } else - _vm->_visa->dixi('pos', 57); + _vm->_visa->dixi('q', 57); break; default: - _vm->_visa->dixi('pos', 57); + _vm->_visa->dixi('q', 57); } } +/** + * Give the lute to Geida + * @remarks Originally called 'give_Geida_the_lute' + */ void Acci::giveGeidaTheLute() { if (_vm->_gyro->dna.room != r__lustiesroom) { _vm->_scrolls->display(Common::String("Not yet. Try later!") + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble); @@ -1243,7 +1247,7 @@ void Acci::giveGeidaTheLute() { } _vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = false; _vm->_lucerna->objectlist(); - _vm->_visa->dixi('pos', 64); // She plays it. + _vm->_visa->dixi('q', 64); // She plays it. _vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings); _vm->_enid->back_to_bootstrap(4); -- cgit v1.2.3 From 382046244868c6d08f556ad0ef714b956c9d0389 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 13:06:12 +0200 Subject: AVALANCHE: Fix bugs in winSequence() and doThat() --- engines/avalanche/acci2.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 1f7c86adf1..0a1a047679 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -1261,7 +1261,7 @@ void Acci::playHarp() { } void Acci::winSequence() { - _vm->_visa->dixi('pos', 78); + _vm->_visa->dixi('q', 78); _vm->_sequence->first_show(7); _vm->_sequence->then_show(8); _vm->_sequence->then_show(9); @@ -1302,6 +1302,9 @@ void Acci::heyThanks() { _vm->_gyro->dna.obj[_thing - 1] = false; } +/** + * @remarks Originally called 'do_that' + */ void Acci::doThat() { const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"}; @@ -1424,7 +1427,7 @@ void Acci::doThat() { break; case Gyro::pibythneth: if (_thing == _vm->_gyro->badge) { - _vm->_visa->dixi('pos', 32); // Thanks! Wow! + _vm->_visa->dixi('q', 32); // Thanks! Wow! _vm->_lucerna->points(3); _vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = false; _vm->_gyro->dna.obj[_vm->_gyro->habit - 1] = true; @@ -1438,7 +1441,7 @@ void Acci::doThat() { if (_vm->_gyro->dna.ayles_is_awake) { if (_thing == _vm->_gyro->pen) { _vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = false; - _vm->_visa->dixi('pos', 54); + _vm->_visa->dixi('q', 54); _vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = true; _vm->_gyro->dna.given_pen_to_ayles = true; _vm->_lucerna->objectlist(); @@ -1470,7 +1473,7 @@ void Acci::doThat() { if (_vm->_gyro->dna.geida_given_potion) winSequence(); else - _vm->_visa->dixi('pos', 77); // That Geida woman! + _vm->_visa->dixi('q', 77); // That Geida woman! break; default: heyThanks(); @@ -1601,7 +1604,7 @@ void Acci::doThat() { } if (!_vm->_gyro->dna.asked_dogfood_about_nim) { - _vm->_visa->dixi('pos', 84); + _vm->_visa->dixi('q', 84); return; } @@ -1696,12 +1699,12 @@ void Acci::doThat() { break; case kVerbCodeMagic: if (_vm->_gyro->dna.avaricius_talk > 0) - _vm->_visa->dixi('pos', 19); + _vm->_visa->dixi('q', 19); else { if ((_vm->_gyro->dna.room == 12) & (_vm->_trip->infield(2))) { // Avaricius appears! - _vm->_visa->dixi('pos', 17); + _vm->_visa->dixi('q', 17); if (_vm->_gyro->whereis[1] == 12) - _vm->_visa->dixi('pos', 18); + _vm->_visa->dixi('q', 18); else { _vm->_trip->tr[1].init(1, false, _vm->_trip); // Avaricius _vm->_trip->apped(2, 4); -- cgit v1.2.3 From 8e7921d19dbc1308505356b7eb45b7d7096257d1 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 13:07:09 +0200 Subject: AVALANCHE: USe the default return value in giveToSpludwick() --- engines/avalanche/acci2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 0a1a047679..b69e0514c4 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -1095,6 +1095,8 @@ bool Acci::giveToSpludwick() { default: return true; } + + return false; } void Acci::drink() { -- cgit v1.2.3 From 9c5cc7bba4661114054f05bbce0250650e1138a5 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 13:16:27 +0200 Subject: AVALANCHE: Add a default value to color in state(), remove dead code --- engines/avalanche/scrolls2.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index fe345d8575..615bdd5a52 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -58,7 +58,7 @@ void Scrolls::state(byte x) { /* Sets "Ready" light to whatever */ if (_vm->_gyro->ledstatus == x) return; /* Already like that! */ - byte color; + byte color = black; switch (x) { case 0: color = black; @@ -69,21 +69,6 @@ void Scrolls::state(byte x) { /* Sets "Ready" light to whatever */ color = green; break; /* Hit a key */ } - - //switch (x) { - //case 0: - // setfillstyle(1, black); - // break; /* Off */ - //case 1: - // setfillstyle(9, green); - // break; /* Half-on (menus) */ - //case 2: - // setfillstyle(1, green); - // break; /* On (kbd) */ - //case 3: - // setfillstyle(6, green); - // break; /* Hit a key */ - //} warning("STUB: Scrolls::state()"); CursorMan.showMouse(false); -- cgit v1.2.3 From e4b3fc8064a5fac7655198e3994bac32223d8a30 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 13:28:15 +0200 Subject: AVALANCHE: Add default value to Direction in updateBackgroundSprites() --- engines/avalanche/celer2.cpp | 94 ++++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index 2d16dc6de9..ce7120732b 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -55,7 +55,9 @@ Celer::~Celer() { } - +/** + * @remarks Originally called 'pics_link' + */ void Celer::updateBackgroundSprites() { if (_vm->_gyro->ddmnow) return; // No animation when the menus are up. @@ -119,8 +121,8 @@ void Celer::updateBackgroundSprites() { break; } - byte direction; if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally. + byte direction = 0; if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360))) direction = 3; else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357)) @@ -155,7 +157,7 @@ void Celer::updateBackgroundSprites() { break; case r__lustiesroom: if (!(_vm->_gyro->dna.lustie_is_asleep)) { - byte direction; + byte direction = 0; if ((_vm->_gyro->roomtime % 45) > 42) direction = 4; // du Lustie blinks. // Bearing of Avvy from du Lustie. @@ -197,55 +199,55 @@ void Celer::updateBackgroundSprites() { } break; case r__nottspub: { - // Bearing of Avvy from Port. - byte direction; - if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360))) - direction = 2; // Middle. - else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180)) - direction = 6; // Left. - else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314)) - direction = 8; // Right. - - if ((_vm->_gyro->roomtime % 60) > 57) - direction--; // Blinks. - - if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed. - drawBackgroundSprite(-1, -1, direction); - _vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not? - } + // Bearing of Avvy from Port. + byte direction = 0; + if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360))) + direction = 2; // Middle. + else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180)) + direction = 6; // Left. + else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314)) + direction = 8; // Right. + + if ((_vm->_gyro->roomtime % 60) > 57) + direction--; // Blinks. + + if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed. + drawBackgroundSprite(-1, -1, direction); + _vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not? + } - switch (_vm->_gyro->roomtime % 50) { - case 45 : - drawBackgroundSprite(-1, -1, 9); // Spurge blinks. - break; - case 49 : - drawBackgroundSprite(-1, -1, 10); - break; - } + switch (_vm->_gyro->roomtime % 50) { + case 45 : + drawBackgroundSprite(-1, -1, 9); // Spurge blinks. + break; + case 49 : + drawBackgroundSprite(-1, -1, 10); + break; } break; + } case r__ducks: { - if ((_vm->_gyro->roomtime % 3) == 0) // The fire flickers. - drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3); - - // Bearing of Avvy from Duck. - byte direction; - if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360))) - direction = 4; // Middle. - else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180)) - direction = 6; // Left. - else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314)) - direction = 8; // Right. - - if ((_vm->_gyro->roomtime % 45) > 42) - direction++; // Duck blinks. - - if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed. - drawBackgroundSprite(-1, -1, direction); - _vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not? - } + if ((_vm->_gyro->roomtime % 3) == 0) // The fire flickers. + drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3); + + // Bearing of Avvy from Duck. + byte direction = 0; + if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360))) + direction = 4; // Middle. + else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180)) + direction = 6; // Left. + else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314)) + direction = 8; // Right. + + if ((_vm->_gyro->roomtime % 45) > 42) + direction++; // Duck blinks. + + if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed. + drawBackgroundSprite(-1, -1, direction); + _vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not? } break; + } } if ((_vm->_gyro->dna.ringing_bells) && (_vm->_gyro->flagset('B'))) { -- cgit v1.2.3 From ff31d8e52152c7a988764d361fbcaeda049d2645 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 13:29:18 +0200 Subject: AVALANCHE: Replace a STUB by a call to updateBackgroundSprites() --- engines/avalanche/celer2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index ce7120732b..6dece2f476 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -261,7 +261,7 @@ void Celer::updateBackgroundSprites() { break; case 2: //nosound(); - warning("STUB: Celer::pics_link()"); + updateBackgroundSprites(); break; } } -- cgit v1.2.3 From fe8e5c7325d3b88ac8bb2dd3db6ee2761e5f9764 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 13:34:58 +0200 Subject: AVALANCHE: Fix coding style: ++ and -- --- engines/avalanche/avalanche.cpp | 2 +- engines/avalanche/celer2.cpp | 4 ++-- engines/avalanche/dropdown2.cpp | 2 +- engines/avalanche/graphics.cpp | 4 ++-- engines/avalanche/gyro2.cpp | 6 +++--- engines/avalanche/lucerna2.cpp | 32 ++++++++++++++++++-------------- engines/avalanche/parser.cpp | 2 +- engines/avalanche/pingo2.cpp | 2 +- engines/avalanche/scrolls2.cpp | 10 +++++----- engines/avalanche/trip6.cpp | 8 ++++---- 10 files changed, 38 insertions(+), 34 deletions(-) diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 3d8ba61a38..a00701456e 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -278,7 +278,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { sz.syncAsByte(_gyro->dna.asked_dogfood_about_nim); - //for (byte groi = 0; groi < numtr; groi ++) { + //for (byte groi = 0; groi < numtr; groi++) { // if (tr[groi].quick) { // blockwrite(f, groi, 1); // tr[groi].savedata(f); diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index 6dece2f476..a84d15116f 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -319,7 +319,7 @@ void Celer::loadBackgroundSprites(byte number) { } void Celer::forgetBackgroundSprites() { - for (byte i = 0; i < _spriteNum; i ++) + for (byte i = 0; i < _spriteNum; i++) if (_sprites[i]._x > kOnDisk) _sprites[i]._picture.free(); } @@ -366,7 +366,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) { //setactivepage(1 - cp); warning("STUB: Celer::show_one()"); - for (byte i = 0; i < 2; i ++) + for (byte i = 0; i < 2; i++) _vm->_trip->getset[i].remember(_r); } diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp index 064af299dc..82a5228ed3 100644 --- a/engines/avalanche/dropdown2.cpp +++ b/engines/avalanche/dropdown2.cpp @@ -276,7 +276,7 @@ void menuset::extd(char c) { byte fv; fv = 0; while ((fv < howmany) && (ddms[fv].extdparse(c))) - fv ++; + fv++; if (fv == howmany) return; getcertain(fv); diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index eaf547c018..b4ee2a7a3f 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -126,9 +126,9 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int32 yRadius = radius * kScreenWidth / (8 * kScreenHeight); // Just don't ask why... if (xRadius == 0) - xRadius ++; + xRadius++; if (yRadius == 0) - yRadius ++; + yRadius++; // Check for an ellipse with negligable x and y radius. if ((xRadius <= 1) && (yRadius <= 1)) diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index 4166ecfe32..1653159937 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -312,7 +312,7 @@ void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) { } void Gyro::newgame() { - for (byte gm = 0; gm < numtr; gm ++) { + for (byte gm = 0; gm < numtr; gm++) { if (_vm->_trip->tr[gm].quick) _vm->_trip->tr[gm].done(); } @@ -343,7 +343,7 @@ void Gyro::newgame() { ppos[0][1] = -177; _vm->_trip->tr[0].appear(300,117,right); // Needed to initialize Avalot. - //for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil; + //for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil; /* fillchar(previous^,sizeof(previous^),#0); { blank out array } */ him = 254; her = 254; @@ -356,7 +356,7 @@ void Gyro::newgame() { dna.avvy_in_bed = true; enid_filename = ""; - for (byte gd = 0; gd <= 1; gd ++) { + for (byte gd = 0; gd <= 1; gd++) { cp = 1 - cp; _vm->_trip->getback(); } diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 1406c444d3..389aa2e23d 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -115,7 +115,7 @@ void Lucerna::scram1(Common::String &x) { } void Lucerna::unscramble() { - for (byte fv = 0; fv < 31; fv ++) + for (byte fv = 0; fv < 31; fv++) for (byte ff = 0; ff < 2; ff++) if (_vm->_gyro->also[fv][ff] != 0) scram1(*_vm->_gyro->also[fv][ff]); @@ -815,7 +815,7 @@ void Lucerna::thinkabout(byte z, bool th) { /* Hey!!! Get it and put it!!! * putimage(x, y, p, 0); setactivepage(1 - cp);*/ - for (byte fv = 0; fv <= 1; fv ++) + for (byte fv = 0; fv <= 1; fv++) _vm->_trip->getset[fv].remember(thinkspace); CursorMan.showMouse(true); @@ -831,14 +831,14 @@ void Lucerna::load_digits() { /* Load the scoring digits & rwlites */ return; } - for (byte fv = 0; fv < 10; fv ++) { + for (byte fv = 0; fv < 10; fv++) { f.seek(fv * digitsize); /*_vm->_gyro->digit[fv] = new byte[digitsize]; f.read(_vm->_gyro->digit[fv], digitsize);*/ _vm->_gyro->digit[fv] = _vm->_graphics->loadPictureGraphic(f); } - for (byte ff = 0; ff < 9; ff ++) { + for (byte ff = 0; ff < 9; ff++) { f.seek(10 * digitsize + ff * rwlitesize); /*_vm->_gyro->rwlite[ff] = new byte[rwlitesize]; f.read(_vm->_gyro->rwlite[ff], rwlitesize);*/ @@ -894,11 +894,11 @@ void Lucerna::showscore() { //setactivepage(3); - for (byte fv = 0; fv < 3; fv ++) + for (byte fv = 0; fv < 3; fv++) if (_vm->_gyro->lastscore[fv] != numbers[fv]) _vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177); - for (byte fv = 0; fv < 2; fv ++) + for (byte fv = 0; fv < 2; fv++) _vm->_trip->getset[fv].remember(scorespace); //setactivepage(1 - cp); @@ -909,10 +909,10 @@ void Lucerna::showscore() { } void Lucerna::points(byte num) { /* Add on no. of points */ - for (byte q = 1; q <= num; q ++) { + for (byte q = 1; q <= num; q++) { _vm->_gyro->dna.score++; /*if (soundfx) - for (byte fv = 1; fv <= 97; fv ++) + for (byte fv = 1; fv <= 97; fv++) sound(177 + dna.score * 3); nosound;*/ } @@ -1143,9 +1143,13 @@ int8 Lucerna::fades(int8 x) { x = x % 16; byte g = x / 4; byte b = x % 4; - if (r > 0) r --; - if (g > 0) g --; - if (b > 0) b --; + if (r > 0) + r--; + if (g > 0) + g--; + if (b > 0) + b--; + return (16 * r + 4 * g + b); /* fades:=x-1;*/ } @@ -1180,7 +1184,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits(). _vm->_gyro->oldrw = _vm->_gyro->dna.rw; CursorMan.showMouse(false); - /* for (byte page_ = 0; page_ <= 1; page_ ++) { + /* for (byte page_ = 0; page_ <= 1; page_++) { setactivepage(page_); putimage(0, 161, rwlite[with.rw], 0); }*/ @@ -1277,7 +1281,7 @@ void Lucerna::delavvy() { CursorMan.showMouse(false); // triptype &with = _vm->_trip->tr[0]; -// for (byte page_ = 0; page_ <= 1; page_ ++) +// for (byte page_ = 0; page_ <= 1; page_++) // mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_); CursorMan.showMouse(true); @@ -1307,7 +1311,7 @@ void Lucerna::minor_redraw() { enterroom(_vm->_gyro->dna.room, 0); /* Ped unknown or non-existant. */ - for (byte fv = 0; fv <= 1; fv ++) { + for (byte fv = 0; fv <= 1; fv++) { _vm->_gyro->cp = 1 - _vm->_gyro->cp; _vm->_trip->getback(); } diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 8bd6d52248..67b893f32f 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -153,7 +153,7 @@ void Parser::drawCursor() { bf.x2 = _inputTextPos + 2; bf.y1 = 168; bf.y2 = 168; - for (byte fv = 0; fv <= 1; fv ++) + for (byte fv = 0; fv <= 1; fv++) _vm->_trip->getset[fv].remember(bf); } diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp index 096a8be084..777a1c7cb6 100644 --- a/engines/avalanche/pingo2.cpp +++ b/engines/avalanche/pingo2.cpp @@ -116,7 +116,7 @@ void Pingo::winning_pic() { return; } - /*for (byte bit = 0; bit <= 3; bit ++) { + /*for (byte bit = 0; bit <= 3; bit++) { port[0x3c4] = 2; port[0x3ce] = 4; port[0x3c5] = 1 << bit; diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 615bdd5a52..65c4faaae0 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -207,7 +207,7 @@ bool Scrolls::they_match(tunetype &played) { mistakes = 0; - for (fv = 1; fv <= sizeof(played); fv ++) + for (fv = 1; fv <= sizeof(played); fv++) if (played[fv] != _vm->_gyro->tune[fv]) { mistakes += 1; } @@ -303,8 +303,8 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) { } /*byte bit; - for (uint16 fv = 1; fv <= yl; fv ++) - for (bit = 0; bit <= 3; bit ++) { + for (uint16 fv = 1; fv <= yl; fv++) + for (bit = 0; bit <= 3; bit++) { port[0x3c4] = 2; port[0x3ce] = 4; port[0x3c5] = 1 << bit; @@ -560,7 +560,7 @@ bool Scrolls::ask(Common::String question) { void Scrolls::resetscroll() { _vm->_gyro->scrolln = 1; - for (int j = 0; j < 15; j ++) + for (int j = 0; j < 15; j++) if (!_vm->_gyro->scroll[j].empty()) _vm->_gyro->scroll[j].clear(); } @@ -760,7 +760,7 @@ void Scrolls::calldrivers() { nn = 1; for (nnn = 0; nnn < numobjs; nnn++) if (_vm->_gyro->dna.obj[nnn]) { - nn ++; + nn++; display(_vm->_gyro->get_better(nnn) + ", " + kControlToBuffer); } } diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index 20c22e40e0..417a92056e 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -110,7 +110,7 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) { //getmem(sil[totalnum-1], 11 * (a.yl + 1)); _info.mani[totalnum] = new manitype[_info.size - 6]; //getmem(mani[totalnum-1], a.size - 6); - for (fv = 0; fv <= _info.yl; fv ++) + for (fv = 0; fv <= _info.yl; fv++) inf.read((*_info.sil[totalnum])[fv], _info.xw); //blockread(inf, (*sil[totalnum-1])[fv], xw); inf.read(*_info.mani[totalnum], _info.size - 6); @@ -945,7 +945,7 @@ void Trip::call_special(uint16 which) { } } _vm->_lucerna->dusk(); - _vm->_gyro->dna.cat_y --; + _vm->_gyro->dna.cat_y--; catamove(4); if (_vm->_gyro->dna.room != r__catacombs) return; @@ -1079,7 +1079,7 @@ void Trip::newspeed() { //setactivepage(1 - cp); - for (page_ = 0; page_ <= 1; page_ ++) + for (page_ = 0; page_ <= 1; page_++) getset[page_].remember(lightspace); } @@ -1304,7 +1304,7 @@ void Trip::spin(byte whichway, byte &tripnum) { void Trip::geida_procs(byte tripnum) { if (_vm->_gyro->dna.geida_time > 0) { - _vm->_gyro->dna.geida_time --; + _vm->_gyro->dna.geida_time--; if (_vm->_gyro->dna.geida_time == 0) _vm->_gyro->dna.geida_spin = 0; } -- cgit v1.2.3 From d2312e626b9527a7afd2be087e4eb10c78f15351 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 13:55:31 +0200 Subject: AVALANCHE: Review use of brackets in acci2 --- engines/avalanche/acci2.cpp | 269 ++++++++++++++++++++++---------------------- 1 file changed, 137 insertions(+), 132 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index b69e0514c4..ef6631184c 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -214,23 +214,26 @@ void Acci::init() { } void Acci::clearWords() { - for (byte i = 0; i < 11; i++) + for (byte i = 0; i < 11; i++) { if (!_realWords[i].empty()) _realWords[i].clear(); + } } byte Acci::wordNum(Common::String word) { if (word.empty()) return 0; - for (int32 i = kParserWordsNum - 1; i >= 0; i--) + for (int32 i = kParserWordsNum - 1; i >= 0; i--) { if (kVocabulary[i]._word == word) return kVocabulary[i]._number; + } // If not found as a whole, we look for it as a substring. - for (int32 i = kParserWordsNum - 1; i >= 0; i--) + for (int32 i = kParserWordsNum - 1; i >= 0; i--) { if (Common::String(kVocabulary[i]._word.c_str(), word.size()) == word) return kVocabulary[i]._number; + } return kPardon; } @@ -301,13 +304,14 @@ void Acci::cheatParse(Common::String codes) { void Acci::stripPunctuation(Common::String &word) { const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?"; - for (byte i = 0; i < 32; i++) - do { + for (byte i = 0; i < 32; i++) { + for (;;) { int16 pos = _vm->_parser->pos(Common::String(punct[i]), word); if (pos == -1) break; word.deleteChar(pos); - } while (true); + } + } } @@ -363,9 +367,11 @@ void Acci::properNouns() { _vm->_parser->_inputText.toLowercase(); // We set every word's first character to uppercase. - for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++) + for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++) { if (_vm->_parser->_inputText[i] == ' ') _vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1); + } + // And the first character as well. _vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0); } @@ -390,39 +396,35 @@ void Acci::storeInterrogation(byte interrogation) { _vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey); // If you want to use any other timer, put this into the case statement. switch (interrogation) { - case 1: { - _vm->_parser->_inputText.toLowercase(); - sayIt(); - _vm->_gyro->dna.like2drink = _vm->_parser->_inputText; - _vm->_gyro->dna.cardiff_things = 2; - } - break; - case 2: { - properNouns(); - sayIt(); - _vm->_gyro->dna.favourite_song = _vm->_parser->_inputText; - _vm->_gyro->dna.cardiff_things = 3; - } - break; - case 3: { - properNouns(); - sayIt(); - _vm->_gyro->dna.worst_place_on_earth = _vm->_parser->_inputText; - _vm->_gyro->dna.cardiff_things = 4; - } - break; - case 4: { - _vm->_parser->_inputText.toLowercase(); - sayIt(); - if (!_vm->_gyro->dna.spare_evening.empty()) - _vm->_gyro->dna.spare_evening.clear(); - _vm->_gyro->dna.spare_evening = _vm->_parser->_inputText; - _vm->_visa->dixi('z', 5); /* His closing statement... */ - _vm->_trip->tr[1].walkto(4); /* The end of the drawbridge */ - _vm->_trip->tr[1].vanishifstill = true; /* Then go away! */ - _vm->_gyro->magics[1].op = _vm->_gyro->nix; - _vm->_gyro->dna.cardiff_things = 5; - } + case 1: + _vm->_parser->_inputText.toLowercase(); + sayIt(); + _vm->_gyro->dna.like2drink = _vm->_parser->_inputText; + _vm->_gyro->dna.cardiff_things = 2; + break; + case 2: + properNouns(); + sayIt(); + _vm->_gyro->dna.favourite_song = _vm->_parser->_inputText; + _vm->_gyro->dna.cardiff_things = 3; + break; + case 3: + properNouns(); + sayIt(); + _vm->_gyro->dna.worst_place_on_earth = _vm->_parser->_inputText; + _vm->_gyro->dna.cardiff_things = 4; + break; + case 4: + _vm->_parser->_inputText.toLowercase(); + sayIt(); + if (!_vm->_gyro->dna.spare_evening.empty()) + _vm->_gyro->dna.spare_evening.clear(); + _vm->_gyro->dna.spare_evening = _vm->_parser->_inputText; + _vm->_visa->dixi('z', 5); /* His closing statement... */ + _vm->_trip->tr[1].walkto(4); /* The end of the drawbridge */ + _vm->_trip->tr[1].vanishifstill = true; /* Then go away! */ + _vm->_gyro->magics[1].op = _vm->_gyro->nix; + _vm->_gyro->dna.cardiff_things = 5; break; case 99: //store_high(_vm->_parser->_inputText); @@ -512,21 +514,24 @@ void Acci::parse() { // Delete words we already processed. int16 spacePos = _vm->_parser->pos(Common::String(' '), inputTextUpper); - if (spacePos > -1) + if (spacePos > -1) { for (byte i = 0; i <= spacePos; i++) inputTextUpper.deleteChar(0); + } + spacePos = _vm->_parser->pos(Common::String(' '), inputText); - if (spacePos > -1) + if (spacePos > -1) { for (byte i = 0; i <= spacePos; i++) inputText.deleteChar(0); + } } if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1) _unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)]; - else + else { if (!_unknown.empty()) _unknown.clear(); - + } // Replace words' codes that mean the same. replace(Common::String('\xFF'), 0); /* zap noise words */ replace(Common::String('\xD') + '\xE2', 1); // "look at" = "examine" @@ -577,24 +582,28 @@ void Acci::parse() { i++; } - if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) // Still not found. - for (i = 0; i < _thats.size() - 1; i++) + if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) { // Still not found. + for (i = 0; i < _thats.size() - 1; i++) { if ((byte)_thats[i] == 252) { // The word is "about", or something similar. _vm->_gyro->subjnumber = (byte)_thats[i + 1]; _thats.setChar(0, i + 1); break; } + } + } - if ((_vm->_gyro->subjnumber == 0) && !_thats.empty())// STILL not found! Must be the word after "say". - for (i = 0; i < _thats.size() - 1; i++) + if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say". + for (i = 0; i < _thats.size() - 1; i++) { if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) { // SAY not followed by a preposition _vm->_gyro->subjnumber = (byte)_thats[i + 1]; _thats.setChar(0, i + 1); break; } + } + } - for (int8 i = _thats.size() - 1; i >= 0; i--) // Reverse order, so first will be used. + for (int8 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used. if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49))) _verb = (byte)_thats[i]; else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) { @@ -604,12 +613,13 @@ void Acci::parse() { _person = (byte)_thats[i]; else if ((byte)_thats[i] == 251) _polite = true; + } - if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) { - _vm->_scrolls->display(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?"); - _vm->_gyro->weirdword = true; - } else - _vm->_gyro->weirdword = false; + if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) { + _vm->_scrolls->display(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?"); + _vm->_gyro->weirdword = true; + } else + _vm->_gyro->weirdword = false; if (_thats.empty()) _thats = kNothing; @@ -617,11 +627,12 @@ void Acci::parse() { if (_thing != kPardon) _vm->_gyro->it = _thing; - if (_person != kPardon) + if (_person != kPardon) { if (_person < 175) _vm->_gyro->him = _person; else _vm->_gyro->her = _person; + } } void Acci::examineObject() { @@ -709,8 +720,6 @@ bool Acci::holding() { return holdingResult; } - - void Acci::openBox(bool isOpening) { if ((_vm->_gyro->dna.room == r__yours) && (_thing == 54)) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); @@ -745,30 +754,29 @@ void Acci::examine() { } } else if (_person != kPardon) exampers(); - else _vm->_scrolls->display("It's just as it looks on the picture."); // Don't know: guess. + else + _vm->_scrolls->display("It's just as it looks on the picture."); // Don't know: guess. } - - void Acci::inventory() { byte itemNum = 0; _vm->_scrolls->display(Common::String("You're carrying ") + _vm->_scrolls->kControlToBuffer); - { - for (byte i = 0; i < numobjs; i++) - if (_vm->_gyro->dna.obj[i]) { - itemNum++; - if (itemNum == _vm->_gyro->dna.carrying) - _vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer); - _vm->_scrolls->display(_vm->_gyro->get_better(i + 1) + _vm->_scrolls->kControlToBuffer); - if ((i + 1) == _vm->_gyro->dna.wearing) - _vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer); - if (itemNum < _vm->_gyro->dna.carrying) - _vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer); - } - if (_vm->_gyro->dna.wearing == kNothing) - _vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!"); - else - _vm->_scrolls->display("."); + + for (byte i = 0; i < numobjs; i++) { + if (_vm->_gyro->dna.obj[i]) { + itemNum++; + if (itemNum == _vm->_gyro->dna.carrying) + _vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer); + _vm->_scrolls->display(_vm->_gyro->get_better(i + 1) + _vm->_scrolls->kControlToBuffer); + if ((i + 1) == _vm->_gyro->dna.wearing) + _vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer); + if (itemNum < _vm->_gyro->dna.carrying) + _vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer); + } + if (_vm->_gyro->dna.wearing == kNothing) + _vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!"); + else + _vm->_scrolls->display("."); } } @@ -776,18 +784,17 @@ void Acci::swallow() { /* Eat something. */ switch (_thing) { case Gyro::wine: switch (_vm->_gyro->dna.winestate) { /* 4 is perfect */ - case 1: { - if (_vm->_gyro->dna.teetotal) { - _vm->_visa->dixi('D', 6); - return; - } - _vm->_visa->dixi('U', 1); - _vm->_pingo->wobble(); - _vm->_visa->dixi('U', 2); - _vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false; - _vm->_lucerna->objectlist(); - drink(); + case 1: + if (_vm->_gyro->dna.teetotal) { + _vm->_visa->dixi('D', 6); + return; } + _vm->_visa->dixi('U', 1); + _vm->_pingo->wobble(); + _vm->_visa->dixi('U', 2); + _vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false; + _vm->_lucerna->objectlist(); + drink(); break; case 2: case 3: @@ -795,12 +802,11 @@ void Acci::swallow() { /* Eat something. */ break; /* You can't drink it! */ } break; - case Gyro::potion: { - _vm->_gyro->background(4); - _vm->_visa->dixi('U', 3); - _vm->_lucerna->gameover(); - _vm->_gyro->background(0); - } + case Gyro::potion: + _vm->_gyro->background(4); + _vm->_visa->dixi('U', 3); + _vm->_lucerna->gameover(); + _vm->_gyro->background(0); break; case Gyro::ink: _vm->_visa->dixi('U', 4); @@ -808,10 +814,9 @@ void Acci::swallow() { /* Eat something. */ case Gyro::chastity: _vm->_visa->dixi('U', 5); break; - case Gyro::mushroom: { - _vm->_visa->dixi('U', 6); - _vm->_lucerna->gameover(); - } + case Gyro::mushroom: + _vm->_visa->dixi('U', 6); + _vm->_lucerna->gameover(); break; case Gyro::onion: if (_vm->_gyro->dna.rotten_onion) @@ -833,15 +838,16 @@ void Acci::swallow() { /* Eat something. */ void Acci::peopleInRoom() { byte numPeople = 0; // Number of people in the room. - for (byte i = 1; i < 29; i++) // Start at 1 so we don't list Avvy himself! + for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself! if (_vm->_gyro->whereis[i] == _vm->_gyro->dna.room) numPeople++; + } if (numPeople == 0) // If nobody's here, we can cut out straight away. return; byte actPerson = 0; // Actually listed people. - for (byte i = 1; i < 29; i++) + for (byte i = 1; i < 29; i++) { if (_vm->_gyro->whereis[i] == _vm->_gyro->dna.room) { actPerson++; if (actPerson == 1) // First on the list. @@ -851,6 +857,7 @@ void Acci::peopleInRoom() { else // The end. _vm->_scrolls->display(Common::String(" and ") + _vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer); } + } if (numPeople == 1) _vm->_scrolls->display(Common::String(" is") + _vm->_scrolls->kControlToBuffer); @@ -921,11 +928,10 @@ void Acci::openDoor() { break; } - if ((!_vm->_gyro->dna.user_moves_avvy) && (_vm->_gyro->dna.room != r__lusties)) return; // No doors can open if you can't move Avvy. - for (byte fv = 8; fv < 15; fv++) + for (byte fv = 8; fv < 15; fv++) { if (_vm->_trip->infield(fv + 1)) { fv -= 8; @@ -951,6 +957,7 @@ void Acci::openDoor() { return; } + } if (_vm->_gyro->dna.room == r__map) _vm->_scrolls->display(Common::String("Avvy, you can complete the whole game without ever going " @@ -1130,8 +1137,6 @@ void Acci::cardiffClimbing() { } } - - void Acci::already() { _vm->_scrolls->display("You're already standing!"); } @@ -1272,11 +1277,12 @@ void Acci::winSequence() { } void Acci::personSpeaks() { - if ((_person == kPardon) || (_person == 0)) + if ((_person == kPardon) || (_person == 0)) { if ((_vm->_gyro->him == kPardon) || (_vm->_gyro->whereis[_vm->_gyro->him - 150] != _vm->_gyro->dna.room)) _person = _vm->_gyro->her; else _person = _vm->_gyro->him; + } if (_vm->_gyro->whereis[_person - 150] != _vm->_gyro->dna.room) { _vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself! @@ -1292,12 +1298,13 @@ void Acci::personSpeaks() { } } - if (!found) - for (byte i = 0; i < 16; i++) + if (!found) { + for (byte i = 0; i < 16; i++) { if ((_vm->_gyro->quasipeds[i].who == _person) && (_vm->_gyro->quasipeds[i].room == _vm->_gyro->dna.room)) _vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 65) + _vm->_scrolls->kControlToBuffer); + } + } } - void Acci::heyThanks() { personSpeaks(); _vm->_scrolls->display(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)"); @@ -1324,16 +1331,16 @@ void Acci::doThat() { if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp) - && (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir) - && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHighscores) && (_verb != kVerbCodeSmartAlec)) { - if (!_vm->_gyro->alive) { - _vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!")); - return; - } - if (!_vm->_gyro->dna.avvy_is_awake && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) { - _vm->_scrolls->display("Talking in your sleep? Try waking up!"); - return; - } + && (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir) + && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHighscores) && (_verb != kVerbCodeSmartAlec)) { + if (!_vm->_gyro->alive) { + _vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!")); + return; + } + if (!_vm->_gyro->dna.avvy_is_awake && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) { + _vm->_scrolls->display("Talking in your sleep? Try waking up!"); + return; + } } switch (_verb) { @@ -1527,19 +1534,18 @@ void Acci::doThat() { _vm->_scrolls->display("Just use the arrow keys to walk there."); break; case kVerbCodeInfo: { - _vm->_scrolls->aboutscroll = true; - - Common::String toDisplay; - for (byte i = 0; i < 7; i++) - toDisplay += _vm->_scrolls->kControlNewLine; - toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine - + "The medi‘val descendant of" + _vm->_scrolls->kControlNewLine - + "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine - + "version " + _vm->_gyro->vernum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright ï " - + _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon; - _vm->_scrolls->display(toDisplay); - - _vm->_scrolls->aboutscroll = false; + _vm->_scrolls->aboutscroll = true; + + Common::String toDisplay; + for (byte i = 0; i < 7; i++) + toDisplay += _vm->_scrolls->kControlNewLine; + toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine + + "The medi‘val descendant of" + _vm->_scrolls->kControlNewLine + + "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + + "version " + _vm->_gyro->vernum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright ï " + + _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon; + _vm->_scrolls->display(toDisplay); + _vm->_scrolls->aboutscroll = false; } break; case kVerbCodeUndress: @@ -1635,7 +1641,7 @@ void Acci::doThat() { } } else if (holding()) { switch (_thing) { - case Gyro::lute : { + case Gyro::lute : _vm->_visa->dixi('U', 7); if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] == _vm->_gyro->dna.room) @@ -1643,7 +1649,6 @@ void Acci::doThat() { if (_vm->_gyro->whereis[_vm->_gyro->pdulustie - 150] == _vm->_gyro->dna.room) _vm->_visa->dixi('U', 15); - } break; case 52: if (_vm->_gyro->dna.room == r__musicroom) -- cgit v1.2.3 From 93a5fadcb82e6f9dd97a24442a7f694babce04a5 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 13:58:12 +0200 Subject: AVALANCHE: Fix error reported by GCC: extra coma in enum declaraction --- engines/avalanche/closing2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h index 14cf54bbf3..89e2d7358a 100644 --- a/engines/avalanche/closing2.h +++ b/engines/avalanche/closing2.h @@ -49,7 +49,7 @@ private: kScreenBugAlert = 1, kScreenRamCram = 2, kScreenNagScreen = 3, - kScreenTwoCopies = 5, + kScreenTwoCopies = 5 }; AvalancheEngine *_vm; -- cgit v1.2.3 From 3f3757e03f6e0eaa735235779146cb9f482827c0 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 14:08:00 +0200 Subject: AVALANCHE: Use a class-key when declaring a friend class --- engines/avalanche/dropdown2.h | 6 +++--- engines/avalanche/trip6.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h index 7b8f972330..105b2b8339 100644 --- a/engines/avalanche/dropdown2.h +++ b/engines/avalanche/dropdown2.h @@ -118,9 +118,9 @@ private: class Dropdown { public: - friend headtype; - friend onemenu; - friend menuset; + friend class headtype; + friend class onemenu; + friend class menuset; onemenu ddm_o; menuset ddm_m; diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h index f91e72c2f3..a4316336cd 100644 --- a/engines/avalanche/trip6.h +++ b/engines/avalanche/trip6.h @@ -145,8 +145,8 @@ public: class Trip { public: - friend triptype; - friend getsettype; + friend class triptype; + friend class getsettype; -- cgit v1.2.3 From bbaa645b6cb9480505f21556e0460368cc7a753c Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 14:10:15 +0200 Subject: AVALANCHE: Fix error reported by GCC: extra coma in enum declaraction in acci2 --- engines/avalanche/acci2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h index e09c72ec22..4937bb47d4 100644 --- a/engines/avalanche/acci2.h +++ b/engines/avalanche/acci2.h @@ -89,7 +89,7 @@ public: kVerbCodeHello = 46, kVerbCodeThanks = 47, kVerbCodeSmartAlec = 249, - kVerbCodeExpletive = 253, + kVerbCodeExpletive = 253 }; static const byte kPardon = 254; // Didn't understand / wasn't given. -- cgit v1.2.3 From 316e84a4d4db512c4f49bfbd7a7b01588e2ebe94 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 14:56:05 +0200 Subject: AVALANCHE: cleanup acci2.h --- engines/avalanche/acci2.cpp | 12 ++--- engines/avalanche/acci2.h | 123 +++++++++----------------------------------- 2 files changed, 28 insertions(+), 107 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index ef6631184c..167faf1188 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -284,12 +284,6 @@ Common::String Acci::totalTime() { return result + _vm->_gyro->strf(s) + " seconds."; } - - -void Acci::number(Common::String &codes) { - warning("STUB: Acci::number()"); -} - void Acci::cheatParse(Common::String codes) { // uint16 num; // int16 e; @@ -1332,7 +1326,7 @@ void Acci::doThat() { if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp) && (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir) - && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHighscores) && (_verb != kVerbCodeSmartAlec)) { + && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) { if (!_vm->_gyro->alive) { _vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!")); return; @@ -1885,7 +1879,7 @@ void Acci::doThat() { } else _vm->_visa->dixi('Q', 10); break; - case kVerbCodePassword: + case kVerbCodePasswd: if (_vm->_gyro->dna.room != r__bridge) _vm->_visa->dixi('Q', 12); else { @@ -1959,7 +1953,7 @@ void Acci::doThat() { _vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->reason_jumping); _vm->_gyro->dna.user_moves_avvy = false; break; - case kVerbCodeHighscores: + case kVerbCodeHiscores: // show_highs(); warning("STUB: Acci::doThat() - case kVerbCodehighscores"); break; diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h index 4937bb47d4..d881eab222 100644 --- a/engines/avalanche/acci2.h +++ b/engines/avalanche/acci2.h @@ -41,67 +41,24 @@ class AvalancheEngine; class Acci { public: enum VerbCode { - kVerbCodeExam = 1, - kVerbCodeOpen = 2, - kVerbCodePause = 3, - kVerbCodeGet = 4, - kVerbCodeDrop = 5, - kVerbCodeInv = 6, - kVerbCodeTalk = 7, - kVerbCodeGive = 8, - kVerbCodeDrink = 9, - kVerbCodeLoad = 10, - kVerbCodeSave = 11, - kVerbCodePay = 12, - kVerbCodeLook = 13, - kVerbCodeBreak = 14, - kVerbCodeQuit = 15, - kVerbCodeSit = 16, - kVerbCodeStand = 17, - kVerbCodeGo = 18, - kVerbCodeInfo = 19, - kVerbCodeUndress = 20, - kVerbCodeWear = 21, - kVerbCodePlay = 22, - kVerbCodeRing = 23, - kVerbCodeHelp = 24, - kVerbCodeLarrypass = 25, - kVerbCodePhaon = 26, - kVerbCodeBoss = 27, - kVerbCodePee = 28, - kVerbCodeCheat = 29, - kVerbCodeMagic = 30, - kVerbCodeRestart = 31, - kVerbCodeEat = 32, - kVerbCodeListen = 33, - kVerbCodeBuy = 34, - kVerbCodeAttack = 35, - kVerbCodePassword = 36, - kVerbCodeDir = 37, - kVerbCodeDie = 38, - kVerbCodeScore = 39, - kVerbCodePut = 40, - kVerbCodeKiss = 41, - kVerbCodeClimb = 42, - kVerbCodeJump = 43, - kVerbCodeHighscores = 44, - kVerbCodeWake = 45, - kVerbCodeHello = 46, - kVerbCodeThanks = 47, - kVerbCodeSmartAlec = 249, - kVerbCodeExpletive = 253 + kVerbCodeExam = 1, kVerbCodeOpen = 2, kVerbCodePause = 3, kVerbCodeGet = 4, kVerbCodeDrop = 5, + kVerbCodeInv = 6, kVerbCodeTalk = 7, kVerbCodeGive = 8, kVerbCodeDrink = 9, kVerbCodeLoad = 10, + kVerbCodeSave = 11, kVerbCodePay = 12, kVerbCodeLook = 13, kVerbCodeBreak = 14, kVerbCodeQuit = 15, + kVerbCodeSit = 16, kVerbCodeStand = 17, kVerbCodeGo = 18, kVerbCodeInfo = 19, kVerbCodeUndress = 20, + kVerbCodeWear = 21, kVerbCodePlay = 22, kVerbCodeRing = 23, kVerbCodeHelp = 24, kVerbCodeLarrypass = 25, + kVerbCodePhaon = 26, kVerbCodeBoss = 27, kVerbCodePee = 28, kVerbCodeCheat = 29, kVerbCodeMagic = 30, + kVerbCodeRestart = 31, kVerbCodeEat = 32, kVerbCodeListen = 33, kVerbCodeBuy = 34, kVerbCodeAttack = 35, + kVerbCodePasswd = 36, kVerbCodeDir = 37, kVerbCodeDie = 38, kVerbCodeScore = 39, kVerbCodePut = 40, + kVerbCodeKiss = 41, kVerbCodeClimb = 42, kVerbCodeJump = 43, kVerbCodeHiscores = 44, kVerbCodeWake = 45, + kVerbCodeHello = 46, kVerbCodeThanks = 47, kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253 }; static const byte kPardon = 254; // Didn't understand / wasn't given. - static const int16 kParserWordsNum = 277; // How many words does the parser know? static const byte kNothing = 250; static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.) - static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS". - - struct VocabEntry { byte _number; Common::String _word; @@ -109,102 +66,72 @@ public: static const VocabEntry kVocabulary[kParserWordsNum]; - static const char kWhat[]; + Common::String _realWords[11]; + byte _verb, _person, _thing; + bool _polite; + Acci(AvalancheEngine *vm); + void init(); + void parse(); + void doThat(); + void verbOpt(byte verb, Common::String &answer, char &ansKey); + void drink(); +private: struct RankType { uint16 _score; Common::String _title; }; static const RankType kRanks[9]; - - + static const char kWhat[]; Common::String _thats; Common::String _unknown; - Common::String _realWords[11]; - byte _verb, _person, _thing, _thing2; - bool _polite; + byte _thing2; - - - Acci(AvalancheEngine *vm); - - void init(); - - void clearWords(); - void parse(); - void lookAround(); // This is called when you say "look". - void openDoor(); - void doThat(); - void verbOpt(byte verb, Common::String &answer, char &ansKey); - void drink(); - -private: AvalancheEngine *_vm; - byte fv; - byte wordNum(Common::String word); void replace(Common::String oldChars, byte newChar); Common::String rank(); Common::String totalTime(); - void number(Common::String &codes); + void clearWords(); void cheatParse(Common::String codes); - void stripPunctuation(Common::String &word); // Strips punctuation from word. - void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective! bool doPronouns(); - void properNouns(); + void lookAround(); // This is called when you say "look". void sayIt(); // This makes Avalot say the response. + void openDoor(); void storeInterrogation(byte interrogation); - void examineObject(); // Examine a standard object-thing - bool isPersonHere(); - void exampers(); - bool holding(); - void openBox(bool isOpening); void examine(); - void inventory(); - void swallow(); - void peopleInRoom(); // This lists the other people in the room. - void silly(); void putProc(); // Called when you call kVerbCodeput. - void notInOrder(); void goToCauldron(); bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!". - void cardiffClimbing(); - void already(); void standUp(); // Called when you ask Avvy to stand. - void getProc(char thing); - void giveGeidaTheLute(); - void playHarp(); - void winSequence(); - void personSpeaks(); - void heyThanks(); }; -- cgit v1.2.3 From 41416f0c0529fe43040c640c83160aa076b7fc80 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 16:10:48 +0200 Subject: AVALANCHE: Clean up celer2 --- engines/avalanche/celer2.cpp | 114 +++++++++++++++++++++---------------------- engines/avalanche/celer2.h | 14 ------ 2 files changed, 55 insertions(+), 73 deletions(-) diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index a84d15116f..d7f318f863 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -37,14 +37,10 @@ #include "common/textconsole.h" - - namespace Avalanche { const int16 Celer::kOnDisk = -1; - - Celer::Celer(AvalancheEngine *vm) { _vm = vm; _spriteNum = 0; @@ -54,7 +50,6 @@ Celer::~Celer() { forgetBackgroundSprites(); } - /** * @remarks Originally called 'pics_link' */ @@ -79,61 +74,60 @@ void Celer::updateBackgroundSprites() { if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % 4) == 0)) drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 2); break; - case r__argentpub: { - if (((_vm->_gyro->roomtime % 7) == 1) && (_vm->_gyro->dna.malagauche != 177)) { - // Malagauche cycle. - _vm->_gyro->dna.malagauche += 1; - switch (_vm->_gyro->dna.malagauche) { - case 1: - case 11: - case 21: - drawBackgroundSprite(-1, -1, 12); // Looks forwards. - break; - case 8: - case 18: - case 28: - case 32: - drawBackgroundSprite(-1, -1, 11); // Looks at you. - break; - case 30: - drawBackgroundSprite(-1, -1, 13); // Winks. - break; - case 33: - _vm->_gyro->dna.malagauche = 0; - break; - } - } - - switch (_vm->_gyro->roomtime % 200) { - case 179: - case 197: - drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle. + case r__argentpub: + if (((_vm->_gyro->roomtime % 7) == 1) && (_vm->_gyro->dna.malagauche != 177)) { + // Malagauche cycle. + _vm->_gyro->dna.malagauche += 1; + switch (_vm->_gyro->dna.malagauche) { + case 1: + case 11: + case 21: + drawBackgroundSprite(-1, -1, 12); // Looks forwards. break; - case 182: - case 194: - drawBackgroundSprite(-1, -1, 6); - break; - case 185: - drawBackgroundSprite(-1, -1, 7); - break; - case 199: - _vm->_gyro->dna.dogfoodpos = 177; // Impossible value for this. + case 8: + case 18: + case 28: + case 32: + drawBackgroundSprite(-1, -1, 11); // Looks at you. + break; + case 30: + drawBackgroundSprite(-1, -1, 13); // Winks. break; + case 33: + _vm->_gyro->dna.malagauche = 0; + break; } + } - if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally. - byte direction = 0; - if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360))) - direction = 3; - else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357)) - direction = 2; - else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292)) - direction = 4; - - if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed. - drawBackgroundSprite(-1, -1, direction); - _vm->_gyro->dna.dogfoodpos = direction; - } + switch (_vm->_gyro->roomtime % 200) { + case 179: + case 197: + drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle. + break; + case 182: + case 194: + drawBackgroundSprite(-1, -1, 6); + break; + case 185: + drawBackgroundSprite(-1, -1, 7); + break; + case 199: + _vm->_gyro->dna.dogfoodpos = 177; // Impossible value for this. + break; + } + + if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally. + byte direction = 0; + if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360))) + direction = 3; + else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357)) + direction = 2; + else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292)) + direction = 4; + + if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed. + drawBackgroundSprite(-1, -1, direction); + _vm->_gyro->dna.dogfoodpos = direction; } } break; @@ -305,9 +299,10 @@ void Celer::loadBackgroundSprites(byte number) { _sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1; _sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8()); - for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) + for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) { for (uint16 x = 0; x < _sprites[i]._xl * 8; x++) *(byte *)_sprites[i]._picture.getBasePtr(x, y) = *_vm->_graphics->getPixel(_sprites[i]._x * 8 + x, _sprites[i]._y + y); + } } else { _sprites[i]._size = sprite._size; _sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1); @@ -319,9 +314,10 @@ void Celer::loadBackgroundSprites(byte number) { } void Celer::forgetBackgroundSprites() { - for (byte i = 0; i < _spriteNum; i++) + for (byte i = 0; i < _spriteNum; i++) { if (_sprites[i]._x > kOnDisk) _sprites[i]._picture.free(); + } } void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) { @@ -378,7 +374,7 @@ void Celer::drawSprite(int16 x, int16 y, const SpriteType &sprite) { _r.y2 = y + sprite._yl; switch (sprite._type) { - case kNaturalImage: // Allow fallthorugh on purpose. + case kNaturalImage: // Allow fallthrough on purpose. case kBgi: _r.x2 = x + sprite._xl + 1; break; diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h index 56c5f22d09..fe38ebe917 100644 --- a/engines/avalanche/celer2.h +++ b/engines/avalanche/celer2.h @@ -36,23 +36,16 @@ #include "graphics/surface.h" - - namespace Avalanche { class AvalancheEngine; class Celer { public: Celer(AvalancheEngine *vm); - ~Celer(); - - void updateBackgroundSprites(); - void loadBackgroundSprites(byte number); - void forgetBackgroundSprites(); // Setting the destination to negative coordinates means the picture should be drawn to it's original position. @@ -71,8 +64,6 @@ private: ::Graphics::Surface _picture; }; - - AvalancheEngine *_vm; int32 _offsets[40]; @@ -80,13 +71,8 @@ private: SpriteType _sprites[40]; bytefield _r; Common::String _filename; - - - static const int16 kOnDisk; /* Value of memos[fv].x when it's not in memory. */ - - void drawSprite(int16 x, int16 y, const SpriteType &sprite); }; -- cgit v1.2.3 From 70aa840f0ba482271b8379685a40e59fb115fd8c Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 16:52:44 +0200 Subject: AVALANCHE: Fix GCC warnings reported by GCC --- engines/avalanche/avalanche.cpp | 27 ++++++++++++++------------- engines/avalanche/avalot.cpp | 4 ++++ engines/avalanche/graphics.cpp | 2 +- engines/avalanche/parser.cpp | 2 ++ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index a00701456e..564f9faee4 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -207,40 +207,37 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { } else { if (!_gyro->dna.like2drink.empty()) _gyro->dna.like2drink.clear(); - uint16 like2drinkSize; + uint16 like2drinkSize = 0; + char actChr = ' '; sz.syncAsUint16LE(like2drinkSize); for (uint16 i = 0; i < like2drinkSize; i++) { - char actChr; sz.syncAsByte(actChr); _gyro->dna.like2drink += actChr; } if (!_gyro->dna.favourite_song.empty()) _gyro->dna.favourite_song.clear(); - uint16 favourite_songSize; + uint16 favourite_songSize = 0; sz.syncAsUint16LE(favourite_songSize); for (uint16 i = 0; i < favourite_songSize; i++) { - char actChr; sz.syncAsByte(actChr); _gyro->dna.favourite_song += actChr; } if (!_gyro->dna.worst_place_on_earth.empty()) _gyro->dna.worst_place_on_earth.clear(); - uint16 worst_place_on_earthSize; + uint16 worst_place_on_earthSize = 0; sz.syncAsUint16LE(worst_place_on_earthSize); for (uint16 i = 0; i < worst_place_on_earthSize; i++) { - char actChr; sz.syncAsByte(actChr); _gyro->dna.worst_place_on_earth += actChr; } if (!_gyro->dna.spare_evening.empty()) _gyro->dna.spare_evening.clear(); - uint16 spare_eveningSize; + uint16 spare_eveningSize = 0; sz.syncAsUint16LE(spare_eveningSize); for (uint16 i = 0; i < spare_eveningSize; i++) { - char actChr; sz.syncAsByte(actChr); _gyro->dna.spare_evening += actChr; } @@ -285,20 +282,21 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { // } //} - byte spriteNum; + byte spriteNum = 0; if (sz.isSaving()) { - spriteNum = 0; - for (byte i = 0; i < _trip->numtr; i++) + for (byte i = 0; i < _trip->numtr; i++) { if (_trip->tr[i].quick) spriteNum++; + } } sz.syncAsByte(spriteNum); - if (sz.isLoading()) + if (sz.isLoading()) { for (byte i = 0; i < _trip->numtr; i++) { // Deallocate sprites. if (_trip->tr[i].quick) _trip->tr[i].done(); } + } for (byte i = 0; i < spriteNum; i++) { sz.syncAsByte(_trip->tr[i].whichsprite); @@ -364,7 +362,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) { return false; } - char *signature = "AVAL"; + const char *signature = "AVAL"; f->write(signature, 4); // Write version. We can't restore from obsolete versions. @@ -536,6 +534,9 @@ void AvalancheEngine::updateEvents() { break; case Common::EVENT_KEYDOWN: _avalot->handleKeyDown(event); + break; + default: + break; } } } diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index c791a77ed6..12bdbd0373 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -97,6 +97,8 @@ void Avalot::handleKeyDown(Common::Event &event) { case Common::KEYCODE_KP1: event.kbd.keycode = Common::KEYCODE_END; break; + default: + break; } switch (event.kbd.keycode) { @@ -120,6 +122,8 @@ void Avalot::handleKeyDown(Common::Event &event) { case Common::KEYCODE_RETURN: _vm->_parser->handleReturn(); break; + default: + break; } _vm->_lucerna->showrw(); diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index b4ee2a7a3f..35ccd5ff2e 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -177,7 +177,7 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 xTemp = xNext; int16 yTemp = yNext; // This is used by both sin and cos. - double tempTerm = (j+delta)*convfac; + tempTerm = (j + delta) * convfac; xNext = floor(xRadius*cos(tempTerm) + 0.5); yNext = floor(yRadius*sin(tempTerm + pi) + 0.5); diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 67b893f32f..c8a04ae3ae 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -101,6 +101,8 @@ void Parser::handleFunctionKey(const Common::Event &event) { case Common::KEYCODE_F7: _vm->_lucerna->callverb(_vm->_acci->kVerbCodeOpen); break; + default: + break; } } -- cgit v1.2.3 From 6818dd2eb4749d4b96d8bf6f4b6b2d0b4d2d8753 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 17:15:33 +0200 Subject: AVALANCHE: Fix some more GCC warnings --- engines/avalanche/acci2.cpp | 6 ++++-- engines/avalanche/trip6.cpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 167faf1188..9ce3180a41 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -1556,7 +1556,8 @@ void Acci::doThat() { if (holding()) { // Wear something. switch (_thing) { case Gyro::chastity: - _vm->_scrolls->display("Hey, kWhat kind of a weirdo are you??!"); + // \? are used to avoid that ??! is parsed as a trigraph + _vm->_scrolls->display("Hey, kWhat kind of a weirdo are you\?\?!"); break; case Gyro::clothes: case Gyro::habit: { /* Change this! */ @@ -1667,7 +1668,8 @@ void Acci::doThat() { if (_thing == _vm->_gyro->bell) { _vm->_scrolls->display("Ding, dong, ding, dong, ding, dong, ding, dong..."); if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B'))) - _vm->_scrolls->display("(Are you trying to join in, Avvy??!)"); + // \? are used to avoid that ??! is parsed as a trigraph + _vm->_scrolls->display("(Are you trying to join in, Avvy\?\?!)"); } else _vm->_scrolls->display(kWhat); } diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index 417a92056e..e07607a4d5 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -1646,6 +1646,8 @@ void Trip::handleMoveKey(const Common::Event &event) { case Common::KEYCODE_KP5: stopwalking(); break; + default: + break; } } -- cgit v1.2.3 From ad5529b5d27748f34cbd978eb3c0040e3a2d266f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 4 Sep 2013 17:54:08 +0200 Subject: AVALANCHE: Fix more GCC warnings --- engines/avalanche/dropdown2.cpp | 36 +++++++++++++++++++----------------- engines/avalanche/dropdown2.h | 2 +- engines/avalanche/gyro2.cpp | 12 ++++++------ engines/avalanche/gyro2.h | 23 +++-------------------- engines/avalanche/lucerna2.cpp | 26 ++++++++++++++------------ engines/avalanche/scrolls2.cpp | 5 ++--- engines/avalanche/sequence2.cpp | 4 ++-- engines/avalanche/trip6.cpp | 16 +++++++--------- engines/avalanche/trip6.h | 4 ++-- 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); -- cgit v1.2.3