Pica: Remove geometry dumper (PICA_DUMP_GEOMETRY)
This commit is contained in:
parent
0b7efc2be2
commit
ff7c798d86
4 changed files with 0 additions and 71 deletions
|
@ -85,35 +85,6 @@ std::shared_ptr<DebugContext> g_debug_context; // TODO: Get rid of this global
|
|||
|
||||
namespace DebugUtils {
|
||||
|
||||
void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) {
|
||||
vertices.push_back(v0);
|
||||
vertices.push_back(v1);
|
||||
vertices.push_back(v2);
|
||||
|
||||
int num_vertices = (int)vertices.size();
|
||||
faces.push_back({{ num_vertices-3, num_vertices-2, num_vertices-1 }});
|
||||
}
|
||||
|
||||
void GeometryDumper::Dump() {
|
||||
static int index = 0;
|
||||
std::string filename = std::string("geometry_dump") + std::to_string(++index) + ".obj";
|
||||
|
||||
std::ofstream file(filename);
|
||||
|
||||
for (const auto& vertex : vertices) {
|
||||
file << "v " << vertex.pos[0]
|
||||
<< " " << vertex.pos[1]
|
||||
<< " " << vertex.pos[2] << std::endl;
|
||||
}
|
||||
|
||||
for (const Face& face : faces) {
|
||||
file << "f " << 1+face.index[0]
|
||||
<< " " << 1+face.index[1]
|
||||
<< " " << 1+face.index[2] << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, const Shader::ShaderSetup& setup, const Regs::VSOutputAttributes* output_attributes)
|
||||
{
|
||||
struct StuffToWrite {
|
||||
|
|
|
@ -158,30 +158,9 @@ extern std::shared_ptr<DebugContext> g_debug_context; // TODO: Get rid of this g
|
|||
|
||||
namespace DebugUtils {
|
||||
|
||||
#define PICA_DUMP_GEOMETRY 0
|
||||
#define PICA_DUMP_TEXTURES 0
|
||||
#define PICA_LOG_TEV 0
|
||||
|
||||
// Simple utility class for dumping geometry data to an OBJ file
|
||||
class GeometryDumper {
|
||||
public:
|
||||
struct Vertex {
|
||||
std::array<float,3> pos;
|
||||
};
|
||||
|
||||
void AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2);
|
||||
|
||||
void Dump();
|
||||
|
||||
private:
|
||||
struct Face {
|
||||
int index[3];
|
||||
};
|
||||
|
||||
std::vector<Vertex> vertices;
|
||||
std::vector<Face> faces;
|
||||
};
|
||||
|
||||
void DumpShader(const std::string& filename, const Regs::ShaderConfig& config,
|
||||
const Shader::ShaderSetup& setup, const Regs::VSOutputAttributes* output_attributes);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue