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:
@@ -33,15 +33,15 @@ void ItemFrameRenderer::render(shared_ptr<Entity> _itemframe, double x, double
|
||||
shared_ptr<ItemFrame> itemFrame = dynamic_pointer_cast<ItemFrame>(_itemframe);
|
||||
|
||||
glPushMatrix();
|
||||
float xOffs = static_cast<float>(itemFrame->x - x) - 0.5f;
|
||||
float yOffs = static_cast<float>(itemFrame->y - y) - 0.5f;
|
||||
float zOffs = static_cast<float>(itemFrame->z - z) - 0.5f;
|
||||
float xOffs = (float) (itemFrame->x - x) - 0.5f;
|
||||
float yOffs = (float) (itemFrame->y - y) - 0.5f;
|
||||
float zOffs = (float) (itemFrame->z - z) - 0.5f;
|
||||
|
||||
int xt = itemFrame->xTile + Direction::STEP_X[itemFrame->dir];
|
||||
int yt = itemFrame->yTile;
|
||||
int zt = itemFrame->zTile + Direction::STEP_Z[itemFrame->dir];
|
||||
|
||||
glTranslatef(static_cast<float>(xt) - xOffs, static_cast<float>(yt) - yOffs, static_cast<float>(zt) - zOffs);
|
||||
glTranslatef((float) xt - xOffs, (float) yt - yOffs, (float) zt - zOffs);
|
||||
|
||||
drawFrame(itemFrame);
|
||||
drawItem(itemFrame);
|
||||
@@ -110,9 +110,9 @@ void ItemFrameRenderer::drawItem(shared_ptr<ItemFrame> entity)
|
||||
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
|
||||
shared_ptr<ItemInstance> instance = entity->getItem();
|
||||
if (instance == nullptr) return;
|
||||
if (instance == NULL) return;
|
||||
|
||||
shared_ptr<ItemEntity> itemEntity = std::make_shared<ItemEntity>(entity->level, 0, 0, 0, instance);
|
||||
shared_ptr<ItemEntity> itemEntity = shared_ptr<ItemEntity>(new ItemEntity(entity->level, 0, 0, 0, instance));
|
||||
itemEntity->getItem()->count = 1;
|
||||
itemEntity->bobOffs = 0;
|
||||
|
||||
@@ -154,7 +154,7 @@ void ItemFrameRenderer::drawItem(shared_ptr<ItemFrame> entity)
|
||||
t->end();
|
||||
|
||||
shared_ptr<MapItemSavedData> data = Item::map->getSavedData(itemEntity->getItem(), entity->level);
|
||||
if (data != nullptr)
|
||||
if (data != NULL)
|
||||
{
|
||||
entityRenderDispatcher->itemInHandRenderer->minimap->render(nullptr, entityRenderDispatcher->textures, data, entity->entityId);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void ItemFrameRenderer::drawItem(shared_ptr<ItemFrame> entity)
|
||||
double compassRotA = ct->rota;
|
||||
ct->rot = 0;
|
||||
ct->rota = 0;
|
||||
ct->updateFromPosition(entity->level, entity->x, entity->z, Mth::wrapDegrees( static_cast<float>(180 + entity->dir * 90) ), false, true);
|
||||
ct->updateFromPosition(entity->level, entity->x, entity->z, Mth::wrapDegrees( (float)(180 + entity->dir * 90) ), false, true);
|
||||
ct->rot = compassRot;
|
||||
ct->rota = compassRotA;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user