- Fixed: MugShotFrame::getTexture() allocated space for the sprite name that

it never freed. I'm not sure it's a good assumption that 9 characters is
  always long enough, either, since you can have longer file names than that
  inside a zip.
- Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL.


SVN r929 (trunk)
This commit is contained in:
Randy Heit 2008-04-20 00:23:07 +00:00
parent d7656bf73b
commit d8166e0e5e
4 changed files with 19 additions and 11 deletions

View file

@ -1,4 +1,11 @@
April 19, 2008
- Fixed: MugShotFrame::getTexture() allocated space for the sprite name that
it never freed. I'm not sure it's a good assumption that 9 characters is
always long enough, either, since you can have longer file names than that
inside a zip.
- Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL.
- Fixed: Sound sequences are not thinkers, therefore they must be explicitly
marked as roots for the GC.
- Reduced the range that area sounds require to interpolate between 2D and
3D panning.
- The listener's velocity is now set at 0 for the sound engine. The player

View file

@ -67,6 +67,7 @@
#include "stats.h"
#include "c_dispatch.h"
#include "p_acs.h"
#include "s_sndseq.h"
// MACROS ------------------------------------------------------------------
@ -300,6 +301,8 @@ static void MarkRoot()
if (playeringame[i])
players[i].PropagateMark();
}
// Mark sound sequences.
DSeqNode::StaticMarkHead();
// Mark sectors.
if (SectorMarker == NULL && sectors != NULL)
{

View file

@ -88,16 +88,15 @@ FTexture *MugShotFrame::getTexture(FString &defaultFace, FPlayerSkin *skin, int
int index = !directional ? random % graphic.Size() : direction;
if(index > (signed int) (graphic.Size()-1))
index = graphic.Size()-1;
char* sprite = new char[9];
memcpy(sprite, skin->face[0] != 0 ? skin->face : defaultFace, 3);
memcpy(sprite+3, graphic[index], strlen(graphic[index]));
sprite[3+strlen(graphic[index])] = '\0';
FString sprite(skin->face[0] != 0 ? skin->face : &defaultFace[0], 3);
sprite += graphic[index];
if(usesLevels) //change the last character to the level
{
if(!health2 && (!healthspecial || index == 1))
sprite[2+strlen(graphic[index])] += level;
sprite.LockBuffer()[2 + graphic[index].Len()] += level;
else
sprite[1+strlen(graphic[index])] += level;
sprite.LockBuffer()[1 + graphic[index].Len()] += level;
sprite.UnlockBuffer();
}
return TexMan[TexMan.CheckForTexture(sprite, 0, true)];
}
@ -1511,19 +1510,17 @@ void DSBarInfo::DrawInventoryBar(int type, int num, int x, int y, bool alwayssho
void DSBarInfo::DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y, int padleft, int padright, int chainsize,
bool wiggle, bool translate)
{
if(chain == NULL)
return;
if(value > 100)
value = 100;
else if(value < 0)
value = 0;
if(wiggle)
y += chainWiggle;
int gemWidth = gem->GetWidth();
int chainWidth = chain->GetWidth();
int offset = (int) (((double) (chainWidth-padleft-padright)/100)*value);
if(chain != NULL)
{
DrawGraphic(chain, x+(offset%chainsize), y);
}
DrawGraphic(chain, x+(offset%chainsize), y);
if(gem != NULL)
DrawGraphic(gem, x+padleft+offset, y, translate ? DRAWIMAGE_TRANSLATABLE : 0);
}

View file

@ -29,6 +29,7 @@ public:
void ChangeData (int seqOffset, int delayTics, float volume, int currentSoundID);
void AddChoice (int seqnum, seqtype_t type);
FName GetSequenceName() const;
static void StaticMarkHead() { GC::Mark(SequenceListHead); }
virtual void MakeSound (int loop) {}
virtual void *Source () { return NULL; }