- test skyboxes with dynamic_cast and scale them properly.

This commit is contained in:
Christoph Oelckers 2020-04-18 13:13:57 +02:00
parent 217b80b1fb
commit f7dd16ba16
8 changed files with 57 additions and 50 deletions

View file

@ -44,7 +44,6 @@ FSkyBox::FSkyBox(const char *name)
}
else previous = nullptr;
faces[0]=faces[1]=faces[2]=faces[3]=faces[4]=faces[5] = nullptr;
bSkybox = true;
fliptop = false;
}

View file

@ -1,3 +1,42 @@
#pragma once
#include "textures.h"
//-----------------------------------------------------------------------------
//
// Todo: Get rid of this
// The faces can easily be stored in the material layer array
//
//-----------------------------------------------------------------------------
class FSkyBox : public FImageTexture
{
public:
FGameTexture* previous;
FGameTexture* faces[6]; // the faces need to be full materials as they can have all supported effects.
bool fliptop;
FSkyBox(const char* name);
void SetSize();
bool Is3Face() const
{
return faces[5] == nullptr;
}
bool IsFlipped() const
{
return fliptop;
}
FGameTexture* GetSkyFace(int num) const
{
return faces[num];
}
bool GetSkyFlip() const
{
return fliptop;
}
};

View file

@ -94,7 +94,6 @@ FTexture::FTexture (int lumpnum)
bNoRemap0(false), bMasked(true), bAlphaTexture(false), bHasCanvas(false),
Rotations(0xFFFF), SkyOffset(0), Width(0), Height(0)
{
bSkybox = false;
bNoCompress = false;
bTranslucent = -1;
}

View file

@ -258,7 +258,6 @@ protected:
uint8_t bAlphaTexture : 1; // Texture is an alpha channel without color information
uint8_t bHasCanvas : 1; // Texture is based off FCanvasTexture
uint8_t bSkybox : 1; // is a cubic skybox
int8_t bTranslucent : 2;
uint16_t Rotations;
@ -447,35 +446,6 @@ enum
};
//-----------------------------------------------------------------------------
//
// Todo: Get rid of this
// The faces can easily be stored in the material layer array
//
//-----------------------------------------------------------------------------
class FSkyBox : public FImageTexture
{
public:
FGameTexture* previous;
FGameTexture* faces[6]; // the faces need to be full materials as they can have all supported effects.
bool fliptop;
FSkyBox(const char* name);
void SetSize();
bool Is3Face() const
{
return faces[5] == nullptr;
}
bool IsFlipped() const
{
return fliptop;
}
};
enum EGameTexFlags
{
GTexf_NoDecals = 1, // Decals should not stick to texture
@ -644,7 +614,6 @@ public:
bool isUserContent() const;
int CheckRealHeight() { return xs_RoundToInt(Base->CheckRealHeight() / ScaleY); }
bool isSkybox() const { return Base->bSkybox; }
void SetSize(int x, int y)
{
TexelWidth = x;
@ -684,13 +653,6 @@ public:
return Base->GetTranslucency();
}
// Since these properties will later piggyback on existing members of FGameTexture, the accessors need to be here.
FGameTexture *GetSkyFace(int num)
{
return (isSkybox() ? static_cast<FSkyBox*>(Base.get())->faces[num] : nullptr);
}
bool GetSkyFlip() { return isSkybox() ? static_cast<FSkyBox*>(Base.get())->fliptop : false; }
int GetClampMode(int clampmode)
{
if (GetUseType() == ETextureType::SWCanvas) clampmode = CLAMP_NOFILTER;