more PhracturedBlue's memory leak fixes
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@321 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -44,7 +44,7 @@ process_image (FRAMEPTR FramePtr, SDL_Surface *img[], AniData *ani, int cel_ct)
|
|||||||
TFB_Image *tfbimg;
|
TFB_Image *tfbimg;
|
||||||
int hx, hy;
|
int hx, hy;
|
||||||
|
|
||||||
TYPE_SET (FramePtr->TypeIndexAndFlags, WANT_PIXMAP << FTYPE_SHIFT);
|
TYPE_SET (FramePtr->TypeIndexAndFlags, ROM_DRAWABLE);
|
||||||
INDEX_SET (FramePtr->TypeIndexAndFlags, cel_ct);
|
INDEX_SET (FramePtr->TypeIndexAndFlags, cel_ct);
|
||||||
|
|
||||||
if (img[cel_ct]->format->palette)
|
if (img[cel_ct]->format->palette)
|
||||||
@@ -136,9 +136,11 @@ process_font (FRAMEPTR FramePtr, SDL_Surface *img[], int cel_ct)
|
|||||||
FRAMEPTR stretch_frame (FRAMEPTR FramePtr, int neww, int newh,int destroy)
|
FRAMEPTR stretch_frame (FRAMEPTR FramePtr, int neww, int newh,int destroy)
|
||||||
{
|
{
|
||||||
FRAMEPTR NewFrame;
|
FRAMEPTR NewFrame;
|
||||||
|
DWORD type;
|
||||||
SDL_Surface *src,*dst;
|
SDL_Surface *src,*dst;
|
||||||
|
type=TYPE_GET (FramePtr->TypeIndexAndFlags);
|
||||||
NewFrame = CaptureDrawable (
|
NewFrame = CaptureDrawable (
|
||||||
CreateDrawable (WANT_PIXMAP, (SIZE)neww, (SIZE)newh, 1)
|
CreateDrawable (/*WANT_PIXMAP*/type, (SIZE)neww, (SIZE)newh, 1)
|
||||||
);
|
);
|
||||||
src = ((TFB_Image *)((BYTE *)(FramePtr) + FramePtr->DataOffs))->NormalImg;
|
src = ((TFB_Image *)((BYTE *)(FramePtr) + FramePtr->DataOffs))->NormalImg;
|
||||||
dst = ((TFB_Image *)((BYTE *)(NewFrame) + NewFrame->DataOffs))->NormalImg;
|
dst = ((TFB_Image *)((BYTE *)(NewFrame) + NewFrame->DataOffs))->NormalImg;
|
||||||
@@ -304,7 +306,7 @@ _GetCelData (FILE *fp, DWORD length)
|
|||||||
|
|
||||||
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
||||||
TYPE_SET (DrawablePtr->FlagsAndIndex,
|
TYPE_SET (DrawablePtr->FlagsAndIndex,
|
||||||
(DRAWABLE_TYPE)ROM_DRAWABLE << FTYPE_SHIFT);
|
(DRAWABLE_TYPE)WANT_PIXMAP << FTYPE_SHIFT);
|
||||||
INDEX_SET (DrawablePtr->FlagsAndIndex, cel_ct - 1);
|
INDEX_SET (DrawablePtr->FlagsAndIndex, cel_ct - 1);
|
||||||
|
|
||||||
FramePtr = &DrawablePtr->Frame[cel_ct];
|
FramePtr = &DrawablePtr->Frame[cel_ct];
|
||||||
@@ -325,18 +327,17 @@ BOOLEAN
|
|||||||
_ReleaseCelData (MEM_HANDLE handle)
|
_ReleaseCelData (MEM_HANDLE handle)
|
||||||
{
|
{
|
||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
|
int cel_ct;
|
||||||
|
FRAMEPTR FramePtr;
|
||||||
|
|
||||||
if ((DrawablePtr = LockDrawable (handle)) == 0)
|
if ((DrawablePtr = LockDrawable (handle)) == 0)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
if (TYPE_GET (DrawablePtr->FlagsAndIndex) != SCREEN_DRAWABLE)
|
cel_ct = INDEX_GET (DrawablePtr->FlagsAndIndex)+1;
|
||||||
|
|
||||||
|
FramePtr = &DrawablePtr->Frame[cel_ct];
|
||||||
|
if (TYPE_GET ((FramePtr-1)->TypeIndexAndFlags) != SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
int cel_ct;
|
|
||||||
FRAMEPTR FramePtr;
|
|
||||||
|
|
||||||
cel_ct = INDEX_GET (DrawablePtr->FlagsAndIndex) + 1;
|
|
||||||
|
|
||||||
FramePtr = &DrawablePtr->Frame[cel_ct];
|
|
||||||
while (--FramePtr, cel_ct--)
|
while (--FramePtr, cel_ct--)
|
||||||
{
|
{
|
||||||
if (FramePtr->DataOffs)
|
if (FramePtr->DataOffs)
|
||||||
|
|||||||
Reference in New Issue
Block a user