- eliminated all cases of calling DrawTexture with an FTexture.

Everything uses FGameTexture now.
This commit is contained in:
Christoph Oelckers 2020-04-14 01:01:29 +02:00
commit d9928b51a8
13 changed files with 68 additions and 71 deletions

View file

@ -212,11 +212,12 @@ bool SetTextureParms(F2DDrawer *drawer, DrawParms* parms, FTexture* img, double
void DrawText(F2DDrawer* drawer, FFont* font, int normalcolor, double x, double y, const char* string, int tag_first, ...);
void DrawText(F2DDrawer* drawer, FFont* font, int normalcolor, double x, double y, const char32_t* string, int tag_first, ...);
void DrawChar(F2DDrawer* drawer, FFont* font, int normalcolor, double x, double y, int character, int tag_first, ...);
void DrawTexture(F2DDrawer* drawer, FTexture* img, double x, double y, int tags_first, ...);
template <typename ...Params>
void DrawTexture(F2DDrawer* drawer, FGameTexture* img, double x, double y, int tags_first, Params&&... params)
{
void DrawTexture(F2DDrawer * drawer, FTexture * img, double x, double y, int tags_first, ...);
DrawTexture(drawer, img->GetTexture(), x, y, tags_first, std::forward<Params>(params)...);
}

View file

@ -589,7 +589,7 @@ protected:
//
//==========================================================================
FTexture *PNGTexture_CreateFromFile(PNGHandle *png, const FString &filename)
FGameTexture *PNGTexture_CreateFromFile(PNGHandle *png, const FString &filename)
{
if (M_FindPNGChunk(png, MAKE_ID('I','H','D','R')) == 0)
{
@ -608,7 +608,7 @@ FTexture *PNGTexture_CreateFromFile(PNGHandle *png, const FString &filename)
// Reject anything that cannot be put into a savegame picture by GZDoom itself.
if (compression != 0 || filter != 0 || interlace > 0 || bitdepth != 8 || (colortype != 2 && colortype != 3)) return nullptr;
else return new FPNGFileTexture (png->File, width, height, colortype);
else return reinterpret_cast<FGameTexture*>(new FPNGFileTexture (png->File, width, height, colortype));
}
//==========================================================================

View file

@ -119,8 +119,8 @@ bool M_ReadIDAT (FileReader &file, uint8_t *buffer, int width, int height, int p
uint8_t bitdepth, uint8_t colortype, uint8_t interlace, unsigned int idatlen);
class FTexture;
class FGameTexture;
FTexture *PNGTexture_CreateFromFile(PNGHandle *png, const FString &filename);
FGameTexture *PNGTexture_CreateFromFile(PNGHandle *png, const FString &filename);
#endif

View file

@ -276,7 +276,6 @@ public:
bool isFullbrightDisabled() const { return bDisableFullbright; }
bool isHardwareCanvas() const { return bHasCanvas; } // There's two here so that this can deal with software canvases in the hardware renderer later.
bool isCanvas() const { return bHasCanvas; }
bool isMiscPatch() const { return UseType == ETextureType::MiscPatch; } // only used by the intermission screen to decide whether to tile the background image or not.
int isWarped() const { return bWarped; }
int GetRotations() const { return Rotations; }
float GetShaderSpeed() const { return shaderspeed; }
@ -590,6 +589,7 @@ public:
bool isValid() { return wrapped.isValid(); }
bool isWarped() { return wrapped.isWarped(); }
bool isMiscPatch() const { return wrapped.GetUseType() == ETextureType::MiscPatch; } // only used by the intermission screen to decide whether to tile the background image or not.
bool useWorldPanning() { return wrapped.UseWorldPanning(); }
float GetShaderSpeed() const { return wrapped.GetShaderSpeed(); }
uint16_t GetRotations() const { return wrapped.GetRotations(); }