Added api for dynamic surfaces
This commit is contained in:
@@ -313,7 +313,7 @@ static void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macro
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
void surface_load_for_libsm64( const struct SM64Surface *surfaceArray, size_t numSurfaces )
|
void surface_load_for_libsm64( const struct SM64Surface *surfaceArray, uint32_t numSurfaces )
|
||||||
{
|
{
|
||||||
while( s_surface_node_list )
|
while( s_surface_node_list )
|
||||||
{
|
{
|
||||||
|
|||||||
+14
-2
@@ -97,7 +97,7 @@ void sm64_global_init( uint8_t *rom, uint8_t *outTexture, SM64DebugPrintFunction
|
|||||||
D_80339D10.targetAnim = NULL;
|
D_80339D10.targetAnim = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sm64_load_surfaces( uint16_t terrainType, const struct SM64Surface *surfaceArray, size_t numSurfaces )
|
void sm64_load_surfaces( uint16_t terrainType, const struct SM64Surface *surfaceArray, uint32_t numSurfaces )
|
||||||
{
|
{
|
||||||
surface_load_for_libsm64( surfaceArray, numSurfaces );
|
surface_load_for_libsm64( surfaceArray, numSurfaces );
|
||||||
gCurrentArea->terrainType = terrainType;
|
gCurrentArea->terrainType = terrainType;
|
||||||
@@ -141,7 +141,7 @@ static void update_objects( void )
|
|||||||
//update_mario_platform();
|
//update_mario_platform();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sm64_mario_tick( const struct SM64MarioInputs *inputs, struct SM64MarioState *outState, struct SM64MarioGeometryBuffers *outBuffers )
|
void sm64_mario_tick( const struct SM64MarioInputs *inputs, struct SM64MarioState *outState, struct SM64MarioGeometryBuffers *outBuffers )
|
||||||
{
|
{
|
||||||
update_button( inputs->buttonA, A_BUTTON );
|
update_button( inputs->buttonA, A_BUTTON );
|
||||||
update_button( inputs->buttonB, B_BUTTON );
|
update_button( inputs->buttonB, B_BUTTON );
|
||||||
@@ -170,4 +170,16 @@ void sm64_mario_tick( const struct SM64MarioInputs *inputs, struct SM64MarioStat
|
|||||||
void sm64_global_terminate( void )
|
void sm64_global_terminate( void )
|
||||||
{
|
{
|
||||||
// TODO free
|
// TODO free
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t sm64_load_surface_object( const struct SM64SurfaceObject *surfaceObject )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void sm64_move_object( uint32_t id, const struct SM64ObjectTransform *transform )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void sm64_unload_object( uint32_t id )
|
||||||
|
{
|
||||||
}
|
}
|
||||||
+21
-4
@@ -19,6 +19,19 @@ struct SM64MarioInputs
|
|||||||
uint8_t buttonA, buttonB, buttonZ;
|
uint8_t buttonA, buttonB, buttonZ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct SM64ObjectTransform
|
||||||
|
{
|
||||||
|
float position[3];
|
||||||
|
float eulerRotation[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SM64SurfaceObject
|
||||||
|
{
|
||||||
|
struct SM64ObjectTransform transform;
|
||||||
|
uint32_t surfaceCount;
|
||||||
|
struct SM64Surface surfaces[];
|
||||||
|
};
|
||||||
|
|
||||||
struct SM64MarioState
|
struct SM64MarioState
|
||||||
{
|
{
|
||||||
float position[3];
|
float position[3];
|
||||||
@@ -38,14 +51,18 @@ struct SM64MarioGeometryBuffers
|
|||||||
|
|
||||||
typedef void (*SM64DebugPrintFunctionPtr)( const char * );
|
typedef void (*SM64DebugPrintFunctionPtr)( const char * );
|
||||||
|
|
||||||
static const size_t SM64_TEXTURE_WIDTH = 64 * 11;
|
static const uint32_t SM64_TEXTURE_WIDTH = 64 * 11;
|
||||||
static const size_t SM64_TEXTURE_HEIGHT = 64;
|
static const uint32_t SM64_TEXTURE_HEIGHT = 64;
|
||||||
static const size_t SM64_GEO_MAX_TRIANGLES = 1024;
|
static const uint32_t SM64_GEO_MAX_TRIANGLES = 1024;
|
||||||
|
|
||||||
extern void sm64_global_init( uint8_t *rom, uint8_t *outTexture, SM64DebugPrintFunctionPtr debugPrintFunction );
|
extern void sm64_global_init( uint8_t *rom, uint8_t *outTexture, SM64DebugPrintFunctionPtr debugPrintFunction );
|
||||||
extern void sm64_load_surfaces( uint16_t terrainType, const struct SM64Surface *surfaceArray, size_t numSurfaces );
|
extern void sm64_load_surfaces( uint16_t terrainType, const struct SM64Surface *surfaceArray, uint32_t numSurfaces );
|
||||||
extern void sm64_mario_reset( int16_t marioX, int16_t marioY, int16_t marioZ );
|
extern void sm64_mario_reset( int16_t marioX, int16_t marioY, int16_t marioZ );
|
||||||
extern void sm64_mario_tick( const struct SM64MarioInputs *inputs, struct SM64MarioState *outState, struct SM64MarioGeometryBuffers *outBuffers );
|
extern void sm64_mario_tick( const struct SM64MarioInputs *inputs, struct SM64MarioState *outState, struct SM64MarioGeometryBuffers *outBuffers );
|
||||||
extern void sm64_global_terminate( void );
|
extern void sm64_global_terminate( void );
|
||||||
|
|
||||||
|
extern uint32_t sm64_load_surface_object( const struct SM64SurfaceObject *surfaceObject );
|
||||||
|
extern void sm64_move_object( uint32_t id, const struct SM64ObjectTransform *transform );
|
||||||
|
extern void sm64_unload_object( uint32_t id );
|
||||||
|
|
||||||
#endif//__LIB_SM64_H
|
#endif//__LIB_SM64_H
|
||||||
Reference in New Issue
Block a user