This commit is contained in:
GabsPuNs
2026-06-06 18:42:29 -04:00
parent a567ed3942
commit b77caa0da9
12 changed files with 19 additions and 14 deletions

View File

@@ -876,13 +876,15 @@ void GameRenderer::updateLightTexture(float a)
const __m256 v255 = _mm256_set1_ps(255.0f);
#endif
// 4J-JEV: Now doing light textures on PER PLAYER basis.
// 4J - we *had* added separate light textures for all dimensions, and this loop to update them all here
for (int j = 0; j < XUSER_MAX_COUNT; j++)
{
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[j];
if (player == nullptr)
continue;
Level *level = player->level;
Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture
const float skyDarken1 = level->getSkyDarken(1.0f);
const float skyWeight = skyDarken1 * 0.65f + 0.35f;

View File

@@ -11,9 +11,7 @@ ResourceLocation HorseRenderer::HORSE_SKELETON_LOCATION = ResourceLocation(TN_MO
std::map<wstring, ResourceLocation *> HorseRenderer::LAYERED_LOCATION_CACHE;
HorseRenderer::HorseRenderer(Model *model, float f) : MobRenderer(model, f)
{
}
HorseRenderer::HorseRenderer(Model *model, float f) : MobRenderer(model, f) {}
void HorseRenderer::adjustHeight(shared_ptr<PathfinderMob> mob, float FHeight)
{
@@ -26,13 +24,10 @@ void HorseRenderer::scale(shared_ptr<LivingEntity> entityliving, float f)
int type = dynamic_pointer_cast<EntityHorse>(entityliving)->getType();
if (type == EntityHorse::TYPE_DONKEY)
{
sizeFactor *= 0.87F;
}
else if (type == EntityHorse::TYPE_MULE)
{
sizeFactor *= 0.92F;
}
glScalef(sizeFactor, sizeFactor, sizeFactor);
MobRenderer::scale(entityliving, f);
}
@@ -40,15 +35,14 @@ void HorseRenderer::scale(shared_ptr<LivingEntity> entityliving, float f)
void HorseRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale)
{
if (mob->isInvisible())
{
model->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob);
}
else
{
EntityRenderer::bindTexture(mob);
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
// Ensure that any extra layers of texturing are disabled after rendering this horse
RenderManager.TextureBind(-1);
//RenderManager.TextureBind(1, -1);
}
}
@@ -60,9 +54,7 @@ void HorseRenderer::bindTexture(ResourceLocation *location)
entityRenderDispatcher->textures->bindTextureLayers(location);
}
else
{
EntityRenderer::bindTexture(location);
}
}
ResourceLocation *HorseRenderer::getTextureLocation(shared_ptr<Entity> entity)
@@ -93,9 +85,7 @@ ResourceLocation *HorseRenderer::getOrCreateLayeredTextureLocation(shared_ptr<En
ResourceLocation *location;
if (it != LAYERED_LOCATION_CACHE.end())
{
location = it->second;
}
else
{
LAYERED_LOCATION_CACHE[textureName] = new ResourceLocation(horse->getLayeredTextureLayers());

View File

@@ -530,6 +530,18 @@ void Textures::bindTextureLayers(ResourceLocation *resource)
RenderManager.TextureBind(id);
}
/*
void Textures::bindTextureLayers(ResourceLocation *resource)
{
assert(resource->isPreloaded());
int layers = resource->getTextureCount();
for( int i = 0; i < layers; i++ )
RenderManager.TextureBind(i, loadTexture(resource->getTexture(i)));
}
*/
void Textures::bind(int id)
{
//if (id != lastBoundId)

View File

@@ -169,6 +169,7 @@ public:
// Textures
int TextureCreate();
void TextureFree(int idx);
void TextureBind(int slot, int idx);
void TextureBind(int idx);
void TextureBindVertex(int idx);
void TextureSetTextureLevels(int levels);