aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 27a491428..4204c2a02 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1879,10 +1879,17 @@ ServerMap::ServerMap(std::string savedir):
//m_chunksize = 8; // Takes a few seconds
- m_seed = (((u64)(myrand()%0xffff)<<0)
- + ((u64)(myrand()%0xffff)<<16)
- + ((u64)(myrand()%0xffff)<<32)
- + ((u64)(myrand()%0xffff)<<48));
+ if (g_settings.get("fixed_map_seed").empty())
+ {
+ m_seed = (((u64)(myrand()%0xffff)<<0)
+ + ((u64)(myrand()%0xffff)<<16)
+ + ((u64)(myrand()%0xffff)<<32)
+ + ((u64)(myrand()%0xffff)<<48));
+ }
+ else
+ {
+ m_seed = g_settings.getU64("fixed_map_seed");
+ }
/*
Experimental and debug stuff
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
/*
Minetest
Copyright (C) 2010-2014 sapier <sapier at gmx dot net>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __FONTENGINE_H__
#define __FONTENGINE_H__

#include <map>
#include <vector>
#include "IGUIFont.h"
#include "IGUISkin.h"
#include "IGUIEnvironment.h"
#include "settings.h"

#define FONT_SIZE_UNSPECIFIED 0xFFFFFFFF

enum FontMode {
	FM_Standard = 0,
	FM_Mono,
	FM_Fallback,
	FM_Simple,
	FM_SimpleMono,
	FM_MaxMode,
	FM_Unspecified
};

class FontEngine
{
public:

	FontEngine(Settings* main_settings, gui::IGUIEnvironment* env);

	~FontEngine();

	/** get Font */
	irr::gui::IGUIFont* getFont(unsigned int font_size=FONT_SIZE_UNSPECIFIED,
			FontMode mode=FM_Unspecified);

	/** get text height for a specific font */
	unsigned int getTextHeight(unsigned int font_size=FONT_SIZE_UNSPECIFIED,
			FontMode mode=FM_Unspecified);

	/** get text width if a text for a specific font */
	unsigned int getTextWidth(const std::string& text,
			unsigned int font_size=FONT_SIZE_UNSPECIFIED,
			FontMode mode=FM_Unspecified)
	{
		return getTextWidth(utf8_to_wide(text));
	}