From d33b4826e2111b8de8d3c0c7f458279c9d934d8c Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 20 Apr 2011 12:19:55 -0400 Subject: [PATCH] add WFObj::VertexRef::operator<() --- WFObj.cc | 9 +++++++++ WFObj.h | 1 + 2 files changed, 10 insertions(+) diff --git a/WFObj.cc b/WFObj.cc index 690aa09..1ec8c8f 100644 --- a/WFObj.cc +++ b/WFObj.cc @@ -326,3 +326,12 @@ bool WFObj::loadfile(const char *path, Buffer *buff) { /* TODO */ } + +bool WFObj::VertexRef::operator<(const VertexRef & other) +{ + if (vertex != other.vertex) + return vertex < other.vertex; + if (texture != other.texture) + return texture < other.texture; + return normal < other.normal; +} diff --git a/WFObj.h b/WFObj.h index 02375d5..c1c4b32 100644 --- a/WFObj.h +++ b/WFObj.h @@ -51,6 +51,7 @@ protected: int vertex; int texture; int normal; + bool operator<(const VertexRef & other); }; class Face