Minor changes in file type handling

This commit is contained in:
Eduardo Bart
2013-01-27 23:23:53 -02:00
parent 4536c68f00
commit 773837da98
18 changed files with 43 additions and 50 deletions

View File

@@ -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)

View File

@@ -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)) {

View 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

View File

@@ -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()) {