From ede99eecb4bc81d89fc4f3f60bacdfba868ba9e1 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Fri, 29 Mar 2013 16:55:45 +0100 Subject: [PATCH] Add warn log when falling back to xor texture --- gfx/texture.cpp | 2 ++ gfx_es2/draw_buffer.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/gfx/texture.cpp b/gfx/texture.cpp index 54c7dd61db..1d89dd2229 100644 --- a/gfx/texture.cpp +++ b/gfx/texture.cpp @@ -113,6 +113,7 @@ bool Texture::Load(const char *filename) { if (!strcmp("png", &name[len-3]) || !strcmp("PNG", &name[len-3])) { if (!LoadPNG(fn)) { + WLOG("WARNING: Failed to load .png %s, falling back to ugly gray XOR pattern!", fn); LoadXOR(); return false; } else { @@ -124,6 +125,7 @@ bool Texture::Load(const char *filename) { if (LoadZIM(name)) { return true; } else { + WLOG("WARNING: Failed to load .zim texture %s, falling back to ugly gray XOR pattern!", fn); LoadXOR(); return false; } diff --git a/gfx_es2/draw_buffer.cpp b/gfx_es2/draw_buffer.cpp index 6e2545e001..87273b87d0 100644 --- a/gfx_es2/draw_buffer.cpp +++ b/gfx_es2/draw_buffer.cpp @@ -120,6 +120,13 @@ void DrawBuffer::Flush(const GLSLProgram *program, bool set_blend_state) { } void DrawBuffer::V(float x, float y, float z, uint32 color, float u, float v) { +#ifdef _DEBUG + if (count_ >= MAX_VERTS) { + FLOG("Overflowed the DrawBuffer"); + return; + } +#endif + Vertex *vert = &verts_[count_++]; vert->x = x; vert->y = y;