- more texture cleanup.

It is now in a state where FTexture really needs to be separated from FGameTexture.
This commit is contained in:
Christoph Oelckers 2020-04-15 18:59:14 +02:00
commit 83817080bb
21 changed files with 91 additions and 103 deletions

View file

@ -377,7 +377,7 @@ sector_t *PolyFrameBuffer::RenderViewpoint(FRenderViewpoint &mainvp, AActor * ca
void PolyFrameBuffer::RenderTextureView(FCanvasTexture *tex, AActor *Viewpoint, double FOV)
{
// This doesn't need to clear the fake flat cache. It can be shared between camera textures and the main view of a scene.
FMaterial *mat = FMaterial::ValidateTexture(tex, false);
FMaterial *mat = FMaterial::ValidateTexture(reinterpret_cast<FGameTexture*>(tex), false);
auto BaseLayer = static_cast<PolyHardwareTexture*>(mat->GetLayer(0, 0));
float ratio = (float)tex->GetDisplayWidthDouble() / (float)tex->GetDisplayHeightDouble();
@ -534,7 +534,7 @@ void PolyFrameBuffer::CleanForRestart()
void PolyFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation)
{
if (mat->Source()->isSWCanvas()) return;
if (mat->Source()->GetUseType() == ETextureType::SWCanvas) return;
int flags = mat->isExpanded() ? CTF_Expand : 0;
FTexture* layer;

View file

@ -64,8 +64,7 @@ void PolyHardwareTexture::Reset()
DCanvas *PolyHardwareTexture::GetImage(FTexture *baselayer, const FMaterialState &state)
{
FTexture *tex = state.mMaterial->Source();
if (tex->isHardwareCanvas()) static_cast<FCanvasTexture*>(tex)->NeedUpdate();
FGameTexture *tex = state.mMaterial->Source();
if (!mCanvas)
{

View file

@ -281,7 +281,7 @@ void PolyRenderState::Apply()
}
if (mMaterial.mMaterial && mMaterial.mMaterial->Source())
mStreamData.timer = static_cast<float>((double)(screen->FrameTime - firstFrame) * (double)mMaterial.mMaterial->Source()->shaderspeed / 1000.);
mStreamData.timer = static_cast<float>((double)(screen->FrameTime - firstFrame) * (double)mMaterial.mMaterial->Source()->GetShaderSpeed() / 1000.);
else
mStreamData.timer = 0.0f;