summaryrefslogtreecommitdiff
path: root/src/resources/map/map.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-12-22 02:03:59 +0300
committerAndrei Karas <akaras@inbox.ru>2017-12-22 02:03:59 +0300
commit5133814218de74d57c7febadf61b3ab05216dc25 (patch)
tree60b88270c9a50ef333fefed38c805baab00429a1 /src/resources/map/map.cpp
parentcc7a39f467a49b2e91717739cb6e7c3c4b34a245 (diff)
downloadmanaverse-5133814218de74d57c7febadf61b3ab05216dc25.tar.gz
manaverse-5133814218de74d57c7febadf61b3ab05216dc25.tar.bz2
manaverse-5133814218de74d57c7febadf61b3ab05216dc25.tar.xz
manaverse-5133814218de74d57c7febadf61b3ab05216dc25.zip
Remove default parameters from properties.h
Diffstat (limited to 'src/resources/map/map.cpp')
-rw-r--r--src/resources/map/map.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index 39365643d..56483486f 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -244,23 +244,23 @@ void Map::initializeAmbientLayers() restrict2
}
Image *restrict const img = Loader::getImage(
- getProperty(name + "image"));
+ getProperty(name + "image", std::string()));
if (img != nullptr)
{
- int mask = atoi(getProperty(name + "mask").c_str());
+ int mask = atoi(getProperty(name + "mask", std::string()).c_str());
if (mask == 0)
mask = 1;
- const float parallax = getFloatProperty(name + "parallax");
+ const float parallax = getFloatProperty(name + "parallax", 0.0F);
mForegrounds.push_back(new AmbientLayer(
name,
img,
getFloatProperty(name + "parallaxX", parallax),
getFloatProperty(name + "parallaxY", parallax),
- getFloatProperty(name + "posX"),
- getFloatProperty(name + "posY"),
- getFloatProperty(name + "scrollX"),
- getFloatProperty(name + "scrollY"),
- getBoolProperty(name + "keepratio"),
+ getFloatProperty(name + "posX", 0.0F),
+ getFloatProperty(name + "posY", 0.0F),
+ getFloatProperty(name + "scrollX", 0.0F),
+ getFloatProperty(name + "scrollY", 0.0F),
+ getBoolProperty(name + "keepratio", false),
mask));
// The AmbientLayer takes control over the image.
@@ -274,25 +274,25 @@ void Map::initializeAmbientLayers() restrict2
{
const std::string name("background" + toString(i));
Image *restrict const img = Loader::getImage(
- getProperty(name + "image"));
+ getProperty(name + "image", std::string()));
if (img != nullptr)
{
- int mask = atoi(getProperty(name + "mask").c_str());
+ int mask = atoi(getProperty(name + "mask", std::string()).c_str());
if (mask == 0)
mask = 1;
- const float parallax = getFloatProperty(name + "parallax");
+ const float parallax = getFloatProperty(name + "parallax", 0.0F);
mBackgrounds.push_back(new AmbientLayer(
name,
img,
getFloatProperty(name + "parallaxX", parallax),
getFloatProperty(name + "parallaxY", parallax),
- getFloatProperty(name + "posX"),
- getFloatProperty(name + "posY"),
- getFloatProperty(name + "scrollX"),
- getFloatProperty(name + "scrollY"),
- getBoolProperty(name + "keepratio"),
+ getFloatProperty(name + "posX", 0.0F),
+ getFloatProperty(name + "posY", 0.0F),
+ getFloatProperty(name + "scrollX", 0.0F),
+ getFloatProperty(name + "scrollY", 0.0F),
+ getBoolProperty(name + "keepratio", false),
mask));
// The AmbientLayer takes control over the image.
@@ -822,27 +822,27 @@ void Map::removeActor(const Actors::iterator &restrict iterator) restrict2
const std::string Map::getMusicFile() const restrict2
{
- return getProperty("music");
+ return getProperty("music", std::string());
}
const std::string Map::getName() const restrict2
{
if (hasProperty("name"))
- return getProperty("name");
+ return getProperty("name", std::string());
- return getProperty("mapname");
+ return getProperty("mapname", std::string());
}
const std::string Map::getFilename() const restrict2
{
- const std::string fileName = getProperty("_filename");
+ const std::string fileName = getProperty("_filename", std::string());
const size_t lastSlash = fileName.rfind('/') + 1;
return fileName.substr(lastSlash, fileName.rfind('.') - lastSlash);
}
const std::string Map::getGatName() const restrict2
{
- const std::string fileName = getProperty("_filename");
+ const std::string fileName = getProperty("_filename", std::string());
const size_t lastSlash = fileName.rfind('/') + 1;
return fileName.substr(lastSlash,
fileName.rfind('.') - lastSlash).append(".gat");
@@ -1258,7 +1258,7 @@ void Map::saveExtraLayer() const restrict2
std::string Map::getUserMapDirectory() const restrict2
{
return pathJoin(settings.serverConfigDir,
- getProperty("_realfilename"));
+ getProperty("_realfilename", std::string()));
}
void Map::addRange(const std::string &restrict name,