diff options
author | click <none@none> | 2010-06-05 00:59:25 +0200 |
---|---|---|
committer | click <none@none> | 2010-06-05 00:59:25 +0200 |
commit | e77716188861d4aa83b227a90e04a66b63baeb1f (patch) | |
tree | ce72764181a760314ec851f7535052dcf75649db /dep/src/g3dlite/constants.cpp | |
parent | 1426c2970f42a2d065198806f750bf5dd28d580b (diff) |
HIGHLY EXPERIMENTAL - USE AT YOUR OWN RISK
Implement the use of the new vmap3-format by Lynx3d (mad props to you for this, and thanks for the talks earlier)
+ reduced Vmap size to less than one third, and improve precision
+ indoor/outdoor check which allows automatic unmounting of players
+ additional area information from WMOAreaTable.dbc, removed existing "hacks"
+ WMO liquid information for swimming and fishing correctly in buildings/cities/caves/instances (lava and slime WILL hurt from now on!)
- buildfiles for windows are not properly done, and will need to be sorted out
NOTE: Do NOT annoy Lynx3d about this, any issues with this "port" is entirely our fault !
THIS REVISION IS CONSIDERED UNSTABLE AND CONTAINS WORK IN PROGRESS - USE AT YOUR OWN RISK!
--HG--
branch : trunk
Diffstat (limited to 'dep/src/g3dlite/constants.cpp')
-rw-r--r-- | dep/src/g3dlite/constants.cpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/dep/src/g3dlite/constants.cpp b/dep/src/g3dlite/constants.cpp new file mode 100644 index 00000000000..52cad3cd90b --- /dev/null +++ b/dep/src/g3dlite/constants.cpp @@ -0,0 +1,82 @@ +/** + @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 std::string MirrorQuality::str[] = {"NONE", "STATIC_ENV", "DYNAMIC_PLANAR", "DYNAMIC_ENV", "BEST"}; +const MirrorQuality::Value MirrorQuality::enm[] = {MirrorQuality::NONE, MirrorQuality::STATIC_ENV, + MirrorQuality::DYNAMIC_PLANAR, MirrorQuality::DYNAMIC_ENV, MirrorQuality::BEST}; + +MirrorQuality::MirrorQuality(const class Any& any) { + *this = any; +} + + +MirrorQuality& MirrorQuality::operator=(const Any& any) { + const std::string& s = toUpper(any.string()); + + for (int i = 0; ! str[i].empty(); ++i) { + if (s == str[i]) { + value = enm[i]; + return *this; + } + } + + any.verify(false, "Unrecognized MirrorQuality constant"); + return *this; +} + + +MirrorQuality::operator Any() const { + return toString(); +} + + +const std::string& MirrorQuality::toString() const { + return str[value]; +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +const std::string RefractionQuality::str[] = {"NONE", "STATIC_ENV", "DYNAMIC_FLAT", "DYNAMIC_FLAT_MULTILAYER", "DYNAMIC_ENV", "BEST"}; +const RefractionQuality::Value RefractionQuality::enm[] = {RefractionQuality::NONE, RefractionQuality::STATIC_ENV, + RefractionQuality::DYNAMIC_FLAT, RefractionQuality::DYNAMIC_FLAT_MULTILAYER, RefractionQuality::DYNAMIC_ENV, RefractionQuality::BEST}; + +RefractionQuality::RefractionQuality(const class Any& any) { + *this = any; +} + + +RefractionQuality& RefractionQuality::operator=(const Any& any) { + const std::string& s = toUpper(any.string()); + + for (int i = 0; ! str[i].empty(); ++i) { + if (s == str[i]) { + value = enm[i]; + return *this; + } + } + + any.verify(false, "Unrecognized RefractionQuality constant"); + return *this; +} + + +RefractionQuality::operator Any() const { + return toString(); +} + + +const std::string& RefractionQuality::toString() const { + return str[value]; +} + +} // G3D |