Re-enable corona support

This commit is contained in:
Magnus Norddahl 2023-03-16 23:49:33 +01:00
commit eac73d9eba
10 changed files with 9 additions and 17 deletions

View file

@ -582,7 +582,6 @@ void HWDrawInfo::RenderPortal(HWPortal *p, FRenderState &state, bool usestencil)
void HWDrawInfo::DrawCorona(FRenderState& state, ACorona* corona, double dist)
{
#if 0
spriteframe_t* sprframe = &SpriteFrames[sprites[corona->sprite].spriteframes + (size_t)corona->SpawnState->GetFrame()];
FTextureID patch = sprframe->Texture[0];
if (!patch.isValid()) return;
@ -644,7 +643,6 @@ void HWDrawInfo::DrawCorona(FRenderState& state, ACorona* corona, double dist)
vp[3].Set(x1, y1, 1.0f, u1, v1);
state.Draw(DT_TriangleStrip, vertexindex, 4);
#endif
}
static ETraceStatus CheckForViewpointActor(FTraceResults& res, void* userdata)
@ -672,7 +670,6 @@ void HWDrawInfo::DrawCoronas(FRenderState& state)
float timeElapsed = (screen->FrameTime - LastFrameTime) / 1000.0f;
LastFrameTime = screen->FrameTime;
#if 0
for (ACorona* corona : Coronas)
{
auto cPos = corona->Vec3Offset(0., 0., corona->Height * 0.5);
@ -699,7 +696,6 @@ void HWDrawInfo::DrawCoronas(FRenderState& state)
if (corona->CoronaFade > 0.0f)
DrawCorona(state, corona, dist);
}
#endif
state.SetTextureMode(TM_NORMAL);
screen->mViewpoints->Bind(state, vpIndex);
@ -719,10 +715,10 @@ void HWDrawInfo::EndDrawScene(sector_t * viewsector, FRenderState &state)
{
state.EnableFog(false);
/*if (gl_coronas && Coronas.Size() > 0)
if (gl_coronas && Coronas.Size() > 0)
{
DrawCoronas(state);
}*/
}
// [BB] HUD models need to be rendered here.
const bool renderHUDModel = IsHUDModelForPlayerAvailable(players[consoleplayer].camera->player);

View file

@ -151,7 +151,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<ACorona*> Coronas;
uint64_t LastFrameTime = 0;
TArray<MissingTextureInfo> MissingUpperTextures;

View file

@ -707,13 +707,11 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
return;
}
#if 0
if (thing->IsKindOf(NAME_Corona))
{
di->Coronas.Push(static_cast<ACorona*>(thing));
return;
}
#endif
const auto &vp = di->Viewpoint;
AActor *camera = vp.camera;