X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=common.h;h=ff522676c82083b4b1de77a19333bebbe95d57af;hb=23ef4d7f6bfe6a5a91c78822b081a9ea63cb74a6;hp=0abe4469fd27b97d2107de2ee54834f289b3d9a6;hpb=19213f3309ec3c45e5b23ac2f0d91f26f3a8984f;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/common.h b/common.h index 0abe446..ff52267 100644 --- a/common.h +++ b/common.h @@ -7,9 +7,26 @@ #define VG_TIMESTEP_FIXED (1.0/60.0) #define VG_3D +#define VG_GAME +//#define VG_STATIC static +#define VG_STATIC #define VG_FRAMEBUFFER_RESIZE 1 #include "vg/vg.h" -#include "anyascii/anyascii.h" +#include "submodules/anyascii/impl/c/anyascii.c" + +#define RESET_MAX_TIME 45.0 +VG_STATIC v3f TEMP_BOARD_0, TEMP_BOARD_1; + +enum menu_controller_type +{ + k_menu_controller_type_keyboard, + k_menu_controller_type_xbox, + k_menu_controller_type_playstation, + k_menu_controller_type_steam, + k_menu_controller_type_steam_deck +}; + +VG_STATIC enum menu_controller_type menu_display_controller; typedef struct ray_hit ray_hit; struct ray_hit @@ -19,9 +36,9 @@ struct ray_hit v3f pos, normal; }; -static int network_scores_updated = 0; +VG_STATIC int network_scores_updated = 0; -static u32 utf8_byte0_byte_count( u8 char0 ) +VG_STATIC u32 utf8_byte0_byte_count( u8 char0 ) { for( u32 k=2; k<4; k++ ) { @@ -32,14 +49,8 @@ static u32 utf8_byte0_byte_count( u8 char0 ) return 0; } -static void str_utf8_collapse( const char *str, char *buf, u32 length ) +VG_STATIC void str_utf8_collapse( const char *str, char *buf, u32 length ) { - if( length == 0 ) - { - strncpy( buf, "User", length ); - return; - } - u8 *ustr = (u8 *)str; u32 utf32_code = 0x00000000; u32 i=0, j=0, utf32_byte_ct=0; @@ -86,4 +97,103 @@ static void str_utf8_collapse( const char *str, char *buf, u32 length ) buf[j] = 0x00; } +VG_STATIC float + k_runspeed = 20.0f, /* depr */ + k_board_radius = 0.3f, + k_board_length = 0.45f, + k_board_allowance = 0.04f, + k_friction_lat = 12.0f, + k_friction_resistance = 0.01f, + k_max_push_speed = 16.0f, + k_push_accel = 10.0f, + k_push_cycle_rate = 8.0f, + k_steer_ground = 2.5f, + k_steer_air = 3.6f, + k_steer_air_lerp = 0.3f, + k_pump_force = 0.0f, + k_downforce = 5.0f, + k_walk_downforce = 8.0f, + k_jump_charge_speed = (1.0f/1.0f), + k_jump_force = 5.0f, + k_pitch_limit = 1.5f, + k_look_speed = 2.0f, + + k_spin_boost = 2.2f, + + k_cog_spring = 0.2f, + k_cog_damp = 0.02f, + k_cog_mass_ratio = 0.9f, + + k_mmthrow_scale = 6.0f, + k_mmcollect_lat = 2.0f, + k_mmcollect_vert = 0.0f, + k_mmdecay = 12.0f, + k_spring_angular = 1.0f, + + k_spring_force = 15.0f, + k_spring_dampener = 5.0f; + + +VG_STATIC float + k_walkspeed = 10.0f, + k_airspeed = 2.0f, + k_stopspeed = 4.0f, + k_walk_accel = 10.0f, + k_walk_air_accel = 7.0f, + k_walk_friction = 10.0f, + k_walk_step_height = 0.2f; + +VG_STATIC float k_ragdoll_floatyiness = 20.0f, + k_ragdoll_floatydrag = 1.0f, + k_ragdoll_limit_scale = 1.0f; + +VG_STATIC int k_ragdoll_div = 1, + ragdoll_frame = 0, + k_ragdoll_debug_collider = 1, + k_ragdoll_debug_constraints = 0; + + +VG_STATIC int freecam = 0; +VG_STATIC int walk_grid_iterations = 1; +VG_STATIC float fc_speed = 10.0f; +VG_STATIC int cl_thirdperson = 0; + +VG_STATIC void common_var_temp(void) +{ + VG_VAR_F32( k_walkspeed ); + VG_VAR_F32( k_stopspeed ); + VG_VAR_F32( k_airspeed ); + VG_VAR_F32( k_walk_friction ); + VG_VAR_F32( k_walk_air_accel ); + VG_VAR_F32( k_runspeed ); + VG_VAR_F32( k_walk_accel ); + + VG_VAR_I32( freecam ); + VG_VAR_I32( cl_thirdperson ); + VG_VAR_F32_PERSISTENT( fc_speed ); + + /* TODO: NOT PERSISTENT */ + VG_VAR_F32( k_ragdoll_limit_scale ); + VG_VAR_I32( k_ragdoll_div ); + VG_VAR_I32( k_ragdoll_debug_collider ); + VG_VAR_I32( k_ragdoll_debug_constraints ); + + VG_VAR_F32( k_friction_lat ); + + VG_VAR_F32( k_cog_spring ); + VG_VAR_F32( k_cog_damp ); + + VG_VAR_F32( k_cog_mass_ratio ); + VG_VAR_F32( k_downforce ); + + VG_VAR_F32( k_spring_force ); + VG_VAR_F32( k_spring_dampener ); + VG_VAR_F32( k_spring_angular ); + + VG_VAR_F32( k_mmthrow_scale ); + VG_VAR_F32( k_mmcollect_lat ); + VG_VAR_F32( k_mmcollect_vert ); + VG_VAR_F32( k_mmdecay ); +} + #endif /* COMMON_H */