Pulled out debug print function registering into a separate method from init.
This commit is contained in:
@@ -10,8 +10,5 @@ extern SM64DebugPrintFunctionPtr g_debug_print_func;
|
|||||||
char debugStr[1024]; \
|
char debugStr[1024]; \
|
||||||
sprintf( debugStr, __VA_ARGS__ ); \
|
sprintf( debugStr, __VA_ARGS__ ); \
|
||||||
g_debug_print_func( debugStr ); \
|
g_debug_print_func( debugStr ); \
|
||||||
} else { \
|
|
||||||
printf( __VA_ARGS__ ); \
|
|
||||||
printf( "\n" ); \
|
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|||||||
+7
-2
@@ -79,13 +79,18 @@ static void free_area( struct Area *area )
|
|||||||
free( area );
|
free( area );
|
||||||
}
|
}
|
||||||
|
|
||||||
SM64_LIB_FN void sm64_global_init( uint8_t *rom, uint8_t *outTexture, SM64DebugPrintFunctionPtr debugPrintFunction )
|
typedef void (*SM64DebugPrintFunctionPtr)( const char * );
|
||||||
|
SM64_LIB_FN void sm64_register_debug_print_function( SM64DebugPrintFunctionPtr debugPrintFunction )
|
||||||
|
{
|
||||||
|
g_debug_print_func = debugPrintFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SM64_LIB_FN void sm64_global_init( uint8_t *rom, uint8_t *outTexture )
|
||||||
{
|
{
|
||||||
if( s_init_global )
|
if( s_init_global )
|
||||||
sm64_global_terminate();
|
sm64_global_terminate();
|
||||||
|
|
||||||
s_init_global = true;
|
s_init_global = true;
|
||||||
g_debug_print_func = debugPrintFunction;
|
|
||||||
|
|
||||||
load_mario_textures_from_rom( rom, outTexture );
|
load_mario_textures_from_rom( rom, outTexture );
|
||||||
load_mario_anims_from_rom( rom );
|
load_mario_anims_from_rom( rom );
|
||||||
|
|||||||
+4
-3
@@ -60,8 +60,6 @@ struct SM64MarioGeometryBuffers
|
|||||||
uint16_t numTrianglesUsed;
|
uint16_t numTrianglesUsed;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*SM64DebugPrintFunctionPtr)( const char * );
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
SM64_TEXTURE_WIDTH = 64 * 11,
|
SM64_TEXTURE_WIDTH = 64 * 11,
|
||||||
@@ -69,7 +67,10 @@ enum
|
|||||||
SM64_GEO_MAX_TRIANGLES = 1024,
|
SM64_GEO_MAX_TRIANGLES = 1024,
|
||||||
};
|
};
|
||||||
|
|
||||||
extern SM64_LIB_FN void sm64_global_init( uint8_t *rom, uint8_t *outTexture, SM64DebugPrintFunctionPtr debugPrintFunction );
|
typedef void (*SM64DebugPrintFunctionPtr)( const char * );
|
||||||
|
extern SM64_LIB_FN void sm64_register_debug_print_function( SM64DebugPrintFunctionPtr debugPrintFunction );
|
||||||
|
|
||||||
|
extern SM64_LIB_FN void sm64_global_init( uint8_t *rom, uint8_t *outTexture );
|
||||||
extern SM64_LIB_FN void sm64_global_terminate( void );
|
extern SM64_LIB_FN void sm64_global_terminate( void );
|
||||||
|
|
||||||
extern SM64_LIB_FN void sm64_static_surfaces_load( const struct SM64Surface *surfaceArray, uint32_t numSurfaces );
|
extern SM64_LIB_FN void sm64_static_surfaces_load( const struct SM64Surface *surfaceArray, uint32_t numSurfaces );
|
||||||
|
|||||||
Reference in New Issue
Block a user