From: divverent Date: Thu, 16 Dec 2010 06:46:40 +0000 (+0000) Subject: if a skyboxskinframe is missing, don't draw that sky surface (fixes crash if some... X-Git-Tag: xonotic-v0.1.0preview~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d386ec55b42731f8ac9823599b888c6827423792;p=xonotic%2Fdarkplaces.git if a skyboxskinframe is missing, don't draw that sky surface (fixes crash if some but not all skybox files exist; also allows a quicker "partial skybox" where e.g. the bottom side isn't even drawn at all) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10665 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=3dd1e6fd20b37f7f88418ef0593114a73312b0d3 --- diff --git a/r_sky.c b/r_sky.c index 388316ac..4aa4d7fb 100644 --- a/r_sky.c +++ b/r_sky.c @@ -302,7 +302,8 @@ static void R_SkyBox(void) int i; RSurf_ActiveCustomEntity(&skymatrix, &skyinversematrix, 0, 0, 1, 1, 1, 1, 6*4, skyboxvertex3f, skyboxtexcoord2f, NULL, NULL, NULL, NULL, 6*2, skyboxelement3i, skyboxelement3s, false, false); for (i = 0;i < 6;i++) - R_DrawCustomSurface(skyboxskinframe[i], &identitymatrix, MATERIALFLAG_SKY | MATERIALFLAG_FULLBRIGHT | MATERIALFLAG_NOCULLFACE | MATERIALFLAG_NODEPTHTEST, i*4, 4, i*2, 2, false, false); + if(skyboxskinframe[i]) + R_DrawCustomSurface(skyboxskinframe[i], &identitymatrix, MATERIALFLAG_SKY | MATERIALFLAG_FULLBRIGHT | MATERIALFLAG_NOCULLFACE | MATERIALFLAG_NODEPTHTEST, i*4, 4, i*2, 2, false, false); } #define skygridx 32