=================
DrawPic Questions Section
=================
The DrawPic stuff was just an example. I don’t know when/where you want to change the icon, so that is something you need to figure out.
When you want to draw the new cursor, it will still need to be changed/added with a DrawPic function call same as the way the cursor is drawn in all the other places, and that example displays how to change it. If you use a cvar, the array element you would use would just be the cvarname instead of a number/define, like this (note, again this is just an example):
//original function call in stock source
CG_DrawPic( cgDC.cursorx, cgDC.cursory, 32, 32, cgs.media.cursorIcon );
//modified function call to accomodate custom cursors
CG_DrawPic( cgDC.cursorx, cgDC.cursory, 32, 32, cgs.media.cursorIcon[cvarname.Integer] );
=================
Cvar Creation Section
=================
To create a new cvar, follow this example. In this example, we will create a serverside cvar. Clientside cvars are created exactly the same way as in this example, with the only difference being they are placed in the cgame files. ANyhow, example of a server cvar:
Open the file g_main.c. Locate the section for declaring cvars near the top of the file around line 27, and add this cvar declaration to the rest of them:
vmCvar_t g_anExampleCvar;
Now, in the same file around line 213, just under the cvar variable declarations is an initialization statement (the thing is huge, can’t miss it) for the gameCvarTable variable. Add your cvar appropriately into this table (check out the cvarTable_t structure just above the cvar declarations in the same file if you are unsure of what the proper values should be):
{ &g_anExampleCvar, "g_anExampleCvar", "1", CVAR_ARCHIVE | CVAR_SERVERINFO, 0, qfalse },
Now, 3rd and final step, open the file g_local.h. We need to allow all source files access to this cvar, so we need to make it an extern. Add the following in the extern cvars portion of the code to the rest of them around line 1579:
extern vmCvar_t g_anExampleCvar;
Done, you now have a new cvar.