Remade sprite rendering

Added VertexColor shader flag
Added color sprite attribute
Added VertexStruct_XY_Color(_UV) struct & declaration


Former-commit-id: b664f4520aa55f4502f85f9dedab9b92040a8c16
This commit is contained in:
Lynix
2015-01-04 13:19:07 +01:00
parent 97ff9bc4ac
commit 4de17fdffb
22 changed files with 264 additions and 145 deletions

View File

@@ -205,6 +205,21 @@ bool NzVertexDeclaration::Initialize()
NazaraAssert(declaration->GetStride() == sizeof(NzVertexStruct_XYZ), "Invalid stride for declaration nzVertexLayout_XYZ");
// nzVertexLayout_XYZ_Color : NzVertexStruct_XYZ_Color
declaration = &s_declarations[nzVertexLayout_XYZ_Color_UV];
declaration->EnableComponent(nzVertexComponent_Position, nzComponentType_Float3, NzOffsetOf(NzVertexStruct_XYZ_Color, position));
declaration->EnableComponent(nzVertexComponent_Color, nzComponentType_Color, NzOffsetOf(NzVertexStruct_XYZ_Color, color));
NazaraAssert(declaration->GetStride() == sizeof(NzVertexStruct_XYZ_Color), "Invalid stride for declaration nzVertexLayout_XYZ_Color");
// nzVertexLayout_XYZ_Color_UV : NzVertexStruct_XYZ_Color_UV
declaration = &s_declarations[nzVertexLayout_XYZ_Color_UV];
declaration->EnableComponent(nzVertexComponent_Position, nzComponentType_Float3, NzOffsetOf(NzVertexStruct_XYZ_Color_UV, position));
declaration->EnableComponent(nzVertexComponent_Color, nzComponentType_Color, NzOffsetOf(NzVertexStruct_XYZ_Color_UV, color));
declaration->EnableComponent(nzVertexComponent_TexCoord, nzComponentType_Float2, NzOffsetOf(NzVertexStruct_XYZ_Color_UV, uv));
NazaraAssert(declaration->GetStride() == sizeof(NzVertexStruct_XYZ_Color_UV), "Invalid stride for declaration nzVertexLayout_XYZ_Color_UV");
// nzVertexLayout_XYZ_Normal : NzVertexStruct_XYZ_Normal
declaration = &s_declarations[nzVertexLayout_XYZ_Normal];
declaration->EnableComponent(nzVertexComponent_Position, nzComponentType_Float3, NzOffsetOf(NzVertexStruct_XYZ_Normal, position));