diff options
author | SmileTheory <SmileTheory@gmail.com> | 2013-10-15 01:19:16 -0700 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2014-06-17 17:43:35 +0100 |
commit | bfd5a88d22160a94dfc0df380e01ed8319283e62 (patch) | |
tree | aff95be51dc52273bf09fb225d007036a10ffb6c /src/renderergl2/tr_world.c | |
parent | 9b532f128d0b1481074c1602c00b9f4d850a9b44 (diff) |
OpenGL2: Merge bsp surface structs into a single struct, and more cleanup.
Diffstat (limited to 'src/renderergl2/tr_world.c')
-rw-r--r-- | src/renderergl2/tr_world.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/src/renderergl2/tr_world.c b/src/renderergl2/tr_world.c index 5d35cded..1a25d26a 100644 --- a/src/renderergl2/tr_world.c +++ b/src/renderergl2/tr_world.c @@ -209,16 +209,18 @@ static int R_DlightSurface( msurface_t *surf, int dlightBits ) { } } - if ( *surf->data == SF_FACE ) { - ((srfSurfaceFace_t *)surf->data)->dlightBits = dlightBits; - } else if ( *surf->data == SF_GRID ) { - ((srfGridMesh_t *)surf->data)->dlightBits = dlightBits; - } else if ( *surf->data == SF_TRIANGLES ) { - ((srfTriangles_t *)surf->data)->dlightBits = dlightBits; - } else if ( *surf->data == SF_VBO_MESH ) { - ((srfVBOMesh_t *)surf->data)->dlightBits = dlightBits; - } else { - dlightBits = 0; + switch(*surf->data) + { + case SF_FACE: + case SF_GRID: + case SF_TRIANGLES: + case SF_VBO_MESH: + ((srfBspSurface_t *)surf->data)->dlightBits = dlightBits; + break; + + default: + dlightBits = 0; + break; } if ( dlightBits ) { @@ -293,16 +295,18 @@ static int R_PshadowSurface( msurface_t *surf, int pshadowBits ) { } } - if ( *surf->data == SF_FACE ) { - ((srfSurfaceFace_t *)surf->data)->pshadowBits = pshadowBits; - } else if ( *surf->data == SF_GRID ) { - ((srfGridMesh_t *)surf->data)->pshadowBits = pshadowBits; - } else if ( *surf->data == SF_TRIANGLES ) { - ((srfTriangles_t *)surf->data)->pshadowBits = pshadowBits; - } else if ( *surf->data == SF_VBO_MESH ) { - ((srfVBOMesh_t *)surf->data)->pshadowBits = pshadowBits; - } else { - pshadowBits = 0; + switch(*surf->data) + { + case SF_FACE: + case SF_GRID: + case SF_TRIANGLES: + case SF_VBO_MESH: + ((srfBspSurface_t *)surf->data)->pshadowBits = pshadowBits; + break; + + default: + pshadowBits = 0; + break; } if ( pshadowBits ) { |