From dc3477b092492b085c71684321d6e8367dbaaead Mon Sep 17 00:00:00 2001 From: uruk Date: Sun, 16 Feb 2014 22:12:35 +0100 Subject: AVALANCHE: Implement ShootEmUp::setup() and connected functions. --- engines/avalanche/graphics.cpp | 2 +- engines/avalanche/shootemup.cpp | 107 ++++++++++++++++++++++++++++++++++++---- engines/avalanche/shootemup.h | 43 +++++++++++++++- 3 files changed, 141 insertions(+), 11 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index ab1a108194..8b94e9a09f 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -744,7 +744,7 @@ void GraphicManager::seuFree() { } /** - * @remarks Originally called 'display' + * @remarks Originally called 'display' and it also replaces 'display_const' */ void GraphicManager::seuDrawPicture(int x, int y, byte which) { drawPicture(_surface, _seuPictures[which], x, y); diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 79720fcb8c..0d6e0df42e 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -32,13 +32,54 @@ namespace Avalanche { -const byte ShootEmUp::kFacingRight = 87; const byte ShootEmUp::kStocks = 27; +const byte ShootEmUp::kFacingRight = 87; +const byte ShootEmUp::kFacingLeft = 93; +const long int ShootEmUp::kFlag = -20047; ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _vm = vm; _time = 0; + for (int i = 0; i < 7; i++) + _stockStatus[i] = 0; + for (int i = 0; i < 99; i++) { + _sprites[i]._ix = 0; + _sprites[i]._iy = 0; + _sprites[i]._x = 0; + _sprites[i]._y = 0; + _sprites[i]._p = 0; + _sprites[i]._timeout = 0; + _sprites[i]._cameo = false; + _sprites[i]._cameoFrame = 0; + _sprites[i]._missile = false; + _sprites[i]._wipe = false; + } + _rectNum = 0; + _avvyWas = 0; + _avvyPos = 0; + _avvyAnim = 0; + _avvyFacing = 0; + _altWasPressedBefore = false; + _throwNext = 0; + _firing = false; + for (int i = 0; i < 4; i++) { + _running[i]._x = 0; + _running[i]._y = 0; + _running[i]._frame = 0; + _running[i]._tooHigh = 0; + _running[i]._lowest = 0; + _running[i]._ix = 0; + _running[i]._iy = 0; + _running[i]._frameDelay = 0; + } + for (int i = 0; i < 7; i++) + _hasEscaped[i] = false; + _count321 = 0; + _howManyHaveEscaped = 0; + _escapeCount = 0; + _escaping = false; + _timeThisSecond = 0; } void ShootEmUp::run() { @@ -62,10 +103,7 @@ void ShootEmUp::run() { } setup(); - initRunner(20, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2); - initRunner(600, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2); - initRunner(600, 100, 61, 67, -(_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); - initRunner(20, 100, 61, 67, -(_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); + do { blankIt(); hitPeople(); @@ -123,12 +161,24 @@ void ShootEmUp::showStock(byte x) { warning("STUB: ShootEmUp::showStock()"); } +void ShootEmUp::drawNumber(int number, int size, int x) { + for (int i = 0; i < size - 1; i++) { + int divisor = 10; + for (int j = 0; j < size - 2 - i; j++) + divisor *= 10; + char value = number / divisor; + _vm->_graphics->seuDrawPicture(x + i * 10, 0, value); + number -= value * divisor; + } + _vm->_graphics->seuDrawPicture(x + (size - 1) * 10, 0, number % 10); +} + void ShootEmUp::showScore() { - warning("STUB: ShootEmUp::showScore()"); + drawNumber(_score, 5, 40); } void ShootEmUp::showTime() { - warning("STUB: ShootEmUp::showTime()"); + drawNumber(_time, 3, 140); } void ShootEmUp::gain(int8 howMuch) { @@ -136,7 +186,8 @@ void ShootEmUp::gain(int8 howMuch) { } void ShootEmUp::newEscape() { - warning("STUB: ShootEmUp::newEscape()"); + _escapeCount = _vm->_rnd->getRandomNumber(17) * 20; + _escaping = false; } void ShootEmUp::nextPage() { @@ -195,7 +246,45 @@ void ShootEmUp::instructions() { } void ShootEmUp::setup() { - warning("STUB: ShootEmUp::setup()"); + _score = 0; + _time = 120; + + for (int i = 0; i < 7; i++) { + _stockStatus[i] = _vm->_rnd->getRandomNumber(1); + showStock(i); + } + + _avvyWas = 320; + _avvyPos = 320; + _avvyAnim = 1; + _avvyFacing = kFacingLeft; + + _altWasPressedBefore = false; + _throwNext = 74; + _firing = false; + + for (int i = 0; i < 4; i++) + _running[i]._x = kFlag; + + newEscape(); + + _count321 = 255; // Counting down. + + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); // Black out the whole screen. + + // Set up status line: + _vm->_graphics->seuDrawPicture(0, 0, 16); // Score: + showScore(); // Value of score (00000 here). + _vm->_graphics->seuDrawPicture(110, 0, 19); // Time: + showTime(); // Value of time. + + _vm->_graphics->refreshScreen(); + + // From the original core cycle: + initRunner(20, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2); + initRunner(600, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2); + initRunner(600, 100, 61, 67, -(_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); + initRunner(20, 100, 61, 67, -(_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); } void ShootEmUp::initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8 iyy) { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index b2cf8ba34a..21b5a76fb0 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -38,12 +38,52 @@ public: void run(); private: - static const byte kFacingRight; + struct Sprite { + int8 _ix, _iy; + int16 _x, _y; + byte _p; + int16 _timeout; + bool _cameo; + byte _cameoFrame; + bool _missile; + bool _wipe; + }; + + struct Runner { + int16 _x, _y; + byte _frame; + byte _tooHigh; + byte _lowest; + int8 _ix, _iy; + byte _frameDelay; + }; + static const byte kStocks; + static const byte kFacingRight; + static const byte kFacingLeft; + static const long int kFlag; AvalancheEngine *_vm; + uint16 _score; byte _time; + byte _stockStatus[7]; + Sprite _sprites[99]; + byte _rectNum; // Original: 'rsize' + uint16 _avvyWas; + uint16 _avvyPos; + byte _avvyAnim; + byte _avvyFacing; + bool _altWasPressedBefore; + byte _throwNext; + bool _firing; + Runner _running[4]; + bool _hasEscaped[7]; + byte _count321; + byte _howManyHaveEscaped; + uint16 _escapeCount; + bool _escaping; + byte _timeThisSecond; bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y); byte getStockNumber(byte x); @@ -53,6 +93,7 @@ private: void define(int16 xx, int16 yy, byte pp, int8 ixx, int8 iyy, int16 time, bool isAMissile, bool doWeWipe); void defineCameo(int16 xx, int16 yy, byte pp, int16 time); void showStock(byte x); + void drawNumber(int number, int size, int x); void showScore(); void showTime(); void gain(int8 howMuch); -- cgit v1.2.3 From 591b38ed427f4c2074a47cfe78c016fe4c547a16 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 16 Feb 2014 22:52:33 +0100 Subject: AVALANCHE: Silence warnings in MSVC --- engines/avalanche/shootemup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 0d6e0df42e..03addc62b6 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -283,8 +283,8 @@ void ShootEmUp::setup() { // From the original core cycle: initRunner(20, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2); initRunner(600, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2); - initRunner(600, 100, 61, 67, -(_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); - initRunner(20, 100, 61, 67, -(_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); + initRunner(600, 100, 61, 67, (-(int8)_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); + initRunner(20, 100, 61, 67, (-(int8)_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); } void ShootEmUp::initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8 iyy) { -- cgit v1.2.3 From 854de79c236641bdb3414f727d9fee62e70ac463 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:18 +0100 Subject: AVALANCHE: Make GPL headers consistent in themselves. --- engines/avalanche/animation.cpp | 4 ++-- engines/avalanche/animation.h | 4 ++-- engines/avalanche/avalanche.cpp | 6 +++--- engines/avalanche/avalanche.h | 6 +++--- engines/avalanche/avalot.cpp | 6 +++--- engines/avalanche/avalot.h | 6 +++--- engines/avalanche/background.cpp | 4 ++-- engines/avalanche/background.h | 4 ++-- engines/avalanche/clock.cpp | 40 ++++++++++++++++++++-------------------- engines/avalanche/clock.h | 40 ++++++++++++++++++++-------------------- engines/avalanche/closing.cpp | 4 ++-- engines/avalanche/closing.h | 4 ++-- engines/avalanche/console.cpp | 6 +++--- engines/avalanche/console.h | 6 +++--- engines/avalanche/detection.cpp | 6 +++--- engines/avalanche/dialogs.cpp | 6 +++--- engines/avalanche/dialogs.h | 6 +++--- engines/avalanche/enums.h | 6 +++--- engines/avalanche/ghostroom.cpp | 40 ++++++++++++++++++++-------------------- engines/avalanche/ghostroom.h | 40 ++++++++++++++++++++-------------------- engines/avalanche/graphics.cpp | 6 +++--- engines/avalanche/graphics.h | 6 +++--- engines/avalanche/help.cpp | 40 ++++++++++++++++++++-------------------- engines/avalanche/help.h | 40 ++++++++++++++++++++-------------------- engines/avalanche/menu.cpp | 4 ++-- engines/avalanche/menu.h | 4 ++-- engines/avalanche/nim.cpp | 6 +++--- engines/avalanche/nim.h | 6 +++--- engines/avalanche/parser.cpp | 6 +++--- engines/avalanche/parser.h | 6 +++--- engines/avalanche/sequence.cpp | 4 ++-- engines/avalanche/sequence.h | 4 ++-- engines/avalanche/shootemup.cpp | 40 ++++++++++++++++++++-------------------- engines/avalanche/shootemup.h | 40 ++++++++++++++++++++-------------------- engines/avalanche/sound.cpp | 4 ++-- engines/avalanche/sound.h | 4 ++-- engines/avalanche/timer.cpp | 4 ++-- engines/avalanche/timer.h | 4 ++-- 38 files changed, 236 insertions(+), 236 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 74dd2100e5..1ec3dbd4d2 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h index aa4e6482a4..375d117893 100644 --- a/engines/avalanche/animation.h +++ b/engines/avalanche/animation.h @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 073b9a9425..8158536a0c 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index d2e5678ae9..9d6ab1693a 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 6648e8d961..2e89287f58 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h index 9afb4a7b63..04b945fd20 100644 --- a/engines/avalanche/avalot.h +++ b/engines/avalanche/avalot.h @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp index f49d103df3..e5b66c509b 100644 --- a/engines/avalanche/background.cpp +++ b/engines/avalanche/background.cpp @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h index 67020c861d..98d6d36fed 100644 --- a/engines/avalanche/background.h +++ b/engines/avalanche/background.h @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/clock.cpp b/engines/avalanche/clock.cpp index 1c2c50c3bf..6d398d9921 100644 --- a/engines/avalanche/clock.cpp +++ b/engines/avalanche/clock.cpp @@ -1,24 +1,24 @@ /* 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. -* -*/ + * + * 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. diff --git a/engines/avalanche/clock.h b/engines/avalanche/clock.h index 68e8e119f0..85ea508a80 100644 --- a/engines/avalanche/clock.h +++ b/engines/avalanche/clock.h @@ -1,24 +1,24 @@ /* 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. -* -*/ + * + * 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. diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp index 1cb2e84218..552b71b563 100644 --- a/engines/avalanche/closing.cpp +++ b/engines/avalanche/closing.cpp @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h index 25217e347e..6e65deb310 100644 --- a/engines/avalanche/closing.h +++ b/engines/avalanche/closing.h @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/console.cpp b/engines/avalanche/console.cpp index e4b52116e4..29ae5cf9c3 100644 --- a/engines/avalanche/console.cpp +++ b/engines/avalanche/console.cpp @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/console.h b/engines/avalanche/console.h index 166515d913..b5b5fb63fc 100644 --- a/engines/avalanche/console.h +++ b/engines/avalanche/console.h @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp index 5f4f03a78b..028f167e70 100644 --- a/engines/avalanche/detection.cpp +++ b/engines/avalanche/detection.cpp @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index 2174df3580..b175464f0c 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h index defd152db5..4b50a61732 100644 --- a/engines/avalanche/dialogs.h +++ b/engines/avalanche/dialogs.h @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h index 23192863f1..998c96a131 100644 --- a/engines/avalanche/enums.h +++ b/engines/avalanche/enums.h @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp index 6bd0da7834..3323e538ef 100644 --- a/engines/avalanche/ghostroom.cpp +++ b/engines/avalanche/ghostroom.cpp @@ -1,24 +1,24 @@ /* 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. -* -*/ + * + * 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. diff --git a/engines/avalanche/ghostroom.h b/engines/avalanche/ghostroom.h index b4917d8cb4..ebb02f7aac 100644 --- a/engines/avalanche/ghostroom.h +++ b/engines/avalanche/ghostroom.h @@ -1,24 +1,24 @@ /* 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. -* -*/ + * + * 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. diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 8b94e9a09f..1e3a6ff36c 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index e5538bca7a..05bd507d8e 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp index 0e60f5fadb..bef557db07 100644 --- a/engines/avalanche/help.cpp +++ b/engines/avalanche/help.cpp @@ -1,24 +1,24 @@ /* 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. -* -*/ + * + * 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. diff --git a/engines/avalanche/help.h b/engines/avalanche/help.h index f31a73d189..7543d87047 100644 --- a/engines/avalanche/help.h +++ b/engines/avalanche/help.h @@ -1,24 +1,24 @@ /* 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. -* -*/ + * + * 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. diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp index c3fa709ee4..af3caf880e 100644 --- a/engines/avalanche/menu.cpp +++ b/engines/avalanche/menu.cpp @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h index b7674fbb9d..f4833d31c4 100644 --- a/engines/avalanche/menu.h +++ b/engines/avalanche/menu.h @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp index e4897a6d49..1430b69ea9 100644 --- a/engines/avalanche/nim.cpp +++ b/engines/avalanche/nim.cpp @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/nim.h b/engines/avalanche/nim.h index 7e5f55e69f..3c2f0455cf 100644 --- a/engines/avalanche/nim.h +++ b/engines/avalanche/nim.h @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 1a9585e2a3..5e58d1df5c 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h index 20066329e5..46408f518a 100644 --- a/engines/avalanche/parser.h +++ b/engines/avalanche/parser.h @@ -8,12 +8,12 @@ * 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 + * 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. diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp index 3a60c4ec1d..d63532a457 100644 --- a/engines/avalanche/sequence.cpp +++ b/engines/avalanche/sequence.cpp @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h index d3c1b54963..8062118059 100644 --- a/engines/avalanche/sequence.h +++ b/engines/avalanche/sequence.h @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 03addc62b6..3012813d70 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -1,24 +1,24 @@ /* 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. -* -*/ + * + * 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. diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 21b5a76fb0..ce6af73237 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -1,24 +1,24 @@ /* 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. -* -*/ + * + * 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. diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp index c324df4713..229d046cc1 100644 --- a/engines/avalanche/sound.cpp +++ b/engines/avalanche/sound.cpp @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/sound.h b/engines/avalanche/sound.h index 25b6b267d3..a67016a206 100644 --- a/engines/avalanche/sound.h +++ b/engines/avalanche/sound.h @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index b7a8433e71..69e0d84b3c 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -8,12 +8,12 @@ * 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. diff --git a/engines/avalanche/timer.h b/engines/avalanche/timer.h index 9a91c4d24b..fd51544fd1 100644 --- a/engines/avalanche/timer.h +++ b/engines/avalanche/timer.h @@ -8,12 +8,12 @@ * 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. -- cgit v1.2.3 From 589c6ffed25e818cd332e3ffb462ee13c4c8703e Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 18 Feb 2014 13:53:20 +0100 Subject: AVALANCHE: Reimplement the rectangle drawing methods. --- engines/avalanche/ghostroom.cpp | 14 +++++++------- engines/avalanche/graphics.cpp | 6 +++--- engines/avalanche/graphics.h | 6 ++++-- engines/avalanche/help.cpp | 4 ++-- engines/avalanche/nim.cpp | 10 +++++----- engines/avalanche/shootemup.cpp | 6 +++--- 6 files changed, 24 insertions(+), 22 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp index 3323e538ef..5942c5565c 100644 --- a/engines/avalanche/ghostroom.cpp +++ b/engines/avalanche/ghostroom.cpp @@ -209,7 +209,7 @@ void GhostRoom::run() { CursorMan.showMouse(false); _vm->_graphics->saveScreen(); _vm->fadeOut(); - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); // Black out the whole screen. + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); // Black out the whole screen. _vm->fadeIn(); // Only load the pictures if it's our first time walking into the room. @@ -230,12 +230,12 @@ void GhostRoom::run() { int xBound = x % 30; if ((22 <= xBound) && (xBound <= 27)) { if (xBound == 27) - _vm->_graphics->drawFilledRectangle(Common::Rect(x, 135, x + 17, 137), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(x, 135, x + 16, 136), kColorBlack); _vm->_graphics->ghostDrawPicture(_eyes[0], x, 136); _vm->_graphics->drawDot(x + 16, 137, kColorBlack); } else { if (xBound == 21) - _vm->_graphics->drawFilledRectangle(Common::Rect(x, 137, x + 18, 139), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(x, 137, x + 17, 138), kColorBlack); _vm->_graphics->ghostDrawPicture(_eyes[0], x, 135); _vm->_graphics->drawDot(x + 16, 136, kColorBlack); // Eyes would leave a trail 1 pixel high behind them. } @@ -298,7 +298,7 @@ void GhostRoom::run() { wait(777); // Erase "aargh": - _vm->_graphics->drawFilledRectangle(Common::Rect(172, 78, 348, 112), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(172, 78, 347, 111), kColorBlack); _vm->_graphics->refreshScreen(); for (int i = 4; i >= 0; i--) { @@ -307,7 +307,7 @@ void GhostRoom::run() { } // Erase the exclamation mark: - _vm->_graphics->drawFilledRectangle(Common::Rect(246, 127, 252, 134), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(246, 127, 251, 133), kColorBlack); _vm->_graphics->refreshScreen(); // Avvy hurries back: @@ -320,12 +320,12 @@ void GhostRoom::run() { int xBound = x % 30; if ((22 <= xBound) && (xBound <= 27)) { if (xBound == 22) - _vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 134, x + 38, 138), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 134, x + 38, 137), kColorBlack); _vm->_graphics->ghostDrawPicture(_eyes[1], x + 23, 136); _vm->_graphics->drawDot(x + 22, 137, kColorBlack); } else { if (xBound == 28) - _vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 135, x + 38, 139), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 135, x + 38, 138), kColorBlack); _vm->_graphics->ghostDrawPicture(_eyes[1], x + 23, 135); _vm->_graphics->drawDot(x + 22, 136, kColorBlack); // Eyes would leave a trail 1 pixel high behind them. } diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 1e3a6ff36c..ca9409d25d 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -479,11 +479,11 @@ void GraphicManager::drawDebugLines() { } void GraphicManager::drawFilledRectangle(Common::Rect rect, Color color) { - _surface.fillRect(rect, color); + _surface.fillRect(Common::Rect(rect.left, rect.top, rect.right + 1, rect.bottom + 1), color); } void GraphicManager::drawRectangle(Common::Rect rect, Color color) { - _surface.frameRect(rect, color); + _surface.frameRect(Common::Rect(rect.left, rect.top, rect.right + 1, rect.bottom + 1), color); } void GraphicManager::nimLoad() { @@ -687,7 +687,7 @@ void GraphicManager::helpDrawHighlight(byte which, Color color) { return; which &= 31; - drawRectangle(Common::Rect(466, 38 + which * 27, 555, 63 + which * 27), color); + drawRectangle(Common::Rect(466, 38 + which * 27, 555, 62 + which * 27), color); } /** diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 05bd507d8e..b720ae7c8e 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -59,13 +59,15 @@ public: void loadDigits(); void loadMouse(byte which); + // We have to handle the drawing of rectangles a little bit differently to mimic Pascal's bar() and rectangle() methods properly. + // Now it is possible to use the original coordinates everywhere. + void drawFilledRectangle(Common::Rect rect, Color color); + void drawRectangle(Common::Rect rect, Color color); void drawDot(int x, int y, Color color); void drawLine(int x1, int y1, int x2, int y2, int penX, int penY, Color color); Common::Point drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color); void drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color); void drawTriangle(Common::Point *p, Color color); - void drawFilledRectangle(Common::Rect rect, Color color); - void drawRectangle(Common::Rect rect, Color color); void drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color); void drawBigText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color); // Very similar to drawText. TODO: Try to unify the two. void drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color); diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp index bef557db07..b667ad090d 100644 --- a/engines/avalanche/help.cpp +++ b/engines/avalanche/help.cpp @@ -66,8 +66,8 @@ void Help::switchPage(byte which) { Common::String title = getLine(file); - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlue); - _vm->_graphics->drawFilledRectangle(Common::Rect(8, 40, 450, 200), kColorWhite); + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlue); + _vm->_graphics->drawFilledRectangle(Common::Rect(8, 40, 449, 199), kColorWhite); byte index = file.readByte(); _vm->_graphics->helpDrawButton(-177, index); diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp index 1430b69ea9..87af8053e1 100644 --- a/engines/avalanche/nim.cpp +++ b/engines/avalanche/nim.cpp @@ -152,13 +152,13 @@ void Nim::setup() { _vm->fadeIn(); _vm->_graphics->nimLoad(); - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); // Upper left rectangle. - _vm->_graphics->drawRectangle(Common::Rect(10, 5, 381, 71), kColorRed); - _vm->_graphics->drawFilledRectangle(Common::Rect(11, 6, 380, 70), kColorBrown); + _vm->_graphics->drawRectangle(Common::Rect(10, 5, 380, 70), kColorRed); + _vm->_graphics->drawFilledRectangle(Common::Rect(11, 6, 379, 69), kColorBrown); // Bottom right rectangle. - _vm->_graphics->drawRectangle(Common::Rect(394, 50, 635, 198), kColorRed); - _vm->_graphics->drawFilledRectangle(Common::Rect(395, 51, 634, 197), kColorBrown); + _vm->_graphics->drawRectangle(Common::Rect(394, 50, 634, 197), kColorRed); + _vm->_graphics->drawFilledRectangle(Common::Rect(395, 51, 633, 196), kColorBrown); _vm->_graphics->nimDrawLogo(); _vm->_graphics->nimDrawInitials(); diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 3012813d70..cd46d00333 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -202,11 +202,11 @@ void ShootEmUp::nextPage() { } } - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); } void ShootEmUp::instructions() { - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); // Black out the whole screen. + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); // Black out the whole screen. _vm->_graphics->seuDrawPicture(25, 25, kFacingRight); _vm->_graphics->drawNormalText("< Avvy, our hero, needs your help - you must move him around.", _vm->_font, 8, 60, 35, kColorWhite); _vm->_graphics->drawNormalText("(He''s too terrified to move himself!)", _vm->_font, 8, 80, 45, kColorWhite); @@ -270,7 +270,7 @@ void ShootEmUp::setup() { _count321 = 255; // Counting down. - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); // Black out the whole screen. + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); // Black out the whole screen. // Set up status line: _vm->_graphics->seuDrawPicture(0, 0, 16); // Score: -- cgit v1.2.3 From f20d4e726d4c747d9c813d12834d35c7475e250e Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 18 Feb 2014 14:05:03 +0100 Subject: AVALANCHE: Introduce GraphicManager::blackOutScreen(). --- engines/avalanche/ghostroom.cpp | 2 +- engines/avalanche/graphics.cpp | 8 ++++++-- engines/avalanche/graphics.h | 3 ++- engines/avalanche/shootemup.cpp | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp index 5942c5565c..91b2bae4f0 100644 --- a/engines/avalanche/ghostroom.cpp +++ b/engines/avalanche/ghostroom.cpp @@ -209,7 +209,7 @@ void GhostRoom::run() { CursorMan.showMouse(false); _vm->_graphics->saveScreen(); _vm->fadeOut(); - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); // Black out the whole screen. + _vm->_graphics->blackOutScreen(); _vm->fadeIn(); // Only load the pictures if it's our first time walking into the room. diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index ca9409d25d..4bd6695bb8 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -478,12 +478,16 @@ void GraphicManager::drawDebugLines() { } } +void GraphicManager::drawRectangle(Common::Rect rect, Color color) { + _surface.frameRect(Common::Rect(rect.left, rect.top, rect.right + 1, rect.bottom + 1), color); +} + void GraphicManager::drawFilledRectangle(Common::Rect rect, Color color) { _surface.fillRect(Common::Rect(rect.left, rect.top, rect.right + 1, rect.bottom + 1), color); } -void GraphicManager::drawRectangle(Common::Rect rect, Color color) { - _surface.frameRect(Common::Rect(rect.left, rect.top, rect.right + 1, rect.bottom + 1), color); +void GraphicManager::blackOutScreen() { + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); } void GraphicManager::nimLoad() { diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index b720ae7c8e..34f6498fca 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -61,8 +61,9 @@ public: // We have to handle the drawing of rectangles a little bit differently to mimic Pascal's bar() and rectangle() methods properly. // Now it is possible to use the original coordinates everywhere. - void drawFilledRectangle(Common::Rect rect, Color color); void drawRectangle(Common::Rect rect, Color color); + void drawFilledRectangle(Common::Rect rect, Color color); + void blackOutScreen(); void drawDot(int x, int y, Color color); void drawLine(int x1, int y1, int x2, int y2, int penX, int penY, Color color); Common::Point drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color); diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index cd46d00333..435adb1d48 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -206,7 +206,7 @@ void ShootEmUp::nextPage() { } void ShootEmUp::instructions() { - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); // Black out the whole screen. + _vm->_graphics->blackOutScreen(); _vm->_graphics->seuDrawPicture(25, 25, kFacingRight); _vm->_graphics->drawNormalText("< Avvy, our hero, needs your help - you must move him around.", _vm->_font, 8, 60, 35, kColorWhite); _vm->_graphics->drawNormalText("(He''s too terrified to move himself!)", _vm->_font, 8, 80, 45, kColorWhite); @@ -270,7 +270,7 @@ void ShootEmUp::setup() { _count321 = 255; // Counting down. - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); // Black out the whole screen. + _vm->_graphics->blackOutScreen(); // Set up status line: _vm->_graphics->seuDrawPicture(0, 0, 16); // Score: -- cgit v1.2.3 From 3b313bfc83f922c5ed92503f0de99cec0bcb6f12 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 18 Feb 2014 14:15:28 +0100 Subject: AVALANCHE: Implement ShootEmUp::blankIt(). --- engines/avalanche/shootemup.cpp | 4 +++- engines/avalanche/shootemup.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 435adb1d48..530e65d883 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -138,7 +138,9 @@ byte ShootEmUp::getStockNumber(byte x) { } void ShootEmUp::blankIt() { - warning("STUB: ShootEmUp::blankIt()"); + for (int i = 0; i < _rectNum; i++) + _vm->_graphics->drawFilledRectangle(_rectangles[i], kColorBlack); + _rectNum = 0; } void ShootEmUp::moveThem() { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index ce6af73237..383a712c93 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -70,6 +70,7 @@ private: byte _stockStatus[7]; Sprite _sprites[99]; byte _rectNum; // Original: 'rsize' + Common::Rect _rectangles[99]; uint16 _avvyWas; uint16 _avvyPos; byte _avvyAnim; -- cgit v1.2.3 From 1b5cf54cedeb4fdac2849a57dfd6185d3bd0ade7 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 18 Feb 2014 14:55:54 +0100 Subject: AVALANCHE: Implement ShootEmUp::hitPeople() and connected functions. --- engines/avalanche/shootemup.cpp | 50 ++++++++++++++++++++++++++++++++++++----- engines/avalanche/shootemup.h | 2 +- 2 files changed, 45 insertions(+), 7 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 530e65d883..4a4c10c17e 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -118,6 +118,8 @@ void ShootEmUp::run() { updateTime(); check321(); readKbd(); + + _vm->_graphics->refreshScreen(); } while (_time != 0); _vm->fadeOut(); @@ -128,8 +130,8 @@ void ShootEmUp::run() { } bool ShootEmUp::overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y) { - warning("STUB: ShootEmUp::overlap()"); - return false; + // By De Morgan's law: + return (a2x >= b1x) && (b2x >= a1x) && (a2y >= b1y) && (b2y >= a1y); } byte ShootEmUp::getStockNumber(byte x) { @@ -151,8 +153,20 @@ void ShootEmUp::plotThem() { warning("STUB: ShootEmUp::plotThem()"); } -void ShootEmUp::define(int16 xx, int16 yy, byte pp, int8 ixx, int8 iyy, int16 time, bool isAMissile, bool doWeWipe) { - warning("STUB: ShootEmUp::define()"); +void ShootEmUp::define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe) { + for (int i = 0; i < 99; i++) { + if (_sprites[i]._x == kFlag) { + _sprites[i]._x = x; + _sprites[i]._y = y; + _sprites[i]._p = p; + _sprites[i]._ix = ix; + _sprites[i]._iy = iy; + _sprites[i]._timeout = time; + _sprites[i]._cameo = false; + _sprites[i]._missile = isAMissile; + _sprites[i]._wipe = doWeWipe; + } + } } void ShootEmUp::defineCameo(int16 xx, int16 yy, byte pp, int16 time) { @@ -184,7 +198,12 @@ void ShootEmUp::showTime() { } void ShootEmUp::gain(int8 howMuch) { - warning("STUB: ShootEmUp::gain()"); + if ((_score + howMuch) == 0) // howMuch can be negative! + _score = 0; + else + _score += howMuch; + + showScore(); } void ShootEmUp::newEscape() { @@ -326,7 +345,26 @@ void ShootEmUp::updateTime() { } void ShootEmUp::hitPeople() { - warning("STUB: ShootEmUp::hitPeople()"); + if (_count321 != 0) + return; + + for (int i = 0; i < 99; i++) { + if ((_sprites[i]._missile) && (_sprites[i]._x != kFlag)) { + for (int j = 0; j < 4; j++) { + + bool overlaps = overlap(_sprites[i]._x, _sprites[i]._y, _sprites[i]._x + 7, _sprites[i]._y + 10, + _running[j]._x, _running[j]._y, _running[j]._x + 17, _running[j]._y + 24); + + if ((_running[j]._x != kFlag) && (overlaps)) { + _vm->_sound->playNote(7177, 1); + _sprites[i]._x = kFlag; + gain(-5); + define(_running[j]._x + 20, _running[j]._y + 3, 34 + _vm->_rnd->getRandomNumber(5), 1, 3, 9, false, true); // Oof! + define(_sprites[i]._x, _sprites[i]._y, 83, 1, 0, 17, false, true); // Oops! + } + } + } + } } void ShootEmUp::escapeCheck() { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 383a712c93..38f18b0d1c 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -91,7 +91,7 @@ private: void blankIt(); void moveThem(); void plotThem(); - void define(int16 xx, int16 yy, byte pp, int8 ixx, int8 iyy, int16 time, bool isAMissile, bool doWeWipe); + void define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe); void defineCameo(int16 xx, int16 yy, byte pp, int16 time); void showStock(byte x); void drawNumber(int number, int size, int x); -- cgit v1.2.3 From 72c40dbd47b8684358432567cd20cbd3b9af92b8 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 18 Feb 2014 15:42:31 +0100 Subject: AVALANCHE: Repair writing off the boundaries in loadPictureGraphic(). --- engines/avalanche/graphics.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 4bd6695bb8..367ca27c09 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -790,7 +790,10 @@ Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) { byte pixel = file.readByte(); for (int bit = 0; bit < 8; bit++) { byte pixelBit = (pixel >> bit) & 1; - *(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane); + // If the picture's width is not a multiple of 8, and we get over the boundary with the 'x' cycle, pixelBit is surely == 0. + // Otherwise, it doesn't cause trouble, since addign 0 doesn't have an effect at all. + if (pixelBit != 0) + *(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane); } } } -- cgit v1.2.3 From 2e56baeca0ad9067f73a03c81a161e05acda7abe Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 18 Feb 2014 15:47:17 +0100 Subject: AVALANCHE: Rework GraphicManager::loadPictureSign(). --- engines/avalanche/graphics.cpp | 11 +++++------ engines/avalanche/graphics.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 367ca27c09..cde0f5de9a 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -826,22 +826,21 @@ Graphics::Surface GraphicManager::loadPictureRaw(Common::File &file, uint16 widt return picture; } -Graphics::Surface GraphicManager::loadPictureSign(Common::File &file, int xl, int yl) { +Graphics::Surface GraphicManager::loadPictureSign(Common::File &file, uint16 width, uint16 height) { // I know it looks very similar to the other loadPicture methods, but in truth it's the combination of the two. - uint16 width = xl * 8; - uint16 height = yl; + width *= 8; Graphics::Surface picture; // We make a Surface object for the picture itself. picture.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); // Produce the picture. We read it in row-by-row, and every row has 4 planes. - for (int yy = 0; yy < height; yy++) { + for (int y = 0; y < height; y++) { for (int8 plane = 0; plane < 4; plane++) { // The planes are in the "right" order. - for (uint16 xx = 0; xx < width; xx += 8) { + for (uint16 x = 0; x < width; x += 8) { byte pixel = file.readByte(); for (int bit = 0; bit < 8; bit++) { byte pixelBit = (pixel >> bit) & 1; - *(byte *)picture.getBasePtr(xx + 7 - bit, yy) += (pixelBit << plane); + *(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane); } } } diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 34f6498fca..1da875b330 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -180,7 +180,7 @@ private: // Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data. - Graphics::Surface loadPictureSign(Common::File &file, int xl, int yl); // Reads a tricky type of picture used for the "game over"/"about" scrolls and in the mini-game Nim. + Graphics::Surface loadPictureSign(Common::File &file, uint16 width, uint16 height); // Reads a tricky type of picture used for the "game over"/"about" scrolls and in the mini-game Nim. void drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color); void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY); -- cgit v1.2.3 From a3eea23624df66a277802bc1bf828dbf773c5da1 Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 19 Feb 2014 16:48:26 +0100 Subject: AVALANCHE: Implement ShootEmUp::initRunner(). --- engines/avalanche/shootemup.cpp | 19 +++++++++++++++++-- engines/avalanche/shootemup.h | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 4a4c10c17e..07a40a0c72 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -36,6 +36,7 @@ const byte ShootEmUp::kStocks = 27; const byte ShootEmUp::kFacingRight = 87; const byte ShootEmUp::kFacingLeft = 93; const long int ShootEmUp::kFlag = -20047; +const byte ShootEmUp::kFrameDelayMax = 2; ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _vm = vm; @@ -308,8 +309,22 @@ void ShootEmUp::setup() { initRunner(20, 100, 61, 67, (-(int8)_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2); } -void ShootEmUp::initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8 iyy) { - warning("STUB: ShootEmUp::initRunner()"); +void ShootEmUp::initRunner(int16 x, int16 y, byte f1, byte f2, int8 ix, int8 iy) { + for (int i = 0; i < 4; i++) { + if (_running[i]._x == kFlag) { + _running[i]._x = x; + _running[i]._y = y; + _running[i]._frame = f1; + _running[i]._tooHigh = f2; + _running[i]._lowest = f1; + _running[i]._ix = ix; + _running[i]._iy = iy; + if ((ix = 0) && (iy = 0)) + _running[i]._ix = 2; // To stop them running on the spot! + _running[i]._frameDelay = kFrameDelayMax; + return; + } + } } void ShootEmUp::moveAvvy() { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 38f18b0d1c..62d55804d7 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -62,6 +62,7 @@ private: static const byte kFacingRight; static const byte kFacingLeft; static const long int kFlag; + static const byte kFrameDelayMax; AvalancheEngine *_vm; -- cgit v1.2.3 From c498e910eb19bcc78fbd35dbf743a09e9a2e0ddb Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 19 Feb 2014 17:55:32 +0100 Subject: AVALANCHE: Implement ShootEmUp::plotThem() and connected functions. --- engines/avalanche/graphics.cpp | 25 +++++++++++++++++++++++++ engines/avalanche/graphics.h | 1 + engines/avalanche/shootemup.cpp | 31 ++++++++++++++++++++++++++++++- engines/avalanche/shootemup.h | 2 ++ 4 files changed, 58 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index cde0f5de9a..3b4413ab76 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -754,6 +754,31 @@ void GraphicManager::seuDrawPicture(int x, int y, byte which) { drawPicture(_surface, _seuPictures[which], x, y); } +/** + * @remarks Originally called 'cameo_display' + */ +void GraphicManager::seuDrawCameo(int destX, int destY, byte w1, byte w2) { + // First we make the pixels of the previous sprite (cameo) blank: + uint16 maxX = _seuPictures[w2].w; + uint16 maxY = _seuPictures[w2].h; + + if (destX + maxX > _surface.w) + maxX = _surface.w - destX; + + if (destY + maxY > _surface.h) + maxY = _surface.h - destY; + + for (uint16 y = 0; y < maxY; y++) { + for (uint16 x = 0; x < maxX; x++) { + if (*(const byte *)_seuPictures[w2].getBasePtr(x, y) != 0) + *(byte *)_surface.getBasePtr(x + destX, y + destY) = 0; + } + } + + // Then we draw the desired sprite: + drawPicture(_surface, _seuPictures[w1], destX, destY); +} + /** * This function is for skipping the difference between a stored 'size' value associated with a picture * and the actual size of the pictures when reading them from files for Ghostroom and Shoot em' up. diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 1da875b330..553f993188 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -115,6 +115,7 @@ public: void seuLoad(); void seuFree(); void seuDrawPicture(int x, int y, byte which); + void seuDrawCameo(int destX, int destY, byte w1, byte w2); void clearAlso(); void clearTextBar(); diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 07a40a0c72..d7832a07be 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -81,6 +81,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _escapeCount = 0; _escaping = false; _timeThisSecond = 0; + _cp = false; } void ShootEmUp::run() { @@ -120,6 +121,8 @@ void ShootEmUp::run() { check321(); readKbd(); + _cp = !_cp; + _vm->_graphics->refreshScreen(); } while (_time != 0); @@ -150,8 +153,32 @@ void ShootEmUp::moveThem() { warning("STUB: ShootEmUp::moveThem()"); } +void ShootEmUp::blank(Common::Rect rect) { + _rectangles[_rectNum++] = rect; +} + void ShootEmUp::plotThem() { - warning("STUB: ShootEmUp::plotThem()"); + for (int i = 0; i < 99; i++) { + if (_sprites[i]._x != kFlag) { + if (_sprites[i]._cameo) { + _vm->_graphics->seuDrawCameo(_sprites[i]._x, _sprites[i]._y, _sprites[i]._p, _sprites[i]._cameoFrame); + if (!_cp) { + _sprites[i]._cameoFrame += 2; + _sprites[i]._p += 2; + } + } else + _vm->_graphics->seuDrawPicture(_sprites[i]._x, _sprites[i]._y, _sprites[i]._p); + + if (_sprites[i]._wipe) + blank(Common::Rect(_sprites[i]._x, _sprites[i]._y, _sprites[i]._x + _rectangles[i].width(), _sprites[i]._y + _rectangles[i].height())); + + if (_sprites[i]._timeout > 0) { + _sprites[i]._timeout--; + if (_sprites[i]._timeout == 0) + _sprites[i]._y = kFlag; + } + } + } } void ShootEmUp::define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe) { @@ -276,6 +303,8 @@ void ShootEmUp::setup() { showStock(i); } + _cp = true; + _avvyWas = 320; _avvyPos = 320; _avvyAnim = 1; diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 62d55804d7..6dfa3baa1b 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -86,11 +86,13 @@ private: uint16 _escapeCount; bool _escaping; byte _timeThisSecond; + bool _cp; bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y); byte getStockNumber(byte x); void blankIt(); void moveThem(); + void blank(Common::Rect rect); void plotThem(); void define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe); void defineCameo(int16 xx, int16 yy, byte pp, int16 time); -- cgit v1.2.3 From 546a3cea826fca2e33f7472dd080d21d0e2ab54c Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 19 Feb 2014 17:56:16 +0100 Subject: AVALANCHE: Implement ShootEmUp::moveThem(). --- engines/avalanche/shootemup.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index d7832a07be..52dd1d4676 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -150,7 +150,12 @@ void ShootEmUp::blankIt() { } void ShootEmUp::moveThem() { - warning("STUB: ShootEmUp::moveThem()"); + for (int i = 0; i < 99; i++) { + if (_sprites[i]._x != kFlag) { + _sprites[i]._x += _sprites[i]._ix; + _sprites[i]._y += _sprites[i]._iy; + } + } } void ShootEmUp::blank(Common::Rect rect) { -- cgit v1.2.3 From 5c841dab6dd03754e37b3c7a0849a865f850179b Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 19 Feb 2014 18:45:08 +0100 Subject: AVALANCHE: Implement ShootEmUp::moveAvvy(). --- engines/avalanche/shootemup.cpp | 35 ++++++++++++++++++++++++++++++++++- engines/avalanche/shootemup.h | 4 ++++ 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 52dd1d4676..fde6fc3ff5 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -33,10 +33,13 @@ namespace Avalanche { const byte ShootEmUp::kStocks = 27; +const byte ShootEmUp::kAvvyShoots = 86; const byte ShootEmUp::kFacingRight = 87; const byte ShootEmUp::kFacingLeft = 93; const long int ShootEmUp::kFlag = -20047; const byte ShootEmUp::kFrameDelayMax = 2; +const byte ShootEmUp::kAvvyY = 150; +const byte ShootEmUp::kShooting[7] = { 87, 80, 81, 82, 81, 80, 87 }; ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _vm = vm; @@ -82,6 +85,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _escaping = false; _timeThisSecond = 0; _cp = false; + _wasFacing = 0; } void ShootEmUp::run() { @@ -362,7 +366,36 @@ void ShootEmUp::initRunner(int16 x, int16 y, byte f1, byte f2, int8 ix, int8 iy) } void ShootEmUp::moveAvvy() { - warning("STUB: ShootEmUp::moveAvvy()"); + if (_avvyWas < _avvyPos) + _avvyFacing = kFacingRight; + else if (_avvyWas > _avvyPos) + _avvyFacing = kFacingLeft; + + if (!_firing) { + if (_avvyWas == _avvyPos) + _avvyAnim = 1; + else { + _avvyAnim++; + if (_avvyAnim == 6) + _avvyAnim = 0; + } + } + + if (_avvyFacing == kAvvyShoots) + define(_avvyPos, kAvvyY, kShooting[_avvyAnim], 0, 0, 1, false, true); + else + define(_avvyPos, kAvvyY, _avvyAnim + _avvyFacing, 0, 0, 1, false, true); + + _avvyWas = _avvyPos; + + if (_avvyFacing == kAvvyShoots) { + if (_avvyAnim == 6) { + _avvyFacing = _wasFacing; + _avvyAnim = 0; + _firing = false; + } else + _avvyAnim++; + } } void ShootEmUp::readKbd() { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 6dfa3baa1b..b3561aceae 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -59,10 +59,13 @@ private: }; static const byte kStocks; + static const byte kAvvyShoots; static const byte kFacingRight; static const byte kFacingLeft; static const long int kFlag; static const byte kFrameDelayMax; + static const byte kAvvyY; + static const byte kShooting[7]; AvalancheEngine *_vm; @@ -87,6 +90,7 @@ private: bool _escaping; byte _timeThisSecond; bool _cp; + byte _wasFacing; bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y); byte getStockNumber(byte x); -- cgit v1.2.3 From 2d5493b599b8ea5410a0ba481b6cd12c05debf52 Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 19 Feb 2014 19:10:25 +0100 Subject: AVALANCHE: Implement ShootEmUp::bumpFolk() and ShootEmUp::turnAround(). --- engines/avalanche/shootemup.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index fde6fc3ff5..5a490124a1 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -411,11 +411,31 @@ void ShootEmUp::collisionCheck() { } void ShootEmUp::turnAround(byte who, bool randomX) { - warning("STUB: ShootEmUp::turnAround()"); + if (randomX) { + int8 ix = (_vm->_rnd->getRandomNumber(4) + 1); + if (_running[who]._ix > 0) + _running[who]._ix = -(ix); + else + _running[who]._ix = ix; + } else + _running[who]._ix = -(_running[who]._ix); + + _running[who]._iy = -(_running[who]._iy); } void ShootEmUp::bumpFolk() { - warning("STUB: ShootEmUp::bumpFolk()"); + for (int i = 0; i < 4; i++) { + if (_running[i]._x != kFlag) { + for (int j = i + 1; j < 4; j++) { + bool overlaps = overlap(_running[i]._x, _running[i]._y, _running[i]._x + 17, _running[i]._y + 24, + _running[j]._x, _running[j]._y, _running[j]._x + 17, _running[j]._y + 24); + if ((_running[i]._x != kFlag) && overlaps) { + turnAround(i, false); // Opp. directions. + turnAround(j, false); + } + } + } + } } void ShootEmUp::peopleRunning() { -- cgit v1.2.3 From 7970cddb1f81d584917376838c9d43b7118c852e Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 19 Feb 2014 19:52:07 +0100 Subject: AVALANCHE: Implement ShootEmUp::peopleRunning(). --- engines/avalanche/shootemup.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 5a490124a1..edd4d7a87a 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -439,7 +439,36 @@ void ShootEmUp::bumpFolk() { } void ShootEmUp::peopleRunning() { - warning("STUB: ShootEmUp::peopleRunning()"); + if (_count321 != 0) + return; + + for (int i = 0; i < 4; i++) { + if (_running[i]._x != kFlag) { + if (((_running[i]._y + _running[i]._iy) <= 53) || ((_running[i]._y + _running[i]._iy) >= 120)) + _running[i]._iy = -(_running[i]._iy); + + byte frame = 0; + if (_running[i]._ix < 0) + frame = _running[i]._frame; + else + frame = _running[i]._frame + 7; + define(_running[i]._x, _running[i]._y, frame, 0, 0, 1, false, true); + + if (_running[i]._frameDelay == 0) { + _running[i]._frame++; + if (_running[i]._frame == _running[i]._tooHigh) + _running[i]._frame = _running[i]._lowest; + _running[i]._frameDelay = kFrameDelayMax; + _running[i]._y += _running[i]._iy; + } else + _running[i]._frameDelay--; + + if (((_running[i]._x + _running[i]._ix) <= 0) || ((_running[i]._x + _running[i]._ix) >= 620)) + turnAround(i, true); + + _running[i]._x += _running[i]._ix; + } + } } void ShootEmUp::updateTime() { -- cgit v1.2.3 From 6d2f3019c7bc42e7a72491e2d3c723c471cc7c96 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 19 Feb 2014 21:11:55 +0100 Subject: AVALANCHE: Fix uninitialized variable in Avalanche's shoot'em up --- engines/avalanche/shootemup.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index edd4d7a87a..2e689b870d 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -86,6 +86,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _timeThisSecond = 0; _cp = false; _wasFacing = 0; + _score = 0; } void ShootEmUp::run() { -- cgit v1.2.3 From a2a222e647c2227c9bf01c0023cae1aa72aadcad Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 19 Feb 2014 21:41:12 +0100 Subject: AVALANCHE: Some British to American english --- engines/avalanche/avalanche.cpp | 6 +++--- engines/avalanche/dialogs.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 8158536a0c..27c366914a 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -279,9 +279,9 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { if (!_favoriteSong.empty()) _favoriteSong.clear(); - uint16 favourite_songSize = 0; - sz.syncAsUint16LE(favourite_songSize); - for (uint16 i = 0; i < favourite_songSize; i++) { + uint16 favoriteSongSize = 0; + sz.syncAsUint16LE(favoriteSongSize); + for (uint16 i = 0; i < favoriteSongSize; i++) { sz.syncAsByte(actChr); _favoriteSong += actChr; } diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index b175464f0c..36f6f4470c 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -455,7 +455,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) { mx -= lx; my -= ly + 2; - bool centre = false; + bool center = false; byte iconIndent = 0; switch (_useIcon) { @@ -481,11 +481,11 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) { if (!_scroll[i].empty()) switch (_scroll[i][_scroll[i].size() - 1]) { case kControlCenter: - centre = true; + center = true; _scroll[i].deleteLastChar(); break; case kControlLeftJustified: - centre = false; + center = false; _scroll[i].deleteLastChar(); break; case kControlQuestion: @@ -497,7 +497,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) { break; } - if (centre) + if (center) say(320 - _scroll[i].size() * 4 + iconIndent, my, _scroll[i]); else say(mx + iconIndent, my, _scroll[i]); -- cgit v1.2.3 From 37b147d9503b0614983d7072be60c2708ade0800 Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 14:41:42 +0100 Subject: AVALANCHE: Repair out of bound read in Help::handleMouse(). --- engines/avalanche/help.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp index b667ad090d..5d3247ba9a 100644 --- a/engines/avalanche/help.cpp +++ b/engines/avalanche/help.cpp @@ -180,6 +180,7 @@ bool Help::handleMouse(const Common::Event &event) { } else { // LBUTTONDOWN or MOUSEMOVE int highlightIs = 0; + // Decide which button we are hovering the cursor over: if ((mousePos.x > 470) && (mousePos.x <= 550) && (((mousePos.y - 13) % 27) <= 20)) { // No click, so highlight. highlightIs = (mousePos.y - 13) / 27 - 1; if ((highlightIs < 0) || (5 < highlightIs)) @@ -187,20 +188,21 @@ bool Help::handleMouse(const Common::Event &event) { } else highlightIs = 177; - if (((highlightIs != 177) && (event.type == Common::EVENT_LBUTTONDOWN)) || _holdLeft) { + Color highlightColor = kColorLightblue; + // If we clicked on a button or we are holding down the button, we have to highlight it with cyan: + if (((highlightIs != 177) && ((event.type == Common::EVENT_LBUTTONDOWN)) || _holdLeft)) { _holdLeft = true; - highlightIs += 32; + highlightColor = kColorLightcyan; } - if (_highlightWas != highlightIs) { + // Erase the previous highlight only if it's needed: + if (_highlightWas != highlightIs) _vm->_graphics->helpDrawHighlight(_highlightWas, kColorBlue); + + // Highligt the current one with the proper color: + if (_buttons[highlightIs]._trigger != Common::KEYCODE_INVALID) { _highlightWas = highlightIs; - if (_buttons[highlightIs & 31]._trigger != Common::KEYCODE_INVALID) { - if (highlightIs > 31) - _vm->_graphics->helpDrawHighlight(highlightIs, kColorLightcyan); - else - _vm->_graphics->helpDrawHighlight(highlightIs, kColorLightblue); - } + _vm->_graphics->helpDrawHighlight(highlightIs, highlightColor); } } -- cgit v1.2.3 From e03ccde6e9d13a56ca1b8e1264df1f936a234f40 Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 15:02:22 +0100 Subject: AVALANCHE: Implement ShootEmUp::animate() and connected functions. --- engines/avalanche/shootemup.cpp | 36 ++++++++++++++++++++++++++++++------ engines/avalanche/shootemup.h | 5 +++-- 2 files changed, 33 insertions(+), 8 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 2e689b870d..70b26d267f 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -87,6 +87,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _cp = false; _wasFacing = 0; _score = 0; + _escapeStock = 0; } void ShootEmUp::run() { @@ -143,9 +144,13 @@ bool ShootEmUp::overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b return (a2x >= b1x) && (b2x >= a1x) && (a2y >= b1y) && (b2y >= a1y); } -byte ShootEmUp::getStockNumber(byte x) { - warning("STUB: ShootEmUp::getStockNumber()"); - return 0; +byte ShootEmUp::getStockNumber(byte index) { + while (_hasEscaped[index]) { + index++; + if (index == 7) + index = 0; + } + return index; } void ShootEmUp::blankIt() { @@ -211,8 +216,17 @@ void ShootEmUp::defineCameo(int16 xx, int16 yy, byte pp, int16 time) { warning("STUB: ShootEmUp::defineCameo()"); } -void ShootEmUp::showStock(byte x) { - warning("STUB: ShootEmUp::showStock()"); +void ShootEmUp::showStock(byte index) { + if (_escaping && (index == _escapeStock)) { + _vm->_graphics->seuDrawPicture(index * 90 + 20, 30, kStocks + 2); + return; + } + + if (_stockStatus[index] > 5) + return; + + _vm->_graphics->seuDrawPicture(index * 90 + 20, 30, kStocks + _stockStatus[index]); + _stockStatus[index] = 1 - _stockStatus[index]; } void ShootEmUp::drawNumber(int number, int size, int x) { @@ -404,7 +418,17 @@ void ShootEmUp::readKbd() { } void ShootEmUp::animate() { - warning("STUB: ShootEmUp::animate()"); + if (_vm->_rnd->getRandomNumber(9) == 1) + showStock(getStockNumber(_vm->_rnd->getRandomNumber(5))); + for (int i = 0; i < 7; i++) { + if (_stockStatus[i] > 5) { + _stockStatus[i]--; + if (_stockStatus[i] == 8) { + _stockStatus[i] = 0; + showStock(i); + } + } + } } void ShootEmUp::collisionCheck() { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index b3561aceae..9162282e65 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -91,16 +91,17 @@ private: byte _timeThisSecond; bool _cp; byte _wasFacing; + byte _escapeStock; bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y); - byte getStockNumber(byte x); + byte getStockNumber(byte index); void blankIt(); void moveThem(); void blank(Common::Rect rect); void plotThem(); void define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe); void defineCameo(int16 xx, int16 yy, byte pp, int16 time); - void showStock(byte x); + void showStock(byte index); void drawNumber(int number, int size, int x); void showScore(); void showTime(); -- cgit v1.2.3 From ad9a8df66dafd2a44a3a9e3869b1ec6948a5dabf Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 15:28:46 +0100 Subject: AVALANCHE: Implement ShootEmUp::escapeCheck(). --- engines/avalanche/shootemup.cpp | 37 ++++++++++++++++++++++++++++++++++++- engines/avalanche/shootemup.h | 1 + 2 files changed, 37 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 70b26d267f..4224b7f2e7 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -88,6 +88,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _wasFacing = 0; _score = 0; _escapeStock = 0; + _gotOut = false; } void ShootEmUp::run() { @@ -524,7 +525,41 @@ void ShootEmUp::hitPeople() { } void ShootEmUp::escapeCheck() { - warning("STUB: ShootEmUp::escapeCheck()"); + if (_count321 != 0) + return; + + if (_escapeCount > 0) { + _escapeCount--; + return; + } + + // Escape_count = 0; now what ? + + if (_escaping) { + if (_gotOut) { + newEscape(); + _escaping = false; + _vm->_graphics->seuDrawPicture(_escapeStock * 90 + 20, 30, kStocks + 4); + } else { + _vm->_graphics->seuDrawPicture(_escapeStock * 90 + 20, 30, kStocks + 5); + _escapeCount = 20; + _gotOut = true; + define(_escapeStock * 90 + 20, 50, 25, 0, 2, 17, false, true); // Escaped! + gain(-10); + _hasEscaped[_escapeStock] = true; + + _howManyHaveEscaped++; + + if (_howManyHaveEscaped == 7) + _time = 0; + } + } else { + _escapeStock = getStockNumber(_vm->_rnd->getRandomNumber(6)); + _escaping = true; + _gotOut = false; + _vm->_graphics->seuDrawPicture(_escapeStock * 90 + 20, 30, kStocks + 2); // Smiling! + _escapeCount = 200; + } } void ShootEmUp::check321() { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 9162282e65..9e9747bc8e 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -92,6 +92,7 @@ private: bool _cp; byte _wasFacing; byte _escapeStock; + bool _gotOut; bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y); byte getStockNumber(byte index); -- cgit v1.2.3 From 808a59bdf26ce1bac620c9d6e9a67b815d22696a Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 15:59:14 +0100 Subject: AVALANCHE: Implement ShootEmUp::collisionCheck(). --- engines/avalanche/shootemup.cpp | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 4224b7f2e7..00e74ccd3b 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -433,7 +433,41 @@ void ShootEmUp::animate() { } void ShootEmUp::collisionCheck() { - warning("STUB: ShootEmUp::collisionCheck()"); + for (int i = 0; i < 99; i++) { + if ((_sprites[i]._x != kFlag) && (_sprites[i]._missile) && + (_sprites[i]._y < 60) && (_sprites[i]._timeout == 1)) { + int distFromSide = (_sprites[i]._x - 20) % 90; + int thisStock = (_sprites[i]._x - 20) / 90; + if ((!_hasEscaped[thisStock]) && (distFromSide > 17) && (distFromSide < 34)) { + _vm->_sound->playNote(999, 3); + _vm->_system->delayMillis(3); + define(_sprites[i]._x + 20, _sprites[i]._y, 26 + _vm->_rnd->getRandomNumber(1), 3, 1, 12, false, true); // Well done! + define(thisStock * 90 + 20, 30, 31, 0, 0, 7, false, false); // Face of man + defineCameo(thisStock * 90 + 20 + 10, 35, 40, 7); // Splat! + define(thisStock * 90 + 20 + 20, 50, 34 + _vm->_rnd->getRandomNumber(4), 0, 2, 9, false, true); // Oof! + _stockStatus[thisStock] = 17; + gain(3); // Score for hitting a face. + + if (_escaping && (_escapeStock = thisStock)) { // Hit the escaper. + _vm->_sound->playNote(1777, 1); + _vm->_system->delayMillis(1); + gain(5); // Bonus for hitting escaper. + _escaping = false; + newEscape(); + } + } else { + define(_sprites[i]._x, _sprites[i]._y, 83 + _vm->_rnd->getRandomNumber(2), 2, 2, 17, false, true); // Missed! + if ((!_hasEscaped[thisStock]) && (distFromSide > 3) && (distFromSide < 43)) { + define(thisStock * 90 + 20, 30, 30, 0, 0, 7, false, false); // Face of man + if (distFromSide > 35) + defineCameo(_sprites[i]._x - 27, 35, 40, 7); // Splat! + else + defineCameo(_sprites[i]._x - 7, 35, 40, 7); + _stockStatus[thisStock] = 17; + } + } + } + } } void ShootEmUp::turnAround(byte who, bool randomX) { -- cgit v1.2.3 From 0b4a2ba0a81f092935e727353e89cb146fc380ce Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 22:25:34 +0100 Subject: AVALANCHE: Implement ShootEmUp::updateTime(). --- engines/avalanche/shootemup.cpp | 24 +++++++++++++++++++++++- engines/avalanche/shootemup.h | 2 ++ 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 00e74ccd3b..e1a6280dc1 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -40,6 +40,8 @@ const long int ShootEmUp::kFlag = -20047; const byte ShootEmUp::kFrameDelayMax = 2; const byte ShootEmUp::kAvvyY = 150; const byte ShootEmUp::kShooting[7] = { 87, 80, 81, 82, 81, 80, 87 }; +const byte ShootEmUp::kTimesASecond = 18; +const byte ShootEmUp::kFlashTime = 20; // If flash_time is <= this, the word "time" will flash. Should be about 20. ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _vm = vm; @@ -532,7 +534,27 @@ void ShootEmUp::peopleRunning() { } void ShootEmUp::updateTime() { - warning("STUB: ShootEmUp::updateTime()"); + if (_count321 != 0) + return; + + _timeThisSecond++; + + if (_timeThisSecond < kTimesASecond) + return; + + _time--; + showTime(); + _timeThisSecond = 0; + + if (_time < kFlashTime) { + int timeMode = 0; + if ((_time % 2) == 1) + timeMode = 20; // Normal 'Time:' + else + timeMode = 86; // Flash 'Time:' + + _vm->_graphics->seuDrawPicture(110, 0, timeMode); + } } void ShootEmUp::hitPeople() { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 9e9747bc8e..36ef8d0e73 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -66,6 +66,8 @@ private: static const byte kFrameDelayMax; static const byte kAvvyY; static const byte kShooting[7]; + static const byte kTimesASecond; + static const byte kFlashTime; AvalancheEngine *_vm; -- cgit v1.2.3 From 401b85eb214e6980e8d030cf36bd55d78371d732 Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 22:31:03 +0100 Subject: AVALANCHE: Implement ShootEmUp::check321(). --- engines/avalanche/shootemup.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index e1a6280dc1..51bc714c28 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -619,7 +619,25 @@ void ShootEmUp::escapeCheck() { } void ShootEmUp::check321() { - warning("STUB: ShootEmUp::check321()"); + if (_count321 == 0) + return; + + _count321--; + + switch (_count321) { + case 84: + define(320, 60, 16, 2, 1, 94, false, true); + break; + case 169: + define(320, 60, 15, 0, 1, 94, false, true); + break; + case 254: + define(320, 60, 14, -2, 1, 94, false, true); + define(0, 100, 18, 2, 0, 254, false, true); + break; + default: + break; + } } } // End of namespace Avalanche -- cgit v1.2.3 From 614006c1e575df5ca03059669e435aedd64e8db1 Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 22:43:29 +0100 Subject: AVALANCHE: Implement ShootEmUp::defineCameo(). --- engines/avalanche/shootemup.cpp | 17 +++++++++++++++-- engines/avalanche/shootemup.h | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 51bc714c28..5f48c2f6dd 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -215,8 +215,21 @@ void ShootEmUp::define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, b } } -void ShootEmUp::defineCameo(int16 xx, int16 yy, byte pp, int16 time) { - warning("STUB: ShootEmUp::defineCameo()"); +void ShootEmUp::defineCameo(int16 x, int16 y, byte p, int16 time) { + for (int i = 0; i < 99; i++) { + if (_sprites[i]._x == kFlag) { + _sprites[i]._x = x; + _sprites[i]._y = y; + _sprites[i]._p = p; + _sprites[i]._ix = 0; + _sprites[i]._iy = 0; + _sprites[i]._timeout = time; + _sprites[i]._cameo = true; + _sprites[i]._cameoFrame = p + 1; + _sprites[i]._missile = false; + _sprites[i]._wipe = false; + } + } } void ShootEmUp::showStock(byte index) { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 36ef8d0e73..d0df763715 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -103,7 +103,7 @@ private: void blank(Common::Rect rect); void plotThem(); void define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe); - void defineCameo(int16 xx, int16 yy, byte pp, int16 time); + void defineCameo(int16 x, int16 y, byte p, int16 time); void showStock(byte index); void drawNumber(int number, int size, int x); void showScore(); -- cgit v1.2.3 From a3d4908e53d812cfcc2fd93fbb067345afa577c6 Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 23:06:49 +0100 Subject: AVALANCHE: Put a necessary delay into ShootEmUp's main loop. --- engines/avalanche/shootemup.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 5f48c2f6dd..02d65772ae 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -116,6 +116,8 @@ void ShootEmUp::run() { setup(); do { + uint32 beginLoop = _vm->_system->getMillis(); + blankIt(); hitPeople(); plotThem(); @@ -133,6 +135,11 @@ void ShootEmUp::run() { _cp = !_cp; _vm->_graphics->refreshScreen(); + + uint32 delay = _vm->_system->getMillis() - beginLoop; + if (delay <= 55) + _vm->_system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight). + } while (_time != 0); _vm->fadeOut(); -- cgit v1.2.3 From acdfcb527294a1b44f647fe4c91115ee0918a6f6 Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 23:28:34 +0100 Subject: AVALANCHE: Repair ShootEmUp::plotThem(). --- engines/avalanche/shootemup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 02d65772ae..baf51a2ebd 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -200,7 +200,7 @@ void ShootEmUp::plotThem() { if (_sprites[i]._timeout > 0) { _sprites[i]._timeout--; if (_sprites[i]._timeout == 0) - _sprites[i]._y = kFlag; + _sprites[i]._x = kFlag; } } } -- cgit v1.2.3 From 73223fd1914306e8332b315033633097f78ddabc Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 23:30:12 +0100 Subject: AVALANCHE: Repair ShootEmUp::define() and ShootEmUp::defineCameo(). --- engines/avalanche/shootemup.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index baf51a2ebd..1ade16fe02 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -218,6 +218,7 @@ void ShootEmUp::define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, b _sprites[i]._cameo = false; _sprites[i]._missile = isAMissile; _sprites[i]._wipe = doWeWipe; + return; } } } @@ -235,6 +236,7 @@ void ShootEmUp::defineCameo(int16 x, int16 y, byte p, int16 time) { _sprites[i]._cameoFrame = p + 1; _sprites[i]._missile = false; _sprites[i]._wipe = false; + return; } } } -- cgit v1.2.3 From db34e0ce0d499257df73574f1d9a70312280716b Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 23:34:22 +0100 Subject: AVALANCHE: Repair ShootEmUp::gain(). --- engines/avalanche/shootemup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 1ade16fe02..2c4777ea07 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -275,7 +275,7 @@ void ShootEmUp::showTime() { } void ShootEmUp::gain(int8 howMuch) { - if ((_score + howMuch) == 0) // howMuch can be negative! + if ((_score + howMuch) < 0) // howMuch can be negative! _score = 0; else _score += howMuch; -- cgit v1.2.3 From 7a17db17a56b47d6297f51cfe392c14440454ef1 Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 20 Feb 2014 23:47:13 +0100 Subject: AVALANCHE: Repair ShootEmUp::updateTime(). --- engines/avalanche/shootemup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 2c4777ea07..30dabf62e7 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -568,7 +568,7 @@ void ShootEmUp::updateTime() { showTime(); _timeThisSecond = 0; - if (_time < kFlashTime) { + if (_time <= kFlashTime) { int timeMode = 0; if ((_time % 2) == 1) timeMode = 20; // Normal 'Time:' -- cgit v1.2.3 From 46b7c1fde4313bea4565284c84d081f3c18d5db1 Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 21 Feb 2014 00:03:18 +0100 Subject: AVALANCHE: Repair ShootEmUp::setup(). --- engines/avalanche/shootemup.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 30dabf62e7..8b024275a9 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -366,6 +366,9 @@ void ShootEmUp::setup() { for (int i = 0; i < 4; i++) _running[i]._x = kFlag; + for (int i = 0; i < 99; i++) + _sprites[i]._x = kFlag; + newEscape(); _count321 = 255; // Counting down. -- cgit v1.2.3 From 55719452830808fd24a3274734212df22405fd61 Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 21 Feb 2014 15:33:21 +0100 Subject: AVALANCHE: Repair ShootEmUp::setup(). --- engines/avalanche/shootemup.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 8b024275a9..a2d5289e63 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -347,11 +347,6 @@ void ShootEmUp::setup() { _score = 0; _time = 120; - for (int i = 0; i < 7; i++) { - _stockStatus[i] = _vm->_rnd->getRandomNumber(1); - showStock(i); - } - _cp = true; _avvyWas = 320; @@ -375,6 +370,11 @@ void ShootEmUp::setup() { _vm->_graphics->blackOutScreen(); + for (int i = 0; i < 7; i++) { + _stockStatus[i] = _vm->_rnd->getRandomNumber(1); + showStock(i); + } + // Set up status line: _vm->_graphics->seuDrawPicture(0, 0, 16); // Score: showScore(); // Value of score (00000 here). -- cgit v1.2.3 From 5580c0b95e11d4035626ddd6efef600385044f76 Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 21 Feb 2014 15:50:37 +0100 Subject: AVALANCHE: Repair define() and defineCameo() in ShootEmUp. --- engines/avalanche/shootemup.cpp | 6 +++--- engines/avalanche/shootemup.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index a2d5289e63..783c1f9e20 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -206,12 +206,12 @@ void ShootEmUp::plotThem() { } } -void ShootEmUp::define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe) { +void ShootEmUp::define(int16 x, int16 y, int8 p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe) { for (int i = 0; i < 99; i++) { if (_sprites[i]._x == kFlag) { _sprites[i]._x = x; _sprites[i]._y = y; - _sprites[i]._p = p; + _sprites[i]._p = p - 1; _sprites[i]._ix = ix; _sprites[i]._iy = iy; _sprites[i]._timeout = time; @@ -223,7 +223,7 @@ void ShootEmUp::define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, b } } -void ShootEmUp::defineCameo(int16 x, int16 y, byte p, int16 time) { +void ShootEmUp::defineCameo(int16 x, int16 y, int8 p, int16 time) { for (int i = 0; i < 99; i++) { if (_sprites[i]._x == kFlag) { _sprites[i]._x = x; diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index d0df763715..ada39066fd 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -41,7 +41,7 @@ private: struct Sprite { int8 _ix, _iy; int16 _x, _y; - byte _p; + int8 _p; int16 _timeout; bool _cameo; byte _cameoFrame; @@ -102,8 +102,8 @@ private: void moveThem(); void blank(Common::Rect rect); void plotThem(); - void define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe); - void defineCameo(int16 x, int16 y, byte p, int16 time); + void define(int16 x, int16 y, int8 p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe); + void defineCameo(int16 x, int16 y, int8 p, int16 time); void showStock(byte index); void drawNumber(int number, int size, int x); void showScore(); -- cgit v1.2.3 From d23ced0aed643b2d6e3b6a70518f9412652dd817 Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 21 Feb 2014 16:22:37 +0100 Subject: AVALANCHE: Repair ShootEmUp::plotThem(). --- engines/avalanche/graphics.cpp | 8 ++++++++ engines/avalanche/graphics.h | 2 ++ engines/avalanche/shootemup.cpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 3b4413ab76..603e294fd8 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -779,6 +779,14 @@ void GraphicManager::seuDrawCameo(int destX, int destY, byte w1, byte w2) { drawPicture(_surface, _seuPictures[w1], destX, destY); } +uint16 GraphicManager::seuGetPicWidth(int which) { + return _seuPictures[which].w; +} + +uint16 GraphicManager::seuGetPicHeight(int which) { + return _seuPictures[which].h; +} + /** * This function is for skipping the difference between a stored 'size' value associated with a picture * and the actual size of the pictures when reading them from files for Ghostroom and Shoot em' up. diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 553f993188..86244e9b3c 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -116,6 +116,8 @@ public: void seuFree(); void seuDrawPicture(int x, int y, byte which); void seuDrawCameo(int destX, int destY, byte w1, byte w2); + uint16 seuGetPicWidth(int which); + uint16 seuGetPicHeight(int which); void clearAlso(); void clearTextBar(); diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 783c1f9e20..1b48aa9433 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -195,7 +195,7 @@ void ShootEmUp::plotThem() { _vm->_graphics->seuDrawPicture(_sprites[i]._x, _sprites[i]._y, _sprites[i]._p); if (_sprites[i]._wipe) - blank(Common::Rect(_sprites[i]._x, _sprites[i]._y, _sprites[i]._x + _rectangles[i].width(), _sprites[i]._y + _rectangles[i].height())); + blank(Common::Rect(_sprites[i]._x, _sprites[i]._y, _sprites[i]._x + _vm->_graphics->seuGetPicWidth(_sprites[i]._p), _sprites[i]._y + _vm->_graphics->seuGetPicHeight(_sprites[i]._p))); if (_sprites[i]._timeout > 0) { _sprites[i]._timeout--; -- cgit v1.2.3 From 59f440c36a75dad95e1fa12f6ff26a329cdd94b0 Mon Sep 17 00:00:00 2001 From: uruk Date: Sat, 22 Feb 2014 15:35:24 +0100 Subject: AVALANCHE: Repair ShootEmUp::updateTime(). --- engines/avalanche/shootemup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 1b48aa9433..676154d52f 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -574,9 +574,9 @@ void ShootEmUp::updateTime() { if (_time <= kFlashTime) { int timeMode = 0; if ((_time % 2) == 1) - timeMode = 20; // Normal 'Time:' + timeMode = 19; // Normal 'Time:' else - timeMode = 86; // Flash 'Time:' + timeMode = 85; // Flash 'Time:' _vm->_graphics->seuDrawPicture(110, 0, timeMode); } -- cgit v1.2.3 From c03ed78a24a92f6b73f589b50a16753dc4ac5961 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 25 Feb 2014 07:33:42 +0100 Subject: AVALANCHE: Fix destination check in initRunner() --- engines/avalanche/shootemup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 676154d52f..f50be51eaf 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -400,7 +400,7 @@ void ShootEmUp::initRunner(int16 x, int16 y, byte f1, byte f2, int8 ix, int8 iy) _running[i]._lowest = f1; _running[i]._ix = ix; _running[i]._iy = iy; - if ((ix = 0) && (iy = 0)) + if ((ix == 0) && (iy == 0)) _running[i]._ix = 2; // To stop them running on the spot! _running[i]._frameDelay = kFrameDelayMax; return; -- cgit v1.2.3 From e15dafb9e4f15a1c9095b02bca0d240de9bd2f09 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 25 Feb 2014 21:56:32 +0100 Subject: AVALANCHE: Rework use of Common::Rect. Now the right and bottom coordinates of the rectangles aren't included in them. --- engines/avalanche/ghostroom.cpp | 18 +++++++++--------- engines/avalanche/graphics.cpp | 8 ++++---- engines/avalanche/graphics.h | 2 -- engines/avalanche/help.cpp | 4 ++-- engines/avalanche/nim.cpp | 18 +++++++++--------- engines/avalanche/shootemup.cpp | 2 +- 6 files changed, 25 insertions(+), 27 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp index 91b2bae4f0..1419a0cbab 100644 --- a/engines/avalanche/ghostroom.cpp +++ b/engines/avalanche/ghostroom.cpp @@ -230,12 +230,12 @@ void GhostRoom::run() { int xBound = x % 30; if ((22 <= xBound) && (xBound <= 27)) { if (xBound == 27) - _vm->_graphics->drawFilledRectangle(Common::Rect(x, 135, x + 16, 136), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(x, 135, x + 17, 137), kColorBlack); _vm->_graphics->ghostDrawPicture(_eyes[0], x, 136); _vm->_graphics->drawDot(x + 16, 137, kColorBlack); } else { if (xBound == 21) - _vm->_graphics->drawFilledRectangle(Common::Rect(x, 137, x + 17, 138), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(x, 137, x + 18, 139), kColorBlack); _vm->_graphics->ghostDrawPicture(_eyes[0], x, 135); _vm->_graphics->drawDot(x + 16, 136, kColorBlack); // Eyes would leave a trail 1 pixel high behind them. } @@ -257,7 +257,7 @@ void GhostRoom::run() { } // Blank out the Glerk's space. - _vm->_graphics->drawFilledRectangle(Common::Rect(456, 14, 530, 50), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(456, 14, 531, 51), kColorBlack); _vm->_graphics->refreshScreen(); @@ -265,7 +265,7 @@ void GhostRoom::run() { for (int y = -64; y <= 103; y++) { _vm->_graphics->ghostDrawGhost(_ghost[1 + (abs(y / 7) % 2) * 3], 0, y); if (y > 0) - _vm->_graphics->drawFilledRectangle(Common::Rect(0, y - 1, 26 * 8, y), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(0, y - 1, 26 * 8 + 1, y + 1), kColorBlack); _vm->_graphics->refreshScreen(); wait(27); @@ -276,7 +276,7 @@ void GhostRoom::run() { for (int i = 0; i < 4; i++) { for (int j = 0; j < 5; j++) { - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 96, 26 * 8, 169), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 96, 26 * 8, 170), kColorBlack); _vm->_graphics->ghostDrawGhost(_ghost[kWaveOrder[j]], 0, 96 + kAdjustment[j]); _aarghCount++; @@ -298,7 +298,7 @@ void GhostRoom::run() { wait(777); // Erase "aargh": - _vm->_graphics->drawFilledRectangle(Common::Rect(172, 78, 347, 111), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(172, 78, 348, 112), kColorBlack); _vm->_graphics->refreshScreen(); for (int i = 4; i >= 0; i--) { @@ -307,7 +307,7 @@ void GhostRoom::run() { } // Erase the exclamation mark: - _vm->_graphics->drawFilledRectangle(Common::Rect(246, 127, 251, 133), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(246, 127, 252, 134), kColorBlack); _vm->_graphics->refreshScreen(); // Avvy hurries back: @@ -320,12 +320,12 @@ void GhostRoom::run() { int xBound = x % 30; if ((22 <= xBound) && (xBound <= 27)) { if (xBound == 22) - _vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 134, x + 38, 137), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 134, x + 39, 138), kColorBlack); _vm->_graphics->ghostDrawPicture(_eyes[1], x + 23, 136); _vm->_graphics->drawDot(x + 22, 137, kColorBlack); } else { if (xBound == 28) - _vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 135, x + 38, 138), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(x + 22, 135, x + 39, 139), kColorBlack); _vm->_graphics->ghostDrawPicture(_eyes[1], x + 23, 135); _vm->_graphics->drawDot(x + 22, 136, kColorBlack); // Eyes would leave a trail 1 pixel high behind them. } diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 603e294fd8..9510f4f72a 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -479,15 +479,15 @@ void GraphicManager::drawDebugLines() { } void GraphicManager::drawRectangle(Common::Rect rect, Color color) { - _surface.frameRect(Common::Rect(rect.left, rect.top, rect.right + 1, rect.bottom + 1), color); + _surface.frameRect(rect, color); } void GraphicManager::drawFilledRectangle(Common::Rect rect, Color color) { - _surface.fillRect(Common::Rect(rect.left, rect.top, rect.right + 1, rect.bottom + 1), color); + _surface.fillRect(rect, color); } void GraphicManager::blackOutScreen() { - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); } void GraphicManager::nimLoad() { @@ -691,7 +691,7 @@ void GraphicManager::helpDrawHighlight(byte which, Color color) { return; which &= 31; - drawRectangle(Common::Rect(466, 38 + which * 27, 555, 62 + which * 27), color); + drawRectangle(Common::Rect(466, 38 + which * 27, 556, 63 + which * 27), color); } /** diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 86244e9b3c..acc0c92a15 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -59,8 +59,6 @@ public: void loadDigits(); void loadMouse(byte which); - // We have to handle the drawing of rectangles a little bit differently to mimic Pascal's bar() and rectangle() methods properly. - // Now it is possible to use the original coordinates everywhere. void drawRectangle(Common::Rect rect, Color color); void drawFilledRectangle(Common::Rect rect, Color color); void blackOutScreen(); diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp index 5d3247ba9a..b24f6c40d8 100644 --- a/engines/avalanche/help.cpp +++ b/engines/avalanche/help.cpp @@ -66,8 +66,8 @@ void Help::switchPage(byte which) { Common::String title = getLine(file); - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlue); - _vm->_graphics->drawFilledRectangle(Common::Rect(8, 40, 449, 199), kColorWhite); + _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlue); + _vm->_graphics->drawFilledRectangle(Common::Rect(8, 40, 450, 200), kColorWhite); byte index = file.readByte(); _vm->_graphics->helpDrawButton(-177, index); diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp index 87af8053e1..9457a5065b 100644 --- a/engines/avalanche/nim.cpp +++ b/engines/avalanche/nim.cpp @@ -152,13 +152,13 @@ void Nim::setup() { _vm->fadeIn(); _vm->_graphics->nimLoad(); - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); + _vm->_graphics->blackOutScreen(); // Upper left rectangle. - _vm->_graphics->drawRectangle(Common::Rect(10, 5, 380, 70), kColorRed); - _vm->_graphics->drawFilledRectangle(Common::Rect(11, 6, 379, 69), kColorBrown); + _vm->_graphics->drawRectangle(Common::Rect(10, 5, 381, 71), kColorRed); + _vm->_graphics->drawFilledRectangle(Common::Rect(11, 6, 380, 70), kColorBrown); // Bottom right rectangle. - _vm->_graphics->drawRectangle(Common::Rect(394, 50, 634, 197), kColorRed); - _vm->_graphics->drawFilledRectangle(Common::Rect(395, 51, 633, 196), kColorBrown); + _vm->_graphics->drawRectangle(Common::Rect(394, 50, 635, 198), kColorRed); + _vm->_graphics->drawFilledRectangle(Common::Rect(395, 51, 634, 197), kColorBrown); _vm->_graphics->nimDrawLogo(); _vm->_graphics->nimDrawInitials(); @@ -383,8 +383,8 @@ void Nim::takeSome() { int x1 = 63 + (_stones[_row] - _number) * 64; int y1 = 38 + 35 * (_row + 1); - int x2 = 54 + _stones[_row] * 64; - int y2 = 63 + 35 * (_row + 1); + int x2 = 55 + _stones[_row] * 64; + int y2 = 64 + 35 * (_row + 1); _vm->_graphics->drawRectangle(Common::Rect(x1, y1, x2, y2), kColorBlue); // Draw the selection rectangle. _vm->_graphics->refreshScreen(); @@ -396,8 +396,8 @@ void Nim::takeSome() { _vm->_graphics->drawRectangle(Common::Rect(x1, y1, x2, y2), kColorBlack); // Erase the previous selection. x1 = 63 + (_stones[_row] - _number) * 64; y1 = 38 + 35 * (_row + 1); - x2 = 54 + _stones[_row] * 64; - y2 = 63 + 35 * (_row + 1); + x2 = 55 + _stones[_row] * 64; + y2 = 64 + 35 * (_row + 1); _vm->_graphics->drawRectangle(Common::Rect(x1, y1, x2, y2), kColorBlue); // Draw the new one. _vm->_graphics->refreshScreen(); } diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index f50be51eaf..c14961af42 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -300,7 +300,7 @@ void ShootEmUp::nextPage() { } } - _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 639, 199), kColorBlack); + _vm->_graphics->blackOutScreen(); } void ShootEmUp::instructions() { -- cgit v1.2.3 From bb6b3e87b69aab2bc53fd3f170998243175ff8c4 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 25 Feb 2014 22:27:50 +0100 Subject: AVALANCHE: Move initializations from ShootEmUp::setup() to the constructor. --- engines/avalanche/shootemup.cpp | 42 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index c14961af42..3946d80561 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -46,13 +46,13 @@ const byte ShootEmUp::kFlashTime = 20; // If flash_time is <= this, the word "ti ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _vm = vm; - _time = 0; + _time = 120; for (int i = 0; i < 7; i++) _stockStatus[i] = 0; for (int i = 0; i < 99; i++) { _sprites[i]._ix = 0; _sprites[i]._iy = 0; - _sprites[i]._x = 0; + _sprites[i]._x = kFlag; _sprites[i]._y = 0; _sprites[i]._p = 0; _sprites[i]._timeout = 0; @@ -62,15 +62,15 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _sprites[i]._wipe = false; } _rectNum = 0; - _avvyWas = 0; - _avvyPos = 0; - _avvyAnim = 0; - _avvyFacing = 0; + _avvyWas = 320; + _avvyPos = 320; + _avvyAnim = 1; + _avvyFacing = kFacingLeft; _altWasPressedBefore = false; - _throwNext = 0; + _throwNext = 74; _firing = false; for (int i = 0; i < 4; i++) { - _running[i]._x = 0; + _running[i]._x = kFlag; _running[i]._y = 0; _running[i]._frame = 0; _running[i]._tooHigh = 0; @@ -81,7 +81,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) { } for (int i = 0; i < 7; i++) _hasEscaped[i] = false; - _count321 = 0; + _count321 = 255; // Counting down. _howManyHaveEscaped = 0; _escapeCount = 0; _escaping = false; @@ -344,32 +344,10 @@ void ShootEmUp::instructions() { } void ShootEmUp::setup() { - _score = 0; - _time = 120; - - _cp = true; - - _avvyWas = 320; - _avvyPos = 320; - _avvyAnim = 1; - _avvyFacing = kFacingLeft; - - _altWasPressedBefore = false; - _throwNext = 74; - _firing = false; - - for (int i = 0; i < 4; i++) - _running[i]._x = kFlag; - - for (int i = 0; i < 99; i++) - _sprites[i]._x = kFlag; + _vm->_graphics->blackOutScreen(); newEscape(); - _count321 = 255; // Counting down. - - _vm->_graphics->blackOutScreen(); - for (int i = 0; i < 7; i++) { _stockStatus[i] = _vm->_rnd->getRandomNumber(1); showStock(i); -- cgit v1.2.3 From 0e17b464ca620931f43be55fdfdbc0a0fb78cb7b Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 25 Feb 2014 22:49:44 +0100 Subject: AVALANCHE: Repair ShootEmUp::escapeCheck(). --- engines/avalanche/shootemup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 3946d80561..8a62752983 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -609,8 +609,10 @@ void ShootEmUp::escapeCheck() { _howManyHaveEscaped++; - if (_howManyHaveEscaped == 7) + if (_howManyHaveEscaped == 7) { + _vm->_graphics->seuDrawPicture(266, 90, 23); _time = 0; + } } } else { _escapeStock = getStockNumber(_vm->_rnd->getRandomNumber(6)); -- cgit v1.2.3 From c47d8a4597c499f1493fe0da99d32f5790cd3df3 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 25 Feb 2014 23:14:06 +0100 Subject: AVALANCHE: Rework define() and the constants in ShootEmUp. --- engines/avalanche/shootemup.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 8a62752983..bf041b5ad8 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -39,7 +39,7 @@ const byte ShootEmUp::kFacingLeft = 93; const long int ShootEmUp::kFlag = -20047; const byte ShootEmUp::kFrameDelayMax = 2; const byte ShootEmUp::kAvvyY = 150; -const byte ShootEmUp::kShooting[7] = { 87, 80, 81, 82, 81, 80, 87 }; +const byte ShootEmUp::kShooting[7] = { 86, 79, 80, 81, 80, 79, 86 }; const byte ShootEmUp::kTimesASecond = 18; const byte ShootEmUp::kFlashTime = 20; // If flash_time is <= this, the word "time" will flash. Should be about 20. @@ -211,7 +211,7 @@ void ShootEmUp::define(int16 x, int16 y, int8 p, int8 ix, int8 iy, int16 time, b if (_sprites[i]._x == kFlag) { _sprites[i]._x = x; _sprites[i]._y = y; - _sprites[i]._p = p - 1; + _sprites[i]._p = p; _sprites[i]._ix = ix; _sprites[i]._iy = iy; _sprites[i]._timeout = time; @@ -446,10 +446,10 @@ void ShootEmUp::collisionCheck() { if ((!_hasEscaped[thisStock]) && (distFromSide > 17) && (distFromSide < 34)) { _vm->_sound->playNote(999, 3); _vm->_system->delayMillis(3); - define(_sprites[i]._x + 20, _sprites[i]._y, 26 + _vm->_rnd->getRandomNumber(1), 3, 1, 12, false, true); // Well done! - define(thisStock * 90 + 20, 30, 31, 0, 0, 7, false, false); // Face of man + define(_sprites[i]._x + 20, _sprites[i]._y, 25 + _vm->_rnd->getRandomNumber(1), 3, 1, 12, false, true); // Well done! + define(thisStock * 90 + 20, 30, 30, 0, 0, 7, false, false); // Face of man defineCameo(thisStock * 90 + 20 + 10, 35, 40, 7); // Splat! - define(thisStock * 90 + 20 + 20, 50, 34 + _vm->_rnd->getRandomNumber(4), 0, 2, 9, false, true); // Oof! + define(thisStock * 90 + 20 + 20, 50, 33 + _vm->_rnd->getRandomNumber(4), 0, 2, 9, false, true); // Oof! _stockStatus[thisStock] = 17; gain(3); // Score for hitting a face. @@ -461,9 +461,9 @@ void ShootEmUp::collisionCheck() { newEscape(); } } else { - define(_sprites[i]._x, _sprites[i]._y, 83 + _vm->_rnd->getRandomNumber(2), 2, 2, 17, false, true); // Missed! + define(_sprites[i]._x, _sprites[i]._y, 82 + _vm->_rnd->getRandomNumber(2), 2, 2, 17, false, true); // Missed! if ((!_hasEscaped[thisStock]) && (distFromSide > 3) && (distFromSide < 43)) { - define(thisStock * 90 + 20, 30, 30, 0, 0, 7, false, false); // Face of man + define(thisStock * 90 + 20, 30, 29, 0, 0, 7, false, false); // Face of man if (distFromSide > 35) defineCameo(_sprites[i]._x - 27, 35, 40, 7); // Splat! else @@ -514,9 +514,9 @@ void ShootEmUp::peopleRunning() { byte frame = 0; if (_running[i]._ix < 0) - frame = _running[i]._frame; + frame = _running[i]._frame - 1; else - frame = _running[i]._frame + 7; + frame = _running[i]._frame + 6; define(_running[i]._x, _running[i]._y, frame, 0, 0, 1, false, true); if (_running[i]._frameDelay == 0) { @@ -575,8 +575,8 @@ void ShootEmUp::hitPeople() { _vm->_sound->playNote(7177, 1); _sprites[i]._x = kFlag; gain(-5); - define(_running[j]._x + 20, _running[j]._y + 3, 34 + _vm->_rnd->getRandomNumber(5), 1, 3, 9, false, true); // Oof! - define(_sprites[i]._x, _sprites[i]._y, 83, 1, 0, 17, false, true); // Oops! + define(_running[j]._x + 20, _running[j]._y + 3, 33 + _vm->_rnd->getRandomNumber(5), 1, 3, 9, false, true); // Oof! + define(_sprites[i]._x, _sprites[i]._y, 82, 1, 0, 17, false, true); // Oops! } } } @@ -603,7 +603,7 @@ void ShootEmUp::escapeCheck() { _vm->_graphics->seuDrawPicture(_escapeStock * 90 + 20, 30, kStocks + 5); _escapeCount = 20; _gotOut = true; - define(_escapeStock * 90 + 20, 50, 25, 0, 2, 17, false, true); // Escaped! + define(_escapeStock * 90 + 20, 50, 24, 0, 2, 17, false, true); // Escaped! gain(-10); _hasEscaped[_escapeStock] = true; @@ -631,14 +631,14 @@ void ShootEmUp::check321() { switch (_count321) { case 84: - define(320, 60, 16, 2, 1, 94, false, true); + define(320, 60, 15, 2, 1, 94, false, true); break; case 169: - define(320, 60, 15, 0, 1, 94, false, true); + define(320, 60, 14, 0, 1, 94, false, true); break; case 254: - define(320, 60, 14, -2, 1, 94, false, true); - define(0, 100, 18, 2, 0, 254, false, true); + define(320, 60, 13, -2, 1, 94, false, true); + define(0, 100, 17, 2, 0, 254, false, true); break; default: break; -- cgit v1.2.3