commented out drawByPath3() (obsolete)

This commit is contained in:
h4570
2020-12-28 14:23:51 +01:00
parent 6e09741d19
commit 1b6e1e94ee
2 changed files with 67 additions and 63 deletions
+29 -29
View File
@@ -64,39 +64,39 @@ public:
/** 2D draw. */ /** 2D draw. */
void draw(Sprite &t_sprite); void draw(Sprite &t_sprite);
/// --- Draw: PATH3 /// --- OBSOLETE
/** // /**
* WARNING: THIS FUNC CAUSE VISUAL ARTIFACTS! // * WARNING: THIS FUNC CAUSE VISUAL ARTIFACTS!
* Draw many meshes with lighting information. // * Draw many meshes with lighting information.
* Slowest way of rendering (PATH 3, using EE and GIF). // * Slowest way of rendering (PATH 3, using EE and GIF).
* NOTICE: Animation supported, lighting supported // * NOTICE: Animation supported, lighting supported
*/ // */
void drawByPath3(Mesh *t_meshes, u16 t_amount, LightBulb *t_bulbs, u16 t_bulbsCount); // void drawByPath3(Mesh *t_meshes, u16 t_amount, LightBulb *t_bulbs, u16 t_bulbsCount);
/** // /**
* WARNING: THIS FUNC CAUSE VISUAL ARTIFACTS! // * WARNING: THIS FUNC CAUSE VISUAL ARTIFACTS!
* Draw mesh with lighting information. // * Draw mesh with lighting information.
* Slowest way of rendering (PATH 3, using EE and GIF). // * Slowest way of rendering (PATH 3, using EE and GIF).
* NOTICE: Animation supported, lighting supported // * NOTICE: Animation supported, lighting supported
*/ // */
void drawByPath3(Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount); // void drawByPath3(Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount);
/** // /**
* WARNING: THIS FUNC CAUSE VISUAL ARTIFACTS! // * WARNING: THIS FUNC CAUSE VISUAL ARTIFACTS!
* Draw many meshes without lighting information. // * Draw many meshes without lighting information.
* Slowest way of rendering (PATH 3, using EE and GIF). // * Slowest way of rendering (PATH 3, using EE and GIF).
* NOTICE: Animation supported, lighting supported // * NOTICE: Animation supported, lighting supported
*/ // */
void drawByPath3(Mesh *t_meshes, u16 t_amount); // void drawByPath3(Mesh *t_meshes, u16 t_amount);
/** // /**
* WARNING: THIS FUNC CAUSE VISUAL ARTIFACTS! // * WARNING: THIS FUNC CAUSE VISUAL ARTIFACTS!
* Draw mesh without lighting information. // * Draw mesh without lighting information.
* Slowest way of rendering (PATH 3, using EE and GIF). // * Slowest way of rendering (PATH 3, using EE and GIF).
* NOTICE: Animation supported, lighting supported // * NOTICE: Animation supported, lighting supported
*/ // */
void drawByPath3(Mesh &t_mesh); // void drawByPath3(Mesh &t_mesh);
/// --- Draw: PATH1 /// --- Draw: PATH1
+38 -34
View File
@@ -227,43 +227,47 @@ void Renderer::allocateBuffers(int t_screenW, int t_screenH)
/// --- Draw: PATH3 /// --- Draw: PATH3
void Renderer::drawByPath3(Mesh *t_meshes, u16 t_amount, LightBulb *t_bulbs, u16 t_bulbsCount) // Obsolete
{ // void Renderer::drawByPath3(Mesh *t_meshes, u16 t_amount, LightBulb *t_bulbs, u16 t_bulbsCount)
for (u16 i = 0; i < t_amount; i++) // {
drawByPath3(t_meshes[i], t_bulbs, t_bulbsCount); // for (u16 i = 0; i < t_amount; i++)
} // drawByPath3(t_meshes[i], t_bulbs, t_bulbsCount);
// }
void Renderer::drawByPath3(Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount) // Obsolete
{ // void Renderer::drawByPath3(Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount)
beginFrameIfNeeded(); // {
if (!t_mesh.isDataLoaded()) // beginFrameIfNeeded();
PRINT_ERR("Can't draw, because no mesh data was loaded!"); // if (!t_mesh.isDataLoaded())
if (t_mesh.getCurrentAnimationFrame() != t_mesh.getNextAnimationFrame()) // PRINT_ERR("Can't draw, because no mesh data was loaded!");
t_mesh.animate(); // if (t_mesh.getCurrentAnimationFrame() != t_mesh.getNextAnimationFrame())
for (u32 i = 0; i < t_mesh.getMaterialsCount(); i++) // t_mesh.animate();
{ // for (u32 i = 0; i < t_mesh.getMaterialsCount(); i++)
MeshMaterial *material = &t_mesh.getMaterial(i); // {
if (t_mesh.shouldBeFrustumCulled && !material->isInFrustum(renderData.frustumPlanes, t_mesh.position)) // MeshMaterial *material = &t_mesh.getMaterial(i);
return; // if (t_mesh.shouldBeFrustumCulled && !material->isInFrustum(renderData.frustumPlanes, t_mesh.position))
Texture *tex = textureRepo.getBySpriteOrMesh(material->getId()); // return;
changeTexture(tex); // Texture *tex = textureRepo.getBySpriteOrMesh(material->getId());
gifSender->initPacket(context); // changeTexture(tex);
u32 vertCount = material->getFacesCount(); // gifSender->initPacket(context);
VECTOR *vertices = new VECTOR[vertCount]; // u32 vertCount = material->getFacesCount();
VECTOR *normals = new VECTOR[vertCount]; // VECTOR *vertices = new VECTOR[vertCount];
VECTOR *coordinates = new VECTOR[vertCount]; // VECTOR *normals = new VECTOR[vertCount];
vertCount = t_mesh.getDrawData(i, vertices, normals, coordinates, *renderData.cameraPosition); // VECTOR *coordinates = new VECTOR[vertCount];
gifSender->addObject(&renderData, t_mesh, vertCount, vertices, normals, coordinates, t_bulbs, t_bulbsCount, &textureBuffer, &material->color); // vertCount = t_mesh.getDrawData(i, vertices, normals, coordinates, *renderData.cameraPosition);
gifSender->sendPacket(); // gifSender->addObject(&renderData, t_mesh, vertCount, vertices, normals, coordinates, t_bulbs, t_bulbsCount, &textureBuffer, &material->color);
delete[] vertices; // gifSender->sendPacket();
delete[] normals; // delete[] vertices;
delete[] coordinates; // delete[] normals;
} // delete[] coordinates;
} // }
// }
void Renderer::drawByPath3(Mesh *t_meshes, u16 t_amount) { drawByPath3(t_meshes, t_amount, NULL, 0); } // Obsolete
// void Renderer::drawByPath3(Mesh *t_meshes, u16 t_amount) { drawByPath3(t_meshes, t_amount, NULL, 0); }
void Renderer::drawByPath3(Mesh &t_mesh) { drawByPath3(t_mesh, NULL, 0); } // Obsolete
// void Renderer::drawByPath3(Mesh &t_mesh) { drawByPath3(t_mesh, NULL, 0); }
/// --- Draw: PATH1 /// --- Draw: PATH1