mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
add a new folder structure redesign organized by packages
This commit is contained in:
@@ -71,7 +71,7 @@ bool Font::load(const std::string& file)
|
||||
{
|
||||
std::stringstream fin;
|
||||
if(!g_resources.loadFile(file, fin)) {
|
||||
error("ERROR: Coult not load font file '",file,"'");
|
||||
logError("ERROR: Coult not load font file '",file,"'");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ bool Font::load(const std::string& file)
|
||||
// load texture
|
||||
m_texture = g_textures.get(textureName);
|
||||
if(!m_texture) {
|
||||
error("ERROR: Failed to load image for font file '",file,"'");
|
||||
logError("ERROR: Failed to load image for font file '",file,"'");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ bool Font::load(const std::string& file)
|
||||
m_glyphHeight);
|
||||
}
|
||||
} catch(OTMLException e) {
|
||||
error("ERROR: Malformed font file \"", file.c_str(), "\":\n ", e.what());
|
||||
logError("ERROR: Malformed font file \"", file.c_str(), "\":\n ", e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -57,7 +57,7 @@ FontPtr Fonts::get(const std::string& fontName)
|
||||
return font;
|
||||
}
|
||||
|
||||
fatal("ERROR: Font '",fontName,"' not found");
|
||||
logFatal("ERROR: Font '",fontName,"' not found");
|
||||
return FontPtr();
|
||||
}
|
||||
|
||||
|
@@ -40,8 +40,8 @@ void Graphics::init()
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
info("GPU ", glGetString(GL_RENDERER));
|
||||
info("OpenGL ", glGetString(GL_VERSION));
|
||||
logInfo("GPU ", glGetString(GL_RENDERER));
|
||||
logInfo("OpenGL ", glGetString(GL_VERSION));
|
||||
}
|
||||
|
||||
void Graphics::terminate()
|
||||
|
@@ -37,7 +37,7 @@ uint Texture::internalLoadGLTexture(uchar *pixels, int channels, int width, int
|
||||
GLint texSize;
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize);
|
||||
if(width > texSize || height > texSize) {
|
||||
error("loading texture with size ",width,"x",height," failed, the maximum size is ",texSize,"x",texSize);
|
||||
logError("loading texture with size ",width,"x",height," failed, the maximum size is ",texSize,"x",texSize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -49,14 +49,14 @@ TexturePtr Textures::get(const std::string& textureFile)
|
||||
if(!texture) {
|
||||
// currently only png textures are supported
|
||||
if(!boost::ends_with(textureFile, ".png")) {
|
||||
error("ERROR: Unable to load texture '",textureFile,"', file format no supported.");
|
||||
logError("ERROR: Unable to load texture '",textureFile,"', file format no supported.");
|
||||
return texture;
|
||||
}
|
||||
|
||||
// load texture file data
|
||||
std::stringstream fin;
|
||||
if(!g_resources.loadFile(textureFile, fin)) {
|
||||
error("ERROR: Unable to load texture '",textureFile,"', file could not be read.");
|
||||
logError("ERROR: Unable to load texture '",textureFile,"', file could not be read.");
|
||||
return texture;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ TexturePtr Textures::get(const std::string& textureFile)
|
||||
// load the texture
|
||||
texture = TexturePtr(TextureLoader::loadPNG(fin));
|
||||
if(!texture)
|
||||
error("ERROR: Unable to load texture '",textureFile,"'");
|
||||
logError("ERROR: Unable to load texture '",textureFile,"'");
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
|
Reference in New Issue
Block a user