Permalink
Browse files

SUPERNOVA: Adds missing initializations

  • Loading branch information...
Joefish committed Nov 21, 2018
1 parent 1d00e62 commit ff36f94c1f6112b4f6318a25c3376d6d53b07b53
Showing with 36 additions and 3 deletions.
  1. +18 −0 engines/supernova/graphics.cpp
  2. +12 −0 engines/supernova/rooms.cpp
  3. +2 −1 engines/supernova/state.cpp
  4. +4 −2 engines/supernova/state.h
@@ -42,6 +42,24 @@ MSNImage::MSNImage() {
_pitch = 0;
_numSections = 0;
_numClickFields = 0;

for (int i = 0; i < kMaxSections; ++i) {
_section[i].x1 = 0;
_section[i].x2 = 0;
_section[i].y1 = 0;
_section[i].y2 = 0;
_section[i].next = 0;
_section[i].addressLow = 0xFFFF;
_section[i].addressHigh = 0xFF;
}

for (int i = 0; i < kMaxClickFields; ++i) {
_clickField[i].x1 = 0;
_clickField[i].x2 = 0;
_clickField[i].y1 = 0;
_clickField[i].y2 = 0;
_clickField[i].next = 0;
}
}

MSNImage::~MSNImage() {
@@ -32,6 +32,11 @@ namespace Supernova {

Room::Room() {
_seen = false;
_fileNumber = 0;
_id = NULLROOM;
_vm = nullptr;
_gm = nullptr;

for (int i = 0; i < kMaxSection; ++i)
_shown[i] = kShownFalse;
for (int i = 0; i < kMaxDialog; ++i)
@@ -704,6 +709,7 @@ ShipSleepCabin::ShipSleepCabin(SupernovaEngine *vm, GameManager *gm) {
_fileNumber = 33;
_id = SLEEP;
_shown[0] = kShownTrue;
_color = kColorBlack;

_objectState[0] = Object(_id, kStringHatch, kStringStasisHatchDescription2, CABINS, NULLTYPE, 0, 0, 0, NULLROOM, 0);
_objectState[1] = Object(_id, kStringHatch, kStringStasisHatchDescription2, CABIN, NULLTYPE, 1, 1, 0, NULLROOM, 0);
@@ -916,6 +922,7 @@ ShipCockpit::ShipCockpit(SupernovaEngine *vm, GameManager *gm) {
_fileNumber = 9;
_id = COCKPIT;
_shown[0] = kShownTrue;
_color = kColorBlack;

_objectState[0] = Object(_id, kStringInstruments, kStringInstrumentsDescription1, INSTRUMENTS, NULLTYPE, 2, 2, 0, NULLROOM, 0);
_objectState[1] = Object(_id, kStringMonitor, kStringDefaultDescription, MONITOR, NULLTYPE, 0, 0, 0, NULLROOM, 0);
@@ -1907,6 +1914,8 @@ ArsanoMeetup::ArsanoMeetup(SupernovaEngine *vm, GameManager *gm) {
_fileNumber = 37;
_id = MEETUP;
_shown[0] = kShownTrue;
_sign = 0;
_beacon = 0;

_objectState[0] = Object(_id, kStringCave,kStringDefaultDescription,NULLOBJECT,EXIT,255,255,0,CAVE,22);
_objectState[1] = Object(_id, kStringSign,kStringSignDescription,MEETUP_SIGN,NULLTYPE,0,0,0);
@@ -2273,6 +2282,7 @@ ArsanoRemaining::ArsanoRemaining(SupernovaEngine *vm, GameManager *gm) {
_objectState[2] = Object(_id, kStringShoes,kStringShoesDescription,NULLOBJECT,NULLTYPE,2,2,0);

_chewing = kShownTrue;
_i = 0;
}

void ArsanoRemaining::animation() {
@@ -2459,6 +2469,7 @@ ArsanoRoger::ArsanoRoger(SupernovaEngine *vm, GameManager *gm) {
_dialog1[3] = kStringDialogSeparator;

_eyewitness = 5;
_hands = 0;
}

void ArsanoRoger::onEntrance() {
@@ -2592,6 +2603,7 @@ ArsanoGlider::ArsanoGlider(SupernovaEngine *vm, GameManager *gm) {
_fileNumber = 19;
_id = GLIDER;
_shown[0] = kShownTrue;
_sinus = 0;

_objectState[0] = Object(_id, kStringExit,kStringDefaultDescription,NULLOBJECT,EXIT,255,255,0,MEETUP,15);
_objectState[1] = Object(_id, kStringButton,kStringDefaultDescription,GLIDER_BUTTON1,PRESS,0,0,0);
@@ -290,7 +290,8 @@ StringId GameManager::guiStatusCommands[] = {
GameManager::GameManager(SupernovaEngine *vm, Sound *sound)
: _inventory(&_nullObject, _inventoryScroll)
, _vm(vm)
, _sound(sound) {
, _sound(sound)
, _mouseClickType(Common::EVENT_INVALID) {
initRooms();
changeRoom(INTRO);
initState();
@@ -68,8 +68,10 @@ class Inventory {
Inventory(Object *nullObject, int &inventoryScroll)
: _numObjects(0)
, _nullObject(nullObject)
, _inventoryScroll(inventoryScroll)
{}
, _inventoryScroll(inventoryScroll) {
for (int i = 0; i < kMaxCarry; ++i)
_inventory[i] = nullptr;
}

void add(Object &obj);
void remove(Object &obj);

0 comments on commit ff36f94

Please sign in to comment.