mirror of
https://github.com/edubart/otclient.git
synced 2025-12-02 16:06:51 +01:00
Restore support for animated png files
* Rework resource manager * Add missing files * Improve some graphics classes
This commit is contained in:
@@ -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()));
|
||||
|
||||
|
||||
@@ -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()));
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user