mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
final commit
This commit is contained in:
parent
1712cd4f47
commit
ec82ee1ea1
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
@ -1086,4 +1087,4 @@ bool Tesselator::hasMaxVertices()
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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"";
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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"";
|
||||||
|
|
@ -45,4 +51,4 @@ std::wstring Language::getElementName(const std::wstring& elementId)
|
||||||
std::wstring Language::getElementDescription(const std::wstring& elementId)
|
std::wstring Language::getElementDescription(const std::wstring& elementId)
|
||||||
{
|
{
|
||||||
return elementId;
|
return elementId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ 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);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
7
debug.sh
7
debug.sh
|
|
@ -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
7
run.sh
|
|
@ -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 ../..
|
|
||||||
Loading…
Reference in a new issue