aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2014-02-25 22:27:50 +0100
committeruruk2014-02-25 22:27:50 +0100
commitbb6b3e87b69aab2bc53fd3f170998243175ff8c4 (patch)
tree64bec6fd5953e7f8f6a860671926264bfd703a1e /engines
parente15dafb9e4f15a1c9095b02bca0d240de9bd2f09 (diff)
downloadscummvm-rg350-bb6b3e87b69aab2bc53fd3f170998243175ff8c4.tar.gz
scummvm-rg350-bb6b3e87b69aab2bc53fd3f170998243175ff8c4.tar.bz2
scummvm-rg350-bb6b3e87b69aab2bc53fd3f170998243175ff8c4.zip
AVALANCHE: Move initializations from ShootEmUp::setup() to the constructor.
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/shootemup.cpp42
1 files changed, 10 insertions, 32 deletions
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);