Skip to content

Commit

Permalink
DM: Remove custom warning function
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Aug 27, 2016
1 parent bf5875d commit 5ca6975
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 36 deletions.
19 changes: 0 additions & 19 deletions engines/dm/dm.cpp
Expand Up @@ -64,25 +64,6 @@
#include <gui/saveload.h>

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<Common::String> 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)
Expand Down
2 changes: 0 additions & 2 deletions engines/dm/dm.h
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion engines/dm/eventman.cpp
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion engines/dm/eventman.h
Expand Up @@ -288,7 +288,7 @@ class EventManager {
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
Expand Down
8 changes: 4 additions & 4 deletions engines/dm/gfx.cpp
Expand Up @@ -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");
}


Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion engines/dm/gfx.h
Expand Up @@ -821,7 +821,7 @@ class DisplayMan {
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();
Expand Down
2 changes: 1 addition & 1 deletion engines/dm/group.cpp
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions engines/dm/loadsave.cpp
Expand Up @@ -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();
Expand Down
10 changes: 7 additions & 3 deletions engines/dm/sounds.cpp
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions engines/dm/text.h
Expand Up @@ -64,9 +64,9 @@ class TextMan {
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
};

Expand Down

0 comments on commit 5ca6975

Please sign in to comment.