Cavestory Mod API
Classes
SurfaceBitplane.h File Reference
#include <CSMAPI_begincode.h>
#include <CSMAPI_endcode.h>

Go to the source code of this file.

Classes

struct  SURFACE_BITPLANE
 A calculated collision bitplane for a surface. More...
 
enum  SurfaceBitplaneFlags { SURF_BITPLANE_HAS_BOUNDS = 0x0001 , SURF_BITPLANE_HAS_BITPLANE = 0x0002 , SURF_BITPLANE_HAS_ALL = 0xFFFF }
 The flags responsible for identifying what information a bitplane object holds about a surface. More...
 
CAVESTORY_MOD_API void CSM_SurfaceBitplane_Init (SURFACE_BITPLANE *pPlane)
 Initialize a bitplane object. More...
 
CAVESTORY_MOD_API void CSM_SurfaceBitplane_Free (SURFACE_BITPLANE *pPlane)
 Free an allocated bitplane. More...
 
CAVESTORY_MOD_API BOOL CSM_SurfaceBitplane_Scan (Surface_Ids iSurfId, GUI_RECT *pRect, SURFACE_BITPLANE *pPlane, unsigned int iFlags=SurfaceBitplaneFlags::SURF_BITPLANE_HAS_ALL, unsigned char iAlphaThreshold=10)
 Create a surface bitplane. More...
 
CAVESTORY_MOD_API BOOL CSM_SurfaceBitplane_IsPixelSolid (SURFACE_BITPLANE *pPlane, int iX, int iY)
 Check to see if a pixel is collidable. More...
 

Enumeration Type Documentation

◆ SurfaceBitplaneFlags

The flags responsible for identifying what information a bitplane object holds about a surface.

Enumerator
SURF_BITPLANE_HAS_BOUNDS 

This bitplane contains a calculated bounding box.

SURF_BITPLANE_HAS_BITPLANE 

This bitplane contains a calculated collision bitplane.

SURF_BITPLANE_HAS_ALL 

This bitplane contains everything listed above.

Function Documentation

◆ CSM_SurfaceBitplane_Free()

CAVESTORY_MOD_API void CSM_SurfaceBitplane_Free ( SURFACE_BITPLANE pPlane)

Free an allocated bitplane.

Parameters
pPlaneThe plane to free from memory.

◆ CSM_SurfaceBitplane_Init()

CAVESTORY_MOD_API void CSM_SurfaceBitplane_Init ( SURFACE_BITPLANE pPlane)

Initialize a bitplane object.

Parameters
pPlaneThe plane to initialize.

◆ CSM_SurfaceBitplane_IsPixelSolid()

CAVESTORY_MOD_API BOOL CSM_SurfaceBitplane_IsPixelSolid ( SURFACE_BITPLANE pPlane,
int  iX,
int  iY 
)

Check to see if a pixel is collidable.

Parameters
pPlaneThe plane to use.
iXThe pixel's X position.
iYThe pixel's Y position.
Returns
Returns TRUE if the pixel is collidable, FALSE otherwise.

◆ CSM_SurfaceBitplane_Scan()

CAVESTORY_MOD_API BOOL CSM_SurfaceBitplane_Scan ( Surface_Ids  iSurfId,
GUI_RECT pRect,
SURFACE_BITPLANE pPlane,
unsigned int  iFlags = SurfaceBitplaneFlags::SURF_BITPLANE_HAS_ALL,
unsigned char  iAlphaThreshold = 10 
)

Create a surface bitplane.

Parameters
iSurfIdThe surface ID to scan.
pRectThe rect to scan. Can be NULL to scan the entire surface.
pPlaneThe bitplane object to be populated with information.
iFlagsThe flags to use when creating the bitplane.
iAlphaThresholdThe alpha value that pixel colors have to be equal to or less than to be considered a '0' in the bitplane.
Returns
Returns TRUE on success, FALSE on failure. @warn Must initialize the bitplane before using it here with CSM_SurfaceBitplane_Init()!