Skip to content
Permalink
Browse files

avoid use of Z_ChangeTag() for memory allocated by W_CacheLumpNum/Name()

* Fixes issue #430

* Updated comment

* Reverted change in r_data.c, modified comment in p_switch.c
  • Loading branch information...
WSSDude authored and fabiangreffrath committed Jul 8, 2019
1 parent d9455e0 commit 07f4ec334ed10634b18e7b577a86c7cb3a830617
Showing with 7 additions and 7 deletions.
  1. +1 −1 src/doom/p_spec.c
  2. +2 −2 src/doom/p_switch.c
  3. +3 −3 src/doom/r_data.c
  4. +1 −1 src/doom/r_swirl.c
@@ -222,7 +222,7 @@ void P_InitPicAnims (void)

if (from_lump)
{
Z_ChangeTag(animdefs, PU_CACHE);
W_ReleaseLumpName("ANIMATED");
}

if (init_swirl)
@@ -25,7 +25,7 @@
#include "p_local.h"
#include "i_swap.h" // [crispy] SHORT()
#include "w_wad.h" // [crispy] W_CheckNumForName()
#include "z_zone.h" // [crispy] Z_ChangeTag()
#include "z_zone.h" // [crispy] PU_STATIC

#include "g_game.h"

@@ -171,7 +171,7 @@ void P_InitSwitchList(void)
// [crispy] add support for SWITCHES lumps
if (from_lump)
{
Z_ChangeTag(alphSwitchList, PU_CACHE);
W_ReleaseLumpName("SWITCHES");
}

// [crispy] pre-allocate some memory for the buttonlist[] array
@@ -1122,7 +1122,7 @@ static void R_InitTranMap()

free(fname);

Z_ChangeTag(playpal, PU_CACHE);
W_ReleaseLumpName("PLAYPAL");
}
}
#endif
@@ -1203,7 +1203,7 @@ void R_InitColormaps (void)
}
}

Z_ChangeTag(colormap, PU_CACHE);
W_ReleaseLumpName("COLORMAP");
}
#endif

@@ -1234,7 +1234,7 @@ void R_InitColormaps (void)
crstr[i] = M_StringDuplicate(c);
}

Z_ChangeTag(playpal, PU_CACHE);
W_ReleaseLumpName("PLAYPAL");
}

#ifndef CRISPY_TRUECOLOR
@@ -114,7 +114,7 @@ char *R_DistortedFlat(int flatnum)
distortedflat[i] = normalflat[offset[i]];
}

Z_ChangeTag(normalflat, PU_CACHE);
W_ReleaseLumpNum(flatnum);

swirlflat = flatnum;
}

0 comments on commit 07f4ec3

Please sign in to comment.
You can’t perform that action at this time.