HDB: Added more debug output and hid some verbose stubs

This commit is contained in:
Eugene Sandulenko 2019-06-26 08:52:37 +02:00
parent 37a393e9e1
commit aa793bdcfd
5 changed files with 23 additions and 14 deletions

View File

@ -193,8 +193,7 @@ void AI::processCines() {
warning("Can't locate '%s' in moveEntity", _cine[i]->title);
}
} else {
debug(3, "C_MOVEENTITY: _cine[%d]->e->tileX: %d, _cine[%d]->e->goalX: %d", i, _cine[i]->e->tileX, i, _cine[i]->e->goalX);
debug(3, "C_MOVEENTITY: _cine[%d]->e->tileY: %d, _cine[%d]->e->goalY: %d", i, _cine[i]->e->tileY, i, _cine[i]->e->goalY);
debug(3, "C_MOVEENTITY: %d, %s tileX: %d, goalX: %d tileY %d, goalY: %d", i, AIType2Str(_cine[i]->e->type), _cine[i]->e->tileX, _cine[i]->e->goalX, _cine[i]->e->tileY, _cine[i]->e->goalY);
if (!_cine[i]->e->goalX) {
complete = true;
}

View File

@ -1209,7 +1209,7 @@ void AI::drawEnts(int x, int y, int w, int h) {
case AI_VORTEXIAN:
if (e->draw)
e->draw->drawMasked(e->x - x + e->drawXOff, e->y - y + e->drawYOff);
debug(1, "STUB: AI::drawEnts: Replace Masked Blitting with Alpha Masked Blitting");
debug(9, "STUB: AI::drawEnts: Replace Masked Blitting with Alpha Masked Blitting");
break;
case AI_GUY: // Draw Player Last
break;
@ -1259,16 +1259,21 @@ void AI::drawEnts(int x, int y, int w, int h) {
}
void AI::drawLevel2Ents() {
int debug = 0; //game.GetDebug(); // FIXME
int debugging = 0; //game.GetDebug(); // FIXME
for (int i = 0; i < _numLevel2Ents; i++) {
// call custom drawing code?
if (_entsLevel2[i].aiDraw)
if (_entsLevel2[i].aiDraw) {
debug(5, "AI::drawLevel2Ents: entity %s(%d) at %d,%d", AIType2Str(_entsLevel2[i].e->type), _entsLevel2[i].e->type, _entsLevel2[i].x, _entsLevel2[i].y);
_entsLevel2[i].aiDraw(_entsLevel2[i].e, _entsLevel2[i].x, _entsLevel2[i].y);
else if (_entsLevel2[i].draw)
} else if (_entsLevel2[i].draw) {
debug(5, "AI::drawLevel2Ents: tile '%s' at %d,%d", _entsLevel2[i].draw->getName(), _entsLevel2[i].x, _entsLevel2[i].y);
_entsLevel2[i].draw->drawMasked(_entsLevel2[i].x, _entsLevel2[i].y);
else if (debug)
} else if (debugging) {
_debugQMark->drawMasked(_entsLevel2[i].x, _entsLevel2[i].y );
}
if (_entsLevel2[i].stunnedWait)
g_hdb->_ai->_stunnedGfx[_stunAnim]->drawMasked(_entsLevel2[i].x , _entsLevel2[i].y);
@ -1436,11 +1441,13 @@ AIEntity *AI::legalMove(int tileX, int tileY, int level, int *result) {
if (hit && hit->state != STATE_FLOATING)
// If player and entity are not at the same level, are they on stairs?
if (hit->level != level)
if (level == 1 && !(bgFlags & kFlagStairTop))
if (hit->level != level) {
if (level == 1 && !(bgFlags & kFlagStairTop)) {
hit = NULL;
else if (level == 1 && !(bgFlags & kFlagStairBot))
} else if (level == 1 && !(bgFlags & kFlagStairBot)) {
hit = NULL;
}
}
if (level == 1) {
if (bgFlags & kFlagSolid) {

View File

@ -128,7 +128,7 @@ void aiPlayerInit2(AIEntity *e) {
}
void aiPlayerAction(AIEntity *e) {
warning("STUB: AI: aiPlayerAction required");
debug(9, "STUB: AI: aiPlayerAction required");
}
void aiPlayerDraw(AIEntity *e, int mx, int my) {
@ -226,7 +226,7 @@ void aiSergeantInit2(AIEntity *e) {
void aiSergeantAction(AIEntity *e) {
if (e->goalX) {
warning("AI-PLAYER: aiSergeantAction: Play SND_FOOTSTEPS sounds");
debug(9, "STUB: AI-PLAYER: aiSergeantAction: Play SND_FOOTSTEPS sounds");
g_hdb->_ai->animateEntity(e);
} else
g_hdb->_ai->animEntFrames(e);

View File

@ -190,6 +190,8 @@ public:
uint _width, _height;
char *getName() { return _name; }
private:
char _name[64];
@ -210,6 +212,7 @@ public:
uint32 _flags;
char *getName() { return _name; }
private:
char _name[64];

View File

@ -702,7 +702,7 @@ void Map::drawGratings() {
g_hdb->_drawMan->getTile(_gratings[i]->tile)->drawMasked(_gratings[i]->x, _gratings[i]->y);
}
debug(1, "Gratings Count: %d", _numGratings);
debug(8, "Gratings Count: %d", _numGratings);
}
void Map::drawForegrounds() {
@ -710,7 +710,7 @@ void Map::drawForegrounds() {
g_hdb->_drawMan->getTile(_foregrounds[i]->tile)->drawMasked(_foregrounds[i]->x, _foregrounds[i]->y);
}
debug(1, "Foregrounds Count: %d", _numForegrounds);
debug(8, "Foregrounds Count: %d", _numForegrounds);
}
uint32 Map::getMapBGTileFlags(int x, int y) {