From 77a9dd13d3415f0cae4b0a843fa6187f73653478 Mon Sep 17 00:00:00 2001 From: alanh <> Date: Mon, 20 Nov 2000 16:30:11 +0000 Subject: [PATCH] cast &ADY and &DX to int* instead of long* --- glide3x/h3/glide3/src/gdraw.c | 21 +++++++++++++++------ glide3x/h5/glide3/src/gdraw.c | 12 ++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/glide3x/h3/glide3/src/gdraw.c b/glide3x/h3/glide3/src/gdraw.c index 6ffd3b8..eb4f414 100644 --- a/glide3x/h3/glide3/src/gdraw.c +++ b/glide3x/h3/glide3/src/gdraw.c @@ -19,6 +19,15 @@ ** ** $Header$ ** $Log$ + ** Revision 1.2.2.2 2000/11/02 10:27:24 alanh + ** Commit some of Dave Mosberger's code: + ** + ** If mode is not zero, initialize "stride" to the + ** number of floats that corresponds to the size of a pointer (1 on a + ** 32-bit platform, 2 on a 64-bit platform). This code works + ** properly as long as sizeof(void*)==N*sizeof(float) for some + ** integer constant N. + ** ** Revision 1.2.2.1 2000/08/30 08:47:03 alanh ** Changes for Voodoo3 for 64bit architectures ** @@ -627,16 +636,16 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) ** compute absolute deltas and draw from low Y to high Y */ ADY = FARRAY(b, gc->state.vData.vertexInfo.offset+4) - FARRAY(a, gc->state.vData.vertexInfo.offset+4); - i = *(long *)&ADY; + i = *(int *)&ADY; if (i < 0) { float *tv; tv = a; a = b; b = tv; i ^= 0x80000000; /* ady = -ady; */ - (*(long *)&ADY) = i; + (*(int *)&ADY) = i; } DX = FARRAY(b, gc->state.vData.vertexInfo.offset) - FARRAY(a, gc->state.vData.vertexInfo.offset); - j = *(long *)&DX; + j = *(int *)&DX; if (j < 0) { j ^= 0x80000000; /* adx = -adx; */ } @@ -806,7 +815,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) ** compute absolute deltas and draw from low Y to high Y */ ADY = tmp2 - tmp1; - i = *(long *)&ADY; + i = *(int *)&ADY; if (i < 0) { float *tv; owa = oowb; owb = oowa; @@ -814,7 +823,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) fby = tmp1; tv = a; a = b; b = tv; i ^= 0x80000000; /* ady = -ady; */ - (*(long *)&ADY) = i; + (*(int *)&ADY) = i; } fax = FARRAY(a, gc->state.vData.vertexInfo.offset) *owa*gc->state.Viewport.hwidth+gc->state.Viewport.ox; @@ -822,7 +831,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) *owb*gc->state.Viewport.hwidth+gc->state.Viewport.ox; DX = fbx - fax; - j = *(long *)&DX; + j = *(int *)&DX; if (j < 0) { j ^= 0x80000000; /* adx = -adx; */ } diff --git a/glide3x/h5/glide3/src/gdraw.c b/glide3x/h5/glide3/src/gdraw.c index 800475b..0124942 100644 --- a/glide3x/h5/glide3/src/gdraw.c +++ b/glide3x/h5/glide3/src/gdraw.c @@ -810,16 +810,16 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) ** compute absolute deltas and draw from low Y to high Y */ ADY = FARRAY(b, gc->state.vData.vertexInfo.offset+4) - FARRAY(a, gc->state.vData.vertexInfo.offset+4); - i = *(long *)&ADY; + i = *(int *)&ADY; if (i < 0) { float *tv; tv = a; a = b; b = tv; i ^= 0x80000000; /* ady = -ady; */ - (*(long *)&ADY) = i; + (*(int *)&ADY) = i; } DX = FARRAY(b, gc->state.vData.vertexInfo.offset) - FARRAY(a, gc->state.vData.vertexInfo.offset); - j = *(long *)&DX; + j = *(int *)&DX; if (j < 0) { j ^= 0x80000000; /* adx = -adx; */ } @@ -989,7 +989,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) ** compute absolute deltas and draw from low Y to high Y */ ADY = tmp2 - tmp1; - i = *(long *)&ADY; + i = *(int *)&ADY; if (i < 0) { float *tv; owa = oowb; owb = oowa; @@ -997,7 +997,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) fby = tmp1; tv = a; a = b; b = tv; i ^= 0x80000000; /* ady = -ady; */ - (*(long *)&ADY) = i; + (*(int *)&ADY) = i; } fax = FARRAY(a, gc->state.vData.vertexInfo.offset) *owa*gc->state.Viewport.hwidth+gc->state.Viewport.ox; @@ -1005,7 +1005,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) *owb*gc->state.Viewport.hwidth+gc->state.Viewport.ox; DX = fbx - fax; - j = *(long *)&DX; + j = *(int *)&DX; if (j < 0) { j ^= 0x80000000; /* adx = -adx; */ }