Add settings storage to geometry sets

This adds the ability for geometry sets to store build settings that can
be automatically applied when they are loaded. This should allow sharing
of .gset files to demonstrate problems with certain settings on certain
files. It also allows people to diagnose problems more easily by being
able to dump their own triangle meshes and settings and load them in the
demo, with all of its visualization options. .gset files can be created
from the current mesh and settings by pressing the 9 key, which will
generate it in the same folder as the input mesh.

Also converts more of the demo to use STL.
This commit is contained in:
Jakob Botsch Nielsen
2016-01-17 20:31:09 +01:00
parent f8d6d3976d
commit a31da928ba
16 changed files with 333 additions and 216 deletions
+4 -6
View File
@@ -19,7 +19,7 @@
#include "MeshLoaderObj.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#define _USE_MATH_DEFINES
#include <math.h>
@@ -135,10 +135,10 @@ static int parseFace(char* row, int* data, int n, int vcnt)
return j;
}
bool rcMeshLoaderObj::load(const char* filename)
bool rcMeshLoaderObj::load(const std::string& filename)
{
char* buf = 0;
FILE* fp = fopen(filename, "rb");
FILE* fp = fopen(filename.c_str(), "rb");
if (!fp)
return false;
fseek(fp, 0, SEEK_END);
@@ -226,8 +226,6 @@ bool rcMeshLoaderObj::load(const char* filename)
}
}
strncpy(m_filename, filename, sizeof(m_filename));
m_filename[sizeof(m_filename)-1] = '\0';
m_filename = filename;
return true;
}