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.xav...@gmail.com>
---

My knowledge of mesa and opengl is close to 0 and C one is limited so this
could be all wrong.
If this is not the proper fix, just enligthen me :)

 src/mesa/state_tracker/st_atom_scissor.c |    8 ++++----
 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 3fd59e1..fb666b8 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 */
-- 
1.6.6.1


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to