diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp index 9a05a424cac..ff385f947fb 100644 --- a/engines/supernova/graphics.cpp +++ b/engines/supernova/graphics.cpp @@ -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() { diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp index ce274d6d8e1..18fd64e32cb 100644 --- a/engines/supernova/rooms.cpp +++ b/engines/supernova/rooms.cpp @@ -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); diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp index 92a8dfe16a2..8d54bd7d611 100644 --- a/engines/supernova/state.cpp +++ b/engines/supernova/state.cpp @@ -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(); diff --git a/engines/supernova/state.h b/engines/supernova/state.h index 7d7b2284add..c0446705f09 100644 --- a/engines/supernova/state.h +++ b/engines/supernova/state.h @@ -68,8 +68,10 @@ public: 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);