Major cleanup of the FRAME, CONTEXT, and FONT abstraction layers.
The PFRAME_DESC, FRAMEPTR, PCONTEXT_DESC, CONTEXTPTR, PFONT_DESC, and FONTPTR types are all now defunct. gfxintrn.h has also been vastly simplified. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2698 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
Changes towards version 0.7:
|
Changes towards version 0.7:
|
||||||
|
- Cleaned up FRAME, CONTEXT, and FONT abstraction layers - Michael
|
||||||
- Added Input Frames to pause code to stop infinite loops - Michael
|
- Added Input Frames to pause code to stop infinite loops - Michael
|
||||||
- Added more netplay debug code - SvdB
|
- Added more netplay debug code - SvdB
|
||||||
- Added uio_fprintf() and uio_vfprintf() - SvdB
|
- Added uio_fprintf() and uio_vfprintf() - SvdB
|
||||||
|
|||||||
@@ -21,9 +21,13 @@
|
|||||||
|
|
||||||
#include "memlib.h"
|
#include "memlib.h"
|
||||||
|
|
||||||
#define CONTEXT PVOID
|
typedef struct context_desc CONTEXT_DESC;
|
||||||
#define FRAME PVOID
|
typedef struct frame_desc FRAME_DESC;
|
||||||
#define FONT PVOID
|
typedef struct font_desc FONT_DESC;
|
||||||
|
|
||||||
|
typedef CONTEXT_DESC *CONTEXT;
|
||||||
|
typedef FRAME_DESC *FRAME;
|
||||||
|
typedef FONT_DESC *FONT;
|
||||||
|
|
||||||
typedef CONTEXT *PCONTEXT;
|
typedef CONTEXT *PCONTEXT;
|
||||||
typedef FRAME *PFRAME;
|
typedef FRAME *PFRAME;
|
||||||
@@ -183,12 +187,6 @@ enum
|
|||||||
FadeSomeToColor
|
FadeSomeToColor
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _GFXLIB_H */
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _GFX_PROTOS
|
|
||||||
#define _GFX_PROTOS
|
|
||||||
|
|
||||||
extern BOOLEAN InitGraphics (int argc, char *argv[], COUNT
|
extern BOOLEAN InitGraphics (int argc, char *argv[], COUNT
|
||||||
KbytesRequired);
|
KbytesRequired);
|
||||||
extern void UninitGraphics (void);
|
extern void UninitGraphics (void);
|
||||||
@@ -278,5 +276,4 @@ extern void FlushColorXForms (void);
|
|||||||
void SetSystemRect (PRECT pRect);
|
void SetSystemRect (PRECT pRect);
|
||||||
void ClearSystemRect (void);
|
void ClearSystemRect (void);
|
||||||
|
|
||||||
#endif /* _GFX_PROTOS */
|
#endif /* _GFXLIB_H */
|
||||||
|
|
||||||
|
|||||||
@@ -20,18 +20,18 @@
|
|||||||
#include "gfxother.h"
|
#include "gfxother.h"
|
||||||
|
|
||||||
GRAPHICS_STATUS _GraphicsStatusFlags;
|
GRAPHICS_STATUS _GraphicsStatusFlags;
|
||||||
CONTEXTPTR _pCurContext;
|
CONTEXT _pCurContext;
|
||||||
|
|
||||||
PRIMITIVE _locPrim;
|
PRIMITIVE _locPrim;
|
||||||
|
|
||||||
FONTPTR _CurFontPtr;
|
FONT _CurFontPtr;
|
||||||
|
|
||||||
CONTEXT
|
CONTEXT
|
||||||
SetContext (CONTEXT Context)
|
SetContext (CONTEXT Context)
|
||||||
{
|
{
|
||||||
CONTEXT LastContext;
|
CONTEXT LastContext;
|
||||||
|
|
||||||
LastContext = (CONTEXT)_pCurContext;
|
LastContext = _pCurContext;
|
||||||
if (Context != LastContext)
|
if (Context != LastContext)
|
||||||
{
|
{
|
||||||
if (LastContext)
|
if (LastContext)
|
||||||
@@ -47,7 +47,7 @@ SetContext (CONTEXT Context)
|
|||||||
DeactivateContext ();
|
DeactivateContext ();
|
||||||
}
|
}
|
||||||
|
|
||||||
_pCurContext = (CONTEXTPTR)Context;
|
_pCurContext = Context;
|
||||||
if (_pCurContext)
|
if (_pCurContext)
|
||||||
{
|
{
|
||||||
ActivateContext ();
|
ActivateContext ();
|
||||||
@@ -57,8 +57,8 @@ SetContext (CONTEXT Context)
|
|||||||
|
|
||||||
SetPrimColor (&_locPrim, _get_context_fg_color ());
|
SetPrimColor (&_locPrim, _get_context_fg_color ());
|
||||||
|
|
||||||
_CurFramePtr = (FRAMEPTR)_get_context_fg_frame ();
|
_CurFramePtr = _get_context_fg_frame ();
|
||||||
_CurFontPtr = (FONTPTR)_get_context_font ();
|
_CurFontPtr = _get_context_font ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,21 +103,18 @@ DestroyContext (CONTEXT_REF ContextRef)
|
|||||||
CONTEXT
|
CONTEXT
|
||||||
CaptureContext (CONTEXT_REF ContextRef)
|
CaptureContext (CONTEXT_REF ContextRef)
|
||||||
{
|
{
|
||||||
CONTEXTPTR ContextPtr;
|
CONTEXT ContextPtr;
|
||||||
|
|
||||||
ContextPtr = LockContext (ContextRef);
|
ContextPtr = LockContext (ContextRef);
|
||||||
if (ContextPtr)
|
if (ContextPtr)
|
||||||
ContextPtr->ContextRef = ContextRef;
|
ContextPtr->ContextRef = ContextRef;
|
||||||
|
|
||||||
return ((CONTEXT)ContextPtr);
|
return (ContextPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
CONTEXT_REF
|
CONTEXT_REF
|
||||||
ReleaseContext (CONTEXT Context)
|
ReleaseContext (CONTEXT ContextPtr)
|
||||||
{
|
{
|
||||||
CONTEXTPTR ContextPtr;
|
|
||||||
|
|
||||||
ContextPtr = (CONTEXTPTR)Context;
|
|
||||||
if (ContextPtr)
|
if (ContextPtr)
|
||||||
{
|
{
|
||||||
CONTEXT_REF ContextRef;
|
CONTEXT_REF ContextRef;
|
||||||
@@ -261,7 +258,7 @@ FixContextFontEffect (void)
|
|||||||
img = TFB_DrawImage_CreateForScreen (w, h, TRUE);
|
img = TFB_DrawImage_CreateForScreen (w, h, TRUE);
|
||||||
if (_get_context_fbk_flags () & FBK_IMAGE)
|
if (_get_context_fbk_flags () & FBK_IMAGE)
|
||||||
{ // image pattern backing
|
{ // image pattern backing
|
||||||
FRAMEPTR EffectFrame = (FRAMEPTR)_get_context_fonteff ();
|
FRAME EffectFrame = _get_context_fonteff ();
|
||||||
|
|
||||||
TFB_DrawImage_Image (EffectFrame->image,
|
TFB_DrawImage_Image (EffectFrame->image,
|
||||||
-EffectFrame->HotSpot.x, -EffectFrame->HotSpot.y,
|
-EffectFrame->HotSpot.x, -EffectFrame->HotSpot.y,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ typedef UWORD FBK_FLAGS;
|
|||||||
#define FBK_DIRTY (1 << 0)
|
#define FBK_DIRTY (1 << 0)
|
||||||
#define FBK_IMAGE (1 << 1)
|
#define FBK_IMAGE (1 << 1)
|
||||||
|
|
||||||
typedef struct
|
struct context_desc
|
||||||
{
|
{
|
||||||
CONTEXT_REF ContextRef;
|
CONTEXT_REF ContextRef;
|
||||||
UWORD Flags;
|
UWORD Flags;
|
||||||
@@ -40,21 +40,18 @@ typedef struct
|
|||||||
TFB_Image *FontBacking;
|
TFB_Image *FontBacking;
|
||||||
FBK_FLAGS BackingFlags;
|
FBK_FLAGS BackingFlags;
|
||||||
|
|
||||||
} CONTEXT_DESC;
|
};
|
||||||
typedef CONTEXT_DESC *PCONTEXT_DESC;
|
|
||||||
|
|
||||||
#define CONTEXT_PRIORITY DEFAULT_MEM_PRIORITY
|
#define CONTEXT_PRIORITY DEFAULT_MEM_PRIORITY
|
||||||
|
|
||||||
#define CONTEXTPTR PCONTEXT_DESC
|
|
||||||
|
|
||||||
#define AllocContext() \
|
#define AllocContext() \
|
||||||
(CONTEXT_REF)mem_allocate ((MEM_SIZE)sizeof (CONTEXT_DESC), \
|
(CONTEXT_REF)mem_allocate ((MEM_SIZE)sizeof (CONTEXT_DESC), \
|
||||||
MEM_ZEROINIT | MEM_PRIMARY, CONTEXT_PRIORITY, MEM_SIMPLE)
|
MEM_ZEROINIT | MEM_PRIMARY, CONTEXT_PRIORITY, MEM_SIMPLE)
|
||||||
#define LockContext (CONTEXTPTR)mem_lock
|
#define LockContext (CONTEXT)mem_lock
|
||||||
#define UnlockContext mem_unlock
|
#define UnlockContext mem_unlock
|
||||||
#define FreeContext mem_release
|
#define FreeContext mem_release
|
||||||
|
|
||||||
extern CONTEXTPTR _pCurContext;
|
extern CONTEXT _pCurContext;
|
||||||
extern PRIMITIVE _locPrim;
|
extern PRIMITIVE _locPrim;
|
||||||
|
|
||||||
#define _get_context_fg_color() (_pCurContext->ForeGroundColor)
|
#define _get_context_fg_color() (_pCurContext->ForeGroundColor)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ typedef struct
|
|||||||
DRAWABLE (*alloc_image) (COUNT NumFrames, DRAWABLE_TYPE DrawableType,
|
DRAWABLE (*alloc_image) (COUNT NumFrames, DRAWABLE_TYPE DrawableType,
|
||||||
CREATE_FLAGS flags, SIZE width, SIZE height);
|
CREATE_FLAGS flags, SIZE width, SIZE height);
|
||||||
|
|
||||||
void (*read_display) (PRECT pRect, FRAMEPTR DstFramePtr);
|
void (*read_display) (PRECT pRect, FRAME DstFramePtr);
|
||||||
|
|
||||||
} DISPLAY_INTERFACE;
|
} DISPLAY_INTERFACE;
|
||||||
typedef DISPLAY_INTERFACE *PDISPLAY_INTERFACE;
|
typedef DISPLAY_INTERFACE *PDISPLAY_INTERFACE;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "libs/mathlib.h"
|
#include "libs/mathlib.h"
|
||||||
#include "gfxother.h"
|
#include "gfxother.h"
|
||||||
|
|
||||||
FRAMEPTR _CurFramePtr;
|
FRAME _CurFramePtr;
|
||||||
|
|
||||||
FRAME
|
FRAME
|
||||||
SetContextFGFrame (FRAME Frame)
|
SetContextFGFrame (FRAME Frame)
|
||||||
@@ -35,7 +35,7 @@ SetContextFGFrame (FRAME Frame)
|
|||||||
if (LastFrame)
|
if (LastFrame)
|
||||||
DeactivateDrawable ();
|
DeactivateDrawable ();
|
||||||
|
|
||||||
_CurFramePtr = (FRAMEPTR)Frame;
|
_CurFramePtr = Frame;
|
||||||
if (_CurFramePtr)
|
if (_CurFramePtr)
|
||||||
ActivateDrawable ();
|
ActivateDrawable ();
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ CreateDisplay (CREATE_FLAGS CreateFlags, PSIZE pwidth, PSIZE pheight)
|
|||||||
GetDisplayWidth (), GetDisplayHeight ());
|
GetDisplayWidth (), GetDisplayHeight ());
|
||||||
if (Drawable)
|
if (Drawable)
|
||||||
{
|
{
|
||||||
FRAMEPTR F;
|
FRAME F;
|
||||||
|
|
||||||
if ((F = CaptureDrawable (Drawable)) == 0)
|
if ((F = CaptureDrawable (Drawable)) == 0)
|
||||||
DestroyDrawable (Drawable);
|
DestroyDrawable (Drawable);
|
||||||
@@ -91,11 +91,11 @@ AllocDrawable (COUNT n)
|
|||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
int i;
|
int i;
|
||||||
DrawablePtr = LockDrawable (Drawable);
|
DrawablePtr = LockDrawable (Drawable);
|
||||||
DrawablePtr->Frame = (FRAMEPTR)HMalloc ((MEM_SIZE)(sizeof (FRAME_DESC) * n));
|
DrawablePtr->Frame = (FRAME)HMalloc ((MEM_SIZE)(sizeof (FRAME_DESC) * n));
|
||||||
|
|
||||||
/* Zero out the newly allocated frames, since HMalloc doesn't have MEM_ZEROINIT. */
|
/* Zero out the newly allocated frames, since HMalloc doesn't have MEM_ZEROINIT. */
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
FRAMEPTR F;
|
FRAME F;
|
||||||
F = &DrawablePtr->Frame[i];
|
F = &DrawablePtr->Frame[i];
|
||||||
F->parent = DrawablePtr;
|
F->parent = DrawablePtr;
|
||||||
F->Type = 0;
|
F->Type = 0;
|
||||||
@@ -125,7 +125,7 @@ CreateDrawable (CREATE_FLAGS CreateFlags, SIZE width, SIZE height, COUNT
|
|||||||
width, height);
|
width, height);
|
||||||
if (Drawable)
|
if (Drawable)
|
||||||
{
|
{
|
||||||
FRAMEPTR F;
|
FRAME F;
|
||||||
|
|
||||||
F = CaptureDrawable (Drawable);
|
F = CaptureDrawable (Drawable);
|
||||||
if (F)
|
if (F)
|
||||||
@@ -160,7 +160,7 @@ DestroyDrawable (DRAWABLE Drawable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
GetFrameRect (FRAMEPTR FramePtr, PRECT pRect)
|
GetFrameRect (FRAME FramePtr, PRECT pRect)
|
||||||
{
|
{
|
||||||
if (FramePtr)
|
if (FramePtr)
|
||||||
{
|
{
|
||||||
@@ -176,7 +176,7 @@ GetFrameRect (FRAMEPTR FramePtr, PRECT pRect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
HOT_SPOT
|
HOT_SPOT
|
||||||
SetFrameHot (FRAMEPTR FramePtr, HOT_SPOT HotSpot)
|
SetFrameHot (FRAME FramePtr, HOT_SPOT HotSpot)
|
||||||
{
|
{
|
||||||
if (FramePtr)
|
if (FramePtr)
|
||||||
{
|
{
|
||||||
@@ -192,7 +192,7 @@ SetFrameHot (FRAMEPTR FramePtr, HOT_SPOT HotSpot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
HOT_SPOT
|
HOT_SPOT
|
||||||
GetFrameHot (FRAMEPTR FramePtr)
|
GetFrameHot (FRAME FramePtr)
|
||||||
{
|
{
|
||||||
if (FramePtr)
|
if (FramePtr)
|
||||||
{
|
{
|
||||||
@@ -203,10 +203,10 @@ GetFrameHot (FRAMEPTR FramePtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DRAWABLE
|
DRAWABLE
|
||||||
RotateFrame (FRAMEPTR Frame, COUNT angle)
|
RotateFrame (FRAME Frame, COUNT angle)
|
||||||
{
|
{
|
||||||
DRAWABLE Drawable;
|
DRAWABLE Drawable;
|
||||||
FRAMEPTR RotFramePtr;
|
FRAME RotFramePtr;
|
||||||
SIZE dx, dy;
|
SIZE dx, dy;
|
||||||
SIZE d;
|
SIZE d;
|
||||||
COUNT organg;
|
COUNT organg;
|
||||||
@@ -245,7 +245,7 @@ RotateFrame (FRAMEPTR Frame, COUNT angle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SetFrameTransparentColor (FRAMEPTR Frame, COLOR c32k)
|
SetFrameTransparentColor (FRAME Frame, COLOR c32k)
|
||||||
{
|
{
|
||||||
TFB_Palette color;
|
TFB_Palette color;
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ typedef UWORD DRAWABLE_TYPE;
|
|||||||
#define RAM_DRAWABLE 1
|
#define RAM_DRAWABLE 1
|
||||||
#define SCREEN_DRAWABLE 2
|
#define SCREEN_DRAWABLE 2
|
||||||
|
|
||||||
typedef struct frame_desc
|
struct frame_desc
|
||||||
{
|
{
|
||||||
DRAWABLE_TYPE Type;
|
DRAWABLE_TYPE Type;
|
||||||
UWORD Index;
|
UWORD Index;
|
||||||
@@ -47,8 +47,7 @@ typedef struct frame_desc
|
|||||||
EXTENT Bounds;
|
EXTENT Bounds;
|
||||||
TFB_Image *image;
|
TFB_Image *image;
|
||||||
struct drawable_desc *parent;
|
struct drawable_desc *parent;
|
||||||
} FRAME_DESC;
|
};
|
||||||
typedef FRAME_DESC *PFRAME_DESC;
|
|
||||||
|
|
||||||
typedef struct drawable_desc
|
typedef struct drawable_desc
|
||||||
{
|
{
|
||||||
@@ -60,16 +59,15 @@ typedef struct drawable_desc
|
|||||||
} DRAWABLE_DESC;
|
} DRAWABLE_DESC;
|
||||||
typedef DRAWABLE_DESC *PDRAWABLE_DESC;
|
typedef DRAWABLE_DESC *PDRAWABLE_DESC;
|
||||||
|
|
||||||
#define GetFrameWidth(f) (((PFRAME_DESC)(f))->Bounds.width)
|
#define GetFrameWidth(f) ((f)->Bounds.width)
|
||||||
#define GetFrameHeight(f) (((PFRAME_DESC)(f))->Bounds.height)
|
#define GetFrameHeight(f) ((f)->Bounds.height)
|
||||||
#define SetFrameBounds(f,w,h) \
|
#define SetFrameBounds(f,w,h) \
|
||||||
(((PFRAME_DESC)(f))->Bounds.width=(w), \
|
((f)->Bounds.width=(w), \
|
||||||
((PFRAME_DESC)(f))->Bounds.height=(h))
|
((f))->Bounds.height=(h))
|
||||||
|
|
||||||
#define DRAWABLE_PRIORITY DEFAULT_MEM_PRIORITY
|
#define DRAWABLE_PRIORITY DEFAULT_MEM_PRIORITY
|
||||||
|
|
||||||
#define DRAWABLEPTR PDRAWABLE_DESC
|
#define DRAWABLEPTR PDRAWABLE_DESC
|
||||||
#define FRAMEPTR PFRAME_DESC
|
|
||||||
#define COUNTPTR PCOUNT
|
#define COUNTPTR PCOUNT
|
||||||
|
|
||||||
extern DRAWABLE AllocDrawable (COUNT num_frames);
|
extern DRAWABLE AllocDrawable (COUNT num_frames);
|
||||||
@@ -90,7 +88,7 @@ extern DRAWABLE AllocDrawable (COUNT num_frames);
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
RECT Box;
|
RECT Box;
|
||||||
FRAMEPTR FramePtr;
|
FRAME FramePtr;
|
||||||
} IMAGE_BOX;
|
} IMAGE_BOX;
|
||||||
typedef IMAGE_BOX *PIMAGE_BOX;
|
typedef IMAGE_BOX *PIMAGE_BOX;
|
||||||
|
|
||||||
@@ -109,7 +107,7 @@ typedef PSTAMP STAMPPTR;
|
|||||||
typedef PTEXT TEXTPTR;
|
typedef PTEXT TEXTPTR;
|
||||||
|
|
||||||
extern STAMP _save_stamp;
|
extern STAMP _save_stamp;
|
||||||
extern FRAMEPTR _CurFramePtr;
|
extern FRAME _CurFramePtr;
|
||||||
|
|
||||||
extern void _rect_blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr);
|
extern void _rect_blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr);
|
||||||
extern void _text_blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr);
|
extern void _text_blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr);
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ SetContextFont (FONT Font)
|
|||||||
{
|
{
|
||||||
FONT LastFont;
|
FONT LastFont;
|
||||||
|
|
||||||
LastFont = (FONT)_CurFontPtr;
|
LastFont = _CurFontPtr;
|
||||||
_CurFontPtr = (FONTPTR)Font;
|
_CurFontPtr = Font;
|
||||||
if (ContextActive ())
|
if (ContextActive ())
|
||||||
SwitchContextFont (Font);
|
SwitchContextFont (Font);
|
||||||
|
|
||||||
@@ -56,21 +56,21 @@ DestroyFont (FONT_REF FontRef)
|
|||||||
FONT
|
FONT
|
||||||
CaptureFont (FONT_REF FontRef)
|
CaptureFont (FONT_REF FontRef)
|
||||||
{
|
{
|
||||||
FONTPTR FontPtr;
|
FONT FontPtr;
|
||||||
|
|
||||||
FontPtr = LockFont (FontRef);
|
FontPtr = LockFont (FontRef);
|
||||||
if (FontPtr)
|
if (FontPtr)
|
||||||
FontPtr->FontRef = FontRef;
|
FontPtr->FontRef = FontRef;
|
||||||
|
|
||||||
return ((FONT)FontPtr);
|
return FontPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
FONT_REF
|
FONT_REF
|
||||||
ReleaseFont (FONT Font)
|
ReleaseFont (FONT Font)
|
||||||
{
|
{
|
||||||
FONTPTR FontPtr;
|
FONT FontPtr;
|
||||||
|
|
||||||
FontPtr = (FONTPTR)Font;
|
FontPtr = Font;
|
||||||
if (FontPtr)
|
if (FontPtr)
|
||||||
{
|
{
|
||||||
FONT_REF FontRef;
|
FONT_REF FontRef;
|
||||||
@@ -122,7 +122,7 @@ GetContextFontLeadingWidth (PSIZE pwidth)
|
|||||||
BOOLEAN
|
BOOLEAN
|
||||||
TextRect (PTEXT lpText, PRECT pRect, PBYTE pdelta)
|
TextRect (PTEXT lpText, PRECT pRect, PBYTE pdelta)
|
||||||
{
|
{
|
||||||
FONTPTR FontPtr;
|
FONT FontPtr;
|
||||||
|
|
||||||
FontPtr = _CurFontPtr;
|
FontPtr = _CurFontPtr;
|
||||||
if (FontPtr != 0 && lpText->CharCount != 0)
|
if (FontPtr != 0 && lpText->CharCount != 0)
|
||||||
@@ -237,7 +237,7 @@ TextRect (PTEXT lpText, PRECT pRect, PBYTE pdelta)
|
|||||||
void
|
void
|
||||||
_text_blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr)
|
_text_blt (PRECT pClipRect, PRIMITIVEPTR PrimPtr)
|
||||||
{
|
{
|
||||||
FONTPTR FontPtr;
|
FONT FontPtr;
|
||||||
|
|
||||||
COUNT num_chars;
|
COUNT num_chars;
|
||||||
wchar_t next_ch;
|
wchar_t next_ch;
|
||||||
|
|||||||
@@ -47,17 +47,15 @@ FreeFontPage (FONT_PAGE *page)
|
|||||||
HFree (page);
|
HFree (page);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct
|
struct font_desc
|
||||||
{
|
{
|
||||||
FONT_REF FontRef;
|
FONT_REF FontRef;
|
||||||
|
|
||||||
UWORD Leading;
|
UWORD Leading;
|
||||||
UWORD LeadingWidth;
|
UWORD LeadingWidth;
|
||||||
FONT_PAGE *fontPages;
|
FONT_PAGE *fontPages;
|
||||||
} FONT_DESC;
|
};
|
||||||
typedef FONT_DESC *PFONT_DESC;
|
|
||||||
|
|
||||||
#define FONTPTR PFONT_DESC
|
|
||||||
#define CHAR_DESCPTR PCHAR_DESC
|
#define CHAR_DESCPTR PCHAR_DESC
|
||||||
|
|
||||||
#define FONT_PRIORITY DEFAULT_MEM_PRIORITY
|
#define FONT_PRIORITY DEFAULT_MEM_PRIORITY
|
||||||
@@ -65,13 +63,13 @@ typedef FONT_DESC *PFONT_DESC;
|
|||||||
#define AllocFont(size) \
|
#define AllocFont(size) \
|
||||||
(FONT_REF)mem_allocate ((MEM_SIZE)(sizeof (FONT_DESC) + (size)), \
|
(FONT_REF)mem_allocate ((MEM_SIZE)(sizeof (FONT_DESC) + (size)), \
|
||||||
MEM_ZEROINIT | MEM_GRAPHICS, FONT_PRIORITY, MEM_SIMPLE)
|
MEM_ZEROINIT | MEM_GRAPHICS, FONT_PRIORITY, MEM_SIMPLE)
|
||||||
#define LockFont(h) (FONTPTR)mem_lock (h)
|
#define LockFont(h) (FONT)mem_lock (h)
|
||||||
#define UnlockFont(h) mem_unlock (h)
|
#define UnlockFont(h) mem_unlock (h)
|
||||||
#define FreeFont _ReleaseFontData
|
#define FreeFont _ReleaseFontData
|
||||||
|
|
||||||
#define NULL_FONT (FONTPTR)NULL_PTR
|
#define NULL_FONT (FONT)NULL_PTR
|
||||||
|
|
||||||
extern FONTPTR _CurFontPtr;
|
extern FONT _CurFontPtr;
|
||||||
|
|
||||||
extern MEM_HANDLE _GetFontData (uio_Stream *fp, DWORD length);
|
extern MEM_HANDLE _GetFontData (uio_Stream *fp, DWORD length);
|
||||||
extern BOOLEAN _ReleaseFontData (MEM_HANDLE handle);
|
extern BOOLEAN _ReleaseFontData (MEM_HANDLE handle);
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define _GFX_PROTOS
|
|
||||||
#include "gfxlib.h"
|
#include "gfxlib.h"
|
||||||
#include "reslib.h"
|
#include "reslib.h"
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
@@ -30,14 +29,5 @@
|
|||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
#undef CONTEXT
|
|
||||||
#define CONTEXT CONTEXTPTR
|
|
||||||
#undef FRAME
|
|
||||||
#define FRAME FRAMEPTR
|
|
||||||
#undef FONT
|
|
||||||
#define FONT FONTPTR
|
|
||||||
#undef _GFX_PROTOS
|
|
||||||
#include "gfxlib.h"
|
|
||||||
|
|
||||||
#endif /* _GFXINTRN_H */
|
#endif /* _GFXINTRN_H */
|
||||||
|
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ DrawablesIntersect (PINTERSECT_CONTROL pControl0,
|
|||||||
SIZE dy;
|
SIZE dy;
|
||||||
SIZE time_y_0, time_y_1;
|
SIZE time_y_0, time_y_1;
|
||||||
RECT r0, r1;
|
RECT r0, r1;
|
||||||
FRAMEPTR FramePtr0, FramePtr1;
|
FRAME FramePtr0, FramePtr1;
|
||||||
|
|
||||||
if (!ContextActive () || max_time_val == 0)
|
if (!ContextActive () || max_time_val == 0)
|
||||||
return ((TIME_VALUE)0);
|
return ((TIME_VALUE)0);
|
||||||
@@ -252,13 +252,13 @@ DrawablesIntersect (PINTERSECT_CONTROL pControl0,
|
|||||||
r1.extent.width = pControl1->EndPoint.x - r1.corner.x;
|
r1.extent.width = pControl1->EndPoint.x - r1.corner.x;
|
||||||
r1.extent.height = pControl1->EndPoint.y - r1.corner.y;
|
r1.extent.height = pControl1->EndPoint.y - r1.corner.y;
|
||||||
|
|
||||||
FramePtr0 = (FRAMEPTR)pControl0->IntersectStamp.frame;
|
FramePtr0 = pControl0->IntersectStamp.frame;
|
||||||
if (FramePtr0 == 0)
|
if (FramePtr0 == 0)
|
||||||
return(0);
|
return(0);
|
||||||
r0.corner.x -= FramePtr0->HotSpot.x;
|
r0.corner.x -= FramePtr0->HotSpot.x;
|
||||||
r0.corner.y -= FramePtr0->HotSpot.y;
|
r0.corner.y -= FramePtr0->HotSpot.y;
|
||||||
|
|
||||||
FramePtr1 = (FRAMEPTR)pControl1->IntersectStamp.frame;
|
FramePtr1 = pControl1->IntersectStamp.frame;
|
||||||
if (FramePtr1 == 0)
|
if (FramePtr1 == 0)
|
||||||
return(0);
|
return(0);
|
||||||
r1.corner.x -= FramePtr1->HotSpot.x;
|
r1.corner.x -= FramePtr1->HotSpot.x;
|
||||||
@@ -393,10 +393,10 @@ DrawablesIntersect (PINTERSECT_CONTROL pControl0,
|
|||||||
pControl0, &r0, pControl1, &r1,
|
pControl0, &r0, pControl1, &r1,
|
||||||
(TIME_VALUE)time_y_0, (TIME_VALUE)time_y_1)))
|
(TIME_VALUE)time_y_0, (TIME_VALUE)time_y_1)))
|
||||||
{
|
{
|
||||||
FramePtr0 = (FRAMEPTR)pControl0->IntersectStamp.frame;
|
FramePtr0 = pControl0->IntersectStamp.frame;
|
||||||
pControl0->EndPoint.x = r0.corner.x + FramePtr0->HotSpot.x;
|
pControl0->EndPoint.x = r0.corner.x + FramePtr0->HotSpot.x;
|
||||||
pControl0->EndPoint.y = r0.corner.y + FramePtr0->HotSpot.y;
|
pControl0->EndPoint.y = r0.corner.y + FramePtr0->HotSpot.y;
|
||||||
FramePtr1 = (FRAMEPTR)pControl1->IntersectStamp.frame;
|
FramePtr1 = pControl1->IntersectStamp.frame;
|
||||||
pControl1->EndPoint.x = r1.corner.x + FramePtr1->HotSpot.x;
|
pControl1->EndPoint.x = r1.corner.x + FramePtr1->HotSpot.x;
|
||||||
pControl1->EndPoint.y = r1.corner.y + FramePtr1->HotSpot.y;
|
pControl1->EndPoint.y = r1.corner.y + FramePtr1->HotSpot.y;
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ LoadDisplayPixmap (PRECT area, FRAME frame)
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
frame = CaptureDrawable (buffer);
|
frame = CaptureDrawable (buffer);
|
||||||
ReadDisplay (area, (FRAMEPTR)frame);
|
ReadDisplay (area, frame);
|
||||||
ReleaseDrawable (frame);
|
ReleaseDrawable (frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ CaptureDrawable (DRAWABLE Drawable)
|
|||||||
COUNT FrameIndex;
|
COUNT FrameIndex;
|
||||||
|
|
||||||
FrameIndex = GetDrawableIndex (Drawable);
|
FrameIndex = GetDrawableIndex (Drawable);
|
||||||
return ((FRAME)&DrawablePtr->Frame[FrameIndex]);
|
return &DrawablePtr->Frame[FrameIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
DRAWABLE
|
DRAWABLE
|
||||||
ReleaseDrawable (FRAMEPTR FramePtr)
|
ReleaseDrawable (FRAME FramePtr)
|
||||||
{
|
{
|
||||||
if (FramePtr != 0)
|
if (FramePtr != 0)
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ ReleaseDrawable (FRAMEPTR FramePtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MEM_HANDLE
|
MEM_HANDLE
|
||||||
GetFrameHandle (FRAMEPTR FramePtr)
|
GetFrameHandle (FRAME FramePtr)
|
||||||
{
|
{
|
||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ GetFrameHandle (FRAMEPTR FramePtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
COUNT
|
COUNT
|
||||||
GetFrameCount (FRAMEPTR FramePtr)
|
GetFrameCount (FRAME FramePtr)
|
||||||
{
|
{
|
||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ GetFrameCount (FRAMEPTR FramePtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
COUNT
|
COUNT
|
||||||
GetFrameIndex (FRAMEPTR FramePtr)
|
GetFrameIndex (FRAME FramePtr)
|
||||||
{
|
{
|
||||||
if (FramePtr == 0)
|
if (FramePtr == 0)
|
||||||
return (0);
|
return (0);
|
||||||
@@ -87,7 +87,7 @@ GetFrameIndex (FRAMEPTR FramePtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FRAME
|
FRAME
|
||||||
SetAbsFrameIndex (FRAMEPTR FramePtr, COUNT FrameIndex)
|
SetAbsFrameIndex (FRAME FramePtr, COUNT FrameIndex)
|
||||||
{
|
{
|
||||||
if (FramePtr != 0)
|
if (FramePtr != 0)
|
||||||
{
|
{
|
||||||
@@ -96,14 +96,14 @@ SetAbsFrameIndex (FRAMEPTR FramePtr, COUNT FrameIndex)
|
|||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
|
|
||||||
FrameIndex = FrameIndex % (DrawablePtr->MaxIndex + 1);
|
FrameIndex = FrameIndex % (DrawablePtr->MaxIndex + 1);
|
||||||
FramePtr = (FRAMEPTR)&DrawablePtr->Frame[FrameIndex];
|
FramePtr = &DrawablePtr->Frame[FrameIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((FRAME)FramePtr);
|
return FramePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
FRAME
|
FRAME
|
||||||
SetRelFrameIndex (FRAMEPTR FramePtr, SIZE FrameOffs)
|
SetRelFrameIndex (FRAME FramePtr, SIZE FrameOffs)
|
||||||
{
|
{
|
||||||
if (FramePtr != 0)
|
if (FramePtr != 0)
|
||||||
{
|
{
|
||||||
@@ -119,14 +119,14 @@ SetRelFrameIndex (FRAMEPTR FramePtr, SIZE FrameOffs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FrameOffs = ((SWORD)FramePtr->Index + FrameOffs) % num_frames;
|
FrameOffs = ((SWORD)FramePtr->Index + FrameOffs) % num_frames;
|
||||||
FramePtr = (FRAMEPTR)&DrawablePtr->Frame[FrameOffs];
|
FramePtr = &DrawablePtr->Frame[FrameOffs];
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((FRAME)FramePtr);
|
return FramePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
FRAME
|
FRAME
|
||||||
SetEquFrameIndex (FRAMEPTR DstFramePtr, FRAMEPTR SrcFramePtr)
|
SetEquFrameIndex (FRAME DstFramePtr, FRAME SrcFramePtr)
|
||||||
{
|
{
|
||||||
if (DstFramePtr && SrcFramePtr)
|
if (DstFramePtr && SrcFramePtr)
|
||||||
return ((FRAME)(
|
return ((FRAME)(
|
||||||
@@ -139,7 +139,7 @@ SetEquFrameIndex (FRAMEPTR DstFramePtr, FRAMEPTR SrcFramePtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FRAME
|
FRAME
|
||||||
IncFrameIndex (FRAMEPTR FramePtr)
|
IncFrameIndex (FRAME FramePtr)
|
||||||
{
|
{
|
||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
|
|
||||||
@@ -148,24 +148,24 @@ IncFrameIndex (FRAMEPTR FramePtr)
|
|||||||
|
|
||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
if (FramePtr->Index < DrawablePtr->MaxIndex)
|
if (FramePtr->Index < DrawablePtr->MaxIndex)
|
||||||
return ((FRAME)++FramePtr);
|
return ++FramePtr;
|
||||||
else
|
else
|
||||||
return ((FRAME)DrawablePtr->Frame);
|
return DrawablePtr->Frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
FRAME
|
FRAME
|
||||||
DecFrameIndex (FRAMEPTR FramePtr)
|
DecFrameIndex (FRAME FramePtr)
|
||||||
{
|
{
|
||||||
if (FramePtr == 0)
|
if (FramePtr == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
if (FramePtr->Index > 0)
|
if (FramePtr->Index > 0)
|
||||||
return ((FRAME)--FramePtr);
|
return --FramePtr;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
|
|
||||||
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
DrawablePtr = GetFrameParentDrawable (FramePtr);
|
||||||
return ((FRAME)&DrawablePtr->Frame[DrawablePtr->MaxIndex]);
|
return &DrawablePtr->Frame[DrawablePtr->MaxIndex];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ GetGraphicScale ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_screen (PRECT lpRect, FRAMEPTR DstFramePtr)
|
read_screen (PRECT lpRect, FRAME DstFramePtr)
|
||||||
{
|
{
|
||||||
if (_CurFramePtr->Type != SCREEN_DRAWABLE
|
if (_CurFramePtr->Type != SCREEN_DRAWABLE
|
||||||
|| DstFramePtr->Type == SCREEN_DRAWABLE
|
|| DstFramePtr->Type == SCREEN_DRAWABLE
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ typedef struct anidata
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
process_image (FRAMEPTR FramePtr, SDL_Surface *img[], AniData *ani, int cel_ct)
|
process_image (FRAME FramePtr, SDL_Surface *img[], AniData *ani, int cel_ct)
|
||||||
{
|
{
|
||||||
TFB_Image *tfbimg;
|
TFB_Image *tfbimg;
|
||||||
int hx, hy;
|
int hx, hy;
|
||||||
@@ -185,9 +185,9 @@ processFontChar (TFB_Char* CharPtr, SDL_Surface *surf)
|
|||||||
// create a new frame of size neww x newh, and blit a scaled version FramePtr
|
// create a new frame of size neww x newh, and blit a scaled version FramePtr
|
||||||
// into it.
|
// into it.
|
||||||
// destroy the old frame if 'destroy' is 1
|
// destroy the old frame if 'destroy' is 1
|
||||||
FRAMEPTR stretch_frame (FRAMEPTR FramePtr, int neww, int newh, int destroy)
|
FRAME stretch_frame (FRAME FramePtr, int neww, int newh, int destroy)
|
||||||
{
|
{
|
||||||
FRAMEPTR NewFrame;
|
FRAME NewFrame;
|
||||||
CREATE_FLAGS flags;
|
CREATE_FLAGS flags;
|
||||||
TFB_Image *tfbImg;
|
TFB_Image *tfbImg;
|
||||||
TFB_Canvas src, dst;
|
TFB_Canvas src, dst;
|
||||||
@@ -209,7 +209,7 @@ FRAMEPTR stretch_frame (FRAMEPTR FramePtr, int neww, int newh, int destroy)
|
|||||||
return (NewFrame);
|
return (NewFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_rgb_bmp (FRAMEPTR FramePtr, Uint32 *rgba, int maxx, int maxy)
|
void process_rgb_bmp (FRAME FramePtr, Uint32 *rgba, int maxx, int maxy)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
TFB_Image *tfbImg;
|
TFB_Image *tfbImg;
|
||||||
@@ -230,7 +230,7 @@ void process_rgb_bmp (FRAMEPTR FramePtr, Uint32 *rgba, int maxx, int maxy)
|
|||||||
UnlockMutex (tfbImg->mutex);
|
UnlockMutex (tfbImg->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fill_frame_rgb (FRAMEPTR FramePtr, Uint32 color, int x0, int y0,
|
void fill_frame_rgb (FRAME FramePtr, Uint32 color, int x0, int y0,
|
||||||
int x, int y)
|
int x, int y)
|
||||||
{
|
{
|
||||||
SDL_Surface *img;
|
SDL_Surface *img;
|
||||||
@@ -255,7 +255,7 @@ void fill_frame_rgb (FRAMEPTR FramePtr, Uint32 color, int x0, int y0,
|
|||||||
UnlockMutex (tfbImg->mutex);
|
UnlockMutex (tfbImg->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void arith_frame_blit (FRAMEPTR srcFrame, RECT *rsrc, FRAMEPTR dstFrame,
|
void arith_frame_blit (FRAME srcFrame, RECT *rsrc, FRAME dstFrame,
|
||||||
RECT *rdst, int num, int denom)
|
RECT *rdst, int num, int denom)
|
||||||
{
|
{
|
||||||
TFB_Image *srcImg, *dstImg;
|
TFB_Image *srcImg, *dstImg;
|
||||||
@@ -312,7 +312,7 @@ void arith_frame_blit (FRAMEPTR srcFrame, RECT *rsrc, FRAMEPTR dstFrame,
|
|||||||
// bits 8-15 : blue
|
// bits 8-15 : blue
|
||||||
// bits 0-7 : alpha
|
// bits 0-7 : alpha
|
||||||
// The 8bpp pixel format is 1 index per pixel
|
// The 8bpp pixel format is 1 index per pixel
|
||||||
void getpixelarray (void *map, int Bpp, FRAMEPTR FramePtr,
|
void getpixelarray (void *map, int Bpp, FRAME FramePtr,
|
||||||
int width, int height)
|
int width, int height)
|
||||||
{
|
{
|
||||||
Uint8 r,g,b,a;
|
Uint8 r,g,b,a;
|
||||||
@@ -367,7 +367,7 @@ void getpixelarray (void *map, int Bpp, FRAMEPTR FramePtr,
|
|||||||
|
|
||||||
// Generate a pixel (in the correct format to be applied to FramePtr) from the
|
// Generate a pixel (in the correct format to be applied to FramePtr) from the
|
||||||
// r,g,b,a values supplied
|
// r,g,b,a values supplied
|
||||||
Uint32 frame_mapRGBA (FRAMEPTR FramePtr,Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
Uint32 frame_mapRGBA (FRAME FramePtr,Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
||||||
{
|
{
|
||||||
SDL_Surface *img= (SDL_Surface *)FramePtr->image->NormalImg;
|
SDL_Surface *img= (SDL_Surface *)FramePtr->image->NormalImg;
|
||||||
return (SDL_MapRGBA (img->format, r, g, b, a));
|
return (SDL_MapRGBA (img->format, r, g, b, a));
|
||||||
@@ -450,7 +450,7 @@ _GetCelData (uio_Stream *fp, DWORD length)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FRAMEPTR FramePtr;
|
FRAME FramePtr;
|
||||||
|
|
||||||
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
||||||
DrawablePtr->Flags = WANT_PIXMAP;
|
DrawablePtr->Flags = WANT_PIXMAP;
|
||||||
@@ -475,7 +475,7 @@ _ReleaseCelData (MEM_HANDLE handle)
|
|||||||
{
|
{
|
||||||
DRAWABLEPTR DrawablePtr;
|
DRAWABLEPTR DrawablePtr;
|
||||||
int cel_ct;
|
int cel_ct;
|
||||||
FRAMEPTR FramePtr = NULL;
|
FRAME FramePtr = NULL;
|
||||||
|
|
||||||
if ((DrawablePtr = LockDrawable (handle)) == 0)
|
if ((DrawablePtr = LockDrawable (handle)) == 0)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
@@ -530,7 +530,7 @@ _GetFontData (uio_Stream *fp, DWORD length)
|
|||||||
size_t numBCDs = 0;
|
size_t numBCDs = 0;
|
||||||
int dirEntryI;
|
int dirEntryI;
|
||||||
uio_DirHandle *fontDirHandle = NULL;
|
uio_DirHandle *fontDirHandle = NULL;
|
||||||
FONTPTR fontPtr;
|
FONT fontPtr;
|
||||||
|
|
||||||
if (_cur_resfile_name == 0)
|
if (_cur_resfile_name == 0)
|
||||||
goto err;
|
goto err;
|
||||||
@@ -691,7 +691,7 @@ err:
|
|||||||
BOOLEAN
|
BOOLEAN
|
||||||
_ReleaseFontData (MEM_HANDLE handle)
|
_ReleaseFontData (MEM_HANDLE handle)
|
||||||
{
|
{
|
||||||
FONTPTR font = LockFont (handle);
|
FONT font = LockFont (handle);
|
||||||
if (font == NULL)
|
if (font == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -748,7 +748,7 @@ _request_drawable (COUNT NumFrames, DRAWABLE_TYPE DrawableType,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int imgw, imgh;
|
int imgw, imgh;
|
||||||
FRAMEPTR FramePtr;
|
FRAME FramePtr;
|
||||||
|
|
||||||
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
DrawablePtr->hDrawable = GetDrawableHandle (Drawable);
|
||||||
DrawablePtr->Flags = flags;
|
DrawablePtr->Flags = flags;
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ void random16xZoomSurfaceRGBA (SDL_Surface *src, SDL_Surface *dst)
|
|||||||
blurSurface32 (dst);
|
blurSurface32 (dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
FRAMEPTR scale16xRandomizeFrame (FRAMEPTR NewFrame, FRAMEPTR FramePtr)
|
FRAME scale16xRandomizeFrame (FRAME NewFrame, FRAME FramePtr)
|
||||||
{
|
{
|
||||||
TFB_Image *origImg, *newImg;
|
TFB_Image *origImg, *newImg;
|
||||||
CREATE_FLAGS flags;
|
CREATE_FLAGS flags;
|
||||||
|
|||||||
@@ -118,12 +118,12 @@ void
|
|||||||
TFB_Prim_Stamp (PSTAMP stmp)
|
TFB_Prim_Stamp (PSTAMP stmp)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
PFRAME_DESC SrcFramePtr;
|
FRAME SrcFramePtr;
|
||||||
TFB_Image *img;
|
TFB_Image *img;
|
||||||
TFB_ColorMap *cmap = NULL;
|
TFB_ColorMap *cmap = NULL;
|
||||||
int gscale;
|
int gscale;
|
||||||
|
|
||||||
SrcFramePtr = (PFRAME_DESC)stmp->frame;
|
SrcFramePtr = stmp->frame;
|
||||||
if (!SrcFramePtr)
|
if (!SrcFramePtr)
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "TFB_Prim_Stamp: Tried to draw a NULL frame"
|
log_add (log_Warning, "TFB_Prim_Stamp: Tried to draw a NULL frame"
|
||||||
@@ -167,12 +167,12 @@ void
|
|||||||
TFB_Prim_StampFill (PSTAMP stmp, TFB_Palette *color)
|
TFB_Prim_StampFill (PSTAMP stmp, TFB_Palette *color)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
PFRAME_DESC SrcFramePtr;
|
FRAME SrcFramePtr;
|
||||||
TFB_Image *img;
|
TFB_Image *img;
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
int gscale;
|
int gscale;
|
||||||
|
|
||||||
SrcFramePtr = (PFRAME_DESC)stmp->frame;
|
SrcFramePtr = stmp->frame;
|
||||||
if (!SrcFramePtr)
|
if (!SrcFramePtr)
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "TFB_Prim_StampFill: Tried to draw a NULL frame"
|
log_add (log_Warning, "TFB_Prim_StampFill: Tried to draw a NULL frame"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include "libs/sound/trackplayer.h"
|
#include "libs/sound/trackplayer.h"
|
||||||
|
|
||||||
|
|
||||||
static FRAMEPTR scope_frame;
|
static FRAME scope_frame;
|
||||||
static int scope_init = 0;
|
static int scope_init = 0;
|
||||||
static TFB_Image *scope_bg = NULL;
|
static TFB_Image *scope_bg = NULL;
|
||||||
static TFB_Image *scope_surf = NULL;
|
static TFB_Image *scope_surf = NULL;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ extern void fill_frame_rgb (FRAME FramePtr, DWORD color, int x0, int y0,
|
|||||||
int x, int y);
|
int x, int y);
|
||||||
extern void arith_frame_blit (FRAME srcFrame, RECT *rsrc, FRAME dstFrame,
|
extern void arith_frame_blit (FRAME srcFrame, RECT *rsrc, FRAME dstFrame,
|
||||||
RECT *rdst, int num, int denom);
|
RECT *rdst, int num, int denom);
|
||||||
extern void getpixelarray (void *map, int Bpp, FRAMEPTR FramePtr,
|
extern void getpixelarray (void *map, int Bpp, FRAME FramePtr,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -938,7 +938,7 @@ PostProcessQueue (VIEW_STATE view_state, SIZE scroll_x,
|
|||||||
// (smaller) zoom level image as mipmap,
|
// (smaller) zoom level image as mipmap,
|
||||||
// needed for trilinear scaling
|
// needed for trilinear scaling
|
||||||
|
|
||||||
PFRAME_DESC frame =
|
FRAME frame =
|
||||||
SetAbsFrameIndex (
|
SetAbsFrameIndex (
|
||||||
ElementPtr->next.image.farray
|
ElementPtr->next.image.farray
|
||||||
[index + 1],
|
[index + 1],
|
||||||
@@ -949,7 +949,7 @@ PostProcessQueue (VIEW_STATE view_state, SIZE scroll_x,
|
|||||||
TFB_DrawCommand DC;
|
TFB_DrawCommand DC;
|
||||||
TFB_Image *mmimg = frame->image;
|
TFB_Image *mmimg = frame->image;
|
||||||
DC.Type = TFB_DRAWCOMMANDTYPE_SETMIPMAP;
|
DC.Type = TFB_DRAWCOMMANDTYPE_SETMIPMAP;
|
||||||
DC.data.setmipmap.image = ((PFRAME_DESC)ElementPtr->next.image.frame)->image;
|
DC.data.setmipmap.image = (ElementPtr->next.image.frame)->image;
|
||||||
DC.data.setmipmap.hotx = frame->HotSpot.x;
|
DC.data.setmipmap.hotx = frame->HotSpot.x;
|
||||||
DC.data.setmipmap.hoty = frame->HotSpot.y;
|
DC.data.setmipmap.hoty = frame->HotSpot.y;
|
||||||
LockMutex (mmimg->mutex);
|
LockMutex (mmimg->mutex);
|
||||||
|
|||||||
Reference in New Issue
Block a user