93 Commits

Author SHA1 Message Date
sapier
6f040716cc Added lua tracebacks to some errors where you have been blind to what… (#5043)
* Added lua tracebacks to some errors where you have been blind to what actually went wrong
2017-01-15 13:36:53 +01:00
Ner'zhul
14a094c1a2 Environment & IGameDef code refactoring (#4985)
* Environment code refactoring
* Cleanup includes & class declarations in client & server environment to improve build speed
* ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts.
* Cleanup IGameDef
  * Move ITextureSource* IGameDef::getTextureSource() to Client only.
  * Also move ITextureSource *IGameDef::tsrc() helper
  * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call
  * drop unused emerge() call
  * cleanup server unused functions (mentionned before)
* Drop one unused parameter from ContentFeatures::updateTextures
* move checkLocalPrivilege to Client
* Remove some unnecessary casts
* create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it
* Fix some comments
* Change required IGameDef to Server/Client pointers
* Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects
* Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu
* drop ClientMap::sectorWasDrawn which is unused
2017-01-09 20:39:22 +01:00
Dániel Juhász
675911971a Fix unnecessary block loading (#4847)
This commit makes the game load blocks only if they are not in the
memory.
2016-12-18 19:20:23 +10:00
Loic Blot
17bad192fe Replace various std::map with UNORDERED_MAP + various cleanups
This is part 2 for 5f084cd98d7b3326b51320455364337539710efd

Other improvements:

* Use the defined ItemGroupList when used
* make Client::checkPrivilege const
* inline some trivial functions
* Add ActiveObjectMap typedef
* Add SettingsEntries typedef
2016-10-05 10:53:19 +02:00
kwolekr
7af0dede5f Add MapSettingsManager and new mapgen setting script API functions
This commit refactors the majority of the Mapgen settings system.
- MapgenParams is now owned by MapSettingsManager, itself a part of ServerMap,
  instead of the EmergeManager.
- New Script API functions added:
    core.get_mapgen_setting
    core.get_mapgen_setting_noiseparams,
    core.set_mapgen_setting, and
    core.set_mapgen_setting_noiseparams.
- minetest.get/set_mapgen_params are deprecated by the above new functions.
- It is now possible to view and modify any arbitrary mapgen setting from a mod,
  rather than the base MapgenParams structure.
- MapgenSpecificParams has been removed.
2016-07-03 15:38:36 -04:00
kwolekr
55913a1218 Mapgen: Refactor mapgen creation and management
- Move mapgen creation logic out of EmergeManager and into Mapgen
- Internally represent mapgen type as an enum value, instead of a string
- Remove the need for a MapgenFactory per mapgen
2016-07-03 14:04:11 -04:00
kwolekr
18c17ff1fd Move biome calculation to BiomeGen
BiomeGen defines an interface that, given a set of BiomeParams, computes biomes
for a given area using the algorithm implemented by that specific BiomeGen.
This abstracts away the old system where each mapgen supplied the noises
required for biome generation.
2016-05-27 23:23:58 -04:00
paramat
2a92bccd00 FindSpawnPos: Let mapgens decide what spawn altitude is suitable
To avoid spawn search failing in new specialised mapgens
Increase spawn search range to 4000 nodes
Add getSpawnLevelAtPoint() functions to EmergeManager, class Mapgen
and all mapgens
Remove getGroundLevelAtPoint() functions from all mapgens except mgv6
(possibly to be re-added later in the correct form to return actual
ground level)
Make mgvalleys flag names consistent with other mapgens
Remove now unused 'vertical spawn range' setting
2016-02-09 07:14:45 +00:00
kwolekr
90137292cb EmergeManager: Do not queue duplicate block requests 2016-01-19 04:18:06 -05:00
Duane Robertson
ab1e7d3f8e Add Valleys mapgen. 2016-01-14 05:04:29 +00:00
paramat
05e4f39c40 Mgflat: Set blank default spflags. Unhide 2016-01-10 04:07:47 +00:00
paramat
4d4d5a7370 Mgfractal: Move julia set selection into formula parameter
Improve default parameters
Update and improve documentation
Unhide mapgen, but is still unstable
2015-11-23 00:34:09 +00:00
paramat
5b0fdfaa00 Mapgen: Add flat mapgen in hidden form 2015-11-11 09:37:54 +00:00
kwolekr
dbb1dffa98 Refactor Thread class to improve readability and portability
- Fix some incompatibilities with obscure platforms (AIX and WinCE)
- Clean up Thread class interface
- Add m_ prefix to private member variables
- Simplify platform-dependent logic, reducing preprocessor
  conditional clauses and improving readibility
- Add Thread class documentation
2015-10-16 23:43:29 -04:00
ShadowNinja
85dbe50ec1 Rename macros with two leading underscores
These names are reserved for the compiler/library implementations.
2015-10-14 02:39:37 -04:00
ShadowNinja
324f309a49 Always use errorstream for DEBUG_EXCEPTION_HANDLER 2015-10-14 02:33:30 -04:00
paramat
beaa87fb1c Mapgen: Add 4D fractal mapgen 2015-10-06 06:43:04 +01:00
kwolekr
321e32b612 Allow setting chunksize in core.set_mapgen_params 2015-10-04 17:26:08 -04:00
kwolekr
3272113636 Hide mapgens from main menu not intended for end users 2015-10-04 17:11:41 -04:00
kwolekr
8c2bf6e89b Add emerge completion callback mechanism
Major refactor of emerge.cpp and Map::init/finishBlockMake
2015-10-04 16:27:50 -04:00
kwolekr
23316c9f92 Add /emergeblocks command and core.emerge_area() Lua API 2015-09-23 15:56:24 -04:00
ShadowNinja
098d28aa5e Clean up threading
* Rename everything.
    * Strip J prefix.
    * Change UpperCamelCase functions to lowerCamelCase.
  * Remove global (!) semaphore count mutex on OSX.
  * Remove semaphore count getter (unused, unsafe, depended on internal
    API functions on Windows, and used a hack on OSX).
  * Add `Atomic<type>`.
  * Make `Thread` handle thread names.
  * Add support for C++11 multi-threading.
  * Combine pthread and win32 sources.
  * Remove `ThreadStarted` (unused, unneeded).
  * Move some includes from the headers to the sources.
  * Move all of `Event` into its header (allows inlining with no new includes).
  * Make `Event` use `Semaphore` (except on Windows).
  * Move some porting functions into `Thread`.
  * Integrate logging with `Thread`.
  * Add threading test.
2015-08-23 22:04:06 -04:00
Břetislav Štec
ecbbc8a1a2 Prepend "Lua: " before lua exceptions
src/server.cpp
src/emerge.cpp
2015-08-02 02:17:37 -04:00
sfan5
023fd295d5 Revert the upper-case PROJECT_NAME nonsense that was part of #2402 2015-04-27 16:24:49 +02:00
Craig Robbins
0731f9ed2a Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
ShadowNinja
2de60ae349 Clean up and tweak build system
* Combine client and server man pages.
  * Update unit test options and available databases in man page.
  * Add `--worldname` to man page.
  * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`.
  * Disable server build by default on all operating systems.
  * Make `ENABLE_FREETYPE` not fail if FreeType isn't found.
  * Enable LevelDB, Redis, and FreeType detection by default.
  * Remove the `VERSION_PATCH_ORIG` hack.
  * Add option to search for and use system JSONCPP.
  * Remove broken LuaJIT version detection.
  * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`.
  * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`.
  * Clean up style of CMake files.
2015-03-27 15:00:48 -04:00
ngosang
55e479a807 Respect game mapgen flags and save world noise params 2015-03-07 15:53:39 -05:00
fz72
714e41c831 Fix map_seed not changed when creating a new world after login to another 2015-02-18 08:57:14 +01:00
kwolekr
a4b0f2d481 Randomly generate seed if field blank for any Settings instance 2015-02-01 02:05:39 -05:00
kwolekr
2b098f9dd8 Write common mapgen params to map_meta.txt on world initialization 2015-01-27 22:29:28 -05:00
sapier
fbca8ce3fd Fix emerge thread not cleaning up emerge queue on shutdown 2015-01-07 12:19:48 +01:00
kwolekr
b9066cd7f3 Fix some lingering code style issues 2014-12-29 22:04:47 -05:00
kwolekr
8d748e5bf5 Mapgen: Use getBlockSeed2() for blockseeds (much better uniformity) 2014-12-29 21:44:52 -05:00
kwolekr
6a136cf876 Add core.get_mapgen_names() to Main Menu API (and use it)
Also rewrite mapgen registration for static initialization
2014-12-29 21:23:51 -05:00
kwolekr
eb208e6b75 Expose mapgen parameters on scripting init
Add minetest.get_mapgen_params()
Deprecate minetest.register_on_mapgen_init()
2014-12-29 12:59:59 -05:00
kwolekr
66c691836a Biomes: Make biome heat and humidity noise parameters user-configurable 2014-12-09 00:38:04 -05:00
kwolekr
4f8d54e249 Rewrite generate notification mechanism
Add support for notify-on-decoration
Clean up mapgen constructors
Clean up mapgen.cpp code style somewhat
Remove trailing whitespace from some files
2014-12-06 13:53:35 -05:00
kwolekr
bb5f0e46bd Add Generator Element Management framework
Add BiomeManager, OreManager, DecorationManager, and SchematicManager
2014-11-12 23:02:41 -05:00
paramat
28ed3ea7c4 Add mgv5. New noise code, uses biome API. Eased 3d noise for terrain, caves, blobs 2014-11-08 21:37:26 +01:00
Kahrl
7b6cfc3cad Include mg_decoration.h, mg_ore.h from emerge.cpp to fix warnings 2014-11-02 17:52:30 +01:00
kwolekr
08068ac0c6 Split up mapgen.cpp 2014-11-01 13:16:23 -04:00
kwolekr
4f31a0ef47 Add NodeResolver and clean up node name -> content ID resolution system 2014-10-26 23:55:45 -04:00
ShadowNinja
dbf9e444b1 Split settings into seperate source and header files
This also cleans up settings a bit
2014-09-21 14:39:35 -04:00
proller
b2306abb3d Remove indev mapgen 2014-07-12 18:21:54 +04:00
proller
447cc35283 Remove math mapgen 2014-07-12 18:15:55 +04:00
PilzAdam
af16b6c591 Fix memory leak in EmergeManager 2014-07-06 15:41:59 +02:00
Sfan5
3f90a81374 Fix all warnings reported by clang 2014-04-15 21:34:53 +02:00
sapier
607f617471 Add support for named threads (atm linux only) 2014-04-09 21:32:21 +02:00
kwolekr
d48f851863 Add minetest.set_noiseparam_defaults() Lua API 2014-02-15 19:13:14 -05:00
kwolekr
2a896ffbf7 Make flag strings clear specified flag with 'no' prefix
Remove flagmask field from set_mapgen_params table
Add small bits of needed documentation
2014-02-08 17:50:59 -05:00