mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-15 17:51:53 +00:00
chore: format Minecraft.Client
This commit is contained in:
@@ -7,30 +7,26 @@
|
||||
#include "../../../Minecraft.World/Entities/Entity.h"
|
||||
#include "../../../Minecraft.World/Level/Level.h"
|
||||
|
||||
SignRenderer::SignRenderer() { signModel = new SignModel(); }
|
||||
|
||||
SignRenderer::SignRenderer()
|
||||
{
|
||||
signModel = new SignModel();
|
||||
}
|
||||
void SignRenderer::render(std::shared_ptr<TileEntity> _sign, double x, double y,
|
||||
double z, float a, bool setColor, float alpha,
|
||||
bool useCompiled) {
|
||||
// 4J - dynamic cast required because we aren't using templates/generics in
|
||||
// our version
|
||||
std::shared_ptr<SignTileEntity> sign =
|
||||
std::dynamic_pointer_cast<SignTileEntity>(_sign);
|
||||
|
||||
void SignRenderer::render(std::shared_ptr<TileEntity> _sign, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled)
|
||||
{
|
||||
// 4J - dynamic cast required because we aren't using templates/generics in our version
|
||||
std::shared_ptr<SignTileEntity> sign = std::dynamic_pointer_cast<SignTileEntity>(_sign);
|
||||
|
||||
Tile *tile = sign->getTile();
|
||||
Tile* tile = sign->getTile();
|
||||
|
||||
glPushMatrix();
|
||||
float size = 16 / 24.0f;
|
||||
if (tile == Tile::sign)
|
||||
{
|
||||
glTranslatef((float) x + 0.5f, (float) y + 0.75f * size, (float) z + 0.5f);
|
||||
if (tile == Tile::sign) {
|
||||
glTranslatef((float)x + 0.5f, (float)y + 0.75f * size, (float)z + 0.5f);
|
||||
float rot = sign->getData() * 360 / 16.0f;
|
||||
glRotatef(-rot, 0, 1, 0);
|
||||
signModel->cube2->visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
int face = sign->getData();
|
||||
float rot = 0;
|
||||
|
||||
@@ -38,20 +34,20 @@ void SignRenderer::render(std::shared_ptr<TileEntity> _sign, double x, double y,
|
||||
if (face == 4) rot = 90;
|
||||
if (face == 5) rot = -90;
|
||||
|
||||
glTranslatef((float) x + 0.5f, (float) y + 0.75f * size, (float) z + 0.5f);
|
||||
glTranslatef((float)x + 0.5f, (float)y + 0.75f * size, (float)z + 0.5f);
|
||||
glRotatef(-rot, 0, 1, 0);
|
||||
glTranslatef(0, -5 / 16.0f, -7 / 16.0f);
|
||||
|
||||
signModel->cube2->visible = false;
|
||||
}
|
||||
|
||||
bindTexture(TN_ITEM_SIGN); // 4J was L"/item/sign.png"
|
||||
bindTexture(TN_ITEM_SIGN); // 4J was L"/item/sign.png"
|
||||
|
||||
glPushMatrix();
|
||||
glScalef(size, -size, -size);
|
||||
signModel->render(true);
|
||||
glPopMatrix();
|
||||
Font *font = getFont();
|
||||
Font* font = getFont();
|
||||
|
||||
float s = 1 / 60.0f * size;
|
||||
glTranslatef(0, 0.5f * size, 0.07f * size);
|
||||
@@ -59,62 +55,56 @@ void SignRenderer::render(std::shared_ptr<TileEntity> _sign, double x, double y,
|
||||
glNormal3f(0, 0, -1 * s);
|
||||
glDepthMask(false);
|
||||
|
||||
int col = Minecraft::GetInstance()->getColourTable()->getColor(eMinecraftColour_Sign_Text);
|
||||
std::wstring msg;
|
||||
// need to send the new data
|
||||
// Get the current language setting from the console
|
||||
std::uint32_t dwLanguage = XGetLanguage( );
|
||||
int col = Minecraft::GetInstance()->getColourTable()->getColor(
|
||||
eMinecraftColour_Sign_Text);
|
||||
std::wstring msg;
|
||||
// need to send the new data
|
||||
// Get the current language setting from the console
|
||||
std::uint32_t dwLanguage = XGetLanguage();
|
||||
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++) // 4J - was sign.messages.length
|
||||
{
|
||||
if(sign->IsVerified())
|
||||
{
|
||||
if(sign->IsCensored())
|
||||
{
|
||||
switch(dwLanguage)
|
||||
{
|
||||
case XC_LANGUAGE_KOREAN:
|
||||
case XC_LANGUAGE_JAPANESE:
|
||||
case XC_LANGUAGE_TCHINESE:
|
||||
msg = L"Censored";// In-game font, so English only
|
||||
break;
|
||||
default:
|
||||
msg = app.GetString(IDS_STRINGVERIFY_CENSORED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = sign->GetMessage(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(dwLanguage)
|
||||
{
|
||||
case XC_LANGUAGE_KOREAN:
|
||||
case XC_LANGUAGE_JAPANESE:
|
||||
case XC_LANGUAGE_TCHINESE:
|
||||
msg = L"Awaiting Approval";// In-game font, so English only
|
||||
break;
|
||||
default:
|
||||
msg = app.GetString(IDS_STRINGVERIFY_AWAITING_APPROVAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == sign->GetSelectedLine())
|
||||
{
|
||||
msg = L"> " + msg + L" <";
|
||||
font->draw(msg, -font->width(msg) / 2, i * 10 - (MAX_SIGN_LINES) * 5, col); // 4J - (MAX_SIGN_LINES) was sign.messages.length
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++) // 4J - was sign.messages.length
|
||||
{
|
||||
if (sign->IsVerified()) {
|
||||
if (sign->IsCensored()) {
|
||||
switch (dwLanguage) {
|
||||
case XC_LANGUAGE_KOREAN:
|
||||
case XC_LANGUAGE_JAPANESE:
|
||||
case XC_LANGUAGE_TCHINESE:
|
||||
msg = L"Censored"; // In-game font, so English only
|
||||
break;
|
||||
default:
|
||||
msg = app.GetString(IDS_STRINGVERIFY_CENSORED);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
msg = sign->GetMessage(i);
|
||||
}
|
||||
} else {
|
||||
switch (dwLanguage) {
|
||||
case XC_LANGUAGE_KOREAN:
|
||||
case XC_LANGUAGE_JAPANESE:
|
||||
case XC_LANGUAGE_TCHINESE:
|
||||
msg =
|
||||
L"Awaiting Approval"; // In-game font, so English only
|
||||
break;
|
||||
default:
|
||||
msg = app.GetString(IDS_STRINGVERIFY_AWAITING_APPROVAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
font->draw(msg, -font->width(msg) / 2, i * 10 - (MAX_SIGN_LINES) * 5, col); // 4J - (MAX_SIGN_LINES) was sign.messages.length
|
||||
|
||||
if (i == sign->GetSelectedLine()) {
|
||||
msg = L"> " + msg + L" <";
|
||||
font->draw(msg, -font->width(msg) / 2,
|
||||
i * 10 - (MAX_SIGN_LINES) * 5,
|
||||
col); // 4J - (MAX_SIGN_LINES) was sign.messages.length
|
||||
} else {
|
||||
font->draw(msg, -font->width(msg) / 2,
|
||||
i * 10 - (MAX_SIGN_LINES) * 5,
|
||||
col); // 4J - (MAX_SIGN_LINES) was sign.messages.length
|
||||
}
|
||||
}
|
||||
glDepthMask(true);
|
||||
glColor4f(1, 1, 1, 1);
|
||||
glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user