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:
mcmartin
2003-02-05 05:52:00 +00:00
parent 3ff6dd63aa
commit 075ad942a4
+19 -15
View File
@@ -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 - if (GetPrimType (PrimPtr) == STAMPFILL_PRIM)
GetFrameHotX (_CurFramePtr); {
SDL_DstRect.y = (short) pClipRect->corner.y - int r, g, b;
GetFrameHotY (_CurFramePtr); DWORD c32k;
SDL_BlitSurface ( c32k = GetPrimColor (PrimPtr) >> 8; // shift out color index
img->NormalImg, r = (c32k >> (10 - (8 - 5))) & 0xF8;
NULL, g = (c32k >> (5 - (8 - 5))) & 0xF8;
dst_img->NormalImg, b = (c32k << (8 - 5)) & 0xF8;
&SDL_DstRect
);
UnlockMutex (dst_img->mutex); TFB_DrawImage_FilledImage(img,
UnlockMutex (img->mutex); 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);
}
} }
} }