diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/image.cpp | 8 | ||||
-rw-r--r-- | src/resources/itemmanager.cpp | 18 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 14 | ||||
-rw-r--r-- | src/resources/resourcemanager.cpp | 26 |
4 files changed, 33 insertions, 33 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 5114d1d3..1e186d7b 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -76,7 +76,7 @@ Image* Image::load(void* buffer, unsigned int bufferSize, int flags) // Check if the file was opened and return the appropriate value. if (!image) { - logger.log("Error: Image convert failed."); + logger->log("Error: Image convert failed."); return NULL; } @@ -101,7 +101,7 @@ Image* Image::load(void* buffer, unsigned int bufferSize, int flags) rmask, gmask, bmask, amask); if (formatImage == NULL) { - logger.log("Error", "Image load failed: not enough memory"); + logger->log("Error", "Image load failed: not enough memory"); } SDL_Surface *image = SDL_ConvertSurface( @@ -149,7 +149,7 @@ Image* Image::load(void* buffer, unsigned int bufferSize, int flags) GLuint texture; glGenTextures(1, &texture); - logger.log("Binding texture %d (%dx%d)", texture, realWidth, realHeight); + logger->log("Binding texture %d (%dx%d)", texture, realWidth, realHeight); glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D( GL_TEXTURE_2D, 0, 4, @@ -189,7 +189,7 @@ Image* Image::load(void* buffer, unsigned int bufferSize, int flags) errmsg = "GL_OUT_OF_MEMORY"; break; } - logger.log("Error: Image GL import failed: %s", errmsg.c_str()); + logger->log("Error: Image GL import failed: %s", errmsg.c_str()); return NULL; } diff --git a/src/resources/itemmanager.cpp b/src/resources/itemmanager.cpp index ecccd20c..a3438241 100644 --- a/src/resources/itemmanager.cpp +++ b/src/resources/itemmanager.cpp @@ -42,18 +42,18 @@ ItemManager::ItemManager() std::fstream dbFile; dbFile.open(TMW_DATADIR "data/items.xml", std::ios::in); if (!dbFile.is_open()) { - logger.log("Cannot find item database!"); + logger->log("Cannot find item database!"); return; } dbFile.close(); - + xmlDocPtr doc = xmlParseFile(TMW_DATADIR "data/items.xml"); if (doc) { xmlNodePtr node = xmlDocGetRootElement(doc); if (!node || !xmlStrEqual(node->name, BAD_CAST "items")) { - logger.log("Warning: Not a valid database file!"); + logger->log("Warning: Not a valid database file!"); } else { for (node = node->xmlChildrenNode; node != NULL; node = node->next) { @@ -84,7 +84,7 @@ ItemManager::ItemManager() prop = xmlGetProp(node, BAD_CAST "slot"); int slot = atoi((const char*)prop); xmlFree(prop); - + ItemInfo *itemInfo = new ItemInfo(); itemInfo->setImage(image); itemInfo->setArt(art); @@ -94,20 +94,20 @@ ItemManager::ItemManager() itemInfo->setWeight(weight); itemInfo->setSlot(slot); db[id] = itemInfo; - - /*logger.log("Item: %i %i %i %s %s %i %i %i", id, + + /*logger->log("Item: %i %i %i %s %s %i %i %i", id, getImage(id), getArt(id), getName(id).c_str(), getDescription(id).c_str(), getType(id), getWeight(id), getSlot(id));*/ } } } - + xmlFreeDoc(doc); } else { - logger.log("Error while parsing item database!"); + logger->log("Error while parsing item database!"); } - + unknown = new ItemInfo(); unknown->setName("Unknown item"); } diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 11deacbf..d5d30e79 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -62,7 +62,7 @@ Map *MapReader::readMap(const std::string &filename) std::fstream fin; fin.open(name.c_str(), std::ios::in); if (!fin.is_open()) { - logger.log("No such file!"); + logger->log("No such file!"); return NULL; } fin.close(); @@ -73,14 +73,14 @@ Map *MapReader::readMap(const std::string &filename) xmlNodePtr node = xmlDocGetRootElement(doc); if (!node || !xmlStrEqual(node->name, BAD_CAST "map")) { - logger.log("Warning: Not a map file (%s)!", filename.c_str()); + logger->log("Warning: Not a map file (%s)!", filename.c_str()); return NULL; } return readMap(node, filename); xmlFreeDoc(doc); } else { - logger.log("Error while parsing map file (%s)!", filename.c_str()); + logger->log("Error while parsing map file (%s)!", filename.c_str()); } return NULL; @@ -115,7 +115,7 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path) } else if (xmlStrEqual(node->name, BAD_CAST "layer")) { - logger.log("- Loading layer %d", layerNr); + logger->log("- Loading layer %d", layerNr); readLayer(node, map, layerNr); layerNr++; } @@ -150,7 +150,7 @@ void MapReader::readLayer(xmlNodePtr node, Map *map, int layer) xmlFree(encoding); if (compression) { - logger.log("Warning: no layer compression supported!"); + logger->log("Warning: no layer compression supported!"); xmlFree(compression); return; } @@ -228,7 +228,7 @@ Tileset* MapReader::readTileset( xmlNodePtr node, const std::string &path, Map *map) { if (xmlHasProp(node, BAD_CAST "source")) { - logger.log("Warning: External tilesets not supported yet."); + logger->log("Warning: External tilesets not supported yet."); return NULL; } @@ -259,7 +259,7 @@ Tileset* MapReader::readTileset( return set; } else { - logger.log("Warning: Failed to load tileset (%s)", source); + logger->log("Warning: Failed to load tileset (%s)", source); } } diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index ba990734..d4a3a037 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -68,7 +68,7 @@ ResourceManager::~ResourceManager() } resources.clear(); - logger.log("ResourceManager::~ResourceManager() cleaned up %d references " + logger->log("ResourceManager::~ResourceManager() cleaned up %d references " "to %d resources", danglingReferences, danglingResources); } @@ -84,7 +84,7 @@ Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, return resIter->second.resource; } - logger.log("ResourceManager::get(%s)", idPath.c_str()); + logger->log("ResourceManager::get(%s)", idPath.c_str()); Resource *resource = NULL; @@ -92,7 +92,7 @@ Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, switch (type) { case MAP: - logger.log("Warning: Map resource not supported."); + logger->log("Warning: Map resource not supported."); break; case MUSIC: { @@ -109,7 +109,7 @@ Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, free(buffer); } else { - logger.log("Warning: resource doesn't exist!"); + logger->log("Warning: resource doesn't exist!"); } } break; @@ -128,15 +128,15 @@ Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, free(buffer); } else { - logger.log("Warning: resource doesn't exist!"); + logger->log("Warning: resource doesn't exist!"); } } break; case SCRIPT: - logger.log("Warning: Script resource not supported."); + logger->log("Warning: Script resource not supported."); break; case TILESET: - logger.log("Warning: Tileset resource not supported."); + logger->log("Warning: Tileset resource not supported."); break; case SOUND_EFFECT: { @@ -153,12 +153,12 @@ Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, free(buffer); } else { - logger.log("Warning: resource doesn't exist!"); + logger->log("Warning: resource doesn't exist!"); } } break; default: - logger.log("Warning: Unknown resource type"); + logger->log("Warning: Unknown resource type"); break; } @@ -231,7 +231,7 @@ void ResourceManager::searchAndAddZipFiles() std::string filePath = std::string("data/") + std::string(findFileInfo.name); - logger.log("Adding to PhysicsFS: %s", findFileInfo.name); + logger->log("Adding to PhysicsFS: %s", findFileInfo.name); // Add the zip file to our PhysicsFS search path PHYSFS_addToSearchPath(filePath.c_str(), 1); @@ -264,7 +264,7 @@ void ResourceManager::searchAndAddZipFiles() std::string filePath = std::string(programPath) + std::string("/") + std::string(direntry->d_name); - logger.log("Adding to PhysicsFS: %s", filePath.c_str()); + logger->log("Adding to PhysicsFS: %s", filePath.c_str()); // Add the zip file to our PhysicsFS search path PHYSFS_addToSearchPath(filePath.c_str(), 1); @@ -279,7 +279,7 @@ void *ResourceManager::loadFile(const std::string &fileName, int &fileSize) { // If the file doesn't exist indicate failure if (!PHYSFS_exists(fileName.c_str())) { - logger.log("Warning: %s not found!", fileName.c_str()); + logger->log("Warning: %s not found!", fileName.c_str()); return NULL; } @@ -288,7 +288,7 @@ void *ResourceManager::loadFile(const std::string &fileName, int &fileSize) // If the handler is an invalid pointer indicate failure if (file == NULL) { - logger.log("Warning: %s failed to load!", fileName.c_str()); + logger->log("Warning: %s failed to load!", fileName.c_str()); return NULL; } |