diff options
author | Johannes Schickel | 2013-04-19 06:43:47 -0700 |
---|---|---|
committer | Johannes Schickel | 2013-04-19 06:43:47 -0700 |
commit | 2785c3a5287019ad2eb9eddb4aae374128d243a4 (patch) | |
tree | b95a053d2b4b3d67c772a5c51a356994c317b0f7 /engines | |
parent | 80271c24b122f737aca6a617b7096260315e110d (diff) | |
parent | 34aaac0a1e40ce2136572ffc71de3345ace706ef (diff) | |
download | scummvm-rg350-2785c3a5287019ad2eb9eddb4aae374128d243a4.tar.gz scummvm-rg350-2785c3a5287019ad2eb9eddb4aae374128d243a4.tar.bz2 scummvm-rg350-2785c3a5287019ad2eb9eddb4aae374128d243a4.zip |
Merge pull request #322 from fingolfin/fix-clang-warnings
Fix clang warnings
Diffstat (limited to 'engines')
51 files changed, 74 insertions, 96 deletions
diff --git a/engines/agi/loader_v1.cpp b/engines/agi/loader_v1.cpp index 189c98ee98..33e956af41 100644 --- a/engines/agi/loader_v1.cpp +++ b/engines/agi/loader_v1.cpp @@ -254,7 +254,7 @@ int AgiLoader_v1::loadResource(int t, int n) { if (data != NULL) { // Freeing of the raw resource from memory is delegated to the createFromRawResource-function - _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound, _vm->_soundemu); + _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, _vm->_soundemu); _vm->_game.dirSound[n].flags |= RES_LOADED; } else { ec = errBadResource; diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp index a2ac6f0111..ee69bb5b27 100644 --- a/engines/agi/loader_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -230,7 +230,7 @@ int AgiLoader_v2::loadResource(int t, int n) { if (data != NULL) { // Freeing of the raw resource from memory is delegated to the createFromRawResource-function - _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound, _vm->_soundemu); + _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, _vm->_soundemu); _vm->_game.dirSound[n].flags |= RES_LOADED; } else { ec = errBadResource; diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp index 29635f935b..250d8e7615 100644 --- a/engines/agi/loader_v3.cpp +++ b/engines/agi/loader_v3.cpp @@ -314,7 +314,7 @@ int AgiLoader_v3::loadResource(int t, int n) { data = loadVolRes(&_vm->_game.dirSound[n]); if (data != NULL) { // Freeing of the raw resource from memory is delegated to the createFromRawResource-function - _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound, _vm->_soundemu); + _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, _vm->_soundemu); _vm->_game.dirSound[n].flags |= RES_LOADED; } else { ec = errBadResource; diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 9d899b1855..0245f3936a 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1705,7 +1705,9 @@ void cmdCallV1(AgiGame *state, uint8 *p) { // FIXME: The following instruction looks incomplete. // Maybe something is meant to be assigned to, or read from, // the logic_list entry? - state->logic_list[++state->max_logics]; +// state->logic_list[++state->max_logics]; + // For now, just do the increment, to silence a clang warning + ++state->max_logics; _v[13] = 1; } diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index 53863a8c7e..37f8661367 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -1134,7 +1134,7 @@ bool WinnieEngine::playSound(ENUM_WTP_SOUND iSound) { file.read(data, size); file.close(); - _game.sounds[0] = AgiSound::createFromRawResource(data, size, 0, *_sound, _soundemu); + _game.sounds[0] = AgiSound::createFromRawResource(data, size, 0, _soundemu); _sound->startSound(0, 0); bool cursorShowing = CursorMan.showMouse(false); diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index ca3d799ecc..3ae4d548dc 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -36,25 +36,25 @@ namespace Agi { // TODO: add support for variable sampling rate in the output device // -AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, SoundMgr &manager, int soundemu) { +AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, int soundemu) { if (data == NULL || len < 2) // Check for too small resource or no resource at all return NULL; uint16 type = READ_LE_UINT16(data); // For V1 sound resources if (type != AGI_SOUND_SAMPLE && (type & 0xFF) == 0x01) - return new PCjrSound(data, len, resnum, manager); + return new PCjrSound(data, len, resnum); switch (type) { // Create a sound object based on the type case AGI_SOUND_SAMPLE: - return new IIgsSample(data, len, resnum, manager); + return new IIgsSample(data, len, resnum); case AGI_SOUND_MIDI: - return new IIgsMidi(data, len, resnum, manager); + return new IIgsMidi(data, len, resnum); case AGI_SOUND_4CHN: if (soundemu == SOUND_EMU_MIDI) { - return new MIDISound(data, len, resnum, manager); + return new MIDISound(data, len, resnum); } else { - return new PCjrSound(data, len, resnum, manager); + return new PCjrSound(data, len, resnum); } } @@ -62,7 +62,7 @@ AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, S return NULL; } -PCjrSound::PCjrSound(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) { +PCjrSound::PCjrSound(uint8 *data, uint32 len, int resnum) : AgiSound() { _data = data; // Save the resource pointer _len = len; // Save the resource's length _type = READ_LE_UINT16(data); // Read sound resource's type diff --git a/engines/agi/sound.h b/engines/agi/sound.h index 6fd8dd516e..528becbb58 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -93,7 +93,7 @@ public: */ class AgiSound { public: - AgiSound(SoundMgr &manager) : _manager(manager), _isPlaying(false), _isValid(false) {} + AgiSound() : _isPlaying(false), _isValid(false) {} virtual ~AgiSound() {} virtual void play() { _isPlaying = true; } virtual void stop() { _isPlaying = false; } @@ -108,17 +108,16 @@ public: * from memory using free() or delegate the responsibility onwards to some other * function! */ - static AgiSound *createFromRawResource(uint8 *data, uint32 len, int resnum, SoundMgr &manager, int soundemu); + static AgiSound *createFromRawResource(uint8 *data, uint32 len, int resnum, int soundemu); protected: - SoundMgr &_manager; ///< AGI sound manager object bool _isPlaying; ///< Is the sound playing? bool _isValid; ///< Is this a valid sound object? }; class PCjrSound : public AgiSound { public: - PCjrSound(uint8 *data, uint32 len, int resnum, SoundMgr &manager); + PCjrSound(uint8 *data, uint32 len, int resnum); ~PCjrSound() { free(_data); } virtual uint16 type() { return _type; } const uint8 *getVoicePointer(uint voiceNum); diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index bfc8d4d8f3..f088ad3a01 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -447,7 +447,7 @@ void SoundGen2GS::setProgramChangeMapping(const IIgsMidiProgramMapping *mapping) _progToInst = mapping; } -IIgsMidi::IIgsMidi(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) { +IIgsMidi::IIgsMidi(uint8 *data, uint32 len, int resnum) : AgiSound() { _data = data; // Save the resource pointer _ptr = _data + 2; // Set current position to just after the header _len = len; // Save the resource's length @@ -472,7 +472,7 @@ static bool convertWave(Common::SeekableReadStream &source, int8 *dest, uint len return !(source.eos() || source.err()); } -IIgsSample::IIgsSample(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) { +IIgsSample::IIgsSample(uint8 *data, uint32 len, int resnum) : AgiSound() { Common::MemoryReadStream stream(data, len, DisposeAfterUse::YES); // Check that the header was read ok and that it's of the correct type diff --git a/engines/agi/sound_2gs.h b/engines/agi/sound_2gs.h index 404f4a47a1..12e7b7b951 100644 --- a/engines/agi/sound_2gs.h +++ b/engines/agi/sound_2gs.h @@ -144,7 +144,7 @@ public: class IIgsMidi : public AgiSound { public: - IIgsMidi(uint8 *data, uint32 len, int resnum, SoundMgr &manager); + IIgsMidi(uint8 *data, uint32 len, int resnum); ~IIgsMidi() { if (_data != NULL) free(_data); } virtual uint16 type() { return _type; } virtual const uint8 *getPtr() { return _ptr; } @@ -161,7 +161,7 @@ public: class IIgsSample : public AgiSound { public: - IIgsSample(uint8 *data, uint32 len, int resnum, SoundMgr &manager); + IIgsSample(uint8 *data, uint32 len, int resnum); ~IIgsSample() { delete[] _sample; } virtual uint16 type() { return _header.type; } const IIgsSampleHeader &getHeader() const { return _header; } diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp index 47d354093b..24e3ca8fb7 100644 --- a/engines/agi/sound_midi.cpp +++ b/engines/agi/sound_midi.cpp @@ -59,7 +59,7 @@ namespace Agi { static uint32 convertSND2MIDI(byte *snddata, byte **data); -MIDISound::MIDISound(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) { +MIDISound::MIDISound(uint8 *data, uint32 len, int resnum) : AgiSound() { _data = data; // Save the resource pointer _len = len; // Save the resource's length _type = READ_LE_UINT16(data); // Read sound resource's type diff --git a/engines/agi/sound_midi.h b/engines/agi/sound_midi.h index 36bd66ee76..ac1b100b12 100644 --- a/engines/agi/sound_midi.h +++ b/engines/agi/sound_midi.h @@ -33,7 +33,7 @@ namespace Agi { class MIDISound : public AgiSound { public: - MIDISound(uint8 *data, uint32 len, int resnum, SoundMgr &manager); + MIDISound(uint8 *data, uint32 len, int resnum); ~MIDISound() { free(_data); } virtual uint16 type() { return _type; } uint8 *_data; ///< Raw sound resource data @@ -61,8 +61,6 @@ public: private: bool _isGM; - - SoundMgr *_manager; }; } // End of namespace Agi diff --git a/engines/cine/console.cpp b/engines/cine/console.cpp index 4af28592e7..46f0ea61d3 100644 --- a/engines/cine/console.cpp +++ b/engines/cine/console.cpp @@ -28,6 +28,7 @@ namespace Cine { bool labyrinthCheat; CineConsole::CineConsole(CineEngine *vm) : GUI::Debugger(), _vm(vm) { + assert(_vm); DCmd_Register("labyrinthCheat", WRAP_METHOD(CineConsole, Cmd_LabyrinthCheat)); labyrinthCheat = false; diff --git a/engines/draci/console.cpp b/engines/draci/console.cpp index a0013c59fe..07f0ff5542 100644 --- a/engines/draci/console.cpp +++ b/engines/draci/console.cpp @@ -26,6 +26,7 @@ namespace Draci { DraciConsole::DraciConsole(DraciEngine *vm) : GUI::Debugger(), _vm(vm) { + assert(_vm); } DraciConsole::~DraciConsole() { diff --git a/engines/dreamweb/console.cpp b/engines/dreamweb/console.cpp index d415089a48..532bf815ef 100644 --- a/engines/dreamweb/console.cpp +++ b/engines/dreamweb/console.cpp @@ -25,6 +25,7 @@ namespace DreamWeb { DreamWebConsole::DreamWebConsole(DreamWebEngine *vm) : GUI::Debugger(), _vm(vm) { + assert(_vm); } DreamWebConsole::~DreamWebConsole() { diff --git a/engines/gob/pregob/onceupon/stork.h b/engines/gob/pregob/onceupon/stork.h index 756f5258c7..ae57983000 100644 --- a/engines/gob/pregob/onceupon/stork.h +++ b/engines/gob/pregob/onceupon/stork.h @@ -79,8 +79,6 @@ private: }; - GobEngine *_vm; - Surface *_frame; ANIObject *_bundle; diff --git a/engines/groovie/vdx.h b/engines/groovie/vdx.h index ebe58cb119..a9bfaa1eb4 100644 --- a/engines/groovie/vdx.h +++ b/engines/groovie/vdx.h @@ -62,11 +62,11 @@ private: bool _flagEight; bool _flagNine; - bool _flagSkipStill; + //bool _flagSkipStill; bool _flagSkipPalette; bool _flagFirstFrame; - bool _flagTransparent; - bool _flagUpdateStill; + //bool _flagTransparent; + //bool _flagUpdateStill; void getStill(Common::ReadStream *in); void getDelta(Common::ReadStream *in); diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp index 467153e4dd..253d849286 100644 --- a/engines/hopkins/computer.cpp +++ b/engines/hopkins/computer.cpp @@ -326,13 +326,13 @@ static const char _spanishText[] = "% **** ORDENADOR DEL FBI NUMERO 4985 **** ORDENADOR J.HOPKINS *****\n" "% **** ORDENADOR DEL FBI NUMERO 4998 **** ORDENADOR S.COLLINS *****\n" "% *** ORDENADOR DEL FBI NUMERO 4997 *** ORDENADOR DE ACCESO LIBRE ***\n" -"% LA CONTRASE¥A ES: ALLFREE\n" -"% ESCRIBE CONTRASE¥A ACTUAL\n" +"% LA CONTRASE\0245A ES: ALLFREE\n" +"% ESCRIBE CONTRASE\0245A ACTUAL\n" "% **** ACCESO DENEGADO ****\n" "% 1) *** JUEGO ***\n" "% 0) SALIR DEL ORDENADOR\n" -"% 2) CADAVER EXTRA¥O\n" -"% 3) CADAVER EXTRA¥O\n" +"% 2) CADAVER EXTRA\0245O\n" +"% 3) CADAVER EXTRA\0245O\n" "% 4) SENADOR FERGUSSON\n" "% 5) MATAPERROS\n" "% 2) CIENTIFICO SECUESTRADO.\n" diff --git a/engines/made/console.cpp b/engines/made/console.cpp index c835988788..0076b6a4f9 100644 --- a/engines/made/console.cpp +++ b/engines/made/console.cpp @@ -26,6 +26,7 @@ namespace Made { MadeConsole::MadeConsole(MadeEngine *vm) : GUI::Debugger(), _vm(vm) { + assert(_vm); } MadeConsole::~MadeConsole() { diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index a9889cc7af..e2d9532c8a 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -31,7 +31,7 @@ namespace Parallaction { GfxObj::GfxObj(uint objType, Frames *frames, const char* name) : - _frames(frames), _keep(true), x(0), y(0), z(0), _prog(0), _flags(0), + _frames(frames), x(0), y(0), z(0), _prog(0), _flags(0), type(objType), frame(0), layer(3), scale(100), _hasMask(false), _hasPath(false) { if (name) { diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index e9daabb194..55c1c0c04e 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -289,8 +289,6 @@ class GfxObj { char *_name; Frames *_frames; - bool _keep; - public: int16 x, y; diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp index 30bf681e63..dd10e7ad46 100644 --- a/engines/queen/input.cpp +++ b/engines/queen/input.cpp @@ -50,12 +50,12 @@ const Verb Input::_verbKeys[] = { VERB_USE }; -Input::Input(Common::Language language, OSystem *system, QueenEngine *vm) : +Input::Input(Common::Language language, OSystem *system) : _system(system), _eventMan(system->getEventManager()), _fastMode(false), _keyVerb(VERB_NONE), _cutawayRunning(false), _canQuit(false), _cutawayQuit(false), _dialogueRunning(false), _talkQuit(false), _quickSave(false), _quickLoad(false), _debugger(false), _inKey(Common::KEYCODE_INVALID), - _mouseButton(0), _idleTime(0) , _vm(vm) { + _mouseButton(0), _idleTime(0) { switch (language) { case Common::EN_ANY: diff --git a/engines/queen/input.h b/engines/queen/input.h index b3bf811cd1..f04ecb24f7 100644 --- a/engines/queen/input.h +++ b/engines/queen/input.h @@ -46,7 +46,7 @@ public: MOUSE_RBUTTON = 2 }; - Input(Common::Language language, OSystem *system, QueenEngine *vm); + Input(Common::Language language, OSystem *system); void delay(uint amount); @@ -96,8 +96,6 @@ private: Common::EventManager *_eventMan; - QueenEngine *_vm; - //! some cutaways require update() run faster bool _fastMode; diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index c403536e22..08fc594560 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -500,7 +500,7 @@ Common::Error QueenEngine::run() { _display = new Display(this, _system); _graphics = new Graphics(this); _grid = new Grid(this); - _input = new Input(_resource->getLanguage(), _system, this); + _input = new Input(_resource->getLanguage(), _system); if (_resource->isDemo()) { _logic = new LogicDemo(this); diff --git a/engines/queen/talk.h b/engines/queen/talk.h index 68196784b1..cba77cc255 100644 --- a/engines/queen/talk.h +++ b/engines/queen/talk.h @@ -88,8 +88,6 @@ private: QueenEngine *_vm; - bool _wasFullscren; - //! Raw .dog file data (without 20 byte header) byte *_fileData; diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index 70dff15a86..b42063b119 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -37,8 +37,8 @@ namespace Sci { -GfxCompare::GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster) - : _segMan(segMan), _kernel(kernel), _cache(cache), _screen(screen), _coordAdjuster(coordAdjuster) { +GfxCompare::GfxCompare(SegManager *segMan, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster) + : _segMan(segMan), _cache(cache), _screen(screen), _coordAdjuster(coordAdjuster) { } GfxCompare::~GfxCompare() { diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h index 91e3b90fdb..0080406a3b 100644 --- a/engines/sci/graphics/compare.h +++ b/engines/sci/graphics/compare.h @@ -34,7 +34,7 @@ class Screen; */ class GfxCompare { public: - GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster); + GfxCompare(SegManager *segMan, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster); ~GfxCompare(); uint16 kernelOnControl(byte screenMask, const Common::Rect &rect); @@ -47,7 +47,6 @@ public: private: SegManager *_segMan; - Kernel *_kernel; GfxCache *_cache; GfxScreen *_screen; GfxCoordAdjuster *_coordAdjuster; diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp index 5535a7408a..5b61e1a86a 100644 --- a/engines/sci/graphics/controls32.cpp +++ b/engines/sci/graphics/controls32.cpp @@ -35,8 +35,8 @@ namespace Sci { -GfxControls32::GfxControls32(SegManager *segMan, GfxCache *cache, GfxScreen *screen, GfxText32 *text) - : _segMan(segMan), _cache(cache), _screen(screen), _text(text) { +GfxControls32::GfxControls32(SegManager *segMan, GfxCache *cache, GfxText32 *text) + : _segMan(segMan), _cache(cache), _text(text) { } GfxControls32::~GfxControls32() { diff --git a/engines/sci/graphics/controls32.h b/engines/sci/graphics/controls32.h index 68dca59462..1b705988c2 100644 --- a/engines/sci/graphics/controls32.h +++ b/engines/sci/graphics/controls32.h @@ -34,7 +34,7 @@ class GfxText32; */ class GfxControls32 { public: - GfxControls32(SegManager *segMan, GfxCache *cache, GfxScreen *screen, GfxText32 *text); + GfxControls32(SegManager *segMan, GfxCache *cache, GfxText32 *text); ~GfxControls32(); void kernelTexteditChange(reg_t controlObject); @@ -42,7 +42,6 @@ public: private: SegManager *_segMan; GfxCache *_cache; - GfxScreen *_screen; GfxText32 *_text; }; diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h index 63f608be6b..25279b34b1 100644 --- a/engines/sci/graphics/coordadjuster.h +++ b/engines/sci/graphics/coordadjuster.h @@ -71,8 +71,6 @@ public: private: GfxPorts *_ports; - - Port *backuppedPort; }; #ifdef ENABLE_SCI32 diff --git a/engines/sci/graphics/fontsjis.h b/engines/sci/graphics/fontsjis.h index c4ae4ab580..ae5eaa43f9 100644 --- a/engines/sci/graphics/fontsjis.h +++ b/engines/sci/graphics/fontsjis.h @@ -50,9 +50,6 @@ private: GuiResourceId _resourceId; Graphics::FontSJIS *_commonFont; - - byte _lastForDoubleByteWidth; - byte _lastForDoubleByteDraw; }; } // End of namespace Sci diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index d20aa80c77..25b373a011 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -41,8 +41,8 @@ namespace Sci { -GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio) - : _resMan(resMan), _segMan(segMan), _kernel(kernel), _cache(cache), _ports(ports), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette), _transitions(transitions), _audio(audio) { +GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio) + : _resMan(resMan), _segMan(segMan), _cache(cache), _ports(ports), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette), _transitions(transitions), _audio(audio) { } GfxPaint16::~GfxPaint16() { diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h index 46df203200..e06021c3e7 100644 --- a/engines/sci/graphics/paint16.h +++ b/engines/sci/graphics/paint16.h @@ -38,7 +38,7 @@ class GfxView; */ class GfxPaint16 : public GfxPaint { public: - GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio); + GfxPaint16(ResourceManager *resMan, SegManager *segMan, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio); ~GfxPaint16(); void init(GfxAnimate *animate, GfxText16 *text16); @@ -89,7 +89,6 @@ public: private: ResourceManager *_resMan; SegManager *_segMan; - Kernel *_kernel; AudioPlayer *_audio; GfxAnimate *_animate; GfxCache *_cache; diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index a9590c829a..a03e77dfa6 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -34,8 +34,8 @@ namespace Sci { -GfxPaint32::GfxPaint32(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCoordAdjuster *coordAdjuster, GfxCache *cache, GfxScreen *screen, GfxPalette *palette) - : _resMan(resMan), _segMan(segMan), _kernel(kernel), _coordAdjuster(coordAdjuster), _cache(cache), _screen(screen), _palette(palette) { +GfxPaint32::GfxPaint32(ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette) + : _resMan(resMan), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette) { } GfxPaint32::~GfxPaint32() { diff --git a/engines/sci/graphics/paint32.h b/engines/sci/graphics/paint32.h index 66b31de282..81e355f77f 100644 --- a/engines/sci/graphics/paint32.h +++ b/engines/sci/graphics/paint32.h @@ -34,7 +34,7 @@ class GfxPorts; */ class GfxPaint32 : public GfxPaint { public: - GfxPaint32(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCoordAdjuster *coordAdjuster, GfxCache *cache, GfxScreen *screen, GfxPalette *palette); + GfxPaint32(ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette); ~GfxPaint32(); void fillRect(Common::Rect rect, byte color); @@ -44,10 +44,7 @@ public: private: ResourceManager *_resMan; - SegManager *_segMan; - Kernel *_kernel; GfxCoordAdjuster *_coordAdjuster; - GfxCache *_cache; GfxScreen *_screen; GfxPalette *_palette; }; diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index 7eaa0168b8..56e9ea8b69 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -36,8 +36,8 @@ namespace Sci { -GfxText16::GfxText16(ResourceManager *resMan, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen) - : _resMan(resMan), _cache(cache), _ports(ports), _paint16(paint16), _screen(screen) { +GfxText16::GfxText16(GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen) + : _cache(cache), _ports(ports), _paint16(paint16), _screen(screen) { init(); } diff --git a/engines/sci/graphics/text16.h b/engines/sci/graphics/text16.h index b33c2c4df0..321c7fc25e 100644 --- a/engines/sci/graphics/text16.h +++ b/engines/sci/graphics/text16.h @@ -40,7 +40,7 @@ class GfxFont; */ class GfxText16 { public: - GfxText16(ResourceManager *_resMan, GfxCache *fonts, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen); + GfxText16(GfxCache *fonts, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen); ~GfxText16(); GuiResourceId GetFontId(); @@ -75,7 +75,6 @@ private: void init(); bool SwitchToFont900OnSjis(const char *text); - ResourceManager *_resMan; GfxCache *_cache; GfxPorts *_ports; GfxPaint16 *_paint16; diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 1f5c354d1f..caba2c33cc 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -627,11 +627,11 @@ void SciEngine::initGraphics() { // SCI32 graphic objects creation _gfxCoordAdjuster = new GfxCoordAdjuster32(_gamestate->_segMan); _gfxCursor->init(_gfxCoordAdjuster, _eventMan); - _gfxCompare = new GfxCompare(_gamestate->_segMan, _kernel, _gfxCache, _gfxScreen, _gfxCoordAdjuster); - _gfxPaint32 = new GfxPaint32(_resMan, _gamestate->_segMan, _kernel, _gfxCoordAdjuster, _gfxCache, _gfxScreen, _gfxPalette); + _gfxCompare = new GfxCompare(_gamestate->_segMan, _gfxCache, _gfxScreen, _gfxCoordAdjuster); + _gfxPaint32 = new GfxPaint32(_resMan, _gfxCoordAdjuster, _gfxScreen, _gfxPalette); _gfxPaint = _gfxPaint32; _gfxText32 = new GfxText32(_gamestate->_segMan, _gfxCache, _gfxScreen); - _gfxControls32 = new GfxControls32(_gamestate->_segMan, _gfxCache, _gfxScreen, _gfxText32); + _gfxControls32 = new GfxControls32(_gamestate->_segMan, _gfxCache, _gfxText32); _robotDecoder = new RobotDecoder(getPlatform() == Common::kPlatformMacintosh); _gfxFrameout = new GfxFrameout(_gamestate->_segMan, _resMan, _gfxCoordAdjuster, _gfxCache, _gfxScreen, _gfxPalette, _gfxPaint32); } else { @@ -640,24 +640,24 @@ void SciEngine::initGraphics() { _gfxPorts = new GfxPorts(_gamestate->_segMan, _gfxScreen); _gfxCoordAdjuster = new GfxCoordAdjuster16(_gfxPorts); _gfxCursor->init(_gfxCoordAdjuster, _eventMan); - _gfxCompare = new GfxCompare(_gamestate->_segMan, _kernel, _gfxCache, _gfxScreen, _gfxCoordAdjuster); + _gfxCompare = new GfxCompare(_gamestate->_segMan, _gfxCache, _gfxScreen, _gfxCoordAdjuster); _gfxTransitions = new GfxTransitions(_gfxScreen, _gfxPalette); - _gfxPaint16 = new GfxPaint16(_resMan, _gamestate->_segMan, _kernel, _gfxCache, _gfxPorts, _gfxCoordAdjuster, _gfxScreen, _gfxPalette, _gfxTransitions, _audio); + _gfxPaint16 = new GfxPaint16(_resMan, _gamestate->_segMan, _gfxCache, _gfxPorts, _gfxCoordAdjuster, _gfxScreen, _gfxPalette, _gfxTransitions, _audio); _gfxPaint = _gfxPaint16; _gfxAnimate = new GfxAnimate(_gamestate, _gfxCache, _gfxPorts, _gfxPaint16, _gfxScreen, _gfxPalette, _gfxCursor, _gfxTransitions); - _gfxText16 = new GfxText16(_resMan, _gfxCache, _gfxPorts, _gfxPaint16, _gfxScreen); + _gfxText16 = new GfxText16(_gfxCache, _gfxPorts, _gfxPaint16, _gfxScreen); _gfxControls16 = new GfxControls16(_gamestate->_segMan, _gfxPorts, _gfxPaint16, _gfxText16, _gfxScreen); _gfxMenu = new GfxMenu(_eventMan, _gamestate->_segMan, _gfxPorts, _gfxPaint16, _gfxText16, _gfxScreen, _gfxCursor); _gfxMenu->reset(); -#ifdef ENABLE_SCI32 - } -#endif - if (_gfxPorts) { _gfxPorts->init(_features->usesOldGfxFunctions(), _gfxPaint16, _gfxText16); _gfxPaint16->init(_gfxAnimate, _gfxText16); + +#ifdef ENABLE_SCI32 } +#endif + // Set default (EGA, amiga or resource 999) palette _gfxPalette->setDefault(); } diff --git a/engines/scumm/debugger.h b/engines/scumm/debugger.h index a9b340d691..b60a1a2f03 100644 --- a/engines/scumm/debugger.h +++ b/engines/scumm/debugger.h @@ -35,7 +35,6 @@ public: private: ScummEngine *_vm; - bool _old_soundsPaused; // Commands bool Cmd_Room(int argc, const char **argv); diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h index 7fa31a195d..e17c1b9a39 100644 --- a/engines/scumm/he/animation_he.h +++ b/engines/scumm/he/animation_he.h @@ -55,7 +55,6 @@ private: Video::VideoDecoder *_video; - char baseName[40]; uint32 _flags; uint32 _wizResNum; }; diff --git a/engines/sword1/console.cpp b/engines/sword1/console.cpp index 603efd308e..4c55f8d990 100644 --- a/engines/sword1/console.cpp +++ b/engines/sword1/console.cpp @@ -26,6 +26,7 @@ namespace Sword1 { SwordConsole::SwordConsole(SwordEngine *vm) : GUI::Debugger(), _vm(vm) { + assert(_vm); } SwordConsole::~SwordConsole() { diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp index 3611294eb8..a4b540ac7b 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -117,8 +117,6 @@ private: Glyph _glyph[SIZE_OF_CHAR_SET]; - int _fontId; - public: enum { kAlignLeft, @@ -142,7 +140,7 @@ public: }; FontRendererGui::FontRendererGui(Sword2Engine *vm, int fontId) - : _vm(vm), _fontId(fontId) { + : _vm(vm) { byte *font = _vm->_resman->openResource(fontId); SpriteInfo sprite; diff --git a/engines/sword2/memory.cpp b/engines/sword2/memory.cpp index 5fd2d4e78e..391983930d 100644 --- a/engines/sword2/memory.cpp +++ b/engines/sword2/memory.cpp @@ -52,7 +52,7 @@ namespace Sword2 { -MemoryManager::MemoryManager(Sword2Engine *vm) : _vm(vm) { +MemoryManager::MemoryManager() { // The id stack contains all the possible ids for the memory blocks. // We use this to ensure that no two blocks ever have the same id. diff --git a/engines/sword2/memory.h b/engines/sword2/memory.h index 3f511dd5db..250da138c2 100644 --- a/engines/sword2/memory.h +++ b/engines/sword2/memory.h @@ -40,8 +40,6 @@ struct MemBlock { class MemoryManager { private: - Sword2Engine *_vm; - MemBlock *_memBlocks; MemBlock **_memBlockIndex; int16 _numBlocks; @@ -56,7 +54,7 @@ private: int16 findInsertionPointInIndex(byte *ptr); public: - MemoryManager(Sword2Engine *vm); + MemoryManager(); ~MemoryManager(); int16 getNumBlocks() { return _numBlocks; } diff --git a/engines/sword2/sound.h b/engines/sword2/sound.h index 9a59ef27a8..e250707fb9 100644 --- a/engines/sword2/sound.h +++ b/engines/sword2/sound.h @@ -142,7 +142,6 @@ private: bool _looping; int32 _fading; int32 _fadeSamples; - bool _paused; void refill(); diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index dfa6a23320..d4a564e2c0 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -450,7 +450,7 @@ Common::Error Sword2Engine::run() { _debugger = new Debugger(this); - _memory = new MemoryManager(this); + _memory = new MemoryManager(); _resman = new ResourceManager(this); if (!_resman->init()) diff --git a/engines/sword25/console.cpp b/engines/sword25/console.cpp index 5d15f189ab..f1b91d2bc2 100644 --- a/engines/sword25/console.cpp +++ b/engines/sword25/console.cpp @@ -26,6 +26,7 @@ namespace Sword25 { Sword25Console::Sword25Console(Sword25Engine *vm) : GUI::Debugger(), _vm(vm) { + assert(_vm); } Sword25Console::~Sword25Console() { diff --git a/engines/toon/console.cpp b/engines/toon/console.cpp index 8037dca4cb..18f81e1323 100644 --- a/engines/toon/console.cpp +++ b/engines/toon/console.cpp @@ -26,6 +26,7 @@ namespace Toon { ToonConsole::ToonConsole(ToonEngine *vm) : GUI::Debugger(), _vm(vm) { + assert(_vm); } ToonConsole::~ToonConsole() { diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index 9175b1050a..826f2fef6f 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -162,7 +162,6 @@ public: class GfxFontBackup { private: - GfxSurface *_surface; Common::Point _edgeSize; Common::Point _position; GfxColors _colors; diff --git a/engines/tucker/console.cpp b/engines/tucker/console.cpp index e0f2debc30..17ba2038d0 100644 --- a/engines/tucker/console.cpp +++ b/engines/tucker/console.cpp @@ -11,7 +11,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License @@ -26,6 +26,7 @@ namespace Tucker { TuckerConsole::TuckerConsole(TuckerEngine *vm) : _vm(vm) { + assert(_vm); } TuckerConsole::~TuckerConsole() { diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp index 5139620727..351444a1db 100644 --- a/engines/wintermute/base/font/base_font_bitmap.cpp +++ b/engines/wintermute/base/font/base_font_bitmap.cpp @@ -478,7 +478,7 @@ bool BaseFontBitmap::loadBuffer(byte *buffer) { _widths[spaceChar] = spaceWidth; } else { if (_widths[spaceChar] == expandWidth || _widths[spaceChar] == 0) { - _widths[spaceChar] = (_widths['m'] + _widths['i']) / 2; + _widths[spaceChar] = (_widths[(uint)'m'] + _widths[(uint)'i']) / 2; } } } else { diff --git a/engines/wintermute/base/save_thumb_helper.h b/engines/wintermute/base/save_thumb_helper.h index 43cc7e39a7..0efae26a4a 100644 --- a/engines/wintermute/base/save_thumb_helper.h +++ b/engines/wintermute/base/save_thumb_helper.h @@ -44,7 +44,6 @@ public: BaseImage *_scummVMThumb; private: BaseImage *storeThumb(bool doFlip, int width, int height); - BaseImage *_richThumbnail; BaseGame *_gameRef; }; |