Added true color texture support for walls and floors
This commit is contained in:
parent
c59db95cc8
commit
05b6fe6174
9 changed files with 506 additions and 178 deletions
|
|
@ -45,6 +45,7 @@
|
|||
#include "v_video.h"
|
||||
#include "m_fixed.h"
|
||||
#include "textures/textures.h"
|
||||
#include "v_palette.h"
|
||||
|
||||
typedef bool (*CheckFunc)(FileReader & file);
|
||||
typedef FTexture * (*CreateFunc)(FileReader & file, int lumpnum);
|
||||
|
|
@ -175,6 +176,33 @@ FTexture::~FTexture ()
|
|||
KillNative();
|
||||
}
|
||||
|
||||
const uint32_t *FTexture::GetColumnBgra(unsigned int column, const Span **spans_out)
|
||||
{
|
||||
const uint32_t *pixels = GetPixelsBgra();
|
||||
|
||||
column %= Width;
|
||||
if (column < 0)
|
||||
column += Width;
|
||||
|
||||
if (spans_out != nullptr)
|
||||
GetColumn(column, spans_out);
|
||||
return pixels + column * Height;
|
||||
}
|
||||
|
||||
const uint32_t *FTexture::GetPixelsBgra()
|
||||
{
|
||||
if (BgraPixels.empty())
|
||||
{
|
||||
const BYTE *indices = GetPixels();
|
||||
BgraPixels.resize(Width * Height);
|
||||
for (int i = 0; i < Width * Height; i++)
|
||||
{
|
||||
BgraPixels[i] = GPalette.BaseColors[indices[i]].d;
|
||||
}
|
||||
}
|
||||
return BgraPixels.data();
|
||||
}
|
||||
|
||||
bool FTexture::CheckModified ()
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue