1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/**
@file constants.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2009-05-20
@edited 2010-01-29
*/
#include "G3D/constants.h"
#include "G3D/Any.h"
#include "G3D/stringutils.h"
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
|