Fixed a handful of bugs last commit introduced (Freed the Frame array at
the wrong time, treated SCREEN_DRAWABLE as a flag instead of an enum) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@943 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -149,7 +149,6 @@ DestroyDrawable (DRAWABLE Drawable)
|
|||||||
DrawablePtr = LockDrawable (Drawable);
|
DrawablePtr = LockDrawable (Drawable);
|
||||||
if (DrawablePtr)
|
if (DrawablePtr)
|
||||||
{
|
{
|
||||||
HFree (DrawablePtr->Frame);
|
|
||||||
UnlockDrawable (Drawable);
|
UnlockDrawable (Drawable);
|
||||||
FreeDrawable (Drawable);
|
FreeDrawable (Drawable);
|
||||||
|
|
||||||
|
|||||||
@@ -508,8 +508,10 @@ _ReleaseCelData (MEM_HANDLE handle)
|
|||||||
|
|
||||||
cel_ct = INDEX_GET (DrawablePtr->FlagsAndIndex)+1;
|
cel_ct = INDEX_GET (DrawablePtr->FlagsAndIndex)+1;
|
||||||
|
|
||||||
|
if (DrawablePtr->Frame)
|
||||||
|
{
|
||||||
FramePtr = &DrawablePtr->Frame[cel_ct];
|
FramePtr = &DrawablePtr->Frame[cel_ct];
|
||||||
if (!(TYPE_GET ((FramePtr-1)->TypeIndexAndFlags) & SCREEN_DRAWABLE))
|
if (TYPE_GET ((FramePtr-1)->TypeIndexAndFlags) != SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
while (--FramePtr, cel_ct--)
|
while (--FramePtr, cel_ct--)
|
||||||
{
|
{
|
||||||
@@ -521,6 +523,8 @@ _ReleaseCelData (MEM_HANDLE handle)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
HFree (DrawablePtr->Frame);
|
||||||
|
}
|
||||||
|
|
||||||
UnlockDrawable (handle);
|
UnlockDrawable (handle);
|
||||||
mem_release (handle);
|
mem_release (handle);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ TFB_Prim_Point (PPOINT p, TFB_Palette *color)
|
|||||||
r.corner.y = p->y - _CurFramePtr->HotSpot.y;
|
r.corner.y = p->y - _CurFramePtr->HotSpot.y;
|
||||||
r.extent.width = r.extent.height = 1;
|
r.extent.width = r.extent.height = 1;
|
||||||
|
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) & SCREEN_DRAWABLE)
|
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
||||||
TFB_DrawScreen_Rect (&r, color->r, color->g, color->b, TFB_SCREEN_MAIN);
|
TFB_DrawScreen_Rect (&r, color->r, color->g, color->b, TFB_SCREEN_MAIN);
|
||||||
else
|
else
|
||||||
TFB_DrawImage_Rect (&r, color->r, color->g, color->b, _CurFramePtr->image);
|
TFB_DrawImage_Rect (&r, color->r, color->g, color->b, _CurFramePtr->image);
|
||||||
@@ -86,7 +86,7 @@ TFB_Prim_FillRect (PRECT r, TFB_Palette *color)
|
|||||||
rect.extent.height) >> 1;
|
rect.extent.height) >> 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) & SCREEN_DRAWABLE)
|
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
||||||
TFB_DrawScreen_Rect (&rect, color->r, color->g, color->b, TFB_SCREEN_MAIN);
|
TFB_DrawScreen_Rect (&rect, color->r, color->g, color->b, TFB_SCREEN_MAIN);
|
||||||
else
|
else
|
||||||
TFB_DrawImage_Rect (&rect, color->r, color->g, color->b, _CurFramePtr->image);
|
TFB_DrawImage_Rect (&rect, color->r, color->g, color->b, _CurFramePtr->image);
|
||||||
@@ -102,7 +102,7 @@ TFB_Prim_Line (PLINE line, TFB_Palette *color)
|
|||||||
x2=line->second.x - _CurFramePtr->HotSpot.x;
|
x2=line->second.x - _CurFramePtr->HotSpot.x;
|
||||||
y2=line->second.y - _CurFramePtr->HotSpot.y;
|
y2=line->second.y - _CurFramePtr->HotSpot.y;
|
||||||
|
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) & SCREEN_DRAWABLE)
|
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
||||||
TFB_DrawScreen_Line (x1, y1, x2, y2, color->r, color->g, color->b, TFB_SCREEN_MAIN);
|
TFB_DrawScreen_Line (x1, y1, x2, y2, color->r, color->g, color->b, TFB_SCREEN_MAIN);
|
||||||
else
|
else
|
||||||
TFB_DrawImage_Line (x1, y1, x2, y2, color->r, color->g, color->b, _CurFramePtr->image);
|
TFB_DrawImage_Line (x1, y1, x2, y2, color->r, color->g, color->b, _CurFramePtr->image);
|
||||||
@@ -155,7 +155,7 @@ TFB_Prim_Stamp (PSTAMP stmp)
|
|||||||
|
|
||||||
UnlockMutex (img->mutex);
|
UnlockMutex (img->mutex);
|
||||||
|
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) & SCREEN_DRAWABLE)
|
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
TFB_DrawScreen_Image (img, x, y, gscale, (paletted ? palette : NULL),
|
TFB_DrawScreen_Image (img, x, y, gscale, (paletted ? palette : NULL),
|
||||||
TFB_SCREEN_MAIN);
|
TFB_SCREEN_MAIN);
|
||||||
@@ -209,7 +209,7 @@ TFB_Prim_StampFill (PSTAMP stmp, TFB_Palette *color)
|
|||||||
|
|
||||||
UnlockMutex (img->mutex);
|
UnlockMutex (img->mutex);
|
||||||
|
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) & SCREEN_DRAWABLE)
|
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
TFB_DrawScreen_FilledImage (img, x, y, gscale, r, g, b,
|
TFB_DrawScreen_FilledImage (img, x, y, gscale, r, g, b,
|
||||||
TFB_SCREEN_MAIN);
|
TFB_SCREEN_MAIN);
|
||||||
|
|||||||
Reference in New Issue
Block a user