From bc8737d707595aebd7cc11d6d5a5d65ede750f59 Mon Sep 17 00:00:00 2001 From: James Canete Date: Tue, 20 Jul 2021 13:51:19 -0700 Subject: [PATCH 1/4] OpenGL2: Flip normals for backfacing triangles. https://github.com/ioquake/ioq3/issues/513 --- code/renderergl2/glsl/lightall_fp.glsl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/renderergl2/glsl/lightall_fp.glsl b/code/renderergl2/glsl/lightall_fp.glsl index ff7fc125..28b59eb7 100644 --- a/code/renderergl2/glsl/lightall_fp.glsl +++ b/code/renderergl2/glsl/lightall_fp.glsl @@ -264,7 +264,8 @@ void main() float NL, NH, NE, EH, attenuation; #if defined(USE_LIGHT) && !defined(USE_FAST_LIGHT) - mat3 tangentToWorld = mat3(var_Tangent.xyz, var_Bitangent.xyz, var_Normal.xyz); + vec3 surfNormal = (!gl_FrontFacing ? var_Normal : -var_Normal).xyz; + mat3 tangentToWorld = mat3(var_Tangent.xyz, var_Bitangent.xyz, surfNormal); viewDir = vec3(var_Normal.w, var_Tangent.w, var_Bitangent.w); E = normalize(viewDir); #endif @@ -335,7 +336,7 @@ void main() N.z = sqrt(clamp((0.25 - N.x * N.x) - N.y * N.y, 0.0, 1.0)); N = tangentToWorld * N; #else - N = var_Normal.xyz; + N = surfNormal; #endif N = normalize(N); @@ -361,7 +362,7 @@ void main() #if !defined(USE_LIGHT_VECTOR) ambientColor = lightColor; - float surfNL = clamp(dot(var_Normal.xyz, L), 0.0, 1.0); + float surfNL = clamp(dot(surfNormal, L), 0.0, 1.0); // reserve 25% ambient to avoid black areas on normalmaps lightColor *= 0.75; From 77d6cde137d9dca0ac4f2473d25c278bc65e34d9 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 15 Aug 2021 12:07:02 -0400 Subject: [PATCH 2/4] Fix compiling against SDL 2.0.17 KMOD_RESERVED was replaced with KMOD_SCROLL. --- code/sdl/sdl_input.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/sdl/sdl_input.c b/code/sdl/sdl_input.c index 2ad324e3..63274c61 100644 --- a/code/sdl/sdl_input.c +++ b/code/sdl/sdl_input.c @@ -33,6 +33,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../client/client.h" #include "../sys/sys_local.h" +#if !SDL_VERSION_ATLEAST(2, 0, 17) +#define KMOD_SCROLL KMOD_RESERVED +#endif + static cvar_t *in_keyboardDebug = NULL; static SDL_GameController *gamepad = NULL; @@ -84,7 +88,7 @@ static void IN_PrintKey( const SDL_Keysym *keysym, keyNum_t key, qboolean down ) if( keysym->mod & KMOD_NUM ) Com_Printf( " KMOD_NUM" ); if( keysym->mod & KMOD_CAPS ) Com_Printf( " KMOD_CAPS" ); if( keysym->mod & KMOD_MODE ) Com_Printf( " KMOD_MODE" ); - if( keysym->mod & KMOD_RESERVED ) Com_Printf( " KMOD_RESERVED" ); + if( keysym->mod & KMOD_SCROLL ) Com_Printf( " KMOD_SCROLL" ); Com_Printf( " Q:0x%02x(%s)\n", key, Key_KeynumToString( key ) ); } From 788f29de940714bc79217144dfec8f6d1c7f6897 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 27 Sep 2021 10:56:17 +0100 Subject: [PATCH 3/4] GHA deprecated Ubuntu 16.04 - update to 18.04 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de630b4e..1e8755ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: linux: name: Linux - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Install Dependencies From 26780805c80c597c3c4209234385979d548d8380 Mon Sep 17 00:00:00 2001 From: Adam Mizerski Date: Sat, 25 Sep 2021 13:53:33 +0200 Subject: [PATCH 4/4] qsort cannot be called with NULL resolves #519 --- code/qcommon/files.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 4a94463e..a9f2995a 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -2932,7 +2932,9 @@ void FS_AddGameDirectory( const char *path, const char *dir ) { // Get .pk3 files pakfiles = Sys_ListFiles(curpath, ".pk3", NULL, &numfiles, qfalse); - qsort( pakfiles, numfiles, sizeof(char*), paksort ); + if ( pakfiles ) { + qsort( pakfiles, numfiles, sizeof(char*), paksort ); + } if ( fs_numServerPaks ) { numdirs = 0;