From 51a1b3ecff054787361f4021826a5c6b0de97f4b Mon Sep 17 00:00:00 2001 From: Pontus Fransson Date: Mon, 27 Jan 2014 13:54:56 +0100 Subject: [PATCH] GL - Resource get size --- Code/Misc/Resource/OResourceHandler.cpp | 7 +++++++ Code/Misc/Resource/OysterResource.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/Code/Misc/Resource/OResourceHandler.cpp b/Code/Misc/Resource/OResourceHandler.cpp index 918ecd1d..52d93af0 100644 --- a/Code/Misc/Resource/OResourceHandler.cpp +++ b/Code/Misc/Resource/OResourceHandler.cpp @@ -214,7 +214,14 @@ int OysterResource::GetResourceId(const wchar_t c[]) return -1; } +int OysterResource::GetResourceSize(const OHRESOURCE& resource) +{ + OResource* t = resourcePrivate.FindResource(resource); + if(t) return t->GetResourceSize(); + + return -1; +} OResource* ResourcePrivate::FindResource(const OHRESOURCE& h) const { diff --git a/Code/Misc/Resource/OysterResource.h b/Code/Misc/Resource/OysterResource.h index d6509b54..8adce704 100644 --- a/Code/Misc/Resource/OysterResource.h +++ b/Code/Misc/Resource/OysterResource.h @@ -150,6 +150,11 @@ namespace Oyster * @return Returns the accociated ID */ static int GetResourceId(const wchar_t filename[]); + + + static int GetResourceSize(const OHRESOURCE& resource); + + }; }