mirror of
https://github.com/XProger/OpenLara.git
synced 2025-02-23 23:14:47 +01:00
RPI build fix, detect language; Clover build fix
This commit is contained in:
parent
3ae71b1106
commit
6076c25ee5
@ -807,7 +807,9 @@ namespace GAPI {
|
||||
glGenerateMipmap(target);
|
||||
if ((opt & (OPT_VOLUME | OPT_CUBEMAP | OPT_NEAREST)) == 0 && (Core::support.maxAniso > 0)) {
|
||||
glTexParameteri(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, min(int(Core::support.maxAniso), 8));
|
||||
#if !defined(_OS_RPI) && !defined(_OS_CLOVER) // TODO
|
||||
glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, 3);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1122,9 +1124,13 @@ namespace GAPI {
|
||||
#ifdef _GAPI_GLES
|
||||
int GLES_VERSION = 1;
|
||||
#if defined(__SDL2__)
|
||||
SDL_GL_GetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, &GLES_VERSION);
|
||||
SDL_GL_GetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, &GLES_VERSION);
|
||||
#else
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &GLES_VERSION);
|
||||
#if defined(_OS_RPI) || defined(_OS_CLOVER)
|
||||
GLES_VERSION = 2;
|
||||
#else
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &GLES_VERSION);
|
||||
#endif
|
||||
#endif
|
||||
GLES3 = GLES_VERSION > 2;
|
||||
#endif
|
||||
|
@ -1,3 +1,3 @@
|
||||
set -e
|
||||
clang++ -std=c++11 -Os -s -g -marm -march=armv7ve -mtune=cortex-a7 -mfloat-abi=hard -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__CLOVER__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -L/opt/vc/lib/ -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev -o../../../bin/OpenLara
|
||||
clang++ -std=c++11 -Os -s -g -marm -march=armv7ve -mtune=cortex-a7 -mfloat-abi=hard -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding -DNDEBUG -D__CLOVER__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -L/opt/vc/lib/ -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev -o../../../bin/OpenLara
|
||||
strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note
|
||||
|
@ -1,3 +1,3 @@
|
||||
set -e
|
||||
clang++ -std=c++11 -Os -s -g -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__RPI__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -o../../../bin/OpenLara -L/opt/vc/lib/ -lbrcmGLESv2 -lbrcmEGL -lX11 -lm -lrt -lpthread -lasound -lbcm_host -ludev
|
||||
clang++ -std=c++11 -Os -s -g -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding -DNDEBUG -D__RPI__ main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -o../../../bin/OpenLara -L/opt/vc/lib/ -lbrcmGLESv2 -lbrcmEGL -lX11 -lm -lrt -lpthread -lasound -lbcm_host -ludev
|
||||
strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note
|
||||
|
@ -469,6 +469,27 @@ void inputUpdate() {
|
||||
|
||||
EGLDisplay display;
|
||||
|
||||
int checkLanguage() {
|
||||
char *lang = getenv("LANG");
|
||||
if (!lang || strlen(lang) < 2) return 0;
|
||||
|
||||
uint16 id;
|
||||
memcpy(&id, lang, 2);
|
||||
|
||||
if (id == TWOCC("en")) return STR_LANG_EN - STR_LANG_EN;
|
||||
if (id == TWOCC("fr")) return STR_LANG_FR - STR_LANG_EN;
|
||||
if (id == TWOCC("de")) return STR_LANG_DE - STR_LANG_EN;
|
||||
if (id == TWOCC("es")) return STR_LANG_ES - STR_LANG_EN;
|
||||
if (id == TWOCC("it")) return STR_LANG_IT - STR_LANG_EN;
|
||||
if (id == TWOCC("pl")) return STR_LANG_PL - STR_LANG_EN;
|
||||
if (id == TWOCC("uk")) return STR_LANG_RU - STR_LANG_EN;
|
||||
if (id == TWOCC("be")) return STR_LANG_RU - STR_LANG_EN;
|
||||
if (id == TWOCC("ru")) return STR_LANG_RU - STR_LANG_EN;
|
||||
if (id == TWOCC("ja")) return STR_LANG_JA - STR_LANG_EN;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
bcm_host_init();
|
||||
|
||||
@ -502,6 +523,8 @@ int main(int argc, char **argv) {
|
||||
timeval t;
|
||||
gettimeofday(&t, NULL);
|
||||
startTime = t.tv_sec;
|
||||
|
||||
Core::defLang = checkLanguage();
|
||||
|
||||
sndInit();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user