summaryrefslogtreecommitdiff
path: root/src/properties.h
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-07-27 01:02:27 +0200
committerBertram <bertram@cegetel.net>2009-07-27 01:02:27 +0200
commitfa1a3ab995f037ddf33817a1b2ce143130a457f8 (patch)
tree4cfc52364c271a9a318a2fee4b611514d7941476 /src/properties.h
parent7bc30f545784b26594803b559f1d76d5434027ea (diff)
downloadmana-client-fa1a3ab995f037ddf33817a1b2ce143130a457f8.tar.gz
mana-client-fa1a3ab995f037ddf33817a1b2ce143130a457f8.tar.bz2
mana-client-fa1a3ab995f037ddf33817a1b2ce143130a457f8.tar.xz
mana-client-fa1a3ab995f037ddf33817a1b2ce143130a457f8.zip
Added the ability to ask a ambient layer to keep its ratio when the resolution isn't the default.
You'll have to add this in map properties, for instance if you're want to keep ratio on overlay 0: <map version="1.0" orientation="orthogonal" width="128" height="128" tilewidth="32" tileheight="32"> <properties> ... <property name="overlay0keepratio" value="true"/> ... </properties> </map>
Diffstat (limited to 'src/properties.h')
-rw-r--r--src/properties.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/properties.h b/src/properties.h
index a2ce5b88..75335377 100644
--- a/src/properties.h
+++ b/src/properties.h
@@ -74,6 +74,26 @@ class Properties
}
/**
+ * Gets a map property as a boolean.
+ *
+ * @param name The name of the property.
+ * @param def Default value, false by default.
+ * @return the value of the given property, or false when it doesn't
+ * exist.
+ */
+ float getBoolProperty(const std::string &name, bool def = false) const
+ {
+ PropertyMap::const_iterator i = mProperties.find(name);
+ bool ret = def;
+ if (i != mProperties.end())
+ {
+ if (i->second == "true")
+ ret = true;
+ }
+ return ret;
+ }
+
+ /**
* Returns whether a certain property is available.
*
* @param name The name of the property.