Skip to content

Commit

Permalink
[engine]Issue #116: Use debug log tag for info header
Browse files Browse the repository at this point in the history
  • Loading branch information
Miquel Angel Quinones Garcia committed Feb 19, 2013
1 parent f64d4f7 commit a99e12f
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 83 deletions.
8 changes: 4 additions & 4 deletions IndieLib/common/src/IND_AnimationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ bool IND_AnimationManager::addToSurface(IND_Animation *pNewAnimation,
*/
bool IND_AnimationManager::addToImage(IND_Animation *pNewAnimation, const char *pAnimation) {
g_debug->header("Parsing and loading animation", 5);
g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pAnimation, 1);

if (!_ok) {
Expand Down Expand Up @@ -494,7 +494,7 @@ bool IND_AnimationManager::parseAnimation(IND_Animation *pNewAnimation, const ch
// ----- Parsing collision file -----

g_debug->header("Parsing collision file", 5);
g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar((char *) mXFrame->Attribute("collision"), 1);

if (!_collisionParser->parseCollision(mNewFrame->_frame._listBoundingCollision, (char *) mXFrame->Attribute("collision"))) {
Expand Down Expand Up @@ -657,7 +657,7 @@ bool IND_AnimationManager::remove(IND_Animation *pAn, bool pType) {

// ----- Free object -----

g_debug->header("Name:", 3);
g_debug->header("Name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pAn->_animation._name, 1);

// ------ Free all the surfaces and animations -----
Expand Down Expand Up @@ -738,7 +738,7 @@ void IND_AnimationManager::delFromlist(IND_Animation *pAn) {
* Initialization error message.
*/
void IND_AnimationManager::writeMessage() {
g_debug->header("This operation can not be done", 3);
g_debug->header("This operation can not be done", DebugApi::LogHeaderInfo);
g_debug->dataChar("", 1);
g_debug->header("Invalid Id or not correctly initialized AnimationManager", DebugApi::LogHeaderError);
}
Expand Down
2 changes: 1 addition & 1 deletion IndieLib/common/src/IND_Entity2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ bool IND_Entity2d::setBoundingAreas(const char *pFile) {
return 0;
}

g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pFile, 1);

// Only for surfaces
Expand Down
12 changes: 6 additions & 6 deletions IndieLib/common/src/IND_Entity2dManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ bool IND_Entity2dManager::isOK() const {
*/
bool IND_Entity2dManager::add(IND_Entity2d *pNewEntity2d) {
g_debug->header("Adding 2d entity", 5);
g_debug->header("Name:", 3);
g_debug->header("Name:", DebugApi::LogHeaderInfo);
pNewEntity2d->_id = _idTrack++;
g_debug->dataInt(pNewEntity2d->getId(), 1);

Expand Down Expand Up @@ -162,10 +162,10 @@ bool IND_Entity2dManager::add(IND_Entity2d *pNewEntity2d) {
*/
bool IND_Entity2dManager::add(int pLayer, IND_Entity2d *pNewEntity2d) {
g_debug->header("Adding 2d entity", 5);
g_debug->header("Name:", 3);
g_debug->header("Name:", DebugApi::LogHeaderInfo);
pNewEntity2d->_id = _idTrack++;
g_debug->dataInt(pNewEntity2d->getId(), 1);
g_debug->header("Layer:", 3);
g_debug->header("Layer:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pLayer, 1);

if (!_ok) {
Expand Down Expand Up @@ -195,7 +195,7 @@ bool IND_Entity2dManager::add(int pLayer, IND_Entity2d *pNewEntity2d) {
*/
bool IND_Entity2dManager::remove(IND_Entity2d *pEn) {
g_debug->header("Freeing 2d entity", 5);
g_debug->header("Name:", 3);
g_debug->header("Name:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pEn->getId(), 1);

if (!_ok || !pEn) {
Expand Down Expand Up @@ -777,7 +777,7 @@ Initialization error message
==================
*/
void IND_Entity2dManager::writeMessage() {
g_debug->header("This operation can not be done", 3);
g_debug->header("This operation can not be done", DebugApi::LogHeaderInfo);
g_debug->dataChar("", 1);
g_debug->header("Invalid Id or IND_Entity2dManager not correctly initialized", DebugApi::LogHeaderError);
}
Expand Down Expand Up @@ -807,7 +807,7 @@ void IND_Entity2dManager::freeVars() {
for (mEntityListIter = _listEntities2d[i]->begin();
mEntityListIter != _listEntities2d[i]->end();
mEntityListIter++) {
g_debug->header("Freeing 2d entity:", 3);
g_debug->header("Freeing 2d entity:", DebugApi::LogHeaderInfo);

// Delete all the bounding areas
(*mEntityListIter)->deleteBoundingAreas((char*)"*");
Expand Down
10 changes: 5 additions & 5 deletions IndieLib/common/src/IND_FontManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool IND_FontManager::add(IND_Font *pNewFont,
IND_Type pType,
IND_Quality pQuality) {
g_debug->header("Parsing and loading font", 5);
g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pFile, 1);

if (!_ok) {
Expand All @@ -171,7 +171,7 @@ bool IND_FontManager::add(IND_Font *pNewFont,

if (!mMath.isPowerOfTwo(pImage->getWidth()) ||
!mMath.isPowerOfTwo(pImage->getHeight())) {
g_debug->header("This operation can not be done", 3);
g_debug->header("This operation can not be done", DebugApi::LogHeaderInfo);
g_debug->dataChar("", 1);
g_debug->header("The height and width of the font must be power of 2", DebugApi::LogHeaderError);
return 0;
Expand Down Expand Up @@ -244,7 +244,7 @@ bool IND_FontManager::remove(IND_Font *pFo) {

// ----- Free object -----

g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pFo->getFileName(), 1);

// Free bitmap IND_Surface
Expand Down Expand Up @@ -401,7 +401,7 @@ Initialization error message
==================
*/
void IND_FontManager::writeMessage() {
g_debug->header("This operation can not be done", 3);
g_debug->header("This operation can not be done", DebugApi::LogHeaderInfo);
g_debug->dataChar("", 1);
g_debug->header("Invalid Id or FontManager not correctly initialized", DebugApi::LogHeaderError);
}
Expand All @@ -426,7 +426,7 @@ void IND_FontManager::freeVars() {
for (mFontListIter = _listFonts->begin();
mFontListIter != _listFonts->end();
mFontListIter++) {
g_debug->header("Freeing font:", 3);
g_debug->header("Freeing font:", DebugApi::LogHeaderInfo);
g_debug->dataChar((*mFontListIter)->getFileName(), 1);

// Free bitmap IND_Surface
Expand Down
34 changes: 17 additions & 17 deletions IndieLib/common/src/IND_ImageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bool IND_ImageManager::add(IND_Image *pNewImage, const char *pName) {
return 0;
}

g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pName, 1);

if (!_ok) {
Expand All @@ -124,7 +124,7 @@ bool IND_ImageManager::add(IND_Image *pNewImage, const char *pName) {
getExtensionFromName(pName,ext);
if (checkExtImage(ext)) {
pNewImage->setExtension(ext);
g_debug->header("Extension:", 3);
g_debug->header("Extension:", DebugApi::LogHeaderInfo);
g_debug->dataChar(ext, 1);
} else {
g_debug->header("Unknown extension", DebugApi::LogHeaderError);
Expand Down Expand Up @@ -162,15 +162,15 @@ bool IND_ImageManager::add(IND_Image *pNewImage, const char *pName) {

// ----- g_debug -----

g_debug->header("Size:", 3);
g_debug->header("Size:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pNewImage->getWidth(), 0);
g_debug->dataChar("x", 0);
g_debug->dataInt(pNewImage->getHeight(), 1);

g_debug->header("Bpp:", 3);
g_debug->header("Bpp:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pNewImage->getBytespp(), 1);

g_debug->header("Format:", 3);
g_debug->header("Format:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pNewImage->getFormatString(), 1);

g_debug->header("Image loaded", 6);
Expand All @@ -191,7 +191,7 @@ FIBITMAP* IND_ImageManager::load(const char *pName) {
return NULL;
}

g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pName, 1);

if (!_ok) {
Expand All @@ -208,7 +208,7 @@ FIBITMAP* IND_ImageManager::load(const char *pName) {
return NULL;
}

g_debug->header("Extension:", 3);
g_debug->header("Extension:", DebugApi::LogHeaderInfo);
g_debug->dataChar(ext, 1);

// ----- Load image -----
Expand Down Expand Up @@ -267,15 +267,15 @@ bool IND_ImageManager::add(IND_Image *pNewImage, FIBITMAP *pImageToBeCopied) {

// ----- g_debug -----

g_debug->header("Size:", 3);
g_debug->header("Size:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pNewImage->getWidth(), 0);
g_debug->dataChar("x", 0);
g_debug->dataInt(pNewImage->getHeight(), 1);

g_debug->header("Bpp:", 3);
g_debug->header("Bpp:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pNewImage->getBytespp(), 1);

g_debug->header("Format:", 3);
g_debug->header("Format:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pNewImage->getFormatString(), 1);

g_debug->header("Image cloned and added", 6);
Expand Down Expand Up @@ -370,7 +370,7 @@ bool IND_ImageManager::remove(IND_Image *pIm) {

// ----- Free object -----

g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pIm->getName(), 1);

// Free image
Expand Down Expand Up @@ -429,7 +429,7 @@ bool IND_ImageManager::clone(IND_Image *pNewImage, IND_Image *pOldImage) {

// ----- g_debug -----

g_debug->header("File name:", 3);
g_debug->header("File name:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pOldImage->getName(), 1);
g_debug->header("Image cloned", 6);

Expand Down Expand Up @@ -463,15 +463,15 @@ bool IND_ImageManager::save(IND_Image *pIm, const char *pName) {
// return 0;
//}

//g_debug->header("Image type:", 3);
//g_debug->header("Image type:", DebugApi::LogHeaderInfo);
//g_debug->dataChar(_ext, 1);

//ilBindImage(pIm->getDevilId());

//g_debug->header("File name:", 3);
//g_debug->header("File name:", DebugApi::LogHeaderInfo);
//g_debug->dataChar(pName, 1);

//g_debug->header("Size:", 3);
//g_debug->header("Size:", DebugApi::LogHeaderInfo);
//g_debug->dataInt(pIm->getWidth(), 0);
//g_debug->dataChar("x", 0);
//g_debug->dataInt(pIm->getHeight(), 1);
Expand Down Expand Up @@ -549,7 +549,7 @@ Initialization error message
==================
*/
void IND_ImageManager::writeMessage() {
g_debug->header("This operation can not be done", 3);
g_debug->header("This operation can not be done", DebugApi::LogHeaderInfo);
g_debug->dataChar("", 1);
g_debug->header("Invalid Id or IND_ImageManager not correctly initialized", DebugApi::LogHeaderError);
}
Expand Down Expand Up @@ -586,7 +586,7 @@ void IND_ImageManager::freeVars() {
mImageListIter++) {
FIBITMAP* handle = (*mImageListIter)->getFreeImageHandle();
if (handle) {
g_debug->header("Freeing image:", 3);
g_debug->header("Freeing image:", DebugApi::LogHeaderInfo);
g_debug->dataChar((*mImageListIter)->getName(), 1);

// Free image
Expand Down
20 changes: 10 additions & 10 deletions IndieLib/common/src/IND_SurfaceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ bool IND_SurfaceManager::addMain(IND_Surface *pNewSurface,
return 0;
}

g_debug->header("From image:", 3);
g_debug->header("From image:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pImage->getName(), 1);

//Convert image if needed
Expand All @@ -514,34 +514,34 @@ bool IND_SurfaceManager::addMain(IND_Surface *pNewSurface,
// ----- g_debug -----


g_debug->header("Type:", 3);
g_debug->header("Type:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pNewSurface->getTypeString(), 1);

g_debug->header("Quality:", 3);
g_debug->header("Quality:", DebugApi::LogHeaderInfo);
g_debug->dataChar(pNewSurface->getQualityString(), 1);

g_debug->header("Image size:", 3);
g_debug->header("Image size:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pNewSurface->_surface->_attributes._width, 0);
g_debug->dataChar("x", 0);
g_debug->dataInt(pNewSurface->_surface->_attributes._height, 1);

g_debug->header("Block size:", 3);
g_debug->header("Block size:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pNewSurface->_surface->_attributes._widthBlock, 0);
g_debug->dataChar("x", 0);
g_debug->dataInt(pNewSurface->_surface->_attributes._heightBlock, 1);

g_debug->header("Number of blocks:", 3);
g_debug->header("Number of blocks:", DebugApi::LogHeaderInfo);
g_debug->dataInt(pNewSurface->_surface->_attributes._blocksX, 0);
g_debug->dataChar("x", 0);
g_debug->dataInt(pNewSurface->_surface->_attributes._blocksY, 1);

g_debug->header("Spare (Right | Down):", 3);
g_debug->header("Spare (Right | Down):", DebugApi::LogHeaderInfo);
g_debug->dataInt(pNewSurface->_surface->_attributes._spareX, 0);
g_debug->dataChar("x", 0);
g_debug->dataInt(pNewSurface->_surface->_attributes._spareY, 1);

//TODO: LOG % NOT USED
//g_debug->Header ("Not used percentage:", 3);
//g_debug->Header ("Not used percentage:", DebugApi::LogHeaderInfo);
//g_debug->DataFloat (pNewSurface->_surface->_attributes., 0);
//g_debug->DataChar ("%", 1);

Expand Down Expand Up @@ -628,7 +628,7 @@ Writes a message in the log that the object was not initialized
==================
*/
void IND_SurfaceManager::writeMessage() {
g_debug->header("This operation can not be done", 3);
g_debug->header("This operation can not be done", DebugApi::LogHeaderInfo);
g_debug->dataChar("", 1);
g_debug->header("Invalid Id or SurfaceManager not correctly initialized", DebugApi::LogHeaderError);
}
Expand Down Expand Up @@ -709,7 +709,7 @@ void IND_SurfaceManager::freeVars() {
for (mSurfaceListIter = _listSurfaces->begin();
mSurfaceListIter != _listSurfaces->end();
mSurfaceListIter++) {
g_debug->header("Freeing surface:", 3);
g_debug->header("Freeing surface:", DebugApi::LogHeaderInfo);
//FIXME: This breaks on LLVM compiler (OSX, XCode)
//g_debug->dataInt((int) & (*mSurfaceListIter)->_surface, 1);
DISPOSE(*mSurfaceListIter);
Expand Down
Loading

0 comments on commit a99e12f

Please sign in to comment.