Permalink
Browse files

rendererGLES: small optimization, use short instead of int for system…

…s with small memory amount to spare, refs #1100
  • Loading branch information...
rafal1137 committed Oct 6, 2018
1 parent afd0454 commit cc2b85298e575499b0ac9c1181fe9b45ba8ef7ff
Showing with 9 additions and 9 deletions.
  1. +1 −1 src/rendererGLES/tr_bsp.c
  2. +1 −1 src/rendererGLES/tr_local.h
  3. +7 −7 src/rendererGLES/tr_surface.c
View
2 src/rendererGLES/tr_bsp.c 100644 → 100755
@@ -538,7 +538,7 @@ static void ParseTriSurf(dsurface_t *ds, drawVert_t *verts, msurface_t *surf, in
tri->numVerts = numVerts;
tri->numIndexes = numIndexes;
tri->verts = ( drawVert_t * )(tri + 1);
tri->indexes = ( int * )(tri->verts + tri->numVerts);
tri->indexes = ( short * )(tri->verts + tri->numVerts);
surf->data = (surfaceType_t *)tri;
View
2 src/rendererGLES/tr_local.h 100644 → 100755
@@ -948,7 +948,7 @@ typedef struct srfTriangles_s
// triangle definitions
int numIndexes;
int *indexes;
short *indexes;
int numVerts;
drawVert_t *verts;
View
14 src/rendererGLES/tr_surface.c 100644 → 100755
@@ -185,7 +185,7 @@ void RB_AddQuadStampFadingCornersExt(vec3_t origin, vec3_t left, vec3_t up, byte
void RB_AddQuadStampExt(vec3_t origin, vec3_t left, vec3_t up, byte *color, float s1, float t1, float s2, float t2)
{
vec3_t normal;
int ndx;
short ndx;
RB_CHECKOVERFLOW(4, 6);
@@ -322,8 +322,8 @@ static void RB_SurfaceSprite(void)
*/
void RB_SurfacePolychain(srfPoly_t *p)
{
int i;
int numv;
short i;
short numv;
RB_CHECKOVERFLOW(p->numVerts, 3 * (p->numVerts - 2));
@@ -665,7 +665,7 @@ void RB_SurfaceBeam(void)
static void DoRailCore(const vec3_t start, const vec3_t end, const vec3_t up, float len, float spanWidth)
{
float spanWidth2;
int vbase = tess.numVertexes;
short vbase = tess.numVertexes;
float t; // = len / 256.0f;
// configurable tile
@@ -1748,14 +1748,14 @@ void RB_SurfaceFlare(srfFlare_t *surf)
/**
* @brief RB_SurfaceDisplayList
* @param[in] surf
*/
void RB_SurfaceDisplayList(srfDisplayList_t *surf)
{
// all apropriate state must be set in RB_BeginSurface
// this isn't implemented yet...
qglCallList(surf->listNum);
}
*/
/**
* @brief RB_SurfacePolyBuffer
* @param[in] surf
@@ -1844,7 +1844,7 @@ void(*rb_surfaceTable[SF_NUM_SURFACE_TYPES]) (void *) =
(void (*)(void *))RB_MDM_SurfaceAnim, // SF_MDM,
(void (*)(void *))RB_SurfaceFlare, // SF_FLARE,
(void (*)(void *))RB_SurfaceEntity, // SF_ENTITY
(void (*)(void *))RB_SurfaceDisplayList, // SF_DISPLAY_LIST
// (void (*)(void *))RB_SurfaceDisplayList, // SF_DISPLAY_LIST
(void (*)(void *))RB_SurfacePolyBuffer, // SF_POLYBUFFER
(void (*)(void *))RB_SurfaceDecal, // SF_DECAL
};

0 comments on commit cc2b852

Please sign in to comment.