- Fixed?: WallSpriteColumn apparently needs to set dc_texturefrac. At least

Valgrind seems to say so.
- Fixed: The FWadCollection destructor needs to use free to free the LumpInfo
  and Wads arrays.
- Fixed: The ColorMapKiller needs to use the delete[] form of delete.
- Fixed: FConfigFile::ClearCurrentSection() should be calling the delete[] form
  of delete to free the entry.
- Fixed: FPatchTexture::MakeTexture() does not need to blindly recreate the
  Spans if they already exist.
- Fixed: The FMultiPatchTexture destructor did not call its Unload() method.
- Restored the original padding calculation to FMultiPatchTexture::MakeTexture().
  I believe the Valgrind errors were caused by accessing off the end of the
  screen buffer, not from accessing off the end of a texture.


SVN r98 (trunk)
This commit is contained in:
Randy Heit 2006-05-10 03:08:27 +00:00
commit def53bdd5d
6 changed files with 26 additions and 10 deletions

View file

@ -1273,6 +1273,11 @@ void FPatchTexture::MakeTexture ()
}
// Create the spans
if (Spans != NULL)
{
return;
}
Spans = (Span **)M_Malloc (sizeof(Span*)*Width + sizeof(Span)*numspans);
spanstuffer = (Span *)((BYTE *)Spans + sizeof(Span*)*Width);
warned = false;
@ -2152,6 +2157,7 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl
FMultiPatchTexture::~FMultiPatchTexture ()
{
Unload ();
if (Parts != NULL)
{
delete[] Parts;
@ -2227,8 +2233,7 @@ void FMultiPatchTexture::MakeTexture ()
{
// Add a little extra space at the end if the texture's height is not
// a power of 2, in case somebody accidentally makes it repeat vertically.
// (Jim's Valgrind dump indicates that more padding is needed here.)
int numpix = Width * Height + Height;// (1 << HeightBits) - Height;
int numpix = Width * Height + (1 << HeightBits) - Height;
Pixels = new BYTE[numpix];
memset (Pixels, 0, numpix);
@ -2843,12 +2848,12 @@ static struct ColorMapKiller
{
if (fakecmaps != NULL)
{
delete fakecmaps;
delete[] fakecmaps;
fakecmaps = NULL;
}
if (realcolormaps != NULL)
{
delete realcolormaps;
delete[] realcolormaps;
realcolormaps = NULL;
}
}