diff --git a/gui/resources.cpp b/gui/resources.cpp
index e0016fc..1e2e7f9 100644
--- a/gui/resources.cpp
+++ b/gui/resources.cpp
@@ -258,21 +258,32 @@
 	mSurfaces.clear();
 }
 
-Resource* ResourceManager::FindResource(std::string name)
+FontResource* ResourceManager::FindFont(const std::string& name) const
 {
-	std::vector<Resource*>::iterator iter;
-
-	for (iter = mResources.begin(); iter != mResources.end(); iter++)
-	{
-		if (name == (*iter)->GetName())
-			return (*iter);
-	}
+	for (std::vector<FontResource*>::const_iterator it = mFonts.begin(); it != mFonts.end(); ++it)
+		if (name == (*it)->GetName())
+			return *it;
 	return NULL;
 }
 
-ResourceManager::ResourceManager(xml_node<>* resList, ZipArchive* pZip)
+ImageResource* ResourceManager::FindImage(const std::string& name) const
 {
-	LoadResources(resList, pZip);
+	for (std::vector<ImageResource*>::const_iterator it = mImages.begin(); it != mImages.end(); ++it)
+		if (name == (*it)->GetName())
+			return *it;
+	return NULL;
+}
+
+AnimationResource* ResourceManager::FindAnimation(const std::string& name) const
+{
+	for (std::vector<AnimationResource*>::const_iterator it = mAnimations.begin(); it != mAnimations.end(); ++it)
+		if (name == (*it)->GetName())
+			return *it;
+	return NULL;
+}
+
+ResourceManager::ResourceManager()
+{
 }
 
 void ResourceManager::LoadResources(xml_node<>* resList, ZipArchive* pZip)
@@ -285,14 +296,18 @@
 	while (child != NULL)
 	{
 		xml_attribute<>* attr = child->first_attribute("type");
-		if (!attr)
-			break;
 
-		Resource* res = NULL;
-		std::string type = attr->value();
+		bool error = false;
+		std::string type = attr ? attr->value() : "*unspecified*";
 		if (type == "font")
 		{
-			res = new FontResource(child, pZip);
+			FontResource* res = new FontResource(child, pZip);
+			if (res->GetResource())
+				mFonts.push_back(res);
+			else {
+				error = true;
+				delete res;
+			}
 		}
 		else if (type == "image")
 		{
@@ -300,7 +315,13 @@
 			xml_attribute<>* retain_aspect_ratio = child->first_attribute("retainaspect");
 			if (retain_aspect_ratio)
 				retain = 1; // the value does not matter, if retainaspect is present, we assume that we want to retain it
-			res = new ImageResource(child, pZip, retain);
+			ImageResource* res = new ImageResource(child, pZip, retain);
+			if (res->GetResource())
+				mImages.push_back(res);
+			else {
+				error = true;
+				delete res;
+			}
 		}
 		else if (type == "animation")
 		{
@@ -308,14 +329,21 @@
 			xml_attribute<>* retain_aspect_ratio = child->first_attribute("retainaspect");
 			if (retain_aspect_ratio)
 				retain = 1; // the value does not matter, if retainaspect is present, we assume that we want to retain it
-			res = new AnimationResource(child, pZip, retain);
+			AnimationResource* res = new AnimationResource(child, pZip, retain);
+			if (res->GetResourceCount())
+				mAnimations.push_back(res);
+			else {
+				error = true;
+				delete res;
+			}
 		}
 		else
 		{
 			LOGERR("Resource type (%s) not supported.\n", type.c_str());
+			error = true;
 		}
 
-		if (res == NULL || !res->loadedOK())
+		if (error)
 		{
 			std::string res_name;
 			if (child->first_attribute("name"))
@@ -327,12 +355,6 @@
 				LOGERR("Resource (%s)-(%s) failed to load\n", type.c_str(), res_name.c_str());
 			} else
 				LOGERR("Resource type (%s) failed to load\n", type.c_str());
-
-			delete res;
-		}
-		else
-		{
-			mResources.push_back(res);
 		}
 
 		child = child->next_sibling("resource");
@@ -341,10 +363,12 @@
 
 ResourceManager::~ResourceManager()
 {
-	std::vector<Resource*>::iterator iter;
+	for (std::vector<FontResource*>::iterator it = mFonts.begin(); it != mFonts.end(); ++it)
+		delete *it;
 
-	for (iter = mResources.begin(); iter != mResources.end(); iter++)
-		delete *iter;
+	for (std::vector<ImageResource*>::iterator it = mImages.begin(); it != mImages.end(); ++it)
+		delete *it;
 
-	mResources.clear();
+	for (std::vector<AnimationResource*>::iterator it = mAnimations.begin(); it != mAnimations.end(); ++it)
+		delete *it;
 }
