fix many things and make playable

This commit is contained in:
Kolyah35
2026-03-03 02:25:34 +03:00
parent 13010f10fa
commit fd183d4888
8 changed files with 52 additions and 30 deletions

View File

@@ -66,7 +66,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
//minecraft->gameRenderer->setupGuiScreen();
Font* font = minecraft->font;
#ifdef PLATFORM_DESKTOP
const bool isTouchInterface = false;
#else
const bool isTouchInterface = minecraft->useTouchscreen();
#endif
const int screenWidth = (int)(minecraft->width * InvGuiScale);
const int screenHeight = (int)(minecraft->height * InvGuiScale);
blitOffset = -90;
@@ -391,7 +395,6 @@ void Gui::onConfigChanged( const Config& c ) {
//LOGI("x,y: %f, %f\n", xx, yy);
}
rcFeedbackInner = t.end(true, rcFeedbackInner.vboId);
if (c.minecraft->useTouchscreen()) {
// I'll bump this up to 6.
int num = 6; // without "..." dots
@@ -614,27 +617,27 @@ void Gui::renderBubbles() {
}
}
static OffsetPosTranslator posTranslator;
void Gui::onLevelGenerated() {
if (Level* level = minecraft->level) {
Pos p = level->getSharedSpawnPos();
posTranslator = OffsetPosTranslator((float)-p.x, (float)-p.y, (float)-p.z);
}
}
static OffsetPosTranslator posTranslator;
void Gui::onLevelGenerated() {
if (Level* level = minecraft->level) {
Pos p = level->getSharedSpawnPos();
posTranslator = OffsetPosTranslator((float)-p.x, (float)-p.y, (float)-p.z);
}
}
void Gui::renderDebugInfo() {
static char buf[256];
float xx = minecraft->player->x;
float yy = minecraft->player->y - minecraft->player->heightOffset;
float zz = minecraft->player->z;
posTranslator.to(xx, yy, zz);
sprintf(buf, "pos: %3.1f, %3.1f, %3.1f\n", xx, yy, zz);
Tesselator& t = Tesselator::instance;
t.beginOverride();
t.scale2d(InvGuiScale, InvGuiScale);
minecraft->font->draw(buf, 2, 2, 0xffffff);
t.resetScale();
t.endOverrideAndDraw();
static char buf[256];
float xx = minecraft->player->x;
float yy = minecraft->player->y - minecraft->player->heightOffset;
float zz = minecraft->player->z;
posTranslator.to(xx, yy, zz);
sprintf(buf, "pos: %3.1f, %3.1f, %3.1f\n", xx, yy, zz);
Tesselator& t = Tesselator::instance;
t.beginOverride();
t.scale2d(InvGuiScale, InvGuiScale);
minecraft->font->draw(buf, 2, 2, 0xffffff);
t.resetScale();
t.endOverrideAndDraw();
}
void Gui::renderSleepAnimation( const int screenWidth, const int screenHeight ) {