1.0 release. Requires 4.2.3 or higher.
- Migrated screen projection code to libeye. - Some pickups emit light, like in Doomreal. - Backported map revealer item from Doomreal. - Brand new Invulnerability and Night Vision powerups. - Add option to allow Shield Belt and armors simultaneously. - Backported armor bonus model from Doomreal. - Added Dual Enforcers icon for HUD. - Changed player class names to their character names, like in Doomreal. - Terrain splashes. - Translocator doesn't telefrag other players in coop. - Reduced view shake from Impact Hammer. - Various other updates and bug fixes.
This commit is contained in:
parent
0ed1e6aa4f
commit
b79d29f071
91 changed files with 1994 additions and 511 deletions
|
|
@ -444,6 +444,13 @@ Class RedeemerHUD : HUDMessageBase
|
|||
Array<TargetActor> ta;
|
||||
Shape2D sshape, darrow;
|
||||
bool dodim;
|
||||
// libeye stuff
|
||||
dtLe_ProjScreen proj;
|
||||
dtLe_GLScreen gl_proj;
|
||||
dtLe_SWScreen sw_proj;
|
||||
dtLe_Viewport viewport;
|
||||
bool can_project;
|
||||
transient CVar cvar_renderer;
|
||||
|
||||
RedeemerHUD Init()
|
||||
{
|
||||
|
|
@ -460,15 +467,45 @@ Class RedeemerHUD : HUDMessageBase
|
|||
sshape.PushCoord((1,1));
|
||||
sshape.PushTriangle(0,3,1);
|
||||
sshape.PushTriangle(0,2,3);
|
||||
gl_proj = new("dtLe_GLScreen");
|
||||
sw_proj = new("dtLe_SWScreen");
|
||||
PrepareProjection();
|
||||
return self;
|
||||
}
|
||||
void PrepareProjection()
|
||||
{
|
||||
if ( !cvar_renderer )
|
||||
cvar_renderer = CVar.GetCVar("vid_rendermode",players[consoleplayer]);
|
||||
if ( !cvar_renderer )
|
||||
{
|
||||
can_project = proj = gl_proj;
|
||||
return;
|
||||
}
|
||||
switch ( cvar_renderer.GetInt() )
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
proj = sw_proj;
|
||||
break;
|
||||
default:
|
||||
proj = gl_proj;
|
||||
break;
|
||||
}
|
||||
can_project = proj;
|
||||
}
|
||||
override bool Tick()
|
||||
{
|
||||
PrepareProjection();
|
||||
LagRoll = dt_Quat.Normalize180(ViewRoll-LagRoll2);
|
||||
LagRoll2 += dt_Quat.Normalize180(LagRoll-LagRoll2)*0.1;
|
||||
// shootable targetting
|
||||
if ( CVar.GetCVar('flak_redeemerreadout',players[consoleplayer]).GetBool() && !CVar.GetCVar('flak_redeemerreadout_perframe',players[consoleplayer]).GetBool() )
|
||||
if ( CVar.GetCVar('flak_redeemerreadout',players[consoleplayer]).GetBool() && !CVar.GetCVar('flak_redeemerreadout_perframe',players[consoleplayer]).GetBool() && can_project )
|
||||
{
|
||||
viewport.FromHud();
|
||||
proj.CacheResolution();
|
||||
proj.CacheFov(players[consoleplayer].fov);
|
||||
proj.Reorient(ViewPos,(ViewAngle,ViewPitch,ViewRoll));
|
||||
proj.BeginProjection();
|
||||
if ( !t ) t = ThinkerIterator.Create("Actor");
|
||||
if ( !tr ) tr = new("MidTracer");
|
||||
t.Reinit();
|
||||
|
|
@ -479,11 +516,11 @@ Class RedeemerHUD : HUDMessageBase
|
|||
{
|
||||
Vector3 tdir = Level.Vec3Diff(ViewPos,a.Pos+(0,0,a.Height*0.5));
|
||||
if ( !a.bSHOOTABLE || (a.Health <= 0) || ((Camera is 'GuidedWarShell') && (a == GuidedWarShell(Camera).b)) || (tdir.length() > 2000) || (acos(tdir.unit() dot vdir) > players[consoleplayer].FOV) || tr.Trace(ViewPos,Camera.CurSector,tdir.unit(),tdir.length(),0) ) continue;
|
||||
Vector3 wpos = ViewPos+tdir;
|
||||
Vector3 spos = dt_CoordUtil.WorldToScreen(wpos,ViewPos,ViewPitch,ViewAngle,ViewRoll,players[consoleplayer].FOV);
|
||||
if ( spos.z > 1.0 ) continue;
|
||||
proj.ProjectWorldPos(ViewPos+tdir);
|
||||
Vector2 npos = proj.ProjectToNormal();
|
||||
if ( !proj.IsInFront() ) continue;
|
||||
TargetActor te = new("TargetActor");
|
||||
te.vpos = dt_CoordUtil.ToViewport(spos);
|
||||
te.vpos = viewport.SceneToWindow(npos);
|
||||
te.diststr = String.Format("%f",tdir.length());
|
||||
te.diststr.Replace(".","");
|
||||
ta.Push(te);
|
||||
|
|
@ -496,10 +533,15 @@ Class RedeemerHUD : HUDMessageBase
|
|||
if ( visibility != StatusBar.HUDMSGLayer_UnderHUD ) return;
|
||||
if ( dodim ) Screen.Dim("C8 00 00",0.2,0,0,Screen.GetWidth(),Screen.GetHeight());
|
||||
// shootable targetting
|
||||
if ( CVar.GetCVar('flak_redeemerreadout',players[consoleplayer]).GetBool() )
|
||||
if ( CVar.GetCVar('flak_redeemerreadout',players[consoleplayer]).GetBool() && can_project )
|
||||
{
|
||||
if ( CVar.GetCVar('flak_redeemerreadout_perframe',players[consoleplayer]).GetBool() )
|
||||
{
|
||||
viewport.FromHud();
|
||||
proj.CacheResolution();
|
||||
proj.CacheFov(players[consoleplayer].fov);
|
||||
proj.Reorient(ViewPos,(ViewAngle,ViewPitch,ViewRoll));
|
||||
proj.BeginProjection();
|
||||
if ( !t ) t = ThinkerIterator.Create("Actor");
|
||||
if ( !tr ) tr = new("MidTracer");
|
||||
t.Reinit();
|
||||
|
|
@ -510,11 +552,11 @@ Class RedeemerHUD : HUDMessageBase
|
|||
{
|
||||
Vector3 tdir = Level.Vec3Diff(ViewPos,a.Pos+(0,0,a.Height*0.5));
|
||||
if ( !a.bSHOOTABLE || (a.Health <= 0) || ((Camera is 'GuidedWarShell') && (a == GuidedWarShell(Camera).b)) || (tdir.length() > 2000) || (acos(tdir.unit() dot vdir) > players[consoleplayer].FOV) || tr.Trace(ViewPos,Camera.CurSector,tdir.unit(),tdir.length(),0) ) continue;
|
||||
Vector3 wpos = ViewPos+tdir;
|
||||
Vector3 spos = dt_CoordUtil.WorldToScreen(wpos,ViewPos,ViewPitch,ViewAngle,ViewRoll,players[consoleplayer].FOV);
|
||||
if ( spos.z > 1.0 ) continue;
|
||||
proj.ProjectWorldPos(ViewPos+tdir);
|
||||
Vector2 npos = proj.ProjectToNormal();
|
||||
if ( !proj.IsInFront() ) continue;
|
||||
TargetActor te = new("TargetActor");
|
||||
te.vpos = dt_CoordUtil.ToViewport(spos);
|
||||
te.vpos = viewport.SceneToWindow(npos);
|
||||
te.diststr = String.Format("%f",tdir.length());
|
||||
te.diststr.Replace(".","");
|
||||
ta.Push(te);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue