Skip to content

Commit

Permalink
replace PATCH_STITCHING preprocessor define with r_patchStitching cvar (
Browse files Browse the repository at this point in the history
  • Loading branch information
Razish authored and taysta committed Feb 10, 2024
1 parent 030d8db commit a8bf4c3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions codemp/rd-rend2/tr_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ cvar_t *cl_ratioFix;

cvar_t *r_patchStitching;

cvar_t *r_patchStitching;

extern void RB_SetGL2D (void);
static void R_Splash()
{
Expand Down
14 changes: 7 additions & 7 deletions shared/rd-rend2/tr_bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2174,8 +2174,8 @@ static void R_CreateWorldVBOs( world_t *worldData )
ri.Printf(PRINT_ALL, "...calculating world VBO %d ( %i verts %i tris )\n", k, numVerts, numIndexes / 3);

// create arrays
verts = (packedVertex_t *)Hunk_AllocateTempMemory(numVerts * sizeof(packedVertex_t));
indexes = (glIndex_t *)Hunk_AllocateTempMemory(numIndexes * sizeof(glIndex_t));
verts = (packedVertex_t *)ri.Hunk_AllocateTempMemory(numVerts * sizeof(packedVertex_t));
indexes = (glIndex_t *)ri.Hunk_AllocateTempMemory(numIndexes * sizeof(glIndex_t));

// set up indices and copy vertices
numVerts = 0;
Expand Down Expand Up @@ -2319,7 +2319,7 @@ static void R_LoadSurfaces( world_t *worldData, lump_t *surfs, lump_t *verts, lu
if ( indexLump->filelen % sizeof(*indexes))
ri.Error (ERR_DROP, "LoadMap: funny lump size in %s",worldData->name);

out = (msurface_t *)Hunk_Alloc ( count * sizeof(*out), h_low );
out = (msurface_t *)ri.Hunk_Alloc ( count * sizeof(*out), h_low );

worldData->surfaces = out;
worldData->numsurfaces = count;
Expand Down Expand Up @@ -2538,7 +2538,7 @@ static void R_LoadNodesAndLeafs (world_t *worldData, lump_t *nodeLump, lump_t *l
numNodes = nodeLump->filelen / sizeof(dnode_t);
numLeafs = leafLump->filelen / sizeof(dleaf_t);

out = (mnode_t *)Hunk_Alloc ( (numNodes + numLeafs) * sizeof(*out), h_low);
out = (mnode_t *)ri.Hunk_Alloc ( (numNodes + numLeafs) * sizeof(*out), h_low);

worldData->nodes = out;
worldData->numnodes = numNodes + numLeafs;
Expand Down Expand Up @@ -2637,7 +2637,7 @@ static void R_LoadMarksurfaces (world_t *worldData, lump_t *l)
if (l->filelen % sizeof(*in))
ri.Error (ERR_DROP, "LoadMap: funny lump size in %s",worldData->name);
count = l->filelen / sizeof(*in);
out = (int *)Hunk_Alloc ( count*sizeof(*out), h_low);
out = (int *)ri.Hunk_Alloc ( count*sizeof(*out), h_low);

worldData->marksurfaces = out;
worldData->nummarksurfaces = count;
Expand Down Expand Up @@ -2666,8 +2666,8 @@ static void R_LoadPlanes( world_t *worldData, lump_t *l ) {
if (l->filelen % sizeof(*in))
ri.Error (ERR_DROP, "LoadMap: funny lump size in %s",worldData->name);
count = l->filelen / sizeof(*in);
out = (cplane_t *)Hunk_Alloc ( count*2*sizeof(*out), h_low);
out = (cplane_t *)ri.Hunk_Alloc ( count*2*sizeof(*out), h_low);

worldData->planes = out;
worldData->numplanes = count;

Expand Down
10 changes: 5 additions & 5 deletions shared/rd-rend2/tr_curve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,21 +386,21 @@ srfBspSurface_t *R_CreateSurfaceGridMesh(int width, int height,
// copy the results out to a grid
size = (width * height - 1) * sizeof( srfVert_t ) + sizeof( *grid );

grid = /*ri.Hunk_Alloc*/ (srfBspSurface_t *)R_Malloc( size, TAG_GRIDMESH );
grid = /*ri.Hunk_Alloc*/ (srfBspSurface_t *)Z_Malloc( size, TAG_GRIDMESH );
Com_Memset(grid, 0, size);

grid->widthLodError = /*ri.Hunk_Alloc*/ (float *)R_Malloc( width * 4, TAG_GRIDMESH );
grid->widthLodError = /*ri.Hunk_Alloc*/ (float *)Z_Malloc( width * 4, TAG_GRIDMESH );
Com_Memcpy( grid->widthLodError, errorTable[0], width * 4 );

grid->heightLodError = /*ri.Hunk_Alloc*/ (float *)R_Malloc( height * 4, TAG_GRIDMESH );
grid->heightLodError = /*ri.Hunk_Alloc*/ (float *)Z_Malloc( height * 4, TAG_GRIDMESH );
Com_Memcpy( grid->heightLodError, errorTable[1], height * 4 );

grid->numIndexes = numIndexes;
grid->indexes = (glIndex_t *)R_Malloc(grid->numIndexes * sizeof(glIndex_t), TAG_GRIDMESH);
grid->indexes = (glIndex_t *)Z_Malloc(grid->numIndexes * sizeof(glIndex_t), TAG_GRIDMESH);
Com_Memcpy(grid->indexes, indexes, numIndexes * sizeof(glIndex_t));

grid->numVerts = (width * height);
grid->verts = (srfVert_t *)R_Malloc(grid->numVerts * sizeof(srfVert_t), TAG_GRIDMESH);
grid->verts = (srfVert_t *)Z_Malloc(grid->numVerts * sizeof(srfVert_t), TAG_GRIDMESH);

grid->width = width;
grid->height = height;
Expand Down

0 comments on commit a8bf4c3

Please sign in to comment.