* Patches by Sean Morrison, from BzFlag commits r15755 and r14843: + Only delete textures if there is at least one of them. + Ensure that the FTTextureFont data members get set for all cases. * Added Sean to the AUTHORS file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/AUTHORS b/AUTHORS
index 49ba40c..c55d8f4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,6 +16,7 @@ Contributors:
Robert Bell (pixmap font modifications)
Sam Hocevar <sam@zoy.org> (build system, new maintainer)
Éric Beets <ericbeets@free.fr> (C bindings)
+ Sean Morrison (bug fixes, new maintainer)
Bug fixes:
diff --git a/src/FTFont/FTTextureFont.cpp b/src/FTFont/FTTextureFont.cpp
index 40248f1..7828bd1 100644
--- a/src/FTFont/FTTextureFont.cpp
+++ b/src/FTFont/FTTextureFont.cpp
@@ -111,7 +111,11 @@ FTTextureFontImpl::FTTextureFontImpl(const unsigned char *pBufferBytes,
FTTextureFontImpl::~FTTextureFontImpl()
{
- glDeleteTextures(textureIDList.size(), (const GLuint*)&textureIDList[0]);
+ if(textureIDList.size())
+ {
+ glDeleteTextures(textureIDList.size(),
+ (const GLuint*)&textureIDList[0]);
+ }
}
@@ -160,6 +164,7 @@ void FTTextureFontImpl::CalculateTextureSize()
{
if(!maximumGLTextureSize)
{
+ maximumGLTextureSize = 1024;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&maximumGLTextureSize);
assert(maximumGLTextureSize); // If you hit this then you have an invalid OpenGL context.
}