From f46b9d77dd1427aacb095f834f10f3fb45502637 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 19 Jan 2015 10:28:48 -0500 Subject: XEEN: Compilation fixes for gcc --- engines/xeen/darkside/darkside_game.cpp | 13 +++++++------ engines/xeen/dialogs.cpp | 4 ++-- engines/xeen/dialogs.h | 2 ++ engines/xeen/dialogs_error.cpp | 2 +- engines/xeen/dialogs_options.h | 8 ++++++++ engines/xeen/font.cpp | 22 +++++++++++----------- engines/xeen/font.h | 2 +- engines/xeen/interface.cpp | 6 +++--- engines/xeen/module.mk | 1 - engines/xeen/sound.cpp | 2 +- engines/xeen/sound.h | 4 ++-- 11 files changed, 38 insertions(+), 28 deletions(-) diff --git a/engines/xeen/darkside/darkside_game.cpp b/engines/xeen/darkside/darkside_game.cpp index 60cb69362a..fe8c161287 100644 --- a/engines/xeen/darkside/darkside_game.cpp +++ b/engines/xeen/darkside/darkside_game.cpp @@ -66,9 +66,10 @@ void DarkSideEngine::showTitle1() { SpriteResource("nwc1.int"), SpriteResource("nwc2.int"), SpriteResource("nwc3.int"), SpriteResource("nwc4.int") }; - File voc[3] = { - File("dragon1.voc"), File("dragon2.voc"), File("dragon3.voc") - }; + Common::File voc[3]; + voc[0].open("dragon1.voc"); + voc[1].open("dragon2.voc"); + voc[2].open("dragon3.voc"); // Load backgrounds _screen->loadBackground("nwc1.raw"); @@ -168,9 +169,9 @@ void DarkSideEngine::showStartSequence() { SpriteResource sprites[3] = { SpriteResource("title.int"), SpriteResource("pyratop.int"), SpriteResource("pyramid.int") }; - File voc[2] = { - File("pharoh1a.voc"), File("pharoh1b.voc") - }; + Common::File voc[2]; + voc[0].open("pharoh1a.voc"); + voc[1].open("pharoh1b.voc"); _screen->vertMerge(SCREEN_HEIGHT); _screen->loadPage(0); diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp index c677fc8efb..824e8249ce 100644 --- a/engines/xeen/dialogs.cpp +++ b/engines/xeen/dialogs.cpp @@ -102,14 +102,14 @@ void ButtonContainer::doScroll(XeenEngine *vm, bool drawFlag, bool doFade) { // Load hand vga files SpriteResource *hand[16]; for (int i = 0; i < 16; ++i) { - Common::String name = Common::String::format("hand%02u.vga", i); + Common::String name = Common::String::format("hand%02d.vga", i); hand[i] = new SpriteResource(name); } // Load marb vga files SpriteResource *marb[5]; for (int i = 1; i < 5; ++i) { - Common::String name = Common::String::format("marb%02u.vga"); + Common::String name = Common::String::format("marb%02d.vga", i); marb[i] = new SpriteResource(name); } diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h index 229c40a2da..d8a9123c10 100644 --- a/engines/xeen/dialogs.h +++ b/engines/xeen/dialogs.h @@ -76,6 +76,8 @@ protected: virtual void showContents(SpriteResource &title1, bool mode); public: SettingsBaseDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {} + + virtual ~SettingsBaseDialog() {} }; class CreditsScreen: public ButtonContainer { diff --git a/engines/xeen/dialogs_error.cpp b/engines/xeen/dialogs_error.cpp index c0c072386d..e8512216c7 100644 --- a/engines/xeen/dialogs_error.cpp +++ b/engines/xeen/dialogs_error.cpp @@ -38,7 +38,7 @@ void ErrorScroll::execute(const Common::String &msg, ErrorWaitType waitType) { EventsManager &events = *_vm->_events; Window &w = screen._windows[6]; - Common::String s = Common::String::format("\x03c\v010\t000%s", msg); + Common::String s = Common::String::format("\x03c\v010\t000%s", msg.c_str()); w.open(); w.writeString(s); w.update(); diff --git a/engines/xeen/dialogs_options.h b/engines/xeen/dialogs_options.h index 7a933fdea6..bb4aea9a36 100644 --- a/engines/xeen/dialogs_options.h +++ b/engines/xeen/dialogs_options.h @@ -46,6 +46,8 @@ protected: virtual void openWindow() {} public: + virtual ~OptionsMenu() {} + static void show(XeenEngine *vm); }; @@ -54,6 +56,8 @@ protected: virtual void startup(Common::String &title1, Common::String &title2); public: CloudsOptionsMenu(XeenEngine *vm) : OptionsMenu(vm) {} + + virtual ~CloudsOptionsMenu() {} }; class DarkSideOptionsMenu : public OptionsMenu { @@ -61,6 +65,8 @@ protected: virtual void startup(Common::String &title1, Common::String &title2); public: DarkSideOptionsMenu(XeenEngine *vm) : OptionsMenu(vm) {} + + virtual ~DarkSideOptionsMenu() {} }; class WorldOptionsMenu : public DarkSideOptionsMenu { @@ -80,6 +86,8 @@ protected: virtual void showContents(SpriteResource &title1, bool mode); public: WorldOptionsMenu(XeenEngine *vm) : DarkSideOptionsMenu(vm), _bgFrame(0) {} + + virtual ~WorldOptionsMenu() {} }; } // End of namespace Xeen diff --git a/engines/xeen/font.cpp b/engines/xeen/font.cpp index b5608d48b8..aee05f9066 100644 --- a/engines/xeen/font.cpp +++ b/engines/xeen/font.cpp @@ -34,7 +34,7 @@ FontSurface::FontSurface() : XSurface(), _fontData(nullptr), _bgColor(DEFAULT_BG _textColors[3] = 0x20; } -FontSurface::FontSurface(int w, int h) : XSurface(), _fontData(nullptr), _msgWraps(false), +FontSurface::FontSurface(int wv, int hv) : XSurface(wv, hv), _fontData(nullptr), _msgWraps(false), _bgColor(DEFAULT_BG_COLOR), _fontReduced(false), _fontJustify(JUSTIFY_NONE) { create(w, h); _textColors[0] = 0; @@ -173,12 +173,12 @@ Common::String FontSurface::writeString(const Common::String &s, const Common::R _fontJustify = JUSTIFY_NONE; } else if (c == 4) { // Draw an empty box of a given width - int w = fontAtoi(); + int wv = fontAtoi(); Common::Point pt = _writePos; if (_fontJustify == JUSTIFY_RIGHT) - pt.x -= w; + pt.x -= wv; - Common::Rect r(pt.x, pt.y, pt.x + w, pt.y + (_fontReduced ? 9 : 10)); + Common::Rect r(pt.x, pt.y, pt.x + wv, pt.y + (_fontReduced ? 9 : 10)); fillRect(r, _bgColor); } else if (c == 5) { continue; @@ -187,8 +187,8 @@ Common::String FontSurface::writeString(const Common::String &s, const Common::R writeChar(' '); } else if (c == 7) { // Set text background color - int c = fontAtoi(); - _bgColor = (c < 0 || c > 255) ? DEFAULT_BG_COLOR : c; + int bgColor = fontAtoi(); + _bgColor = (bgColor < 0 || bgColor > 255) ? DEFAULT_BG_COLOR : bgColor; } else if (c == 8) { // Draw a character outline c = getNextChar(); @@ -218,8 +218,8 @@ Common::String FontSurface::writeString(const Common::String &s, const Common::R } } else if (c == 9) { // Skip x position - int xp = fontAtoi(); - _writePos.x = MIN(bounds.left + xp, (int)bounds.right); + int xAmount = fontAtoi(); + _writePos.x = MIN(bounds.left + xAmount, (int)bounds.right); } else if (c == 10) { // Newline if (newLine(bounds)) @@ -304,10 +304,10 @@ bool FontSurface::newLine(const Common::Rect &bounds) { _msgWraps = false; _writePos.x = bounds.left; - int h = _fontReduced ? 9 : 10; - _writePos.y += h; + int hv = _fontReduced ? 9 : 10; + _writePos.y += hv; - return ((_writePos.y + h - 1) > bounds.bottom); + return ((_writePos.y + hv - 1) > bounds.bottom); } /** diff --git a/engines/xeen/font.h b/engines/xeen/font.h index 0f53d5e6a7..6b362d7bf5 100644 --- a/engines/xeen/font.h +++ b/engines/xeen/font.h @@ -58,7 +58,7 @@ public: Justify _fontJustify; public: FontSurface(); - FontSurface(int w, int h); + FontSurface(int wv, int hv); virtual ~FontSurface() {} void writeSymbol(int symbolId); diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index a2c42a7b40..50f3ede109 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -28,7 +28,7 @@ namespace Xeen { Interface::Interface(XeenEngine *vm) : ButtonContainer(), InterfaceMap(vm), _vm(vm) { - Common::fill(&_partyFaces[0], &_partyFaces[MAX_ACTIVE_PARTY], nullptr); + Common::fill(&_partyFaces[0], &_partyFaces[MAX_ACTIVE_PARTY], (SpriteResource *)nullptr); _batUIFrame = 0; _spotDoorsUIFrame = 0; _dangerSenseUIFrame = 0; @@ -425,7 +425,7 @@ void Interface::setupFaces(int charIndex, Common::Array xeenSideChars, bool int charId; for (posIndex = 0; posIndex < 4; ++posIndex) { - int charId = xeenSideChars[charIndex]; + charId = xeenSideChars[charIndex]; bool isInParty = _vm->_party.isInParty(charId); if (charId == 0xff) { @@ -902,7 +902,7 @@ void Interface::setMazeBits() { break; case 4: case 7: - _wo[27]; + ++_wo[27]; break; case 5: ++_wo[227]; diff --git a/engines/xeen/module.mk b/engines/xeen/module.mk index d6b8097386..6362ffe1bf 100644 --- a/engines/xeen/module.mk +++ b/engines/xeen/module.mk @@ -18,7 +18,6 @@ MODULE_OBJS := \ items.o \ map.o \ party.o \ - resdata.o \ resources.o \ saves.o \ screen.o \ diff --git a/engines/xeen/sound.cpp b/engines/xeen/sound.cpp index 9495b25fe4..7c7524af54 100644 --- a/engines/xeen/sound.cpp +++ b/engines/xeen/sound.cpp @@ -27,7 +27,7 @@ namespace Xeen { SoundManager::SoundManager(XeenEngine *vm): _vm(vm) { } -void SoundManager::proc2(File &f) { +void SoundManager::proc2(Common::SeekableReadStream &f) { } diff --git a/engines/xeen/sound.h b/engines/xeen/sound.h index da6548b07d..553b1c6f44 100644 --- a/engines/xeen/sound.h +++ b/engines/xeen/sound.h @@ -35,11 +35,11 @@ private: public: SoundManager(XeenEngine *vm); - void proc2(File &f); + void proc2(Common::SeekableReadStream &f); void startMusic(int v1); - void playSong(const File &f) {} + void playSong(Common::SeekableReadStream &f) {} void playSample(const Common::SeekableReadStream *stream, int v2) {} }; -- cgit v1.2.3