- reworked how the software renderer manages its textures.
* it's no longer the main texture objects managing the pixel buffer but FSoftwareTexture. * create proper spans for true color textures. The paletted spans only match if the image does not have any translucent pixels. * create proper warp textures instead of working off the paletted variants. As a side effect, caching of pixel buffers for texture composition is temporarily disabled, as it management of texture redirections. These things will be reimplemented once things progress further. The existing methods here had their share of serious issues that should be fixed.
This commit is contained in:
parent
69cc1f831c
commit
82bd742ea3
31 changed files with 322 additions and 506 deletions
|
|
@ -53,7 +53,6 @@ public:
|
|||
Height = vertical ? 256 : 2;
|
||||
bMasked = false;
|
||||
bTranslucent = false;
|
||||
PixelsAreStatic = 2; // The alpha buffer is static, but if this gets used as a regular texture, a separate buffer needs to be made.
|
||||
|
||||
// Fill the column/row with shading values.
|
||||
// Vertical shaders have have minimum alpha at the top
|
||||
|
|
@ -100,24 +99,24 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t *MakeTexture(FRenderStyle style) override
|
||||
TArray<uint8_t> Get8BitPixels(bool alphatex) override
|
||||
{
|
||||
if (style.Flags & STYLEF_RedIsAlpha)
|
||||
TArray<uint8_t> Pix(512, true);
|
||||
if (alphatex)
|
||||
{
|
||||
return Pixels;
|
||||
memcpy(Pix.Data(), Pixels, 512);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Since this presents itself to the game as a regular named texture
|
||||
// it can easily be used on walls and flats and should work as such,
|
||||
// even if it makes little sense.
|
||||
auto Pix = new uint8_t[512];
|
||||
for (int i = 0; i < 512; i++)
|
||||
{
|
||||
Pix[i] = GrayMap[Pixels[i]];
|
||||
}
|
||||
return Pix;
|
||||
}
|
||||
return Pix;
|
||||
}
|
||||
|
||||
int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf = NULL) override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue