From what I recall with C is that a define is basically a constant so you have to provide it with a literal value rather than trying to assign it with the value of some other variable.
Maybe if this become an global int (since this is only ever really going to be the values of 256, 512 or 1024 realistically) and then replace the instances of TRACEMAP_SIZE with the new int variable throughout the whole of bg_tracemap.c. This is all from my pretty bad memory of C which I havn’t done anything with for about five or so years now.
should look something like:
int itracemap_size;
typedef struct tracemap_s {
qboolean loaded;
float sky[itracemap_size][itracemap_size];
float skyground[itracemap_size][itracemap_size];
float ground[itracemap_size][itracemap_size];
vec2_t world_mins, world_maxs;
int groundfloor, groundceil;
} tracemap_t;
…
Then in the CG_GenerateTracemap method, where the code reads:
// Topdown tracing
CG_Printf( "Generating level heightmap and level mask…
" );
memset( &tracemap, 0, sizeof(tracemap) );
Add before the memset line an additional line that loads the variable itracemap_size with the value of the new CVAR which would needto be setup. The new CVAR could then be set via the ui menu I have played with so that as you try to create a tracemap of size X, it first sets the CVAR to size X and then executes the generatetracemap method.
Let me know if this makes sense. PM me if you want to try and work this out together since I think this is really useful. I generated a 1024 tracemap for Stalingrad and wish i had this when I mad the command map for Shadowstorm since I can actuall see the detail