Fix misc rerelease issues.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6042 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-08-24 06:06:05 +00:00
parent 904fa4ce64
commit da46f65679
14 changed files with 98 additions and 54 deletions

View File

@ -6348,9 +6348,11 @@ static void CL_PrintStandardMessage(char *msgtext, int printlevel)
// print final chunk
Q_strncatz(fullmessage, msgtext, sizeof(fullmessage));
#ifdef HAVE_LEGACY
if (scr_usekfont.ival)
Con_PrintFlags(fullmessage, PFS_FORCEUTF8, 0);
else
#endif
Con_Printf("%s", fullmessage);
}
@ -7438,7 +7440,7 @@ void CLQW_ParseServerMessage (void)
cl.completed_time = cl.gametime;
}
cl.intermissionmode = IM_NQFINALE;
SCR_CenterPrint (destsplit, MSG_ReadString (), false);
SCR_CenterPrint (destsplit, TL_Translate(MSG_ReadString ()), false);
break;
case svc_sellscreen:

View File

@ -2781,8 +2781,6 @@ void Key_WriteBindings (vfsfile_t *f)
void Key_EnsureBinds(void)
{
int i, m;
if (cls.demoplayback)
return;
for (i=0 ; i<=K_AUX16 ; i++)
{
for (m = 0; m < KEY_MODIFIERSTATES; m++)
@ -2818,8 +2816,6 @@ void Key_EnsureBinds(void)
Key_SetBinding ('7', ~0, "impulse 7", RESTRICT_LOCAL);
Key_SetBinding ('8', ~0, "impulse 8", RESTRICT_LOCAL);
Key_SetBinding (K_RSHIFT, ~0, "+speed", RESTRICT_LOCAL);
Menu_Prompt(NULL, NULL, "Configuration missing...\nSetting up some automatic binds..", NULL, NULL, "Okay");
}
/*

View File

@ -975,7 +975,8 @@ struct po_s *PO_Create(void);
void PO_Merge(struct po_s *po, vfsfile_t *file);
const char *PO_GetText(struct po_s *po, const char *msg);
void PO_Close(struct po_s *po);
void TL_Reformat(char *out, size_t outsize, size_t numargs, const char **arg);
const char *TL_Translate(const char *src); //$foo translations.
void TL_Reformat(char *out, size_t outsize, size_t numargs, const char **arg); //"{0} died\n" formatting (with $foo translation, on each arg)
//
// log.c

View File

@ -7591,7 +7591,8 @@ static qboolean check_pext2_infoblobs (extcheck_t *extcheck) {return !!(extchec
static qboolean check_pext2_vrinputs (extcheck_t *extcheck) {return !!(extcheck->pext2 & PEXT2_VRINPUTS);}
//rerelease stomped on things. make sure our earlier extension reports correctly.
static qboolean check_bouncemissile (extcheck_t *extcheck) {return !extcheck->world->remasterlogic/*became 'movetype_gib'*/;}
static qboolean check_notrerelease (extcheck_t *extcheck) {return !extcheck->world->remasterlogic;}
//static qboolean check_rerelease (extcheck_t *extcheck) {return !!extcheck->world->remasterlogic;}
#define NOBI NULL, 0,{NULL},
qc_extension_t QSG_Extensions[] = {
@ -7609,15 +7610,15 @@ qc_extension_t QSG_Extensions[] = {
{"DP_CON_SETA", NULL, 0,{NULL}, "The 'seta' console command exists, like the 'set' command, but also marks the cvar for archiving, allowing it to be written into the user's config. Use this command in your default.cfg file."},
#endif
{"DP_CSQC_ROTATEMOVES"},
{"DP_EF_ADDITIVE"},
{"DP_EF_ADDITIVE", check_notrerelease},
{"DP_ENT_ALPHA", check_pext_trans}, //transparent entites
{"DP_EF_BLUE"}, //hah!! This is QuakeWorld!!!
{"DP_EF_BLUE", check_notrerelease}, //hah!! This is QuakeWorld!!!
{"DP_EF_FULLBRIGHT"}, //Rerouted to hexen2 support.
{"DP_EF_NODEPTHTEST"}, //for cheats
{"DP_EF_NODRAW"}, //implemented by sending it with no modelindex
{"DP_EF_NODRAW", check_notrerelease}, //implemented by sending it with no modelindex
{"DP_EF_NOGUNBOB"}, //nogunbob. sane people should use csqc instead.
{"DP_EF_NOSHADOW"},
{"DP_EF_RED"},
{"DP_EF_RED", check_notrerelease},
{"DP_ENT_COLORMOD", check_pext_colourmod},
{"DP_ENT_CUSTOMCOLORMAP"},
{"DP_ENT_EXTERIORMODELTOCLIENT"},
@ -7638,7 +7639,7 @@ qc_extension_t QSG_Extensions[] = {
{"DP_LIGHTSTYLE_STATICVALUE"},
{"DP_LITSUPPORT"},
{"DP_MONSTERWALK", NULL, 0,{NULL}, "MOVETYPE_WALK is valid on non-player entities. Note that only players receive acceleration etc in line with none/bounce/fly/noclip movetypes on the player, thus you will have to provide your own accelerations (incluing gravity) yourself."},
{"DP_MOVETYPEBOUNCEMISSILE", check_bouncemissile}, //I added the code for hexen2 support.
{"DP_MOVETYPEBOUNCEMISSILE", check_notrerelease}, //I added the code for hexen2 support.
{"DP_MOVETYPEFOLLOW"},
{"DP_QC_ASINACOSATANATAN2TAN", NULL, 5,{"asin", "acos", "atan", "atan2", "tan"}},
{"DP_QC_CHANGEPITCH", NULL, 1,{"changepitch"}},

View File

@ -553,45 +553,46 @@ static void PO_Merge_Rerelease(struct po_s *po, const char *fmt)
}
}
const char *TL_Translate(const char *src)
{
if (*src == '$')
{
if (!com_translations)
{
char lang[64], *h;
vfsfile_t *f = NULL;
com_translations = PO_Create();
PO_Merge_Rerelease(com_translations, "localization/loc_%s.txt");
Q_strncpyz(lang, language.string, sizeof(lang));
while ((h = strchr(lang, '-')))
*h = '_'; //standardise it
if (*lang)
f = FS_OpenVFS(va("localisation/%s.po", lang), "rb", FS_GAME); //long/specific form
if (!f)
{
if ((h = strchr(lang, '_')))
{
*h = 0;
if (*lang)
f = FS_OpenVFS(va("localisation/%s.po", lang), "rb", FS_GAME); //short/general form
}
}
if (f)
PO_Merge(com_translations, f);
}
src = PO_GetText(com_translations, src);
}
return src;
}
void TL_Reformat(char *out, size_t outsize, size_t numargs, const char **arg)
{
const char *fmt;
const char *a;
size_t alen;
for (alen = 0; alen < numargs; alen++)
{
if (*arg[alen] == '$')
{
if (!com_translations)
{
char lang[64], *h;
vfsfile_t *f = NULL;
com_translations = PO_Create();
PO_Merge_Rerelease(com_translations, "localization/loc_%s.txt");
Q_strncpyz(lang, language.string, sizeof(lang));
while ((h = strchr(lang, '-')))
*h = '_'; //standardise it
if (*lang)
f = FS_OpenVFS(va("localisation/%s.po", lang), "rb", FS_GAME); //long/specific form
if (!f)
{
if ((h = strchr(lang, '_')))
{
*h = 0;
if (*lang)
f = FS_OpenVFS(va("localisation/%s.po", lang), "rb", FS_GAME); //short/general form
}
}
if (f)
PO_Merge(com_translations, f);
}
arg[alen] = PO_GetText(com_translations, arg[alen]);
}
}
fmt = (numargs>0&&arg[0])?arg[0]:"";
fmt = TL_Translate(fmt);
outsize--;
while (outsize > 0)
@ -618,7 +619,7 @@ void TL_Reformat(char *out, size_t outsize, size_t numargs, const char **arg)
if (index >= numargs || !arg[index])
a = "";
else
a = arg[index];
a = TL_Translate(arg[index]);
alen = strlen(a);
if (alen > outsize)

View File

@ -108,7 +108,7 @@ typedef struct q2trace_s
#define FL_PARTIALGROUND (1<<10) // not all corners are valid
#define FL_WATERJUMP (1<<11) // player jumping out of water
#define FL_JUMPRELEASED (1<<12)
#define FLRM_ISBOT (1<<13)
//#define FLRE_ISBOT (1<<13)
#define FL_FINDABLE_NONSOLID (1<<14) //a cpqwsv feature
#define FL_MOVECHAIN_ANGLE (1<<15) // hexen2 - when in a move chain, will update the angle
#define FLQW_LAGGEDMOVE (1<<16)

View File

@ -1858,7 +1858,7 @@ void R_GAlias_GenerateBatches(entity_t *e, batch_t **batches)
if (sort < SHADER_SORT_NEAREST)
sort = SHADER_SORT_NEAREST;
}
if (e->flags & RF_NOSHADOW)
if ((e->flags & RF_NOSHADOW) || (clmodel->engineflags & MDLF_NOSHADOWS))
b->flags |= BEF_NOSHADOWS;
b->vbo = NULL;
b->next = batches[sort];

View File

@ -43,6 +43,9 @@ cvar_t temp_lit2support = CVARD("temp_mod_lit2support", "0", "Set to 1 to e
#ifdef SPRMODELS
cvar_t r_sprite_backfacing = CVARD ("r_sprite_backfacing", "0", "Make oriented sprites face backwards relative to their orientation, for compat with q1.");
#endif
#ifdef RTLIGHTS
cvar_t r_noEntityCastShadowList = CVARD ("r_noEntityCastShadowList", "progs/missile.mdl,progs/flame.mdl,progs/flame2.mdl,progs/lavaball.mdl,progs/grenade.mdl,progs/spike.mdl,progs/s_spike.mdl,progs/laser.mdl,progs/lspike.mdl,progs/candle.mdl", "Models in this list will not cast shadows.");
#endif
#ifdef SERVERONLY
cvar_t gl_overbright, gl_specular, gl_load24bit, r_replacemodels, gl_miptexLevel, r_fb_bmodels; //all of these can/should default to 0
cvar_t r_noframegrouplerp = CVARF ("r_noframegrouplerp", "0", CVAR_ARCHIVE);
@ -643,6 +646,9 @@ void Mod_Init (qboolean initial)
Cvar_Register(&temp_lit2support, NULL);
Cvar_Register (&r_meshpitch, "Gamecode");
Cvar_Register (&r_meshroll, "Gamecode");
#ifdef RTLIGHTS
Cvar_Register(&r_noEntityCastShadowList, "Graphical Nicaties");
#endif
Cmd_AddCommandD("sv_saveentfile", Mod_SaveEntFile_f, "Dumps a copy of the map's entities to disk, so that it can be edited and used as a replacement for slightly customised maps.");
Cmd_AddCommandD("mod_showent", Mod_ShowEnt_f, "Allows you to quickly search through a map's entities.");
Cmd_AddCommand("version_modelformats", Mod_PrintFormats_f);
@ -1352,6 +1358,17 @@ model_t *Mod_LoadModel (model_t *mod, enum mlverbosity_e verbose)
{
if (mod->loadstate == MLS_NOTLOADED && *mod->name != '*')
{
#ifdef RTLIGHTS
char *s = strstr(r_noEntityCastShadowList.string, mod->publicname);
COM_AssertMainThread("Mod_LoadModel");
if (s)
{
size_t l = strlen(mod->publicname);
if ((s == r_noEntityCastShadowList.string || s[-1]==',') && (s[l] == 0 || s[l] == ','))
mod->engineflags |= MDLF_NOSHADOWS;
}
#endif
mod->loadstate = MLS_LOADING;
if (verbose == MLV_ERROR || verbose == MLV_WARNSYNC)
COM_InsertWork(WG_LOADER, Mod_LoadModelWorker, mod, NULL, verbose, 0);

View File

@ -208,9 +208,12 @@ m*_t structures are in-memory
#define EF_DIMLIGHT (1<<3)
#define QWEF_FLAG1 (1<<4) //only applies to qw player entities
#define NQEF_NODRAW (1<<4) //so packet entities are free to get this instead
#define REEF_QUADLIGHT (1<<4)
#define QWEF_FLAG2 (1<<5) //only applies to qw player entities
#define NQEF_ADDITIVE (1<<5) //so packet entities are free to get this instead
#define REEF_PENTLIGHT (1<<5)
#define EF_BLUE (1<<6)
#define REEF_CANDLELIGHT (1<<6)
#define EF_RED (1<<7)
#define H2EF_NODRAW (1<<7) //this is going to get complicated... emulated server side.
#define DPEF_NOGUNBOB (1<<8) //viewmodel attachment does not bob. only applies to viewmodelforclient/RF_WEAPONMODEL
@ -1102,7 +1105,7 @@ typedef struct model_s
#define MDLF_BOLT 0x0100 // doesn't produce shadows
#define MDLF_NOTREPLACEMENTS 0x0200 // can be considered a cheat, disable texture replacements
#define MDLF_EZQUAKEFBCHEAT 0x0400 // this is a blatent cheat, one that can disadvantage us fairly significantly if we don't support it.
//#define MDLF_HASBRUSHES 0x0800 // q1bsp has brush info for more precise traceboxes
#define MDLF_NOSHADOWS 0x0800 // do not cast shadows from this entity, ever.
#define MDLF_RECALCULATERAIN 0x1000 // particles changed, recalculate any sky polys
//============================================================================

View File

@ -1182,7 +1182,9 @@ qboolean R_ImportRTLights(const char *entlump)
break;
}
if (radius < 50) //some mappers insist on many tiny lights. such lights can usually get away with no shadows..
if (rerelease)
r_shadow_realtime_world_lightmaps.value = 1;
else if (radius < 50) //some mappers insist on many tiny lights. such lights can usually get away with no shadows..
pflags |= PFLAGS_NOSHADOW;
VectorAdd(origin, originhack, origin);
@ -1767,6 +1769,7 @@ void R_EditLights_DrawInfo(void)
" Specular : %.2f\n"
" NormalMode : %s\n"
"RealTimeMode : %s\n"
" FadeDist : %.0f-%.0f\n"
" Spin : %.0f %.0f %.0f\n"
" Cone : %.0f\n"
" Nearclip : %.0f\n"
@ -1780,6 +1783,7 @@ void R_EditLights_DrawInfo(void)
,((dl->flags&LFLAG_NOSHADOWS)?"no":"yes"), dl->cubemapname, dl->coronascale
,dl->lightcolourscales[0], dl->lightcolourscales[1], dl->lightcolourscales[2]
,((dl->flags&LFLAG_NORMALMODE)?"yes":"no"), ((dl->flags&LFLAG_REALTIMEMODE)?"yes":"no")
,dl->fade[0], dl->fade[1]
,dl->rotation[0],dl->rotation[1],dl->rotation[2], dl->fov, dl->nearclip
//,((dl->flags&LFLAG_SHADOWMAP)?"no":"yes"),((dl->flags&LFLAG_CREPUSCULAR)?"yes":"no"),((dl->flags&LFLAG_ORTHO)?"yes":"no")
);
@ -1789,7 +1793,7 @@ void R_EditLights_DrawInfo(void)
R2D_ImageColours(0,0,0,.35);
R2D_FillBlock(x-4, y, 320+4, 16*8+4);
R2D_ImageColours(1,1,1,1);
R_DrawTextField(x, y, 320, 16*8, s, CON_WHITEMASK, CPRINT_LALIGN|CPRINT_TALIGN|CPRINT_NOWRAP, font_default, fontscale);
R_DrawTextField(x, y, 320, 19*8, s, CON_WHITEMASK, CPRINT_LALIGN|CPRINT_TALIGN|CPRINT_NOWRAP, font_default, fontscale);
}
void R_EditLights_DrawLights(void)
{

View File

@ -4110,7 +4110,7 @@ void Sh_DrawLights(qbyte *vis)
continue;
if (dist > dl->fade[0])
{
dist = (dist-dl->fade[0]) / (dl->fade[1]-dl->fade[0]);
dist = 1-((dist-dl->fade[0]) / (dl->fade[1]-dl->fade[0]));
VectorScale(colour, dist, colour);
}
}

View File

@ -10714,8 +10714,14 @@ static void QCBUILTIN PF_setpause(pubprogfuncs_t *prinst, struct globalvars_s *p
/*builtins to work around the remastered edition of quake.*/
void PF_finaleFinished(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ //undocumented. just stub it for now. this will probably break coop games that killed shub.
{ //undocumented. implement some quicky hack that just waits till some user has tried attacking. should probably be at least half players or something. silly afkers.
unsigned int i;
G_FLOAT(OFS_RETURN) = false;
for (i = 0; i < svs.allocated_client_slots; i++)
{
if (svs.clients[i].lastcmd.buttons & 1)
G_FLOAT(OFS_RETURN) = true;
}
}
void PF_localsound_remaster(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ //undocumented. just stub it.

View File

@ -3496,7 +3496,21 @@ void SV_Snapshot_BuildStateQ1(entity_state_t *state, edict_t *ent, client_t *cli
state->modelindex = sv_playermodel;
}
if (progstype != PROG_QW)
if (sv.world.remasterlogic)
{
if (state->effects & (REEF_QUADLIGHT|REEF_PENTLIGHT|REEF_CANDLELIGHT))
{ //remap these flags to something new.
unsigned int old = state->effects;
state->effects &= ~(REEF_QUADLIGHT|REEF_PENTLIGHT|REEF_CANDLELIGHT);
if (old & REEF_QUADLIGHT)
state->effects |= EF_BLUE;
if (old & REEF_PENTLIGHT)
state->effects |= EF_RED;
if (old & REEF_CANDLELIGHT)
state->effects |= 0;
}
}
else if (progstype != PROG_QW)
{
if (progstype == PROG_TENEBRAE)
{

View File

@ -8299,7 +8299,6 @@ void SV_ExecuteClientMessage (client_t *cl)
}
split->lastcmd = newcmd;
split->lastcmd.buttons = 0; // avoid multiple fires on lag
}
split = split->controlled; //so the next splitscreen client gets the next packet.
host_client = cl;