mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-11-15 14:36:42 +01:00
ref_soft: use correct types for pointer arithmetics
This commit is contained in:
parent
6f36edfd16
commit
113f18cfb0
@ -651,7 +651,7 @@ void R_ScanEdges (void)
|
||||
surf_t *s;
|
||||
|
||||
basespan_p = (espan_t *)
|
||||
((unsigned long long)(basespans + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
((uintptr_t)(basespans + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
max_span_p = &basespan_p[MAXSPANS - RI.vrect.width];
|
||||
|
||||
span_p = basespan_p;
|
||||
|
@ -353,7 +353,7 @@ static qboolean R_CreateBuffer_GLES3( int width, int height, uint *stride, uint
|
||||
1, 1,
|
||||
0, 1,
|
||||
};
|
||||
int vbo, pbo, fbo, to;
|
||||
GLuint vbo, pbo, fbo, to;
|
||||
|
||||
// shitty fbo does not work without texture objects :(
|
||||
pglGenTextures( 1, &to );
|
||||
|
@ -1258,12 +1258,12 @@ void R_DrawBrushModel(cl_entity_t *pent)
|
||||
else
|
||||
{
|
||||
r_edges = (edge_t *)
|
||||
(((unsigned long long)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
(((uintptr_t)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
}
|
||||
|
||||
if (r_surfsonstack)
|
||||
{
|
||||
surfaces = (surf_t *)(((unsigned long long)&lsurfs[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
surfaces = (surf_t *)(((uintptr_t)&lsurfs[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
surf_max = &surfaces[r_cnumsurfs];
|
||||
// surface 0 doesn't really exist; it's just a dummy because index 0
|
||||
// is used to indicate no edge attached to surface
|
||||
@ -1411,12 +1411,12 @@ void R_EdgeDrawing (void)
|
||||
else
|
||||
{
|
||||
r_edges = (edge_t *)
|
||||
(((unsigned long long)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
(((uintptr_t)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
}
|
||||
|
||||
if (r_surfsonstack)
|
||||
{
|
||||
surfaces = (surf_t *)(((unsigned long long)&lsurfs + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
surfaces = (surf_t *)(((uintptr_t)&lsurfs + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
surf_max = &surfaces[r_cnumsurfs];
|
||||
|
||||
// surface 0 doesn't really exist; it's just a dummy because index 0
|
||||
|
@ -521,7 +521,7 @@ void R_EmitCachedEdge (void)
|
||||
{
|
||||
edge_t *pedge_t;
|
||||
|
||||
pedge_t = (edge_t *)((unsigned long long)r_edges + r_pedge->cachededgeoffset);
|
||||
pedge_t = (edge_t *)((uintptr_t)r_edges + r_pedge->cachededgeoffset);
|
||||
|
||||
if (!pedge_t->surfs[0])
|
||||
pedge_t->surfs[0] = surface_p - surfaces;
|
||||
@ -624,9 +624,9 @@ void R_RenderFace (msurface_t *fa, int clipflags)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((((unsigned long long)edge_p - (unsigned long long)r_edges) >
|
||||
if ((((uintptr_t)edge_p - (uintptr_t)r_edges) >
|
||||
r_pedge->cachededgeoffset) &&
|
||||
(((edge_t *)((unsigned long long)r_edges +
|
||||
(((edge_t *)((uintptr_t)r_edges +
|
||||
r_pedge->cachededgeoffset))->owner == r_pedge))
|
||||
{
|
||||
R_EmitCachedEdge ();
|
||||
@ -670,9 +670,9 @@ void R_RenderFace (msurface_t *fa, int clipflags)
|
||||
{
|
||||
// it's cached if the cached edge is valid and is owned
|
||||
// by this medge_t
|
||||
if ((((unsigned long long)edge_p - (unsigned long long)r_edges) >
|
||||
if ((((uintptr_t)edge_p - (uintptr_t)r_edges) >
|
||||
r_pedge->cachededgeoffset) &&
|
||||
(((edge_t *)((unsigned long long)r_edges +
|
||||
(((edge_t *)((uintptr_t)r_edges +
|
||||
r_pedge->cachededgeoffset))->owner == r_pedge))
|
||||
{
|
||||
R_EmitCachedEdge ();
|
||||
|
@ -1390,7 +1390,7 @@ void D_DrawZSpans (espan_t *pspan)
|
||||
// we count on FP exceptions being turned off to avoid range problems
|
||||
izi = (int)(zi * 0x8000 * 0x10000);
|
||||
|
||||
if ((unsigned long long)pdest & 0x02)
|
||||
if ((uintptr_t)pdest & 0x02)
|
||||
{
|
||||
*pdest++ = (short)(izi >> 16);
|
||||
izi += izistep;
|
||||
|
Loading…
Reference in New Issue
Block a user