more OutputDebugString() conversions, and removed a useless trace in the base WResource destructor - instead, moved it up to WCachedResource so that we can output the filename of the resource that is being destroyed.
This commit is contained in:
@@ -38,7 +38,7 @@ public:
|
|||||||
friend class WResourceManager;
|
friend class WResourceManager;
|
||||||
template<class cacheItem,class cacheActual> friend class WCache;
|
template<class cacheItem,class cacheActual> friend class WCache;
|
||||||
|
|
||||||
virtual ~WCachedResource() {};
|
virtual ~WCachedResource();
|
||||||
|
|
||||||
string mFilename;
|
string mFilename;
|
||||||
virtual void Refresh()=0; //Basically calls Attempt(filename) and remaps in situ.
|
virtual void Refresh()=0; //Basically calls Attempt(filename) and remaps in situ.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "../include/config.h"
|
#include "../include/config.h"
|
||||||
|
#include "../include/DebugRoutines.h"
|
||||||
#include "../include/utils.h"
|
#include "../include/utils.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@@ -14,8 +15,6 @@
|
|||||||
|
|
||||||
//WResource
|
//WResource
|
||||||
WResource::~WResource(){
|
WResource::~WResource(){
|
||||||
OutputDebugString("~WResource()\n");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
WResource::WResource(){
|
WResource::WResource(){
|
||||||
locks = WRES_UNLOCKED;
|
locks = WRES_UNLOCKED;
|
||||||
@@ -60,6 +59,12 @@ void WResource::unlock(bool force){
|
|||||||
void WResource::hit(){
|
void WResource::hit(){
|
||||||
lastTime = resources.nowTime();
|
lastTime = resources.nowTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WCachedResource::~WCachedResource()
|
||||||
|
{
|
||||||
|
DebugTrace("Destroying WCachedResource: " << mFilename);
|
||||||
|
}
|
||||||
|
|
||||||
//WCachedTexture
|
//WCachedTexture
|
||||||
WCachedTexture::WCachedTexture(){
|
WCachedTexture::WCachedTexture(){
|
||||||
texture = NULL;
|
texture = NULL;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "../include/config.h"
|
#include "../include/config.h"
|
||||||
|
#include "../include/DebugRoutines.h"
|
||||||
#include "../include/utils.h"
|
#include "../include/utils.h"
|
||||||
#include "../include/GameOptions.h"
|
#include "../include/GameOptions.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -160,12 +161,7 @@ void WResourceManager::FlattenTimes(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
WResourceManager::WResourceManager(){
|
WResourceManager::WResourceManager(){
|
||||||
|
DebugTrace("Init WResourceManager : " << addressof(this));
|
||||||
#ifdef WIN32
|
|
||||||
char buf [4096];
|
|
||||||
sprintf(buf, " Init WResourceManager : %p\n", this);
|
|
||||||
OutputDebugString(buf);
|
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_CACHE
|
#ifdef DEBUG_CACHE
|
||||||
menuCached = 0;
|
menuCached = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -1459,7 +1455,7 @@ bool WCache<cacheItem, cacheActual>::Delete(cacheItem * item){
|
|||||||
cacheSize -= isize;
|
cacheSize -= isize;
|
||||||
#ifdef DEBUG_CACHE
|
#ifdef DEBUG_CACHE
|
||||||
if(cacheItems == 0)
|
if(cacheItems == 0)
|
||||||
OutputDebugString("cacheItems out of sync.\n");
|
DebugTrace("cacheItems out of sync.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cacheItems--;
|
cacheItems--;
|
||||||
|
|||||||
Reference in New Issue
Block a user