diff options
author | Eugene Sandulenko | 2019-07-18 18:11:36 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:23 +0200 |
commit | 927770f34b6a15bf1c125ee2e1d668e8577169db (patch) | |
tree | cb78c5bc2861175f72acb7c63871879ef956bf18 /engines | |
parent | cea2285db1bd87864639271ec8555d50d0908f3b (diff) | |
download | scummvm-rg350-927770f34b6a15bf1c125ee2e1d668e8577169db.tar.gz scummvm-rg350-927770f34b6a15bf1c125ee2e1d668e8577169db.tar.bz2 scummvm-rg350-927770f34b6a15bf1c125ee2e1d668e8577169db.zip |
HDB: Initialise class variables
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/ai-init.cpp | 62 | ||||
-rw-r--r-- | engines/hdb/menu.cpp | 103 | ||||
-rw-r--r-- | engines/hdb/menu.h | 1 |
3 files changed, 120 insertions, 46 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index 23cfe2d8e9..73987c7211 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -912,6 +912,43 @@ AI::AI() { _clubUpFrames = 0; _clubLeftFrames = 0; _clubRightFrames = 0; + + memset(&_inventory, 0, sizeof(InvEnt) * kMaxInventory); + + // Free Player Graphics + for (int i = 0; i < 8; i++) + _slugAttackGfx[i] = NULL; + + _weaponSelGfx = NULL; + _weaponGfx = NULL; + + memset(_clubDownGfx, 0, sizeof(_clubDownGfx)); + memset(_clubUpGfx, 0, sizeof(_clubUpGfx)); + memset(_clubLeftGfx, 0, sizeof(_clubLeftGfx)); + memset(_clubRightGfx, 0, sizeof(_clubRightGfx)); + memset(_slugAttackGfx, 0, sizeof(_slugAttackGfx)); + memset(_pushdownGfx, 0, sizeof(_pushdownGfx)); + memset(_pushupGfx, 0, sizeof(_pushupGfx)); + memset(_pushleftGfx, 0, sizeof(_pushleftGfx)); + memset(_pushrightGfx, 0, sizeof(_pushrightGfx)); + memset(_stunDownGfx, 0, sizeof(_stunDownGfx)); + memset(_stunUpGfx, 0, sizeof(_stunUpGfx)); + memset(_stunLeftGfx, 0, sizeof(_stunLeftGfx)); + memset(_stunRightGfx, 0, sizeof(_stunRightGfx)); + memset(_slugDownGfx, 0, sizeof(_slugDownGfx)); + memset(_slugUpGfx, 0, sizeof(_slugUpGfx)); + memset(_slugLeftGfx, 0, sizeof(_slugLeftGfx)); + memset(_slugRightGfx, 0, sizeof(_slugRightGfx)); + + memset(_horrible1Gfx, 0, sizeof(_horrible1Gfx)); + memset(_horrible2Gfx, 0, sizeof(_horrible2Gfx)); + memset(_horrible3Gfx, 0, sizeof(_horrible3Gfx)); + memset(_horrible4Gfx, 0, sizeof(_horrible4Gfx)); + memset(_plummetGfx, 0, sizeof(_plummetGfx)); + memset(_dyingGfx, 0, sizeof(_dyingGfx)); + + memset(_waypointGfx, 0, sizeof(_waypointGfx)); + _debugQMark = NULL; } AI::~AI() { @@ -952,31 +989,6 @@ AI::~AI() { _weaponGfx = NULL; } - memset(_clubDownGfx, 0, sizeof(_clubDownGfx)); - memset(_clubUpGfx, 0, sizeof(_clubUpGfx)); - memset(_clubLeftGfx, 0, sizeof(_clubLeftGfx)); - memset(_clubRightGfx, 0, sizeof(_clubRightGfx)); - memset(_slugAttackGfx, 0, sizeof(_slugAttackGfx)); - memset(_pushdownGfx, 0, sizeof(_pushdownGfx)); - memset(_pushupGfx, 0, sizeof(_pushupGfx)); - memset(_pushleftGfx, 0, sizeof(_pushleftGfx)); - memset(_pushrightGfx, 0, sizeof(_pushrightGfx)); - memset(_stunDownGfx, 0, sizeof(_stunDownGfx)); - memset(_stunUpGfx, 0, sizeof(_stunUpGfx)); - memset(_stunLeftGfx, 0, sizeof(_stunLeftGfx)); - memset(_stunRightGfx, 0, sizeof(_stunRightGfx)); - memset(_slugDownGfx, 0, sizeof(_slugDownGfx)); - memset(_slugUpGfx, 0, sizeof(_slugUpGfx)); - memset(_slugLeftGfx, 0, sizeof(_slugLeftGfx)); - memset(_slugRightGfx, 0, sizeof(_slugRightGfx)); - - memset(_horrible1Gfx, 0, sizeof(_horrible1Gfx)); - memset(_horrible2Gfx, 0, sizeof(_horrible2Gfx)); - memset(_horrible3Gfx, 0, sizeof(_horrible3Gfx)); - memset(_horrible4Gfx, 0, sizeof(_horrible4Gfx)); - memset(_plummetGfx, 0, sizeof(_plummetGfx)); - memset(_dyingGfx, 0, sizeof(_dyingGfx)); - for (int i = 0; i < 4; i++) delete _waypointGfx[i]; memset(_waypointGfx, 0, sizeof(_waypointGfx)); diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp index 8d82283623..6e98900425 100644 --- a/engines/hdb/menu.cpp +++ b/engines/hdb/menu.cpp @@ -25,26 +25,7 @@ namespace HDB { -Menu::~Menu() { - freeMenu(); - - delete _gCheckEmpty; - delete _gCheckOff; - delete _gCheckOn; - delete _gCheckLeft; - delete _gCheckRight; - - delete _contArrowUp; - delete _contArrowDown; - delete _contArrowLeft; - delete _contArrowRight; - delete _contAssign; - - delete _warpPlaque; - delete _hdbLogoScreen; -} - -bool Menu::init() { +Menu::Menu() { _starWarp = 0; _rocketEx = 0; _titleActive = false; @@ -70,6 +51,87 @@ bool Menu::init() { _keyAssignRight = Common::KEYCODE_RIGHT; _keyAssignUse = Common::KEYCODE_RETURN; + _gCheckEmpty = NULL; + _gCheckOff = NULL; + _gCheckOn = NULL; + _gCheckLeft = NULL; + _gCheckRight = NULL; + + _contArrowUp = NULL; + _contArrowDown = NULL; + _contArrowLeft = NULL; + _contArrowRight = NULL; + _contAssign = NULL; + + _waitingForKey = false; + _warpPlaque = NULL; + _hdbLogoScreen = NULL; + + _titleScreen = NULL; + _oohOohGfx = NULL; + _newGfx = NULL; + _loadGfx = NULL; + _optionsGfx = NULL; + _quitGfx = NULL; + _resumeGfx = NULL; + _slotGfx = NULL; + _rocketMain = NULL; + _rocketSecond = NULL; + _rocketEx1 = NULL; + _rocketEx2 = NULL; + _titleLogo = NULL; + _hdbLogoScreen = NULL; + for (int i = 0; i < kNebulaCount; i++) + _nebulaGfx[i] = NULL; + + _sliderLeft = NULL; + _sliderMid = NULL; + _sliderRight = NULL; + _sliderKnob = NULL; + _modePuzzleGfx = NULL; + _modeActionGfx = NULL; + _modeLoadGfx = NULL; + _modeSaveGfx = NULL; + _menuBackoutGfx = NULL; + _menuBackspaceGfx = NULL; + + _controlButtonGfx = NULL; + + _controlsGfx = NULL; + + _vortexian[0] = _vortexian[1] = _vortexian[2] = NULL; + + _star[0] = _star[1] = _star[2] = NULL; + + // secret stars + _starRedGfx[0] = _starRedGfx[1] = NULL; + _starGreenGfx[0] = _starGreenGfx[1] = NULL; + _starBlueGfx[0] = _starBlueGfx[1] = NULL; + + _versionGfx = NULL; + _warpGfx = NULL; +} + +Menu::~Menu() { + freeMenu(); + + delete _gCheckEmpty; + delete _gCheckOff; + delete _gCheckOn; + delete _gCheckLeft; + delete _gCheckRight; + + delete _contArrowUp; + delete _contArrowDown; + delete _contArrowLeft; + delete _contArrowRight; + delete _contAssign; + + delete _warpPlaque; + delete _hdbLogoScreen; +} + +bool Menu::init() { _gCheckEmpty = g_hdb->_gfx->loadPic(G_CHECK_EMPTY); _gCheckOff = g_hdb->_gfx->loadPic(G_CHECK_OFF); _gCheckOn = g_hdb->_gfx->loadPic(G_CHECK_ON); @@ -82,7 +144,6 @@ bool Menu::init() { _contArrowRight = g_hdb->_gfx->loadPic(CTRL_ARROWRIGHT); _contAssign = g_hdb->_gfx->loadPic(CTRL_ASSIGN); - _waitingForKey = false; _warpPlaque = g_hdb->_gfx->loadPic(WARP_PLAQUE); _hdbLogoScreen = g_hdb->_gfx->loadPic(TITLESCREEN); diff --git a/engines/hdb/menu.h b/engines/hdb/menu.h index 006ee7a8aa..a17d2cb4bd 100644 --- a/engines/hdb/menu.h +++ b/engines/hdb/menu.h @@ -152,6 +152,7 @@ struct Star { class Menu { public: + Menu(); ~Menu(); bool init(); |