Skip to content

Commit

Permalink
allow changing fov of center camera
Browse files Browse the repository at this point in the history
  • Loading branch information
Kethen committed Sep 26, 2024
1 parent b051581 commit b549096
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions s4_league_fps_unlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ static pthread_mutex_t config_mutex;
struct config{
int max_framerate;
int field_of_view;
int center_field_of_view;
int sprint_field_of_view;
bool framelimiter_full_busy_loop;
int framelimiter_busy_loop_buffer_100ns;
Expand All @@ -122,6 +123,7 @@ static float set_drop_val;
struct config config = {
.max_framerate = 300,
.field_of_view = 60,
.center_field_of_view = 66,
.sprint_field_of_view = 80,
.framelimiter_full_busy_loop = false,
.framelimiter_busy_loop_buffer_100ns = 15000,
Expand Down Expand Up @@ -166,6 +168,12 @@ static void parse_config(){
staging_config.field_of_view = parsed_config_file["field_of_view"];
LOG_VERBOSE("setting field of view to %d", staging_config.field_of_view);
}
if(!parsed_config_file["center_field_of_view"].is_number()){
LOG("failed reading center_field_of_view from %s, ", config_file_name)
}else{
staging_config.center_field_of_view = parsed_config_file["center_field_of_view"];
LOG_VERBOSE("setting center field of view to %d", staging_config.center_field_of_view);
}
if(!parsed_config_file["sprint_field_of_view"].is_number()){
LOG("failed reading sprint_field_of_view from %s, ", config_file_name)
}else{
Expand Down Expand Up @@ -340,6 +348,8 @@ void __attribute__((thiscall)) patched_fun_00766000(struct ctx_fun_00766000 *ctx
pthread_mutex_lock(&config_mutex);
if(ctx->target_fov == 60.0){
ctx->target_fov = config.field_of_view;
}else if(ctx->target_fov == 66.0){
ctx->target_fov = config.center_field_of_view;
}else if(ctx->target_fov == 80.0){
ctx->target_fov = config.sprint_field_of_view;
}
Expand Down
1 change: 1 addition & 0 deletions s4_league_fps_unlock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"max_framerate":300,
"field_of_view":60,
"center_field_of_view":66,
"sprint_field_of_view":80,
"framelimiter_full_busy_loop":false,
"framelimiter_busy_loop_buffer_100ns":15000
Expand Down

0 comments on commit b549096

Please sign in to comment.