summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorXavier Chantry <chantry.xavier@gmail.com>2010-01-23 17:27:21 +0100
committerBrian Paul <brianp@vmware.com>2010-01-24 16:45:49 -0700
commitfdfa4c85297d5d25e7256bf73e35309b358af86c (patch)
tree90028bcc0a0cfaba71f77ea6ca75a1ec1c0319ef /src/mesa
parente85cb98a169f83e1a1ad7f17cbbedaee0ea47fe1 (diff)
st/mesa: fix unsigned/signed breakage in scissor
commit 53174afeeb introduced a portability change that converted GLint x,y to GLuint. That breaks when x and y are negative, which seems to be allowed, and which at least one game uses : teeworlds. Rather than simply reverting the change, it seems possible to convert the 16bit unsigned to GLint so that comparisons are made between signed integers instead. This hopefully does not break anything while keeping MSVC happy. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_atom_scissor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c
index 3fd59e1945..fb666b8546 100644
--- a/src/mesa/state_tracker/st_atom_scissor.c
+++ b/src/mesa/state_tracker/st_atom_scissor.c
@@ -52,14 +52,14 @@ update_scissor( struct st_context *st )
scissor.maxy = fb->Height;
if (st->ctx->Scissor.Enabled) {
- if ((GLuint)st->ctx->Scissor.X > scissor.minx)
+ if (st->ctx->Scissor.X > (GLint)scissor.minx)
scissor.minx = st->ctx->Scissor.X;
- if ((GLuint)st->ctx->Scissor.Y > scissor.miny)
+ if (st->ctx->Scissor.Y > (GLint)scissor.miny)
scissor.miny = st->ctx->Scissor.Y;
- if ((GLuint)st->ctx->Scissor.X + st->ctx->Scissor.Width < scissor.maxx)
+ if (st->ctx->Scissor.X + st->ctx->Scissor.Width < (GLint)scissor.maxx)
scissor.maxx = st->ctx->Scissor.X + st->ctx->Scissor.Width;
- if ((GLuint)st->ctx->Scissor.Y + st->ctx->Scissor.Height < scissor.maxy)
+ if (st->ctx->Scissor.Y + st->ctx->Scissor.Height < (GLint)scissor.maxy)
scissor.maxy = st->ctx->Scissor.Y + st->ctx->Scissor.Height;
/* check for null space */