Restore support for animated png files

* Rework resource manager
* Add missing files
* Improve some graphics classes
This commit is contained in:
Eduardo Bart
2013-01-08 19:31:41 -02:00
parent fdcad184f9
commit 0120b7554c
47 changed files with 807 additions and 161 deletions

View File

@@ -165,7 +165,7 @@ void CreatureManager::clearSpawns()
void CreatureManager::loadMonsters(const std::string& file)
{
TiXmlDocument doc;
doc.Parse(g_resources.loadFile(file).c_str());
doc.Parse(g_resources.readFileContents(file).c_str());
if(doc.Error())
stdext::throw_exception(stdext::format("cannot open monsters file '%s': '%s'", file, doc.ErrorDesc()));
@@ -187,7 +187,7 @@ void CreatureManager::loadMonsters(const std::string& file)
void CreatureManager::loadSingleCreature(const std::string& file)
{
loadCreatureBuffer(g_resources.loadFile(file));
loadCreatureBuffer(g_resources.readFileContents(file));
}
void CreatureManager::loadNpcs(const std::string& folder)
@@ -205,7 +205,7 @@ void CreatureManager::loadNpcs(const std::string& folder)
if(boost::filesystem::is_directory(it->status()))
continue;
loadCreatureBuffer(g_resources.loadFile(tmp + f));
loadCreatureBuffer(g_resources.readFileContents(tmp + f));
}
}
@@ -222,7 +222,7 @@ void CreatureManager::loadSpawns(const std::string& fileName)
}
TiXmlDocument doc;
doc.Parse(g_resources.loadFile(fileName).c_str());
doc.Parse(g_resources.readFileContents(fileName).c_str());
if(doc.Error())
stdext::throw_exception(stdext::format("cannot load spawns xml file '%s: '%s'", fileName, doc.ErrorDesc()));

View File

@@ -114,7 +114,7 @@ const HousePtr& HouseManager::getHouse(uint32 houseId)
void HouseManager::load(const std::string& fileName)
{
TiXmlDocument doc;
doc.Parse(g_resources.loadFile(fileName).c_str());
doc.Parse(g_resources.readFileContents(fileName).c_str());
if(doc.Error())
stdext::throw_exception(stdext::format("failed to load '%s': %s (House XML)", fileName, doc.ErrorDesc()));

View File

@@ -125,7 +125,7 @@ ImagePtr SpriteManager::getSpriteImage(int id)
read += 4 + (3 * coloredPixels);
}
// fill remaining pixels with alpha
// fill reamaning pixels with alpha
while(writePos < SPRITE_DATA_SIZE) {
pixels[writePos + 0] = 0x00;
pixels[writePos + 1] = 0x00;

View File

@@ -139,7 +139,7 @@ void ThingTypeManager::loadXml(const std::string& file)
stdext::throw_exception("OTB must be loaded before XML");
TiXmlDocument doc;
doc.Parse(g_resources.loadFile(file).c_str());
doc.Parse(g_resources.readFileContents(file).c_str());
if(doc.Error())
stdext::throw_exception(stdext::format("failed to parse '%s': '%s'", file, doc.ErrorDesc()));