mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-18 18:21:13 +00:00
- move PrepareTexture out of the inner drawer loops
This commit is contained in:
parent
64bdc8c495
commit
80f9c81e36
8 changed files with 8 additions and 6 deletions
|
@ -292,6 +292,7 @@ namespace swrenderer
|
||||||
// draw the columns one at a time
|
// draw the columns one at a time
|
||||||
if (visible)
|
if (visible)
|
||||||
{
|
{
|
||||||
|
Thread->PrepareTexture(tex);
|
||||||
for (int x = x1; x < x2; ++x)
|
for (int x = x1; x < x2; ++x)
|
||||||
{
|
{
|
||||||
if (cameraLight->FixedColormap() == nullptr && cameraLight->FixedLightLevel() < 0)
|
if (cameraLight->FixedColormap() == nullptr && cameraLight->FixedLightLevel() < 0)
|
||||||
|
|
|
@ -163,6 +163,9 @@ namespace swrenderer
|
||||||
drawerargs.SetLight(&NormalLight, 0, 0);
|
drawerargs.SetLight(&NormalLight, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Thread->PrepareTexture(frontskytex);
|
||||||
|
Thread->PrepareTexture(backskytex);
|
||||||
|
|
||||||
DrawSky(pl);
|
DrawSky(pl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,6 +301,7 @@ namespace swrenderer
|
||||||
|
|
||||||
if (visible)
|
if (visible)
|
||||||
{
|
{
|
||||||
|
thread->PrepareTexture(WallSpriteTile);
|
||||||
while (x < x2)
|
while (x < x2)
|
||||||
{
|
{
|
||||||
if (calclighting)
|
if (calclighting)
|
||||||
|
|
|
@ -628,6 +628,7 @@ namespace swrenderer
|
||||||
short *mceilingclip = zeroarray;
|
short *mceilingclip = zeroarray;
|
||||||
|
|
||||||
fixed_t frac = startfrac;
|
fixed_t frac = startfrac;
|
||||||
|
thread->PrepareTexture(pic);
|
||||||
for (int x = x1; x < x2; x++)
|
for (int x = x1; x < x2; x++)
|
||||||
{
|
{
|
||||||
drawerargs.DrawMaskedColumn(thread, x, iscale, pic, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, false);
|
drawerargs.DrawMaskedColumn(thread, x, iscale, pic, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, false);
|
||||||
|
|
|
@ -343,6 +343,7 @@ namespace swrenderer
|
||||||
{
|
{
|
||||||
RenderTranslucentPass *translucentPass = thread->TranslucentPass.get();
|
RenderTranslucentPass *translucentPass = thread->TranslucentPass.get();
|
||||||
|
|
||||||
|
thread->PrepareTexture(tex);
|
||||||
while (x < x2)
|
while (x < x2)
|
||||||
{
|
{
|
||||||
if (!translucentPass->ClipSpriteColumnWithPortals(x, vis))
|
if (!translucentPass->ClipSpriteColumnWithPortals(x, vis))
|
||||||
|
|
|
@ -232,6 +232,7 @@ namespace swrenderer
|
||||||
{
|
{
|
||||||
RenderTranslucentPass *translucentPass = thread->TranslucentPass.get();
|
RenderTranslucentPass *translucentPass = thread->TranslucentPass.get();
|
||||||
|
|
||||||
|
thread->PrepareTexture(WallSpriteTile);
|
||||||
while (x < x2)
|
while (x < x2)
|
||||||
{
|
{
|
||||||
if (calclighting)
|
if (calclighting)
|
||||||
|
|
|
@ -36,7 +36,6 @@ namespace swrenderer
|
||||||
|
|
||||||
void SkyDrawerArgs::SetFrontTexture(RenderThread *thread, FTexture *texture, uint32_t column)
|
void SkyDrawerArgs::SetFrontTexture(RenderThread *thread, FTexture *texture, uint32_t column)
|
||||||
{
|
{
|
||||||
thread->PrepareTexture(texture);
|
|
||||||
if (thread->Viewport->RenderTarget->IsBgra())
|
if (thread->Viewport->RenderTarget->IsBgra())
|
||||||
{
|
{
|
||||||
dc_source = (const uint8_t *)texture->GetColumnBgra(column, nullptr);
|
dc_source = (const uint8_t *)texture->GetColumnBgra(column, nullptr);
|
||||||
|
@ -51,7 +50,6 @@ namespace swrenderer
|
||||||
|
|
||||||
void SkyDrawerArgs::SetBackTexture(RenderThread *thread, FTexture *texture, uint32_t column)
|
void SkyDrawerArgs::SetBackTexture(RenderThread *thread, FTexture *texture, uint32_t column)
|
||||||
{
|
{
|
||||||
thread->PrepareTexture(texture);
|
|
||||||
if (texture == nullptr)
|
if (texture == nullptr)
|
||||||
{
|
{
|
||||||
dc_source2 = nullptr;
|
dc_source2 = nullptr;
|
||||||
|
|
|
@ -62,8 +62,6 @@ namespace swrenderer
|
||||||
dc_iscale = iscale;
|
dc_iscale = iscale;
|
||||||
dc_textureheight = tex->GetHeight();
|
dc_textureheight = tex->GetHeight();
|
||||||
|
|
||||||
thread->PrepareTexture(tex);
|
|
||||||
|
|
||||||
const FTexture::Span *span;
|
const FTexture::Span *span;
|
||||||
const uint8_t *column;
|
const uint8_t *column;
|
||||||
if (viewport->RenderTarget->IsBgra() && !drawer_needs_pal_input)
|
if (viewport->RenderTarget->IsBgra() && !drawer_needs_pal_input)
|
||||||
|
@ -134,8 +132,6 @@ namespace swrenderer
|
||||||
dc_x = x;
|
dc_x = x;
|
||||||
dc_iscale = iscale;
|
dc_iscale = iscale;
|
||||||
|
|
||||||
thread->PrepareTexture(tex);
|
|
||||||
|
|
||||||
// Normalize to 0-1 range:
|
// Normalize to 0-1 range:
|
||||||
double uv_stepd = FIXED2DBL(dc_iscale);
|
double uv_stepd = FIXED2DBL(dc_iscale);
|
||||||
double v_step = uv_stepd / tex->GetHeight();
|
double v_step = uv_stepd / tex->GetHeight();
|
||||||
|
|
Loading…
Reference in a new issue