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);
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
#else
uint8_t xx = (uint8_t) (x * 127);
uint8_t yy = (uint8_t) (y * 127);
uint8_t zz = (uint8_t) (z * 127);
// 4jcraft copied the PSVITA branch, read comment above
int8_t xx = (int8_t) (x * 127);
int8_t yy = (int8_t) (y * 127);
int8_t zz = (int8_t) (z * 127);
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
#endif
}
@ -1086,4 +1087,4 @@ bool Tesselator::hasMaxVertices()
#else
return false;
#endif
}
}

View file

@ -3,7 +3,8 @@
#include "I18n.h"
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
return L"";

View file

@ -10,6 +10,6 @@ private:
static Language *lang;
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);
};
};

View file

@ -3,7 +3,7 @@
// 4J - TODO - properly implement
Language *Language::singleton = new Language();
Language *Language::singleton = nullptr;
Language::Language()
{
@ -11,6 +11,11 @@ Language::Language()
Language *Language::getInstance()
{
// 4jcraft, fixes static init fiassco in I18n.cpp
if(singleton == nullptr) {
singleton = new Language();
}
return singleton;
}
@ -20,7 +25,8 @@ std::wstring Language::getElement(const std::wstring& 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
return L"";
@ -45,4 +51,4 @@ std::wstring Language::getElementName(const std::wstring& elementId)
std::wstring Language::getElementDescription(const std::wstring& elementId)
{
return elementId;
}
}

View file

@ -7,8 +7,8 @@ private:
public:
Language();
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 getElementName(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 ../..