From 5ca69756651f438fe09e64a706575084440881a7 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 27 Aug 2016 11:07:49 +0200 Subject: DM: Remove custom warning function --- engines/dm/dm.cpp | 19 ------------------- engines/dm/dm.h | 2 -- engines/dm/eventman.cpp | 2 +- engines/dm/eventman.h | 2 +- engines/dm/gfx.cpp | 8 ++++---- engines/dm/gfx.h | 2 +- engines/dm/group.cpp | 2 +- engines/dm/loadsave.cpp | 3 +-- engines/dm/sounds.cpp | 10 +++++++--- engines/dm/text.h | 4 ++-- 10 files changed, 18 insertions(+), 36 deletions(-) diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 92d09148ea..753b6cb253 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -64,25 +64,6 @@ #include namespace DM { -void warning(bool repeat, const char *s, ...) { - va_list va; - - va_start(va, s); - Common::String output = Common::String::vformat(s, va); - va_end(va); - - if (repeat) { - ::warning("%s", output.c_str()); - } else { - static Common::Array stringsPrinted; - - if (Common::find(stringsPrinted.begin(), stringsPrinted.end(), s) == stringsPrinted.end()) { - stringsPrinted.push_back(output); - ::warning("%s", output.c_str()); - } - } -} - const char *debugGetDirectionName(Direction dir) { static const char *directionNames[] = {"North", "East", "South", "West"}; if (dir < 0 || dir > 3) diff --git a/engines/dm/dm.h b/engines/dm/dm.h index 921197fd5e..f83f477089 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -104,8 +104,6 @@ struct DMADGameDescription { OriginalSavePlatform _origPlatformToAccept[k_savePlatform_total + 1]; }; -void warning(bool repeat, const char *s, ...); - enum Direction { kDirNorth = 0, kDirEast = 1, diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 39f74e53ab..c267b735e2 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -390,7 +390,7 @@ EventManager::EventManager(DMEngine *vm) : _vm(vm) { _primaryKeyboardInput = nullptr; _secondaryKeyboardInput = nullptr; _ignoreMouseMovements = false; - warning(false, "_g587_hideMousePointerRequestCount should start with value 1"); + warning("_g587_hideMousePointerRequestCount should start with value 1"); _hideMousePointerRequestCount = 0; _mouseButtonStatus = 0; _highlightScreenBox.setToZero(); diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h index 5686e50be7..92d055cb46 100644 --- a/engines/dm/eventman.h +++ b/engines/dm/eventman.h @@ -288,7 +288,7 @@ public: void waitForMouseOrKeyActivity(); // @ F0541_INPUT_WaitForMouseOrKeyboardActivity void commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2); // @ F0362_COMMAND_HighlightBoxEnable void highlightBoxDisable(); // @ F0363_COMMAND_HighlightBoxDisable - void highlightScreenBox(int16 x1, int16 x2, int16 y1, int16 y2) { warning(false, "STUB METHOD: highlightScreenBox"); } // @ F0006_MAIN_HighlightScreenBox + void highlightScreenBox(int16 x1, int16 x2, int16 y1, int16 y2) { warning("STUB METHOD: highlightScreenBox"); } // @ F0006_MAIN_HighlightScreenBox KeyboardInput _primaryKeyboardInputInterface[7]; // @ G0458_as_Graphic561_PrimaryKeyboardInput_Interface KeyboardInput _secondaryKeyboardInputMovement[19]; // @ G0459_as_Graphic561_SecondaryKeyboardInput_Movement diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index 506a2e057e..d4023056e2 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -863,7 +863,7 @@ void DisplayMan::blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask int16 lastUnitIndex, int16 firstUnitIndex, int16 destByteWidth, Color transparent, int16 xPos, int16 yPos, int16 destHeight, int16 height2) { // make sure to take care of inclusive boundaries, color can have 0x8000 flag to not use mask - warning(false, "STUB: f133_blitBoxFilledWithMaskedBitmap"); + warning("STUB: f133_blitBoxFilledWithMaskedBitmap"); } @@ -2746,8 +2746,8 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex void DisplayMan::blitToBitmapShrinkWithPalChange(byte *srcBitmap, byte *destBitmap, int16 srcPixelWidth, int16 srcHeight, int16 destPixelWidth, int16 destHeight, byte *palChange) { - warning(false, "DUMMY CODE: f129_blitToBitmapShrinkWithPalChange"); - warning(false, "MISSING CODE: No palette change takes place in f129_blitToBitmapShrinkWithPalChange"); + warning("DUMMY CODE: f129_blitToBitmapShrinkWithPalChange"); + warning("MISSING CODE: No palette change takes place in f129_blitToBitmapShrinkWithPalChange"); destPixelWidth = (destPixelWidth + 1) & 0xFFFE; @@ -3668,7 +3668,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; } blitBoxFilledWithMaskedBitmap(bitmapRedBanana, _bitmapViewport, 0, getDerivedBitmap(k0_DerivedBitmapViewport), boxExplosionPatternD0C, _vm->getRandomNumber(4) + 87, _vm->getRandomNumber(64), k112_byteWidthViewport, Color(k0x0080_BlitDoNotUseMask | k10_ColorFlesh), 0, 0, 136, 93); addDerivedBitmap(k0_DerivedBitmapViewport); - warning(false, "DISABLED CODE: f480_releaseBlock in f115_cthulhu"); + warning("DISABLED CODE: f480_releaseBlock in drawObjectsCreaturesProjectilesExplosions"); //f480_releaseBlock(k0_DerivedBitmapViewport | 0x8000); } else { int16 explosionScale; diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h index 508d4d89ab..44e75abbc2 100644 --- a/engines/dm/gfx.h +++ b/engines/dm/gfx.h @@ -821,7 +821,7 @@ public: uint16 getDarkenedColor(uint16 RGBcolor); void startEndFadeToPalette(uint16 *P0849_pui_Palette); // @ F0436_STARTEND_FadeToPalette void buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom); // @ F0508_AMIGA_BuildPaletteChangeCopperList - void shadeScreenBox(Box* box, Color color) { warning(false, "STUB METHOD: shadeScreenBox"); } // @ F0136_VIDEO_ShadeScreenBox + void shadeScreenBox(Box* box, Color color) { warning("STUB METHOD: shadeScreenBox"); } // @ F0136_VIDEO_ShadeScreenBox private: void initConstants(); diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index f0a28a12a2..41aefbb641 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -1378,7 +1378,7 @@ void GroupMan::setGroupDirection(ActiveGroup *activeGroup, int16 dir, int16 crea } void GroupMan::addGroupEvent(TimelineEvent *event, uint32 time) { - warning(false, "potentially dangerous cast to uint32 below"); + warning("potentially dangerous cast to uint32 below"); if (time < (uint32)filterTime(event->_mapTime)) { event->_type -= 5; event->_C._ticks = filterTime(event->_mapTime) - time; diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index 5091c00436..302d7ef01f 100644 --- a/engines/dm/loadsave.cpp +++ b/engines/dm/loadsave.cpp @@ -78,8 +78,7 @@ LoadgameResponse DMEngine::loadgame(int16 slot) { SaveGameHeader header; readSaveGameHeader(file, &header); - warning(false, "MISSING CODE: missing check for matching format and platform in save in f435_loadgame"); - + warning("MISSING CODE: missing check for matching format and platform in save in f435_loadgame"); dmSaveHeader._saveTarget = (SaveTarget)file->readSint32BE(); dmSaveHeader._saveVersion = file->readSint32BE(); diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp index 886e5fd2fc..421c299a15 100644 --- a/engines/dm/sounds.cpp +++ b/engines/dm/sounds.cpp @@ -41,9 +41,13 @@ namespace DM { SoundMan* SoundMan::getSoundMan(DMEngine* vm, const DMADGameDescription* gameVersion) { switch (gameVersion->_desc.platform) { - default: warning(false, "Unknown platform, using default Amiga SoundMan"); - case Common::kPlatformAmiga: return new SoundMan(vm); - case Common::kPlatformAtariST: return new SoundMan_Atari(vm); + default: + warning("Unknown platform, using default Amiga SoundMan"); + // No break on purpose + case Common::kPlatformAmiga: + return new SoundMan(vm); + case Common::kPlatformAtariST: + return new SoundMan_Atari(vm); } } diff --git a/engines/dm/text.h b/engines/dm/text.h index 55392a1551..b6049d7659 100644 --- a/engines/dm/text.h +++ b/engines/dm/text.h @@ -64,9 +64,9 @@ public: void clearExpiredRows(); // @ F0044_TEXT_MESSAGEAREA_ClearExpiredRows void printEndGameString(int16 x, int16 y, Color textColor, char *text); // @ F0443_STARTEND_EndgamePrintString bool isTextScrolling(TextScroller *scroller, bool waitEndOfScrolling) { - warning(false, "STUB METHOD: isTextScrolling"); return true; + warning("STUB METHOD: isTextScrolling"); return true; } // @ F0561_SCROLLER_IsTextScrolling - void setScrollerCommand(TextScroller *scroller, int16 command) { warning(false, "STUB METHOD: f560_SCROLLER_setCommand"); } // @ F0560_SCROLLER_SetCommand + void setScrollerCommand(TextScroller *scroller, int16 command) { warning("STUB METHOD: f560_SCROLLER_setCommand"); } // @ F0560_SCROLLER_SetCommand void clearAllRows(); // @ F0043_TEXT_MESSAGEAREA_ClearAllRows }; -- cgit v1.2.3