26 #ifndef CAVESTORY_MOD_API_H_
27 #error "Please include CavestoryModAPI.h before including sub-classes."
807 const char* pFileName
818 const char* pFileName
831 unsigned int iFrameOffset = 0xFFFFFFFF
897 unsigned int iFrameNo,
898 unsigned int iInsertNo = 0xFFFFFFFF
933 int* pFrameIndex = NULL,
934 int* pEventIndex = NULL
992 bool bFreezeFrame =
false,
993 bool bDontDraw =
false,
994 bool bDrawHUD =
true,
995 bool bDrawFade =
true
1101 unsigned short iTileX,
1102 unsigned short iTileY,
1103 unsigned int iOldTileID,
1104 unsigned int iNewTileID,
Directions
Directions.
Definition: CSMAPI_enums.h:37
@ PXDPSC_boost_sw
boost_sw
Definition: GameDemo.h:177
@ PXDPSC_updown
Up / down.
Definition: GameDemo.h:186
@ PXDPSC_cond
cond
Definition: GameDemo.h:102
@ PXDPSC_shock
shock
Definition: GameDemo.h:162
@ PXDPSC_BIGGEST_TYPE
Biggest variable type.
Definition: GameDemo.h:207
@ PXDPSC_physics_normal
physics_normal
Definition: GameDemo.h:168
@ PXDPSC_xm
xm
Definition: GameDemo.h:111
@ PXDPSC_max_life
max_life
Definition: GameDemo.h:120
@ PXDPSC_UNIQUE_COUNT
Number of recordable variables (with unique change flags)
Definition: GameDemo.h:204
@ PXDPSC_ignore_water
ignore_water
Definition: GameDemo.h:174
@ PXDPSC_weapon_level
weapon_level
Definition: GameDemo.h:138
@ PXDPSC_input_flags
input_flags
Definition: GameDemo.h:123
@ PXDPSC_weapon_code
weapon_code
Definition: GameDemo.h:129
@ PXDPSC_y
y
Definition: GameDemo.h:108
@ PXDPSC_boost_cnt
boost_cnt
Definition: GameDemo.h:180
@ PXDPSC_flag
Flags.
Definition: GameDemo.h:183
@ PXDPSC_x
x
Definition: GameDemo.h:105
@ PXDPSC_weapon_max_ammo
weapon_max_ammo
Definition: GameDemo.h:135
@ PXDPSC_netanim
unit
Definition: GameDemo.h:165
@ PXDPSC_act_no
Count2.
Definition: GameDemo.h:195
@ PXDPSC_ym
ym
Definition: GameDemo.h:114
@ PXDPSC_counts
Count1.
Definition: GameDemo.h:189
@ PXDPSC_star
star
Definition: GameDemo.h:159
@ PXDPSC_input_flags_trg
input_flags_trg
Definition: GameDemo.h:126
@ PXDPSC_weapon_exp
weapon_exp
Definition: GameDemo.h:141
@ PXDPSC_life
life
Definition: GameDemo.h:117
@ PXDPSC_act_wait
Count2.
Definition: GameDemo.h:192
@ PXDPSC_ani_wait
ani_wait
Definition: GameDemo.h:153
@ PXDPSC_direct
direct
Definition: GameDemo.h:147
@ PXDPSC_equip
equip
Definition: GameDemo.h:156
@ PXDPSC_ani_no
ani_no
Definition: GameDemo.h:150
@ PXDPSC_COUNT
Number of recordable variables for playerstate.
Definition: GameDemo.h:201
@ PXDPSC_weapon_ammo
weapon_ammo
Definition: GameDemo.h:132
@ PXDPSC_ALL_FLAGS
All flags combined.
Definition: GameDemo.h:198
@ PXDPSC_physics_underwater
physics_underwater
Definition: GameDemo.h:171
@ PXDPSC_selectedArms
selectedArms
Definition: GameDemo.h:144
@ PXDFT_CLEAR_FADE
Stop fading.
Definition: GameDemo.h:83
@ PXDFT_FADE_OUT
Fade out.
Definition: GameDemo.h:89
@ PXDFT_FADE_IN
Fade in.
Definition: GameDemo.h:86
@ PXDFT_MAX_FADES
How many fade types there.
Definition: GameDemo.h:92
CAVESTORY_MOD_API void CSM_GameDemo_Act(GAME_DEMO_STATE *pState, bool bFreezeFrame=false, bool bDontDraw=false, bool bDrawHUD=true, bool bDrawFade=true)
Act for a frame.
CAVESTORY_MOD_API bool CSM_GameDemo_Optimize(GAME_DEMO_STATE *pState, bool bSaveAndLoad)
Optimize a game demo.
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Record_NpcState(GAME_DEMO_STATE *pState, NPCHAR *pNpc, int iIndex)
Record the state of an NPC.
CAVESTORY_MOD_API void CSM_GameDemo_Unlink(GAME_DEMO_STATE *pState)
Unregister a demo from the active linkage list.
CAVESTORY_MOD_API PXDEMO_FRAME_STRUCT * CSM_GameDemo_Frames_Add(GAME_DEMO_STATE *pState, int iFrameNo)
Add af rame to the demo.
CAVESTORY_MOD_API int CSM_GameDemo_Record_NewFrame(GAME_DEMO_STATE *pState)
Increment the simulated frame count.
CAVESTORY_MOD_API GAME_DEMO_STATE * gRecordingDemo
A pointer to the current recording demo.
CAVESTORY_MOD_API bool CSM_GameDemo_FirstLink(GAME_DEMO_STATE **pFirst)
Get the first in the gamestate link.
CAVESTORY_MOD_API int CSM_GameDemo_Load(GAME_DEMO_STATE *pState, const char *pFileName)
Load a game demo.
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Record_Timer(GAME_DEMO_STATE *pState)
Record the game's timer.
PXDEMO_EVENT_TYPE
GameDemo Event Types.
Definition: GameDemo.h:43
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Events_Find(GAME_DEMO_STATE *pState, PXDEMO_EVENT_TYPE iType, int iFrameNo, int iStartIndex=0, PXDEMO_FRAME_STRUCT **pFramePtr=NULL, int *pFrameIndex=NULL, int *pEventIndex=NULL)
Find an event.
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Record_RandomSeed(GAME_DEMO_STATE *pState)
Record the current random seed.
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Events_Add(GAME_DEMO_STATE *pState, PXDEMO_EVENT_TYPE iType, unsigned int iFrameNo, unsigned int iInsertNo=0xFFFFFFFF)
Add an event to the demo.
PXDEMO_PLAYERSTATE_CHANGE
Changed playerstate variables between frames.
Definition: GameDemo.h:100
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Record_Stage(GAME_DEMO_STATE *pState)
Record the current stage index.
CAVESTORY_MOD_API void CSM_GameDemo_Init(GAME_DEMO_STATE *pState)
Initialize a GAME_DEMO_STATE object without linking it.
CAVESTORY_MOD_API void CSM_GameDemo_Init_Relink(GAME_DEMO_STATE *pState)
Initialize a GAME_DEMO_STATE object whilst also re-linking it.
CAVESTORY_MOD_API void CSM_GameDemo_Link(GAME_DEMO_STATE *pState)
Register a demo to the active linkage list.
CAVESTORY_MOD_API bool CSM_GameDemo_Events_Remove(GAME_DEMO_STATE *pState, PXDEMO_EVENT_TYPE iType, int iFrameNo, int iStartIndex=0)
Remove an event from the demo.
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Record_Camera(GAME_DEMO_STATE *pState)
Record the game camera's current details.
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Record_PlayerState(GAME_DEMO_STATE *pState, const char *pName, SafeClientInterface *pInterface)
Record a player's state.
CAVESTORY_MOD_API PXDEMO_FRAME_STRUCT * CSM_GameDemo_Frames_Find(GAME_DEMO_STATE *pState, int iFrameNo, int *pIndex=NULL)
Find a frame.
CAVESTORY_MOD_API void CSM_GameDemo_StartRecord()
Begin recording a demo.
CAVESTORY_MOD_API void CSM_GameDemo_StopRecord(GAME_DEMO_STATE *pState)
Stop recording a demo.
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Record_MapTileChange(GAME_DEMO_STATE *pState, unsigned short iTileX, unsigned short iTileY, unsigned int iOldTileID, unsigned int iNewTileID, bool bCreateSmoke, bool bOnlyUndo)
Record a maptile change.
CAVESTORY_MOD_API void CSM_GameDemo_Free(GAME_DEMO_STATE *pState)
Free a GAME_DEMO_STATE object.
CAVESTORY_MOD_API PXDEMO_PLAYER_STRUCT * CSM_GameDemo_Players_Find(GAME_DEMO_STATE *pState, const char *pName, int *pIndex=NULL)
Find a player's object by name.
CAVESTORY_MOD_API bool CSM_GameDemo_Frames_Remove(GAME_DEMO_STATE *pState, int iFrameNo)
Remove a frame from the demo.
CAVESTORY_MOD_API PXDEMO_EVENT_STRUCT * CSM_GameDemo_Record_Fade(GAME_DEMO_STATE *pState, PXDEMO_FADE_TYPE iType, Directions iDirect)
Record a screen fade.
CAVESTORY_MOD_API PXDEMO_PLAYER_STRUCT * CSM_GameDemo_Players_Add(GAME_DEMO_STATE *pState, const char *pName, SafeClientInterface *pInterface)
Add a player to the demo state.
CAVESTORY_MOD_API void CSM_GameDemo_LoadGamestate(GAME_DEMO_STATE *pState)
Load a demo's gamestate.
CAVESTORY_MOD_API bool CSM_GameDemo_Players_Remove(GAME_DEMO_STATE *pState, const char *pName)
Remove a player from the demo state.
CAVESTORY_MOD_API int CSM_GameDemo_Save(GAME_DEMO_STATE *pState, const char *pFileName)
Save a game demo.
PXDEMO_FADE_TYPE
Fade effect types.
Definition: GameDemo.h:81
CAVESTORY_MOD_API bool CSM_GameDemo_CombineDemos(GAME_DEMO_STATE *pDst, GAME_DEMO_STATE *pSource, unsigned int iFrameOffset=0xFFFFFFFF)
Combine game demos.
@ PXDET_SET_NPC_STATE
Set an NPC.
Definition: GameDemo.h:57
@ PXDET_SET_RANDOM_SEED
Set the random seed.
Definition: GameDemo.h:54
@ PXDET_SET_MAP_TILE
Set a map tile.
Definition: GameDemo.h:72
@ PXDET_DO_SCREEN_FADE
Fade in or fade out the screen.
Definition: GameDemo.h:60
@ PXDET_SET_TIMER
Set the game timer.
Definition: GameDemo.h:66
@ PXDET_SET_PLAYER_STATE
Set the state of a player.
Definition: GameDemo.h:48
@ PXDET_SET_NPC_DATA
Set the game timer.
Definition: GameDemo.h:69
@ PXDET_SET_CAMERA
Set the game camera's details.
Definition: GameDemo.h:63
@ PXDET_SET_STAGE
Transfer to a new stage.
Definition: GameDemo.h:51
@ PXDET_INVALID_EVENT
Invalid.
Definition: GameDemo.h:45
@ PXDET_MAX_EVENTS
How many events there can be.
Definition: GameDemo.h:75
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:30
#define ARMS_MAX
How many weapons can be initialized at one time for each client.
Definition: CSMAPI_defines.h:43
Weapon object.
Definition: CSMAPI_types.h:1264
Event: Do a screen fade in / out.
Definition: GameDemo.h:546
PXDEMO_FADE_TYPE type
The fade type.
Definition: GameDemo.h:550
unsigned char direct
The direction of the fade.
Definition: GameDemo.h:555
Event: Set camera details.
Definition: GameDemo.h:561
int quake2
Quake amount (2).
Definition: GameDemo.h:586
int x
The X position of the camera.
Definition: GameDemo.h:564
int quake
Quake amount.
Definition: GameDemo.h:582
int target
The focus target for this camera.
Definition: GameDemo.h:574
int wait
Camera speed.
Definition: GameDemo.h:578
int y
The Y position of the camera.
Definition: GameDemo.h:568
Event: Set map tile.
Definition: GameDemo.h:614
bool only_undo
Only undo.
Definition: GameDemo.h:637
unsigned short tile_y
The NPC type to parse.
Definition: GameDemo.h:621
unsigned short new_tile_id
The NPC type to parse.
Definition: GameDemo.h:629
unsigned short old_tile_id
The NPC type to parse.
Definition: GameDemo.h:625
unsigned short tile_x
The NPC type to parse.
Definition: GameDemo.h:617
bool show_smoke
Show smoke.
Definition: GameDemo.h:633
Event: Set NPC data.
Definition: GameDemo.h:601
unsigned int code_char
The NPC type to parse.
Definition: GameDemo.h:604
unsigned long long int transmit_flags
Transmit flags for this NPC type.
Definition: GameDemo.h:608
Event: Set the state of an NPC at the given slot.
Definition: GameDemo.h:529
unsigned int npc_idx
The NPC's slot index.
Definition: GameDemo.h:532
unsigned int random_seed
Random seed.
Definition: GameDemo.h:536
NPCHAR state
The state of the NPC.
Definition: GameDemo.h:540
Event: Set player state.
Definition: GameDemo.h:494
unsigned int change_flags
The flags that determine what has changed between the last state and this one.
Definition: GameDemo.h:501
int player_idx
The player's index.
Definition: GameDemo.h:497
PXDEMO_PLAYERSTATE_STRUCT state
The player's new state.
Definition: GameDemo.h:505
Event: Set the random seed.
Definition: GameDemo.h:520
int seed
The new random seed.
Definition: GameDemo.h:523
Event: Set current stage.
Definition: GameDemo.h:511
int stage_idx
The stage's index that we want to switch to.
Definition: GameDemo.h:514
Event: Set game timer.
Definition: GameDemo.h:592
int time_passed
The timer position.
Definition: GameDemo.h:595
Holds a game demo's state.
Definition: GameDemo.h:727
static GAME_DEMO_STATE * first
First demo state.
Definition: GameDemo.h:730
PXDEMO_DEMOINFO_STRUCT mInfo
The game details.
Definition: GameDemo.h:734
PXDEMO_FRAME_CHUNK mFrames
Frames.
Definition: GameDemo.h:742
PXDEMO_PLAYER_CHUNK mPlayers
Players.
Definition: GameDemo.h:738
GAME_DEMO_STATE * mNext
Next demo state.
Definition: GameDemo.h:746
int mChecksum
The checksum of this gamedemo.
Definition: GameDemo.h:750
Manages colors.
Definition: CSMAPI_types.h:497
Physics specifier for MYCHAR.
Definition: CSMAPI_types.h:1359
NPC object.
Definition: CSMAPI_types.h:2021
Game info.
Definition: GameDemo.h:215
int random_seed
The random seed.
Definition: GameDemo.h:238
unsigned char flags[1000]
NPC flags.
Definition: GameDemo.h:242
int mod_version
The version of the mod at the time.
Definition: GameDemo.h:226
unsigned int cavenet_version
The version of CaveNet at the time.
Definition: GameDemo.h:218
unsigned char skip_flags[8]
Skip flags.
Definition: GameDemo.h:246
int play_frame
The current play frame.
Definition: GameDemo.h:234
unsigned int npc_count
Transmit flags.
Definition: GameDemo.h:254
unsigned long long int * npc_transmit_flags
Transmit flags.
Definition: GameDemo.h:250
int total_sim_frames
The frame length for this demo.
Definition: GameDemo.h:230
int game_flags
Game flags.
Definition: GameDemo.h:258
char * mod_name
The loaded mod's internal name.
Definition: GameDemo.h:222
Main event info struct.
Definition: GameDemo.h:684
PXDEMO_EVENT_TYPE type
Event type.
Definition: GameDemo.h:687
union PXDEMO_EVENT_UNION data
A union containing all possible data for this event.
Definition: GameDemo.h:691
Holds all frames.
Definition: GameDemo.h:712
unsigned int count
The size of list.
Definition: GameDemo.h:719
PXDEMO_FRAME_STRUCT * list
An allocated list that holds the frames.
Definition: GameDemo.h:715
Frame info.
Definition: GameDemo.h:475
int event_count
Size of event_list.
Definition: GameDemo.h:482
PXDEMO_EVENT_STRUCT * event_list
An allocated list of events to perform for this frame.
Definition: GameDemo.h:478
int frame_no
This frame's number.
Definition: GameDemo.h:486
Holds all the players.
Definition: GameDemo.h:699
PXDEMO_PLAYER_STRUCT * list
An allocated list that holds the players.
Definition: GameDemo.h:702
unsigned int count
The size of list.
Definition: GameDemo.h:706
Player info.
Definition: GameDemo.h:430
bool use_color
Whether to use custom color or not.
Definition: GameDemo.h:467
int last_state_event_idx
The event index of this player's last state.
Definition: GameDemo.h:459
PXDEMO_PLAYERSTATE_STRUCT state
This player's state.
Definition: GameDemo.h:449
int last_state_frame_idx
This player's last state.
Definition: GameDemo.h:454
char * character_name
This player's character name.
Definition: GameDemo.h:445
CustomPlayer * character
This player's character.
Definition: GameDemo.h:441
char * name
This player's name.
Definition: GameDemo.h:433
ARMS arms[ARMS_MAX]
This player's ARMS tables.
Definition: GameDemo.h:437
GUI_COLOR char_color
This character's color.
Definition: GameDemo.h:463
State of a player.
Definition: GameDemo.h:264
int input_flags_trg
Trg input flags.
Definition: GameDemo.h:299
unsigned char weapon_level
The held weapon's max ammo.
Definition: GameDemo.h:315
int equip
Equip flags.
Definition: GameDemo.h:339
int tgt_y
Target Y.
Definition: GameDemo.h:395
int down
Looking down.
Definition: GameDemo.h:383
int ym
Current Y motion.
Definition: GameDemo.h:283
signed char a
a
Definition: GameDemo.h:387
short max_life
The max life of this player.
Definition: GameDemo.h:291
int xm
Current X motion.
Definition: GameDemo.h:279
signed char boost_sw
Booster SW.
Definition: GameDemo.h:367
int selectedArms
Selected weapon.
Definition: GameDemo.h:323
unsigned char shock
Player damage invulnerability counter.
Definition: GameDemo.h:347
short life
The life of this player.
Definition: GameDemo.h:287
int x
Current X position.
Definition: GameDemo.h:271
int count1
Count.
Definition: GameDemo.h:403
short star
Amount of stars.
Definition: GameDemo.h:343
int weapon_code
The held weapon index.
Definition: GameDemo.h:303
int count2
Count.
Definition: GameDemo.h:407
int y
Current Y position.
Definition: GameDemo.h:275
int act_no
Act number.
Definition: GameDemo.h:419
int up
Looking up.
Definition: GameDemo.h:379
int weapon_ammo
The held weapon's ammo.
Definition: GameDemo.h:307
int ani_wait
Animation wait.
Definition: GameDemo.h:335
int tgt_x
Target X.
Definition: GameDemo.h:391
unsigned char cond
Condition of the player.
Definition: GameDemo.h:267
int direct
Direction.
Definition: GameDemo.h:327
int netanim
Player state.
Definition: GameDemo.h:351
int weapon_max_ammo
The held weapon's max ammo.
Definition: GameDemo.h:311
MYCHAR_PHYSICS physics_underwater
Underwater physics.
Definition: GameDemo.h:359
int weapon_exp
The held weapon's exp.
Definition: GameDemo.h:319
unsigned int flag
Flags.
Definition: GameDemo.h:375
int count4
Count.
Definition: GameDemo.h:415
int air
Current air.
Definition: GameDemo.h:399
MYCHAR_PHYSICS physics_normal
Normal physics.
Definition: GameDemo.h:355
int boost_cnt
Booster count.
Definition: GameDemo.h:371
int input_flags
Input flags.
Definition: GameDemo.h:295
bool ignore_water
Ignore water.
Definition: GameDemo.h:363
int ani_no
Animation number.
Definition: GameDemo.h:331
int act_wait
Act wait.
Definition: GameDemo.h:423
int count3
Count.
Definition: GameDemo.h:411
SafeClientInterface.
Definition: CSMAPI_types.h:1775
A union containing all possibilities for an event.
Definition: GameDemo.h:643
EVENT_SETNPCDATA_STRUCT npc_data
PXDEMO_EVENT_TYPE::PXDET_SET_NPC_DATA.
Definition: GameDemo.h:674
EVENT_SETNPCSTATE_STRUCT npc_state
PXDEMO_EVENT_TYPE::PXDET_SET_NPC_STATE.
Definition: GameDemo.h:658
EVENT_SETTIMER_STRUCT timer
PXDEMO_EVENT_TYPE::PXDET_SET_TIMER.
Definition: GameDemo.h:670
EVENT_SETMAPTILE_STRUCT map_tile
PXDEMO_EVENT_TYPE::PXDET_SET_MAP_TILE.
Definition: GameDemo.h:678
EVENT_SETPLAYERSTATE_STRUCT player_state
PXDEMO_EVENT_TYPE::PXDET_SET_PLAYER_STATE.
Definition: GameDemo.h:646
EVENT_SETCAMERA_STRUCT camera
PXDEMO_EVENT_TYPE::PXDET_SET_CAMERA.
Definition: GameDemo.h:666
EVENT_DOSCREENFADE_STRUCT screen_fade
PXDEMO_EVENT_TYPE::PXDET_DO_SCREEN_FADE.
Definition: GameDemo.h:662
EVENT_SETRANDOMSEED_STRUCT random_seed
PXDEMO_EVENT_TYPE::PXDET_SET_RANDOM_SEED.
Definition: GameDemo.h:654
EVENT_SETSTAGE_STRUCT stage
PXDEMO_EVENT_TYPE::PXDET_SET_STAGE.
Definition: GameDemo.h:650