From 8ed152d3fec51417bded56629e5f3a0f5164aaa4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 7 Nov 2009 11:02:47 +0000 Subject: [PATCH] Bugfixes --- source/gldbg.cpp | 1 + source/glprint.c | 3 +++ source/glstate.cpp | 2 +- source/tracer.cpp | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/gldbg.cpp b/source/gldbg.cpp index b95f81d..d2ca85e 100644 --- a/source/gldbg.cpp +++ b/source/gldbg.cpp @@ -26,6 +26,7 @@ Application::RegApp GlDbg::reg; GlDbg::GlDbg(int argc, char **argv): cmd_interp(*this), process(vector(argv+1, argv+argc)), + buf_offset(0), flushing(false), got_sigchld(false) { diff --git a/source/glprint.c b/source/glprint.c index 3f6db65..0081953 100644 --- a/source/glprint.c +++ b/source/glprint.c @@ -74,6 +74,9 @@ static const char *print_array(const char *fmt, const void *data, unsigned elem_ char *ptr; unsigned i; + if(!data) + return "NULL"; + for(cptr=fmt; (type<2 && *cptr); ++cptr) { if(*cptr=='%') diff --git a/source/glstate.cpp b/source/glstate.cpp index ff8f3a2..90b0ac0 100644 --- a/source/glstate.cpp +++ b/source/glstate.cpp @@ -237,7 +237,7 @@ void GlState::glMultiTexCoord4f(void *user_data, unsigned index, float s, float void GlState::glActiveTexture(void *user_data, unsigned index) { - reinterpret_cast(user_data)->active_tex = index; + reinterpret_cast(user_data)->active_tex = index-GL_TEXTURE0; } void GlState::glBindTexture(void *user_data, GLenum target, unsigned id) diff --git a/source/tracer.cpp b/source/tracer.cpp index 7ce00fe..d92da29 100644 --- a/source/tracer.cpp +++ b/source/tracer.cpp @@ -20,6 +20,7 @@ Tracer::Tracer(): Tracer::~Tracer() { + delete glprint; if(delete_out) delete out; } -- 2.45.2