Misc - Added methods for extracting resource reference count and resource size
This commit is contained in:
parent
6414fc1a4f
commit
3bdb65f92a
|
@ -437,6 +437,38 @@ int ResourceManager::GetResourceId(const wchar_t c[])
|
|||
|
||||
return -1;
|
||||
}
|
||||
int ResourceManager::GetResourceCount(const wchar_t filename[])
|
||||
{
|
||||
ResourceData *t = FindResource(this->resources, filename);
|
||||
|
||||
if(t) return t->referenceCount;
|
||||
|
||||
return 0;
|
||||
}
|
||||
int ResourceManager::GetResourceCount(const HRESOURCE& resource)
|
||||
{
|
||||
ResourceData *t = FindResource(this->resources, resource);
|
||||
|
||||
if(t) return t->referenceCount;
|
||||
|
||||
return 0;
|
||||
}
|
||||
int ResourceManager::GetResourceSize(const wchar_t filename[])
|
||||
{
|
||||
ResourceData *t = FindResource(this->resources, filename);
|
||||
|
||||
if(t) return t->resourceSize;
|
||||
|
||||
return 0;
|
||||
}
|
||||
int ResourceManager::GetResourceSize(const HRESOURCE& resource)
|
||||
{
|
||||
ResourceData *t = FindResource(this->resources, resource);
|
||||
|
||||
if(t) return t->resourceSize;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -148,6 +148,14 @@ namespace Oyster
|
|||
* @return Returns the accociated ID
|
||||
*/
|
||||
int GetResourceId(const wchar_t filename[]);
|
||||
|
||||
int GetResourceCount(const wchar_t filename[]);
|
||||
|
||||
int GetResourceCount(const HRESOURCE& resource);
|
||||
|
||||
int GetResourceSize(const wchar_t filename[]);
|
||||
|
||||
int GetResourceSize(const HRESOURCE& resource);
|
||||
|
||||
private:
|
||||
ResourceManager(const ResourceManager& obj);
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace Utility
|
|||
ReferenceCount() :count(0) { }
|
||||
ReferenceCount(const ReferenceCount& o) { count = o.count; }
|
||||
inline const ReferenceCount& operator=(const ReferenceCount& o) { count = o.count; return *this;}
|
||||
operator int() { return this->count; }
|
||||
inline void Incref() { this->count++; }
|
||||
inline void Incref(int c) { this->count += c; }
|
||||
inline int Decref() { return --this->count;}
|
||||
|
|
Loading…
Reference in New Issue