Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
Kolyah35
2026-03-17 21:59:16 +03:00
15 changed files with 488 additions and 18 deletions

View File

@@ -23,6 +23,8 @@
#include "../world/level/storage/LevelStorageSource.h"
#include "../world/level/storage/LevelStorage.h"
#include "player/input/KeyboardInput.h"
#include "player/input/ControllerTurnInput.h"
#include "player/input/XperiaPlayInput.h"
#include "world/level/chunk/ChunkSource.h"
#ifndef STANDALONE_SERVER

View File

@@ -1,5 +1,8 @@
#include "Option.h"
#include <sstream>
#include <cstdio>
Option::~Option() {}
bool Option::parse_bool_like(const std::string& value, bool& out) {
if (value == "true" || value == "YES") {
@@ -23,7 +26,7 @@ bool OptionFloat::parse(const std::string& value) {
return true;
}
return std::sscanf(value.c_str(), "%f", &m_value) == 1;
return sscanf(value.c_str(), "%f", &m_value) == 1;
}
bool OptionInt::parse(const std::string& value) {
bool b;
@@ -32,7 +35,7 @@ bool OptionInt::parse(const std::string& value) {
return true;
}
return std::sscanf(value.c_str(), "%d", &m_value) == 1;
return sscanf(value.c_str(), "%d", &m_value) == 1;
}
bool OptionBool::parse(const std::string& value) {
if (value == "0") {

View File

@@ -21,7 +21,7 @@ template<> struct is_min_max_option<float> : std::true_type {};
class Option {
public:
Option(const std::string& key) : m_key("options." + key) {}
virtual ~Option() = default;
virtual ~Option();
const std::string& getStringId() { return m_key; }

View File

@@ -27,6 +27,7 @@
#include "../../platform/time.h"
#include <cmath>
#include <algorithm>
#include <sstream>
float Gui::InvGuiScale = 1.0f / 3.0f;
float Gui::GuiScale = 1.0f / Gui::InvGuiScale;
@@ -841,7 +842,9 @@ void Gui::renderPlayerList(Font* font, int screenWidth, int screenHeight) {
}
// player count title
std::string titleText = "Players (" + std::to_string(playerNames.size()) + ")";
std::ostringstream titleStream;
titleStream << "Players (" << playerNames.size() << ")";
std::string titleText = titleStream.str();
float titleWidth = font->width(titleText);
if (titleWidth > maxNameWidth)

View File

@@ -350,8 +350,8 @@ void LocalPlayer::calculateFlight(float xa, float ya, float za) {
za = za * flySpeed;
#ifdef ANDROID
if (Keyboard::isKeyDown(103)) ya = .2f * minecraft->options.flySpeed;
if (Keyboard::isKeyDown(102)) ya = -.2f * minecraft->options.flySpeed;
if (Keyboard::isKeyDown(103)) ya = .2f * flySpeed;
if (Keyboard::isKeyDown(102)) ya = -.2f * flySpeed;
#else
if (Keyboard::isKeyDown(Keyboard::KEY_E)) ya = .2f * flySpeed;
if (Keyboard::isKeyDown(Keyboard::KEY_Q)) ya = -.2f * flySpeed;

View File

@@ -4,6 +4,8 @@
//package net.minecraft.client.player;
#include "KeyboardInput.h"
#include "platform/input/Controller.h"
#include "world/entity/player/Player.h"
// @note: This is just copy-pasted from KeyboardInput right now.
class XperiaPlayInput: public KeyboardInput

View File

@@ -655,7 +655,7 @@ void GameRenderer::pick(float a) {
float range = mc->gameMode->getPickRange();
bool isPicking = true;
#ifndef PLATFORM_DESKTOP
bool freeform = mc->useTouchscreen() && !mc->options.isJoyTouchArea;
bool freeform = mc->useTouchscreen() && !mc->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA);
#else
bool freeform = false;
#endif

View File

@@ -25,7 +25,7 @@
#include "platform/input/Mouse.h"
#include "platform/input/Multitouch.h"
#include "EGLConfigPrinter.h"
#include "EglConfigPrinter.h"
const int BroadcastPort = 9991;

View File

@@ -23,7 +23,7 @@
#include "platform/input/Mouse.h"
#include "platform/input/Controller.h"
#include "EGLConfigPrinter.h"
#include "EglConfigPrinter.h"
const int BroadcastPort = 9991;