Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a.
This commit is contained in:
@@ -17,7 +17,7 @@ LivingEntityRenderer::LivingEntityRenderer(Model *model, float shadow)
|
||||
{
|
||||
this->model = model;
|
||||
shadowRadius = shadow;
|
||||
armor = nullptr;
|
||||
armor = NULL;
|
||||
}
|
||||
|
||||
void LivingEntityRenderer::setArmor(Model *armor)
|
||||
@@ -43,11 +43,11 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
model->attackTime = getAttackAnim(mob, a);
|
||||
if (armor != nullptr) armor->attackTime = model->attackTime;
|
||||
if (armor != NULL) armor->attackTime = model->attackTime;
|
||||
model->riding = mob->isRiding();
|
||||
if (armor != nullptr) armor->riding = model->riding;
|
||||
if (armor != NULL) armor->riding = model->riding;
|
||||
model->young = mob->isBaby();
|
||||
if (armor != nullptr) armor->young = model->young;
|
||||
if (armor != NULL) armor->young = model->young;
|
||||
|
||||
/*try*/
|
||||
{
|
||||
@@ -259,7 +259,7 @@ void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, f
|
||||
|
||||
void LivingEntityRenderer::setupPosition(shared_ptr<LivingEntity> mob, double x, double y, double z)
|
||||
{
|
||||
glTranslatef(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z));
|
||||
glTranslatef((float) x, (float) y, (float) z);
|
||||
}
|
||||
|
||||
void LivingEntityRenderer::setupRotations(shared_ptr<LivingEntity> mob, float bob, float bodyRot, float a)
|
||||
@@ -306,7 +306,7 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
|
||||
int arrowCount = mob->getArrowCount();
|
||||
if (arrowCount > 0)
|
||||
{
|
||||
shared_ptr<Entity> arrow = std::make_shared<Arrow>(mob->level, mob->x, mob->y, mob->z);
|
||||
shared_ptr<Entity> arrow = shared_ptr<Entity>(new Arrow(mob->level, mob->x, mob->y, mob->z));
|
||||
Random random = Random(mob->entityId);
|
||||
Lighting::turnOff();
|
||||
for (int i = 0; i < arrowCount; i++)
|
||||
@@ -405,7 +405,7 @@ void LivingEntityRenderer::renderName(shared_ptr<LivingEntity> mob, double x, do
|
||||
|
||||
Font *font = getFont();
|
||||
glPushMatrix();
|
||||
glTranslatef(static_cast<float>(x) + 0, static_cast<float>(y) + mob->bbHeight + 0.5f, static_cast<float>(z));
|
||||
glTranslatef((float) x + 0, (float) y + mob->bbHeight + 0.5f, (float) z);
|
||||
glNormal3f(0, 1, 0);
|
||||
|
||||
glRotatef(-entityRenderDispatcher->playerRotY, 0, 1, 0);
|
||||
@@ -448,7 +448,7 @@ void LivingEntityRenderer::renderName(shared_ptr<LivingEntity> mob, double x, do
|
||||
|
||||
bool LivingEntityRenderer::shouldShowName(shared_ptr<LivingEntity> mob)
|
||||
{
|
||||
return Minecraft::renderNames() && mob != entityRenderDispatcher->cameraEntity && !mob->isInvisibleTo(Minecraft::GetInstance()->player) && mob->rider.lock() == nullptr;
|
||||
return Minecraft::renderNames() && mob != entityRenderDispatcher->cameraEntity && !mob->isInvisibleTo(Minecraft::GetInstance()->player) && mob->rider.lock() == NULL;
|
||||
}
|
||||
|
||||
void LivingEntityRenderer::renderNameTags(shared_ptr<LivingEntity> mob, double x, double y, double z, const wstring &msg, float scale, double dist)
|
||||
@@ -595,10 +595,10 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
|
||||
{
|
||||
t->color(0.0f, 0.0f, 0.0f, 0.25f);
|
||||
}
|
||||
t->vertex(static_cast<float>(-w - 1), static_cast<float>(-1 + offs), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(-w - 1), static_cast<float>(+8 + offs + 1), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(+w + 1), static_cast<float>(+8 + offs + 1), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(+w + 1), static_cast<float>(-1 + offs), static_cast<float>(0));
|
||||
t->vertex((float)(-w - 1), (float)( -1 + offs), (float)( 0));
|
||||
t->vertex((float)(-w - 1), (float)( +8 + offs + 1), (float)( 0));
|
||||
t->vertex((float)(+w + 1), (float)( +8 + offs + 1), (float)( 0));
|
||||
t->vertex((float)(+w + 1), (float)( -1 + offs), (float)( 0));
|
||||
t->end();
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
@@ -607,11 +607,11 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
|
||||
glLineWidth(2.0f);
|
||||
t->begin(GL_LINE_STRIP);
|
||||
t->color(color, 255 * textOpacity);
|
||||
t->vertex(static_cast<float>(-w - 1), static_cast<float>(-1 + offs), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(-w - 1), static_cast<float>(+8 + offs + 1), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(+w + 1), static_cast<float>(+8 + offs + 1), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(+w + 1), static_cast<float>(-1 + offs), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(-w - 1), static_cast<float>(-1 + offs), static_cast<float>(0));
|
||||
t->vertex((float)(-w - 1), (float)( -1 + offs), (float)( 0));
|
||||
t->vertex((float)(-w - 1), (float)( +8 + offs + 1), (float)( 0));
|
||||
t->vertex((float)(+w + 1), (float)( +8 + offs + 1), (float)( 0));
|
||||
t->vertex((float)(+w + 1), (float)( -1 + offs), (float)( 0));
|
||||
t->vertex((float)(-w - 1), (float)( -1 + offs), (float)( 0));
|
||||
t->end();
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glDepthMask(false);
|
||||
@@ -632,10 +632,10 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
|
||||
t->begin();
|
||||
int w = font->width(playerName) / 2;
|
||||
t->color(color, 255);
|
||||
t->vertex(static_cast<float>(-w - 1), static_cast<float>(-1 + offs), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(-w - 1), static_cast<float>(+8 + offs), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(+w + 1), static_cast<float>(+8 + offs), static_cast<float>(0));
|
||||
t->vertex(static_cast<float>(+w + 1), static_cast<float>(-1 + offs), static_cast<float>(0));
|
||||
t->vertex((float)(-w - 1), (float)( -1 + offs), (float)( 0));
|
||||
t->vertex((float)(-w - 1), (float)( +8 + offs), (float)( 0));
|
||||
t->vertex((float)(+w + 1), (float)( +8 + offs), (float)( 0));
|
||||
t->vertex((float)(+w + 1), (float)( -1 + offs), (float)( 0));
|
||||
t->end();
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
@@ -645,7 +645,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
|
||||
|
||||
if( textOpacity > 0.0f )
|
||||
{
|
||||
int textColor = ( ( static_cast<int>(textOpacity * 255) << 24 ) | 0xffffff );
|
||||
int textColor = ( ( (int)(textOpacity*255) << 24 ) | 0xffffff );
|
||||
font->draw(playerName, -font->width(playerName) / 2, offs, textColor);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user