mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-21 09:01:37 +00:00
- eliminated all cases of calling DrawTexture with an FTexture.
Everything uses FGameTexture now.
This commit is contained in:
parent
c7db5b932e
commit
d9928b51a8
13 changed files with 68 additions and 71 deletions
|
@ -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 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 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 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>
|
template <typename ...Params>
|
||||||
void DrawTexture(F2DDrawer* drawer, FGameTexture* img, double x, double y, int tags_first, Params&&... 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)...);
|
DrawTexture(drawer, img->GetTexture(), x, y, tags_first, std::forward<Params>(params)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
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.
|
// 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;
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -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);
|
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
|
#endif
|
||||||
|
|
|
@ -276,7 +276,6 @@ public:
|
||||||
bool isFullbrightDisabled() const { return bDisableFullbright; }
|
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 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 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 isWarped() const { return bWarped; }
|
||||||
int GetRotations() const { return Rotations; }
|
int GetRotations() const { return Rotations; }
|
||||||
float GetShaderSpeed() const { return shaderspeed; }
|
float GetShaderSpeed() const { return shaderspeed; }
|
||||||
|
@ -590,6 +589,7 @@ public:
|
||||||
|
|
||||||
bool isValid() { return wrapped.isValid(); }
|
bool isValid() { return wrapped.isValid(); }
|
||||||
bool isWarped() { return wrapped.isWarped(); }
|
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(); }
|
bool useWorldPanning() { return wrapped.UseWorldPanning(); }
|
||||||
float GetShaderSpeed() const { return wrapped.GetShaderSpeed(); }
|
float GetShaderSpeed() const { return wrapped.GetShaderSpeed(); }
|
||||||
uint16_t GetRotations() const { return wrapped.GetRotations(); }
|
uint16_t GetRotations() const { return wrapped.GetRotations(); }
|
||||||
|
|
|
@ -271,7 +271,7 @@ int eventhead;
|
||||||
int eventtail;
|
int eventtail;
|
||||||
gamestate_t wipegamestate = GS_DEMOSCREEN; // can be -1 to force a wipe
|
gamestate_t wipegamestate = GS_DEMOSCREEN; // can be -1 to force a wipe
|
||||||
bool PageBlank;
|
bool PageBlank;
|
||||||
FTexture *Advisory;
|
FGameTexture *Advisory;
|
||||||
FTextureID Page;
|
FTextureID Page;
|
||||||
const char *Subtitle;
|
const char *Subtitle;
|
||||||
bool nospriterename;
|
bool nospriterename;
|
||||||
|
@ -1005,11 +1005,8 @@ void D_Display ()
|
||||||
// draw pause pic
|
// draw pause pic
|
||||||
if ((paused || pauseext) && menuactive == MENU_Off)
|
if ((paused || pauseext) && menuactive == MENU_Off)
|
||||||
{
|
{
|
||||||
FTexture *tex;
|
auto tex = TexMan.GetGameTextureByName(gameinfo.PauseSign, true);
|
||||||
int x;
|
double x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 +
|
||||||
|
|
||||||
tex = TexMan.GetTextureByName(gameinfo.PauseSign, true);
|
|
||||||
x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 +
|
|
||||||
tex->GetDisplayLeftOffset() * CleanXfac;
|
tex->GetDisplayLeftOffset() * CleanXfac;
|
||||||
DrawTexture(twod, tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
|
DrawTexture(twod, tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
|
||||||
if (paused && multiplayer)
|
if (paused && multiplayer)
|
||||||
|
@ -1031,7 +1028,7 @@ void D_Display ()
|
||||||
D_DrawIcon = NULL;
|
D_DrawIcon = NULL;
|
||||||
if (picnum.isValid())
|
if (picnum.isValid())
|
||||||
{
|
{
|
||||||
FTexture *tex = TexMan.GetTexture(picnum);
|
auto tex = TexMan.GetGameTexture(picnum);
|
||||||
DrawTexture(twod, tex, 160 - tex->GetDisplayWidth()/2, 100 - tex->GetDisplayHeight()/2,
|
DrawTexture(twod, tex, 160 - tex->GetDisplayWidth()/2, 100 - tex->GetDisplayHeight()/2,
|
||||||
DTA_320x200, true, TAG_DONE);
|
DTA_320x200, true, TAG_DONE);
|
||||||
}
|
}
|
||||||
|
@ -1068,7 +1065,7 @@ void D_Display ()
|
||||||
screen->End2D();
|
screen->End2D();
|
||||||
auto wipend = screen->WipeEndScreen ();
|
auto wipend = screen->WipeEndScreen ();
|
||||||
auto wiper = Wiper::Create(wipe_type);
|
auto wiper = Wiper::Create(wipe_type);
|
||||||
wiper->SetTextures(wipe, wipend);
|
wiper->SetTextures(reinterpret_cast<FGameTexture*>(wipe), reinterpret_cast<FGameTexture*>(wipend));
|
||||||
|
|
||||||
wipestart = I_msTime();
|
wipestart = I_msTime();
|
||||||
NetUpdate(); // send out any new accumulation
|
NetUpdate(); // send out any new accumulation
|
||||||
|
@ -1232,7 +1229,7 @@ void D_PageDrawer (void)
|
||||||
ClearRect(twod, 0, 0, SCREENWIDTH, SCREENHEIGHT, 0, 0);
|
ClearRect(twod, 0, 0, SCREENWIDTH, SCREENHEIGHT, 0, 0);
|
||||||
if (Page.Exists())
|
if (Page.Exists())
|
||||||
{
|
{
|
||||||
DrawTexture(twod, TexMan.GetTexture(Page, true), 0, 0,
|
DrawTexture(twod, TexMan.GetGameTexture(Page, true), 0, 0,
|
||||||
DTA_Fullscreen, true,
|
DTA_Fullscreen, true,
|
||||||
DTA_Masked, false,
|
DTA_Masked, false,
|
||||||
DTA_BilinearFilter, true,
|
DTA_BilinearFilter, true,
|
||||||
|
@ -1433,7 +1430,7 @@ void D_DoAdvanceDemo (void)
|
||||||
case 3:
|
case 3:
|
||||||
if (gameinfo.advisoryTime)
|
if (gameinfo.advisoryTime)
|
||||||
{
|
{
|
||||||
Advisory = TexMan.GetTextureByName("ADVISOR");
|
Advisory = TexMan.GetGameTextureByName("ADVISOR");
|
||||||
demosequence = 1;
|
demosequence = 1;
|
||||||
pagetic = (int)(gameinfo.advisoryTime * TICRATE);
|
pagetic = (int)(gameinfo.advisoryTime * TICRATE);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -429,7 +429,7 @@ static void HU_DrawPlayer (player_t *player, bool highlight, int col1, int col2,
|
||||||
auto icon = FSetTextureID(player->mo->IntVar(NAME_ScoreIcon));
|
auto icon = FSetTextureID(player->mo->IntVar(NAME_ScoreIcon));
|
||||||
if (icon.isValid())
|
if (icon.isValid())
|
||||||
{
|
{
|
||||||
FTexture *pic = TexMan.GetTexture(icon);
|
auto pic = TexMan.GetGameTexture(icon);
|
||||||
DrawTexture(twod, pic, col3, y,
|
DrawTexture(twod, pic, col3, y,
|
||||||
DTA_CleanNoMove, true,
|
DTA_CleanNoMove, true,
|
||||||
TAG_DONE);
|
TAG_DONE);
|
||||||
|
@ -450,7 +450,7 @@ static void HU_DrawPlayer (player_t *player, bool highlight, int col1, int col2,
|
||||||
|
|
||||||
if (teamplay && Teams[player->userinfo.GetTeam()].GetLogo().IsNotEmpty ())
|
if (teamplay && Teams[player->userinfo.GetTeam()].GetLogo().IsNotEmpty ())
|
||||||
{
|
{
|
||||||
FTexture *pic = TexMan.GetTextureByName(Teams[player->userinfo.GetTeam()].GetLogo().GetChars ());
|
auto pic = TexMan.GetGameTextureByName(Teams[player->userinfo.GetTeam()].GetLogo().GetChars ());
|
||||||
DrawTexture(twod, pic, col1 - (pic->GetDisplayWidth() + 2) * CleanXfac, y,
|
DrawTexture(twod, pic, col1 - (pic->GetDisplayWidth() + 2) * CleanXfac, y,
|
||||||
DTA_CleanNoMove, true, TAG_DONE);
|
DTA_CleanNoMove, true, TAG_DONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,7 +216,7 @@ void DIntermissionScreen::Drawer ()
|
||||||
{
|
{
|
||||||
if (!mFlatfill)
|
if (!mFlatfill)
|
||||||
{
|
{
|
||||||
DrawTexture(twod, TexMan.GetTexture(mBackground), 0, 0, DTA_Fullscreen, true, TAG_DONE);
|
DrawTexture(twod, TexMan.GetGameTexture(mBackground), 0, 0, DTA_Fullscreen, true, TAG_DONE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -230,7 +230,7 @@ void DIntermissionScreen::Drawer ()
|
||||||
for (unsigned i=0; i < mOverlays.Size(); i++)
|
for (unsigned i=0; i < mOverlays.Size(); i++)
|
||||||
{
|
{
|
||||||
if (CheckOverlay(i))
|
if (CheckOverlay(i))
|
||||||
DrawTexture(twod, TexMan.GetTexture(mOverlays[i].mPic), mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, TAG_DONE);
|
DrawTexture(twod, TexMan.GetGameTexture(mOverlays[i].mPic), mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, TAG_DONE);
|
||||||
}
|
}
|
||||||
if (mSubtitle)
|
if (mSubtitle)
|
||||||
{
|
{
|
||||||
|
@ -287,11 +287,11 @@ void DIntermissionScreenFader::Drawer ()
|
||||||
if (mType == FADE_In) factor = 1.0 - factor;
|
if (mType == FADE_In) factor = 1.0 - factor;
|
||||||
int color = MAKEARGB(int(factor*255), 0,0,0);
|
int color = MAKEARGB(int(factor*255), 0,0,0);
|
||||||
|
|
||||||
DrawTexture(twod, TexMan.GetTexture(mBackground), 0, 0, DTA_Fullscreen, true, DTA_ColorOverlay, color, TAG_DONE);
|
DrawTexture(twod, TexMan.GetGameTexture(mBackground), 0, 0, DTA_Fullscreen, true, DTA_ColorOverlay, color, TAG_DONE);
|
||||||
for (unsigned i=0; i < mOverlays.Size(); i++)
|
for (unsigned i=0; i < mOverlays.Size(); i++)
|
||||||
{
|
{
|
||||||
if (CheckOverlay(i))
|
if (CheckOverlay(i))
|
||||||
DrawTexture(twod, TexMan.GetTexture(mOverlays[i].mPic), mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, DTA_ColorOverlay, color, TAG_DONE);
|
DrawTexture(twod, TexMan.GetGameTexture(mOverlays[i].mPic), mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, DTA_ColorOverlay, color, TAG_DONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -620,7 +620,6 @@ int DIntermissionScreenCast::Ticker ()
|
||||||
void DIntermissionScreenCast::Drawer ()
|
void DIntermissionScreenCast::Drawer ()
|
||||||
{
|
{
|
||||||
spriteframe_t* sprframe;
|
spriteframe_t* sprframe;
|
||||||
FTexture* pic;
|
|
||||||
|
|
||||||
Super::Drawer();
|
Super::Drawer();
|
||||||
|
|
||||||
|
@ -667,13 +666,13 @@ void DIntermissionScreenCast::Drawer ()
|
||||||
}
|
}
|
||||||
|
|
||||||
sprframe = &SpriteFrames[sprites[castsprite].spriteframes + caststate->GetFrame()];
|
sprframe = &SpriteFrames[sprites[castsprite].spriteframes + caststate->GetFrame()];
|
||||||
pic = TexMan.GetTexture(sprframe->Texture[0], true);
|
auto pic = TexMan.GetGameTexture(sprframe->Texture[0], true);
|
||||||
|
|
||||||
DrawTexture(twod, pic, 160, 170,
|
DrawTexture(twod, pic, 160, 170,
|
||||||
DTA_320x200, true,
|
DTA_320x200, true,
|
||||||
DTA_FlipX, sprframe->Flip & 1,
|
DTA_FlipX, sprframe->Flip & 1,
|
||||||
DTA_DestHeightF, pic->GetDisplayHeightDouble() * castscale.Y,
|
DTA_DestHeightF, pic->GetDisplayHeight() * castscale.Y,
|
||||||
DTA_DestWidthF, pic->GetDisplayWidthDouble() * castscale.X,
|
DTA_DestWidthF, pic->GetDisplayWidth() * castscale.X,
|
||||||
DTA_RenderStyle, mDefaults->RenderStyle,
|
DTA_RenderStyle, mDefaults->RenderStyle,
|
||||||
DTA_Alpha, mDefaults->Alpha,
|
DTA_Alpha, mDefaults->Alpha,
|
||||||
DTA_TranslationIndex, casttranslation,
|
DTA_TranslationIndex, casttranslation,
|
||||||
|
@ -710,13 +709,13 @@ int DIntermissionScreenScroller::Responder (event_t *ev)
|
||||||
|
|
||||||
void DIntermissionScreenScroller::Drawer ()
|
void DIntermissionScreenScroller::Drawer ()
|
||||||
{
|
{
|
||||||
FTexture *tex = TexMan.GetTexture(mFirstPic);
|
auto tex = TexMan.GetGameTexture(mFirstPic);
|
||||||
FTexture *tex2 = TexMan.GetTexture(mSecondPic);
|
auto tex2 = TexMan.GetGameTexture(mSecondPic);
|
||||||
if (mTicker >= mScrollDelay && mTicker < mScrollDelay + mScrollTime && tex != NULL && tex2 != NULL)
|
if (mTicker >= mScrollDelay && mTicker < mScrollDelay + mScrollTime && tex != NULL && tex2 != NULL)
|
||||||
{
|
{
|
||||||
|
// These must round down to the nearest full pixel to cover seams between the two textures.
|
||||||
int fwidth = tex->GetDisplayWidth();
|
int fwidth = (int)tex->GetDisplayWidth();
|
||||||
int fheight = tex->GetDisplayHeight();
|
int fheight = (int)tex->GetDisplayHeight();
|
||||||
|
|
||||||
double xpos1 = 0, ypos1 = 0, xpos2 = 0, ypos2 = 0;
|
double xpos1 = 0, ypos1 = 0, xpos2 = 0, ypos2 = 0;
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ private:
|
||||||
int LastSaved = -1;
|
int LastSaved = -1;
|
||||||
int LastAccessed = -1;
|
int LastAccessed = -1;
|
||||||
TArray<char> SavePicData;
|
TArray<char> SavePicData;
|
||||||
FTexture *SavePic = nullptr;
|
FGameTexture *SavePic = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int WindowSize = 0;
|
int WindowSize = 0;
|
||||||
|
|
|
@ -168,7 +168,7 @@ class Wiper_Burn : public Wiper
|
||||||
public:
|
public:
|
||||||
~Wiper_Burn();
|
~Wiper_Burn();
|
||||||
bool Run(int ticks) override;
|
bool Run(int ticks) override;
|
||||||
void SetTextures(FTexture *startscreen, FTexture *endscreen) override;
|
void SetTextures(FGameTexture *startscreen, FGameTexture *endscreen) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int WIDTH = 64, HEIGHT = 64;
|
static const int WIDTH = 64, HEIGHT = 64;
|
||||||
|
@ -307,8 +307,8 @@ bool Wiper_Melt::Run(int ticks)
|
||||||
// Only draw for the final tick.
|
// Only draw for the final tick.
|
||||||
// No need for optimization. Wipes won't ever be drawn with anything else.
|
// No need for optimization. Wipes won't ever be drawn with anything else.
|
||||||
|
|
||||||
int w = startScreen->GetDisplayWidth();
|
int w = startScreen->GetTexelWidth();
|
||||||
int h = startScreen->GetDisplayHeight();
|
int h = startScreen->GetTexelHeight();
|
||||||
dpt.x = i * w / WIDTH;
|
dpt.x = i * w / WIDTH;
|
||||||
dpt.y = MAX(0, y[i] * h / HEIGHT);
|
dpt.y = MAX(0, y[i] * h / HEIGHT);
|
||||||
rect.left = dpt.x;
|
rect.left = dpt.x;
|
||||||
|
@ -331,12 +331,12 @@ bool Wiper_Melt::Run(int ticks)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void Wiper_Burn::SetTextures(FTexture *startscreen, FTexture *endscreen)
|
void Wiper_Burn::SetTextures(FGameTexture *startscreen, FGameTexture *endscreen)
|
||||||
{
|
{
|
||||||
startScreen = startscreen;
|
startScreen = startscreen;
|
||||||
endScreen = endscreen;
|
endScreen = endscreen;
|
||||||
BurnTexture = new FBurnTexture(WIDTH, HEIGHT);
|
BurnTexture = new FBurnTexture(WIDTH, HEIGHT);
|
||||||
auto mat = FMaterial::ValidateTexture(endScreen, false);
|
auto mat = FMaterial::ValidateTexture(endScreen->GetTexture(), false);
|
||||||
mat->AddTextureLayer(BurnTexture);
|
mat->AddTextureLayer(BurnTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ bool Wiper_Burn::Run(int ticks)
|
||||||
}
|
}
|
||||||
|
|
||||||
BurnTexture->CleanHardwareTextures(true, true);
|
BurnTexture->CleanHardwareTextures(true, true);
|
||||||
endScreen->CleanHardwareTextures(false, false);
|
endScreen->GetTexture()->CleanHardwareTextures(false, false);
|
||||||
|
|
||||||
const uint8_t *src = BurnArray;
|
const uint8_t *src = BurnArray;
|
||||||
uint32_t *dest = (uint32_t *)BurnTexture->GetBuffer();
|
uint32_t *dest = (uint32_t *)BurnTexture->GetBuffer();
|
||||||
|
|
|
@ -43,11 +43,11 @@ enum
|
||||||
class Wiper
|
class Wiper
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
FTexture *startScreen = nullptr, *endScreen = nullptr;
|
FGameTexture *startScreen = nullptr, *endScreen = nullptr;
|
||||||
public:
|
public:
|
||||||
virtual ~Wiper();
|
virtual ~Wiper();
|
||||||
virtual bool Run(int ticks) = 0;
|
virtual bool Run(int ticks) = 0;
|
||||||
virtual void SetTextures(FTexture *startscreen, FTexture *endscreen)
|
virtual void SetTextures(FGameTexture *startscreen, FGameTexture *endscreen)
|
||||||
{
|
{
|
||||||
startScreen = startscreen;
|
startScreen = startscreen;
|
||||||
endScreen = endscreen;
|
endScreen = endscreen;
|
||||||
|
|
|
@ -116,7 +116,7 @@ sector_t *SWSceneDrawer::RenderView(player_t *player)
|
||||||
systemTexture->CreateTexture(nullptr, screen->GetWidth(), screen->GetHeight(), 0, false, "swbuffer");
|
systemTexture->CreateTexture(nullptr, screen->GetWidth(), screen->GetHeight(), 0, false, "swbuffer");
|
||||||
|
|
||||||
auto map = swrenderer::CameraLight::Instance()->ShaderColormap();
|
auto map = swrenderer::CameraLight::Instance()->ShaderColormap();
|
||||||
DrawTexture(twod, fbtex.get(), 0, 0, DTA_SpecialColormap, map, TAG_DONE);
|
DrawTexture(twod, reinterpret_cast<FGameTexture*>(fbtex.get()), 0, 0, DTA_SpecialColormap, map, TAG_DONE);
|
||||||
screen->Draw2D();
|
screen->Draw2D();
|
||||||
screen->Clear2D();
|
screen->Clear2D();
|
||||||
screen->PostProcessScene(CM_DEFAULT, [&]() {
|
screen->PostProcessScene(CM_DEFAULT, [&]() {
|
||||||
|
|
|
@ -522,7 +522,7 @@ IHardwareTexture* CreateHardwareTexture()
|
||||||
|
|
||||||
void DrawFrame(F2DDrawer* drawer, int left, int top, int width, int height)
|
void DrawFrame(F2DDrawer* drawer, int left, int top, int width, int height)
|
||||||
{
|
{
|
||||||
FTexture* p;
|
FGameTexture* p;
|
||||||
const gameborder_t* border = &gameinfo.Border;
|
const gameborder_t* border = &gameinfo.Border;
|
||||||
// Sanity check for incomplete gameinfo
|
// Sanity check for incomplete gameinfo
|
||||||
if (border == NULL)
|
if (border == NULL)
|
||||||
|
@ -532,22 +532,22 @@ void DrawFrame(F2DDrawer* drawer, int left, int top, int width, int height)
|
||||||
int bottom = top + height;
|
int bottom = top + height;
|
||||||
|
|
||||||
// Draw top and bottom sides.
|
// Draw top and bottom sides.
|
||||||
p = TexMan.GetTextureByName(border->t);
|
p = TexMan.GetGameTextureByName(border->t);
|
||||||
drawer->AddFlatFill(left, top - p->GetDisplayHeight(), right, top, p, true);
|
drawer->AddFlatFill(left, top - (int)p->GetDisplayHeight(), right, top, p, true);
|
||||||
p = TexMan.GetTextureByName(border->b);
|
p = TexMan.GetGameTextureByName(border->b);
|
||||||
drawer->AddFlatFill(left, bottom, right, bottom + p->GetDisplayHeight(), p, true);
|
drawer->AddFlatFill(left, bottom, right, bottom + (int)p->GetDisplayHeight(), p, true);
|
||||||
|
|
||||||
// Draw left and right sides.
|
// Draw left and right sides.
|
||||||
p = TexMan.GetTextureByName(border->l);
|
p = TexMan.GetGameTextureByName(border->l);
|
||||||
drawer->AddFlatFill(left - p->GetDisplayWidth(), top, left, bottom, p, true);
|
drawer->AddFlatFill(left - (int)p->GetDisplayWidth(), top, left, bottom, p, true);
|
||||||
p = TexMan.GetTextureByName(border->r);
|
p = TexMan.GetGameTextureByName(border->r);
|
||||||
drawer->AddFlatFill(right, top, right + p->GetDisplayWidth(), bottom, p, true);
|
drawer->AddFlatFill(right, top, right + (int)p->GetDisplayWidth(), bottom, p, true);
|
||||||
|
|
||||||
// Draw beveled corners.
|
// Draw beveled corners.
|
||||||
DrawTexture(drawer, TexMan.GetTextureByName(border->tl), left - offset, top - offset, TAG_DONE);
|
DrawTexture(drawer, TexMan.GetGameTextureByName(border->tl), left - offset, top - offset, TAG_DONE);
|
||||||
DrawTexture(drawer, TexMan.GetTextureByName(border->tr), left + width, top - offset, TAG_DONE);
|
DrawTexture(drawer, TexMan.GetGameTextureByName(border->tr), left + width, top - offset, TAG_DONE);
|
||||||
DrawTexture(drawer, TexMan.GetTextureByName(border->bl), left - offset, top + height, TAG_DONE);
|
DrawTexture(drawer, TexMan.GetGameTextureByName(border->bl), left - offset, top + height, TAG_DONE);
|
||||||
DrawTexture(drawer, TexMan.GetTextureByName(border->br), left + width, top + height, TAG_DONE);
|
DrawTexture(drawer, TexMan.GetGameTextureByName(border->br), left + width, top + height, TAG_DONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION(_Screen, DrawFrame)
|
DEFINE_ACTION_FUNCTION(_Screen, DrawFrame)
|
||||||
|
|
|
@ -138,7 +138,7 @@ class DInterBackground : public DObject
|
||||||
int period; // period in tics between animations
|
int period; // period in tics between animations
|
||||||
yahpt_t loc; // location of animation
|
yahpt_t loc; // location of animation
|
||||||
int data; // ALWAYS: n/a, RANDOM: period deviation (<256)
|
int data; // ALWAYS: n/a, RANDOM: period deviation (<256)
|
||||||
TArray<FTexture*> frames; // actual graphics for frames of animations
|
TArray<FGameTexture*> frames; // actual graphics for frames of animations
|
||||||
|
|
||||||
// following must be initialized to zero before use!
|
// following must be initialized to zero before use!
|
||||||
int nexttic; // next value of bcnt (used in conjunction with period)
|
int nexttic; // next value of bcnt (used in conjunction with period)
|
||||||
|
@ -161,9 +161,9 @@ private:
|
||||||
TArray<lnode_t> lnodes;
|
TArray<lnode_t> lnodes;
|
||||||
TArray<in_anim_t> anims;
|
TArray<in_anim_t> anims;
|
||||||
int bcnt = 0; // used for timing of background animation
|
int bcnt = 0; // used for timing of background animation
|
||||||
TArray<FTexture *> yah; // You Are Here graphic
|
TArray<FGameTexture *> yah; // You Are Here graphic
|
||||||
FTexture* splat = nullptr; // splat
|
FGameTexture* splat = nullptr; // splat
|
||||||
FTexture *background = nullptr;
|
FGameTexture *background = nullptr;
|
||||||
wbstartstruct_t *wbs;
|
wbstartstruct_t *wbs;
|
||||||
level_info_t *exitlevel;
|
level_info_t *exitlevel;
|
||||||
|
|
||||||
|
@ -208,15 +208,15 @@ private:
|
||||||
//
|
//
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
||||||
void drawOnLnode(int n, FTexture * c[], int numc)
|
void drawOnLnode(int n, FGameTexture * c[], int numc)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i<numc; i++)
|
for (i = 0; i<numc; i++)
|
||||||
{
|
{
|
||||||
int left;
|
double left;
|
||||||
int top;
|
double top;
|
||||||
int right;
|
double right;
|
||||||
int bottom;
|
double bottom;
|
||||||
|
|
||||||
|
|
||||||
right = c[i]->GetDisplayWidth();
|
right = c[i]->GetDisplayWidth();
|
||||||
|
@ -387,13 +387,13 @@ bool DInterBackground::LoadBackground(bool isenterpic)
|
||||||
|
|
||||||
case 1: // Splat
|
case 1: // Splat
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
splat = TexMan.GetTextureByName(sc.String);
|
splat = TexMan.GetGameTextureByName(sc.String);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: // Pointers
|
case 2: // Pointers
|
||||||
while (sc.GetString() && !sc.Crossed)
|
while (sc.GetString() && !sc.Crossed)
|
||||||
{
|
{
|
||||||
yah.Push(TexMan.GetTextureByName(sc.String));
|
yah.Push(TexMan.GetGameTextureByName(sc.String));
|
||||||
}
|
}
|
||||||
if (sc.Crossed)
|
if (sc.Crossed)
|
||||||
sc.UnGet();
|
sc.UnGet();
|
||||||
|
@ -485,14 +485,14 @@ bool DInterBackground::LoadBackground(bool isenterpic)
|
||||||
if (!sc.CheckString("{"))
|
if (!sc.CheckString("{"))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
an.frames.Push(TexMan.GetTextureByName(sc.String));
|
an.frames.Push(TexMan.GetGameTextureByName(sc.String));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (!sc.CheckString("}"))
|
while (!sc.CheckString("}"))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
an.frames.Push(TexMan.GetTextureByName(sc.String));
|
an.frames.Push(TexMan.GetGameTextureByName(sc.String));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
an.ctr = -1;
|
an.ctr = -1;
|
||||||
|
@ -507,7 +507,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
|
||||||
an.loc.y = sc.Number;
|
an.loc.y = sc.Number;
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
an.frames.Reserve(1); // allocate exactly one element
|
an.frames.Reserve(1); // allocate exactly one element
|
||||||
an.frames[0] = TexMan.GetTextureByName(sc.String);
|
an.frames[0] = TexMan.GetGameTextureByName(sc.String);
|
||||||
anims.Push(an);
|
anims.Push(an);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -523,7 +523,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
|
||||||
texture = TexMan.GetTextureID("INTERPIC", ETextureType::MiscPatch);
|
texture = TexMan.GetTextureID("INTERPIC", ETextureType::MiscPatch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
background = TexMan.GetTexture(texture);
|
background = TexMan.GetGameTexture(texture);
|
||||||
return noautostartmap;
|
return noautostartmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -598,8 +598,8 @@ void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointe
|
||||||
// scale all animations below to fit the size of the base pic
|
// scale all animations below to fit the size of the base pic
|
||||||
// The base pic is always scaled to fit the screen so this allows
|
// The base pic is always scaled to fit the screen so this allows
|
||||||
// placing the animations precisely where they belong on the base pic
|
// placing the animations precisely where they belong on the base pic
|
||||||
animwidth = background->GetDisplayWidthDouble();
|
animwidth = background->GetDisplayWidth();
|
||||||
animheight = background->GetDisplayHeightDouble();
|
animheight = background->GetDisplayHeight();
|
||||||
DrawTexture(twod, background, 0, 0, DTA_Fullscreen, true, TAG_DONE);
|
DrawTexture(twod, background, 0, 0, DTA_Fullscreen, true, TAG_DONE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue