Cavestory Mod API
|
Rendering pipeline for Cavestory Multiplayer. More...
#include <CSMAPI_drawing.h>
Public Types | |
enum | BitmapBoxType { BMPBOX_TYPE_WIDTH = 0 , BMPBOX_TYPE_HEIGHT , BMPBOX_TYPE_BOTH } |
Bitmap box type for CacheSurface::GetBitmapBoxSize and CacheSurface::DrawBitmapBox. More... | |
Static Public Member Functions | |
static void | InitMemory () |
Only called once upon engine init. More... | |
static GUI_POINT | GetTextSize (FontObject *pFont, const char *pText, int iTextLen=-1) |
Get the size of a string of text w/ a font. More... | |
static BOOL | SetCurrentTexture (VideoTexture *pTexture) |
Set the texture that should be used when rendering stuff. More... | |
static BOOL | SetSurfaceID (Surface_Ids sid) |
Set the surface ID that we're editing. More... | |
static BOOL | SelectRendererSurface (int iCustomMagnification=0) |
Alias of SetSurfaceID, handles selecting SURFACE_ID_RENDERER with a custom magnification. More... | |
static BOOL | SetSurfaceIDAndRememberPrevious (Surface_Ids sid) |
Set the surface ID that we're editing. More... | |
static BOOL | SelectRendererSurfaceAndRememberPrevious (int iCustomMagnification=0) |
Alias of SetSurfaceID, handles selecting SURFACE_ID_RENDERER with a custom magnification. More... | |
static BOOL | RememberSurfaceID () |
Remember the currently selected SurfaceID. More... | |
static BOOL | RestoreSurfaceID () |
Return the current SurfaceID selection to the last one stored with RememberSurfaceID(). More... | |
static Surface_Ids | GetSurfaceID () |
Get the surface ID that we're currently editing. More... | |
static VideoTexture * | GetCurrentVideoTexture () |
Get the currently selected video texture. More... | |
static int | GetFreeSurfaceCount () |
Self-explanatory. More... | |
static bool | TryClipPoint (GUI_POINT &p) |
Try to contain a point inside of the clip rect. More... | |
static bool | IsInClipRect (GUI_POINT p) |
Check to see if a point is inside the current clip rect. More... | |
static bool | IsInClipRect (GUI_RECT r) |
Check to see if a rect is inside the current clip rect. More... | |
static bool | IsInClipRectWithCustomMag (GUI_RECT r, int customMagnification) |
Check to see if a rect is inside the current clip rect. More... | |
static void | SetClipRect (GUI_RECT *r, bool bAbsoluteRect=false) |
Add a new clip rect. More... | |
static void | GetClipRect (GUI_RECT *r) |
Get the current clip rect. More... | |
static void | ClearClipRectList () |
Clear the clip rect. More... | |
static GUI_POINT | GetSurfaceIDSize (Surface_Ids sid) |
Get the surface size of a surface. More... | |
static int | GetSurfaceIDMagnification (Surface_Ids sid) |
Get the surface magnification level of a surface. More... | |
static Surface_Ids | GetNextFreeSurfaceID (int iSkipCount=0, bool bAsyncUse=false, bool bLockMutex=true) |
Get the next free Dynamic Surface ID. More... | |
static bool | IsSurfaceAllocated (Surface_Ids sid) |
Checks whether the specified surface is allocated or not. More... | |
static void | FreeSurfaceID (Surface_Ids sid) |
Free a surface ID. More... | |
static void | UnlockSurfaceID (Surface_Ids sid) |
Free a surface ID and set it as non-async. More... | |
static bool | AllocateSurface (int w, int h, Surface_Ids iSurfId=SURFACE_ID_MAX, unsigned int iMagnification=0) |
Allocate a surface ID. More... | |
static bool | LoadFileToSurface (const char *pFileName, Surface_Ids iSurfId=SURFACE_ID_MAX, bool bAsync=false, unsigned int iMagnification=0) |
Load an image from a file into the selected surface ID. More... | |
static bool | SaveSurfaceToFile (const char *pFileName, Surface_Ids iSurfId=SURFACE_ID_MAX) |
Save an image from a surface to a file. More... | |
static void | DrawPixel (GUI_POINT pPoint, unsigned long color, bool bAbsolutePos=false) |
Draw a pixel. More... | |
static void | DrawPixels (GUI_POINT *pPointList, unsigned int iPointCount, unsigned long color, bool bAbsolutePos=false) |
Draw pixels. More... | |
static void | DrawLine (GUI_POINT start, GUI_POINT end, unsigned long color, bool bUseMagnification=true) |
Draw a line. More... | |
static void | DrawStripedLine (GUI_POINT start, GUI_POINT end, unsigned long color) |
Draw a striped line. More... | |
static void | DrawStripedRect (GUI_RECT *pRect, unsigned long iColor) |
Draw a striped rect. More... | |
static void | DrawGradientLine (GUI_POINT start, GUI_POINT end, unsigned long *colors, int colorcount) |
Draw a line with color gradient. More... | |
static void | DrawClearRect (GUI_RECT *r) |
Clear a given rect. More... | |
static void | DrawFilledRect (GUI_RECT *r, unsigned long color, bool bAbsolutePos=false) |
Fill a given rect. More... | |
static void | DrawRect (GUI_RECT *r, unsigned long color, bool bAbsolutePos=false) |
Outline a given rect. More... | |
static void | DrawFilledRectTransparent (GUI_RECT *r, unsigned long color, bool bAbsolutePos=false) |
Fill a given rect. More... | |
static void | DrawRectTransparent (GUI_RECT *r, unsigned long color, bool bAbsolutePos=false) |
Outline a given rect. More... | |
static void | DrawFilledCircle (GUI_POINT p, int size, unsigned long color, bool invert=false) |
Draw a filled circle. More... | |
static void | DrawFilledTriangle (GUI_POINT *points, unsigned long color) |
Draw a filled triangle. More... | |
static void | DrawCircle (GUI_POINT p, int size, unsigned long color) |
Draw a circle. More... | |
static void | DrawTriangle (GUI_POINT *points, unsigned long color) |
Draw a triangle. More... | |
static GUI_POINT | DrawFilledBitmapRect (GUI_RECT *drawRect, GUI_RECT *srcRect, Surface_Ids sid, GUI_POINT drawPadding=GUI_POINT(0, 0)) |
Draw a filled bitmap rect. More... | |
static GUI_POINT | DrawBitmap (GUI_POINT p, GUI_RECT *srcRect, Surface_Ids sid, bool bAbsolutePos=false) |
Draw an image. More... | |
static GUI_POINT | DrawStretchedBitmap (GUI_RECT *r, GUI_RECT *srcRect, Surface_Ids sid, GUI_COLOR color, bool bAbsolutePos=false) |
Draw an image. More... | |
static GUI_POINT | DrawColoredBitmap (GUI_POINT p, GUI_RECT *srcRect, Surface_Ids sid, GUI_COLOR color, bool bAbsolutePos=false) |
Draw a colored image. More... | |
static void | DrawText (GUI_POINT p, FontObject *font, const char *text, unsigned long color) |
Draw text. More... | |
static void | DrawClippedText (GUI_POINT p, FontObject *font, const char *text, unsigned long color, int iStringLength=-1, bool bWrap=false, GUI_POINT *pDrawSize=NULL, int iShadowSize=0, unsigned long iShadowColor=0) |
Draw clipped text. More... | |
static void | DrawClippedTextNoMagnification (GUI_POINT p, FontObject *font, const char *text, unsigned long color, int iStringLength=-1, bool bWrap=false, GUI_POINT *pDrawSize=NULL, int iShadowSize=0, unsigned long iShadowColor=0) |
Draw clipped text. More... | |
static void | DrawSpecialText (GUI_POINT p, SpecialTextCache *pCache) |
Draw clipped special text. More... | |
static void | DrawBitmapBox (GUI_RECT *out_rect, GUI_RECT *bmp_rects, BitmapBoxType type, Surface_Ids bmp_id) |
Draw a bitmap box. More... | |
static void | DrawTransparentBitmapBox (GUI_RECT *out_rect, GUI_RECT *bmp_rects, BitmapBoxType type, Surface_Ids bmp_id, int iAlpha) |
Draw a transparent bitmap box. More... | |
static void | SetNeedsUpdating () |
Force an update for this surface internally. | |
static GUI_POINT | GetBitmapBoxSize (GUI_POINT *desired_extent, GUI_RECT *bmp_rects, BitmapBoxType type) |
Get the size of a bitmap box. More... | |
static void | Put (GUI_POINT out_pos, Surface_Ids sid=SURFACE_ID_MAX, bool bAbsolutePos=false) |
Draw a surface to the screen. More... | |
static void | PutAlpha (GUI_POINT out_pos, Surface_Ids sid=SURFACE_ID_MAX, unsigned char Alpha=255, bool bAbsolutePos=false) |
Draw a transparent surface to the screen. More... | |
static GUI_COLOR | GetPixelColor (GUI_POINT p, Surface_Ids sid, bool bAbsolutePos=false) |
static GUI_COLOR | GetEntityPixel (NPCHAR *npc, GUI_POINT p) |
Rendering pipeline for Cavestory Multiplayer.
Bitmap box type for CacheSurface::GetBitmapBoxSize and CacheSurface::DrawBitmapBox.
|
static |
Allocate a surface ID.
w | The width of the new surface. |
h | The height of the new surface. |
iSurfId | The surface to use. Leave as 'SURFACE_ID_MAX' to use the currently selected surface. |
iMagnification | The magnification level to use. Pass '0' to use UI scale. |
|
static |
Clear the clip rect.
|
static |
Draw an image.
p | The position to draw the image at. |
srcRect | The rect to copy from. Can be NULL to copy the entire source image. |
sid | The source image's surface ID. |
bAbsolutePos | If this is true, then r will not be magnified. |
|
static |
Draw a bitmap box.
out_rect | The rect to draw it at. Can be NULL to use the entire destination surface. |
bmp_rects | A list of GUI_RECT. Must conform to the size required by parameter 'type'. |
type | The type of bitmap box to draw. |
bmp_id | The source image's surface ID. |
|
static |
|
static |
Clear a given rect.
r | The rect to clear. Can be NULL to clear the entire surface. |
|
static |
Draw clipped text.
p | The position to draw the text at. |
font | The font to use. |
text | The text to draw. |
color | The color to draw the text with. |
iStringLength | The length of the string to draw. Can be -1 to automatically detect the length of the string. |
bWrap | Wrap the string if it reaches the edge of the clip rect. |
pDrawSize | A pointer to a GUI_POINT that will hold the size of the output text. |
iShadowSize | The size of the text's shadow. If set to 0, no shadow will be drawn. |
iShadowColor | The color of the shadow. |
|
static |
Draw clipped text.
p | The position to draw the text at. |
font | The font to use. |
text | The text to draw. |
color | The color to draw the text with. |
iStringLength | The length of the string to draw. Can be -1 to automatically detect the length of the string. |
bWrap | Wrap the string if it reaches the edge of the clip rect. |
pDrawSize | A pointer to a GUI_POINT that will hold the size of the output text. |
iShadowSize | The size of the text's shadow. If set to 0, no shadow will be drawn. |
iShadowColor | The color of the shadow. |
|
static |
Draw a colored image.
p | The position to draw the image at. |
srcRect | The rect to copy from. Can be NULL to copy the entire source image. |
sid | The source image's surface ID. |
color | The color to modulate the source image by. |
bAbsolutePos | If this is true, then r will not be magnified. |
|
static |
Draw a filled bitmap rect.
drawRect | The rect to fill with the source image. |
srcRect | The rect to copy from. Can be NULL to copy the entire source image. |
sid | The source image's surface ID. |
drawPadding | Margin for drawRect. |
|
static |
|
static |
Fill a given rect.
r | The rect to fill. Can be NULL to fill the entire surface. |
color | The color to fill with. |
bAbsolutePos | If this is true, then pPoint will not be magnified. |
|
static |
|
static |
|
static |
Draw a line.
start | Line start point. |
end | Line end point. |
color | The color of the line. |
bUseMagnification | Draw a line as big as the current magnification amount. |
|
static |
|
static |
|
static |
|
static |
|
static |
Draw clipped special text.
p | The position to draw the text at. |
pCache | The special text cache that holds the drawing instructions. |
|
static |
Draw an image.
r | The rect to draw the bitmap in. |
srcRect | The rect to copy from. Can be NULL to copy the entire source image. |
sid | The source image's surface ID. |
color | The color to modulate the source image by. |
bAbsolutePos | If this is true, then r will not be magnified. |
|
static |
|
static |
|
static |
Draw a transparent bitmap box.
out_rect | The rect to draw it at. Can be NULL to use the entire destination surface. |
bmp_rects | A list of GUI_RECT. Must conform to the size required by parameter 'type'. |
type | The type of bitmap box to draw. |
bmp_id | The source image's surface ID. |
|
static |
|
static |
|
static |
Get the size of a bitmap box.
desired_extent | The desired extent of the output. |
bmp_rects | A list of GUI_RECT. Must conform to the size required by parameter 'type'. |
type | The type of bitmap box to draw. |
|
static |
Get the current clip rect.
r | A pointer to a RECT that will hold the clip rect. |
|
static |
Get the currently selected video texture.
|
static |
Self-explanatory.
|
static |
Get the next free Dynamic Surface ID.
iSkipCount | Skip this many free slots before returning one. |
bAsyncUse | If set to true, then this function will act as if this surface is in use, and will not return it next time. |
bLockMutex | If set to true, then the mutex will be locked. |
|
static |
Get the surface ID that we're currently editing.
|
static |
Get the surface magnification level of a surface.
sid | The surface ID to get the magnifier of. |
|
static |
Get the surface size of a surface.
sid | The surface ID to get the size of. |
|
static |
Get the size of a string of text w/ a font.
pFont | The font to use. |
pText | The text to get the size of. |
iTextLen | The text length. |
|
static |
Only called once upon engine init.
Do not call.
|
static |
Check to see if a point is inside the current clip rect.
p | The point to test. |
|
static |
Check to see if a rect is inside the current clip rect.
r | The rect to test. |
|
static |
Check to see if a rect is inside the current clip rect.
r | The rect to test. |
customMagnification | The custom magnification level to use. |
|
static |
Checks whether the specified surface is allocated or not.
sid | The surface ID to check. |
|
static |
Load an image from a file into the selected surface ID.
pFileName | The file name of the image. |
iSurfId | The surface to use. Leave as 'SURFACE_ID_MAX' to use the currently selected surface. |
bAsync | Whether this is an asynchronous operation or not. |
iMagnification | The magnification level to use. Pass '0' to use UI scale. |
|
static |
Draw a surface to the screen.
out_pos | Where to draw the surface at. |
sid | The surface ID to draw. Use CacheSurface::SURFACE_ID_MAX to draw the selected Surface ID. |
bAbsolutePos | If this is true, it will use out_pos without magnifying it. |
|
static |
Draw a transparent surface to the screen.
out_pos | Where to draw the surface at. |
sid | The surface ID to draw. Use CacheSurface::SURFACE_ID_MAX to draw the selected Surface ID. |
Alpha | The amount the image should blend into the background. |
bAbsolutePos | If this is true, it will use out_pos without magnifying it. |
|
static |
Remember the currently selected SurfaceID.
Can remember up to 32 entries.
|
static |
Return the current SurfaceID selection to the last one stored with RememberSurfaceID().
|
static |
Save an image from a surface to a file.
pFileName | The file name of the image to save. |
iSurfId | The surface to use. Leave as 'SURFACE_ID_MAX' to use the currently selected surface. |
|
static |
Alias of SetSurfaceID, handles selecting SURFACE_ID_RENDERER with a custom magnification.
magnification | The magnification to use. Pass '0' to signify to use 'magnification'. |
|
static |
Alias of SetSurfaceID, handles selecting SURFACE_ID_RENDERER with a custom magnification.
magnification | The magnification to use. Pass '0' to signify to use 'magnification'. |
|
static |
Add a new clip rect.
r | The rect to set. |
bAbsoluteRect | If this is 'false', r will be multiplied by the current magnification. |
|
static |
Set the texture that should be used when rendering stuff.
pTexture | The texture to set. |
|
static |
Set the surface ID that we're editing.
sid | The surface ID to edit. |
|
static |
Set the surface ID that we're editing.
sid | The surface ID to edit. |
|
static |
Try to contain a point inside of the clip rect.
p | The point to test. |
|
static |
Free a surface ID and set it as non-async.
sid | The surface ID to free. |