Move the EndFrame function "pointer" into the sv_funcs struct.

This commit is contained in:
Bill Currie 2010-12-08 21:20:35 +09:00
parent 33d768ba73
commit 9b9fde244b
3 changed files with 5 additions and 6 deletions

View file

@ -84,6 +84,8 @@ typedef struct {
func_t ClientDisconnect;
func_t SetNewParms;
func_t SetChangeParms;
func_t EndFrame;
} sv_funcs_t;
extern sv_funcs_t sv_funcs;
@ -203,7 +205,6 @@ extern sv_fields_t sv_fields;
#define SVvector(e,f) SVFIELD (e, f, vector)
#define SVinteger(e,f) SVFIELD (e, f, integer)
extern func_t EndFrame;
extern progs_t sv_pr_state;
static inline void

View file

@ -805,11 +805,11 @@ SV_Physics (void)
if (*sv_globals.force_retouch)
(*sv_globals.force_retouch)--;
if (EndFrame) {
if (sv_funcs.EndFrame) {
// let the progs know that the frame has ended
*sv_globals.self = EDICT_TO_PROG (&sv_pr_state, sv.edicts);
*sv_globals.other = EDICT_TO_PROG (&sv_pr_state, sv.edicts);
*sv_globals.time = sv.time;
PR_ExecuteProgram (&sv_pr_state, EndFrame);
PR_ExecuteProgram (&sv_pr_state, sv_funcs.EndFrame);
}
}

View file

@ -71,8 +71,6 @@ cvar_t *saved2;
cvar_t *saved3;
cvar_t *saved4;
func_t EndFrame;
static int sv_range;
static unsigned
@ -316,7 +314,7 @@ static sv_def_t nq_opt_defs[] = {
};
static sv_def_t nq_opt_funcs[] = {
{ev_func, 0, "EndFrame", &EndFrame},
{ev_func, 0, "EndFrame", &sv_funcs.EndFrame},
{ev_void, 0, 0},
};