/*
- * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved
* All trademarks are property of their respective owners
*/
#include "vg/vg_steam_http.h"
#include "vg/vg_steam_friends.h"
#include "vg/vg_steam_user_stats.h"
+#include "submodules/anyascii/impl/c/anyascii.c"
/*
* We only want to use steamworks if building for the networked version,
}
VG_STATIC int steam_ready = 0,
- steam_stats_ready = 0;
+ steam_stats_ready = 0;
VG_STATIC void *hSteamNetworkingSockets,
*hSteamUser;
if( steam_ready && steam_stats_ready ){
for( int i=0; i<vg_list_size(steam_achievement_names); i++ ){
- int set = 0;
+ steamapi_bool set = 0;
const char *name = steam_achievement_names[i];
if( SteamAPI_ISteamUserStats_GetAchievement(
}
}
-VG_STATIC ISteamInput *steam_hInput;
-
VG_STATIC u32 utf8_byte0_byte_count( u8 char0 )
{
for( u32 k=2; k<4; k++ ){
* --------------------------------------------------------
*/
hSteamUserStats = SteamAPI_SteamUserStats();
-
steam_register_callback( k_iUserStatsReceived,
steam_on_recieve_current_stats );
vg_warn( "No Steam Logon: Cannot request stats\n" );
- vg_function_push( (struct vg_cmd)
- {
- .name = "ach_list",
- .function = steam_list_achievements
- });
-
- vg_function_push( (struct vg_cmd)
- {
- .name = "ach_clear_all",
- .function = steam_clear_all_achievements
- });
-
- vg_function_push( (struct vg_cmd)
- {
- .name = "ach_set",
- .function = steam_set_achievemnt_test
- });
-
- steam_hInput = SteamAPI_SteamInput();
- SteamAPI_ISteamInput_Init( steam_hInput, 0 );
- SteamAPI_ISteamInput_RunFrame( steam_hInput, 0 );
-
+ vg_console_reg_cmd( "ach_list", steam_list_achievements, NULL );
+ vg_console_reg_cmd( "ach_clear_all", steam_clear_all_achievements, NULL );
+ vg_console_reg_cmd( "ach_set", steam_set_achievemnt_test, NULL );
+
#endif
/* TODO: On username update callback */
{
if( steam_ready ){
steamworks_event_loop( hSteamClientPipe );
-
- /* TODO
- * We can probably request this from SDL too
- */
- if( steam_hInput ){
- SteamAPI_ISteamInput_RunFrame( steam_hInput, 0 );
-
- InputHandle_t joy0 = SteamAPI_ISteamInput_GetControllerForGamepadIndex(
- steam_hInput, 0 );
-
- vg_input.controller_should_use_trackpad_look = 0;
- if( joy0 != 0 ){
- ESteamInputType type = SteamAPI_ISteamInput_GetInputTypeForHandle(
- steam_hInput, joy0 );
-
- if( type == k_ESteamInputType_SteamController ){
- vg_input.controller_should_use_trackpad_look = 1;
- menu_display_controller = k_menu_controller_type_steam;
- }
- else if( type == k_ESteamInputType_SteamDeckController ){
- menu_display_controller = k_menu_controller_type_steam_deck;
- }
- else if( type == k_ESteamInputType_PS3Controller ||
- type == k_ESteamInputType_PS4Controller ||
- type == k_ESteamInputType_PS5Controller )
- {
- menu_display_controller = k_menu_controller_type_playstation;
- }
- else if( type == k_ESteamInputType_XBox360Controller ||
- type == k_ESteamInputType_XBoxOneController )
- {
- menu_display_controller = k_menu_controller_type_xbox;
- }
- else{
- /* currently unsupported controller */
- menu_display_controller = k_menu_controller_type_xbox;
- }
- }
- else
- menu_display_controller = k_menu_controller_type_keyboard;
- }
}
}