mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-22 11:52:04 +00:00
limit surfaces amount to unsigned short
This commit is contained in:
parent
a4c958ac96
commit
5f2293bf0d
5 changed files with 24 additions and 23 deletions
|
@ -151,14 +151,8 @@ extern oldrefdef_t r_refdef;
|
||||||
|
|
||||||
#define TRANSPARENT_COLOR 0xFF
|
#define TRANSPARENT_COLOR 0xFF
|
||||||
|
|
||||||
#define TURB_TEX_SIZE 64 // base turbulent texture size
|
|
||||||
|
|
||||||
#define CYCLE 128 // turbulent cycle size
|
#define CYCLE 128 // turbulent cycle size
|
||||||
|
|
||||||
#define SCANBUFFERPAD 0x1000
|
|
||||||
|
|
||||||
#define DS_SPAN_LIST_END -128
|
|
||||||
|
|
||||||
// flags in finalvert_t.flags
|
// flags in finalvert_t.flags
|
||||||
#define ALIAS_LEFT_CLIP 0x0001
|
#define ALIAS_LEFT_CLIP 0x0001
|
||||||
#define ALIAS_TOP_CLIP 0x0002
|
#define ALIAS_TOP_CLIP 0x0002
|
||||||
|
@ -175,8 +169,6 @@ extern oldrefdef_t r_refdef;
|
||||||
#define XCENTERING (1.0 / 2.0)
|
#define XCENTERING (1.0 / 2.0)
|
||||||
#define YCENTERING (1.0 / 2.0)
|
#define YCENTERING (1.0 / 2.0)
|
||||||
|
|
||||||
#define CLIP_EPSILON 0.001
|
|
||||||
|
|
||||||
#define BACKFACE_EPSILON 0.01
|
#define BACKFACE_EPSILON 0.01
|
||||||
|
|
||||||
#define NEAR_CLIP 0.01
|
#define NEAR_CLIP 0.01
|
||||||
|
@ -317,12 +309,17 @@ typedef struct surf_s
|
||||||
float d_ziorigin, d_zistepu, d_zistepv;
|
float d_ziorigin, d_zistepu, d_zistepv;
|
||||||
} surf_t;
|
} surf_t;
|
||||||
|
|
||||||
|
typedef unsigned short surfindex_t;
|
||||||
|
|
||||||
|
// surface index size
|
||||||
|
#define SURFINDEX_MAX (1 << (sizeof(surfindex_t) * 8))
|
||||||
|
|
||||||
typedef struct edge_s
|
typedef struct edge_s
|
||||||
{
|
{
|
||||||
shift20_t u;
|
shift20_t u;
|
||||||
shift20_t u_step;
|
shift20_t u_step;
|
||||||
struct edge_s *prev, *next;
|
struct edge_s *prev, *next;
|
||||||
unsigned short surfs[2];
|
surfindex_t surfs[2];
|
||||||
struct edge_s *nextremove;
|
struct edge_s *nextremove;
|
||||||
float nearzi;
|
float nearzi;
|
||||||
medge_t *owner;
|
medge_t *owner;
|
||||||
|
|
|
@ -46,11 +46,6 @@ typedef struct
|
||||||
vec3_t position;
|
vec3_t position;
|
||||||
} mvertex_t;
|
} mvertex_t;
|
||||||
|
|
||||||
#define SIDE_FRONT 0
|
|
||||||
#define SIDE_BACK 1
|
|
||||||
#define SIDE_ON 2
|
|
||||||
|
|
||||||
|
|
||||||
// plane_t structure
|
// plane_t structure
|
||||||
typedef struct mplane_s
|
typedef struct mplane_s
|
||||||
{
|
{
|
||||||
|
@ -231,9 +226,6 @@ typedef struct model_s
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
void Mod_Init(void);
|
void Mod_Init(void);
|
||||||
void Mod_ClearAll(void);
|
|
||||||
void *Mod_Extradata(model_t *mod); // handles caching
|
|
||||||
void Mod_TouchModel(char *name);
|
|
||||||
|
|
||||||
mleaf_t *Mod_PointInLeaf(float *p, model_t *model);
|
mleaf_t *Mod_PointInLeaf(float *p, model_t *model);
|
||||||
byte *Mod_ClusterPVS(int cluster, model_t *model);
|
byte *Mod_ClusterPVS(int cluster, model_t *model);
|
||||||
|
|
|
@ -382,6 +382,14 @@ R_ReallocateMapBuffers (void)
|
||||||
if (r_cnumsurfs < NUMSTACKSURFACES)
|
if (r_cnumsurfs < NUMSTACKSURFACES)
|
||||||
r_cnumsurfs = NUMSTACKSURFACES;
|
r_cnumsurfs = NUMSTACKSURFACES;
|
||||||
|
|
||||||
|
// edge_t->surf limited size to short
|
||||||
|
if (r_cnumsurfs > SURFINDEX_MAX)
|
||||||
|
{
|
||||||
|
r_cnumsurfs = SURFINDEX_MAX;
|
||||||
|
R_Printf(PRINT_ALL, "%s: Code has limitation to surfaces count.\n",
|
||||||
|
__func__);
|
||||||
|
}
|
||||||
|
|
||||||
lsurfs = malloc (r_cnumsurfs * sizeof(surf_t));
|
lsurfs = malloc (r_cnumsurfs * sizeof(surf_t));
|
||||||
if (!lsurfs)
|
if (!lsurfs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1226,6 +1226,8 @@ SPRITE MODELS
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
Mod_LoadSpriteModel
|
Mod_LoadSpriteModel
|
||||||
|
|
||||||
|
support for .sp2 sprites
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -749,7 +749,7 @@ R_PolygonDrawSpans(espan_t *pspan, int iswater )
|
||||||
|
|
||||||
pspan++;
|
pspan++;
|
||||||
|
|
||||||
} while (pspan->count != DS_SPAN_LIST_END);
|
} while (pspan->count != INT_MIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -818,6 +818,8 @@ R_PolygonScanLeftEdge (espan_t *s_polygon_spans)
|
||||||
i = r_polydesc.nump;
|
i = r_polydesc.nump;
|
||||||
|
|
||||||
} while (i != lmaxindex);
|
} while (i != lmaxindex);
|
||||||
|
|
||||||
|
pspan->count = INT_MIN; // mark the end of the span list
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -903,7 +905,7 @@ R_PolygonScanRightEdge(espan_t *s_polygon_spans)
|
||||||
|
|
||||||
} while (i != s_maxindex);
|
} while (i != s_maxindex);
|
||||||
|
|
||||||
pspan->count = DS_SPAN_LIST_END; // mark the end of the span list
|
pspan->count = INT_MIN; // mark the end of the span list
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue