-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase FOV when moving fast (Issue#716) #812
base: master
Are you sure you want to change the base?
Changes from all commits
8522c61
92597d6
a061374
03d63ed
2a0d7c1
e11aa0d
e6dcb98
bb103d9
569d006
3e8d4fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,15 @@ fn fovFormatter(allocator: main.utils.NeverFailingAllocator, value: f32) []const | |
return std.fmt.allocPrint(allocator.allocator, "#ffffffField Of View: {d:.0}°", .{value}) catch unreachable; | ||
} | ||
|
||
fn fovSpeedAddCallback(newValue: f32) void { | ||
settings.speedFovAdd = newValue; | ||
settings.save(); | ||
} | ||
|
||
fn fovSpeedAddFormatter(allocator: main.utils.NeverFailingAllocator, value: f32) []const u8 { | ||
return std.fmt.allocPrint(allocator.allocator, "#ffffffFoV Speed Widening: {d:.0}°", .{value}) catch unreachable; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not happy with the naming here. How do other games call this option? Also the naming is inconsistent: The function is called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Good point. I'll check what other games do as nothing comes to mind right now. Not sure why I skipped over the naming inconsistencies. Will fix, thanks! What do you think of the points brought up by Ikabod-kee? I imagine you have the final say, right? :D |
||
|
||
fn lodDistanceFormatter(allocator: main.utils.NeverFailingAllocator, value: f32) []const u8 { | ||
return std.fmt.allocPrint(allocator.allocator, "#ffffffOpaque leaves distance: {d:.0}", .{@round(value)}) catch unreachable; | ||
} | ||
|
@@ -118,6 +127,7 @@ pub fn onOpen() void { | |
list.add(DiscreteSlider.init(.{0, 0}, 128, "#ffffffLeaves Quality (TODO: requires reload): ", "{}", &leavesQualities, settings.leavesQuality - leavesQualities[0], &leavesQualityCallback)); | ||
list.add(ContinuousSlider.init(.{0, 0}, 128, 50.0, 400.0, settings.@"lod0.5Distance", &lodDistanceCallback, &lodDistanceFormatter)); | ||
list.add(ContinuousSlider.init(.{0, 0}, 128, 40.0, 120.0, settings.fov, &fovCallback, &fovFormatter)); | ||
list.add(ContinuousSlider.init(.{ 0, 0 }, 128, 0, 30, settings.speedFovAdd, &fovSpeedAddCallback, &fovSpeedAddFormatter)); | ||
list.add(CheckBox.init(.{0, 0}, 128, "Bloom", settings.bloom, &bloomCallback)); | ||
list.add(CheckBox.init(.{0, 0}, 128, "Vertical Synchronization", settings.vsync, &vsyncCallback)); | ||
list.add(DiscreteSlider.init(.{0, 0}, 128, "#ffffffAnisotropic Filtering: ", "{}x", &anisotropy, switch(settings.anisotropicFiltering) {1 => 0, 2 => 1, 4 => 2, 8 => 3, 16 => 4, else => 2}, &anisotropicFilteringCallback)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just make fovMod atomic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why does it have to be atomic, when other, similar, variables (like eyeVel or eyePos) are not atomic either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's only ever used by the update and render functions, then you are right, it doesn't need to be thread safe.