cast &ADY and &DX to int* instead of long*

This commit is contained in:
alanh
2000-11-20 16:30:11 +00:00
parent 3093a8a5f4
commit 77a9dd13d3
2 changed files with 21 additions and 12 deletions

View File

@@ -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; */
}

View File

@@ -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; */
}