mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-15 00:51:24 +00:00
Don't copy the SkyDrawerArgs members now that drawer args are grouped by drawer family
This commit is contained in:
parent
f76a039a76
commit
218708571e
2 changed files with 30 additions and 47 deletions
|
@ -547,32 +547,20 @@ namespace swrenderer
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PalSkyCommand::PalSkyCommand(const SkyDrawerArgs &args)
|
PalSkyCommand::PalSkyCommand(const SkyDrawerArgs &args) : args(args)
|
||||||
{
|
{
|
||||||
_dest = args.Dest();
|
|
||||||
_dest_y = args.DestY();
|
|
||||||
_count = args.Count();
|
|
||||||
_source = args.FrontTexturePixels();
|
|
||||||
_source2 = args.BackTexturePixels();
|
|
||||||
_sourceheight[0] = args.FrontTextureHeight();
|
|
||||||
_sourceheight[1] = args.BackTextureHeight();
|
|
||||||
_iscale = args.TextureVStep();
|
|
||||||
_texturefrac = args.TextureVPos();
|
|
||||||
solid_top = args.SolidTopColor();
|
|
||||||
solid_bottom = args.SolidBottomColor();
|
|
||||||
fadeSky = args.FadeSky();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawSingleSky1PalCommand::Execute(DrawerThread *thread)
|
void DrawSingleSky1PalCommand::Execute(DrawerThread *thread)
|
||||||
{
|
{
|
||||||
uint8_t *dest = _dest;
|
uint8_t *dest = args.Dest();
|
||||||
int count = _count;
|
int count = args.Count();
|
||||||
int pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
|
int pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
|
||||||
const uint8_t *source0 = _source;
|
const uint8_t *source0 = args.FrontTexturePixels();
|
||||||
int textureheight0 = _sourceheight[0];
|
int textureheight0 = args.FrontTextureHeight();
|
||||||
|
|
||||||
int32_t frac = _texturefrac;
|
int32_t frac = args.TextureVPos();
|
||||||
int32_t fracstep = _iscale;
|
int32_t fracstep = args.TextureVStep();
|
||||||
|
|
||||||
// Find bands for top solid color, top fade, center textured, bottom fade, bottom solid color:
|
// Find bands for top solid color, top fade, center textured, bottom fade, bottom solid color:
|
||||||
int start_fade = 2; // How fast it should fade out
|
int start_fade = 2; // How fast it should fade out
|
||||||
|
@ -587,15 +575,15 @@ namespace swrenderer
|
||||||
end_fadebottom_y = clamp(end_fadebottom_y, 0, count);
|
end_fadebottom_y = clamp(end_fadebottom_y, 0, count);
|
||||||
|
|
||||||
int num_cores = thread->num_cores;
|
int num_cores = thread->num_cores;
|
||||||
int skipped = thread->skipped_by_thread(_dest_y);
|
int skipped = thread->skipped_by_thread(args.DestY());
|
||||||
dest = thread->dest_for_thread(_dest_y, pitch, dest);
|
dest = thread->dest_for_thread(args.DestY(), pitch, dest);
|
||||||
frac += fracstep * skipped;
|
frac += fracstep * skipped;
|
||||||
fracstep *= num_cores;
|
fracstep *= num_cores;
|
||||||
pitch *= num_cores;
|
pitch *= num_cores;
|
||||||
|
|
||||||
if (!fadeSky)
|
if (!args.FadeSky())
|
||||||
{
|
{
|
||||||
count = thread->count_for_thread(_dest_y, count);
|
count = thread->count_for_thread(args.DestY(), count);
|
||||||
|
|
||||||
for (int index = 0; index < count; index++)
|
for (int index = 0; index < count; index++)
|
||||||
{
|
{
|
||||||
|
@ -608,6 +596,9 @@ namespace swrenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t solid_top = args.SolidTopColor();
|
||||||
|
uint32_t solid_bottom = args.SolidBottomColor();
|
||||||
|
|
||||||
int solid_top_r = RPART(solid_top);
|
int solid_top_r = RPART(solid_top);
|
||||||
int solid_top_g = GPART(solid_top);
|
int solid_top_g = GPART(solid_top);
|
||||||
int solid_top_b = BPART(solid_top);
|
int solid_top_b = BPART(solid_top);
|
||||||
|
@ -696,16 +687,16 @@ namespace swrenderer
|
||||||
|
|
||||||
void DrawDoubleSky1PalCommand::Execute(DrawerThread *thread)
|
void DrawDoubleSky1PalCommand::Execute(DrawerThread *thread)
|
||||||
{
|
{
|
||||||
uint8_t *dest = _dest;
|
uint8_t *dest = args.Dest();
|
||||||
int count = _count;
|
int count = args.Count();
|
||||||
int pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
|
int pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
|
||||||
const uint8_t *source0 = _source;
|
const uint8_t *source0 = args.FrontTexturePixels();
|
||||||
const uint8_t *source1 = _source2;
|
const uint8_t *source1 = args.BackTexturePixels();
|
||||||
int textureheight0 = _sourceheight[0];
|
int textureheight0 = args.FrontTextureHeight();
|
||||||
uint32_t maxtextureheight1 = _sourceheight[1] - 1;
|
uint32_t maxtextureheight1 = args.BackTextureHeight() - 1;
|
||||||
|
|
||||||
int32_t frac = _texturefrac;
|
int32_t frac = args.TextureVPos();
|
||||||
int32_t fracstep = _iscale;
|
int32_t fracstep = args.TextureVStep();
|
||||||
|
|
||||||
// Find bands for top solid color, top fade, center textured, bottom fade, bottom solid color:
|
// Find bands for top solid color, top fade, center textured, bottom fade, bottom solid color:
|
||||||
int start_fade = 2; // How fast it should fade out
|
int start_fade = 2; // How fast it should fade out
|
||||||
|
@ -720,15 +711,15 @@ namespace swrenderer
|
||||||
end_fadebottom_y = clamp(end_fadebottom_y, 0, count);
|
end_fadebottom_y = clamp(end_fadebottom_y, 0, count);
|
||||||
|
|
||||||
int num_cores = thread->num_cores;
|
int num_cores = thread->num_cores;
|
||||||
int skipped = thread->skipped_by_thread(_dest_y);
|
int skipped = thread->skipped_by_thread(args.DestY());
|
||||||
dest = thread->dest_for_thread(_dest_y, pitch, dest);
|
dest = thread->dest_for_thread(args.DestY(), pitch, dest);
|
||||||
frac += fracstep * skipped;
|
frac += fracstep * skipped;
|
||||||
fracstep *= num_cores;
|
fracstep *= num_cores;
|
||||||
pitch *= num_cores;
|
pitch *= num_cores;
|
||||||
|
|
||||||
if (!fadeSky)
|
if (!args.FadeSky())
|
||||||
{
|
{
|
||||||
count = thread->count_for_thread(_dest_y, count);
|
count = thread->count_for_thread(args.DestY(), count);
|
||||||
|
|
||||||
for (int index = 0; index < count; index++)
|
for (int index = 0; index < count; index++)
|
||||||
{
|
{
|
||||||
|
@ -748,6 +739,9 @@ namespace swrenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t solid_top = args.SolidTopColor();
|
||||||
|
uint32_t solid_bottom = args.SolidBottomColor();
|
||||||
|
|
||||||
int solid_top_r = RPART(solid_top);
|
int solid_top_r = RPART(solid_top);
|
||||||
int solid_top_g = GPART(solid_top);
|
int solid_top_g = GPART(solid_top);
|
||||||
int solid_top_b = BPART(solid_top);
|
int solid_top_b = BPART(solid_top);
|
||||||
|
|
|
@ -37,18 +37,7 @@ namespace swrenderer
|
||||||
FString DebugInfo() override { return "PalSkyCommand"; }
|
FString DebugInfo() override { return "PalSkyCommand"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint32_t solid_top;
|
SkyDrawerArgs args;
|
||||||
uint32_t solid_bottom;
|
|
||||||
bool fadeSky;
|
|
||||||
|
|
||||||
uint8_t *_dest;
|
|
||||||
int _dest_y;
|
|
||||||
int _count;
|
|
||||||
const uint8_t *_source;
|
|
||||||
const uint8_t *_source2;
|
|
||||||
int _sourceheight[2];
|
|
||||||
uint32_t _iscale;
|
|
||||||
uint32_t _texturefrac;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DrawSingleSky1PalCommand : public PalSkyCommand { public: using PalSkyCommand::PalSkyCommand; void Execute(DrawerThread *thread) override; };
|
class DrawSingleSky1PalCommand : public PalSkyCommand { public: using PalSkyCommand::PalSkyCommand; void Execute(DrawerThread *thread) override; };
|
||||||
|
|
Loading…
Reference in a new issue