From a723c0ad7d3e05dd2d5d316445f0d79ed983775d Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Fri, 16 Oct 2020 22:46:03 +0000 Subject: [PATCH] progsvm.h: Make header compile standalone git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13017 d7cf8633-e32d-0410-b094-e92efae38249 --- progsvm.h | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/progsvm.h b/progsvm.h index 1029c2e1..0b624265 100644 --- a/progsvm.h +++ b/progsvm.h @@ -29,10 +29,20 @@ The code uses void pointers instead. #ifndef PROGSVM_H #define PROGSVM_H +#include +#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 @@ -88,7 +98,7 @@ typedef struct prvm_edict_s 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: @@ -616,12 +626,12 @@ typedef struct prvm_prog_s //============================================================================ // 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; @@ -634,7 +644,7 @@ typedef struct prvm_prog_s // 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) @@ -802,10 +812,10 @@ void PRVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessa #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); @@ -833,10 +843,10 @@ void PRVM_ED_ClearEdict(prvm_prog_t *prog, prvm_edict_t *e); 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); @@ -881,7 +891,7 @@ extern int prvm_type_size[8]; // for consistency : I think a goal of this sub-pr 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); @@ -906,8 +916,8 @@ Set up the fields marked with [INIT] in the prog struct 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); @@ -916,9 +926,9 @@ void PRVM_Watchpoint(prvm_prog_t *prog, int stack_index, const char *text, etype 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); -- 2.39.2