[Scummvm-git-logs] scummvm master -> 3231a6e3a20010de64b9d6397c08c0ace917bd05
bluegr
noreply at scummvm.org
Fri May 13 19:35:00 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3231a6e3a2 SCUMM: Use inline member initialization
Commit: 3231a6e3a20010de64b9d6397c08c0ace917bd05
https://github.com/scummvm/scummvm/commit/3231a6e3a20010de64b9d6397c08c0ace917bd05
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2022-05-13T22:34:56+03:00
Commit Message:
SCUMM: Use inline member initialization
and initialize all members.
Changed paths:
engines/scumm/scumm.cpp
engines/scumm/scumm.h
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 9eb1372fd11..ab270d3c09e 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -106,15 +106,9 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_game(dr.game),
_filenamePattern(dr.fp),
_language(dr.language),
- _currentScript(0xFF), // Let debug() work on init stage
- _messageDialog(nullptr), _pauseDialog(nullptr), _versionDialog(nullptr),
_rnd("scumm"),
- _shakeTimerRate(dr.game.version <= 3 ? 236696 : 291304),
- _enableEnhancements(false)
- {
-
- _localizer = nullptr;
-
+ _shakeTimerRate(dr.game.version <= 3 ? 236696 : 291304)
+{
#ifdef USE_RGB_COLOR
if (_game.features & GF_16BIT_COLOR) {
if (_game.platform == Common::kPlatformPCEngine)
@@ -147,206 +141,40 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_gameMD5[i] = (byte)tmpVal;
}
- _fileHandle = nullptr;
-
// Init all vars
- _imuse = nullptr;
- _imuseDigital = nullptr;
- _musicEngine = nullptr;
- _townsPlayer = nullptr;
- _verbs = nullptr;
- _objs = nullptr;
- _sound = nullptr;
memset(&vm, 0, sizeof(vm));
- _pauseDialog = nullptr;
- _versionDialog = nullptr;
- _fastMode = 0;
- _actors = _sortedActors = nullptr;
- _arraySlot = nullptr;
- _inventory = nullptr;
- _newNames = nullptr;
- _scummVars = nullptr;
- _roomVars = nullptr;
- _varwatch = 0;
- _bitVars = nullptr;
- _numVariables = 0;
- _numBitVariables = 0;
- _numRoomVariables = 0;
- _numLocalObjects = 0;
- _numGlobalObjects = 0;
- _numArray = 0;
- _numVerbs = 0;
- _numFlObject = 0;
- _numInventory = 0;
- _numRooms = 0;
- _numScripts = 0;
- _numSounds = 0;
- _numCharsets = 0;
- _numNewNames = 0;
- _numGlobalScripts = 0;
- _numCostumes = 0;
- _numImages = 0;
- _numLocalScripts = 60;
- _numSprites = 0;
- _numTalkies = 0;
- _numPalettes = 0;
- _numUnk = 0;
- _curPalIndex = 0;
- _currentRoom = 0;
- _egoPositioned = false;
- _mouseAndKeyboardStat = 0;
- _leftBtnPressed = 0;
- _rightBtnPressed = 0;
- _lastInputScriptTime = 0;
- _bootParam = 0;
- _dumpScripts = false;
- _debugMode = false;
- _objectOwnerTable = nullptr;
- _objectRoomTable = nullptr;
- _objectStateTable = nullptr;
- _numObjectsInRoom = 0;
- _userPut = 0;
- _userState = 0;
- _resourceHeaderSize = 8;
- _saveLoadFlag = 0;
- _saveLoadSlot = 0;
- _lastSaveTime = 0;
- _saveTemporaryState = false;
memset(_localScriptOffsets, 0, sizeof(_localScriptOffsets));
- _scriptPointer = nullptr;
- _scriptOrgPointer = nullptr;
- _opcode = 0;
vm.numNestedScripts = 0;
- _lastCodePtr = nullptr;
- _scummStackPos = 0;
memset(_vmStack, 0, sizeof(_vmStack));
- _fileOffset = 0;
memset(_resourceMapper, 0, sizeof(_resourceMapper));
- _lastLoadedRoom = 0;
- _roomResource = 0;
- OF_OWNER_ROOM = 0;
- _verbMouseOver = 0;
- _classData = nullptr;
- _actorToPrintStrFor = 0;
- _sentenceNum = 0;
memset(_sentence, 0, sizeof(_sentence));
memset(_string, 0, sizeof(_string));
- _screenB = 0;
- _screenH = 0;
- _roomHeight = 0;
- _roomWidth = 0;
- _screenHeight = 0;
- _screenWidth = 0;
for (uint i = 0; i < ARRAYSIZE(_virtscr); i++) {
_virtscr[i].clear();
}
camera.reset();
memset(_colorCycle, 0, sizeof(_colorCycle));
memset(_colorUsedByCycle, 0, sizeof(_colorUsedByCycle));
- _ENCD_offs = 0;
- _EXCD_offs = 0;
- _CLUT_offs = 0;
- _EPAL_offs = 0;
- _IM00_offs = 0;
- _PALS_offs = 0;
- _fullRedraw = false;
- _bgNeedsRedraw = false;
- _screenEffectFlag = false;
- _completeScreenRedraw = false;
- _disableFadeInEffect = false;
memset(&_cursor, 0, sizeof(_cursor));
memset(_grabbedCursor, 0, sizeof(_grabbedCursor));
- _currentCursor = 0;
- _newEffect = 0;
- _switchRoomEffect2 = 0;
- _switchRoomEffect = 0;
-
- _bytesPerPixel = 1;
- _doEffect = false;
- _snapScroll = false;
- _shakeEnabled = false;
- _shakeNextTick = _shakeTickCounter = 0;
- _shakeFrame = 0;
- _screenStartStrip = 0;
- _screenEndStrip = 0;
- _screenTop = 0;
- _drawObjectQueNr = 0;
memset(_drawObjectQue, 0, sizeof(_drawObjectQue));
- _palManipStart = 0;
- _palManipEnd = 0;
- _palManipCounter = 0;
- _palManipPalette = nullptr;
- _palManipIntermediatePal = nullptr;
memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
- _hePalettes = nullptr;
- _hePaletteSlot = 0;
- _16BitPalette = nullptr;
- _macScreen = nullptr;
- _macIndy3TextBox = nullptr;
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
- _townsScreen = nullptr;
- _scrollRequest = _scrollDeltaAdjust = 0;
- _scrollDestOffset = _scrollTimer = 0;
_scrollNeedDeltaAdjust = scumm_stricmp(_game.gameid, "indyzak");
- _refreshNeedCatchUp = false;
_enableSmoothScrolling = (_game.platform == Common::kPlatformFMTowns);
memset(_refreshDuration, 0, sizeof(_refreshDuration));
- _refreshArrayPos = 0;
-#ifdef USE_RGB_COLOR
- _cjkFont = nullptr;
-#endif
#endif
- _shadowPalette = nullptr;
- _shadowPaletteSize = 0;
- _verbPalette = nullptr;
memset(_currentPalette, 0, sizeof(_currentPalette));
memset(_darkenPalette, 0, sizeof(_darkenPalette));
memset(_HEV7ActorPalette, 0, sizeof(_HEV7ActorPalette));
- _palDirtyMin = 0;
- _palDirtyMax = 0;
- _haveMsg = 0;
- _haveActorSpeechMsg = false;
- _useTalkAnims = false;
- _defaultTalkDelay = 0;
- _saveSound = 0;
memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags));
memset(_scaleSlots, 0, sizeof(_scaleSlots));
- _charset = nullptr;
- _charsetColor = 0;
memset(_charsetColorMap, 0, sizeof(_charsetColorMap));
memset(_charsetData, 0, sizeof(_charsetData));
- _charsetBufPos = 0;
memset(_charsetBuffer, 0, sizeof(_charsetBuffer));
- _copyProtection = false;
- _voiceMode = 0;
- _talkDelay = 0;
- _NES_lastTalkingActor = 0;
- _NES_talkColor = 0;
- _keepText = false;
- _msgCount = 0;
- _costumeLoader = nullptr;
- _costumeRenderer = nullptr;
- _existLanguageFile = false;
- _languageBuffer = nullptr;
- _numTranslatedLines = 0;
- _translatedLines = nullptr;
- _languageLineIndex = nullptr;
- _2byteFontPtr = nullptr;
- _2byteWidth = 0;
- _2byteHeight = 0;
- _2byteShadow = 0;
- _krStrPost = 0;
- _V1TalkingActor = 0;
for (int i = 0; i < 20; i++)
_2byteMultiFontPtr[i] = nullptr;
- _NESStartStrip = 0;
-
- _skipDrawObject = 0;
-
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
- _townsPaletteFlags = 0;
- _townsClearLayerFlag = 1;
- _townsActiveLayerFlags = 3;
_curStringRect.top = -1;
_curStringRect.left = -1;
_curStringRect.bottom = -1;
@@ -359,148 +187,9 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_cyclRects[i].right = 0;
}
- _numCyclRects = 0;
memset(_scrollFeedStrips, 0, sizeof(_scrollFeedStrips));
#endif
- //
- // Init all VARS to 0xFF
- //
- VAR_KEYPRESS = 0xFF;
- VAR_SYNC = 0xFF;
- VAR_EGO = 0xFF;
- VAR_CAMERA_POS_X = 0xFF;
- VAR_HAVE_MSG = 0xFF;
- VAR_ROOM = 0xFF;
- VAR_OVERRIDE = 0xFF;
- VAR_MACHINE_SPEED = 0xFF;
- VAR_ME = 0xFF;
- VAR_NUM_ACTOR = 0xFF;
- VAR_CURRENT_LIGHTS = 0xFF;
- VAR_CURRENTDRIVE = 0xFF; // How about merging this with VAR_CURRENTDISK?
- VAR_CURRENTDISK = 0xFF;
- VAR_TMR_1 = 0xFF;
- VAR_TMR_2 = 0xFF;
- VAR_TMR_3 = 0xFF;
- VAR_MUSIC_TIMER = 0xFF;
- VAR_ACTOR_RANGE_MIN = 0xFF;
- VAR_ACTOR_RANGE_MAX = 0xFF;
- VAR_CAMERA_MIN_X = 0xFF;
- VAR_CAMERA_MAX_X = 0xFF;
- VAR_TIMER_NEXT = 0xFF;
- VAR_VIRT_MOUSE_X = 0xFF;
- VAR_VIRT_MOUSE_Y = 0xFF;
- VAR_ROOM_RESOURCE = 0xFF;
- VAR_LAST_SOUND = 0xFF;
- VAR_CUTSCENEEXIT_KEY = 0xFF;
- VAR_OPTIONS_KEY = 0xFF;
- VAR_TALK_ACTOR = 0xFF;
- VAR_CAMERA_FAST_X = 0xFF;
- VAR_SCROLL_SCRIPT = 0xFF;
- VAR_ENTRY_SCRIPT = 0xFF;
- VAR_ENTRY_SCRIPT2 = 0xFF;
- VAR_EXIT_SCRIPT = 0xFF;
- VAR_EXIT_SCRIPT2 = 0xFF;
- VAR_VERB_SCRIPT = 0xFF;
- VAR_SENTENCE_SCRIPT = 0xFF;
- VAR_INVENTORY_SCRIPT = 0xFF;
- VAR_CUTSCENE_START_SCRIPT = 0xFF;
- VAR_CUTSCENE_END_SCRIPT = 0xFF;
- VAR_CHARINC = 0xFF;
- VAR_CHARCOUNT = 0xFF;
- VAR_WALKTO_OBJ = 0xFF;
- VAR_DEBUGMODE = 0xFF;
- VAR_HEAPSPACE = 0xFF;
- VAR_RESTART_KEY = 0xFF;
- VAR_PAUSE_KEY = 0xFF;
- VAR_MOUSE_X = 0xFF;
- VAR_MOUSE_Y = 0xFF;
- VAR_TIMER = 0xFF;
- VAR_TIMER_TOTAL = 0xFF;
- VAR_SOUNDCARD = 0xFF;
- VAR_VIDEOMODE = 0xFF;
- VAR_MAINMENU_KEY = 0xFF;
- VAR_FIXEDDISK = 0xFF;
- VAR_CURSORSTATE = 0xFF;
- VAR_USERPUT = 0xFF;
- VAR_SOUNDRESULT = 0xFF;
- VAR_TALKSTOP_KEY = 0xFF;
- VAR_FADE_DELAY = 0xFF;
- VAR_NOSUBTITLES = 0xFF;
-
- VAR_SOUNDPARAM = 0xFF;
- VAR_SOUNDPARAM2 = 0xFF;
- VAR_SOUNDPARAM3 = 0xFF;
- VAR_INPUTMODE = 0xFF;
- VAR_MEMORY_PERFORMANCE = 0xFF;
-
- VAR_VIDEO_PERFORMANCE = 0xFF;
- VAR_ROOM_FLAG = 0xFF;
- VAR_GAME_LOADED = 0xFF;
- VAR_NEW_ROOM = 0xFF;
- VAR_VERSION_KEY = 0xFF;
-
- VAR_V5_TALK_STRING_Y = 0xFF;
-
- VAR_ROOM_WIDTH = 0xFF;
- VAR_ROOM_HEIGHT = 0xFF;
- VAR_SUBTITLES = 0xFF;
- VAR_V6_EMSSPACE = 0xFF;
-
- VAR_CAMERA_POS_Y = 0xFF;
- VAR_CAMERA_MIN_Y = 0xFF;
- VAR_CAMERA_MAX_Y = 0xFF;
- VAR_CAMERA_THRESHOLD_X = 0xFF;
- VAR_CAMERA_THRESHOLD_Y = 0xFF;
- VAR_CAMERA_SPEED_X = 0xFF;
- VAR_CAMERA_SPEED_Y = 0xFF;
- VAR_CAMERA_ACCEL_X = 0xFF;
- VAR_CAMERA_ACCEL_Y = 0xFF;
- VAR_CAMERA_DEST_X = 0xFF;
- VAR_CAMERA_DEST_Y = 0xFF;
- VAR_CAMERA_FOLLOWED_ACTOR = 0xFF;
-
- VAR_LEFTBTN_DOWN = 0xFF;
- VAR_RIGHTBTN_DOWN = 0xFF;
- VAR_LEFTBTN_HOLD = 0xFF;
- VAR_RIGHTBTN_HOLD = 0xFF;
-
- VAR_SAVELOAD_SCRIPT = 0xFF;
- VAR_SAVELOAD_SCRIPT2 = 0xFF;
-
- VAR_DEFAULT_TALK_DELAY = 0xFF;
- VAR_CHARSET_MASK = 0xFF;
-
- VAR_CUSTOMSCALETABLE = 0xFF;
- VAR_V6_SOUNDMODE = 0xFF;
-
- VAR_ACTIVE_VERB = 0xFF;
- VAR_ACTIVE_OBJECT1 = 0xFF;
- VAR_ACTIVE_OBJECT2 = 0xFF;
- VAR_VERB_ALLOWED = 0xFF;
-
- VAR_BLAST_ABOVE_TEXT = 0xFF;
- VAR_VOICE_MODE = 0xFF;
- VAR_MUSIC_BUNDLE_LOADED = 0xFF;
- VAR_VOICE_BUNDLE_LOADED = 0xFF;
-
- VAR_REDRAW_ALL_ACTORS = 0xFF;
- VAR_SKIP_RESET_TALK_ACTOR = 0xFF;
-
- VAR_SOUND_CHANNEL = 0xFF;
- VAR_TALK_CHANNEL = 0xFF;
- VAR_SOUNDCODE_TMR = 0xFF;
- VAR_RESERVED_SOUND_CHANNELS = 0xFF;
-
- VAR_MAIN_SCRIPT = 0xFF;
-
- VAR_NUM_SCRIPT_CYCLES = 0xFF;
- VAR_SCRIPT_CYCLE = 0xFF;
-
- VAR_QUIT_SCRIPT = 0xFF;
-
- VAR_NUM_GLOBAL_OBJS = 0xFF;
-
// Use g_scumm from error() ONLY
g_scumm = this;
@@ -576,9 +265,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
break;
}
- _hexdumpScripts = false;
- _showStack = false;
-
if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) { // FM-TOWNS V3 games originally use 320x240, and we have an option to trim to 200
_screenWidth = 320;
if (ConfMan.getBool("trim_fmtowns_to_200_pixels"))
@@ -622,7 +308,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
else
_compositeBuf = nullptr;
- _herculesBuf = nullptr;
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
_herculesBuf = (byte *)malloc(kHercWidth * kHercHeight);
}
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 67832f70b6a..d335eb0a536 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -293,14 +293,14 @@ public:
/* Put often used variables at the top.
* That results in a shorter form of the opcode
* on some architectures. */
- IMuse *_imuse;
- IMuseDigital *_imuseDigital;
- MusicEngine *_musicEngine;
- Player_Towns *_townsPlayer;
- Sound *_sound;
+ IMuse *_imuse = nullptr;
+ IMuseDigital *_imuseDigital = nullptr;
+ MusicEngine *_musicEngine = nullptr;
+ Player_Towns *_townsPlayer = nullptr;
+ Sound *_sound = nullptr;
- VerbSlot *_verbs;
- ObjectData *_objs;
+ VerbSlot *_verbs = nullptr;
+ ObjectData *_objs = nullptr;
// Core variables
GameSettings _game;
@@ -310,17 +310,17 @@ public:
Common::RandomSource _rnd;
/** Graphics manager */
- Gdi *_gdi;
+ Gdi *_gdi = nullptr;
/** Central resource data. */
- ResourceManager *_res;
+ ResourceManager *_res = nullptr;
- bool _enableEnhancements;
+ bool _enableEnhancements = false;
protected:
VirtualMachineState vm;
- bool _oldSoundsPaused;
+ bool _oldSoundsPaused = false;
public:
// Constructor / Destructor
@@ -400,9 +400,9 @@ public:
void restart();
protected:
- Dialog *_pauseDialog;
- Dialog *_messageDialog;
- Dialog *_versionDialog;
+ Dialog *_pauseDialog = nullptr;
+ Dialog *_messageDialog = nullptr;
+ Dialog *_versionDialog = nullptr;
void confirmExitDialog();
void confirmRestartDialog();
@@ -414,15 +414,15 @@ public:
char displayMessage(const char *altButton, const char *message, ...) GCC_PRINTF(3, 4);
protected:
- byte _fastMode;
+ byte _fastMode = 0;
- byte _numActors;
- Actor **_actors; // Has _numActors elements
- Actor **_sortedActors;
+ byte _numActors = 0;
+ Actor **_actors = nullptr; // Has _numActors elements
+ Actor **_sortedActors = nullptr;
- byte *_arraySlot;
- uint16 *_inventory;
- uint16 *_newNames;
+ byte *_arraySlot = nullptr;
+ uint16 *_inventory = nullptr;
+ uint16 *_newNames = nullptr;
public:
// VAR is a wrapper around scummVar, which attempts to include additional
// useful information should an illegal var access be detected.
@@ -441,43 +441,52 @@ public:
}
protected:
- int16 _varwatch;
- int32 *_roomVars;
- int32 *_scummVars;
- byte *_bitVars;
+ int16 _varwatch = 0;
+ int32 *_roomVars = nullptr;
+ int32 *_scummVars = nullptr;
+ byte *_bitVars = nullptr;
/* Global resource tables */
- int _numVariables, _numBitVariables, _numLocalObjects;
- int _numGlobalObjects, _numArray, _numVerbs, _numFlObject;
- int _numInventory;
- int _numNewNames, _numGlobalScripts;
- int _numRoomVariables;
- int _numPalettes, _numSprites, _numTalkies, _numUnk;
- int _HEHeapSize;
+ int _numVariables = 0;
+ int _numBitVariables = 0;
+ int _numLocalObjects = 0;
+ int _numGlobalObjects = 0;
+ int _numArray = 0;
+ int _numVerbs = 0;
+ int _numFlObject = 0;
+ int _numInventory = 0;
+ int _numNewNames = 0;
+ int _numGlobalScripts = 0;
+ int _numRoomVariables = 0;
+ int _numPalettes = 0;
+ int _numSprites = 0;
+ int _numTalkies = 0;
+ int _numUnk = 0;
+ int _HEHeapSize = 0;
public:
- int _numLocalScripts, _numImages, _numRooms, _numScripts, _numSounds; // Used by HE games
- int _numCostumes; // FIXME - should be protected, used by Actor::remapActorPalette
- int32 _numCharsets; // FIXME - should be protected, used by CharsetRenderer
+ int _numLocalScripts = 60, _numImages = 0, _numRooms = 0, _numScripts = 0, _numSounds = 0; // Used by HE games
+ int _numCostumes = 0; // FIXME - should be protected, used by Actor::remapActorPalette
+ int32 _numCharsets = 0; // FIXME - should be protected, used by CharsetRenderer
- BaseCostumeLoader *_costumeLoader;
- BaseCostumeRenderer *_costumeRenderer;
+ BaseCostumeLoader *_costumeLoader = nullptr;
+ BaseCostumeRenderer *_costumeRenderer = nullptr;
- int _NESCostumeSet;
+ int _NESCostumeSet = 0;
void NES_loadCostumeSet(int n);
- byte *_NEScostdesc, *_NEScostlens, *_NEScostoffs, *_NEScostdata;
+ byte *_NEScostdesc = nullptr, *_NEScostlens = nullptr, *_NEScostoffs = nullptr, *_NEScostdata = nullptr;
byte _NESPatTable[2][4096];
byte _NESPalette[2][16];
- byte _NESBaseTiles;
+ byte _NESBaseTiles = 0;
- int _NESStartStrip;
+ int _NESStartStrip = 0;
protected:
- int _curPalIndex;
+ int _curPalIndex = 0;
public:
- byte _currentRoom; // FIXME - should be protected but Actor::isInCurrentRoom uses it
- int _roomResource; // FIXME - should be protected but Sound::pauseSounds uses it
- bool _egoPositioned; // Used by Actor::putActor, hence public
+ byte _currentRoom = 0; // FIXME - should be protected but Actor::isInCurrentRoom uses it
+ int _roomResource = 0; // FIXME - should be protected but Sound::pauseSounds uses it
+ bool _egoPositioned = false; // Used by Actor::putActor, hence public
FilenamePattern _filenamePattern;
@@ -490,28 +499,28 @@ protected:
Common::Point _mouse;
Common::Point _virtualMouse;
- uint16 _mouseAndKeyboardStat;
- byte _leftBtnPressed, _rightBtnPressed;
+ uint16 _mouseAndKeyboardStat = 0;
+ byte _leftBtnPressed = 0, _rightBtnPressed = 0;
/**
* Last time runInputScript was run (measured in terms of OSystem::getMillis()).
* This is currently only used for Indy3 mac to detect "double clicks".
*/
- uint32 _lastInputScriptTime;
+ uint32 _lastInputScriptTime = 0;
/** The bootparam, to be passed to the script 1, the bootscript. */
- int _bootParam;
+ int _bootParam = 0;
// Various options useful for debugging
- bool _dumpScripts;
- bool _hexdumpScripts;
- bool _showStack;
- bool _debugMode;
+ bool _dumpScripts = false;
+ bool _hexdumpScripts = false;
+ bool _showStack = false;
+ bool _debugMode = false;
// Save/Load class - some of this may be GUI
- byte _saveLoadFlag, _saveLoadSlot;
- uint32 _lastSaveTime;
- bool _saveTemporaryState;
+ byte _saveLoadFlag = 0, _saveLoadSlot = 0;
+ uint32 _lastSaveTime = 0;
+ bool _saveTemporaryState = false;
Common::String _saveLoadFileName;
Common::String _saveLoadDescription;
@@ -555,12 +564,12 @@ protected:
protected:
/* Script VM - should be in Script class */
uint32 _localScriptOffsets[1024];
- const byte *_scriptPointer;
- const byte *_scriptOrgPointer;
- const byte * const *_lastCodePtr;
- byte _opcode;
- byte _currentScript;
- int _scummStackPos;
+ const byte *_scriptPointer = nullptr;
+ const byte *_scriptOrgPointer = nullptr;
+ const byte * const *_lastCodePtr = nullptr;
+ byte _opcode = 0;
+ byte _currentScript = 0xFF; // Let debug() work on init stage
+ int _scummStackPos = 0;
int _vmStack[256];
OpcodeEntry _opcodes[256];
@@ -637,8 +646,8 @@ protected:
void doSentence(int c, int b, int a);
/* Should be in Resource class */
- BaseScummFile *_fileHandle;
- uint32 _fileOffset;
+ BaseScummFile *_fileHandle = nullptr;
+ uint32 _fileOffset = 0;
public:
/** The name of the (macintosh/rescumm style) container file, if any. */
Common::String _containerFile;
@@ -650,7 +659,7 @@ public:
bool isMacM68kIMuse() const;
protected:
- int _resourceHeaderSize;
+ int _resourceHeaderSize = 8;
byte _resourceMapper[128];
const byte *_resourceLastSearchBuf; // FIXME: need to put it to savefile?
uint32 _resourceLastSearchSize; // FIXME: need to put it to savefile?
@@ -703,7 +712,7 @@ protected:
virtual void loadCharset(int i);
void nukeCharset(int i);
- int _lastLoadedRoom;
+ int _lastLoadedRoom = 0;
public:
const byte *findResourceData(uint32 tag, const byte *ptr);
const byte *findResource(uint32 tag, const byte *ptr);
@@ -717,17 +726,17 @@ public:
public:
/* Should be in Object class */
- byte OF_OWNER_ROOM;
+ byte OF_OWNER_ROOM = 0;
int getInventorySlot();
int findInventory(int owner, int index);
int getInventoryCount(int owner);
protected:
- byte *_objectOwnerTable, *_objectRoomTable, *_objectStateTable;
- int _numObjectsInRoom;
+ byte *_objectOwnerTable = nullptr, *_objectRoomTable = nullptr, *_objectStateTable = nullptr;
+ int _numObjectsInRoom = 0;
public:
- uint32 *_classData;
+ uint32 *_classData = nullptr;
protected:
void markObjectRectAsDirty(int obj);
@@ -787,9 +796,9 @@ protected:
protected:
/* Should be in Verb class */
- uint16 _verbMouseOver;
- int8 _userPut;
- uint16 _userState;
+ uint16 _verbMouseOver = 0;
+ int8 _userPut = 0;
+ uint16 _userState = 0;
virtual void handleMouseOver(bool updateInventory);
virtual void redrawVerbs();
@@ -827,14 +836,14 @@ protected:
public:
/* Actor talking stuff */
- byte _actorToPrintStrFor, _V1TalkingActor;
- int _sentenceNum;
+ byte _actorToPrintStrFor = 0, _V1TalkingActor = 0;
+ int _sentenceNum = 0;
SentenceTab _sentence[NUM_SENTENCE];
StringTab _string[6];
- byte _haveMsg;
- int16 _talkDelay;
- int _NES_lastTalkingActor;
- int _NES_talkColor;
+ byte _haveMsg = 0;
+ int16 _talkDelay = 0;
+ int _NES_lastTalkingActor = 0;
+ int _NES_talkColor = 0;
virtual void actorTalk(const byte *msg);
void stopTalk();
@@ -846,32 +855,32 @@ public:
protected:
/* Should be in Graphics class? */
- uint16 _screenB, _screenH;
+ uint16 _screenB = 0, _screenH = 0;
public:
- int _roomHeight, _roomWidth;
- int _screenHeight, _screenWidth;
+ int _roomHeight = 0, _roomWidth = 0;
+ int _screenHeight = 0, _screenWidth = 0;
VirtScreen _virtscr[4]; // Virtual screen areas
CameraData camera; // 'Camera' - viewport
- int _screenStartStrip, _screenEndStrip;
- int _screenTop;
+ int _screenStartStrip = 0, _screenEndStrip = 0;
+ int _screenTop = 0;
Common::RenderMode _renderMode;
- uint8 _bytesPerPixel;
+ uint8 _bytesPerPixel = 1;
Graphics::PixelFormat _outputPixelFormat;
protected:
ColorCycle _colorCycle[16]; // Palette cycles
uint8 _colorUsedByCycle[256];
- uint32 _ENCD_offs, _EXCD_offs;
- uint32 _CLUT_offs, _EPAL_offs;
- uint32 _IM00_offs, _PALS_offs;
+ uint32 _ENCD_offs = 0, _EXCD_offs = 0;
+ uint32 _CLUT_offs = 0, _EPAL_offs = 0;
+ uint32 _IM00_offs = 0, _PALS_offs = 0;
//ender: fullscreen
- bool _fullRedraw, _bgNeedsRedraw;
- bool _screenEffectFlag, _completeScreenRedraw;
- bool _disableFadeInEffect;
+ bool _fullRedraw = false, _bgNeedsRedraw = false;
+ bool _screenEffectFlag = false, _completeScreenRedraw = false;
+ bool _disableFadeInEffect = false;
struct {
int hotspotX, hotspotY, width, height;
@@ -882,12 +891,12 @@ protected:
// HACK Double the array size to handle 16-bit images.
// this should be dynamically allocated based on game depth instead.
byte _grabbedCursor[16384];
- byte _currentCursor;
+ byte _currentCursor = 0;
- byte _newEffect, _switchRoomEffect2, _switchRoomEffect;
- bool _doEffect;
+ byte _newEffect = 0, _switchRoomEffect2 = 0, _switchRoomEffect = 0;
+ bool _doEffect = false;
- bool _snapScroll;
+ bool _snapScroll = false;
public:
bool isLightOn() const;
@@ -964,7 +973,7 @@ public:
protected:
// Screen rendering
byte *_compositeBuf;
- byte *_herculesBuf;
+ byte *_herculesBuf = nullptr;
virtual void drawDirtyScreenParts();
void updateDirtyScreen(VirtScreenNumber slot);
@@ -995,15 +1004,15 @@ protected:
void updateScreenShakeEffect();
protected:
- bool _shakeEnabled;
- uint _shakeFrame;
- uint32 _shakeNextTick;
- uint32 _shakeTickCounter;
+ bool _shakeEnabled = false;
+ uint _shakeFrame = 0;
+ uint32 _shakeNextTick = 0;
+ uint32 _shakeTickCounter = 0;
const uint32 _shakeTimerRate;
void setShake(int mode);
- int _drawObjectQueNr;
+ int _drawObjectQueNr = 0;
byte _drawObjectQue[200];
/* For each of the 410 screen strips, gfxUsageBits contains a
@@ -1028,43 +1037,43 @@ protected:
public:
byte _roomPalette[256];
- byte *_shadowPalette;
- bool _skipDrawObject;
- int _voiceMode;
+ byte *_shadowPalette = nullptr;
+ bool _skipDrawObject = 0;
+ int _voiceMode = 0;
// HE specific
byte _HEV7ActorPalette[256];
- uint8 *_hePalettes;
- uint16 _hePaletteSlot;
- uint16 *_16BitPalette;
+ uint8 *_hePalettes = nullptr;
+ uint16 _hePaletteSlot = 0;
+ uint16 *_16BitPalette = nullptr;
// Indy4 Amiga specific
- byte *_verbPalette;
+ byte *_verbPalette = nullptr;
ScummEngine_v0_Delays _V0Delay;
protected:
- int _shadowPaletteSize;
+ int _shadowPaletteSize = 0;
byte _currentPalette[3 * 256];
byte _darkenPalette[3 * 256];
- int _palDirtyMin, _palDirtyMax;
+ int _palDirtyMin = 0, _palDirtyMax = 0;
- byte _palManipStart, _palManipEnd;
- uint16 _palManipCounter;
- byte *_palManipPalette;
- byte *_palManipIntermediatePal;
+ byte _palManipStart = 0, _palManipEnd = 0;
+ uint16 _palManipCounter = 0;
+ byte *_palManipPalette = nullptr;
+ byte *_palManipIntermediatePal = nullptr;
- bool _haveActorSpeechMsg;
- bool _useTalkAnims;
- uint16 _defaultTalkDelay;
- int _saveSound;
- bool _native_mt32;
- bool _enable_gs;
- bool _copyProtection;
+ bool _haveActorSpeechMsg = false;
+ bool _useTalkAnims = false;
+ uint16 _defaultTalkDelay = 0;
+ int _saveSound = 0;
+ bool _native_mt32 = false;
+ bool _enable_gs = false;
+ bool _copyProtection = false;
// Indy4 Amiga specific
- uint16 _amigaFirstUsedColor;
+ uint16 _amigaFirstUsedColor = 0;
byte _amigaPalette[3 * 64];
void amigaPaletteFindFirstUsedColor();
void mapRoomPalette(int idx);
@@ -1114,7 +1123,7 @@ protected:
/* String class */
public:
- CharsetRenderer *_charset;
+ CharsetRenderer *_charset = nullptr;
byte _charsetColorMap[16];
/**
@@ -1122,23 +1131,23 @@ public:
* drawStripToScreen() composits it over the game graphics.
*/
Graphics::Surface _textSurface;
- int _textSurfaceMultiplier;
- Graphics::Surface *_macScreen;
- Graphics::Surface *_macIndy3TextBox;
+ int _textSurfaceMultiplier = 0;
+ Graphics::Surface *_macScreen = nullptr;
+ Graphics::Surface *_macIndy3TextBox = nullptr;
protected:
- byte _charsetColor;
+ byte _charsetColor = 0;
byte _charsetData[23][16];
- int _charsetBufPos;
+ int _charsetBufPos = 0;
byte _charsetBuffer[512];
- bool _keepText;
- byte _msgCount;
+ bool _keepText = false;
+ byte _msgCount = 0;
- int _nextLeft, _nextTop;
+ int _nextLeft = 0, _nextTop = 0;
- Localizer *_localizer;
+ Localizer *_localizer = nullptr;
void restoreCharsetBg();
void clearCharsetMask();
@@ -1173,22 +1182,21 @@ public:
Common::CodePage getDialogCodePage() const;
// Somewhat hackish stuff for 2 byte support (Chinese/Japanese/Korean)
- bool _useCJKMode;
- bool _useMultiFont;
- int _numLoadedFont;
- int _currentFont;
- int _2byteShadow;
-
- int _2byteHeight;
- int _2byteWidth;
- int _krStrPost;
- byte _newLineCharacter;
+ bool _useCJKMode = false;
+ bool _useMultiFont = false;
+ int _numLoadedFont = 0;
+ int _2byteShadow = 0;
+
+ int _2byteHeight = 0;
+ int _2byteWidth = 0;
+ int _krStrPost = 0;
+ byte _newLineCharacter = 0;
byte *get2byteCharPtr(int idx);
bool isScummvmKorTarget();
//protected:
- byte *_2byteFontPtr;
+ byte *_2byteFontPtr = nullptr;
byte *_2byteMultiFontPtr[20];
int _2byteMultiHeight[20];
int _2byteMultiWidth[20];
@@ -1212,11 +1220,11 @@ private:
Common::HashMap<uint32, TranslationRange> scriptRanges;
};
- bool _existLanguageFile;
- byte *_languageBuffer;
- int _numTranslatedLines;
- TranslatedLine *_translatedLines;
- uint16 *_languageLineIndex;
+ bool _existLanguageFile = false;
+ byte *_languageBuffer = nullptr;
+ int _numTranslatedLines = 0;
+ TranslatedLine *_translatedLines = nullptr;
+ uint16 *_languageLineIndex = nullptr;
Common::HashMap<byte, TranslationRoom> _roomIndex;
const byte *searchTranslatedLine(const byte *text, const TranslationRange &range, bool useIndex);
@@ -1226,159 +1234,159 @@ private:
public:
/* Scumm Vars */
- byte VAR_KEYPRESS;
- byte VAR_SYNC;
- byte VAR_EGO;
- byte VAR_CAMERA_POS_X;
- byte VAR_HAVE_MSG;
- byte VAR_ROOM;
- byte VAR_OVERRIDE;
- byte VAR_MACHINE_SPEED;
- byte VAR_ME;
- byte VAR_NUM_ACTOR;
- byte VAR_CURRENT_LIGHTS;
- byte VAR_CURRENTDRIVE;
- byte VAR_CURRENTDISK;
- byte VAR_TMR_1;
- byte VAR_TMR_2;
- byte VAR_TMR_3;
- byte VAR_MUSIC_TIMER;
- byte VAR_ACTOR_RANGE_MIN;
- byte VAR_ACTOR_RANGE_MAX;
- byte VAR_CAMERA_MIN_X;
- byte VAR_CAMERA_MAX_X;
- byte VAR_TIMER_NEXT;
- byte VAR_VIRT_MOUSE_X;
- byte VAR_VIRT_MOUSE_Y;
- byte VAR_ROOM_RESOURCE;
- byte VAR_LAST_SOUND;
- byte VAR_CUTSCENEEXIT_KEY;
- byte VAR_OPTIONS_KEY;
- byte VAR_TALK_ACTOR;
- byte VAR_CAMERA_FAST_X;
- byte VAR_SCROLL_SCRIPT;
- byte VAR_ENTRY_SCRIPT;
- byte VAR_ENTRY_SCRIPT2;
- byte VAR_EXIT_SCRIPT;
- byte VAR_EXIT_SCRIPT2;
- byte VAR_VERB_SCRIPT;
- byte VAR_SENTENCE_SCRIPT;
- byte VAR_INVENTORY_SCRIPT;
- byte VAR_CUTSCENE_START_SCRIPT;
- byte VAR_CUTSCENE_END_SCRIPT;
- byte VAR_CHARINC;
- byte VAR_WALKTO_OBJ;
- byte VAR_DEBUGMODE;
- byte VAR_HEAPSPACE;
- byte VAR_RESTART_KEY;
- byte VAR_PAUSE_KEY;
- byte VAR_MOUSE_X;
- byte VAR_MOUSE_Y;
- byte VAR_TIMER;
- byte VAR_TIMER_TOTAL;
- byte VAR_SOUNDCARD;
- byte VAR_VIDEOMODE;
- byte VAR_MAINMENU_KEY;
- byte VAR_FIXEDDISK;
- byte VAR_CURSORSTATE;
- byte VAR_USERPUT;
- byte VAR_SOUNDRESULT;
- byte VAR_TALKSTOP_KEY;
- byte VAR_FADE_DELAY;
- byte VAR_NOSUBTITLES;
+ byte VAR_KEYPRESS = 0xFF;
+ byte VAR_SYNC = 0xFF;
+ byte VAR_EGO = 0xFF;
+ byte VAR_CAMERA_POS_X = 0xFF;
+ byte VAR_HAVE_MSG = 0xFF;
+ byte VAR_ROOM = 0xFF;
+ byte VAR_OVERRIDE = 0xFF;
+ byte VAR_MACHINE_SPEED = 0xFF;
+ byte VAR_ME = 0xFF;
+ byte VAR_NUM_ACTOR = 0xFF;
+ byte VAR_CURRENT_LIGHTS = 0xFF;
+ byte VAR_CURRENTDRIVE = 0xFF; // How about merging this with VAR_CURRENTDISK?
+ byte VAR_CURRENTDISK = 0xFF;
+ byte VAR_TMR_1 = 0xFF;
+ byte VAR_TMR_2 = 0xFF;
+ byte VAR_TMR_3 = 0xFF;
+ byte VAR_MUSIC_TIMER = 0xFF;
+ byte VAR_ACTOR_RANGE_MIN = 0xFF;
+ byte VAR_ACTOR_RANGE_MAX = 0xFF;
+ byte VAR_CAMERA_MIN_X = 0xFF;
+ byte VAR_CAMERA_MAX_X = 0xFF;
+ byte VAR_TIMER_NEXT = 0xFF;
+ byte VAR_VIRT_MOUSE_X = 0xFF;
+ byte VAR_VIRT_MOUSE_Y = 0xFF;
+ byte VAR_ROOM_RESOURCE = 0xFF;
+ byte VAR_LAST_SOUND = 0xFF;
+ byte VAR_CUTSCENEEXIT_KEY = 0xFF;
+ byte VAR_OPTIONS_KEY = 0xFF;
+ byte VAR_TALK_ACTOR = 0xFF;
+ byte VAR_CAMERA_FAST_X = 0xFF;
+ byte VAR_SCROLL_SCRIPT = 0xFF;
+ byte VAR_ENTRY_SCRIPT = 0xFF;
+ byte VAR_ENTRY_SCRIPT2 = 0xFF;
+ byte VAR_EXIT_SCRIPT = 0xFF;
+ byte VAR_EXIT_SCRIPT2 = 0xFF;
+ byte VAR_VERB_SCRIPT = 0xFF;
+ byte VAR_SENTENCE_SCRIPT = 0xFF;
+ byte VAR_INVENTORY_SCRIPT = 0xFF;
+ byte VAR_CUTSCENE_START_SCRIPT = 0xFF;
+ byte VAR_CUTSCENE_END_SCRIPT = 0xFF;
+ byte VAR_CHARINC = 0xFF;
+ byte VAR_WALKTO_OBJ = 0xFF;
+ byte VAR_DEBUGMODE = 0xFF;
+ byte VAR_HEAPSPACE = 0xFF;
+ byte VAR_RESTART_KEY = 0xFF;
+ byte VAR_PAUSE_KEY = 0xFF;
+ byte VAR_MOUSE_X = 0xFF;
+ byte VAR_MOUSE_Y = 0xFF;
+ byte VAR_TIMER = 0xFF;
+ byte VAR_TIMER_TOTAL = 0xFF;
+ byte VAR_SOUNDCARD = 0xFF;
+ byte VAR_VIDEOMODE = 0xFF;
+ byte VAR_MAINMENU_KEY = 0xFF;
+ byte VAR_FIXEDDISK = 0xFF;
+ byte VAR_CURSORSTATE = 0xFF;
+ byte VAR_USERPUT = 0xFF;
+ byte VAR_SOUNDRESULT = 0xFF;
+ byte VAR_TALKSTOP_KEY = 0xFF;
+ byte VAR_FADE_DELAY = 0xFF;
+ byte VAR_NOSUBTITLES = 0xFF;
// V5+
- byte VAR_SOUNDPARAM;
- byte VAR_SOUNDPARAM2;
- byte VAR_SOUNDPARAM3;
- byte VAR_INPUTMODE;
- byte VAR_MEMORY_PERFORMANCE;
- byte VAR_VIDEO_PERFORMANCE;
- byte VAR_ROOM_FLAG;
- byte VAR_GAME_LOADED;
- byte VAR_NEW_ROOM;
+ byte VAR_SOUNDPARAM = 0xFF;
+ byte VAR_SOUNDPARAM2 = 0xFF;
+ byte VAR_SOUNDPARAM3 = 0xFF;
+ byte VAR_INPUTMODE = 0xFF;
+ byte VAR_MEMORY_PERFORMANCE = 0xFF;
+ byte VAR_VIDEO_PERFORMANCE = 0xFF;
+ byte VAR_ROOM_FLAG = 0xFF;
+ byte VAR_GAME_LOADED = 0xFF;
+ byte VAR_NEW_ROOM = 0xFF;
// V4/V5
- byte VAR_V5_TALK_STRING_Y;
+ byte VAR_V5_TALK_STRING_Y = 0xFF;
// V6+
- byte VAR_ROOM_WIDTH;
- byte VAR_ROOM_HEIGHT;
- byte VAR_SUBTITLES;
- byte VAR_V6_EMSSPACE;
+ byte VAR_ROOM_WIDTH = 0xFF;
+ byte VAR_ROOM_HEIGHT = 0xFF;
+ byte VAR_SUBTITLES = 0xFF;
+ byte VAR_V6_EMSSPACE = 0xFF;
// V7/V8 specific variables
- byte VAR_CAMERA_POS_Y;
- byte VAR_CAMERA_MIN_Y;
- byte VAR_CAMERA_MAX_Y;
- byte VAR_CAMERA_THRESHOLD_X;
- byte VAR_CAMERA_THRESHOLD_Y;
- byte VAR_CAMERA_SPEED_X;
- byte VAR_CAMERA_SPEED_Y;
- byte VAR_CAMERA_ACCEL_X;
- byte VAR_CAMERA_ACCEL_Y;
- byte VAR_CAMERA_DEST_X;
- byte VAR_CAMERA_DEST_Y;
- byte VAR_CAMERA_FOLLOWED_ACTOR;
+ byte VAR_CAMERA_POS_Y = 0xFF;
+ byte VAR_CAMERA_MIN_Y = 0xFF;
+ byte VAR_CAMERA_MAX_Y = 0xFF;
+ byte VAR_CAMERA_THRESHOLD_X = 0xFF;
+ byte VAR_CAMERA_THRESHOLD_Y = 0xFF;
+ byte VAR_CAMERA_SPEED_X = 0xFF;
+ byte VAR_CAMERA_SPEED_Y = 0xFF;
+ byte VAR_CAMERA_ACCEL_X = 0xFF;
+ byte VAR_CAMERA_ACCEL_Y = 0xFF;
+ byte VAR_CAMERA_DEST_X = 0xFF;
+ byte VAR_CAMERA_DEST_Y = 0xFF;
+ byte VAR_CAMERA_FOLLOWED_ACTOR = 0xFF;
// V7/V8 specific variables
- byte VAR_VERSION_KEY;
- byte VAR_DEFAULT_TALK_DELAY;
- byte VAR_CUSTOMSCALETABLE;
- byte VAR_BLAST_ABOVE_TEXT;
- byte VAR_VOICE_MODE;
- byte VAR_MUSIC_BUNDLE_LOADED;
- byte VAR_VOICE_BUNDLE_LOADED;
-
- byte VAR_LEFTBTN_DOWN; // V7/V8
- byte VAR_RIGHTBTN_DOWN; // V7/V8
- byte VAR_LEFTBTN_HOLD; // V6/V72HE/V7/V8
- byte VAR_RIGHTBTN_HOLD; // V6/V72HE/V7/V8
- byte VAR_SAVELOAD_SCRIPT; // V6/V7 (not HE)
- byte VAR_SAVELOAD_SCRIPT2; // V6/V7 (not HE)
+ byte VAR_VERSION_KEY = 0xFF;
+ byte VAR_DEFAULT_TALK_DELAY = 0xFF;
+ byte VAR_CUSTOMSCALETABLE = 0xFF;
+ byte VAR_BLAST_ABOVE_TEXT = 0xFF;
+ byte VAR_VOICE_MODE = 0xFF;
+ byte VAR_MUSIC_BUNDLE_LOADED = 0xFF;
+ byte VAR_VOICE_BUNDLE_LOADED = 0xFF;
+
+ byte VAR_LEFTBTN_DOWN = 0xFF; // V7/V8
+ byte VAR_RIGHTBTN_DOWN = 0xFF; // V7/V8
+ byte VAR_LEFTBTN_HOLD = 0xFF; // V6/V72HE/V7/V8
+ byte VAR_RIGHTBTN_HOLD = 0xFF; // V6/V72HE/V7/V8
+ byte VAR_SAVELOAD_SCRIPT = 0xFF; // V6/V7 (not HE)
+ byte VAR_SAVELOAD_SCRIPT2 = 0xFF; // V6/V7 (not HE)
// V6/V7 specific variables (FT & Sam & Max specific)
- byte VAR_CHARSET_MASK;
+ byte VAR_CHARSET_MASK = 0xFF;
// V6 specific variables
- byte VAR_V6_SOUNDMODE;
+ byte VAR_V6_SOUNDMODE = 0xFF;
// V1/V2 specific variables
- byte VAR_CHARCOUNT;
- byte VAR_VERB_ALLOWED;
- byte VAR_ACTIVE_VERB;
- byte VAR_ACTIVE_OBJECT1;
- byte VAR_ACTIVE_OBJECT2;
+ byte VAR_CHARCOUNT = 0xFF;
+ byte VAR_VERB_ALLOWED = 0xFF;
+ byte VAR_ACTIVE_VERB = 0xFF;
+ byte VAR_ACTIVE_OBJECT1 = 0xFF;
+ byte VAR_ACTIVE_OBJECT2 = 0xFF;
// HE specific variables
- byte VAR_REDRAW_ALL_ACTORS; // Used in setActorRedrawFlags()
- byte VAR_SKIP_RESET_TALK_ACTOR; // Used in setActorCostume()
+ byte VAR_REDRAW_ALL_ACTORS = 0xFF; // Used in setActorRedrawFlags()
+ byte VAR_SKIP_RESET_TALK_ACTOR = 0xFF; // Used in setActorCostume()
- byte VAR_SOUND_CHANNEL; // Used in o_startSound()
- byte VAR_TALK_CHANNEL; // Used in startHETalkSound()
- byte VAR_SOUNDCODE_TMR; // Used in processSoundCode()
- byte VAR_RESERVED_SOUND_CHANNELS; // Used in findFreeSoundChannel()
+ byte VAR_SOUND_CHANNEL = 0xFF; // Used in o_startSound()
+ byte VAR_TALK_CHANNEL = 0xFF; // Used in startHETalkSound()
+ byte VAR_SOUNDCODE_TMR = 0xFF; // Used in processSoundCode()
+ byte VAR_RESERVED_SOUND_CHANNELS = 0xFF; // Used in findFreeSoundChannel()
- byte VAR_MAIN_SCRIPT; // Used in scummLoop()
+ byte VAR_MAIN_SCRIPT = 0xFF; // Used in scummLoop()
- byte VAR_SCRIPT_CYCLE; // Used in runScript()/runObjectScript()
- byte VAR_NUM_SCRIPT_CYCLES; // Used in runAllScripts()
+ byte VAR_SCRIPT_CYCLE = 0xFF; // Used in runScript()/runObjectScript()
+ byte VAR_NUM_SCRIPT_CYCLES = 0xFF; // Used in runAllScripts()
- byte VAR_QUIT_SCRIPT; // Used in confirmExitDialog()
+ byte VAR_QUIT_SCRIPT = 0xFF; // Used in confirmExitDialog()
// Exists both in V7 and in V72HE:
- byte VAR_NUM_GLOBAL_OBJS;
+ byte VAR_NUM_GLOBAL_OBJS = 0xFF;
#ifdef USE_RGB_COLOR
// FM-Towns / PC-Engine specific
- Graphics::FontSJIS *_cjkFont;
+ Graphics::FontSJIS *_cjkFont = nullptr;
#endif
// FM-Towns specific
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
public:
bool towns_isRectInStringBox(int x1, int y1, int x2, int y2);
- byte _townsPaletteFlags;
+ byte _townsPaletteFlags = 0;
byte _townsCharsetColorMap[16];
protected:
@@ -1401,27 +1409,27 @@ protected:
void towns_updateGfx();
Common::Rect _cyclRects[10];
- int _numCyclRects;
- int _scrollRequest;
- int _scrollDeltaAdjust;
- bool _scrollNeedDeltaAdjust;
+ int _numCyclRects = 0;
+ int _scrollRequest = 0;
+ int _scrollDeltaAdjust = 0;
+ bool _scrollNeedDeltaAdjust = 0;
int _refreshDuration[20];
- int _refreshArrayPos;
- bool _refreshNeedCatchUp;
- bool _enableSmoothScrolling;
- uint32 _scrollTimer;
- uint32 _scrollDestOffset;
+ int _refreshArrayPos = 0;
+ bool _refreshNeedCatchUp = false;
+ bool _enableSmoothScrolling = false;
+ uint32 _scrollTimer = 0;
+ uint32 _scrollDestOffset = 0;
uint16 _scrollFeedStrips[3];
Common::Rect _curStringRect;
- byte _townsOverrideShadowColor;
+ byte _townsOverrideShadowColor = 0;
byte _textPalette[48];
- byte _townsClearLayerFlag;
- byte _townsActiveLayerFlags;
+ byte _townsClearLayerFlag = 1;
+ byte _townsActiveLayerFlags = 3;
static const uint8 _townsLayer2Mask[];
- TownsScreen *_townsScreen;
+ TownsScreen *_townsScreen = nullptr;
#else
void scrollLeft() { redrawBGStrip(_gdi->_numStrips - 1, 1); }
void scrollRight() { redrawBGStrip(0, 1); }
More information about the Scummvm-git-logs
mailing list