aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/LevelRenderer.cpp
diff options
context:
space:
mode:
authorMijaeLio <87155057+MijaeLio@users.noreply.github.com>2026-03-06 20:14:06 -0500
committerGitHub <noreply@github.com>2026-03-06 19:14:06 -0600
commit16446265d555d21f564b5989611a05918728d643 (patch)
treead4ed8918f0090cf64bda4ac604d883a23ab1b48 /Minecraft.Client/LevelRenderer.cpp
parent216943716b8797fa1b9014f337b8ce7bbe50af4d (diff)
Add Render Distance option. (#675)
* FOV option without debug menu Now located in Graphics section. Based on the FOV thing from discord idk * language * render distance option for graphics menu * oop * swf files on media * revert changes on language selector * nvm it was actually easy to fix * forgot this * Final probably Fixed visual bug and made the chunk updates depend to your view distance.
Diffstat (limited to 'Minecraft.Client/LevelRenderer.cpp')
-rw-r--r--Minecraft.Client/LevelRenderer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Minecraft.Client/LevelRenderer.cpp b/Minecraft.Client/LevelRenderer.cpp
index d9510a53..c1b4850c 100644
--- a/Minecraft.Client/LevelRenderer.cpp
+++ b/Minecraft.Client/LevelRenderer.cpp
@@ -61,6 +61,7 @@
#include "..\Minecraft.World\SoundTypes.h"
#include "FrustumCuller.h"
#include "..\Minecraft.World\BasicTypeContainers.h"
+#include "Common/UI/UIScene_SettingsGraphicsMenu.h"
//#define DISABLE_SPU_CODE
@@ -426,8 +427,11 @@ void LevelRenderer::allChanged(int playerIndex)
Tile::leaves->setFancy(mc->options->fancyGraphics);
lastViewDistance = mc->options->viewDistance;
+ int realviewDistance = UIScene_SettingsGraphicsMenu::LevelToDistance(3 - mc->options->viewDistance) + 2;
+ int realrenderArea = (realviewDistance * realviewDistance * 4);
+
// Calculate size of area we can render based on number of players we need to render for
- int dist = (int)sqrtf( (float)PLAYER_RENDER_AREA / (float)activePlayers() );
+ int dist = (int)sqrtf( (float)realrenderArea / (float)activePlayers() );
// AP - poor little Vita just can't cope with such a big area
#ifdef __PSVITA__