medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit e5f4d3351f7346cfc7d9f7dafb05eede6e280b94
parent 6b64630eff4e22f44028232501e22d9234b53f69
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Mon Aug 17 22:29:26 +0200

Use an argument to medfall as path to shared library

Diffstat:
main.cc | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/main.cc b/main.cc @@ -11,8 +11,6 @@ #include "intrinsics.h" #include "gl.h" -#define GAME_LIBRARY_PATH "hm.so" - struct Game { void * lib; GameInit * init; @@ -63,7 +61,9 @@ bool should_reload_game( const char * const path, const time_t lib_write_time ) } int main( int argc, char ** argv ) { - Game game = load_game( GAME_LIBRARY_PATH ); + const char * const game_library_path = argc == 2 ? argv[ 1 ] : "./hm.so"; + + Game game = load_game( game_library_path ); GameMemory mem = { }; mem.persistent_size = megabytes( 64 ); mem.persistent = new u8[ mem.persistent_size ]; @@ -85,9 +85,9 @@ int main( int argc, char ** argv ) { } if( ( i32 ) current_frame_time != ( i32 ) last_frame_time ) { - if( should_reload_game( GAME_LIBRARY_PATH, game.lib_write_time ) ) { + if( should_reload_game( game_library_path, game.lib_write_time ) ) { unload_game( &game ); - game = load_game( GAME_LIBRARY_PATH ); + game = load_game( game_library_path ); } }