mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-14 15:51:26 +00:00
Some ktx fixups.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5870 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
2657dce9c8
commit
1e2b0cdb18
4 changed files with 47 additions and 24 deletions
|
@ -10293,27 +10293,36 @@ void SV_SetEntityButtons(edict_t *ent, unsigned int buttonbits)
|
||||||
|
|
||||||
static void SV_SetSSQCInputs(usercmd_t *ucmd)
|
static void SV_SetSSQCInputs(usercmd_t *ucmd)
|
||||||
{
|
{
|
||||||
pr_global_struct->input_timelength = ucmd->msec/1000.0f * sv.gamespeed;
|
if (pr_global_ptrs->input_timelength)
|
||||||
pr_global_struct->input_impulse = ucmd->impulse;
|
pr_global_struct->input_timelength = ucmd->msec/1000.0f * sv.gamespeed;
|
||||||
|
if (pr_global_ptrs->input_impulse)
|
||||||
|
pr_global_struct->input_impulse = ucmd->impulse;
|
||||||
//precision inaccuracies. :(
|
//precision inaccuracies. :(
|
||||||
#define ANGLE2SHORT(x) (x) * (65536/360.0)
|
#define ANGLE2SHORT(x) (x) * (65536/360.0)
|
||||||
if (sv_player->v->fixangle)
|
if (pr_global_ptrs->input_angles)
|
||||||
{
|
{
|
||||||
(pr_global_struct->input_angles)[0] = sv_player->v->v_angle[0];
|
if (sv_player->v->fixangle)
|
||||||
(pr_global_struct->input_angles)[1] = sv_player->v->v_angle[1];
|
{
|
||||||
(pr_global_struct->input_angles)[2] = sv_player->v->v_angle[2];
|
(pr_global_struct->input_angles)[0] = sv_player->v->v_angle[0];
|
||||||
}
|
(pr_global_struct->input_angles)[1] = sv_player->v->v_angle[1];
|
||||||
else
|
(pr_global_struct->input_angles)[2] = sv_player->v->v_angle[2];
|
||||||
{
|
}
|
||||||
(pr_global_struct->input_angles)[0] = SHORT2ANGLE(ucmd->angles[0]);
|
else
|
||||||
(pr_global_struct->input_angles)[1] = SHORT2ANGLE(ucmd->angles[1]);
|
{
|
||||||
(pr_global_struct->input_angles)[2] = SHORT2ANGLE(ucmd->angles[2]);
|
(pr_global_struct->input_angles)[0] = SHORT2ANGLE(ucmd->angles[0]);
|
||||||
|
(pr_global_struct->input_angles)[1] = SHORT2ANGLE(ucmd->angles[1]);
|
||||||
|
(pr_global_struct->input_angles)[2] = SHORT2ANGLE(ucmd->angles[2]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(pr_global_struct->input_movevalues)[0] = ucmd->forwardmove;
|
if (pr_global_ptrs->input_movevalues)
|
||||||
(pr_global_struct->input_movevalues)[1] = ucmd->sidemove;
|
{
|
||||||
(pr_global_struct->input_movevalues)[2] = ucmd->upmove;
|
(pr_global_struct->input_movevalues)[0] = ucmd->forwardmove;
|
||||||
pr_global_struct->input_buttons = ucmd->buttons;
|
(pr_global_struct->input_movevalues)[1] = ucmd->sidemove;
|
||||||
|
(pr_global_struct->input_movevalues)[2] = ucmd->upmove;
|
||||||
|
}
|
||||||
|
if (pr_global_ptrs->input_buttons)
|
||||||
|
pr_global_struct->input_buttons = ucmd->buttons;
|
||||||
if (pr_global_ptrs->input_weapon)
|
if (pr_global_ptrs->input_weapon)
|
||||||
pr_global_struct->input_weapon = ucmd->weapon;
|
pr_global_struct->input_weapon = ucmd->weapon;
|
||||||
if (pr_global_ptrs->input_lightlevel)
|
if (pr_global_ptrs->input_lightlevel)
|
||||||
|
|
|
@ -429,11 +429,12 @@ static unsigned int QDECL Q1QVMPF_NumForEdict(pubprogfuncs_t *pf, edict_t *e)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int QDECL Q1QVMPF_EdictToProgs(pubprogfuncs_t *pf, edict_t *e)
|
static int QDECL Q1QVMPF_EdictToProgs(pubprogfuncs_t *pf, edict_t *e)
|
||||||
{
|
{ //sadly ktx still uses byte-offset-from-world :(
|
||||||
return e->entnum*sv.world.edict_size;
|
return e->entnum*sv.world.edict_size;
|
||||||
}
|
}
|
||||||
static edict_t *QDECL Q1QVMPF_ProgsToEdict(pubprogfuncs_t *pf, int num)
|
static edict_t *QDECL Q1QVMPF_ProgsToEdict(pubprogfuncs_t *pf, int num)
|
||||||
{
|
{
|
||||||
|
//sadly ktx still uses byte-offset-from-world :(
|
||||||
if (num % sv.world.edict_size)
|
if (num % sv.world.edict_size)
|
||||||
Con_Printf("Edict To Progs with remainder\n");
|
Con_Printf("Edict To Progs with remainder\n");
|
||||||
num /= sv.world.edict_size;
|
num /= sv.world.edict_size;
|
||||||
|
@ -1062,23 +1063,30 @@ static qintptr_t QVM_SetSpawnParams (void *offset, quintptr_t mask, const qintpt
|
||||||
}
|
}
|
||||||
static qintptr_t QVM_ChangeLevel (void *offset, quintptr_t mask, const qintptr_t *arg)
|
static qintptr_t QVM_ChangeLevel (void *offset, quintptr_t mask, const qintptr_t *arg)
|
||||||
{
|
{
|
||||||
|
const char *arg_mapname = VM_POINTER(arg[0]);
|
||||||
|
// const char *arg_entfilename = VM_POINTER(arg[1]);
|
||||||
|
|
||||||
char newmap[MAX_QPATH];
|
char newmap[MAX_QPATH];
|
||||||
if (sv.mapchangelocked)
|
if (sv.mapchangelocked)
|
||||||
return 0;
|
return 0;
|
||||||
sv.mapchangelocked = true;
|
sv.mapchangelocked = true;
|
||||||
COM_QuotedString(VM_POINTER(arg[0]), newmap, sizeof(newmap), false);
|
COM_QuotedString(arg_mapname, newmap, sizeof(newmap), false);
|
||||||
Cbuf_AddText (va("\nchangelevel %s\n", newmap), RESTRICT_LOCAL);
|
Cbuf_AddText (va("\nchangelevel %s\n", newmap), RESTRICT_LOCAL);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static qintptr_t QVM_ChangeLevel2 (void *offset, quintptr_t mask, const qintptr_t *arg)
|
static qintptr_t QVM_ChangeLevelHub (void *offset, quintptr_t mask, const qintptr_t *arg)
|
||||||
{
|
{
|
||||||
|
const char *arg_mapname = VM_POINTER(arg[0]);
|
||||||
|
// const char *arg_entfile = VM_POINTER(arg[1]);
|
||||||
|
const char *arg_startspot = VM_POINTER(arg[2]);
|
||||||
|
|
||||||
char newmap[MAX_QPATH];
|
char newmap[MAX_QPATH];
|
||||||
char startspot[MAX_QPATH];
|
char startspot[MAX_QPATH];
|
||||||
if (sv.mapchangelocked)
|
if (sv.mapchangelocked)
|
||||||
return 0;
|
return 0;
|
||||||
sv.mapchangelocked = true;
|
sv.mapchangelocked = true;
|
||||||
COM_QuotedString(VM_POINTER(arg[0]), newmap, sizeof(newmap), false);
|
COM_QuotedString(arg_mapname, newmap, sizeof(newmap), false);
|
||||||
COM_QuotedString(VM_POINTER(arg[1]), startspot, sizeof(startspot), false);
|
COM_QuotedString(arg_startspot, startspot, sizeof(startspot), false);
|
||||||
Cbuf_AddText (va("\nchangelevel %s %s\n", newmap, startspot), RESTRICT_LOCAL);
|
Cbuf_AddText (va("\nchangelevel %s %s\n", newmap, startspot), RESTRICT_LOCAL);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1990,7 +1998,7 @@ struct
|
||||||
{
|
{
|
||||||
{"SetExtField", QVM_SetExtField},
|
{"SetExtField", QVM_SetExtField},
|
||||||
{"GetExtField", QVM_GetExtField},
|
{"GetExtField", QVM_GetExtField},
|
||||||
{"ChangeLevel2", QVM_ChangeLevel2}, //with start spot
|
{"ChangeLevelHub", QVM_ChangeLevelHub}, //with start spot
|
||||||
#ifdef WEBCLIENT
|
#ifdef WEBCLIENT
|
||||||
{"URI_Query", QVM_uri_query},
|
{"URI_Query", QVM_uri_query},
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -449,6 +449,7 @@ static int QDECL ShowMapList (const char *name, qofs_t flags, time_t mtime, void
|
||||||
}
|
}
|
||||||
static void SV_MapList_f(void)
|
static void SV_MapList_f(void)
|
||||||
{
|
{
|
||||||
|
//FIXME: maps/mapname#modifier.ent
|
||||||
COM_EnumerateFiles("maps/*.bsp", ShowMapList, "");
|
COM_EnumerateFiles("maps/*.bsp", ShowMapList, "");
|
||||||
COM_EnumerateFiles("maps/*.bsp.gz", ShowMapList, ".bsp.gz");
|
COM_EnumerateFiles("maps/*.bsp.gz", ShowMapList, ".bsp.gz");
|
||||||
COM_EnumerateFiles("maps/*.map", ShowMapList, ".map");
|
COM_EnumerateFiles("maps/*.map", ShowMapList, ".map");
|
||||||
|
@ -481,6 +482,7 @@ static void SV_Map_c(int argn, const char *partial, struct xcommandargcompletion
|
||||||
{
|
{
|
||||||
if (argn == 1)
|
if (argn == 1)
|
||||||
{
|
{
|
||||||
|
//FIXME: maps/mapname#modifier.ent
|
||||||
COM_EnumerateFiles(va("maps/%s*.bsp", partial), CompleteMapList, ctx);
|
COM_EnumerateFiles(va("maps/%s*.bsp", partial), CompleteMapList, ctx);
|
||||||
COM_EnumerateFiles(va("maps/%s*.bsp.gz", partial), CompleteMapListExt, ctx);
|
COM_EnumerateFiles(va("maps/%s*.bsp.gz", partial), CompleteMapListExt, ctx);
|
||||||
COM_EnumerateFiles(va("maps/%s*.map", partial), CompleteMapListExt, ctx);
|
COM_EnumerateFiles(va("maps/%s*.map", partial), CompleteMapListExt, ctx);
|
||||||
|
@ -529,6 +531,10 @@ quake2:
|
||||||
|
|
||||||
quake:
|
quake:
|
||||||
+ is used in certain map names. * cannot be, but $ potentially could be.
|
+ is used in certain map names. * cannot be, but $ potentially could be.
|
||||||
|
|
||||||
|
mvdsv:
|
||||||
|
basemap#modifier.ent files
|
||||||
|
|
||||||
======================
|
======================
|
||||||
*/
|
*/
|
||||||
void SV_Map_f (void)
|
void SV_Map_f (void)
|
||||||
|
@ -628,7 +634,7 @@ void SV_Map_f (void)
|
||||||
sv.mapchangelocked = false;
|
sv.mapchangelocked = false;
|
||||||
|
|
||||||
if (!strcmp(level, "."))
|
if (!strcmp(level, "."))
|
||||||
;//restart current
|
;//restart current - deprecated.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf (expanded, sizeof(expanded), "maps/%s.bsp", level); // this function and the if statement below, is a quake bugfix which stopped a map called "dm6++.bsp" from loading because of the + sign, quake2 map syntax interprets + character as "intro.cin+base1.bsp", to play a cinematic then load a map after
|
snprintf (expanded, sizeof(expanded), "maps/%s.bsp", level); // this function and the if statement below, is a quake bugfix which stopped a map called "dm6++.bsp" from loading because of the + sign, quake2 map syntax interprets + character as "intro.cin+base1.bsp", to play a cinematic then load a map after
|
||||||
|
|
|
@ -3521,7 +3521,7 @@ void SV_SendClientMessages (void)
|
||||||
host_client = c;
|
host_client = c;
|
||||||
sv_player = c->edict;
|
sv_player = c->edict;
|
||||||
SV_PreRunCmd();
|
SV_PreRunCmd();
|
||||||
stepmsec = 12;
|
stepmsec = 13;
|
||||||
cmd.msec = stepmsec;
|
cmd.msec = stepmsec;
|
||||||
|
|
||||||
if (sv_showpredloss.ival)
|
if (sv_showpredloss.ival)
|
||||||
|
|
Loading…
Reference in a new issue