X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fscreen.cpp;h=6d67820126f5ab24cee9dab9a5ca40934c8a5417;hp=2d63bc945d85740b3fb579f1ab7df09507916fb7;hb=57c3c69cbc7d9b3724874fd83cd001984ac21b6a;hpb=280f0d7d34b9bd377fb49580b69aebcbd60cc440 diff --git a/src/screen.cpp b/src/screen.cpp index 2d63bc9..6d67820 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -309,7 +309,7 @@ void Screen::RenderBMP(const char * filename) const int w = bmp->w; int h = bmp->h; - GLenum texture_format; + GLenum texture_format = GL_RGBA; switch (bmp->format->BytesPerPixel) { case 4: //contains alpha @@ -425,6 +425,8 @@ void Screen::DebugFontFlush() glDisable(GL_BLEND); + m_debug_font_vertices.Invalidate(); + m_debug_font_indices.Invalidate(); m_debug_font_vertex_head = 0; m_debug_font_index_head = 0; } @@ -451,7 +453,7 @@ void Screen::DebugFontPrint(const char* str) DebugFontPrint(str); return; } - if (*str >= 32 && *str < 128) { + if (*str >= 32 && (unsigned char)(*str) < 128) { stbtt_aligned_quad q; stbtt_GetBakedQuad(m_debug_font_rects, 1024,1024, *str-32, &m_debug_font_x,&m_debug_font_y,&q,1); size_t index = vertexData.Add({q.x0, q.y0, q.s0, q.t0});