Skip to content

Commit 04fce6d

Browse files
committed
fix for for mediump, enable mipmaps for low filter settings
1 parent dfdd112 commit 04fce6d

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

src/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define _GAPI_GL 1
3838
#define _GAPI_GLES 1
3939

40-
//#define DYNGEOM_NO_VBO
40+
#define DYNGEOM_NO_VBO
4141
#elif __linux__
4242
#define _OS_LINUX 1
4343
#define _GAPI_GL 1

src/gapi_gl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,8 @@ namespace GAPI {
633633
}
634634

635635
void setFilterQuality(int value) {
636-
bool filter = value > Core::Settings::LOW;
637-
bool mipmaps = value > Core::Settings::MEDIUM;
636+
bool filter = (opt & OPT_NEAREST) == 0 && (value > Core::Settings::LOW);
637+
bool mipmaps = (opt & OPT_MIPMAPS) != 0;
638638

639639
Core::active.textures[0] = NULL;
640640
bind(0);

src/lara.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#define LARA_SWIM_SPEED 50.0f
4040
#define LARA_SWIM_FRICTION 1.0f
4141

42+
#define LARA_MIN_SPECULAR 0.03f
4243
#define LARA_WET_SPECULAR 0.5f
4344
#define LARA_WET_TIMER (LARA_WET_SPECULAR / 16.0f) // 4 sec
4445

@@ -2813,10 +2814,10 @@ struct Lara : Character {
28132814
updateWeapon();
28142815

28152816
if (stand == STAND_UNDERWATER)
2816-
specular = 0.0f;
2817+
specular = LARA_MIN_SPECULAR;
28172818
else
2818-
if (specular > 0.0f)
2819-
specular = max(0.0f, specular - LARA_WET_TIMER * Core::deltaTime);
2819+
if (specular > LARA_MIN_SPECULAR)
2820+
specular = max(LARA_MIN_SPECULAR, specular - LARA_WET_TIMER * Core::deltaTime);
28202821

28212822
if (state == STATE_MIDAS_DEATH || state == STATE_MIDAS_USE) {
28222823
uint32 sparklesMask = getMidasMask();

src/platform/clover/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
set -e
2-
clang++ -std=c++11 -Os -s -g -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
2+
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
33
strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note

src/platform/clover/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ bool sndInit() {
6666
int err;
6767

6868
// In the perfect world ReedPlayer-Clover process
69-
// will release ALSA devicbefore app running, but...
69+
// will release ALSA device before app running, but...
7070
for (int i = 0; i < 20; i++) { // 20 * 0.1 = 2 secs
7171
sndOut = NULL;
7272
if ((err = snd_pcm_open(&sndOut, "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
@@ -581,10 +581,10 @@ LOG("start\n");
581581

582582
inputFree();
583583

584-
//sndFree();
585-
//Game::deinit();
586-
584+
Game::deinit();
587585
eglFree();
588586

587+
sndFree();
588+
589589
return 0;
590590
}

src/shaders/shader.glsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ uniform vec4 uFogParams;
142142
float fog;
143143
#ifdef UNDERWATER
144144
float d;
145-
if (uViewPos.y < uParam.y)
146-
d = abs((coord.y - uParam.y) / normalize(vViewVec.xyz).y);
147-
else
145+
//if (uViewPos.y < uParam.y) // TODO: fix for mediump
146+
// d = abs((coord.y - uParam.y) / normalize(uViewPos.xyz - coord.xyz).y);
147+
//else
148148
d = length(uViewPos.xyz - coord.xyz);
149149
fog = d * WATER_FOG_DIST;
150150
#else
@@ -436,7 +436,7 @@ uniform vec4 uFogParams;
436436
vec3 normal = normalize(vNormal.xyz);
437437

438438
#ifdef TYPE_ENTITY
439-
float rSpecular = uMaterial.z + 0.03;
439+
float rSpecular = uMaterial.z;
440440
#endif
441441

442442
#ifdef OPT_SHADOW

0 commit comments

Comments
 (0)