diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2012-10-19 15:39:49 +0100 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2012-10-19 15:39:49 +0100 |
commit | 958d980c85810ed01ad45f8c2af924368dde20f4 (patch) | |
tree | b1a9464219cbe84224fce7f0fca98a28b59eb4e5 /retrace/glretrace_glx.cpp | |
parent | cb9d2e002ba98b743851db4016dc68ba3ddbd845 (diff) |
Determine core32 from the traces.
Diffstat (limited to 'retrace/glretrace_glx.cpp')
-rw-r--r-- | retrace/glretrace_glx.cpp | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/retrace/glretrace_glx.cpp b/retrace/glretrace_glx.cpp index 6ff17d8c..918940f0 100644 --- a/retrace/glretrace_glx.cpp +++ b/retrace/glretrace_glx.cpp @@ -129,29 +129,9 @@ static void retrace_glXCreateNewContext(trace::Call &call) { } static void retrace_glXCreatePbuffer(trace::Call &call) { - int width = 0; - int height = 0; - - const trace::Array *attrib_list = dynamic_cast<const trace::Array *>(&call.arg(2)); - if (attrib_list) { - for (size_t i = 0; i + 1 < attrib_list->values.size(); i += 2) { - int param = attrib_list->values[i]->toSInt(); - if (param == 0) { - break; - } - - int value = attrib_list->values[i + 1]->toSInt(); - - switch (param) { - case GLX_PBUFFER_WIDTH: - width = value; - break; - case GLX_PBUFFER_HEIGHT: - height = value; - break; - } - } - } + const trace::Value *attrib_list = dynamic_cast<const trace::Array *>(&call.arg(2)); + int width = glretrace::parseAttrib(attrib_list, GLX_PBUFFER_WIDTH, 0); + int height = glretrace::parseAttrib(attrib_list, GLX_PBUFFER_HEIGHT, 0); unsigned long long orig_drawable = call.ret->toUInt(); |