diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-13 23:22:52 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-13 23:22:52 +0000 |
commit | 25b87e0d02f285fa8bacc4369f1d9251cf815a40 (patch) | |
tree | 7b28f4bf60ac11b1ec77edff528eea8741898f29 /src/resources | |
parent | 00d7a2cee3904a5ef11b884d68b111ce2d7fd8a9 (diff) | |
download | mana-client-25b87e0d02f285fa8bacc4369f1d9251cf815a40.tar.gz mana-client-25b87e0d02f285fa8bacc4369f1d9251cf815a40.tar.bz2 mana-client-25b87e0d02f285fa8bacc4369f1d9251cf815a40.tar.xz mana-client-25b87e0d02f285fa8bacc4369f1d9251cf815a40.zip |
Now the resource manager will log a bit about images and cleanup.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/image.cpp | 7 | ||||
-rw-r--r-- | src/resources/resourcemanager.cpp | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index f84826bb..dc5df41c 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -40,9 +40,10 @@ Image::~Image() Image* Image::load(const std::string &filePath, int flags) { -#ifdef __DEBUG - std::cout << "Image::load(" << filePath << ")\n"; -#endif + std::stringstream msg; + msg << "Image::load(" << filePath << ")"; + log(msg.str()); + // Attempt to use SDL_Image to load the file. SDL_Surface *tmpImage = IMG_Load(filePath.c_str()); SDL_SetColorKey(tmpImage, SDL_SRCCOLORKEY | SDL_RLEACCEL, diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 1a2c7a5f..582bc613 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -62,11 +62,11 @@ ResourceManager::~ResourceManager() } resources.clear(); -#ifdef __DEBUG - std::cout << "ResourceManager::~ResourceManager() cleaned up " << + std::stringstream msg; + msg << "ResourceManager::~ResourceManager() cleaned up " << danglingReferences << " references to " << danglingResources << - " resources\n"; -#endif + " resources"; + log(msg.str()); } Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, |