X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=src%2Fvg%2Fvg_steamworks.h;h=1a3e899ddf158a1a2b9361a1b09c3a581fabdc32;hb=367883958336d1c04c8a304af6119b21f0f2f15a;hp=c0baba54bcca3dea04b42f4e9e0a411c913f4bdc;hpb=6cfa3e0895e42f702276e97c85ad371f3512c67d;p=vg.git diff --git a/src/vg/vg_steamworks.h b/src/vg/vg_steamworks.h index c0baba5..1a3e899 100644 --- a/src/vg/vg_steamworks.h +++ b/src/vg/vg_steamworks.h @@ -635,6 +635,8 @@ static void _sw_access_cache( struct cached_player *player ) static GLuint sw_get_player_image( u64_steamid usr ) { +#ifdef VG_STEAM + // Look for player in cache for( int i = 0; i < steam_api_classes.cache_count; i ++ ) { @@ -700,6 +702,10 @@ static GLuint sw_get_player_image( u64_steamid usr ) free( img_buf ); return dest->avatar_texture; + +#else + return 0; +#endif } ISteamFriends *SteamAPI_SteamFriends_v017(); @@ -710,10 +716,11 @@ ISteamUtils *SteamAPI_SteamUtils_v010(); static void sw_exit(void) { +#ifdef VG_STEAM SteamAPI_Shutdown(); +#endif } -// Needs to be manually called by client unfortunately static void sw_free_opengl(void) { for( int i = 0; i < steam_api_classes.cache_count; i ++ ) @@ -723,6 +730,7 @@ static void sw_free_opengl(void) static int sw_init(void) { +#ifdef VG_STEAM #if defined(VALVE_CALLBACK_PACK_SMALL) if( sizeof(ValvePackingSentinel_t) != 24 ){ printf( "Struct packing error: ValvePackingSentinel_t expected 24 got %i\nThe application is built incorrectly\n", (int)sizeof(ValvePackingSentinel_t)); @@ -769,6 +777,9 @@ static int sw_init(void) vg_register_exit( &sw_exit, "SteamAPI" ); return 1; +#else + return 1; +#endif } @@ -777,6 +788,7 @@ void (*sw_leaderboard_downloaded)( LeaderboardScoresDownloaded_t *pCallback ); static void sw_event_loop(void) { +#ifdef VG_STEAM SteamAPI_ManualDispatch_RunFrame( steam_api_classes.pipe ); CallbackMsg_t callback; @@ -851,6 +863,7 @@ static void sw_event_loop(void) SteamAPI_ManualDispatch_FreeLastCallback( steam_api_classes.pipe ); } +#endif } static void sw_set_achievement( const char *vg_ach_name ) @@ -863,7 +876,9 @@ static void sw_set_achievement( const char *vg_ach_name ) if( !ach->is_set ) { +#ifdef VG_STEAM SteamAPI_ISteamUserStats_SetAchievement( steam_api_classes.stats, vg_ach_name ); +#endif ach->is_set = 1; vg_success( "Achievement set: '%s'\n", vg_ach_name ); }