fix a few minor issues.

* make Corona a fully scripted class so that AActor can be made final again.
* add global vkversion variable for use by the survey code.
* move progress bar on generic start screen to the bottom and made it longer.
* revert BulletPuff to its GZDoom version because the changes are not compatible with Dehacked.
This commit is contained in:
Christoph Oelckers 2023-10-19 22:35:54 +02:00 committed by Magnus Norddahl
commit 92bbaa7531
11 changed files with 21 additions and 89 deletions

View file

@ -44,7 +44,6 @@
#include "hw_clipper.h"
#include "hw_meshcache.h"
#include "v_draw.h"
#include "a_corona.h"
#include "texturemanager.h"
#include "actorinlines.h"
#include "g_levellocals.h"
@ -565,7 +564,7 @@ void HWDrawInfo::RenderPortal(HWPortal *p, FRenderState &state, bool usestencil)
}
void HWDrawInfo::DrawCorona(FRenderState& state, ACorona* corona, double dist)
void HWDrawInfo::DrawCorona(FRenderState& state, AActor* corona, float coronaFade, double dist)
{
spriteframe_t* sprframe = &SpriteFrames[sprites[corona->sprite].spriteframes + (size_t)corona->SpawnState->GetFrame()];
FTextureID patch = sprframe->Texture[0];
@ -585,7 +584,7 @@ void HWDrawInfo::DrawCorona(FRenderState& state, ACorona* corona, double dist)
float screenX = halfViewportWidth + clipPos.X * invW * halfViewportWidth;
float screenY = halfViewportHeight - clipPos.Y * invW * halfViewportHeight;
float alpha = corona->CoronaFade * float(corona->Alpha);
float alpha = coronaFade * float(corona->Alpha);
// distance-based fade - looks better IMO
float distNearFadeStart = float(corona->RenderRadius()) * 0.1f;
@ -655,8 +654,10 @@ void HWDrawInfo::DrawCoronas(FRenderState& state)
float timeElapsed = (screen->FrameTime - LastFrameTime) / 1000.0f;
LastFrameTime = screen->FrameTime;
for (ACorona* corona : Coronas)
for (auto& coronap : Coronas)
{
auto corona = coronap.first;
auto& coronaFade = coronap.second;
auto cPos = corona->Vec3Offset(0., 0., corona->Height * 0.5);
DVector3 direction = Viewpoint.Pos - cPos;
double dist = direction.Length();
@ -671,15 +672,15 @@ void HWDrawInfo::DrawCoronas(FRenderState& state)
FTraceResults results;
if (!Trace(cPos, corona->Sector, direction, dist, MF_SOLID, ML_BLOCKEVERYTHING, corona, results, 0, CheckForViewpointActor, &Viewpoint))
{
corona->CoronaFade = std::min(corona->CoronaFade + timeElapsed * fadeSpeed, 1.0f);
coronaFade = std::min(coronaFade + timeElapsed * fadeSpeed, 1.0f);
}
else
{
corona->CoronaFade = std::max(corona->CoronaFade - timeElapsed * fadeSpeed, 0.0f);
coronaFade = std::max(coronaFade - timeElapsed * fadeSpeed, 0.0f);
}
if (corona->CoronaFade > 0.0f)
DrawCorona(state, corona, dist);
if (coronaFade > 0.0f)
DrawCorona(state, corona, coronaFade, dist);
}
state.SetTextureMode(TM_NORMAL);

View file

@ -150,7 +150,7 @@ struct HWDrawInfo
TArray<HWPortal *> Portals;
TArray<HWDecal *> Decals[2]; // the second slot is for mirrors which get rendered in a separate pass.
TArray<HUDSprite> hudsprites; // These may just be stored by value.
TArray<ACorona*> Coronas;
TArray<std::pair<AActor*, float>> Coronas;
TArray<LevelMeshSurface*> VisibleSurfaces;
uint64_t LastFrameTime = 0;
@ -316,7 +316,7 @@ public:
void DrawDecals(FRenderState &state, TArray<HWDecal *> &decals);
void DrawPlayerSprites(bool hudModelStep, FRenderState &state);
void DrawCoronas(FRenderState& state);
void DrawCorona(FRenderState& state, ACorona* corona, double dist);
void DrawCorona(FRenderState& state, AActor* corona, float coronaFade, double dist);
void ProcessLowerMinisegs(TArray<seg_t *> &lowersegs, FRenderState& state);
void AddSubsectorToPortal(FSectorPortalGroup *portal, subsector_t *sub);

View file

@ -33,7 +33,6 @@
#include "r_sky.h"
#include "r_utility.h"
#include "a_pickups.h"
#include "a_corona.h"
#include "d_player.h"
#include "g_levellocals.h"
#include "events.h"
@ -756,7 +755,7 @@ void HWSprite::Process(HWDrawInfo *di, FRenderState& state, AActor* thing, secto
if (thing->IsKindOf(NAME_Corona))
{
di->Coronas.Push(static_cast<ACorona*>(thing));
di->Coronas.Push(std::make_pair(thing, 0));
return;
}