Cavestory Mod API
Macros | Variables
CSMAPI_defines.h File Reference
#include <CSMAPI_begincode.h>
#include <CSMAPI_endcode.h>

Go to the source code of this file.

Macros

#define SOUND_MODE_LOOP   -1
 
#define SOUND_MODE_STOP   0
 Stop sound. More...
 
#define SOUND_MODE_STOP_THEN_PLAY   1
 Stop and then play a sound. More...
 
#define SOUND_MODE_PLAY   2
 Play a sound. More...
 
#define CSM_MAX_BULLET_FUNCS   64
 
#define CSM_MAX_WEAPON_SHOOT_FUNCS   64
 
#define CSM_MAX_NPC_FUNCS   1024
 
#define CSM_MAX_CUSTOM_SOUNDS   255
 
#define CARET_MAX   0x40
 
#define BULLET_MAX   0x200
 How many bullets can be initialized at one time.
 
#define ARMS_MAX   8
 How many weapons can be initialized at one time for each client.
 
#define ITEM_MAX   32
 How many items can be initialized at one time for each client.
 
#define PERMIT_STAGE_COUNT   24
 
#define MAX_PERMIT_INDEX   8
 
#define MAX_WHIMSICAL_STARS   3
 
#define ANIM_NPC_MAX   128
 
#define NPC_MAX   (0x200 + ANIM_NPC_MAX)
 How many npcs can be initialized at one time.
 
#define ANIM_NPC_START_OFFSET   (NPC_MAX - ANIM_NPC_MAX)
 
#define BOSS_MAX   20
 How many bosses can be initialized at one time.
 
#define MAX_DYNAMIC_SURFACES   (SURFACE_ID_ALLOCATABLE_SURFACE_END - SURFACE_ID_ALLOCATABLE_SURFACE_START)
 
#define BASE_WINDOW_WIDTH   426
 
#define BASE_WINDOW_HEIGHT   240
 
#define WINDOW_WIDTH   WINDOW_REAL_WIDTH
 
#define WINDOW_HEIGHT   WINDOW_REAL_HEIGHT
 
#define PATH_LENGTH   260
 
#define CSM_OUR_GHOST_ID   -2
 
#define SubpixelToPixel(X)   ((X) / 0x200)
 
#define SCALE_GUI_POINT(POINT, CENTER, SCALAR)   (((POINT - CENTER) * SCALAR) + CENTER)
 
#define RECT_WIDTH(RC)   ((RC).right - (RC).left)
 
#define RECT_HEIGHT(RC)   ((RC).bottom - (RC).top)
 
#define CLAMP(x, min, max)   ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x)))
 Clamp a value. More...
 
#define MIN(A, B)   ((A) < (B) ? (A) : (B))
 Get the minimum value between two values. More...
 
#define MAX(A, B)   ((A) > (B) ? (A) : (B))
 Get the maximum value between two values. More...
 
#define ABS(x)   ((x) < 0 ? -(x) : (x))
 
#define SET_RECT(rect, l, t, r, b)
 Set a RECT object's values. More...
 
#define CSM_RGB(r, g, b)   ((r) | ((g) << 8) | ((b) << 16) | (0xFF << 24))
 Combine R, G, B into one number. More...
 
#define CSM_RGBA(r, g, b, a)   ((r) | ((g) << 8) | ((b) << 16) | ((a) << 24))
 Combine R, G, B, A into one number. More...
 
#define CSM_GETRED(x)   (unsigned char)((x) & 0xFF)
 Get the red value from an unsigned int color. More...
 
#define CSM_GETGREEN(x)   (unsigned char)(((x) >> 8) & 0xFF)
 Get the green value from an unsigned int color. More...
 
#define CSM_GETBLUE(x)   (unsigned char)(((x) >> 16) & 0xFF)
 Get the blue value from an unsigned int color. More...
 
#define CSM_GETALPHA(x)   (unsigned char)(((x) >> 24) & 0xFF)
 Get the alpha value from an unsigned int color. More...
 
#define CSM_TextScript_IsMessageBoxOpen()   ((gTS.flags & 0x33) != 0)
 
#define CSM_Error(FORMAT, ...)   CSM_Log("[" __FILE__ " @ %d] ERROR: " __FUNCTION__ "() - " FORMAT, __LINE__, __VA_ARGS__);
 
#define SYSTEM_MENU_CREATE_SHORTCUT(VARNAME, SCAN_CODE, USE_CTRL, USE_SHIFT)
 
#define SYSTEM_MENU_ADD_MENU(MENU, VARNAME, ID, TEXT, PARENT_MENU, SHORTCUT)    SystemMenuItem* VARNAME = (MENU)->AddItem(ID, TEXT, PARENT_MENU, SHORTCUT);
 
#define SYSTEM_MENU_ADD_ITEM(MENU, ID, TEXT, PARENT_MENU, SHORTCUT)    (MENU)->AddItem(ID, TEXT, PARENT_MENU, SHORTCUT)->OnClicked = [](SystemMenuInfo* pGui, SystemMenuItem* pItem)
 
#define SYSTEM_MENU_ADD_SEPERATOR(MENU, PARENT_MENU)    (MENU)->AddItem(-1, "", PARENT_MENU)->Seperator = true;
 

Variables

CAVESTORY_MOD_API int WINDOW_REAL_WIDTH
 
CAVESTORY_MOD_API int WINDOW_REAL_HEIGHT
 

Macro Definition Documentation

◆ SYSTEM_MENU_CREATE_SHORTCUT

#define SYSTEM_MENU_CREATE_SHORTCUT (   VARNAME,
  SCAN_CODE,
  USE_CTRL,
  USE_SHIFT 
)
Value:
Input::KeyShortcut* VARNAME = new Input::KeyShortcut();\
VARNAME->SetCombo(SDL_Scancode::SCAN_CODE, USE_CTRL, USE_SHIFT);