mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
Minor changes in file type handling
This commit is contained in:
@@ -48,7 +48,7 @@ void FontManager::clearFonts()
|
||||
bool FontManager::importFont(std::string file)
|
||||
{
|
||||
try {
|
||||
file = g_resources.guessFileType(file, "otfont");
|
||||
file = g_resources.guessFilePath(file, "otfont");
|
||||
|
||||
OTMLDocumentPtr doc = OTMLDocument::parse(file);
|
||||
OTMLNodePtr fontNode = doc->at("Font");
|
||||
|
@@ -39,7 +39,7 @@ ImagePtr Image::load(std::string file)
|
||||
{
|
||||
ImagePtr image;
|
||||
try {
|
||||
file = g_resources.guessFileType(file, "png");
|
||||
file = g_resources.guessFilePath(file, "png");
|
||||
|
||||
// load image file data
|
||||
image = loadPNG(file);
|
||||
|
@@ -29,7 +29,7 @@ ParticleManager g_particles;
|
||||
bool ParticleManager::importParticle(std::string file)
|
||||
{
|
||||
try {
|
||||
file = g_resources.guessFileType(file, "otps");
|
||||
file = g_resources.guessFilePath(file, "otps");
|
||||
|
||||
OTMLDocumentPtr doc = OTMLDocument::parse(file);
|
||||
for(const OTMLNodePtr& node : doc->children()) {
|
||||
|
@@ -78,7 +78,7 @@ TexturePtr TextureManager::getTexture(const std::string& fileName)
|
||||
// texture not found, load it
|
||||
if(!texture) {
|
||||
try {
|
||||
std::string filePathEx = g_resources.guessFileType(filePath, "png");
|
||||
std::string filePathEx = g_resources.guessFilePath(filePath, "png");
|
||||
|
||||
// load texture file data
|
||||
std::stringstream fin;
|
||||
|
Reference in New Issue
Block a user