Skip to content

Commit

Permalink
Finish the Smart Occlusion tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
EnnuiL committed Dec 1, 2024
1 parent abfe1d8 commit efb0dd4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public static class TweaksConfig extends Section {
public final TrackedValue<Boolean> resetZoomWithMouse = this.value(true);

@WidgetSize(Size.HALF)
@Comment("Improves performance by having the game render less of the world when not necessary while zoomed in. Disable this feature if you notice glitches on zooming out and if the game cannot be optimized any further.")
public final TrackedValue<Boolean> zoomAwareOcclusion = this.value(true);
@Comment("Improves performance by making the game render less of the world while zoomed in. This may cause flashes on zooming out if the Sodium mod isn't installed.")
public final TrackedValue<Boolean> smartOcclusion = this.value(true);

@WidgetSize(Size.HALF)
@Comment("If enabled, the current zoom divisor is forgotten once zooming is finished.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private void tickInstances(CallbackInfo info) {
)
)
private int modifyCulling(int original) {
if (!Zoom.isZooming() || !OkZoomerConfigManager.CONFIG.tweaks.zoomAwareOcclusion.value()) {
if (!Zoom.isZooming() || !OkZoomerConfigManager.CONFIG.tweaks.smartOcclusion.value()) {
return original;
} else {
return Mth.positiveCeilDiv(original, Mth.floor(Zoom.getZoomDivisor()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class LevelRendererMixin {
)
)
private void accountForZooming(Camera camera, Frustum frustum, boolean hasCapturedFrustum, boolean isSpectator, CallbackInfo ci) {
if (OkZoomerConfigManager.CONFIG.tweaks.zoomAwareOcclusion.value()) {
if (OkZoomerConfigManager.CONFIG.tweaks.smartOcclusion.value()) {
int divisor = Zoom.isZooming() ? Mth.floor(Zoom.getZoomDivisor()) : 1;

if (divisor != this.prevZoomDivisor) {
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/resources/assets/ok_zoomer/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"config.ok_zoomer.tweaks.hide_crosshair.tooltip": "Hides the crosshair while zooming.",
"config.ok_zoomer.tweaks.reset_zoom_with_mouse": "Reset Zoom with Mouse",
"config.ok_zoomer.tweaks.reset_zoom_with_mouse.tooltip": "Allows for resetting the zoom with the middle mouse button.",
"config.ok_zoomer.tweaks.zoom_aware_occlusion": "Zoom-Aware Occlusion",
"config.ok_zoomer.tweaks.zoom_aware_occlusion.tooltip": "Improves performance by having the game render less of the world when not necessary while zoomed in. Disable this feature if you notice glitches on zooming out and if the game cannot be optimized any further.",
"config.ok_zoomer.tweaks.smart_occlusion": "Smart Occlusion",
"config.ok_zoomer.tweaks.smart_occlusion.tooltip": "Improves performance by making the game render less of the world while zoomed in. This may cause flashes on zooming out if the Sodium mod isn't installed.",
"config.ok_zoomer.tweaks.forget_zoom_divisor": "Forget Zoom Divisor",
"config.ok_zoomer.tweaks.forget_zoom_divisor.tooltip": "If enabled, the current zoom divisor is forgotten once zooming is finished.",
"config.ok_zoomer.tweaks.use_spyglass_sounds": "Use Spyglass Sounds",
Expand Down
2 changes: 2 additions & 0 deletions common/src/main/resources/assets/ok_zoomer/lang/pt_br.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
"config.ok_zoomer.tweaks.hide_crosshair.tooltip": "Esconde a mira durante o zoom.",
"config.ok_zoomer.tweaks.reset_zoom_with_mouse": "Reiniciar zoom com mouse",
"config.ok_zoomer.tweaks.reset_zoom_with_mouse.tooltip": "Permite reiniciar o zoom com o botão do meio do mouse.",
"config.ok_zoomer.tweaks.smart_occlusion": "Oclusão inteligente",
"config.ok_zoomer.tweaks.smart_occlusion.tooltip": "Melhora o desempenho ao fazer o jogo renderizar menos do mundo durante o zoom. Isto pode causar flashes ao sair do zoom caso o mod Sodium não esteja instalado.",
"config.ok_zoomer.tweaks.forget_zoom_divisor": "Esquecer divisor de zoom",
"config.ok_zoomer.tweaks.forget_zoom_divisor.tooltip": "Se ativado, o divisor de zoom atual será esquecido quando o zoom terminar.",
"config.ok_zoomer.tweaks.use_spyglass_sounds": "Usar sons da luneta",
Expand Down

0 comments on commit efb0dd4

Please sign in to comment.