into SV_Init. This is a hack, however, so someone else please clean this up :)
The VM's internal name now is always "client", so this should make life easier
when debugging (note: this doesn't affect the progs filename used).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6585
d7cf8633-e32d-0410-b094-
e92efae38249
//
// register our commands
//
- Cvar_RegisterVariable (&csqc_progname);
- Cvar_RegisterVariable (&csqc_progcrc);
-
Cvar_RegisterVariable (&cl_upspeed);
Cvar_RegisterVariable (&cl_forwardspeed);
Cvar_RegisterVariable (&cl_backspeed);
PRVM_Begin;
PRVM_InitProg(PRVM_CLIENTPROG);
+ csqc_mempool = Mem_AllocPool("CSQC", 0, NULL);
+
// allocate the mempools
prog->progs_mempool = Mem_AllocPool(csqc_progname.string, 0, NULL);
prog->headercrc = CL_PROGHEADER_CRC;
prog->edictprivate_size = 0; // no private struct used
- prog->name = csqc_progname.string;
+ prog->name = CL_NAME;
prog->num_edicts = 1;
prog->limit_edicts = CL_MAX_EDICTS;
prog->extensionstring = vm_cl_extensions;
return;
}
- csqc_mempool = Mem_AllocPool("CSQC", 0, NULL);
-
//[515]: optional fields & funcs
CL_VM_FindEdictFieldOffsets();
#ifndef CSPROGS_H
#define CSPROGS_H
+#define CL_NAME "client"
+
#define CL_MAX_EDICTS (1<<12)
#define ENTMASK_ENGINE 1
// number of reserved edicts (allocated from 1)
int reserved_edicts; // [INIT]
-
prvm_edict_t *edicts;
void *edictsfields;
void *edictprivate;
#define PRVM_End prog = 0
#endif
-
//#define PRVM_SAFENAME
#ifndef PRVM_SAFENAME
# define PRVM_NAME (prog->name)
va_end(argptr);
Con_Print(msg);
- PRVM_PrintState();
+ // TODO: either add a cvar/cmd to control the state dumping or replace some of the calls with Con_Printf [9/13/2006 Black]
+ //PRVM_PrintState();
}
static char vm_string_temp[VM_STRINGTEMP_BUFFERS][VM_STRINGTEMP_LENGTH];
static int vm_string_tempindex = 0;
-// TODO: move vm_files and vm_fssearchlist to prvm_prog_t struct
-
+// TODO: (move vm_files and vm_fssearchlist to prvm_prog_t struct)
+// TODO: move vm_files and vm_fssearchlist back [9/13/2006 Black]
char *VM_GetTempString(void)
{
char *s;
*/
void SV_Init (void)
{
+ // init the csqc progs cvars, since they are updated/used by the server code
+ // TODO: fix this since this is a quick hack to make some of [515]'s broken code run ;) [9/13/2006 Black]
+ extern cvar_t csqc_progname;
+ extern cvar_t csqc_progcrc;
+ Cvar_RegisterVariable (&csqc_progname);
+ Cvar_RegisterVariable (&csqc_progcrc);
+
Cmd_AddCommand("sv_saveentfile", SV_SaveEntFile_f, "save map entities to .ent file (to allow external editing)");
Cvar_RegisterVariable (&sv_maxvelocity);
Cvar_RegisterVariable (&sv_gravity);
PRVM_InitProg( PRVM_SERVERPROG );
// allocate the mempools
+ // TODO: move the magic numbers/constants into #defines [9/13/2006 Black]
prog->progs_mempool = Mem_AllocPool("Server Progs", 0, NULL);
prog->builtins = vm_sv_builtins;
prog->numbuiltins = vm_sv_numbuiltins;