mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Get rid of the DecodedVertex struct.
This commit is contained in:
parent
7f880a62ce
commit
c4ca9b5956
2 changed files with 29 additions and 19 deletions
|
@ -22,12 +22,32 @@
|
|||
|
||||
#include "VertexDecoder.h"
|
||||
|
||||
void PrintDecodedVertex(const DecodedVertex &vtx, u32 vtype) {
|
||||
if (vtype & GE_VTYPE_NRM_MASK) printf("N: %f %f %f\n", vtx.normal[0], vtx.normal[1], vtx.normal[2]);
|
||||
if (vtype & GE_VTYPE_TC_MASK) printf("TC: %f %f\n", vtx.uv[0], vtx.uv[1]);
|
||||
if (vtype & GE_VTYPE_COL_MASK) printf("C: %02x %02x %02x %02x\n", vtx.color[0], vtx.color[1], vtx.color[2], vtx.color[3]);
|
||||
if (vtype & GE_VTYPE_WEIGHT_MASK) printf("W: TODO\n");
|
||||
printf("P: %f %f %f\n", vtx.pos[0], vtx.pos[1], vtx.pos[2]);
|
||||
void PrintDecodedVertex(VertexReader &vtx) {
|
||||
if (vtx.hasNormal())
|
||||
{
|
||||
float nrm[3];
|
||||
vtx.ReadNrm(nrm);
|
||||
printf("N: %f %f %f\n", nrm[0], nrm[1], nrm[2]);
|
||||
}
|
||||
if (vtx.hasUV()) {
|
||||
float uv[2];
|
||||
vtx.ReadUV(uv);
|
||||
printf("TC: %f %f\n", uv[0], uv[1]);
|
||||
}
|
||||
if (vtx.hasColor0()) {
|
||||
float col0[4];
|
||||
vtx.ReadColor0(col0);
|
||||
printf("C0: %f %f %f %f\n", col0[0], col0[1], col0[2], col0[3]);
|
||||
}
|
||||
if (vtx.hasColor0()) {
|
||||
float col1[3];
|
||||
vtx.ReadColor1(col1);
|
||||
printf("C1: %f %f %f\n", col1[0], col1[1], col1[2]);
|
||||
}
|
||||
// Etc..
|
||||
float pos[3];
|
||||
vtx.ReadPos(pos);
|
||||
printf("P: %f %f %f\n", pos[0], pos[1], pos[2]);
|
||||
}
|
||||
|
||||
const int tcsize[4] = {0,2,4,8}, tcalign[4] = {0,1,2,4};
|
||||
|
|
|
@ -50,16 +50,6 @@ struct DecVtxFormat {
|
|||
short stride;
|
||||
};
|
||||
|
||||
// This is going away soon enough.
|
||||
struct DecodedVertex
|
||||
{
|
||||
float pos[3]; // in case of morph, preblend during decode
|
||||
float normal[3]; // in case of morph, preblend during decode
|
||||
float uv[2]; // scaled by uscale, vscale, if there
|
||||
u8 color[4]; // unlit
|
||||
float weights[8]; // ugh, expensive
|
||||
};
|
||||
|
||||
// This struct too.
|
||||
struct TransformedVertex
|
||||
{
|
||||
|
@ -192,12 +182,12 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void ReadColor1(float color[4]) {
|
||||
void ReadColor1(float color[3]) {
|
||||
switch (decFmt_.c1fmt) {
|
||||
case DEC_U8_4:
|
||||
{
|
||||
u8 *p = (u8 *)(data_ + decFmt_.c1off);
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 3; i++)
|
||||
color[i] = p[i] / 255.0f;
|
||||
}
|
||||
break;
|
||||
|
@ -237,6 +227,6 @@ private:
|
|||
};
|
||||
|
||||
// Debugging utilities
|
||||
void PrintDecodedVertex(const DecodedVertex &vtx, u32 vtype);
|
||||
void PrintDecodedVertex(VertexReader &vtx);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue