removed unecessary colors arr
This commit is contained in:
@@ -24,18 +24,18 @@ DffModel::~DffModel() {}
|
||||
// Methods
|
||||
// ----
|
||||
|
||||
u32 DffModel::getDrawData(u32 splitIndex, VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, VECTOR *o_colors, Vector3 &t_cameraPos, float t_scale, u8 t_shouldBeBackfaceCulled)
|
||||
u32 DffModel::getDrawData(u32 splitIndex, VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, Vector3 &t_cameraPos, float t_scale, u8 t_shouldBeBackfaceCulled)
|
||||
{
|
||||
u32 result = 0;
|
||||
for (u32 i = 0; i < clump.geometryList.geometries[0].extension.materialSplit.splitInformation[splitIndex].faceIndex; i++)
|
||||
fillNextFace(o_vertices, o_normals, o_coordinates, o_colors, 0,
|
||||
fillNextFace(o_vertices, o_normals, o_coordinates, 0,
|
||||
clump.geometryList.geometries[0].extension.materialSplit.splitInformation[splitIndex].vertexInformation[i].vertex1,
|
||||
result++);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void DffModel::fillNextFace(VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, VECTOR *o_colors, u8 geometry, u32 t_getI, u32 t_setI)
|
||||
void DffModel::fillNextFace(VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, u8 geometry, u32 t_getI, u32 t_setI)
|
||||
{
|
||||
o_vertices[t_setI][0] = clump.geometryList.geometries[geometry].data.vertexInformation[t_getI].x;
|
||||
o_vertices[t_setI][1] = clump.geometryList.geometries[geometry].data.vertexInformation[t_getI].y;
|
||||
@@ -51,9 +51,4 @@ void DffModel::fillNextFace(VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coo
|
||||
o_coordinates[t_setI][1] = 1.0F - clump.geometryList.geometries[geometry].data.textureMappingInformation[t_getI].v;
|
||||
o_coordinates[t_setI][2] = 1.0F;
|
||||
o_coordinates[t_setI][3] = 1.0F;
|
||||
|
||||
o_colors[t_setI][0] = 1.0F;
|
||||
o_colors[t_setI][1] = 1.0F;
|
||||
o_colors[t_setI][2] = 1.0F;
|
||||
o_colors[t_setI][3] = 1.0F;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ MD2Model::~MD2Model()
|
||||
// Methods
|
||||
// ----
|
||||
|
||||
u32 MD2Model::getCurrentFrameData(VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, VECTOR *o_colors, Vector3 &t_cameraPos, float t_scale, u8 t_shouldBeBackfaceCulled)
|
||||
u32 MD2Model::getCurrentFrameData(VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, Vector3 &t_cameraPos, float t_scale, u8 t_shouldBeBackfaceCulled)
|
||||
{
|
||||
u32 i = 0;
|
||||
animState.interpolation += animState.speed;
|
||||
@@ -109,11 +109,6 @@ u32 MD2Model::getCurrentFrameData(VECTOR *o_vertices, VECTOR *o_normals, VECTOR
|
||||
o_coordinates[i][1] = 1.0F - coordinates[CURR_COORD].y;
|
||||
o_coordinates[i][2] = 1.0F;
|
||||
o_coordinates[i][3] = 1.0F;
|
||||
|
||||
o_colors[i][0] = 1.0F;
|
||||
o_colors[i][1] = 1.0F;
|
||||
o_colors[i][2] = 1.0F;
|
||||
o_colors[i][3] = 1.0F;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,14 +208,14 @@ void Mesh::loadTextures(char *t_subfolder, char *t_extension)
|
||||
}
|
||||
|
||||
// TODO refactor
|
||||
u32 Mesh::getDrawData(u32 splitIndex, VECTOR *t_vertices, VECTOR *t_normals, VECTOR *t_coordinates, VECTOR *t_colors, Vector3 &t_cameraPos)
|
||||
u32 Mesh::getDrawData(u32 splitIndex, VECTOR *t_vertices, VECTOR *t_normals, VECTOR *t_coordinates, Vector3 &t_cameraPos)
|
||||
{
|
||||
if (isMd2Loaded)
|
||||
return md2->getCurrentFrameData(t_vertices, t_normals, t_coordinates, t_colors, t_cameraPos, scale, shouldBeBackfaceCulled);
|
||||
return md2->getCurrentFrameData(t_vertices, t_normals, t_coordinates, t_cameraPos, scale, shouldBeBackfaceCulled);
|
||||
else if (isObjLoaded)
|
||||
return obj->getDrawData(splitIndex, t_vertices, t_normals, t_coordinates, t_colors, t_cameraPos, scale, shouldBeBackfaceCulled);
|
||||
return obj->getDrawData(splitIndex, t_vertices, t_normals, t_coordinates, t_cameraPos, scale, shouldBeBackfaceCulled);
|
||||
else if (isDffLoaded)
|
||||
return dff->getDrawData(splitIndex, t_vertices, t_normals, t_coordinates, t_colors, t_cameraPos, scale, shouldBeBackfaceCulled);
|
||||
return dff->getDrawData(splitIndex, t_vertices, t_normals, t_coordinates, t_cameraPos, scale, shouldBeBackfaceCulled);
|
||||
PRINT_ERR("Can't get draw data, because no 3D model was loaded!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void ObjModel::animate()
|
||||
}
|
||||
}
|
||||
|
||||
u32 ObjModel::getDrawData(u32 t_materialIndex, VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, VECTOR *o_colors, Vector3 &t_cameraPos, float t_scale, u8 t_shouldBeBackfaceCulled)
|
||||
u32 ObjModel::getDrawData(u32 t_materialIndex, VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, Vector3 &t_cameraPos, float t_scale, u8 t_shouldBeBackfaceCulled)
|
||||
{
|
||||
#define CURR_FRAME frames[animState.currentFrame]
|
||||
#define NEXT_FRAME frames[animState.nextFrame]
|
||||
@@ -107,12 +107,7 @@ u32 ObjModel::getDrawData(u32 t_materialIndex, VECTOR *o_vertices, VECTOR *o_nor
|
||||
o_coordinates[addedFaces][0] = CURR_FRAME.coordinates[MATERIAL.getStFace(matI + vertI)].x;
|
||||
o_coordinates[addedFaces][1] = CURR_FRAME.coordinates[MATERIAL.getStFace(matI + vertI)].y;
|
||||
o_coordinates[addedFaces][2] = 1.0F;
|
||||
o_coordinates[addedFaces][3] = 1.0F;
|
||||
|
||||
o_colors[addedFaces][0] = 1.0F;
|
||||
o_colors[addedFaces][1] = 1.0F;
|
||||
o_colors[addedFaces][2] = 1.0F;
|
||||
o_colors[addedFaces++][3] = 1.0F;
|
||||
o_coordinates[addedFaces++][3] = 1.0F;
|
||||
}
|
||||
}
|
||||
return addedFaces;
|
||||
|
||||
Reference in New Issue
Block a user