1
0
Fork 0
forked from fte/fteqw

menu.dat works! yay!

And a couple of bug fixes too.


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@927 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-03-28 07:05:38 +00:00
parent 36b239f0cf
commit 6f5a1247e8
11 changed files with 40 additions and 39 deletions

View file

@ -364,9 +364,10 @@ void M_Menu_Particles_f (void)
menu->selecteditem = (union menuoption_s *) menu->selecteditem = (union menuoption_s *)
MC_AddConsoleCommand(menu, 16, y, " Choose particle set", "menu_particleset");y+=8;
MC_AddCheckBox(menu, 16, y, " sparks bounce", &r_bouncysparks,0);y+=8; MC_AddCheckBox(menu, 16, y, " sparks bounce", &r_bouncysparks,0);y+=8;
// MC_AddSlider(menu, 16, y, " exp spark count", &r_particles_in_explosion, 16, 1024);y+=8; // MC_AddSlider(menu, 16, y, " exp spark count", &r_particles_in_explosion, 16, 1024);y+=8;
MC_AddCvarCombo(menu, 16, y, " rain effect", &r_part_rain, r_part_rain_options, r_part_rain_values);y+=8; MC_AddCvarCombo(menu, 16, y, " texture emittance", &r_part_rain, r_part_rain_options, r_part_rain_values);y+=8;
#ifdef RGLQUAKE #ifdef RGLQUAKE
if (qrenderer == QR_OPENGL) //sw doesn't have these. if (qrenderer == QR_OPENGL) //sw doesn't have these.

View file

@ -136,11 +136,11 @@ csqcedict_t *csqc_edicts; //consider this 'world'
void CSQC_InitFields(void) void CSQC_InitFields(void)
{ //CHANGING THIS FUNCTION REQUIRES CHANGES TO csqcentvars_t { //CHANGING THIS FUNCTION REQUIRES CHANGES TO csqcentvars_t
#define fieldfloat(name) PR_RegisterFieldVar(csqcprogs, ev_float, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) #define fieldfloat(name) PR_RegisterFieldVar(csqcprogs, ev_float, #name, (int)&((csqcentvars_t*)0)->name, -1)
#define fieldvector(name) PR_RegisterFieldVar(csqcprogs, ev_vector, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) #define fieldvector(name) PR_RegisterFieldVar(csqcprogs, ev_vector, #name, (int)&((csqcentvars_t*)0)->name, -1)
#define fieldentity(name) PR_RegisterFieldVar(csqcprogs, ev_entity, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) #define fieldentity(name) PR_RegisterFieldVar(csqcprogs, ev_entity, #name, (int)&((csqcentvars_t*)0)->name, -1)
#define fieldstring(name) PR_RegisterFieldVar(csqcprogs, ev_string, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) #define fieldstring(name) PR_RegisterFieldVar(csqcprogs, ev_string, #name, (int)&((csqcentvars_t*)0)->name, -1)
#define fieldfunction(name) PR_RegisterFieldVar(csqcprogs, ev_function, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) #define fieldfunction(name) PR_RegisterFieldVar(csqcprogs, ev_function, #name, (int)&((csqcentvars_t*)0)->name, -1)
csqcfields csqcfields
#undef fieldfloat #undef fieldfloat
#undef fieldvector #undef fieldvector
@ -339,6 +339,7 @@ static void PF_R_AddEntity(progfuncs_t *prinst, struct globalvars_s *pr_globals)
ent.alpha = in->v->alpha; ent.alpha = in->v->alpha;
ent.scale = in->v->scale; ent.scale = in->v->scale;
ent.skinnum = in->v->skin;
V_AddEntity(&ent); V_AddEntity(&ent);
} }
@ -1297,7 +1298,7 @@ qboolean CSQC_Init (unsigned int checksum)
csqcprogparms.printf = (void *)Con_Printf;//Con_Printf;//void (*printf) (char *, ...); csqcprogparms.printf = (void *)Con_Printf;//Con_Printf;//void (*printf) (char *, ...);
csqcprogparms.Sys_Error = Sys_Error; csqcprogparms.Sys_Error = Sys_Error;
csqcprogparms.Abort = CSQC_Abort; csqcprogparms.Abort = CSQC_Abort;
csqcprogparms.edictsize = sizeof(csqcedict_t)-sizeof(csqcentvars_t); csqcprogparms.edictsize = sizeof(csqcedict_t);
csqcprogparms.entspawn = NULL;//void (*entspawn) (struct edict_s *ent); //ent has been spawned, but may not have all the extra variables (that may need to be set) set csqcprogparms.entspawn = NULL;//void (*entspawn) (struct edict_s *ent); //ent has been spawned, but may not have all the extra variables (that may need to be set) set
csqcprogparms.entcanfree = NULL;//bool (*entcanfree) (struct edict_s *ent); //return true to stop ent from being freed csqcprogparms.entcanfree = NULL;//bool (*entcanfree) (struct edict_s *ent); //return true to stop ent from being freed

