Skip to content

Commit

Permalink
DM: Clear check some warnings, complete minor functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent 6aabe84 commit 80f2199
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
3 changes: 1 addition & 2 deletions engines/dm/champion.cpp
Expand Up @@ -2216,8 +2216,7 @@ void ChampionMan::f292_drawChampionState(ChampionIndex champIndex) {
strcat(_vm->_g353_stringBuildBuffer, "/");
maxLoad = (f309_getMaximumLoad(curChampion) + 5) / 10;
strcat(_vm->_g353_stringBuildBuffer, f288_getStringFromInteger(maxLoad, true, 3).c_str());
warning(false, "Possibly wrong localization");
strcat(_vm->_g353_stringBuildBuffer, " KG"); // this line
strcat(_vm->_g353_stringBuildBuffer, " KG");
_vm->_textMan->f52_printToViewport(148, 132, loadColor, _vm->_g353_stringBuildBuffer);
setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
}
Expand Down
12 changes: 1 addition & 11 deletions engines/dm/dm.cpp
Expand Up @@ -427,14 +427,6 @@ Common::Error DMEngine::run() {
}

void DMEngine::f2_gameloop() {
//HACK: Remove this block to get real starting position in the Hall of Champions
if (_g298_newGame) {
warning(false, "DUMMY CODE: SETTING PARTY POS AND DIRECTION");
_dungeonMan->_g306_partyMapX = 9;
_dungeonMan->_g307_partyMapY = 9;
_dungeonMan->_g308_partyDir = kDirWest;
}

_canLoadFromGMM = true;
_g318_waitForInputMaxVerticalBlankCount = 10;
while (true) {
Expand Down Expand Up @@ -471,8 +463,7 @@ void DMEngine::f2_gameloop() {

if (!_inventoryMan->_g432_inventoryChampionOrdinal && !_championMan->_g300_partyIsSleeping) {
Box box(0, 223, 0, 135);
warning(false, "DUMMY CODE: clearing screen to black");
_displayMan->f135_fillBoxBitmap(_displayMan->_g296_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport, k136_heightViewport); // dummy code
_displayMan->f135_fillBoxBitmap(_displayMan->_g296_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport, k136_heightViewport); // (possibly dummy code)
_displayMan->f128_drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY);
if (_g325_setMousePointerToObjectInMainLoop) {
_g325_setMousePointerToObjectInMainLoop = false;
Expand Down Expand Up @@ -818,7 +809,6 @@ void DMEngine::f439_drawEntrance() {
// note, a global variable is used here in the original
_displayMan->f466_loadIntoBitmap(k4_entranceGraphicIndice, _displayMan->_g348_bitmapScreen);
_displayMan->f128_drawDungeon(kDirSouth, 2, 0);
warning(false, "IGNORED CODE: G0324_B_DrawViewportRequested = false;");

if (!_savedScreenForOpenEntranceDoors)
_savedScreenForOpenEntranceDoors = new byte[k200_heightScreen * k160_byteWidthScreen * 2];
Expand Down
15 changes: 15 additions & 0 deletions engines/dm/eventman.cpp
Expand Up @@ -314,6 +314,7 @@ EventManager::EventManager(DMEngine *vm) : _vm(vm) {
warning(false, "_g587_hideMousePointerRequestCount should start with value 1");
_g587_hideMousePointerRequestCount = 0;
_g558_mouseButtonStatus = 0;
_highlightScreenBox.setToZero();
}

EventManager::~EventManager() {
Expand Down Expand Up @@ -1556,4 +1557,18 @@ void EventManager::f541_waitForMouseOrKeyActivity() {
_vm->_displayMan->updateScreen();
}
}

void EventManager::f362_commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2) {
_highlightScreenBox = Box(x1, x2, y1, y2);
f6_highlightScreenBox(x1, x2, y1, y2);
_g341_highlightBoxEnabled = true;
}

void EventManager::f363_highlightBoxDisable() {
if (_g341_highlightBoxEnabled == true) {
f6_highlightScreenBox(_highlightScreenBox._x1, _highlightScreenBox._x2, _highlightScreenBox._y1, _highlightScreenBox._y2);
_g341_highlightBoxEnabled = false;
}
}

} // end of namespace DM
5 changes: 3 additions & 2 deletions engines/dm/eventman.h
Expand Up @@ -260,6 +260,7 @@ class EventManager {
bool f375_processType80_clickDungeonView_isLeaderHandObjThrown(int16 posX, int16 posY); // @ F0375_COMMAND_ProcessType80_ClickInDungeonView_IsLeaderHandObjectThrown
void setMousePointerFromSpriteData(byte* mouseSprite);

Box _highlightScreenBox; // @ G0336_i_HighlightBoxX1
public:
explicit EventManager(DMEngine *vm);
~EventManager();
Expand Down Expand Up @@ -319,8 +320,8 @@ class EventManager {
void f371_commandProcessType111To115_ClickInActionArea(int16 posX, int16 posY); // @ F0371_COMMAND_ProcessType111To115_ClickInActionArea_CPSE
void f544_resetPressingEyeOrMouth(); // @ F0544_INPUT_ResetPressingEyeOrMouth
void f541_waitForMouseOrKeyActivity(); // @ F0541_INPUT_WaitForMouseOrKeyboardActivity
void f362_commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2) { warning(false, "STUB METHOD: f362_commandHighlightBoxEnable"); }// @ F0362_COMMAND_HighlightBoxEnable
void f363_highlightBoxDisable() { warning(false, "STUB METHOD: f363_highlightBoxDisable"); } // @ F0363_COMMAND_HighlightBoxDisable
void f362_commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2); // @ F0362_COMMAND_HighlightBoxEnable
void f363_highlightBoxDisable(); // @ F0363_COMMAND_HighlightBoxDisable
void f6_highlightScreenBox(int16 x1, int16 x2, int16 y1, int16 y2) { warning(false, "STUB METHOD: f6_highlightScreenBox"); } // @ F0006_MAIN_HighlightScreenBox
};

Expand Down
7 changes: 3 additions & 4 deletions engines/dm/gfx.cpp
Expand Up @@ -2147,7 +2147,8 @@ void DisplayMan::f128_drawDungeon(Direction dir, int16 posX, int16 posY) {
}

void DisplayMan::f98_drawFloorAndCeiling() {
warning(false, "f98_drawFloorAndCeiling doesn't do anything");
Box box(0, 223, 0, 36);
f135_fillBoxBitmap(_g296_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport, k136_heightViewport);
_g297_drawFloorAndCeilingRequested = false;
}

Expand Down Expand Up @@ -3735,9 +3736,7 @@ byte* DisplayMan::f492_getDerivedBitmap(int16 derivedBitmapIndex) {
return _g638_derivedBitmaps[derivedBitmapIndex];
}

void DisplayMan::f493_addDerivedBitmap(int16 derivedBitmapIndex) {
warning(false, "f493_addDerivedBitmap DOES NOTHING");
}
void DisplayMan::f493_addDerivedBitmap(int16 derivedBitmapIndex) {}

void DisplayMan::f480_releaseBlock(uint16 index) {
delete[] _g638_derivedBitmaps[index];
Expand Down
3 changes: 1 addition & 2 deletions engines/dm/inventory.cpp
Expand Up @@ -246,8 +246,7 @@ void InventoryMan::f346_drawPanelResurrectReincarnate() {
}

void InventoryMan::f347_drawPanel() {
warning(false, "possible reintroduction of BUG0_48");
f334_closeChest(); // possibility of BUG0_48
f334_closeChest();

ChampionMan &cm = *_vm->_championMan;
if (cm._g299_candidateChampionOrdinal) {
Expand Down

0 comments on commit 80f2199

Please sign in to comment.