mirror of
https://github.com/edubart/otclient.git
synced 2025-12-02 16:06:51 +01:00
Minor changes in file type handling
This commit is contained in:
@@ -4,7 +4,7 @@ if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6)
|
||||
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6)
|
||||
|
||||
# client options
|
||||
add_definitions(-DOTCLIENT)
|
||||
add_definitions(-DCLIENT)
|
||||
option(BOT_PROTECTION "Enable bot protection" ON)
|
||||
if(BOT_PROTECTION)
|
||||
add_definitions(-DBOT_PROTECTION)
|
||||
|
||||
@@ -66,7 +66,7 @@ PainterShaderProgramPtr ShaderManager::createFragmentShader(const std::string& n
|
||||
if(!shader)
|
||||
return nullptr;
|
||||
|
||||
file = g_resources.guessFileType(file, "frag");
|
||||
file = g_resources.guessFilePath(file, "frag");
|
||||
|
||||
shader->addShaderFromSourceCode(Shader::Vertex, glslMainWithTexCoordsVertexShader + glslPositionOnlyVertexShader);
|
||||
if(!shader->addShaderFromSourceFile(Shader::Fragment, file)) {
|
||||
|
||||
@@ -45,7 +45,7 @@ bool SpriteManager::loadSpr(std::string file)
|
||||
m_signature = 0;
|
||||
m_loaded = false;
|
||||
try {
|
||||
file = g_resources.guessFileType(file, "spr");
|
||||
file = g_resources.guessFilePath(file, "spr");
|
||||
|
||||
m_spritesFile = g_resources.openFile(file);
|
||||
// cache file buffer to avoid lags from hard drive
|
||||
|
||||
@@ -66,7 +66,7 @@ bool ThingTypeManager::loadDat(std::string file)
|
||||
m_datLoaded = false;
|
||||
m_datSignature = 0;
|
||||
try {
|
||||
file = g_resources.guessFileType(file, "dat");
|
||||
file = g_resources.guessFilePath(file, "dat");
|
||||
|
||||
FileStreamPtr fin = g_resources.openFile(file);
|
||||
|
||||
@@ -100,7 +100,7 @@ bool ThingTypeManager::loadDat(std::string file)
|
||||
bool ThingTypeManager::loadOtml(std::string file)
|
||||
{
|
||||
try {
|
||||
file = g_resources.guessFileType(file, "otml");
|
||||
file = g_resources.guessFilePath(file, "otml");
|
||||
|
||||
OTMLDocumentPtr doc = OTMLDocument::parse(file);
|
||||
for(const OTMLNodePtr& node : doc->children()) {
|
||||
|
||||
Reference in New Issue
Block a user