From 24468bf630dbefb17d72211e5a8cbc67730dcd24 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 13 Jul 2019 00:51:15 +0200 Subject: [PATCH] HDB: Fix warnings --- engines/hdb/gfx.cpp | 5 ++++- engines/hdb/gfx.h | 2 -- engines/hdb/menu.cpp | 13 ++++++++++++- engines/hdb/menu.h | 10 ---------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index 9ba60400a95..999cf3e7cb5 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -625,6 +625,9 @@ void Gfx::drawSky() { } } +static const int snowXVList[13] = {0, -1, -1, -2, -2, -1, 0, 0, 0, -1, -2, -1, 0}; + + void Gfx::drawSnow() { int i; if (_snowInfo.active == false) @@ -632,7 +635,7 @@ void Gfx::drawSnow() { for (i = 0; i < MAX_SNOW; i++) { _snowflake->drawMasked((int)_snowInfo.x[i], (int)_snowInfo.y[i]); - _snowInfo.x[i] += _snowXVList[_snowInfo.xvindex[i]++]; + _snowInfo.x[i] += snowXVList[_snowInfo.xvindex[i]++]; _snowInfo.y[i] += _snowInfo.yv[i]; if (_snowInfo.xvindex[i] == MAX_SNOW_XV) _snowInfo.xvindex[i] = 0; diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h index 28ebcbafecd..371174b113d 100644 --- a/engines/hdb/gfx.h +++ b/engines/hdb/gfx.h @@ -195,8 +195,6 @@ private: int xvindex[MAX_SNOW]; } _snowInfo; - int _snowXVList[13] = {0, -1, -1, -2, -2, -1, 0, 0, 0, -1, -2, -1, 0}; - struct { int x, y, speed; uint16 color; diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp index 11c8817c843..2c524fc21f6 100644 --- a/engines/hdb/menu.cpp +++ b/engines/hdb/menu.cpp @@ -153,6 +153,17 @@ void Menu::writeConfig() { ConfMan.set(CONFIG_CHEAT, "1"); } +static const char nebulaNames[kNebulaCount][32] = { + BACKSCROLL_PLANET1, + BACKSCROLL_PLANET2, + BACKSCROLL_PLANET3, + BACKSCROLL_PLANET4, + BACKSCROLL_PLANET5, + BACKSCROLL_GALAXY1, + BACKSCROLL_GALAXY2 +}; + + void Menu::startMenu() { int i; @@ -1183,7 +1194,7 @@ void Menu::processInput(int x, int y) { int xit = getMenuKey(); - if (y >= kMenuExitY && x < kMenuExitXLeft || xit) { + if ((y >= kMenuExitY && x < kMenuExitXLeft) || xit) { _menuActive = true; _warpActive = false; g_hdb->_sound->playSound(SND_MENU_BACKOUT); diff --git a/engines/hdb/menu.h b/engines/hdb/menu.h index 59650b6451f..0a0cb0d0cd4 100644 --- a/engines/hdb/menu.h +++ b/engines/hdb/menu.h @@ -229,16 +229,6 @@ public: Star _fStars[kMaxStars]; - char nebulaNames[kNebulaCount][32] = { - BACKSCROLL_PLANET1, - BACKSCROLL_PLANET2, - BACKSCROLL_PLANET3, - BACKSCROLL_PLANET4, - BACKSCROLL_PLANET5, - BACKSCROLL_GALAXY1, - BACKSCROLL_GALAXY2 - }; - int _menuKey; };