diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-14 00:53:22 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-14 00:53:22 +0000 |
commit | 812103cea68f1da2004dd518c5ad3b448a0e1729 (patch) | |
tree | b4bc86a077385a219474bcb5bca727e0703ed52b /src/resources | |
parent | 3628aae5ef1be719603d4aa8e1b209cf5e04520c (diff) | |
download | mana-812103cea68f1da2004dd518c5ad3b448a0e1729.tar.gz mana-812103cea68f1da2004dd518c5ad3b448a0e1729.tar.bz2 mana-812103cea68f1da2004dd518c5ad3b448a0e1729.tar.xz mana-812103cea68f1da2004dd518c5ad3b448a0e1729.zip |
Simplified logging for the sake of simplicity.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/image.cpp | 8 | ||||
-rw-r--r-- | src/resources/resourcemanager.cpp | 19 |
2 files changed, 11 insertions, 16 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index dc5df41c..da0be097 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -40,9 +40,7 @@ Image::~Image() Image* Image::load(const std::string &filePath, int flags) { - std::stringstream msg; - msg << "Image::load(" << filePath << ")"; - log(msg.str()); + log("Image::load(%s)", filePath.c_str()); // Attempt to use SDL_Image to load the file. SDL_Surface *tmpImage = IMG_Load(filePath.c_str()); @@ -59,8 +57,8 @@ Image* Image::load(const std::string &filePath, int flags) // Check if the file was opened and return the appropriate value. if (!image) { - log("Error", "Image load failed : %s", IMG_GetError()); - //log("Error", "Image load failed : %s", filePath.c_str()); + log("Error: Image load failed: %s", IMG_GetError()); + //log("Error: Image load failed: %s", filePath.c_str()); return NULL; } diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 582bc613..0d6412d8 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -62,11 +62,8 @@ ResourceManager::~ResourceManager() } resources.clear(); - std::stringstream msg; - msg << "ResourceManager::~ResourceManager() cleaned up " << - danglingReferences << " references to " << danglingResources << - " resources"; - log(msg.str()); + log("ResourceManager::~ResourceManager() cleaned up %d references to %d" + " resources", danglingReferences, danglingResources); } Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, @@ -100,10 +97,10 @@ Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, switch (type) { case MAP: - warning("Map resource not supported."); + log("Warning: Map resource not supported."); break; case MUSIC: - warning("Music resource not supported."); + log("Warning: Music resource not supported."); break; case IMAGE: // Attempt to create and load our image object. @@ -111,16 +108,16 @@ Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, reinterpret_cast<Resource*>(Image::load(filePath, flags)); break; case SCRIPT: - warning("Script resource not supported."); + log("Warning: Script resource not supported."); break; case TILESET: - warning("Tileset resource not supported."); + log("Warning: Tileset resource not supported."); break; case SOUND_EFFECT: - warning("Sound FX resource not supported."); + log("Warning: Sound FX resource not supported."); break; default: - warning("Unknown resource type"); + log("Warning: Unknown resource type"); break; } |