Fix the discolored sky bug

This commit is contained in:
Magnus Norddahl 2022-06-14 03:04:28 +02:00 committed by Rachael Alexanderson
parent be2fe0f304
commit 34f1b23c3f
2 changed files with 10 additions and 3 deletions

View file

@ -127,9 +127,10 @@ FSkyVertexBuffer::FSkyVertexBuffer()
static const FVertexBufferAttribute format[] = {
{ 0, VATTR_VERTEX, VFmt_Float3, (int)myoffsetof(FSkyVertex, x) },
{ 0, VATTR_TEXCOORD, VFmt_Float2, (int)myoffsetof(FSkyVertex, u) },
{ 0, VATTR_COLOR, VFmt_Byte4, (int)myoffsetof(FSkyVertex, color) }
{ 0, VATTR_COLOR, VFmt_Byte4, (int)myoffsetof(FSkyVertex, color) },
{ 0, VATTR_LIGHTMAP, VFmt_Float3, (int)myoffsetof(FSkyVertex, lu) },
};
mVertexBuffer->SetFormat(1, 3, sizeof(FSkyVertex), format);
mVertexBuffer->SetFormat(1, 4, sizeof(FSkyVertex), format);
mVertexBuffer->SetData(mVertices.Size() * sizeof(FSkyVertex), &mVertices[0], BufferUsageType::Static);
}

View file

@ -16,7 +16,7 @@ const int skyoffsetfactor = 57;
struct FSkyVertex
{
float x, y, z, u, v;
float x, y, z, u, v, lu, lv, lindex;
PalEntry color;
void Set(float xx, float zz, float yy, float uu=0, float vv=0, PalEntry col=0xffffffff)
@ -26,6 +26,9 @@ struct FSkyVertex
y = yy;
u = uu;
v = vv;
lu = 0.0f;
lv = 0.0f;
lindex = -1.0f;
color = col;
}
@ -36,6 +39,9 @@ struct FSkyVertex
z = zz;
u = uu;
v = vv;
lu = 0.0f;
lv = 0.0f;
lindex = -1.0f;
color = col;
}