26 #ifndef CAVESTORY_MOD_API_H_
27 #error "Please include CavestoryModAPI.h before including sub-classes."
44 #define INVALID_TEXTURE_COLOR 0x10203040
227 void SetDrawColor(
unsigned char iRed,
unsigned char iGreen,
unsigned char iBlue,
unsigned char iAlpha);
267 void DrawPixels(
GUI_POINT* pPointList,
unsigned int iPointCount,
unsigned long iColor = INVALID_TEXTURE_COLOR);
328 void DrawRect(
GUI_RECT* pRect,
unsigned long iColor = INVALID_TEXTURE_COLOR,
bool bAbsolutePos =
false);
367 void DrawText(
GUI_POINT pPoint, FontObject* pFont,
const char* pText,
int iTextLen = -1,
unsigned long iColor = INVALID_TEXTURE_COLOR,
bool bWrap =
false,
int iShadowSize = 0,
unsigned long iShadowColor = 0);
379 void DrawMagnifiedText(
GUI_POINT pPoint, FontObject* pFont,
const char* pText,
int iTextLen = -1,
unsigned long iColor = INVALID_TEXTURE_COLOR,
bool bWrap =
false,
int iShadowSize = 0,
unsigned long iShadowColor = 0);
386 void DrawRects(
unsigned long iColor = INVALID_TEXTURE_COLOR);
434 void PutStretchedAlpha(
int iDstX,
int iDstY,
int iDstW,
int iDstH,
int iSrcX,
int iSrcY,
int iSrcW,
int iSrcH,
int iAlpha);
447 void PutStretchedSubPixel(
int iDstX,
int iDstY,
int iDstW,
int iDstH,
int iSrcX,
int iSrcY,
int iSrcW,
int iSrcH,
int iAlpha);
459 void PutStretched(
int iDstX,
int iDstY,
int iDstW,
int iDstH,
int iSrcX,
int iSrcY,
int iSrcW,
int iSrcH);
Surface_Ids
List of surface IDs.
Definition: CSMAPI_enums.h:714
An external window to render stuff on.
Definition: ExternalWindow.h:151
An editable texture API.
Definition: VideoTexture.h:51
void DrawPixels(GUI_POINT *pPointList, unsigned int iPointCount, unsigned long iColor=INVALID_TEXTURE_COLOR)
Draw multiple pixels.
void DrawLine(GUI_POINT pStart, GUI_POINT pEnd, unsigned long iColor=INVALID_TEXTURE_COLOR, bool bAbsolutePos=false)
Draw a line.
~VideoTexture()
Default deconstructor.
int m_iBitsPerPixel
Number of bits per pixel.
Definition: VideoTexture.h:98
GUI_RECT m_pOldClipRect
The old clip rect to restore after unlocking this texture.
Definition: VideoTexture.h:74
int m_iWidth
The width of this texture.
Definition: VideoTexture.h:90
void SetTextureSize(int iWidth, int iHeight)
Resize this video texture.
void SetClipRect(GUI_RECT *pRect, bool bAbsoluteRect=false)
Set the clip rect for this texture.
void DrawFilledRect(GUI_RECT *pRect, unsigned long iColor=INVALID_TEXTURE_COLOR, bool bAbsolutePos=false)
Draw a filled rectangle to this texture.
void SetDrawColor(unsigned char iRed, unsigned char iGreen, unsigned char iBlue, unsigned char iAlpha)
Set the drawing color.
void DrawRects(unsigned long iColor=INVALID_TEXTURE_COLOR)
Draw multiple rectangles to this texture.
void Put(int iX, int iY)
Draw this texture onto the screen.
void DrawMagnifiedLine(GUI_POINT pStart, GUI_POINT pEnd, unsigned long iColor=INVALID_TEXTURE_COLOR)
Draw a pre-magnified line.
GUI_RECT * m_pClipRectList
A list of clip rects.
Definition: VideoTexture.h:102
void DrawPixel(GUI_POINT pPoint, unsigned long iColor=INVALID_TEXTURE_COLOR)
Draw a pixel.
bool m_bLocked
Whether this texture is currently locked or not.
Definition: VideoTexture.h:118
void ClearTexture(GUI_RECT *pRect=NULL)
Clear this texture.
VideoTexture()
Default constructor.
int m_iClipRectCount
The number of elements in the clip rect list.
Definition: VideoTexture.h:106
SDL_Texture * m_pTexture
This texture's ACTUAL texture.
Definition: VideoTexture.h:82
void DrawStripedLine(GUI_POINT pStart, GUI_POINT pEnd, unsigned long iColor=INVALID_TEXTURE_COLOR)
Draw a striped line.
SDL_Renderer * m_pRenderer
This texture's renderer.
Definition: VideoTexture.h:86
void DrawText(GUI_POINT pPoint, FontObject *pFont, const char *pText, int iTextLen=-1, unsigned long iColor=INVALID_TEXTURE_COLOR, bool bWrap=false, int iShadowSize=0, unsigned long iShadowColor=0)
Draw text on this texture.
int m_iMagnification
The local magnification for this texture.
Definition: VideoTexture.h:114
void PutStretched(int iDstX, int iDstY, int iDstW, int iDstH, int iSrcX, int iSrcY, int iSrcW, int iSrcH)
Draw this texture onto the screen.
GUI_RECT GetClipRect()
Get the current clip rect.
void PutAlpha(int iX, int iY, int iAlpha)
Draw this texture onto the screen with an alpha value.
void PutStretchedAlpha(int iDstX, int iDstY, int iDstW, int iDstH, int iSrcX, int iSrcY, int iSrcW, int iSrcH, int iAlpha)
Draw this texture onto the screen.
void DrawMagnifiedText(GUI_POINT pPoint, FontObject *pFont, const char *pText, int iTextLen=-1, unsigned long iColor=INVALID_TEXTURE_COLOR, bool bWrap=false, int iShadowSize=0, unsigned long iShadowColor=0)
Draw pre-magnified text on this texture.
void DrawBitmapBox(GUI_RECT *out_rect, GUI_RECT *bmp_rects, CacheSurface::BitmapBoxType type, Surface_Ids bmp_id, int iAlpha=255)
Draw a bitmap box.
void AddTempRect(GUI_RECT pRect)
Add a temporary rect to the rect list.
bool InClipRect(GUI_RECT pRect)
Check to see if a rect is inside of the clip rect.
int m_iHeight
The height of this texture.
Definition: VideoTexture.h:94
void SetDrawColor(unsigned long iColor)
Set the drawing color.
void RecreateTexture()
Recreate this texture.
SDL_Rect * m_pTempArray
A temporary array containing SDL rects.
Definition: VideoTexture.h:122
void DrawStripedRect(GUI_RECT *pRect, unsigned long iColor=INVALID_TEXTURE_COLOR)
Draw a striped rectangle to this texture.
void ClearClipRects()
Clear the clip rect list.
void Unlock()
Unlock this texture.
void DrawMagnifiedPixels(GUI_POINT *pPointList, unsigned int iPointCount, unsigned long iColor=INVALID_TEXTURE_COLOR)
Draw multiple pre-magnified pixels.
void ClearPixels(GUI_POINT *pPointList, unsigned int iPointCount)
Clear multiple pixels.
void DrawStretchedBitmap(GUI_RECT *pRect, GUI_RECT *pSourceRect, Surface_Ids iSurfaceId, unsigned long iColor=INVALID_TEXTURE_COLOR, bool bAbsloutePos=false)
Draw a stretched bitmap.
void ClearTempRectList()
Reset the temporary rectangle list.
static VideoTexture * CreateTexture(int iWidth, int iHeight, int iBitsPerPixel=32, ExternalWindow *pWindow=NULL, int iMagnification=-1, bool bNoTexture=false)
Create a texture.
static VideoTexture * CreateTexture(const char *pFileName, ExternalWindow *pWindow=NULL, int iMagnification=-1)
Create a texture with an image.
GUI_COLOR m_pDrawColor
The current draw color.
Definition: VideoTexture.h:66
static bool FreeTexture(VideoTexture *pTexture)
Free a texture.
int m_iClipRectSize
The size of the clip rect size.
Definition: VideoTexture.h:110
void PutSubPixel(int iX, int iY, int iAlpha)
Draw this texture onto the screen at a subpixel coordinate.
ExternalWindow * m_pWindow
The window object this texture belongs to.
Definition: VideoTexture.h:62
void DrawColoredBitmap(GUI_POINT pPoint, GUI_RECT *pSourceRect, Surface_Ids iSurfaceId, unsigned long iColor, bool bAbsolutePos=false)
Draw a colored bitmap.
void DrawBitmap(GUI_POINT pPoint, GUI_RECT *pSourceRect, Surface_Ids iSurfaceId, bool bAbsolutePos=false)
Draw a bitmap.
SDL_Texture * m_pOldLockTexture
The old lock texture to restore after unlocking this texture.
Definition: VideoTexture.h:70
void PutStretchedSubPixel(int iDstX, int iDstY, int iDstW, int iDstH, int iSrcX, int iSrcY, int iSrcW, int iSrcH, int iAlpha)
Draw this texture onto the screen.
void Lock()
Lock this texture for editing.
bool m_bHasOldClip
Whether the renderer can use the old clip rect.
Definition: VideoTexture.h:78
GUI_RECT GetNonScaledClipRect()
Get the current clip rect (not scaled to local magnification level).
void DrawRect(GUI_RECT *pRect, unsigned long iColor=INVALID_TEXTURE_COLOR, bool bAbsolutePos=false)
Draw a rectangle to this texture.
int m_iTempSize
The size of m_pTempArray.
Definition: VideoTexture.h:130
static void ReloadRenderer(int iMagnification)
Reload the main renderer's texture.
int m_iTempCount
The number of rects in m_pTempArray.
Definition: VideoTexture.h:126
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:30
BitmapBoxType
Bitmap box type for CacheSurface::GetBitmapBoxSize and CacheSurface::DrawBitmapBox.
Definition: CSMAPI_drawing.h:443
Manages colors.
Definition: CSMAPI_types.h:497
Manages points.
Definition: CSMAPI_types.h:546
Definition: CSMAPI_types.h:842
Definition: CSMAPI_types.h:51