Removed ugly manual bit-packing; other cleanups
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2383 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -19,13 +19,6 @@
|
|||||||
#ifndef _DISPLAY_H
|
#ifndef _DISPLAY_H
|
||||||
#define _DISPLAY_H
|
#define _DISPLAY_H
|
||||||
|
|
||||||
/*
|
|
||||||
#define WANT_MASK (CREATE_FLAGS)(1 << 0)
|
|
||||||
#define WANT_PIXMAP (CREATE_FLAGS)(1 << 1)
|
|
||||||
*/
|
|
||||||
#define WANT_COMPRESSED (CREATE_FLAGS)(1 << 2)
|
|
||||||
#define DOUBLE_RES (CREATE_FLAGS)(1 << 3)
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
CREATE_FLAGS DisplayFlags;
|
CREATE_FLAGS DisplayFlags;
|
||||||
|
|||||||
@@ -56,12 +56,9 @@ CreateDisplay (CREATE_FLAGS CreateFlags, PSIZE pwidth, PSIZE pheight)
|
|||||||
if (!DisplayActive ())
|
if (!DisplayActive ())
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
Drawable = _request_drawable (
|
Drawable = _request_drawable (1, SCREEN_DRAWABLE,
|
||||||
(COUNT)1, (DRAWABLE_TYPE)SCREEN_DRAWABLE,
|
(CreateFlags & (WANT_PIXMAP | (GetDisplayFlags () & WANT_MASK))),
|
||||||
(CREATE_FLAGS)(CreateFlags & (WANT_PIXMAP | (GetDisplayFlags () & WANT_MASK))),
|
GetDisplayWidth (), GetDisplayHeight ());
|
||||||
(SIZE)GetDisplayWidth (),
|
|
||||||
(SIZE)GetDisplayHeight ()
|
|
||||||
);
|
|
||||||
if (Drawable)
|
if (Drawable)
|
||||||
{
|
{
|
||||||
FRAMEPTR F;
|
FRAMEPTR F;
|
||||||
@@ -101,9 +98,10 @@ AllocDrawable (COUNT n)
|
|||||||
FRAMEPTR F;
|
FRAMEPTR F;
|
||||||
F = &DrawablePtr->Frame[i];
|
F = &DrawablePtr->Frame[i];
|
||||||
F->parent = DrawablePtr;
|
F->parent = DrawablePtr;
|
||||||
F->TypeIndexAndFlags = 0;
|
F->Type = 0;
|
||||||
|
F->Index = 0;
|
||||||
F->image = 0;
|
F->image = 0;
|
||||||
F->Bounds = 0;
|
F->Bounds.width = F->Bounds.height = 0;
|
||||||
F->HotSpot.x = F->HotSpot.y = 0;
|
F->HotSpot.x = F->HotSpot.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,12 +119,10 @@ CreateDrawable (CREATE_FLAGS CreateFlags, SIZE width, SIZE height, COUNT
|
|||||||
if (!DisplayActive ())
|
if (!DisplayActive ())
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
Drawable = _request_drawable (
|
Drawable = _request_drawable (num_frames, RAM_DRAWABLE,
|
||||||
(COUNT)num_frames, (DRAWABLE_TYPE)RAM_DRAWABLE,
|
(CreateFlags & (WANT_MASK | WANT_PIXMAP
|
||||||
(CREATE_FLAGS)(CreateFlags & (WANT_MASK | WANT_PIXMAP
|
|
||||||
| WANT_ALPHA | MAPPED_TO_DISPLAY)),
|
| WANT_ALPHA | MAPPED_TO_DISPLAY)),
|
||||||
(SIZE)width, (SIZE)height
|
width, height);
|
||||||
);
|
|
||||||
if (Drawable)
|
if (Drawable)
|
||||||
{
|
{
|
||||||
FRAMEPTR F;
|
FRAMEPTR F;
|
||||||
|
|||||||
@@ -48,46 +48,42 @@ typedef BRESENHAM_LINE *PBRESENHAM_LINE;
|
|||||||
#define PAD_WIDTH(w) (w)
|
#define PAD_WIDTH(w) (w)
|
||||||
#endif /* MSDOS */
|
#endif /* MSDOS */
|
||||||
|
|
||||||
#define FTYPE_SHIFT 12
|
|
||||||
#define FINDEX_MASK ((1 << FTYPE_SHIFT) - 1)
|
|
||||||
#define FTYPE_MASK (0xFFFF & ~FINDEX_MASK)
|
|
||||||
|
|
||||||
#define ROM_DRAWABLE (0 << FTYPE_SHIFT)
|
|
||||||
#define RAM_DRAWABLE (1 << FTYPE_SHIFT)
|
|
||||||
#define SCREEN_DRAWABLE (2 << FTYPE_SHIFT)
|
|
||||||
|
|
||||||
typedef UWORD DRAWABLE_TYPE;
|
typedef UWORD DRAWABLE_TYPE;
|
||||||
|
#define ROM_DRAWABLE 0
|
||||||
|
#define RAM_DRAWABLE 1
|
||||||
|
#define SCREEN_DRAWABLE 2
|
||||||
|
|
||||||
#define DATA_HARDWARE (1 << 12)
|
#define DATA_HARDWARE (1 << 12)
|
||||||
#define DATA_COPY (1 << 13)
|
#define DATA_COPY (1 << 13)
|
||||||
#define DATA_PACKED (1 << 14)
|
#define DATA_PACKED (1 << 14)
|
||||||
#define X_FLIP (1 << 15)
|
#define X_FLIP (1 << 15)
|
||||||
|
|
||||||
typedef struct
|
typedef struct frame_desc
|
||||||
{
|
{
|
||||||
DWORD TypeIndexAndFlags;
|
DRAWABLE_TYPE Type;
|
||||||
|
UWORD Index;
|
||||||
HOT_SPOT HotSpot;
|
HOT_SPOT HotSpot;
|
||||||
DWORD Bounds;
|
EXTENT Bounds;
|
||||||
TFB_Image *image;
|
TFB_Image *image;
|
||||||
struct _drawable_desc *parent;
|
struct drawable_desc *parent;
|
||||||
} FRAME_DESC;
|
} FRAME_DESC;
|
||||||
typedef FRAME_DESC *PFRAME_DESC;
|
typedef FRAME_DESC *PFRAME_DESC;
|
||||||
|
|
||||||
typedef struct _drawable_desc
|
typedef struct drawable_desc
|
||||||
{
|
{
|
||||||
MEM_HANDLE hDrawable;
|
MEM_HANDLE hDrawable;
|
||||||
|
|
||||||
UWORD FlagsAndIndex;
|
CREATE_FLAGS Flags;
|
||||||
|
UWORD MaxIndex;
|
||||||
FRAME_DESC *Frame;
|
FRAME_DESC *Frame;
|
||||||
} DRAWABLE_DESC;
|
} DRAWABLE_DESC;
|
||||||
typedef DRAWABLE_DESC *PDRAWABLE_DESC;
|
typedef DRAWABLE_DESC *PDRAWABLE_DESC;
|
||||||
|
|
||||||
#define GetFrameWidth(f) LOWORD (((FRAMEPTR)(f))->Bounds)
|
#define GetFrameWidth(f) (((PFRAME_DESC)(f))->Bounds.width)
|
||||||
#define GetFrameHeight(f) HIWORD (((FRAMEPTR)(f))->Bounds)
|
#define GetFrameHeight(f) (((PFRAME_DESC)(f))->Bounds.height)
|
||||||
#define SetFrameBounds(f,w,h) (((FRAMEPTR)(f))->Bounds=MAKE_DWORD(w,h))
|
#define SetFrameBounds(f,w,h) \
|
||||||
#define GetFrameFlags(f) HIWORD(((FRAMEPTR)(f))->TypeIndexAndFlags)
|
(((PFRAME_DESC)(f))->Bounds.width=(w), \
|
||||||
#define AddFrameFlags(f,v) (((FRAMEPTR)(f))->TypeIndexAndFlags|=((DWORD)(v)<<16))
|
((PFRAME_DESC)(f))->Bounds.height=(h))
|
||||||
#define SubFrameFlags(f,v) (((FRAMEPTR)(f))->TypeIndexAndFlags&=~((DWORD)(v)<<16))
|
|
||||||
|
|
||||||
#define DRAWABLE_PRIORITY DEFAULT_MEM_PRIORITY
|
#define DRAWABLE_PRIORITY DEFAULT_MEM_PRIORITY
|
||||||
|
|
||||||
|
|||||||
@@ -44,9 +44,7 @@ ReleaseDrawable (FRAMEPTR FramePtr)
|
|||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
|
|
||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
Drawable = BUILD_DRAWABLE (
|
Drawable = BUILD_DRAWABLE (DrawablePtr->hDrawable, FramePtr->Index);
|
||||||
DrawablePtr->hDrawable, INDEX_GET (FramePtr->TypeIndexAndFlags)
|
|
||||||
);
|
|
||||||
UnlockDrawable (Drawable);
|
UnlockDrawable (Drawable);
|
||||||
|
|
||||||
return (Drawable);
|
return (Drawable);
|
||||||
@@ -76,7 +74,7 @@ GetFrameCount (FRAMEPTR FramePtr)
|
|||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
return (INDEX_GET (DrawablePtr->FlagsAndIndex) + 1);
|
return DrawablePtr->MaxIndex + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
COUNT
|
COUNT
|
||||||
@@ -85,7 +83,7 @@ GetFrameIndex (FRAMEPTR FramePtr)
|
|||||||
if (FramePtr == 0)
|
if (FramePtr == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
return ((UWORD)INDEX_GET (FramePtr->TypeIndexAndFlags));
|
return FramePtr->Index;
|
||||||
}
|
}
|
||||||
|
|
||||||
FRAME
|
FRAME
|
||||||
@@ -97,8 +95,7 @@ SetAbsFrameIndex (FRAMEPTR FramePtr, COUNT FrameIndex)
|
|||||||
|
|
||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
|
|
||||||
FrameIndex = FrameIndex
|
FrameIndex = FrameIndex % (DrawablePtr->MaxIndex + 1);
|
||||||
% (INDEX_GET (DrawablePtr->FlagsAndIndex) + 1);
|
|
||||||
FramePtr = (FRAMEPTR)&DrawablePtr->Frame[FrameIndex];
|
FramePtr = (FRAMEPTR)&DrawablePtr->Frame[FrameIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,14 +111,14 @@ SetRelFrameIndex (FRAMEPTR FramePtr, SIZE FrameOffs)
|
|||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
|
|
||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
num_frames = INDEX_GET (DrawablePtr->FlagsAndIndex) + 1;
|
num_frames = DrawablePtr->MaxIndex + 1;
|
||||||
if (FrameOffs < 0)
|
if (FrameOffs < 0)
|
||||||
{
|
{
|
||||||
while ((FrameOffs += num_frames) < 0)
|
while ((FrameOffs += num_frames) < 0)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameOffs = ((SWORD)INDEX_GET (FramePtr->TypeIndexAndFlags) + FrameOffs) % num_frames;
|
FrameOffs = ((SWORD)FramePtr->Index + FrameOffs) % num_frames;
|
||||||
FramePtr = (FRAMEPTR)&DrawablePtr->Frame[FrameOffs];
|
FramePtr = (FRAMEPTR)&DrawablePtr->Frame[FrameOffs];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +147,7 @@ IncFrameIndex (FRAMEPTR FramePtr)
|
|||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
if (INDEX_GET (FramePtr->TypeIndexAndFlags) < (DWORD)INDEX_GET (DrawablePtr->FlagsAndIndex))
|
if (FramePtr->Index < DrawablePtr->MaxIndex)
|
||||||
return ((FRAME)++FramePtr);
|
return ((FRAME)++FramePtr);
|
||||||
else
|
else
|
||||||
return ((FRAME)DrawablePtr->Frame);
|
return ((FRAME)DrawablePtr->Frame);
|
||||||
@@ -162,13 +159,13 @@ DecFrameIndex (FRAMEPTR FramePtr)
|
|||||||
if (FramePtr == 0)
|
if (FramePtr == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
if (INDEX_GET (FramePtr->TypeIndexAndFlags))
|
if (FramePtr->Index > 0)
|
||||||
return ((FRAME)--FramePtr);
|
return ((FRAME)--FramePtr);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
|
|
||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
return ((FRAME)&DrawablePtr->Frame[INDEX_GET (DrawablePtr->FlagsAndIndex)]);
|
return ((FRAME)&DrawablePtr->Frame[DrawablePtr->MaxIndex]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,11 +39,10 @@ GetGraphicScale ()
|
|||||||
static void
|
static void
|
||||||
read_screen (PRECT lpRect, FRAMEPTR DstFramePtr)
|
read_screen (PRECT lpRect, FRAMEPTR DstFramePtr)
|
||||||
{
|
{
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) != SCREEN_DRAWABLE
|
if (_CurFramePtr->Type != SCREEN_DRAWABLE
|
||||||
|| TYPE_GET (DstFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE
|
|| DstFramePtr->Type == SCREEN_DRAWABLE
|
||||||
|| !(TYPE_GET (GetFrameParentDrawable (DstFramePtr)
|
|| !(GetFrameParentDrawable (DstFramePtr)->Flags
|
||||||
->FlagsAndIndex)
|
& MAPPED_TO_DISPLAY))
|
||||||
& ((DWORD) MAPPED_TO_DISPLAY << FTYPE_SHIFT)))
|
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "Unimplemented function activated: read_screen()");
|
log_add (log_Warning, "Unimplemented function activated: read_screen()");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ 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, ROM_DRAWABLE);
|
FramePtr->Type = ROM_DRAWABLE;
|
||||||
INDEX_SET (FramePtr->TypeIndexAndFlags, cel_ct);
|
FramePtr->Index = cel_ct;
|
||||||
|
|
||||||
// handle transparency cases
|
// handle transparency cases
|
||||||
if (img[cel_ct]->format->palette)
|
if (img[cel_ct]->format->palette)
|
||||||
@@ -193,8 +193,7 @@ FRAMEPTR stretch_frame (FRAMEPTR FramePtr, int neww, int newh, int destroy)
|
|||||||
TFB_Canvas src, dst;
|
TFB_Canvas src, dst;
|
||||||
EXTENT ext;
|
EXTENT ext;
|
||||||
|
|
||||||
flags = TYPE_GET (GetFrameParentDrawable (FramePtr)
|
flags = GetFrameParentDrawable (FramePtr)->Flags;
|
||||||
->FlagsAndIndex) >> FTYPE_SHIFT;
|
|
||||||
NewFrame = CaptureDrawable (
|
NewFrame = CaptureDrawable (
|
||||||
CreateDrawable (flags, (SIZE)neww, (SIZE)newh, 1));
|
CreateDrawable (flags, (SIZE)neww, (SIZE)newh, 1));
|
||||||
tfbImg = FramePtr->image;
|
tfbImg = FramePtr->image;
|
||||||
@@ -454,9 +453,8 @@ _GetCelData (uio_Stream *fp, DWORD length)
|
|||||||
FRAMEPTR FramePtr;
|
FRAMEPTR FramePtr;
|
||||||
|
|
||||||
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
||||||
TYPE_SET (DrawablePtr->FlagsAndIndex,
|
DrawablePtr->Flags = WANT_PIXMAP;
|
||||||
(DRAWABLE_TYPE)WANT_PIXMAP << FTYPE_SHIFT);
|
DrawablePtr->MaxIndex = cel_ct - 1;
|
||||||
INDEX_SET (DrawablePtr->FlagsAndIndex, cel_ct - 1);
|
|
||||||
|
|
||||||
FramePtr = &DrawablePtr->Frame[cel_ct];
|
FramePtr = &DrawablePtr->Frame[cel_ct];
|
||||||
while (--FramePtr, cel_ct--)
|
while (--FramePtr, cel_ct--)
|
||||||
@@ -482,12 +480,12 @@ _ReleaseCelData (MEM_HANDLE handle)
|
|||||||
if ((DrawablePtr = LockDrawable (handle)) == 0)
|
if ((DrawablePtr = LockDrawable (handle)) == 0)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
cel_ct = INDEX_GET (DrawablePtr->FlagsAndIndex)+1;
|
cel_ct = DrawablePtr->MaxIndex + 1;
|
||||||
|
|
||||||
if (DrawablePtr->Frame)
|
if (DrawablePtr->Frame)
|
||||||
{
|
{
|
||||||
FramePtr = DrawablePtr->Frame;
|
FramePtr = DrawablePtr->Frame;
|
||||||
if (TYPE_GET (FramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
if (FramePtr->Type == SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
FramePtr = NULL;
|
FramePtr = NULL;
|
||||||
}
|
}
|
||||||
@@ -753,8 +751,8 @@ _request_drawable (COUNT NumFrames, DRAWABLE_TYPE DrawableType,
|
|||||||
FRAMEPTR FramePtr;
|
FRAMEPTR FramePtr;
|
||||||
|
|
||||||
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
||||||
TYPE_SET (DrawablePtr->FlagsAndIndex, flags << FTYPE_SHIFT);
|
DrawablePtr->Flags = flags;
|
||||||
INDEX_SET (DrawablePtr->FlagsAndIndex, NumFrames - 1);
|
DrawablePtr->MaxIndex = NumFrames - 1;
|
||||||
|
|
||||||
imgw = width;
|
imgw = width;
|
||||||
imgh = height;
|
imgh = height;
|
||||||
@@ -771,8 +769,8 @@ _request_drawable (COUNT NumFrames, DRAWABLE_TYPE DrawableType,
|
|||||||
FramePtr->image = Image;
|
FramePtr->image = Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPE_SET (FramePtr->TypeIndexAndFlags, DrawableType);
|
FramePtr->Type = DrawableType;
|
||||||
INDEX_SET (FramePtr->TypeIndexAndFlags, NumFrames);
|
FramePtr->Index = NumFrames;
|
||||||
SetFrameBounds (FramePtr, width, height);
|
SetFrameBounds (FramePtr, width, height);
|
||||||
--FramePtr;
|
--FramePtr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (DrawCommand->Type <= TFB_DRAWCOMMANDTYPE_COPYTOIMAGE
|
if (DrawCommand->Type <= TFB_DRAWCOMMANDTYPE_COPYTOIMAGE
|
||||||
&& TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
&& _CurFramePtr->Type == SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
static RECT scissor_rect;
|
static RECT scissor_rect;
|
||||||
|
|
||||||
|
|||||||
@@ -534,16 +534,15 @@ void random16xZoomSurfaceRGBA (SDL_Surface *src, SDL_Surface *dst)
|
|||||||
FRAMEPTR scale16xRandomizeFrame (FRAMEPTR NewFrame, FRAMEPTR FramePtr)
|
FRAMEPTR scale16xRandomizeFrame (FRAMEPTR NewFrame, FRAMEPTR FramePtr)
|
||||||
{
|
{
|
||||||
TFB_Image *origImg, *newImg;
|
TFB_Image *origImg, *newImg;
|
||||||
UBYTE type;
|
CREATE_FLAGS flags;
|
||||||
|
|
||||||
if (NewFrame == NULL)
|
if (NewFrame == NULL)
|
||||||
{
|
{
|
||||||
type = (UBYTE)TYPE_GET (GetFrameParentDrawable (FramePtr)
|
flags = GetFrameParentDrawable (FramePtr)->Flags;
|
||||||
->FlagsAndIndex) >> FTYPE_SHIFT;
|
|
||||||
NewFrame = CaptureDrawable (
|
NewFrame = CaptureDrawable (
|
||||||
CreateDrawable (type,
|
CreateDrawable (flags,
|
||||||
(SIZE)((GetFrameWidth (FramePtr)) << 2),
|
GetFrameWidth (FramePtr) << 2,
|
||||||
(SIZE)((GetFrameHeight (FramePtr)) << 2), 1));
|
GetFrameHeight (FramePtr) << 2, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
newImg = NewFrame->image;
|
newImg = NewFrame->image;
|
||||||
|
|||||||
@@ -37,7 +37,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 (_CurFramePtr->Type == 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);
|
||||||
@@ -92,7 +92,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 (_CurFramePtr->Type == 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);
|
||||||
@@ -108,7 +108,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 (_CurFramePtr->Type == 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);
|
||||||
@@ -153,7 +153,7 @@ TFB_Prim_Stamp (PSTAMP stmp)
|
|||||||
|
|
||||||
UnlockMutex (img->mutex);
|
UnlockMutex (img->mutex);
|
||||||
|
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
if (_CurFramePtr->Type == SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
TFB_DrawScreen_Image (img, x, y, gscale, cmap, TFB_SCREEN_MAIN);
|
TFB_DrawScreen_Image (img, x, y, gscale, cmap, TFB_SCREEN_MAIN);
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ TFB_Prim_StampFill (PSTAMP stmp, TFB_Palette *color)
|
|||||||
|
|
||||||
UnlockMutex (img->mutex);
|
UnlockMutex (img->mutex);
|
||||||
|
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
if (_CurFramePtr->Type == 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);
|
||||||
@@ -220,7 +220,7 @@ TFB_Prim_FontChar (PPOINT origin, TFB_Char *fontChar, TFB_Image *backing)
|
|||||||
x = origin->x - _CurFramePtr->HotSpot.x;
|
x = origin->x - _CurFramePtr->HotSpot.x;
|
||||||
y = origin->y - _CurFramePtr->HotSpot.y;
|
y = origin->y - _CurFramePtr->HotSpot.y;
|
||||||
|
|
||||||
if (TYPE_GET (_CurFramePtr->TypeIndexAndFlags) == SCREEN_DRAWABLE)
|
if (_CurFramePtr->Type == SCREEN_DRAWABLE)
|
||||||
{
|
{
|
||||||
TFB_DrawScreen_FontChar (fontChar, backing, x, y,
|
TFB_DrawScreen_FontChar (fontChar, backing, x, y,
|
||||||
TFB_SCREEN_MAIN);
|
TFB_SCREEN_MAIN);
|
||||||
|
|||||||
Reference in New Issue
Block a user