final commit

This commit is contained in:
Nikita Edel 2026-03-11 19:22:28 +01:00
parent 1712cd4f47
commit ec82ee1ea1
7 changed files with 20 additions and 26 deletions

View file

@ -1049,9 +1049,10 @@ void Tesselator::normal(float x, float y, float z)
int8_t zz = (int8_t) (z * 127); int8_t zz = (int8_t) (z * 127);
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
#else #else
uint8_t xx = (uint8_t) (x * 127); // 4jcraft copied the PSVITA branch, read comment above
uint8_t yy = (uint8_t) (y * 127); int8_t xx = (int8_t) (x * 127);
uint8_t zz = (uint8_t) (z * 127); int8_t yy = (int8_t) (y * 127);
int8_t zz = (int8_t) (z * 127);
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
#endif #endif
} }

View file

@ -3,7 +3,8 @@
#include "I18n.h" #include "I18n.h"
Language *I18n::lang = Language::getInstance(); Language *I18n::lang = Language::getInstance();
std::wstring I18n::get(const std::wstring& id, ...) // 4jcraft const & into va_start is ub
std::wstring I18n::get(std::wstring id, ...)
{ {
#ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway #ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway
return L""; return L"";

View file

@ -10,6 +10,6 @@ private:
static Language *lang; static Language *lang;
public: public:
static std::wstring get(const std::wstring& id, ...); static std::wstring get(std::wstring id, ...);
static std::wstring get(const std::wstring& id, va_list args); static std::wstring get(const std::wstring& id, va_list args);
}; };

View file

@ -3,7 +3,7 @@
// 4J - TODO - properly implement // 4J - TODO - properly implement
Language *Language::singleton = new Language(); Language *Language::singleton = nullptr;
Language::Language() Language::Language()
{ {
@ -11,6 +11,11 @@ Language::Language()
Language *Language::getInstance() Language *Language::getInstance()
{ {
// 4jcraft, fixes static init fiassco in I18n.cpp
if(singleton == nullptr) {
singleton = new Language();
}
return singleton; return singleton;
} }
@ -20,7 +25,8 @@ std::wstring Language::getElement(const std::wstring& elementId)
return elementId; return elementId;
} */ } */
std::wstring Language::getElement(const std::wstring& elementId, ...) // 4jcraft changed, again const reference into va_start, std forbids
std::wstring Language::getElement(std::wstring elementId, ...)
{ {
#ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway #ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway
return L""; return L"";

View file

@ -7,7 +7,7 @@ private:
public: public:
Language(); Language();
static Language *getInstance(); static Language *getInstance();
std::wstring getElement(const std::wstring& elementId, ...); std::wstring getElement(std::wstring elementId, ...);
std::wstring getElement(const std::wstring& elementId, va_list args); std::wstring getElement(const std::wstring& elementId, va_list args);
std::wstring getElementName(const std::wstring& elementId); std::wstring getElementName(const std::wstring& elementId);
std::wstring getElementDescription(const std::wstring& elementId); std::wstring getElementDescription(const std::wstring& elementId);

View file

@ -1,7 +0,0 @@
#!/bin/bash
meson setup build -Db_sanitize=address,leak,undefined -Dcpp_args=-fno-sanitize-recover=all -Dc_args=-fno-sanitize-recover=all && \
meson compile -C build && \
cd build/Minecraft.Client/ && \
gdb -tui ./Minecraft.Client && \
cd ../..

7
run.sh
View file

@ -1,7 +0,0 @@
#!/bin/bash
meson setup build -Db_sanitize=address,leak,undefined -Dcpp_args=-fno-sanitize-recover=all -Dc_args=-fno-sanitize-recover=all && \
meson compile -C build && \
cd build/Minecraft.Client/ && \
UBSAN_OPTIONS=print_stacktrace=1 ./Minecraft.Client && \
cd ../..