[Scummvm-git-logs] scummvm master -> 8ae516bd527d2abefc7f2aa93add01ef1373ccec
aquadran
noreply at scummvm.org
Sun Jan 2 08:23:47 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a4ec998a51 TINYGL: Small corrections for params type
8ae516bd52 TINYGL: Janitorial
Commit: a4ec998a51336dd410eaf179b23cee10d4132f26
https://github.com/scummvm/scummvm/commit/a4ec998a51336dd410eaf179b23cee10d4132f26
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2022-01-02T09:20:34+01:00
Commit Message:
TINYGL: Small corrections for params type
Changed paths:
graphics/tinygl/api.cpp
graphics/tinygl/misc.cpp
graphics/tinygl/opinfo.h
graphics/tinygl/texture.cpp
diff --git a/graphics/tinygl/api.cpp b/graphics/tinygl/api.cpp
index 355b0d92c0a..ccff6985e63 100644
--- a/graphics/tinygl/api.cpp
+++ b/graphics/tinygl/api.cpp
@@ -225,7 +225,7 @@ void tglStencilMask(TGLuint mask) {
TinyGL::GLContext *c = TinyGL::gl_get_context();
TinyGL::GLParam p[2];
p[0].op = TinyGL::OP_StencilMask;
- p[1].i = mask;
+ p[1].ui = mask;
c->gl_add_op(p);
}
@@ -267,7 +267,7 @@ void tglStencilFunc(TGLenum func, TGLint ref, TGLuint mask) {
p[0].op = TinyGL::OP_StencilFunc;
p[1].i = func;
p[2].i = ref;
- p[3].i = mask;
+ p[3].ui = mask;
c->gl_add_op(p);
}
@@ -685,7 +685,7 @@ void tglBindTexture(TGLenum target, TGLuint texture) {
p[0].op = TinyGL::OP_BindTexture;
p[1].i = target;
- p[2].i = texture;
+ p[2].ui = texture;
c->gl_add_op(p);
}
@@ -804,7 +804,7 @@ void tglCallList(TGLuint list) {
TinyGL::GLParam p[2];
p[0].op = TinyGL::OP_CallList;
- p[1].i = list;
+ p[1].ui = list;
c->gl_add_op(p);
}
diff --git a/graphics/tinygl/misc.cpp b/graphics/tinygl/misc.cpp
index 6a0b48e177c..55c1e87fa3c 100644
--- a/graphics/tinygl/misc.cpp
+++ b/graphics/tinygl/misc.cpp
@@ -141,7 +141,7 @@ void GLContext::glopDepthFunc(GLParam *p) {
void GLContext::glopStencilFunc(GLParam *p) {
TGLenum func = p[1].i;
TGLint ref = p[2].i;
- TGLuint mask = p[3].i;
+ TGLuint mask = p[3].ui;
if (func < TGL_NEVER || func > TGL_ALWAYS)
return;
if (ref < 0)
@@ -215,7 +215,7 @@ void GLContext::glopDepthMask(GLParam *p) {
}
void GLContext::glopStencilMask(TinyGL::GLParam *p) {
- stencil_write_mask = p[1].i;
+ stencil_write_mask = p[1].ui;
}
} // end of namespace TinyGL
diff --git a/graphics/tinygl/opinfo.h b/graphics/tinygl/opinfo.h
index fc6784a1a64..8f91a31b873 100644
--- a/graphics/tinygl/opinfo.h
+++ b/graphics/tinygl/opinfo.h
@@ -26,7 +26,7 @@
*/
-ADD_OP(Color, 7, "%f %f %f %f %d %d %d")
+ADD_OP(Color, 4, "%f %f %f %f")
ADD_OP(TexCoord, 4, "%f %f %f %f")
ADD_OP(EdgeFlag, 1, "%d")
ADD_OP(Normal, 3, "%f %f %f")
diff --git a/graphics/tinygl/texture.cpp b/graphics/tinygl/texture.cpp
index 8c0ae5c1cd7..aeced6adcb0 100644
--- a/graphics/tinygl/texture.cpp
+++ b/graphics/tinygl/texture.cpp
@@ -97,10 +97,10 @@ GLTexture *GLContext::alloc_texture(uint h) {
void GLContext::glopBindTexture(GLParam *p) {
int target = p[1].i;
- int texture = p[2].i;
+ uint texture = p[2].ui;
GLTexture *t;
- assert(target == TGL_TEXTURE_2D && texture >= 0);
+ assert(target == TGL_TEXTURE_2D);
t = find_texture(texture);
if (!t) {
Commit: 8ae516bd527d2abefc7f2aa93add01ef1373ccec
https://github.com/scummvm/scummvm/commit/8ae516bd527d2abefc7f2aa93add01ef1373ccec
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2022-01-02T09:22:49+01:00
Commit Message:
TINYGL: Janitorial
Changed paths:
graphics/tinygl/list.cpp
diff --git a/graphics/tinygl/list.cpp b/graphics/tinygl/list.cpp
index 16adabcc0fb..ab15ed7f10d 100644
--- a/graphics/tinygl/list.cpp
+++ b/graphics/tinygl/list.cpp
@@ -57,16 +57,13 @@ GLList *GLContext::find_list(uint list) {
}
void GLContext::delete_list(int list) {
- GLParamBuffer *pb, *pb1;
- GLList *l;
-
- l = find_list(list);
+ GLList *l = find_list(list);
assert(l);
// free param buffer
- pb = l->first_op_buffer;
+ GLParamBuffer *pb = l->first_op_buffer;
while (pb) {
- pb1 = pb->next;
+ GLParamBuffer *pb1 = pb->next;
gl_free(pb);
pb = pb1;
}
@@ -76,11 +73,8 @@ void GLContext::delete_list(int list) {
}
GLList *GLContext::alloc_list(int list) {
- GLList *l;
- GLParamBuffer *ob;
-
- l = (GLList *)gl_zalloc(sizeof(GLList));
- ob = (GLParamBuffer *)gl_zalloc(sizeof(GLParamBuffer));
+ GLList *l = (GLList *)gl_zalloc(sizeof(GLList));
+ GLParamBuffer *ob = (GLParamBuffer *)gl_zalloc(sizeof(GLParamBuffer));
ob->next = nullptr;
l->first_op_buffer = ob;
@@ -92,13 +86,11 @@ GLList *GLContext::alloc_list(int list) {
}
static void gl_print_op(GLParam *p) {
- int op;
- const char *s;
Common::StreamDebug debug = streamDbg();
+ int op = p[0].op;
- op = p[0].op;
p++;
- s = op_table_str[op];
+ const char *s = op_table_str[op];
while (*s != 0) {
if (*s == '%') {
s++;
@@ -120,19 +112,15 @@ static void gl_print_op(GLParam *p) {
}
void GLContext::gl_compile_op(GLParam *p) {
- int op, op_size;
- GLParamBuffer *ob, *ob1;
- int index;
-
- op = p[0].op;
- op_size = op_table_size[op];
- index = current_op_buffer_index;
- ob = current_op_buffer;
+ int op = p[0].op;
+ int op_size = op_table_size[op];
+ int index = current_op_buffer_index;
+ GLParamBuffer *ob = current_op_buffer;
// we should be able to add a NextBuffer opcode
if ((index + op_size) > (OP_BUFFER_MAX_SIZE - 2)) {
- ob1 = (GLParamBuffer *)gl_zalloc(sizeof(GLParamBuffer));
+ GLParamBuffer *ob1 = (GLParamBuffer *)gl_zalloc(sizeof(GLParamBuffer));
ob1->next = nullptr;
ob->next = ob1;
@@ -153,9 +141,8 @@ void GLContext::gl_compile_op(GLParam *p) {
void GLContext::gl_add_op(GLParam *p) {
GLContext *c = gl_get_context();
- int op;
- op = p[0].op;
+ int op = p[0].op;
if (exec_flag) {
op_table_func[op](c, p);
}
@@ -178,17 +165,15 @@ void GLContext::glopNextBuffer(GLParam *) {
}
void GLContext::glopCallList(GLParam *p) {
- GLList *l;
- int list, op;
+ uint list = p[1].ui;
+ GLList *l = find_list(list);
- list = p[1].ui;
- l = find_list(list);
if (!l)
error("list %d not defined", list);
p = l->first_op_buffer->ops;
while (1) {
- op = p[0].op;
+ int op = p[0].op;
if (op == OP_EndList)
break;
if (op == OP_NextBuffer) {
More information about the Scummvm-git-logs
mailing list