diff options
| author | Loki Rautio <lokirautio@gmail.com> | 2026-03-04 03:56:03 -0600 |
|---|---|---|
| committer | Loki Rautio <lokirautio@gmail.com> | 2026-03-04 03:56:03 -0600 |
| commit | 42aec6dac53dffa6afe072560a7e1d4986112538 (patch) | |
| tree | 0836426857391df1b6a83f6368a183f83ec9b104 /Minecraft.Client/LevelRenderer.h | |
| parent | c9d58eeac7c72f0b3038e084667b4d89a6249fce (diff) | |
| parent | ef9b6fd500dfabd9463267b0dd9e29577eea8a2b (diff) | |
Merge branch 'main' into pr/win64-world-saves
# Conflicts:
# Minecraft.Client/MinecraftServer.cpp
# README.md
Diffstat (limited to 'Minecraft.Client/LevelRenderer.h')
| -rw-r--r-- | Minecraft.Client/LevelRenderer.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/Minecraft.Client/LevelRenderer.h b/Minecraft.Client/LevelRenderer.h index c0a98bba..bb2c0d13 100644 --- a/Minecraft.Client/LevelRenderer.h +++ b/Minecraft.Client/LevelRenderer.h @@ -4,6 +4,7 @@ #include "OffsettedRenderList.h" #include "..\Minecraft.World\JavaIntHash.h" #include "..\Minecraft.World\Level.h" +#include "ResourceLocation.h" #include <xmcore.h> #ifdef __PS3__ #include "C4JSpursJob.h" @@ -35,6 +36,14 @@ using namespace std; class LevelRenderer : public LevelListener { friend class Chunk; + +private: + static ResourceLocation MOON_LOCATION; + static ResourceLocation MOON_PHASES_LOCATION; + static ResourceLocation SUN_LOCATION; + static ResourceLocation CLOUDS_LOCATION; + static ResourceLocation END_SKY_LOCATION; + public: static const int CHUNK_XZSIZE = 16; #ifdef _LARGE_WORLDS @@ -43,14 +52,16 @@ public: static const int CHUNK_SIZE = 16; #endif static const int CHUNK_Y_COUNT = Level::maxBuildHeight / CHUNK_SIZE; -#if defined _XBOX_ONE - static const int MAX_COMMANDBUFFER_ALLOCATIONS = 2047 * 1024 * 1024; // Changed to 2047. 4J had set to 512. +#if defined _WINDOWS64 + static const int MAX_COMMANDBUFFER_ALLOCATIONS = 2047 * 1024 * 1024; // Changed to 2047. 4J had set to 512. +#elif defined _XBOX_ONE + static const int MAX_COMMANDBUFFER_ALLOCATIONS = 512 * 1024 * 1024; // 4J - added #elif defined __ORBIS__ static const int MAX_COMMANDBUFFER_ALLOCATIONS = 448 * 1024 * 1024; // 4J - added - hard limit is 512 so giving a lot of headroom here for fragmentation (have seen 16MB lost to fragmentation in multiplayer crash dump before) #elif defined __PS3__ static const int MAX_COMMANDBUFFER_ALLOCATIONS = 110 * 1024 * 1024; // 4J - added #else - static const int MAX_COMMANDBUFFER_ALLOCATIONS = 55 * 1024 * 1024; // 4J - added + static const int MAX_COMMANDBUFFER_ALLOCATIONS = 55 * 1024 * 1024; // 4J - added #endif public: LevelRenderer(Minecraft *mc, Textures *textures); @@ -71,7 +82,7 @@ public: private: void resortChunks(int xc, int yc, int zc); public: - int render(shared_ptr<Mob> player, int layer, double alpha, bool updateChunks); + int render(shared_ptr<LivingEntity> player, int layer, double alpha, bool updateChunks); private: int renderChunks(int from, int to, int layer, double alpha); public: @@ -89,7 +100,7 @@ public: public: void renderHit(shared_ptr<Player> player, HitResult *h, int mode, shared_ptr<ItemInstance> inventoryItem, float a); void renderDestroyAnimation(Tesselator *t, shared_ptr<Player> player, float a); - void renderHitOutline(shared_ptr<Player> player, HitResult *h, int mode, shared_ptr<ItemInstance> inventoryItem, float a); + void renderHitOutline(shared_ptr<Player> player, HitResult *h, int mode, float a); void render(AABB *b); void setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Level *level); // 4J - added level param void tileChanged(int x, int y, int z); @@ -107,6 +118,7 @@ public: void playStreamingMusic(const wstring& name, int x, int y, int z); void playSound(int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f); void playSound(shared_ptr<Entity> entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f); + void playSoundExceptPlayer(shared_ptr<Player> player, int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f); void addParticle(ePARTICLE_TYPE eParticleType, double x, double y, double z, double xa, double ya, double za); // 4J added shared_ptr<Particle> addParticleInternal(ePARTICLE_TYPE eParticleType, double x, double y, double z, double xa, double ya, double za); // 4J added void entityAdded(shared_ptr<Entity> entity); @@ -114,6 +126,7 @@ public: void playerRemoved(shared_ptr<Entity> entity) {} // 4J added - for when a player is removed from the level's player array, not just the entity storage void skyColorChanged(); void clear(); + void globalLevelEvent(int type, int sourceX, int sourceY, int sourceZ, int data); void levelEvent(shared_ptr<Player> source, int type, int x, int y, int z, int data); void destroyTileProgress(int id, int x, int y, int z, int progress); void registerTextures(IconRegister *iconRegister); @@ -259,10 +272,10 @@ public: bool dirtyChunkPresent; __int64 lastDirtyChunkFound; - static const int FORCE_DIRTY_CHUNK_CHECK_PERIOD_MS = 250; + static const int FORCE_DIRTY_CHUNK_CHECK_PERIOD_MS = 125; // decreased from 250 to 125 - updated by detectiveren #ifdef _LARGE_WORLDS - static const int MAX_CONCURRENT_CHUNK_REBUILDS = 4; + static const int MAX_CONCURRENT_CHUNK_REBUILDS = 8; // increased from 4 to 8 - updated by detectiveren static const int MAX_CHUNK_REBUILD_THREADS = MAX_CONCURRENT_CHUNK_REBUILDS - 1; static Chunk permaChunk[MAX_CONCURRENT_CHUNK_REBUILDS]; static C4JThread *rebuildThreads[MAX_CHUNK_REBUILD_THREADS]; @@ -274,4 +287,6 @@ public: CRITICAL_SECTION m_csChunkFlags; #endif void nonStackDirtyChunksAdded(); + + int checkAllPresentChunks(bool *faultFound); // 4J - added for testing }; |
