Permalink
Browse files

STARTREK: Fix some uninitialized variables

  • Loading branch information...
Drenn1 authored and sev- committed Jun 11, 2018
1 parent 487c3fd commit 688c98890929acf4fb6a43a115e28f250fb7d466
Showing with 48 additions and 1 deletion.
  1. +3 −0 engines/startrek/graphics.cpp
  2. +44 −0 engines/startrek/object.h
  3. +1 −1 engines/startrek/startrek.cpp
@@ -51,6 +51,9 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
_palData = new byte[256 * 3];
_lutData = new byte[256 * 3];

memset(_palData, 0, 256 * 3);
memset(_lutData, 0, 256 * 3);

_paletteFadeLevel = 0;
_mouseLocked = false;
_mouseToBeShown = false;
@@ -122,6 +122,50 @@ struct Actor {
uint16 fielda2;
uint16 fielda4;
uint16 fielda6;

public:
Actor() :
spriteDrawn(),
//animFilename[16],
animType(),
sprite(),
//bitmapFilename[10],
scale(),
animFile(),
numAnimFrames(),
animFrame(),
frameToStartNextAnim(),
pos(),
field60(),
field62(),
triggerActionWhenAnimFinished(),
finishedAnimActionParam(),
//animationString2[8](),
field70(),
field72(),
field74(),
field76(),
iwSrcPosition(),
iwDestPosition(),
granularPosX(),
granularPosY(),
speedX(),
speedY(),

dest(),
field90(),
field92(),

direction(),
field94(),
field96(),
//char animationString[10];

fielda2(),
fielda4(),
fielda6()
{}

};

}
@@ -1134,7 +1134,7 @@ bool StarTrekEngine::walkActiveObjectToHotspot() {
int objectIndex;
if (_awayMission.activeAction != ACTION_USE)
objectIndex = OBJECT_KIRK;
else if (_awayMission.activeObject >= OBJECT_KIRK && _awayMission.activeObject <= OBJECT_REDSHIRT)
else if (_awayMission.activeObject <= OBJECT_REDSHIRT)
objectIndex = _awayMission.activeObject;
else if (_awayMission.activeObject >= ITEMS_START && _awayMission.activeObject <= ITEMS_END) { // FIXME: "<= ITEMS_END" doesn't make sense?
if (_awayMission.activeObject == OBJECT_ISTRICOR)

0 comments on commit 688c988

Please sign in to comment.