1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-24 17:26:41 +00:00

Hackish fix to load glf files even if corrupt (this is required or the next commit...)

This commit is contained in:
fgenesis 2012-07-10 22:18:21 +02:00
parent 7b2fa39428
commit 24b08b1043

View file

@ -47,7 +47,7 @@ GLFont::~GLFont ()
//*******************************************************************
bool GLFont::Create (const char *file_name, int tex, bool loadTexture)
{
int num_chars, num_tex_bytes;
ByteBuffer::uint32 num_chars, num_tex_bytes;
char *tex_bytes;
//Destroy the old font if there was one, just to be safe
@ -102,8 +102,8 @@ bool GLFont::Create (const char *file_name, int tex, bool loadTexture)
//Read texture pixel data
num_tex_bytes = header.tex_width * header.tex_height * 2;
tex_bytes = new char[num_tex_bytes];
//input.read(tex_bytes, num_tex_bytes);
bb.read(tex_bytes, num_tex_bytes);
// HACK: Aquaria uses override textures, so we can live with the truncation.
bb.read(tex_bytes, std::min(num_tex_bytes, bb.readable()));
//Build2DMipmaps(3, header.tex_width, header.tex_height, GL_UNSIGNED_BYTE, tex_bytes, 1);