mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 13:13:58 +00:00
FULLPIPE: Split all debug output by channels
This commit is contained in:
parent
1fb5f55b70
commit
6ac435099c
@ -83,7 +83,7 @@ void BehaviorManager::updateBehaviors() {
|
||||
if (!_isActive)
|
||||
return;
|
||||
|
||||
debug(4, "BehaviorManager::updateBehaviors()");
|
||||
debugC(4, kDebugAnimation, "BehaviorManager::updateBehaviors()");
|
||||
for (uint i = 0; i < _behaviors.size(); i++) {
|
||||
BehaviorInfo *beh = _behaviors[i];
|
||||
|
||||
@ -122,7 +122,7 @@ void BehaviorManager::updateBehaviors() {
|
||||
}
|
||||
|
||||
void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *entry) {
|
||||
debug(4, "BehaviorManager::updateBehavior() %d", entry->_movesCount);
|
||||
debugC(4, kDebugAnimation, "BehaviorManager::updateBehavior() %d", entry->_movesCount);
|
||||
for (int i = 0; i < entry->_movesCount; i++) {
|
||||
BehaviorMove *bhi = entry->_behaviorMoves[i];
|
||||
if (!(bhi->_flags & 1)) {
|
||||
@ -144,7 +144,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *e
|
||||
}
|
||||
|
||||
void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorAnim *bhe) {
|
||||
debug(4, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName));
|
||||
debugC(4, kDebugAnimation, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName));
|
||||
|
||||
MessageQueue *mq = 0;
|
||||
|
||||
@ -236,7 +236,7 @@ void BehaviorInfo::clear() {
|
||||
}
|
||||
|
||||
void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) {
|
||||
debug(4, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName));
|
||||
debugC(4, kDebugAnimation, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName));
|
||||
|
||||
clear();
|
||||
_animsCount = 1;
|
||||
@ -260,7 +260,7 @@ void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) {
|
||||
}
|
||||
|
||||
void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *ani) {
|
||||
debug(4, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName));
|
||||
debugC(4, kDebugAnimation, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName));
|
||||
|
||||
clear();
|
||||
|
||||
|
@ -203,6 +203,9 @@ void FullpipeEngine::initialize() {
|
||||
DebugMan.addDebugChannel(kDebugPathfinding, "path", "Pathfinding");
|
||||
DebugMan.addDebugChannel(kDebugDrawing, "drawing", "Drawing");
|
||||
DebugMan.addDebugChannel(kDebugLoading, "loading", "Scene loading");
|
||||
DebugMan.addDebugChannel(kDebugAnimation, "animation", "Animation");
|
||||
DebugMan.addDebugChannel(kDebugMemory, "memory", "Memory management");
|
||||
DebugMan.addDebugChannel(kDebugEvents, "events", "Event handling");
|
||||
|
||||
_globalMessageQueueList = new GlobalMessageQueueList;
|
||||
_behaviorManager = new BehaviorManager;
|
||||
@ -457,7 +460,7 @@ void FullpipeEngine::cleanup() {
|
||||
}
|
||||
|
||||
void FullpipeEngine::updateScreen() {
|
||||
debug(4, "FullpipeEngine::updateScreen()");
|
||||
debugC(4, kDebugDrawing, "FullpipeEngine::updateScreen()");
|
||||
|
||||
_mouseVirtX = _mouseScreenPos.x + _sceneRect.left;
|
||||
_mouseVirtY = _mouseScreenPos.y + _sceneRect.top;
|
||||
|
@ -51,7 +51,10 @@ enum FullpipeGameFeatures {
|
||||
enum AccessDebugChannels {
|
||||
kDebugPathfinding = 1 << 0,
|
||||
kDebugDrawing = 1 << 1,
|
||||
kDebugLoading = 1 << 2
|
||||
kDebugLoading = 1 << 2,
|
||||
kDebugAnimation = 1 << 3,
|
||||
kDebugMemory = 1 << 4,
|
||||
kDebugEvents = 1 << 5
|
||||
};
|
||||
|
||||
class BehaviorManager;
|
||||
|
@ -110,10 +110,10 @@ GameLoader::~GameLoader() {
|
||||
}
|
||||
|
||||
bool GameLoader::load(MfcArchive &file) {
|
||||
debug(1, "GameLoader::load()");
|
||||
debugC(1, kDebugLoading, "GameLoader::load()");
|
||||
|
||||
_gameName = file.readPascalString();
|
||||
debug(1, "_gameName: %s", _gameName);
|
||||
debugC(1, kDebugLoading, "_gameName: %s", _gameName);
|
||||
|
||||
_gameProject = new GameProject();
|
||||
|
||||
@ -126,13 +126,13 @@ bool GameLoader::load(MfcArchive &file) {
|
||||
}
|
||||
|
||||
_gameName = file.readPascalString();
|
||||
debug(1, "_gameName: %s", _gameName);
|
||||
debugC(1, kDebugLoading, "_gameName: %s", _gameName);
|
||||
|
||||
_inventory.load(file);
|
||||
|
||||
_interactionController->load(file);
|
||||
|
||||
debug(1, "sceneTag count: %d", _gameProject->_sceneTagList->size());
|
||||
debugC(1, kDebugLoading, "sceneTag count: %d", _gameProject->_sceneTagList->size());
|
||||
|
||||
_sc2array.resize(_gameProject->_sceneTagList->size());
|
||||
|
||||
@ -142,7 +142,7 @@ bool GameLoader::load(MfcArchive &file) {
|
||||
|
||||
snprintf(tmp, 11, "%04d.sc2", it->_sceneId);
|
||||
|
||||
debug(1, "sc: %s", tmp);
|
||||
debugC(1, kDebugLoading, "sc: %s", tmp);
|
||||
|
||||
_sc2array[i].loadFile((const char *)tmp);
|
||||
}
|
||||
@ -152,7 +152,7 @@ bool GameLoader::load(MfcArchive &file) {
|
||||
_field_FA = file.readUint16LE();
|
||||
_field_F8 = file.readUint16LE();
|
||||
|
||||
debug(1, "_field_FA: %d\n_field_F8: %d", _field_FA, _field_F8);
|
||||
debugC(1, kDebugLoading, "_field_FA: %d\n_field_F8: %d", _field_FA, _field_F8);
|
||||
|
||||
_gameVar = (GameVar *)file.readClass();
|
||||
|
||||
@ -357,7 +357,7 @@ bool preloadCallback(PreloadItem &pre, int flag) {
|
||||
}
|
||||
|
||||
bool GameLoader::preloadScene(int sceneId, int entranceId) {
|
||||
debug(0, "preloadScene(%d, %d), ", sceneId, entranceId);
|
||||
debugC(0, kDebugLoading, "preloadScene(%d, %d), ", sceneId, entranceId);
|
||||
|
||||
if (_preloadSceneId != sceneId || _preloadEntranceId != entranceId) {
|
||||
_preloadSceneId = sceneId;
|
||||
@ -455,13 +455,13 @@ void GameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAni
|
||||
if (picAniInfoCount <= 0)
|
||||
return;
|
||||
|
||||
debug(0, "GameLoader::applyPicAniInfos(sc, ptr, %d)", picAniInfoCount);
|
||||
debugC(0, kDebugAnimation, "GameLoader::applyPicAniInfos(sc, ptr, %d)", picAniInfoCount);
|
||||
|
||||
PictureObject *pict;
|
||||
StaticANIObject *ani;
|
||||
|
||||
for (int i = 0; i < picAniInfoCount; i++) {
|
||||
debug(7, "PicAniInfo: id: %d type: %d", picAniInfo[i]->objectId, picAniInfo[i]->type);
|
||||
debugC(7, kDebugAnimation, "PicAniInfo: id: %d type: %d", picAniInfo[i]->objectId, picAniInfo[i]->type);
|
||||
if (picAniInfo[i]->type & 2) {
|
||||
pict = sc->getPictureObjectById(picAniInfo[i]->objectId, picAniInfo[i]->field_8);
|
||||
if (pict) {
|
||||
@ -551,14 +551,14 @@ Sc2::Sc2() {
|
||||
}
|
||||
|
||||
bool Sc2::load(MfcArchive &file) {
|
||||
debug(5, "Sc2::load()");
|
||||
debugC(5, kDebugLoading, "Sc2::load()");
|
||||
|
||||
_sceneId = file.readUint16LE();
|
||||
|
||||
_motionController = (MotionController *)file.readClass();
|
||||
|
||||
_count1 = file.readUint32LE();
|
||||
debug(4, "count1: %d", _count1);
|
||||
debugC(4, kDebugLoading, "count1: %d", _count1);
|
||||
if (_count1 > 0) {
|
||||
_data1 = (int32 *)malloc(_count1 * sizeof(int32));
|
||||
|
||||
@ -570,7 +570,7 @@ bool Sc2::load(MfcArchive &file) {
|
||||
}
|
||||
|
||||
_defPicAniInfosCount = file.readUint32LE();
|
||||
debug(4, "defPicAniInfos: %d", _defPicAniInfosCount);
|
||||
debugC(4, kDebugLoading, "defPicAniInfos: %d", _defPicAniInfosCount);
|
||||
if (_defPicAniInfosCount > 0) {
|
||||
_defPicAniInfos = (PicAniInfo **)malloc(_defPicAniInfosCount * sizeof(PicAniInfo *));
|
||||
|
||||
@ -587,7 +587,7 @@ bool Sc2::load(MfcArchive &file) {
|
||||
_picAniInfosCount = 0;
|
||||
|
||||
_entranceDataCount = file.readUint32LE();
|
||||
debug(4, "_entranceData: %d", _entranceDataCount);
|
||||
debugC(4, kDebugLoading, "_entranceData: %d", _entranceDataCount);
|
||||
|
||||
if (_entranceDataCount > 0) {
|
||||
_entranceData = (EntranceInfo **)malloc(_entranceDataCount * sizeof(EntranceInfo *));
|
||||
@ -607,7 +607,7 @@ bool Sc2::load(MfcArchive &file) {
|
||||
}
|
||||
|
||||
bool PreloadItems::load(MfcArchive &file) {
|
||||
debug(5, "PreloadItems::load()");
|
||||
debugC(5, kDebugLoading, "PreloadItems::load()");
|
||||
|
||||
int count = file.readCount();
|
||||
|
||||
|
@ -58,7 +58,7 @@ Background::~Background() {
|
||||
}
|
||||
|
||||
bool Background::load(MfcArchive &file) {
|
||||
debug(5, "Background::load()");
|
||||
debugC(5, kDebugLoading, "Background::load()");
|
||||
_bgname = file.readPascalString();
|
||||
|
||||
int count = file.readUint16LE();
|
||||
@ -80,7 +80,7 @@ bool Background::load(MfcArchive &file) {
|
||||
|
||||
_bigPictureArray = (BigPicture ***)calloc(_bigPictureArray1Count, sizeof(BigPicture **));
|
||||
|
||||
debug(6, "bigPictureArray[%d][%d]", _bigPictureArray1Count, _bigPictureArray2Count);
|
||||
debugC(6, kDebugLoading, "bigPictureArray[%d][%d]", _bigPictureArray1Count, _bigPictureArray2Count);
|
||||
|
||||
for (int i = 0; i < _bigPictureArray1Count; i++) {
|
||||
_bigPictureArray[i] = (BigPicture **)calloc(_bigPictureArray2Count, sizeof(BigPicture *));
|
||||
@ -137,7 +137,7 @@ PictureObject::PictureObject(PictureObject *src) : GameObject(src) {
|
||||
}
|
||||
|
||||
bool PictureObject::load(MfcArchive &file, bool bigPicture) {
|
||||
debug(5, "PictureObject::load()");
|
||||
debugC(5, kDebugLoading, "PictureObject::load()");
|
||||
GameObject::load(file);
|
||||
|
||||
if (bigPicture)
|
||||
@ -282,7 +282,7 @@ GameObject::~GameObject() {
|
||||
}
|
||||
|
||||
bool GameObject::load(MfcArchive &file) {
|
||||
debug(5, "GameObject::load()");
|
||||
debugC(5, kDebugLoading, "GameObject::load()");
|
||||
_okeyCode = 0;
|
||||
_flags = 0;
|
||||
_field_20 = 0;
|
||||
@ -464,7 +464,7 @@ Picture::~Picture() {
|
||||
}
|
||||
|
||||
void Picture::freePicture() {
|
||||
debug(5, "Picture::freePicture(): file: %s", _memfilename);
|
||||
debugC(5, kDebugMemory, "Picture::freePicture(): file: %s", _memfilename);
|
||||
|
||||
if (_bitmap) {
|
||||
if (testFlags() && !_field_54) {
|
||||
@ -492,7 +492,7 @@ void Picture::freePixelData() {
|
||||
}
|
||||
|
||||
bool Picture::load(MfcArchive &file) {
|
||||
debug(5, "Picture::load()");
|
||||
debugC(5, kDebugLoading, "Picture::load()");
|
||||
MemoryObject::load(file);
|
||||
|
||||
_x = file.readUint32LE();
|
||||
@ -526,7 +526,7 @@ bool Picture::load(MfcArchive &file) {
|
||||
|
||||
getData();
|
||||
|
||||
debug(5, "Picture::load: loaded <%s>", _memfilename);
|
||||
debugC(5, kDebugLoading, "Picture::load: loaded <%s>", _memfilename);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -546,7 +546,7 @@ void Picture::setAOIDs() {
|
||||
}
|
||||
|
||||
void Picture::init() {
|
||||
debug(5, "Picture::init(), %s", _memfilename);
|
||||
debugC(5, kDebugLoading, "Picture::init(), %s", _memfilename);
|
||||
|
||||
MemoryObject::getData();
|
||||
|
||||
@ -567,7 +567,7 @@ Common::Point *Picture::getDimensions(Common::Point *p) {
|
||||
void Picture::getDibInfo() {
|
||||
int off = _dataSize & ~0xf;
|
||||
|
||||
debug(9, "Picture::getDibInfo: _dataSize: %d", _dataSize);
|
||||
debugC(9, kDebugLoading, "Picture::getDibInfo: _dataSize: %d", _dataSize);
|
||||
|
||||
if (!_dataSize) {
|
||||
warning("Picture::getDibInfo(): Empty data size");
|
||||
@ -605,7 +605,7 @@ void Picture::draw(int x, int y, int style, int angle) {
|
||||
int x1 = x;
|
||||
int y1 = y;
|
||||
|
||||
debug(7, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename);
|
||||
debugC(7, kDebugDrawing, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename);
|
||||
|
||||
if (x != -1)
|
||||
x1 = x;
|
||||
@ -620,7 +620,7 @@ void Picture::draw(int x, int y, int style, int angle) {
|
||||
return;
|
||||
|
||||
if ((_alpha & 0xff) < 0xff) {
|
||||
debug(7, "Picture:draw: alpha = %0x", _alpha);
|
||||
debugC(7, kDebugDrawing, "Picture:draw: alpha = %0x", _alpha);
|
||||
}
|
||||
|
||||
byte *pal = _paletteData;
|
||||
@ -784,7 +784,7 @@ Bitmap::~Bitmap() {
|
||||
}
|
||||
|
||||
void Bitmap::load(Common::ReadStream *s) {
|
||||
debug(5, "Bitmap::load()");
|
||||
debugC(5, kDebugLoading, "Bitmap::load()");
|
||||
|
||||
_x = s->readUint32LE();
|
||||
_y = s->readUint32LE();
|
||||
@ -795,8 +795,8 @@ void Bitmap::load(Common::ReadStream *s) {
|
||||
_dataSize = s->readUint32LE();
|
||||
_flags = s->readUint32LE();
|
||||
|
||||
debug(8, "Bitmap: x: %d y: %d w: %d h: %d dataSize: 0x%x", _x, _y, _width, _height, _dataSize);
|
||||
debug(8, "Bitmap: type: %s (0x%04x) flags: 0x%x", Common::tag2string(_type).c_str(), _type, _flags);
|
||||
debugC(8, kDebugLoading, "Bitmap: x: %d y: %d w: %d h: %d dataSize: 0x%x", _x, _y, _width, _height, _dataSize);
|
||||
debugC(8, kDebugLoading, "Bitmap: type: %s (0x%04x) flags: 0x%x", Common::tag2string(_type).c_str(), _type, _flags);
|
||||
}
|
||||
|
||||
bool Bitmap::isPixelHitAtPos(int x, int y) {
|
||||
@ -821,7 +821,7 @@ void Bitmap::decode(int32 *palette) {
|
||||
}
|
||||
|
||||
void Bitmap::putDib(int x, int y, int32 *palette, int alpha) {
|
||||
debug(7, "Bitmap::putDib(%d, %d)", x, y);
|
||||
debugC(7, kDebugDrawing, "Bitmap::putDib(%d, %d)", x, y);
|
||||
|
||||
int x1 = x - g_fp->_sceneRect.left;
|
||||
int y1 = y - g_fp->_sceneRect.top;
|
||||
@ -868,11 +868,11 @@ bool Bitmap::putDibRB(int32 *palette) {
|
||||
uint16 *srcPtr;
|
||||
|
||||
if (!palette) {
|
||||
debug(2, "Bitmap::putDibRB(): Both global and local palettes are empty");
|
||||
debugC(2, kDebugDrawing, "Bitmap::putDibRB(): Both global and local palettes are empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
debug(8, "Bitmap::putDibRB()");
|
||||
debugC(8, kDebugDrawing, "Bitmap::putDibRB()");
|
||||
|
||||
endy = _height - 1;
|
||||
|
||||
@ -1149,7 +1149,7 @@ void Bitmap::drawRotated(int x, int y, int angle, byte *palette, int alpha) {
|
||||
}
|
||||
|
||||
bool BigPicture::load(MfcArchive &file) {
|
||||
debug(5, "BigPicture::load()");
|
||||
debugC(5, kDebugLoading, "BigPicture::load()");
|
||||
Picture::load(file);
|
||||
|
||||
return true;
|
||||
@ -1190,7 +1190,7 @@ Shadows::Shadows() {
|
||||
}
|
||||
|
||||
bool Shadows::load(MfcArchive &file) {
|
||||
debug(5, "Shadows::load()");
|
||||
debugC(5, kDebugLoading, "Shadows::load()");
|
||||
_sceneId = file.readUint32LE();
|
||||
_staticAniObjectId = file.readUint32LE();
|
||||
_movementId = file.readUint32LE();
|
||||
|
@ -62,7 +62,7 @@ InteractionController::~InteractionController() {
|
||||
}
|
||||
|
||||
bool InteractionController::load(MfcArchive &file) {
|
||||
debug(5, "InteractionController::load()");
|
||||
debugC(5, kDebugLoading, "InteractionController::load()");
|
||||
|
||||
return _interactions.load(file);
|
||||
}
|
||||
@ -440,7 +440,7 @@ Interaction::~Interaction() {
|
||||
}
|
||||
|
||||
bool Interaction::load(MfcArchive &file) {
|
||||
debug(5, "Interaction::load()");
|
||||
debugC(5, kDebugLoading, "Interaction::load()");
|
||||
|
||||
_objectId1 = file.readUint16LE();
|
||||
_objectId2 = file.readUint16LE();
|
||||
@ -531,7 +531,7 @@ bool Interaction::isOverlapping(StaticANIObject *subj, GameObject *obj) {
|
||||
}
|
||||
|
||||
bool EntranceInfo::load(MfcArchive &file) {
|
||||
debug(5, "EntranceInfo::load()");
|
||||
debugC(5, kDebugLoading, "EntranceInfo::load()");
|
||||
|
||||
_sceneId = file.readUint32LE();
|
||||
_field_4 = file.readUint32LE();
|
||||
|
@ -35,7 +35,7 @@ Inventory::~Inventory() {
|
||||
}
|
||||
|
||||
bool Inventory::load(MfcArchive &file) {
|
||||
debug(5, "Inventory::load()");
|
||||
debugC(5, kDebugLoading, "Inventory::load()");
|
||||
|
||||
_sceneId = file.readUint16LE();
|
||||
int numInvs = file.readUint32LE();
|
||||
|
@ -100,7 +100,7 @@ void global_messageHandler_KickMetal() {
|
||||
}
|
||||
|
||||
int global_messageHandler1(ExCommand *cmd) {
|
||||
debug(5, "global_messageHandler1: %d %d", cmd->_messageKind, cmd->_messageNum);
|
||||
debugC(5, kDebugEvents, "global_messageHandler1: %d %d", cmd->_messageKind, cmd->_messageNum);
|
||||
|
||||
if (cmd->_excFlags & 0x10000) {
|
||||
if (cmd->_messageNum == MV_MAN_TOLADDER)
|
||||
@ -364,7 +364,7 @@ int global_messageHandler3(ExCommand *cmd) {
|
||||
case 17:
|
||||
switch (cmd->_messageNum) {
|
||||
case 61:
|
||||
debug(0, "preload: { %d, %d },", cmd->_parentId, cmd->_keyCode);
|
||||
debugC(0, kDebugEvents, "preload: { %d, %d },", cmd->_parentId, cmd->_keyCode);
|
||||
return g_fp->_gameLoader->preloadScene(cmd->_parentId, cmd->_keyCode);
|
||||
case 62:
|
||||
return g_fp->_gameLoader->gotoScene(cmd->_parentId, cmd->_keyCode);
|
||||
|
@ -57,7 +57,7 @@ ExCommand::ExCommand(int16 parentId, int messageKind, int messageNum, int x, int
|
||||
}
|
||||
|
||||
bool ExCommand::load(MfcArchive &file) {
|
||||
debug(5, "ExCommand::load()");
|
||||
debugC(5, kDebugLoading, "ExCommand::load()");
|
||||
|
||||
_parentId = file.readUint16LE();
|
||||
_messageKind = file.readUint32LE();
|
||||
@ -247,7 +247,7 @@ ObjstateCommand::~ObjstateCommand() {
|
||||
}
|
||||
|
||||
bool ObjstateCommand::load(MfcArchive &file) {
|
||||
debug(5, "ObjStateCommand::load()");
|
||||
debugC(5, kDebugLoading, "ObjStateCommand::load()");
|
||||
|
||||
_objtype = kObjTypeObjstateCommand;
|
||||
|
||||
@ -341,7 +341,7 @@ MessageQueue::~MessageQueue() {
|
||||
}
|
||||
|
||||
bool MessageQueue::load(MfcArchive &file) {
|
||||
debug(5, "MessageQueue::load()");
|
||||
debugC(5, kDebugLoading, "MessageQueue::load()");
|
||||
|
||||
_dataId = file.readUint16LE();
|
||||
|
||||
|
@ -2094,7 +2094,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
|
||||
PicAniInfo picAniInfo;
|
||||
Common::Point point;
|
||||
|
||||
debugC(0, kDebugPathfinding, "MovGraph2::doWalkTo(%d, %d, %d, %d, %d)", obj->_id, xpos, ypos, fuzzyMatch, staticsId);
|
||||
debugC(1, kDebugPathfinding, "MovGraph2::doWalkTo(%d, %d, %d, %d, %d)", obj->_id, xpos, ypos, fuzzyMatch, staticsId);
|
||||
|
||||
int idx = getItemIndexByGameObjectId(obj->_id);
|
||||
|
||||
@ -2227,7 +2227,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
|
||||
Common::Array<MovGraphLink *> tempLinkList;
|
||||
double minPath = findMinPath(&linkInfoSource, &linkInfoDest, &tempLinkList);
|
||||
|
||||
debugC(0, kDebugPathfinding, "MovGraph2::doWalkTo(): path: %g parts: %d", minPath, tempLinkList.size());
|
||||
debugC(1, kDebugPathfinding, "MovGraph2::doWalkTo(): path: %g parts: %d", minPath, tempLinkList.size());
|
||||
|
||||
if (minPath < 0.0 || ((linkInfoSource.node != linkInfoDest.node || !linkInfoSource.node) && !tempLinkList.size()))
|
||||
return 0;
|
||||
|
@ -93,11 +93,11 @@ NGIArchive::NGIArchive(const Common::String &filename) : _ngiFilename(filename)
|
||||
|
||||
g_fp->_currArchive = this;
|
||||
|
||||
debug(0, "NGIArchive::NGIArchive(%s): Located %d files", filename.c_str(), _headers.size());
|
||||
debugC(0, kDebugLoading, "NGIArchive::NGIArchive(%s): Located %d files", filename.c_str(), _headers.size());
|
||||
}
|
||||
|
||||
NGIArchive::~NGIArchive() {
|
||||
debug(0, "NGIArchive Destructor Called");
|
||||
debugC(0, kDebugLoading, "NGIArchive Destructor Called");
|
||||
NgiHeadersMap::iterator it = _headers.begin();
|
||||
for ( ; it != _headers.end(); ++it) {
|
||||
delete it->_value;
|
||||
|
@ -44,7 +44,7 @@ SoundList::SoundList() {
|
||||
}
|
||||
|
||||
bool SoundList::load(MfcArchive &file, char *fname) {
|
||||
debug(5, "SoundList::load()");
|
||||
debugC(5, kDebugLoading, "SoundList::load()");
|
||||
|
||||
_soundItemsCount = file.readUint32LE();
|
||||
_soundItems = (Sound **)calloc(_soundItemsCount, sizeof(Sound *));
|
||||
@ -107,7 +107,7 @@ Sound::~Sound() {
|
||||
}
|
||||
|
||||
bool Sound::load(MfcArchive &file, NGIArchive *archive) {
|
||||
debug(5, "Sound::load()");
|
||||
debugC(5, kDebugLoading, "Sound::load()");
|
||||
|
||||
MemoryObject::load(file);
|
||||
|
||||
|
@ -112,7 +112,7 @@ GameProject::GameProject() {
|
||||
}
|
||||
|
||||
bool GameProject::load(MfcArchive &file) {
|
||||
debug(5, "GameProject::load()");
|
||||
debugC(5, kDebugLoading, "GameProject::load()");
|
||||
|
||||
_field_4 = 0;
|
||||
_headerFilename = 0;
|
||||
@ -124,10 +124,10 @@ bool GameProject::load(MfcArchive &file) {
|
||||
|
||||
_headerFilename = file.readPascalString();
|
||||
|
||||
debug(1, "_gameProjectVersion = %d", g_fp->_gameProjectVersion);
|
||||
debug(1, "_pictureScale = %d", g_fp->_pictureScale);
|
||||
debug(1, "_scrollSpeed = %d", g_fp->_scrollSpeed);
|
||||
debug(1, "_headerFilename = %s", _headerFilename);
|
||||
debugC(1, kDebugLoading, "_gameProjectVersion = %d", g_fp->_gameProjectVersion);
|
||||
debugC(1, kDebugLoading, "_pictureScale = %d", g_fp->_pictureScale);
|
||||
debugC(1, kDebugLoading, "_scrollSpeed = %d", g_fp->_scrollSpeed);
|
||||
debugC(1, kDebugLoading, "_headerFilename = %s", _headerFilename);
|
||||
|
||||
_sceneTagList = new SceneTagList();
|
||||
|
||||
@ -205,24 +205,24 @@ bool GameVar::load(MfcArchive &file) {
|
||||
_varName = file.readPascalString();
|
||||
_varType = file.readUint32LE();
|
||||
|
||||
debugN(6, "[%03d] ", file.getLevel());
|
||||
debugCN(6, kDebugLoading, "[%03d] ", file.getLevel());
|
||||
for (int i = 0; i < file.getLevel(); i++)
|
||||
debugN(6, " ");
|
||||
debugCN(6, kDebugLoading, " ");
|
||||
|
||||
debugN(6, "<%s>: ", transCyrillic((byte *)_varName));
|
||||
debugCN(6, kDebugLoading, "<%s>: ", transCyrillic((byte *)_varName));
|
||||
|
||||
switch (_varType) {
|
||||
case 0:
|
||||
_value.intValue = file.readUint32LE();
|
||||
debug(6, "d --> %d", _value.intValue);
|
||||
debugC(6, kDebugLoading, "d --> %d", _value.intValue);
|
||||
break;
|
||||
case 1:
|
||||
_value.intValue = file.readUint32LE(); // FIXME
|
||||
debug(6, "f --> %f", _value.floatValue);
|
||||
debugC(6, kDebugLoading, "f --> %f", _value.floatValue);
|
||||
break;
|
||||
case 2:
|
||||
_value.stringValue = file.readPascalString();
|
||||
debug(6, "s --> %s", _value.stringValue);
|
||||
debugC(6, kDebugLoading, "s --> %s", _value.stringValue);
|
||||
break;
|
||||
default:
|
||||
error("Unknown var type: %d (0x%x)", _varType, _varType);
|
||||
@ -342,7 +342,7 @@ GameVar *GameVar::getSubVarByIndex(int idx) {
|
||||
}
|
||||
|
||||
bool PicAniInfo::load(MfcArchive &file) {
|
||||
debug(5, "PicAniInfo::load()");
|
||||
debugC(5, kDebugLoading, "PicAniInfo::load()");
|
||||
|
||||
type = file.readUint32LE();
|
||||
objectId = file.readUint16LE();
|
||||
|
@ -779,7 +779,7 @@ Common::Point *StaticANIObject::getSomeXY(Common::Point &p) {
|
||||
void StaticANIObject::update(int counterdiff) {
|
||||
int mqid;
|
||||
|
||||
debug(6, "StaticANIObject::update() (%s) [%d] [%d, %d] fl: %x", transCyrillic((byte *)_objectName), _id, _ox, _oy, _flags);
|
||||
debugC(6, kDebugAnimation, "StaticANIObject::update() (%s) [%d] [%d, %d] fl: %x", transCyrillic((byte *)_objectName), _id, _ox, _oy, _flags);
|
||||
|
||||
if (_flags & 2) {
|
||||
_messageNum--;
|
||||
@ -951,7 +951,7 @@ Common::Point *StaticANIObject::calcNextStep(Common::Point *pRes) {
|
||||
}
|
||||
|
||||
void StaticANIObject::stopAnim_maybe() {
|
||||
debug(6, "StaticANIObject::stopAnim_maybe()");
|
||||
debugC(6, kDebugAnimation, "StaticANIObject::stopAnim_maybe()");
|
||||
|
||||
if (!(_flags & 1))
|
||||
return;
|
||||
@ -1093,7 +1093,7 @@ void StaticANIObject::hide() {
|
||||
}
|
||||
|
||||
void StaticANIObject::show1(int x, int y, int movId, int mqId) {
|
||||
debug(6, "StaticANIObject::show1(%d, %d, %d, %d)", x, y, movId, mqId);
|
||||
debugC(6, kDebugAnimation, "StaticANIObject::show1(%d, %d, %d, %d)", x, y, movId, mqId);
|
||||
|
||||
if (_messageQueueId)
|
||||
return;
|
||||
@ -1285,7 +1285,7 @@ bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhase
|
||||
if (_flags & 0x80)
|
||||
return false;
|
||||
|
||||
debug(4, "StaticANIObject::startAnim(%d, %d, %d) (%s [%d]) [%d, %d]", movementId, messageQueueId, dynPhaseIdx, transCyrillic((byte *)_objectName), _id, _ox, _oy);
|
||||
debugC(4, kDebugAnimation, "StaticANIObject::startAnim(%d, %d, %d) (%s [%d]) [%d, %d]", movementId, messageQueueId, dynPhaseIdx, transCyrillic((byte *)_objectName), _id, _ox, _oy);
|
||||
|
||||
if (_messageQueueId) {
|
||||
updateGlobalMessageQueue(messageQueueId, _id);
|
||||
@ -1826,7 +1826,7 @@ void Movement::initStatics(StaticANIObject *ani) {
|
||||
if (!_currMovement)
|
||||
return;
|
||||
|
||||
debug(7, "Movement::initStatics()");
|
||||
debugC(7, kDebugAnimation, "Movement::initStatics()");
|
||||
|
||||
_staticsObj2 = ani->addReverseStatics(_currMovement->_staticsObj2);
|
||||
_staticsObj1 = ani->addReverseStatics(_currMovement->_staticsObj1);
|
||||
@ -1853,7 +1853,7 @@ void Movement::initStatics(StaticANIObject *ani) {
|
||||
}
|
||||
|
||||
void Movement::updateCurrDynamicPhase() {
|
||||
debug(7, "Movement::updateCurrDynamicPhase()");
|
||||
debugC(7, kDebugAnimation, "Movement::updateCurrDynamicPhase()");
|
||||
|
||||
if (_currMovement) {
|
||||
if (_currMovement->_dynamicPhases.size() == 0 || (uint)_currDynamicPhaseIndex >= _currMovement->_dynamicPhases.size())
|
||||
@ -1905,7 +1905,7 @@ int Movement::countPhasesWithFlag(int maxidx, int flag) {
|
||||
}
|
||||
|
||||
void Movement::setDynamicPhaseIndex(int index) {
|
||||
debug(7, "Movement::setDynamicPhaseIndex(%d)", index);
|
||||
debugC(7, kDebugAnimation, "Movement::setDynamicPhaseIndex(%d)", index);
|
||||
while (_currDynamicPhaseIndex < index)
|
||||
gotoNextFrame(0, 0);
|
||||
|
||||
@ -1914,7 +1914,7 @@ void Movement::setDynamicPhaseIndex(int index) {
|
||||
}
|
||||
|
||||
DynamicPhase *Movement::getDynamicPhaseByIndex(int idx) {
|
||||
debug(7, "Movement::updateCurrDynamicPhase()");
|
||||
debugC(7, kDebugAnimation, "Movement::updateCurrDynamicPhase()");
|
||||
|
||||
if (_currMovement) {
|
||||
if (_currMovement->_dynamicPhases.size() == 0 || (uint)idx >= _currMovement->_dynamicPhases.size())
|
||||
@ -1973,7 +1973,7 @@ void Movement::removeFirstPhase() {
|
||||
}
|
||||
|
||||
bool Movement::gotoNextFrame(void (*callback1)(int, Common::Point *point, int, int), void (*callback2)(int *)) {
|
||||
debug(8, "Movement::gotoNextFrame()");
|
||||
debugC(8, kDebugAnimation, "Movement::gotoNextFrame()");
|
||||
|
||||
if (!callback2) {
|
||||
if (_currMovement) {
|
||||
@ -2094,7 +2094,7 @@ bool Movement::gotoNextFrame(void (*callback1)(int, Common::Point *point, int, i
|
||||
}
|
||||
|
||||
bool Movement::gotoPrevFrame() {
|
||||
debug(8, "Movement::gotoPrevFrame()");
|
||||
debugC(8, kDebugAnimation, "Movement::gotoPrevFrame()");
|
||||
|
||||
if (!_currDynamicPhaseIndex) {
|
||||
gotoLastFrame();
|
||||
@ -2192,7 +2192,7 @@ DynamicPhase::DynamicPhase(DynamicPhase *src, bool reverse) {
|
||||
_field_7E = 0;
|
||||
_rect = new Common::Rect();
|
||||
|
||||
debug(1, "DynamicPhase::DynamicPhase(src, %d)", reverse);
|
||||
debugC(1, kDebugAnimation, "DynamicPhase::DynamicPhase(src, %d)", reverse);
|
||||
|
||||
if (reverse) {
|
||||
if (!src->_bitmap)
|
||||
|
@ -45,13 +45,13 @@ bool CObject::loadFile(const char *fname) {
|
||||
}
|
||||
|
||||
bool ObList::load(MfcArchive &file) {
|
||||
debug(5, "ObList::load()");
|
||||
debugC(5, kDebugLoading, "ObList::load()");
|
||||
int count = file.readCount();
|
||||
|
||||
debug(9, "ObList::count: %d:", count);
|
||||
debugC(9, kDebugLoading, "ObList::count: %d:", count);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
debug(9, "ObList::[%d]", i);
|
||||
debugC(9, kDebugLoading, "ObList::[%d]", i);
|
||||
CObject *t = file.readClass();
|
||||
|
||||
push_back(t);
|
||||
@ -61,7 +61,7 @@ bool ObList::load(MfcArchive &file) {
|
||||
}
|
||||
|
||||
bool ObArray::load(MfcArchive &file) {
|
||||
debug(5, "ObArray::load()");
|
||||
debugC(5, kDebugLoading, "ObArray::load()");
|
||||
int count = file.readCount();
|
||||
|
||||
resize(count);
|
||||
@ -76,10 +76,10 @@ bool ObArray::load(MfcArchive &file) {
|
||||
}
|
||||
|
||||
bool DWordArray::load(MfcArchive &file) {
|
||||
debug(5, "DWordArray::load()");
|
||||
debugC(5, kDebugLoading, "DWordArray::load()");
|
||||
int count = file.readCount();
|
||||
|
||||
debug(9, "DWordArray::count: %d", count);
|
||||
debugC(9, kDebugLoading, "DWordArray::count: %d", count);
|
||||
|
||||
resize(count);
|
||||
|
||||
@ -104,7 +104,7 @@ char *MfcArchive::readPascalString(bool twoByte) {
|
||||
tmp = (char *)calloc(len + 1, 1);
|
||||
read(tmp, len);
|
||||
|
||||
debug(9, "readPascalString: %d <%s>", len, transCyrillic((byte *)tmp));
|
||||
debugC(9, kDebugLoading, "readPascalString: %d <%s>", len, transCyrillic((byte *)tmp));
|
||||
|
||||
return tmp;
|
||||
}
|
||||
@ -128,7 +128,7 @@ MemoryObject::~MemoryObject() {
|
||||
}
|
||||
|
||||
bool MemoryObject::load(MfcArchive &file) {
|
||||
debug(5, "MemoryObject::load()");
|
||||
debugC(5, kDebugLoading, "MemoryObject::load()");
|
||||
_memfilename = file.readPascalString();
|
||||
|
||||
if (char *p = strchr(_memfilename, '\\')) {
|
||||
@ -147,7 +147,7 @@ bool MemoryObject::load(MfcArchive &file) {
|
||||
}
|
||||
|
||||
void MemoryObject::loadFile(char *filename) {
|
||||
debug(5, "MemoryObject::loadFile(<%s>)", filename);
|
||||
debugC(5, kDebugLoading, "MemoryObject::loadFile(<%s>)", filename);
|
||||
|
||||
if (!*filename)
|
||||
return;
|
||||
@ -165,7 +165,7 @@ void MemoryObject::loadFile(char *filename) {
|
||||
|
||||
_dataSize = s->size();
|
||||
|
||||
debug(5, "Loading %s (%d bytes)", filename, _dataSize);
|
||||
debugC(5, kDebugLoading, "Loading %s (%d bytes)", filename, _dataSize);
|
||||
_data = (byte *)calloc(_dataSize, 1);
|
||||
s->read(_data, _dataSize);
|
||||
|
||||
@ -194,7 +194,7 @@ byte *MemoryObject::loadData() {
|
||||
}
|
||||
|
||||
void MemoryObject::freeData() {
|
||||
debug(8, "MemoryObject::freeData(): file: %s", _memfilename);
|
||||
debugC(8, kDebugMemory, "MemoryObject::freeData(): file: %s", _memfilename);
|
||||
|
||||
if (_data)
|
||||
free(_data);
|
||||
@ -222,12 +222,12 @@ MemoryObject2::~MemoryObject2() {
|
||||
}
|
||||
|
||||
bool MemoryObject2::load(MfcArchive &file) {
|
||||
debug(5, "MemoryObject2::load()");
|
||||
debugC(5, kDebugLoading, "MemoryObject2::load()");
|
||||
MemoryObject::load(file);
|
||||
|
||||
_mflags |= 1;
|
||||
|
||||
debug(5, "MemoryObject2::load: <%s>", _memfilename);
|
||||
debugC(5, kDebugLoading, "MemoryObject2::load: <%s>", _memfilename);
|
||||
|
||||
if (_memfilename && *_memfilename) {
|
||||
MemoryObject::loadFile(_memfilename);
|
||||
@ -377,15 +377,15 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
|
||||
|
||||
uint obTag = readUint16LE();
|
||||
|
||||
debug(7, "parseClass::obTag = %d (%04x) at 0x%08x", obTag, obTag, pos() - 2);
|
||||
debugC(7, kDebugLoading, "parseClass::obTag = %d (%04x) at 0x%08x", obTag, obTag, pos() - 2);
|
||||
|
||||
if (obTag == 0xffff) {
|
||||
int schema = readUint16LE();
|
||||
|
||||
debug(7, "parseClass::schema = %d", schema);
|
||||
debugC(7, kDebugLoading, "parseClass::schema = %d", schema);
|
||||
|
||||
name = readPascalString(true);
|
||||
debug(7, "parseClass::class <%s>", name);
|
||||
debugC(7, kDebugLoading, "parseClass::class <%s>", name);
|
||||
|
||||
if (!_classMap.contains(name)) {
|
||||
error("Unknown class in MfcArchive: <%s>", name);
|
||||
@ -393,7 +393,7 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
|
||||
|
||||
objectId = _classMap[name];
|
||||
|
||||
debug(7, "tag: %d 0x%x (%x)", _objectMap.size() - 1, _objectMap.size() - 1, objectId);
|
||||
debugC(7, kDebugLoading, "tag: %d 0x%x (%x)", _objectMap.size() - 1, _objectMap.size() - 1, objectId);
|
||||
|
||||
res = createObject(objectId);
|
||||
_objectMap.push_back(res);
|
||||
@ -407,7 +407,7 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
|
||||
if (_objectMap.size() < obTag) {
|
||||
error("Object index too big: %d at 0x%08x", obTag, pos() - 2);
|
||||
}
|
||||
debug(7, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag]));
|
||||
debugC(7, kDebugLoading, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag]));
|
||||
|
||||
res = _objectMap[obTag];
|
||||
|
||||
@ -420,7 +420,7 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
|
||||
error("Object index too big: %d at 0x%08x", obTag, pos() - 2);
|
||||
}
|
||||
|
||||
debug(7, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag]));
|
||||
debugC(7, kDebugLoading, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag]));
|
||||
|
||||
objectId = _objectIdMap[obTag];
|
||||
|
||||
@ -443,7 +443,7 @@ char *genFileName(int superId, int sceneId, const char *ext) {
|
||||
snprintf(s, 255, "%04d.%s", sceneId, ext);
|
||||
}
|
||||
|
||||
debug(7, "genFileName: %s", s);
|
||||
debugC(7, kDebugLoading, "genFileName: %s", s);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user