Build: fix some compiler warnings for g++.
This commit is contained in:
@@ -87,11 +87,16 @@ static const std::string MaterialExt = ".mtl";
|
||||
ObjExporter::ObjExporter(const char* _filename, const aiScene* pScene)
|
||||
: filename(_filename)
|
||||
, pScene(pScene)
|
||||
, endl("\n")
|
||||
, vp()
|
||||
, vn()
|
||||
, vt()
|
||||
, vc() {
|
||||
, vc()
|
||||
, vpMap()
|
||||
, vnMap()
|
||||
, vtMap()
|
||||
, vcMap()
|
||||
, meshes()
|
||||
, endl("\n") {
|
||||
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
||||
const std::locale& l = std::locale("C");
|
||||
mOutput.imbue(l);
|
||||
|
||||
@@ -98,16 +98,13 @@ private:
|
||||
void WriteHeader(std::ostringstream& out);
|
||||
void WriteMaterialFile();
|
||||
void WriteGeometryFile();
|
||||
|
||||
std::string GetMaterialName(unsigned int index);
|
||||
|
||||
void AddMesh(const aiString& name, const aiMesh* m, const aiMatrix4x4& mat);
|
||||
void AddNode(const aiNode* nd, const aiMatrix4x4& mParent);
|
||||
|
||||
private:
|
||||
std::string filename;
|
||||
const aiScene* const pScene;
|
||||
|
||||
std::vector<aiVector3D> vp, vn, vt;
|
||||
std::vector<aiColor4D> vc;
|
||||
|
||||
|
||||
+12
-15
@@ -66,7 +66,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <map>
|
||||
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
static const aiImporterDesc desc = {
|
||||
@@ -80,25 +79,26 @@ static const aiImporterDesc desc = {
|
||||
"sib"
|
||||
};
|
||||
|
||||
struct SIBChunk
|
||||
{
|
||||
struct SIBChunk {
|
||||
uint32_t Tag;
|
||||
uint32_t Size;
|
||||
} PACK_STRUCT;
|
||||
|
||||
enum { POS, NRM, UV, N };
|
||||
enum {
|
||||
POS,
|
||||
NRM,
|
||||
UV,
|
||||
N
|
||||
};
|
||||
|
||||
typedef std::pair<uint32_t, uint32_t> SIBPair;
|
||||
static SIBPair makePair(uint32_t a, uint32_t b) { return (a<b) ? SIBPair(a, b) : SIBPair(b, a); }
|
||||
|
||||
struct SIBEdge
|
||||
{
|
||||
struct SIBEdge {
|
||||
uint32_t faceA, faceB;
|
||||
bool creased;
|
||||
};
|
||||
|
||||
struct SIBMesh
|
||||
{
|
||||
struct SIBMesh {
|
||||
aiMatrix4x4 axis;
|
||||
uint32_t numPts;
|
||||
std::vector<aiVector3D> pos, nrm, uv;
|
||||
@@ -109,15 +109,13 @@ struct SIBMesh
|
||||
std::map<SIBPair, uint32_t> edgeMap;
|
||||
};
|
||||
|
||||
struct SIBObject
|
||||
{
|
||||
struct SIBObject {
|
||||
aiString name;
|
||||
aiMatrix4x4 axis;
|
||||
size_t meshIdx, meshCount;
|
||||
};
|
||||
|
||||
struct SIB
|
||||
{
|
||||
struct SIB {
|
||||
std::vector<aiMaterial*> mtls;
|
||||
std::vector<aiMesh*> meshes;
|
||||
std::vector<aiLight*> lights;
|
||||
@@ -125,8 +123,7 @@ struct SIB
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static SIBEdge& GetEdge(SIBMesh* mesh, uint32_t posA, uint32_t posB)
|
||||
{
|
||||
static SIBEdge& GetEdge(SIBMesh* mesh, uint32_t posA, uint32_t posB) {
|
||||
SIBPair pair = (posA < posB) ? SIBPair(posA, posB) : SIBPair(posB, posA);
|
||||
std::map<SIBPair, uint32_t>::iterator it = mesh->edgeMap.find(pair);
|
||||
if (it != mesh->edgeMap.end())
|
||||
|
||||
Reference in New Issue
Block a user