View file

@ -773,12 +773,12 @@ static void PF_Remove_ (progfuncs_t *prinst, struct globalvars_s *pr_globals)
static void PF_CopyEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) static void PF_CopyEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
void *in, *out; menuedict_t *in, *out;
in = G_EDICT(prinst, OFS_PARM0); in = (menuedict_t*)G_EDICT(prinst, OFS_PARM0);
out = G_EDICT(prinst, OFS_PARM1); out = (menuedict_t*)G_EDICT(prinst, OFS_PARM1);
memcpy((char*)out+prinst->parms->edictsize, (char*)in+prinst->parms->edictsize, menuentsize-prinst->parms->edictsize); memcpy(out->fields, in->fields, menuentsize);
} }
void PF_gethostcachevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_gethostcachevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals)
@ -865,63 +865,61 @@ void PF_menu_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
int i, f; int i, f;
char *s, *t; char *s, *t;
edict_t *ent, *chain; //note, all edicts share the common header, but don't use it's fields! menuedict_t *ent, *chain; //note, all edicts share the common header, but don't use it's fields!
eval_t *val; eval_t *val;
chain = (edict_t *) *prinst->parms->sv_edicts; chain = (menuedict_t *) *prinst->parms->sv_edicts;
f = G_INT(OFS_PARM0)+prinst->fieldadjust; f = G_INT(OFS_PARM0)+prinst->fieldadjust;
f += prinst->parms->edictsize/4;
s = PR_GetStringOfs(prinst, OFS_PARM1); s = PR_GetStringOfs(prinst, OFS_PARM1);
for (i = 1; i < *prinst->parms->sv_num_edicts; i++) for (i = 1; i < *prinst->parms->sv_num_edicts; i++)
{ {
ent = EDICT_NUM(prinst, i); ent = (menuedict_t *)EDICT_NUM(prinst, i);
if (ent->isfree) if (ent->isfree)
continue; continue;
t = *(string_t *)&((float*)ent)[f] + prinst->stringtable; t = *(string_t *)&((float*)ent->fields)[f] + prinst->stringtable;
if (!t) if (!t)
continue; continue;
if (strcmp(t, s)) if (strcmp(t, s))
continue; continue;
val = prinst->GetEdictFieldValue(prinst, ent, "chain", NULL); val = prinst->GetEdictFieldValue(prinst, (void*)ent, "chain", NULL);
if (val) if (val)
val->edict = EDICT_TO_PROG(prinst, chain); val->edict = EDICT_TO_PROG(prinst, (void*)chain);
chain = ent; chain = ent;
} }
RETURN_EDICT(prinst, chain); RETURN_EDICT(prinst, (void*)chain);
} }
//entity findchainfloat(.float _field, float match) = #27; //entity findchainfloat(.float _field, float match) = #27;
void PF_menu_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_menu_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
int i, f; int i, f;
float s; float s;
edict_t *ent, *chain; //note, all edicts share the common header, but don't use it's fields! menuedict_t *ent, *chain; //note, all edicts share the common header, but don't use it's fields!
eval_t *val; eval_t *val;
chain = (edict_t *) *prinst->parms->sv_edicts; chain = (menuedict_t *) *prinst->parms->sv_edicts;
f = G_INT(OFS_PARM0)+prinst->fieldadjust; f = G_INT(OFS_PARM0)+prinst->fieldadjust;
f += prinst->parms->edictsize/4;
s = G_FLOAT(OFS_PARM1); s = G_FLOAT(OFS_PARM1);
for (i = 1; i < *prinst->parms->sv_num_edicts; i++) for (i = 1; i < *prinst->parms->sv_num_edicts; i++)
{ {
ent = EDICT_NUM(prinst, i); ent = (menuedict_t*)EDICT_NUM(prinst, i);
if (ent->isfree) if (ent->isfree)
continue; continue;
if (((float *)ent)[f] != s) if (((float *)ent->fields)[f] != s)
continue; continue;
val = prinst->GetEdictFieldValue(prinst, ent, "chain", NULL); val = prinst->GetEdictFieldValue(prinst, (void*)ent, "chain", NULL);
if (val) if (val)
val->edict = EDICT_TO_PROG(prinst, chain); val->edict = EDICT_TO_PROG(prinst, (void*)chain);
chain = ent; chain = ent;
} }
RETURN_EDICT(prinst, chain); RETURN_EDICT(prinst, (void*)chain);
} }
void PF_etof(progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_etof(progfuncs_t *prinst, struct globalvars_s *pr_globals)
@ -1432,7 +1430,6 @@ void MP_Init (void)
mp_keydown_function = PR_FindFunction(menuprogs, "m_keydown", PR_ANY); mp_keydown_function = PR_FindFunction(menuprogs, "m_keydown", PR_ANY);
mp_keyup_function = PR_FindFunction(menuprogs, "m_keyup", PR_ANY); mp_keyup_function = PR_FindFunction(menuprogs, "m_keyup", PR_ANY);
mp_toggle_function = PR_FindFunction(menuprogs, "m_toggle", PR_ANY); mp_toggle_function = PR_FindFunction(menuprogs, "m_toggle", PR_ANY);
if (mp_init_function) if (mp_init_function)
PR_ExecuteProgram(menuprogs, mp_init_function); PR_ExecuteProgram(menuprogs, mp_init_function);
inmenuprogs--; inmenuprogs--;

View file

@ -56,10 +56,10 @@ IDD_DIALOG1 DIALOGEX 0, 0, 67, 40
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP |
WS_VISIBLE WS_VISIBLE
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE
FONT 16, "Times New Roman", 0, 0, 0x1 FONT 16, "Times New Roman"
BEGIN BEGIN
CTEXT "FTE QuakeWorld",IDC_STATIC,0,0,67,21,SS_CENTERIMAGE CTEXT "FTE QuakeWorld",IDC_STATIC,0,0,67,21,SS_CENTERIMAGE
CTEXT "http://fte.quakesrc.org",IDC_STATIC,0,23,66,17, CTEXT "http://fteqw.sf.net",IDC_STATIC,0,23,66,17,
SS_CENTERIMAGE SS_CENTERIMAGE
END END

View file

@ -42,7 +42,7 @@ void Cache_FreeHigh (int new_high_hunk);
//must be multiple of 4. //must be multiple of 4.
#define TEMPDEBUG 4 #define TEMPDEBUG 4
#define ZONEDEBUG 4 #define ZONEDEBUG 64
#define HUNKDEBUG 4 #define HUNKDEBUG 4
#define CACHEDEBUG 4 #define CACHEDEBUG 4
@ -221,7 +221,7 @@ void BZ_CheckSentinals(void *c)
#endif #endif
} }
/* //revive this function each time you get memory corruption and need to trace it. //revive this function each time you get memory corruption and need to trace it.
void BZ_CheckAllSentinals(void) void BZ_CheckAllSentinals(void)
{ {
zone_t *zone; zone_t *zone;
@ -245,7 +245,7 @@ void BZ_CheckAllSentinals(void)
} }
} }
} }
*/
void VARGS Z_FreeTags(int tag) void VARGS Z_FreeTags(int tag)
{ {

View file

@ -580,7 +580,7 @@ char *PR_UglyValueString (progfuncs_t *progfuncs, etype_t type, eval_t *val)
sprintf (line, "unions cannot yet be saved"); sprintf (line, "unions cannot yet be saved");
break; break;
case ev_string: case ev_string:
sprintf (line, "%s", val->string+progfuncs->stringtable); _snprintf (line, sizeof(line), "%s", val->string+progfuncs->stringtable);
break; break;
case ev_entity: case ev_entity:
sprintf (line, "%i", NUM_FOR_EDICT(progfuncs, (struct edict_s *)PROG_TO_EDICT(progfuncs, val->edict))); sprintf (line, "%i", NUM_FOR_EDICT(progfuncs, (struct edict_s *)PROG_TO_EDICT(progfuncs, val->edict)));

View file

@ -4981,6 +4981,7 @@ void PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals)
(*prinst->pr_trace) = 1; (*prinst->pr_trace) = 1;
return; return;
} }
((int *)s)[0] = 0xabcd1234;
Z_Free(s); Z_Free(s);
} }
void PF_strlen(progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_strlen(progfuncs_t *prinst, struct globalvars_s *pr_globals)
@ -6363,7 +6364,7 @@ static void PF_copyentity (progfuncs_t *prinst, struct globalvars_s *pr_globals)
in = G_EDICT(prinst, OFS_PARM0); in = G_EDICT(prinst, OFS_PARM0);
out = G_EDICT(prinst, OFS_PARM1); out = G_EDICT(prinst, OFS_PARM1);
memcpy(&out->v, &in->v, pr_edict_size-prinst->parms->edictsize); memcpy(out->v, in->v, pr_edict_size);
SV_LinkEdict(out, false); SV_LinkEdict(out, false);
} }

View file

@ -2601,6 +2601,7 @@ void ED_ClearEdict (progfuncs_t *progfuncs, edict_t *e);
void SetUpClientEdict (client_t *cl, edict_t *ent) void SetUpClientEdict (client_t *cl, edict_t *ent)
{ {
extern int pr_teamfield; extern int pr_teamfield;
if (progstype != PROG_NQ) //allow frikbots to work in NQ mods (but not qw!)
ED_ClearEdict(svprogfuncs, ent); ED_ClearEdict(svprogfuncs, ent);
ED_Spawned(ent); ED_Spawned(ent);
ent->isfree = false; ent->isfree = false;