Reformat to something more readable for me :3
This commit is contained in:
+97
-47
@@ -6,23 +6,25 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#ifdef SM64_LIB_EXPORT
|
||||
#define SM64_LIB_FN __declspec(dllexport)
|
||||
#else
|
||||
#define SM64_LIB_FN __declspec(dllimport)
|
||||
#endif
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 4
|
||||
#ifdef SM64_LIB_EXPORT
|
||||
#define SM64_LIB_FN __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define SM64_LIB_FN
|
||||
#endif
|
||||
#ifdef SM64_LIB_EXPORT
|
||||
#define SM64_LIB_FN __declspec(dllexport)
|
||||
#else
|
||||
#define SM64_LIB_FN
|
||||
#define SM64_LIB_FN __declspec(dllimport)
|
||||
#endif
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 4
|
||||
#ifdef SM64_LIB_EXPORT
|
||||
#define SM64_LIB_FN __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define SM64_LIB_FN
|
||||
#endif
|
||||
#else
|
||||
#define SM64_LIB_FN
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
#endif
|
||||
|
||||
struct SM64Surface
|
||||
@@ -61,7 +63,7 @@ struct SM64MarioState
|
||||
float forwardVelocity;
|
||||
int16_t health;
|
||||
uint32_t action;
|
||||
struct AnimInfo* animInfo;
|
||||
struct AnimInfo *animInfo;
|
||||
uint32_t flags;
|
||||
uint32_t particleFlags;
|
||||
int16_t invincTimer;
|
||||
@@ -78,12 +80,18 @@ struct SM64MarioGeometryBuffers
|
||||
|
||||
struct SM64WallCollisionData
|
||||
{
|
||||
/*0x00*/ float x, y, z;
|
||||
/*0x0C*/ float offsetY;
|
||||
/*0x10*/ float radius;
|
||||
/*0x14*/ int16_t unk14;
|
||||
/*0x16*/ int16_t numWalls;
|
||||
/*0x18*/ struct SM64SurfaceCollisionData *walls[4];
|
||||
/*0x00*/
|
||||
float x, y, z;
|
||||
/*0x0C*/
|
||||
float offsetY;
|
||||
/*0x10*/
|
||||
float radius;
|
||||
/*0x14*/
|
||||
int16_t unk14;
|
||||
/*0x16*/
|
||||
int16_t numWalls;
|
||||
/*0x18*/
|
||||
struct SM64SurfaceCollisionData *walls[4];
|
||||
};
|
||||
|
||||
struct SM64FloorCollisionData
|
||||
@@ -120,11 +128,14 @@ struct SM64SurfaceCollisionData
|
||||
float vertex1[3];
|
||||
float vertex2[3];
|
||||
float vertex3[3];
|
||||
struct {
|
||||
|
||||
struct
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
} normal;
|
||||
|
||||
float originOffset;
|
||||
|
||||
uint8_t isValid; // libsm64: added field
|
||||
@@ -134,71 +145,110 @@ struct SM64SurfaceCollisionData
|
||||
|
||||
enum
|
||||
{
|
||||
SM64_TEXTURE_WIDTH = 64 * 11,
|
||||
SM64_TEXTURE_HEIGHT = 64,
|
||||
SM64_GEO_MAX_TRIANGLES = 1024,
|
||||
SM64_TEXTURE_WIDTH = 64 * 11, SM64_TEXTURE_HEIGHT = 64, SM64_GEO_MAX_TRIANGLES = 1024,
|
||||
};
|
||||
|
||||
|
||||
typedef void (*SM64DebugPrintFunctionPtr)( const char * );
|
||||
extern SM64_LIB_FN void sm64_register_debug_print_function( SM64DebugPrintFunctionPtr debugPrintFunction );
|
||||
typedef void (*SM64DebugPrintFunctionPtr)(const char *);
|
||||
|
||||
typedef void (*SM64PlaySoundFunctionPtr)( uint32_t soundBits, float *pos );
|
||||
extern SM64_LIB_FN void sm64_register_play_sound_function( SM64PlaySoundFunctionPtr playSoundFunction );
|
||||
extern SM64_LIB_FN void sm64_register_debug_print_function(SM64DebugPrintFunctionPtr debugPrintFunction);
|
||||
|
||||
extern SM64_LIB_FN void sm64_global_init( const uint8_t *rom, uint8_t *outTexture );
|
||||
extern SM64_LIB_FN void sm64_global_terminate( void );
|
||||
typedef void (*SM64PlaySoundFunctionPtr)(uint32_t soundBits, float *pos);
|
||||
|
||||
extern SM64_LIB_FN void sm64_audio_init( const uint8_t *rom );
|
||||
extern SM64_LIB_FN uint32_t sm64_audio_tick( uint32_t numQueuedSamples, uint32_t numDesiredSamples, int16_t *audio_buffer );
|
||||
extern SM64_LIB_FN void sm64_register_play_sound_function(SM64PlaySoundFunctionPtr playSoundFunction);
|
||||
|
||||
extern SM64_LIB_FN void sm64_static_surfaces_load( const struct SM64Surface *surfaceArray, uint32_t numSurfaces );
|
||||
extern SM64_LIB_FN void sm64_global_init(const uint8_t *rom, uint8_t *outTexture);
|
||||
|
||||
extern SM64_LIB_FN int32_t sm64_mario_create( float x, float y, float z );
|
||||
extern SM64_LIB_FN void sm64_mario_tick( int32_t marioId, const struct SM64MarioInputs *inputs, struct SM64MarioState *outState, struct SM64MarioGeometryBuffers *outBuffers );
|
||||
extern SM64_LIB_FN void sm64_mario_delete( int32_t marioId );
|
||||
extern SM64_LIB_FN void sm64_global_terminate(void);
|
||||
|
||||
extern SM64_LIB_FN void sm64_audio_init(const uint8_t *rom);
|
||||
|
||||
extern SM64_LIB_FN uint32_t sm64_audio_tick(uint32_t numQueuedSamples, uint32_t numDesiredSamples, int16_t *audio_buffer);
|
||||
|
||||
extern SM64_LIB_FN void sm64_static_surfaces_load(const struct SM64Surface *surfaceArray, uint32_t numSurfaces);
|
||||
|
||||
extern SM64_LIB_FN int32_t sm64_mario_create(float x, float y, float z);
|
||||
|
||||
extern SM64_LIB_FN void sm64_mario_tick(int32_t marioId, const struct SM64MarioInputs *inputs, struct SM64MarioState *outState, struct SM64MarioGeometryBuffers *outBuffers);
|
||||
|
||||
extern SM64_LIB_FN void sm64_mario_delete(int32_t marioId);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_action(int32_t marioId, uint32_t action);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_action_arg(int32_t marioId, uint32_t action, uint32_t actionArg);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_animation(int32_t marioId, int32_t animID);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_anim_frame(int32_t marioId, int16_t animFrame);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_state(int32_t marioId, uint32_t flags);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_position(int32_t marioId, float x, float y, float z);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_angle(int32_t marioId, float x, float y, float z);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_faceangle(int32_t marioId, float y);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_velocity(int32_t marioId, float x, float y, float z);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_forward_velocity(int32_t marioId, float vel);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_invincibility(int32_t marioId, int16_t timer);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_water_level(int32_t marioId, signed int level);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_gas_level(int32_t marioId, signed int level);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_mario_health(int32_t marioId, uint16_t health);
|
||||
|
||||
extern SM64_LIB_FN void sm64_mario_take_damage(int32_t marioId, uint32_t damage, uint32_t subtype, float x, float y, float z);
|
||||
|
||||
extern SM64_LIB_FN void sm64_mario_heal(int32_t marioId, uint8_t healCounter);
|
||||
|
||||
extern SM64_LIB_FN void sm64_mario_kill(int32_t marioId);
|
||||
|
||||
extern SM64_LIB_FN void sm64_mario_interact_cap(int32_t marioId, uint32_t capFlag, uint16_t capTime, uint8_t playMusic);
|
||||
|
||||
extern SM64_LIB_FN void sm64_mario_extend_cap(int32_t marioId, uint16_t capTime);
|
||||
|
||||
extern SM64_LIB_FN bool sm64_mario_attack(int32_t marioId, float x, float y, float z, float hitboxHeight);
|
||||
|
||||
extern SM64_LIB_FN uint32_t sm64_surface_object_create( const struct SM64SurfaceObject *surfaceObject );
|
||||
extern SM64_LIB_FN void sm64_surface_object_move( uint32_t objectId, const struct SM64ObjectTransform *transform );
|
||||
extern SM64_LIB_FN void sm64_surface_object_delete( uint32_t objectId );
|
||||
extern SM64_LIB_FN uint32_t sm64_surface_object_create(const struct SM64SurfaceObject *surfaceObject);
|
||||
|
||||
extern SM64_LIB_FN int32_t sm64_surface_find_wall_collision( float *xPtr, float *yPtr, float *zPtr, float offsetY, float radius );
|
||||
extern SM64_LIB_FN int32_t sm64_surface_find_wall_collisions( struct SM64WallCollisionData *colData );
|
||||
extern SM64_LIB_FN float sm64_surface_find_ceil( float posX, float posY, float posZ, struct SM64SurfaceCollisionData **pceil );
|
||||
extern SM64_LIB_FN float sm64_surface_find_floor_height_and_data( float xPos, float yPos, float zPos, struct SM64FloorCollisionData **floorGeo );
|
||||
extern SM64_LIB_FN float sm64_surface_find_floor_height( float x, float y, float z );
|
||||
extern SM64_LIB_FN float sm64_surface_find_floor( float xPos, float yPos, float zPos, struct SM64SurfaceCollisionData **pfloor );
|
||||
extern SM64_LIB_FN float sm64_surface_find_water_level( float x, float z );
|
||||
extern SM64_LIB_FN float sm64_surface_find_poison_gas_level( float x, float z );
|
||||
extern SM64_LIB_FN void sm64_surface_object_move(uint32_t objectId, const struct SM64ObjectTransform *transform);
|
||||
|
||||
extern SM64_LIB_FN void sm64_surface_object_delete(uint32_t objectId);
|
||||
|
||||
extern SM64_LIB_FN int32_t sm64_surface_find_wall_collision(float *xPtr, float *yPtr, float *zPtr, float offsetY, float radius);
|
||||
|
||||
extern SM64_LIB_FN int32_t sm64_surface_find_wall_collisions(struct SM64WallCollisionData *colData);
|
||||
|
||||
extern SM64_LIB_FN float sm64_surface_find_ceil(float posX, float posY, float posZ, struct SM64SurfaceCollisionData **pceil);
|
||||
|
||||
extern SM64_LIB_FN float sm64_surface_find_floor_height_and_data(float xPos, float yPos, float zPos, struct SM64FloorCollisionData **floorGeo);
|
||||
|
||||
extern SM64_LIB_FN float sm64_surface_find_floor_height(float x, float y, float z);
|
||||
|
||||
extern SM64_LIB_FN float sm64_surface_find_floor(float xPos, float yPos, float zPos, struct SM64SurfaceCollisionData **pfloor);
|
||||
|
||||
extern SM64_LIB_FN float sm64_surface_find_water_level(float x, float z);
|
||||
|
||||
extern SM64_LIB_FN float sm64_surface_find_poison_gas_level(float x, float z);
|
||||
|
||||
extern SM64_LIB_FN void sm64_seq_player_play_sequence(uint8_t player, uint8_t seqId, uint16_t arg2);
|
||||
|
||||
extern SM64_LIB_FN void sm64_play_music(uint8_t player, uint16_t seqArgs, uint16_t fadeTimer);
|
||||
|
||||
extern SM64_LIB_FN void sm64_stop_background_music(uint16_t seqId);
|
||||
|
||||
extern SM64_LIB_FN void sm64_fadeout_background_music(uint16_t arg0, uint16_t fadeOut);
|
||||
|
||||
extern SM64_LIB_FN uint16_t sm64_get_current_background_music();
|
||||
|
||||
extern SM64_LIB_FN void sm64_play_sound(int32_t soundBits, float *pos);
|
||||
|
||||
extern SM64_LIB_FN void sm64_play_sound_global(int32_t soundBits);
|
||||
|
||||
extern SM64_LIB_FN void sm64_set_sound_volume(float vol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user