From 117c484183db34f8e5511f3b207b989d2f561a8c Mon Sep 17 00:00:00 2001 From: JKSunny <60109631+jksunny@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:18:17 +0800 Subject: [PATCH] Renderers: Replace PATCH_STITCHING preprocessor define with r_patchStitching cvar Cherrypicked: (https://github.com/JACoders/OpenJK/commit/540edeb67fd65cd08642fe4d324e3e49101755a4) Pull request: (https://github.com/JACoders/OpenJK/pull/1199) Co-Authored-By: razor <844370+razish@users.noreply.github.com> (cherry picked from commit 3ae2bbda774703b74d361272d13f8a056ee55149) --- codemp/rd-dedicated/tr_init.cpp | 5 +---- codemp/rd-vanilla/tr_bsp.cpp | 4 ++-- codemp/rd-vanilla/tr_init.cpp | 2 +- codemp/rd-vanilla/tr_local.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/codemp/rd-dedicated/tr_init.cpp b/codemp/rd-dedicated/tr_init.cpp index c3e37d455f..82304484c3 100644 --- a/codemp/rd-dedicated/tr_init.cpp +++ b/codemp/rd-dedicated/tr_init.cpp @@ -211,8 +211,7 @@ Ghoul2 Insert End cvar_t *r_aviMotionJpegQuality; cvar_t *r_screenshotJpegQuality; - -cvar_t *r_patchStitching; +cvar_t *r_patchStitching; /* ** R_GetModeInfo @@ -455,9 +454,7 @@ Ghoul2 Insert Start /* Ghoul2 Insert End */ - r_patchStitching = ri.Cvar_Get("r_patchStitching", "1", CVAR_ARCHIVE, "Enable stitching of neighbouring patch surfaces" ); - r_modelpoolmegs = ri.Cvar_Get("r_modelpoolmegs", "20", CVAR_ARCHIVE, "" ); if (ri.Sys_LowPhysicalMemory() ) ri.Cvar_Set("r_modelpoolmegs", "0"); diff --git a/codemp/rd-vanilla/tr_bsp.cpp b/codemp/rd-vanilla/tr_bsp.cpp index 59bbed12c0..9b833c4fd9 100644 --- a/codemp/rd-vanilla/tr_bsp.cpp +++ b/codemp/rd-vanilla/tr_bsp.cpp @@ -1393,13 +1393,13 @@ static void R_LoadSurfaces( lump_t *surfs, lump_t *verts, lump_t *indexLump, wor } if ( r_patchStitching->integer ) { - R_StitchAllPatches(worldData); + R_StitchAllPatches( worldData ); } R_FixSharedVertexLodError(worldData); if ( r_patchStitching->integer ) { - R_MovePatchSurfacesToHunk(worldData); + R_MovePatchSurfacesToHunk( worldData ); } ri.Printf( PRINT_ALL, "...loaded %d faces, %i meshes, %i trisurfs, %i flares\n", numFaces, numMeshes, numTriSurfs, numFlares ); diff --git a/codemp/rd-vanilla/tr_init.cpp b/codemp/rd-vanilla/tr_init.cpp index 9759c3160a..2fd1284172 100644 --- a/codemp/rd-vanilla/tr_init.cpp +++ b/codemp/rd-vanilla/tr_init.cpp @@ -220,7 +220,7 @@ cvar_t *se_language; cvar_t *r_aviMotionJpegQuality; cvar_t *r_screenshotJpegQuality; -cvar_t *r_patchStitching; +cvar_t *r_patchStitching; #if !defined(__APPLE__) PFNGLSTENCILOPSEPARATEPROC qglStencilOpSeparate; diff --git a/codemp/rd-vanilla/tr_local.h b/codemp/rd-vanilla/tr_local.h index af22d96d5c..8ca70d7060 100644 --- a/codemp/rd-vanilla/tr_local.h +++ b/codemp/rd-vanilla/tr_local.h @@ -1292,7 +1292,7 @@ extern cvar_t *r_noServerGhoul2; Ghoul2 Insert End */ -extern cvar_t *r_patchStitching; +extern cvar_t *r_patchStitching; //====================================================================