#ifndef PROGSVM_H
#define PROGSVM_H
+#include <stddef.h>
+#include "qtypes.h"
+#include "qdefs.h"
+#include "common.h"
+#include "zone.h"
#include "pr_comp.h" // defs shared with qcc
#include "progdefs.h" // generated by program cdefs
#include "clprogdefs.h" // generated by program cdefs
+struct framegroupblend_s;
+struct frameblend_s;
+struct cmd_state_s;
+struct qfile_s;
+
#ifndef DP_SMALLMEMORY
#define PROFILING
#endif
prvm_int_t *ip;
// FIXME: this server pointer really means world, not server
// (it is used by both server qc and client qc, but not menu qc)
- edict_engineprivate_t *server;
+ struct edict_engineprivate_s *server;
// add other private structs as you desire
// new structs have to start with the elements of prvm_edit_private_t
// e.g. a new struct has to either look like this:
//============================================================================
// until this point everything also exists (with the pr_ prefix) in the old vm
- qfile_t *openfiles[PRVM_MAX_OPENFILES];
+ struct qfile_s *openfiles[PRVM_MAX_OPENFILES];
const char * openfiles_origin[PRVM_MAX_OPENFILES];
- fssearch_t *opensearches[PRVM_MAX_OPENSEARCHES];
+ struct fssearch_s *opensearches[PRVM_MAX_OPENSEARCHES];
const char * opensearches_origin[PRVM_MAX_OPENSEARCHES];
- skeleton_t *skeletons[MAX_EDICTS];
- cmd_state_t *console_cmd; // points to the relevant console command interpreter for this vm (&cmd_client or &cmd_server), also used to access cvars
+ struct skeleton_s *skeletons[MAX_EDICTS];
+ struct cmd_state_s *console_cmd; // points to the relevant console command interpreter for this vm (&cmd_client or &cmd_server), also used to access cvars
// buffer for storing all tempstrings created during one invocation of ExecuteProgram
sizebuf_t tempstringsbuf;
// this tracks the last polygonbegin's choice of
// CL_Mesh_CSQC or CL_Mesh_UI for this polygon
- model_t *polygonbegin_model;
+ struct model_s *polygonbegin_model;
// indicates if polygonbegin should be interpreted as 2d
// (clearscene sets this to false, renderscene sets this to true, drawpic
// also sets this to true)
#define PRVM_Free(buffer) Mem_Free(buffer)
void PRVM_Profile (prvm_prog_t *prog, int maxfunctions, double mintime, int sortby);
-void PRVM_Profile_f(cmd_state_t *cmd);
-void PRVM_ChildProfile_f(cmd_state_t *cmd);
-void PRVM_CallProfile_f(cmd_state_t *cmd);
-void PRVM_PrintFunction_f(cmd_state_t *cmd);
+void PRVM_Profile_f(struct cmd_state_s *cmd);
+void PRVM_ChildProfile_f(struct cmd_state_s *cmd);
+void PRVM_CallProfile_f(struct cmd_state_s *cmd);
+void PRVM_PrintFunction_f(struct cmd_state_s *cmd);
void PRVM_PrintState(prvm_prog_t *prog, int stack_index);
void PRVM_Crash(prvm_prog_t *prog);
void PRVM_PrintFunctionStatements(prvm_prog_t *prog, const char *name);
void PRVM_ED_Print(prvm_prog_t *prog, prvm_edict_t *ed, const char *wildcard_fieldname);
-void PRVM_ED_Write(prvm_prog_t *prog, qfile_t *f, prvm_edict_t *ed);
+void PRVM_ED_Write(prvm_prog_t *prog, struct qfile_s *f, prvm_edict_t *ed);
const char *PRVM_ED_ParseEdict(prvm_prog_t *prog, const char *data, prvm_edict_t *ent);
-void PRVM_ED_WriteGlobals(prvm_prog_t *prog, qfile_t *f);
+void PRVM_ED_WriteGlobals(prvm_prog_t *prog, struct qfile_s *f);
void PRVM_ED_ParseGlobals(prvm_prog_t *prog, const char *data);
void PRVM_ED_CallPrespawnFunction(prvm_prog_t *prog, prvm_edict_t *ent);
void PRVM_Init_Exec(prvm_prog_t *prog);
-void PRVM_ED_PrintEdicts_f(cmd_state_t *cmd);
+void PRVM_ED_PrintEdicts_f(struct cmd_state_s *cmd);
void PRVM_ED_PrintNum (prvm_prog_t *prog, int ent, const char *wildcard_fieldname);
const char *PRVM_GetString(prvm_prog_t *prog, int num);
Load a program with LoadProgs
*/
// Load expects to be called right after Reset
-void PRVM_Prog_Init(prvm_prog_t *prog, cmd_state_t *cmd);
-void PRVM_Prog_Load(prvm_prog_t *prog, const char *filename, unsigned char *data, fs_offset_t size, int numrequiredfunc, const char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, prvm_required_field_t *required_global);
+void PRVM_Prog_Init(prvm_prog_t *prog, struct cmd_state_s *cmd);
+void PRVM_Prog_Load(prvm_prog_t *prog, const char *filename, unsigned char *data, int64_t size, int numrequiredfunc, const char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, prvm_required_field_t *required_global);
void PRVM_Prog_Reset(prvm_prog_t *prog);
void PRVM_StackTrace(prvm_prog_t *prog);
void VM_Warning(prvm_prog_t *prog, const char *fmt, ...) DP_FUNC_PRINTF(2);
-void VM_GenerateFrameGroupBlend(prvm_prog_t *prog, framegroupblend_t *framegroupblend, const prvm_edict_t *ed);
-void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroupblend_t *framegroupblend, const model_t *model, double curtime);
-void VM_UpdateEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed, const model_t *edmodel, const frameblend_t *frameblend);
+void VM_GenerateFrameGroupBlend(prvm_prog_t *prog, struct framegroupblend_s *framegroupblend, const prvm_edict_t *ed);
+void VM_FrameBlendFromFrameGroupBlend(struct frameblend_s *frameblend, const struct framegroupblend_s *framegroupblend, const struct model_s *model, double curtime);
+void VM_UpdateEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed, const struct model_s *edmodel, const struct frameblend_s *frameblend);
void VM_RemoveEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed);
void PRVM_ExplicitCoverageEvent(prvm_prog_t *prog, mfunction_t *func, int statement);