DM: Remove some warnings

This commit is contained in:
Bendegúz Nagy 2016-08-20 13:25:37 +02:00
parent ca267da97c
commit d97a8905cc
10 changed files with 8 additions and 50 deletions

View file

@ -1449,7 +1449,6 @@ void ChampionMan::f319_championKill(uint16 champIndex) {
if (_vm->M0_indexToOrdinal(curChampionIconIndex) == _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap) {
_vm->_eventMan->_g598_mousePointerBitmapUpdated = true;
_vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->M0_indexToOrdinal(kM1_ChampionNone);
warning(false, "IGNORED CODE:G0592_B_BuildMousePointerScreenAreaRequested = true");
}
if (curChampion->_poisonEventCount)
@ -2052,7 +2051,6 @@ uint16 ChampionMan::f306_getStaminaAdjustedValue(Champion *champ, int16 val) {
int16 currStamina = champ->_currStamina;
int16 halfMaxStamina = champ->_maxStamina / 2;
if (currStamina < halfMaxStamina) {
warning(false, "Possible undefined behavior in the original code");
val /= 2;
return val + ((uint32)val * (uint32)currStamina) / halfMaxStamina;
}

View file

@ -147,16 +147,6 @@ int16 M38_distance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2) {
}
DMEngine::DMEngine(OSystem *syst, const ADGameDescription *desc) : Engine(syst), _console(nullptr), _gameVersion(desc) {
// Do not load data files
// Do not initialize graphics here
// Do not initialize audio devices here
// Do these from run
//Specify all default directories
//const Common::FSNode gameDataDir(ConfMan.get("example"));
//SearchMan.addSubDirectoryMatching(gameDataDir, "example2");
DebugMan.addDebugChannel(kDMDebugExample, "example", "example desc");
// register random source
_rnd = new Common::RandomSource("dm");

View file

@ -166,14 +166,6 @@ enum Cell {
#define k255_mapIndexEntrance 255 // @ C255_MAP_INDEX_ENTRANCE
enum {
// engine debug channels
kDMDebugExample = 1 << 0,
kDMDebugUselessCode = 1 << 1,
kDMDebugOftenCalledWarning = 2 << 2
};
//TODO: Directly use CLIP
template<typename T>

View file

@ -399,14 +399,6 @@ void EventManager::f68_setPointerToObject(byte* bitmap) {
_vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(bitmap, _gK190_mousePointerTempBuffer, 16, 16, 16, 16, palChangesMousePointerIcon);
_vm->_displayMan->f132_blitToBitmap(_gK190_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObject, 0, 0, 8, 16, k0_ColorBlack, 16, 18);
/*
warning(false, "TODO - Call f129_blitToBitmapShrinkWithPalChange");
// dummy code
_vm->_displayMan->f132_blitToBitmap(bitmap, L0051_puc_Bitmap, boxMousePointerObjectShadow, 0, 0, 8, 16, kM1_ColorNoTransparency, 16, 18);
_vm->_displayMan->f132_blitToBitmap(bitmap, L0051_puc_Bitmap, boxMousePointerObject, 0, 0, 8, 16, k0_ColorBlack, 16, 18);
*/
_gK100_preventBuildPointerScreenArea = false;
f73_buildpointerScreenArea(_mousePos.x, _mousePos.y);
}
@ -464,9 +456,6 @@ void EventManager::f73_buildpointerScreenArea(int16 mousePosX, int16 mousePosY)
0x07, 0xFF, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// if (_gK100_preventBuildPointerScreenArea)
// return;
_gK100_preventBuildPointerScreenArea = true;
if (_g599_useChampionIconOrdinalAsMousePointerBitmap) {
if ((mousePosY > 28) || (mousePosX < 274)) {

View file

@ -2738,14 +2738,16 @@ bool DisplayMan::f107_isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWall
void DisplayMan::f129_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");
if (destPixelWidth % 8)
destPixelWidth = (destPixelWidth / 8) * 8 + 8;
uint32 scaleX = (kScaleThreshold * srcPixelWidth) / destPixelWidth;
uint32 scaleY = (kScaleThreshold * srcHeight) / destHeight;
warning(false, "MISSING CODE: No palette change takes place in f129_blitToBitmapShrinkWithPalChange");
// Loop through drawing output lines
for (uint32 destY = 0, scaleYCtr = 0; destY < (uint32)destHeight; ++destY, scaleYCtr += scaleY) {

View file

@ -63,6 +63,7 @@ GroupMan::GroupMan(DMEngine *vm) : _vm(vm) {
_g376_maxActiveGroupCount = 60;
_g375_activeGroups = nullptr;
_g377_currActiveGroupCount = 0;
_g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime = 0;
}
GroupMan::~GroupMan() {
@ -1342,11 +1343,9 @@ int32 GroupMan::f179_getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16
void GroupMan::f205_setDirection(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, bool twoHalfSquareSizedCreatures) {
uint16 L0435_ui_GroupDirections;
static int32 G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime; /* These two variables are used to prevent setting direction of half square sized creatures twice at the same game time */
static ActiveGroup *G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup;
warning(false, "TODO: Move G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime to GroupMan so it's properly initialized");
if (twoHalfSquareSizedCreatures && (_vm->_g313_gameTime == G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime) && (activeGroup == G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup)) {
if (twoHalfSquareSizedCreatures && (_vm->_g313_gameTime == _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime) && (activeGroup == G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup)) {
return;
}
if (M21_normalizeModulo4(M50_getCreatureValue(L0435_ui_GroupDirections = activeGroup->_directions, creatureIndex) - dir) == 2) { /* If current and new direction are opposites then change direction only one step at a time */
@ -1356,7 +1355,7 @@ void GroupMan::f205_setDirection(ActiveGroup *activeGroup, int16 dir, int16 crea
}
if (twoHalfSquareSizedCreatures) {
L0435_ui_GroupDirections = f178_getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex ^ 1, dir); /* Set direction of the second half square sized creature */
G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime = _vm->_g313_gameTime;
_g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime = _vm->_g313_gameTime;
G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup = activeGroup;
}
activeGroup->_directions = (Direction)L0435_ui_GroupDirections;

View file

@ -171,6 +171,7 @@ class GroupMan {
bool _g389_groupMovementBlockedByDoor; // @ G0389_B_GroupMovementBlockedByDoor
bool _g390_groupMovementBlockedByParty; // @ G0390_B_GroupMovementBlockedByParty
bool _g387_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter; // @ G0387_B_GroupMovementBlockedByWallStairsPitFakeWallFluxcageTeleporter
int32 _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime; // @ G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime
public:
uint16 _g376_maxActiveGroupCount; // @ G0376_ui_MaximumActiveGroupCount
ActiveGroup *_g375_activeGroups; // @ G0375_ps_ActiveGroups

View file

@ -303,7 +303,6 @@ void InventoryMan::f334_closeChest() {
}
void InventoryMan::f340_drawPanelScrollTextLine(int16 yPos, char* text) {
warning(false, "CHANGE5_03_IMPROVEMENT");
for (char* iter = text; *iter != '\0'; ++iter) {
if ((*iter >= 'A') && (*iter <= 'Z')) {
*iter -= 64;
@ -330,7 +329,6 @@ void InventoryMan::f341_drawPanelScroll(Scroll* scroll) {
charRed++;
char *charGreen = charRed; // first char of the second line
while (*charGreen) {
warning(false, "BUG0_47");
/* BUG0_47 Graphical glitch when you open a scroll. If there is a single line of text in a scroll
(with no carriage return) then charGreen points to undefined data. This may result in a graphical
glitch and also corrupt other memory. This is not an issue in the original dungeons where all
@ -369,7 +367,6 @@ void InventoryMan::f333_openAndDrawChest(Thing thingToOpen, Container* chest, bo
if (_g426_openChest == thingToOpen)
return;
warning(false, "CHANGE8_09_FIX");
if (_g426_openChest != Thing::_none)
f334_closeChest(); // CHANGE8_09_FIX
@ -383,7 +380,6 @@ void InventoryMan::f333_openAndDrawChest(Thing thingToOpen, Container* chest, bo
Thing thing = chest->getSlot();
int16 thingCount = 0;
while (thing != Thing::_endOfList) {
warning(false, "CHANGE8_08_FIX");
if (++thingCount > 8)
break; // CHANGE8_08_FIX, make sure that no more than the first 8 objects in a chest are drawn

View file

@ -79,19 +79,11 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
_championMan->_g414_leaderHandObject = Thing::_none;
_g525_gameId = ((int32)getRandomNumber(65536)) * getRandomNumber(65536);
} else {
warning(false, "MISSING CODE: missing check for matching _g525_gameId in f435_loadgame");
/*if (_vm->_g523_restartGameRequest && (L1372_s_SaveHeader.GameID != _vm->_g525_gameId)) {
L1367_pc_Message = G0546_pc_THATSNOTTHESAMEGAME;
goto T0435004;
}*/
SaveGameHeader header;
readSaveGameHeader(file, &header);
warning(false, "MISSING CODE: missing check for matching format and platform in save in f435_loadgame");
dmSaveHeader._saveFormat = file->readSint16BE();
dmSaveHeader._saveAndPlayChoice = file->readSint16BE();
dmSaveHeader._gameId = file->readSint32BE();

View file

@ -880,7 +880,6 @@ bool MenuMan::f391_didClickTriggerAction(int16 actionListIndex) {
L1199_ps_Champion = &_vm->_championMan->_gK71_champions[L1196_ui_ChampionIndex = _vm->M1_ordinalToIndex(_vm->_championMan->_g506_actingChampionOrdinal)];
if (actionListIndex == -1) {
warning(false, "possible bug in f391_didClickTriggerAction");
// L1198_B_ClickTriggeredAction is set to -1 since booleans are stored in int16 in the original
L1198_B_ClickTriggeredAction = true;
} else {