]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Clear the skybox textures on map load. Use memset to clear skyname.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 16 May 2020 19:37:37 +0000 (19:37 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 16 May 2020 19:37:37 +0000 (19:37 +0000)
This fixes an issue where the skybox textures of the first map you load
stick around in subsequent maps. There was a missing call to
R_SkinFrame_PurgeSkinFrame. Also use memset to clear skyname for good
measure. This may not have actually been part of the bug but it's harmless
and it wasn't clearing the entire array previously.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12527 d7cf8633-e32d-0410-b094-e92efae38249

r_sky.c

diff --git a/r_sky.c b/r_sky.c
index 2a12b8f0d89af98d8cc0948b4b2db795f7dfbff8..84b916e5575971d59af297666641ac4fba759c31 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -86,7 +86,7 @@ static void R_UnloadSkyBox(void)
        {
                if (skyboxskinframe[i])
                {
-                       // TODO: make a R_SkinFrame_Purge for single skins...
+                       R_SkinFrame_PurgeSkinFrame(skyboxskinframe[i]);
                        c++;
                }
                skyboxskinframe[i] = NULL;
@@ -440,7 +440,7 @@ void R_Sky(void)
 void R_ResetSkyBox(void)
 {
        R_UnloadSkyBox();
-       skyname[0] = 0;
+       memset(skyname,0,MAX_QPATH);
        R_LoadSkyBox();
 }