mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-03-09 20:21:10 +00:00
ref_soft: Fix crashes on 64bit
Just replace all long for unsigned long long :)
This commit is contained in:
parent
bb84a3cb7f
commit
b9cec43e2c
@ -651,7 +651,7 @@ void R_ScanEdges (void)
|
|||||||
surf_t *s;
|
surf_t *s;
|
||||||
|
|
||||||
basespan_p = (espan_t *)
|
basespan_p = (espan_t *)
|
||||||
((long)(basespans + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
((unsigned long long)(basespans + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||||
max_span_p = &basespan_p[MAXSPANS - RI.vrect.width];
|
max_span_p = &basespan_p[MAXSPANS - RI.vrect.width];
|
||||||
|
|
||||||
span_p = basespan_p;
|
span_p = basespan_p;
|
||||||
|
@ -1260,13 +1260,12 @@ void R_DrawBrushModel(cl_entity_t *pent)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
r_edges = (edge_t *)
|
r_edges = (edge_t *)
|
||||||
(((long)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
(((unsigned long long)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r_surfsonstack)
|
if (r_surfsonstack)
|
||||||
{
|
{
|
||||||
surfaces = (surf_t *)
|
surfaces = (surf_t *)(((unsigned long long)&lsurfs[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||||
(((long)&lsurfs[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
|
||||||
surf_max = &surfaces[r_cnumsurfs];
|
surf_max = &surfaces[r_cnumsurfs];
|
||||||
// surface 0 doesn't really exist; it's just a dummy because index 0
|
// surface 0 doesn't really exist; it's just a dummy because index 0
|
||||||
// is used to indicate no edge attached to surface
|
// is used to indicate no edge attached to surface
|
||||||
@ -1414,17 +1413,18 @@ void R_EdgeDrawing (void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
r_edges = (edge_t *)
|
r_edges = (edge_t *)
|
||||||
(((long)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
(((unsigned long long)&ledges[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r_surfsonstack)
|
if (r_surfsonstack)
|
||||||
{
|
{
|
||||||
surfaces = (surf_t *)
|
surfaces = (surf_t *)(((unsigned long long)&lsurfs + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||||
(((long)&lsurfs[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
|
||||||
surf_max = &surfaces[r_cnumsurfs];
|
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
|
// surface 0 doesn't really exist; it's just a dummy because index 0
|
||||||
memset(&surfaces[0], 0, sizeof(surf_t));
|
// is used to indicate no edge attached to surface
|
||||||
|
|
||||||
|
memset(surfaces, 0, sizeof(surf_t));
|
||||||
surfaces--;
|
surfaces--;
|
||||||
R_SurfacePatch ();
|
R_SurfacePatch ();
|
||||||
}
|
}
|
||||||
|
@ -521,7 +521,7 @@ void R_EmitCachedEdge (void)
|
|||||||
{
|
{
|
||||||
edge_t *pedge_t;
|
edge_t *pedge_t;
|
||||||
|
|
||||||
pedge_t = (edge_t *)((unsigned long)r_edges + r_pedge->cachededgeoffset);
|
pedge_t = (edge_t *)((unsigned long long)r_edges + r_pedge->cachededgeoffset);
|
||||||
|
|
||||||
if (!pedge_t->surfs[0])
|
if (!pedge_t->surfs[0])
|
||||||
pedge_t->surfs[0] = surface_p - surfaces;
|
pedge_t->surfs[0] = surface_p - surfaces;
|
||||||
@ -624,9 +624,9 @@ void R_RenderFace (msurface_t *fa, int clipflags)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((((unsigned long)edge_p - (unsigned long)r_edges) >
|
if ((((unsigned long long)edge_p - (unsigned long long)r_edges) >
|
||||||
r_pedge->cachededgeoffset) &&
|
r_pedge->cachededgeoffset) &&
|
||||||
(((edge_t *)((unsigned long)r_edges +
|
(((edge_t *)((unsigned long long)r_edges +
|
||||||
r_pedge->cachededgeoffset))->owner == r_pedge))
|
r_pedge->cachededgeoffset))->owner == r_pedge))
|
||||||
{
|
{
|
||||||
R_EmitCachedEdge ();
|
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
|
// it's cached if the cached edge is valid and is owned
|
||||||
// by this medge_t
|
// by this medge_t
|
||||||
if ((((unsigned long)edge_p - (unsigned long)r_edges) >
|
if ((((unsigned long long)edge_p - (unsigned long long)r_edges) >
|
||||||
r_pedge->cachededgeoffset) &&
|
r_pedge->cachededgeoffset) &&
|
||||||
(((edge_t *)((unsigned long)r_edges +
|
(((edge_t *)((unsigned long long)r_edges +
|
||||||
r_pedge->cachededgeoffset))->owner == r_pedge))
|
r_pedge->cachededgeoffset))->owner == r_pedge))
|
||||||
{
|
{
|
||||||
R_EmitCachedEdge ();
|
R_EmitCachedEdge ();
|
||||||
|
@ -1390,7 +1390,7 @@ void D_DrawZSpans (espan_t *pspan)
|
|||||||
// we count on FP exceptions being turned off to avoid range problems
|
// we count on FP exceptions being turned off to avoid range problems
|
||||||
izi = (int)(zi * 0x8000 * 0x10000);
|
izi = (int)(zi * 0x8000 * 0x10000);
|
||||||
|
|
||||||
if ((long)pdest & 0x02)
|
if ((unsigned long long)pdest & 0x02)
|
||||||
{
|
{
|
||||||
*pdest++ = (short)(izi >> 16);
|
*pdest++ = (short)(izi >> 16);
|
||||||
izi += izistep;
|
izi += izistep;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user