Added STAMPFILL_PRIM support for non-screen Drawables
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@681 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -67,7 +67,7 @@ blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr)
|
|||||||
|
|
||||||
if (img->ScaledImg)
|
if (img->ScaledImg)
|
||||||
{
|
{
|
||||||
if (img->scale != gscale)
|
if (img->scale != gscale || img->dirty)
|
||||||
{
|
{
|
||||||
SDL_FreeSurface(img->ScaledImg);
|
SDL_FreeSurface(img->ScaledImg);
|
||||||
img->ScaledImg = NULL;
|
img->ScaledImg = NULL;
|
||||||
@@ -164,28 +164,32 @@ blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SDL_Rect SDL_DstRect;
|
|
||||||
TFB_Image *dst_img;
|
TFB_Image *dst_img;
|
||||||
|
|
||||||
dst_img = ((TFB_Image *) ((BYTE *) _CurFramePtr +
|
dst_img = ((TFB_Image *) ((BYTE *) _CurFramePtr +
|
||||||
_CurFramePtr->DataOffs));
|
_CurFramePtr->DataOffs));
|
||||||
|
|
||||||
LockMutex (dst_img->mutex);
|
|
||||||
|
|
||||||
SDL_DstRect.x = (short) pClipRect->corner.x -
|
|
||||||
GetFrameHotX (_CurFramePtr);
|
|
||||||
SDL_DstRect.y = (short) pClipRect->corner.y -
|
|
||||||
GetFrameHotY (_CurFramePtr);
|
|
||||||
|
|
||||||
SDL_BlitSurface (
|
if (GetPrimType (PrimPtr) == STAMPFILL_PRIM)
|
||||||
img->NormalImg,
|
{
|
||||||
NULL,
|
int r, g, b;
|
||||||
dst_img->NormalImg,
|
DWORD c32k;
|
||||||
&SDL_DstRect
|
|
||||||
);
|
c32k = GetPrimColor (PrimPtr) >> 8; // shift out color index
|
||||||
|
r = (c32k >> (10 - (8 - 5))) & 0xF8;
|
||||||
UnlockMutex (dst_img->mutex);
|
g = (c32k >> (5 - (8 - 5))) & 0xF8;
|
||||||
UnlockMutex (img->mutex);
|
b = (c32k << (8 - 5)) & 0xF8;
|
||||||
|
|
||||||
|
TFB_DrawImage_FilledImage(img,
|
||||||
|
pClipRect->corner.x - GetFrameHotX (_CurFramePtr),
|
||||||
|
pClipRect->corner.y - GetFrameHotY (_CurFramePtr),
|
||||||
|
FALSE, r, g, b, dst_img);
|
||||||
|
} else {
|
||||||
|
TFB_DrawImage_Image(img,
|
||||||
|
pClipRect->corner.x - GetFrameHotX (_CurFramePtr),
|
||||||
|
pClipRect->corner.y - GetFrameHotY (_CurFramePtr),
|
||||||
|
FALSE, img->Palette, dst_img);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user