Fix major overstep with last commit
[carveJwlIkooP6JGAAIwe30JlM.git] / steam.h
diff --git a/steam.h b/steam.h
index 57af4295275acf6d67894da542fa89aec3395289..c0fb7894d21e97846496e1864f78b83b5cccf153 100644 (file)
--- a/steam.h
+++ b/steam.h
@@ -2,6 +2,7 @@
 #define STEAM_H
 
 #include "vg/vg_steam.h"
+#include "vg/vg_steam_utils.h"
 #include "vg/vg_steam_networking.h"
 #include "vg/vg_steam_auth.h"
 #include "vg/vg_steam_http.h"
  * nothing.
  */
 
+static void recv_steam_warning( int severity, const char *msg )
+{
+   if( severity == 0 )
+      vg_low( "%s\n", msg );
+   else
+      vg_info( "%s\n", msg );
+}
+
 static int steam_ready = 0;
 static void *hSteamNetworkingSockets,
             *hSteamUser;
 
 static HSteamPipe hSteamClientPipe;
 
-static void steam_init(void)
+static int steam_init(void)
 {
 #ifdef SR_NETWORKED
+   vg_info( "Initializing steamworks\n" );
+
    if( !SteamAPI_Init() )
    {
+      printf("\n");
       vg_error( "Steamworks failed to initialize\n" );
-      return;
+      return 1;
    }
+
    steam_ready = 1;
 
    SteamAPI_ManualDispatch_Init();
-   vg_success( "Steamworks API running\n" );
 
    /* Connect interfaces */
    hSteamClientPipe = SteamAPI_GetHSteamPipe();
    hSteamNetworkingSockets = SteamAPI_SteamNetworkingSockets_SteamAPI();
    hSteamUser = SteamAPI_SteamUser();
+
+   ISteamUtils *utils = SteamAPI_SteamUtils();
+   SteamAPI_ISteamUtils_SetWarningMessageHook( utils, recv_steam_warning );
+
+   printf("\n");
+   vg_success( "\nSteamworks API running\n" );
 #endif
+
+   return 1;
 }
 
 static void steam_update(void)
@@ -49,7 +69,7 @@ static void steam_update(void)
       steamworks_event_loop( hSteamClientPipe );
 }
 
-static void steam_end(void)
+static void steam_end(void *nothing)
 {
    if( steam_ready )
    {