diff options
Diffstat (limited to 'dep/g3dlite/source/constants.cpp')
-rw-r--r-- | dep/g3dlite/source/constants.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/dep/g3dlite/source/constants.cpp b/dep/g3dlite/source/constants.cpp index 9ee3eb8736b..53a33faa8ec 100644 --- a/dep/g3dlite/source/constants.cpp +++ b/dep/g3dlite/source/constants.cpp @@ -11,6 +11,34 @@ namespace G3D { + const char* PrimitiveType::toString(int i, Value& v) { + static const char* str[] = {"POINTS", "LINES", "LINE_STRIP", "TRIANGLES", "TRIANGLE_FAN", "QUADS", "QUAD_STRIP", NULL}; + static const Value val[] = {POINTS, LINES, LINE_STRIP, TRIANGLES, TRIANGLE_FAN, QUADS, QUAD_STRIP}; + const char* s = str[i]; + if (s) { + v = val[i]; + } + return s; + } + const char* RefractionQuality::toString(int i, Value& v) { + static const char* str[] = {"NONE", "STATIC_ENV", "DYNAMIC_FLAT", "DYNAMIC_FLAT_MULTILAYER", "DYNAMIC_ENV", "BEST", NULL}; + static const Value val[] = {NONE, STATIC_ENV, DYNAMIC_FLAT, DYNAMIC_FLAT_MULTILAYER, DYNAMIC_ENV, BEST}; + const char* s = str[i]; + if (s) { + v = val[i]; + } + return s; + } + + const char* MirrorQuality::toString(int i, Value& v) { + static const char* str[] = {"NONE", "STATIC_ENV", "DYNAMIC_PLANAR", "DYNAMIC_ENV", "BEST", NULL}; + static const Value val[] = {NONE, STATIC_ENV, DYNAMIC_PLANAR, DYNAMIC_ENV, BEST}; + const char* s = str[i]; + if (s) { + v = val[i]; + } + return s; + } } // G3D |