Add support for the FIRSTPERSON renderflag from Q3

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5794 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Eukara 2020-12-25 03:07:07 +00:00
parent 8c1cd3a78d
commit a322a175de
6 changed files with 10 additions and 5 deletions

View file

@ -453,9 +453,8 @@ void VQ3_AddEntity(const q3refEntity_t *q3)
ent.forcedshader = VM_FROMSHANDLE(q3->customShader);
ent.shaderTime = q3->shaderTime;
/* no, these flags are not alike, the first_person rf in q3a so mirrors don't draw them -eukara */
/*if (q3->renderfx & Q3RF_FIRST_PERSON)
ent.flags |= RF_WEAPONMODEL;*/
if (q3->renderfx & Q3RF_FIRST_PERSON)
ent.flags |= RF_FIRSTPERSON;
if (q3->renderfx & Q3RF_DEPTHHACK)
ent.flags |= RF_DEPTHHACK;
if (q3->renderfx & Q3RF_THIRD_PERSON)

View file

@ -842,6 +842,8 @@ static qboolean CopyCSQCEdictToEntity(csqcedict_t *fte_restrict in, entity_t *ft
}
if (rflags & CSQCRF_EXTERNALMODEL)
out->flags |= RF_EXTERNALMODEL;
if (rflags & CSQCRF_FIRSTPERSON)
out->flags |= RF_FIRSTPERSON;
if (rflags & CSQCRF_DEPTHHACK)
out->flags |= RF_DEPTHHACK;
if (rflags & CSQCRF_ADDITIVE)

View file

@ -811,12 +811,12 @@ typedef enum
#define CSQCRF_USEAXIS 16 //use v_forward/v_right/v_up as an axis/matrix - predraw is needed to use this properly
#define CSQCRF_NOSHADOW 32 //don't cast shadows upon other entities (can still be self shadowing, if the engine wishes, and not additive)
#define CSQCRF_FRAMETIMESARESTARTTIMES 64 //EXT_CSQC_1: frame times should be read as (time-frametime).
#define CSQCRF_FIRSTPERSON 1024 //drawn ONLY in mirrors
//#define CSQCRFDP_USETRANSPARENTOFFSET 64 // Allows QC to customize origin used for transparent sorting via transparent_origin global, helps to fix transparent sorting bugs on a very large entities
////#define CSQCRF_NOAUTOADD 128 // removed in favour of predraw return values.
//#define CSQCRFDP_WORLDOBJECT 128 // for large outdoor entities that should not be culled.
//#define CSQCRFDP_FULLBRIGHT 256
//#define CSQCRFDP_NOSHADOW 512
//#define CSQCRF_UNUSED 1024
//#define CSQCRF_UNUSED 2048
//#define CSQCRFDP_MODELLIGHT 4096 // CSQC-set model light
//#define CSQCRFDP_DYNAMICMODELLIGHT 8192 // origin-dependent model light

View file

@ -1357,7 +1357,8 @@ typedef struct q1usercmd_s
#define RF_NOSHADOW (1u<<20) //disables shadow casting
#define RF_NODEPTHTEST (1u<<21) //forces shader sort order and BEF_FORCENODEPTH
#define RF_FORCECOLOURMOD (1u<<22) //forces BEF_FORCECOLOURMOD
#define RF_WEAPONMODELNOBOB (1u<<23) //
#define RF_WEAPONMODELNOBOB (1u<<23)
#define RF_FIRSTPERSON (1u<<24) //only draw through eyes
// player_state_t->refdef flags
#define RDF_UNDERWATER (1u<<0) // warp the screen as apropriate (fov trick)

View file

@ -2855,6 +2855,8 @@ void BE_GenModelBatches(batch_t **batches, const dlight_t *dl, unsigned int bemo
{
ent = &cl_visedicts[i];
if ((r_refdef.externalview && (ent->flags & RF_FIRSTPERSON)) || chase_active.ival)
continue;
if (!r_refdef.externalview && (ent->flags & RF_EXTERNALMODEL) && !chase_active.ival)
continue;

View file

@ -13239,6 +13239,7 @@ void PR_DumpPlatform_f(void)
{"RF_USEAXIS", "const float", CS, D("The entity will be oriented according to the current v_forward+v_right+v_up vector values instead of the entity's .angles field."), CSQCRF_USEAXIS},
{"RF_NOSHADOW", "const float", CS, D("This entity will not cast shadows. Often useful on view models."), CSQCRF_NOSHADOW},
{"RF_FRAMETIMESARESTARTTIMES","const float", CS, D("Specifies that the frame1time, frame2time field are timestamps (denoting the start of the animation) rather than time into the animation."), CSQCRF_FRAMETIMESARESTARTTIMES},
{"RF_FIRSTPERSON","const float", CS, D("This is basically the opposite of RF_EXTERNALMODEL. Don't draw in third-person or mirrors."), CSQCRF_FIRSTPERSON},
{"IE_KEYDOWN", "const float", CS|MENU, D("Specifies that a key was pressed. Second argument is the scan code. Third argument is the unicode (printable) char value. Fourth argument denotes which keyboard(or mouse, if its a mouse 'scan' key) the event came from. Note that some systems may completely separate scan codes and unicode values, with a 0 value for the unspecified argument."), CSIE_KEYDOWN},
{"IE_KEYUP", "const float", CS|MENU, D("Specifies that a key was released. Arguments are the same as IE_KEYDOWN. On some systems, this may be fired instantly after IE_KEYDOWN was fired."), CSIE_KEYUP},