26 #ifndef CAVESTORY_MOD_API_H_
27 #error "Please include CavestoryModAPI.h before including sub-classes."
226 const char* pInternalName = NULL,
229 BOOL(*pSolidFunc)(
Surface_Ids surf_id,
int x,
int y) = NULL,
230 bool* bAlreadyExists = NULL
251 const char* pInternalName = NULL,
254 BOOL(*pSolidFunc)(
Surface_Ids surf_id,
int x,
int y) = NULL
Surface_Ids
List of surface IDs.
Definition: CSMAPI_enums.h:714
CAVESTORY_MOD_API int CSM_ImageBank_GetFloorPosition(CSM_BANK_IMAGE *pBank, int iTileIndex, int iX, int iY, float fAngle=0.f, int iCenterX=0, int iCenterY=0, GUI_POINT debug_bank_sub_pos=GUI_POINT(0, 0))
Scan down until we hit a solid pixel.
CAVESTORY_MOD_API BOOL CSM_ImageBank_TestPixelCollision_NPCHAR(CSM_BANK_IMAGE *pBank, NPCHAR *pNpc, int iTileIndex, GUI_POINT pBankPos, int(*pCollideFunc)(const CSM_BANK_COLLISION_INFO *pInfo), float fAngle=0.f, int iCenterX=0, int iCenterY=0, char iDebugLevel=0)
Check if a pixel is overlapping an NPC.
CAVESTORY_MOD_API BOOL CSM_ImageBank_ScanTile(CSM_BANK_IMAGE *pBank, int iTileIndex, bool bForce=false)
Scan a tile for solid pixels.
CAVESTORY_MOD_API void CSM_ImageBank_SetTileSize(CSM_BANK_IMAGE *pBank, int iTileW, int iTileH)
Check if a pixel is solid.
CAVESTORY_MOD_API int CSM_ImageBank_GetTileIndexByPixel(CSM_BANK_IMAGE *pBank, int iPixelX, int iPixelY)
Get the tile index of a bank at the given pixel coordinates.
CAVESTORY_MOD_API int CSM_ImageBank_Load(int iBankNo, int iEntryNo, CSM_BANK_IMAGE **pOut=NULL, const char *pInternalName=NULL, int iTileSizeW=16, int iTileSizeH=16, BOOL(*pSolidFunc)(Surface_Ids surf_id, int x, int y)=NULL, bool *bAlreadyExists=NULL)
Load a banked image.
CAVESTORY_MOD_API BOOL CSM_ImageBank_FindBySurfaceId(Surface_Ids iSurfId, CSM_BANK_IMAGE **pOut=NULL)
Get a bank by its surface ID.
CAVESTORY_MOD_API void CSM_ImageBank_FreeAll()
Free all bank images.
CAVESTORY_MOD_API BOOL CSM_ImageBank_IsPixelSolid(CSM_BANK_IMAGE *pBank, int iTileIndex, int iX, int iY, float fAngle=0.f, int iCenterX=0, int iCenterY=0)
Check if a pixel is solid.
CAVESTORY_MOD_API int CSM_ImageBank_TestPixelCollision_MYCHAR(CSM_BANK_IMAGE *pBank, MYCHAR *pMC, int iTileIndex, GUI_POINT pBankPos, int(*pCollideFunc)(const CSM_BANK_COLLISION_INFO *pInfo), float fAngle=0.f, int iCenterX=0, int iCenterY=0, char iDebugLevel=0)
Check if a pixel is overlapping a player character.
CAVESTORY_MOD_API BOOL CSM_ImageBank_TestPixelCollision_BANK(CSM_BANK_IMAGE *pBank, CSM_BANK_IMAGE *pOther, int iTileIndex1, int iTileIndex2, GUI_POINT pBankPos1, GUI_POINT pBankPos2, void(*pCollideFunc)(const CSM_BANK_COLLISION_INFO *pInfo), float fAngle=0.f, int iCenterX=0, int iCenterY=0, char iDebugLevel=0)
Check if a pixel is overlapping an NPC.
CAVESTORY_MOD_API Surface_Ids CSM_ImageBank_LoadAndGetSurfaceId(int iBankNo, int iEntryNo, CSM_BANK_IMAGE **pOut=NULL, const char *pInternalName=NULL, int iTileSizeW=16, int iTileSizeH=16, BOOL(*pSolidFunc)(Surface_Ids surf_id, int x, int y)=NULL)
Load a banked image.
CAVESTORY_MOD_API void CSM_ImageBank_Free(CSM_BANK_IMAGE *pBank)
Free a loaded bank image.
CAVESTORY_MOD_API int CSM_ImageBank_GetTileIndex(CSM_BANK_IMAGE *pBank, int iTileX, int iTileY)
Get the tile index of a bank at the given tile coordinates.
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:30
A structure to hold all collision information.
Definition: ImageBank.h:154
CSM_BANK_IMAGE * bank
The bank being tested for.
Definition: ImageBank.h:157
GUI_POINT bank_hit_pixel_subpos
The global subpixel position of the pixel that was collided against.
Definition: ImageBank.h:183
GUI_POINT object_hit_pixel_subpos
The subpixel position of the object pixel that was collided against.
Definition: ImageBank.h:191
GUI_POINT map_tile_pos
The map tile position where the collision took place.
Definition: ImageBank.h:177
CSM_BANK_RECT object_subrect
The object's subpixel rect.
Definition: ImageBank.h:195
CSM_BANK_RECT bank_subrect
The object's subpixel rect.
Definition: ImageBank.h:187
void * object
The object being tested against.
Definition: ImageBank.h:161
int object_old_ym
Old object ym.
Definition: ImageBank.h:203
int tile_index_1
The tile index used for collision testing for object.
Definition: ImageBank.h:173
int object_old_xm
Old object xm.
Definition: ImageBank.h:199
int pass_count
The total number of collisions so far.
Definition: ImageBank.h:165
int tile_index_0
The tile index used for collision testing.
Definition: ImageBank.h:169
Stores data about a banked image.
Definition: ImageBank.h:64
CSM_BANK_IMAGE * next
The bank image.
Definition: ImageBank.h:107
CSM_BANK_TILE * tile_list
The tile list.
Definition: ImageBank.h:103
Surface_Ids surf_id
The surface ID.
Definition: ImageBank.h:99
GUI_POINT img_size
The image size.
Definition: ImageBank.h:83
unsigned int file_name_crc
Stores the file name's CRC.
Definition: ImageBank.h:67
int entry_no
The name of the image inside of the bank folder.
Definition: ImageBank.h:75
int tile_total_count
The total number of tiles in this image.
Definition: ImageBank.h:95
char * name
The internal name of this image.
Definition: ImageBank.h:79
BOOL(* solid_func)(Surface_Ids surf_id, int x, int y)
A function that will determine if a pixel is solid or not.
Definition: ImageBank.h:111
int bank_no
The folder index inside of the 'Images' folder.
Definition: ImageBank.h:71
GUI_POINT tile_count
The number of rows and columns this bank has.
Definition: ImageBank.h:91
GUI_POINT tile_size
The size of each tile in pixels.
Definition: ImageBank.h:87
A more useful RECT struct.
Definition: ImageBank.h:117
int top
...
Definition: ImageBank.h:124
int height
...
Definition: ImageBank.h:140
int width
...
Definition: ImageBank.h:136
int center_y
...
Definition: ImageBank.h:148
int right
...
Definition: ImageBank.h:128
int left
...
Definition: ImageBank.h:120
int bottom
...
Definition: ImageBank.h:132
int center_x
...
Definition: ImageBank.h:144
Stores information about a specific tile.
Definition: ImageBank.h:43
unsigned int * solid_pixel_list
An array of indices pointing towards specific solid pixels.
Definition: ImageBank.h:46
bool done
Done boolean.
Definition: ImageBank.h:58
unsigned char * solid_pixel_map
A bitmap for testing the solidity of pixels.
Definition: ImageBank.h:50
unsigned short solid_count
The number of solid pixels held in the solid_pixels array.
Definition: ImageBank.h:54
Manages points.
Definition: CSMAPI_types.h:546
Player character object.
Definition: CSMAPI_types.h:1470
NPC object.
Definition: CSMAPI_types.h:2021