oweals/minetest.git
7 years agoAdd LuaEntity on_death callback (#6177)
Loïc Blot [Thu, 27 Jul 2017 09:32:35 +0000 (11:32 +0200)]
Add LuaEntity on_death callback (#6177)

Add LuaEntity on_death callback

This fixes #5474

7 years agoRename previous_was_found to previous_exists
Loic Blot [Thu, 27 Jul 2017 05:36:46 +0000 (07:36 +0200)]
Rename previous_was_found to previous_exists

7 years agoMapBlock::actuallyUpdateDayNightDiff(): little performance optimization
Loic Blot [Wed, 26 Jul 2017 21:50:53 +0000 (23:50 +0200)]
MapBlock::actuallyUpdateDayNightDiff(): little performance optimization

don't check isLightDayNightEq if checked on previous node

7 years agocompressZlib: don't use a SharedBuffer but a raw u8 * pointer
Loic Blot [Wed, 26 Jul 2017 21:37:44 +0000 (23:37 +0200)]
compressZlib: don't use a SharedBuffer but a raw u8 * pointer

Remove usage of the SharedBuffer in zlib compression which has two problems:
* We copied the whole memory block to compress it (not good with mapblocks)
* We copied sometimes strings to SharedBuffer to SharedBuffer (2nd time)

Use this method in MapNode::serializeBulk + optimize serialization but merging 3 identical loops in a single loop

7 years agoMassive performance improvement on correctBlockNodeIds
Loic Blot [Wed, 26 Jul 2017 20:54:55 +0000 (22:54 +0200)]
Massive performance improvement on correctBlockNodeIds

correctBlockNodeIds does 2 lookups for each loaded node, one to translate DB ID to name and a second to translate name to real ID. Name to real ID is very consumming if done on every node. As mapblocks are in most cases composed of many identical adjacent nodes, cache previous source and destination id and use them on the next node to prevent any lookup on those maps.

This reduce the function load from 15% of my CPU usage to ~0.7%, on the test, calls was reduced from 2.5M lookups to 42k lookups, it's a huge performance gain

7 years agoNoise::perlinMap2D,3D: replace a loop init with a single memset call
Loic Blot [Wed, 26 Jul 2017 22:24:14 +0000 (00:24 +0200)]
Noise::perlinMap2D,3D: replace a loop init with a single memset call

7 years agoRemove one unused variable in Server::Receive function
Loic Blot [Wed, 26 Jul 2017 22:16:20 +0000 (00:16 +0200)]
Remove one unused variable in Server::Receive function

7 years agoRemove unused Map::getDayNightDiff + fix one undefined variable in mapblock.cpp
Loic Blot [Wed, 26 Jul 2017 21:11:46 +0000 (23:11 +0200)]
Remove unused Map::getDayNightDiff + fix one undefined variable in mapblock.cpp

7 years agoTileLayer: use shared_ptr for FrameSpec vector (#6171)
Loïc Blot [Wed, 26 Jul 2017 18:12:48 +0000 (20:12 +0200)]
TileLayer: use shared_ptr for FrameSpec vector (#6171)

* TileLayer: use shared_ptr for vector framespec
This reduce memory copy of TileLayer from (4 to 16) * FrameSpec where FrameSpec = (sizeof(int) + 3 * sizeof(ptr)) to int + sizeof(ptr)

Callgrind difference

Before: https://lut.im/RGkiJqQb8T/LeQIEXpAuRzfl7gd.png\ f
After: https://lut.im/bcqmwee1xu/cTwtptY5tRuS9lp0.png

* Fix one push_back to use vector::emplace_back & optimize inclusions

7 years agoVoxelManip cleanups (const ref, const move) + function removal (#6169)
Loïc Blot [Wed, 26 Jul 2017 05:35:09 +0000 (07:35 +0200)]
VoxelManip cleanups (const ref, const move) + function removal (#6169)

* VoxelManip cleanups (const ref, const move) permitting to improve a little bit performance

* VoxelArea: precalculate extent (performance enhancement)

This permits to reduce extend high cost to zero and drop many v3s16 object creation/removal to calculate extent
It rebalance the client thread update to updateFastFaceRow instead of MapBlockMesh generation
This will also benefits to mapgen

7 years agoCreate_schematic documentation: Update for per-node force-place
paramat [Tue, 25 Jul 2017 23:13:36 +0000 (00:13 +0100)]
Create_schematic documentation: Update for per-node force-place

The probability list has to also encode per-node force-place.

7 years agoMgv7: Add 'mount_zero_level' parameter
paramat [Mon, 24 Jul 2017 21:50:42 +0000 (22:50 +0100)]
Mgv7: Add 'mount_zero_level' parameter

Allows setting of the mountain 'zero level' (y where density gradient is zero).

It is easy to vertically shift smooth terrain by editing noise parameter 'offset',
but vertically shifting mountain terrain was complex and imprecise, involving
making a calculation based on an average of the mountain height parameter.

7 years agoMove MapEditEventAreaIgnorer to emerge.cpp
Loic Blot [Tue, 25 Jul 2017 06:39:42 +0000 (08:39 +0200)]
Move MapEditEventAreaIgnorer to emerge.cpp

It's only used in emerge threads and it's a local object, don't expose it to the whole Minetest

7 years agoNetwork protocol: Document settable player collisionbox (#6168)
Paramat [Tue, 25 Jul 2017 05:32:44 +0000 (06:32 +0100)]
Network protocol: Document settable player collisionbox (#6168)

7 years agoClouds API: change speed from 'y' to 'z', ColorSpecs in Lua docs (#6164)
Ben Deutsch [Mon, 24 Jul 2017 16:04:00 +0000 (18:04 +0200)]
Clouds API: change speed from 'y' to 'z', ColorSpecs in Lua docs (#6164)

7 years agoLBM: use range based for and fixed a loop variable overloading in applyLBMs
Loic Blot [Mon, 24 Jul 2017 06:26:19 +0000 (08:26 +0200)]
LBM: use range based for and fixed a loop variable overloading in applyLBMs

7 years agoMgv7: Add option to repeat surface biomes in floatlands
paramat [Thu, 13 Jul 2017 20:03:16 +0000 (21:03 +0100)]
Mgv7: Add option to repeat surface biomes in floatlands

7 years agoPlayer collisionbox: Make settable
TeTpaAka [Fri, 29 May 2015 18:30:55 +0000 (20:30 +0200)]
Player collisionbox: Make settable

Breaks compatibility with old clients.

7 years agoIn-cloud fog: Strengthen effect when small view range is used
Lars Hofhansl [Mon, 10 Jul 2017 13:43:06 +0000 (06:43 -0700)]
In-cloud fog: Strengthen effect when small view range is used

Ensure in-cloud fog is always stronger than outside-of-cloud-fog even when
using a small view range.
Also limit in-cloud fog range to a maximum of 32 nodes to keep it fairly
strong when using a large view range.

7 years agoWindow size: use 1024x600 to avoid a smaller UI
paramat [Mon, 17 Jul 2017 20:19:46 +0000 (21:19 +0100)]
Window size: use 1024x600 to avoid a smaller UI

The change from 800x600 to 1024x576 (16:9) was a reduction in height which caused
user interface to become smaller.
Continue to use width 1024 as it is a common small screen width.

7 years ago[CSM] Add flavour limits controlled by server (#5930)
Loïc Blot [Tue, 18 Jul 2017 19:39:55 +0000 (21:39 +0200)]
[CSM] Add flavour limits controlled by server (#5930)

* [CSM] Add flavour limits controlled by server

Server send flavour limits to client permitting to disable or limit some Lua calls

* Add limits for reading nodedefs and itemdefs

* flavour: Add lookup node limits

* Merge get_node_or_nil into get_node.

Sending fake node doesn't make sense in CSM, just return nil if node is not available for any reason

* Add node range customization when noderange flavour is enabled (default 8 nodes)

* Limit nodes range & disable chat message sending by default

* Bump protocol version

7 years agoCopy lua51.dll (luajit) to bindir (#6148)
adrido [Tue, 18 Jul 2017 19:29:23 +0000 (21:29 +0200)]
Copy lua51.dll (luajit) to bindir (#6148)

7 years agoLBM content mapping map doesn't need to be ordered, use std::unordered_map
Loic Blot [Tue, 18 Jul 2017 06:23:37 +0000 (08:23 +0200)]
LBM content mapping map doesn't need to be ordered, use std::unordered_map

Also rename helper to lbm_map instead of container_map

7 years agoVery little performance fix on correctBlockNodeIds
Loic Blot [Tue, 18 Jul 2017 06:18:13 +0000 (08:18 +0200)]
Very little performance fix on correctBlockNodeIds

+ C++11 codestyle

7 years agoMgfractal: Improve spawning behaviour
paramat [Mon, 17 Jul 2017 16:27:35 +0000 (17:27 +0100)]
Mgfractal: Improve spawning behaviour

Spawn player 1 node higher to avoid spawning waist-deep in a possible
biome 'dust' node, such as tundra snowblock.
Tune default offset to spawn players in a more interesting location on the
mandelbrot sets, on a raised area that looks like a spawn platform.
Tune julia parameters to help avoid spawn search failing, especially for
fractal 6.

7 years agoMesh generation: Fix performance regression caused by 'plantlike_rooted' PR
number Zero [Sun, 16 Jul 2017 20:43:01 +0000 (23:43 +0300)]
Mesh generation: Fix performance regression caused by 'plantlike_rooted' PR

Regression caused by ef285b2815962a7a01791059ed984cb12fdba4dd

7 years agoChat: Move chat text down to not overlap 3rd line of debug text (#6145)
Paramat [Mon, 17 Jul 2017 11:53:14 +0000 (12:53 +0100)]
Chat: Move chat text down to not overlap 3rd line of debug text (#6145)

7 years agoAdd information about the button height
cx384 [Sun, 16 Jul 2017 11:09:27 +0000 (13:09 +0200)]
Add information about the button height

7 years agoF5 debug display: Reformat and remove some information (#6125)
Paramat [Sun, 16 Jul 2017 10:33:09 +0000 (11:33 +0100)]
F5 debug display: Reformat and remove some information (#6125)

For consistency return to 'FPS =', add comma before FPS.
Remove 'R' from 'range_all' as may be re-keymapped.
Remove inconsistent brackets from 'range_all'.
Change 'v_range' to 'view_range'.
Add 'pos = ' before co-ordinates.
Add spaces around '=' in yaw display.
Remove brackets from around 'yaw' and 'seed'.
Move 'pointing_at' to 3rd line.
Remove 'param1' (0 for all solid nodes and unreadable for light sources due to
light bank encoding).
Remove file name of pointed node top tile (this also removes the need to get
ContentFeatures for the node, slightly improving performance).
Replace quotes around node data with brackets, looks better and more consistent.

Add 'guitext3' for third line.
Use 'setVisible' for all 3 lines to control the setting of each text rectangle.
Improve logic of 3rd line to only run code it needs to depending on whether
pointing data is avaialble and whether node is not 'ignore' and not 'unknown'.

7 years agoChat protocol rewrite (#5117)
Loïc Blot [Sun, 16 Jul 2017 08:47:31 +0000 (10:47 +0200)]
Chat protocol rewrite (#5117)

* New TOCLIENT_CHAT_MESSAGE packet

* Rename old packet to TOCLIENT_CHAT_MESSAGE_OLD for compat
* Handle TOCLIENT_CHAT_MESSAGE new structure client side
* Client chat queue should use a specific object
* SendChatMessage: use the right packet depending on protocol version (not complete yet)
* Add chatmessage(type) objects and handle them client side (partially)
* Use ChatMessage instead of std::wstring server side

* Update with timestamp support

7 years agoCamera: Fix wieldmesh glitch after teleporting (#6138)
kilbith [Sat, 15 Jul 2017 18:15:36 +0000 (20:15 +0200)]
Camera: Fix wieldmesh glitch after teleporting (#6138)

7 years agoRevert "CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand""
Loic Blot [Sat, 15 Jul 2017 07:28:10 +0000 (09:28 +0200)]
Revert "CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand""

This reverts commit bdac12761cd92960c3df83c932aa610f2322215f.

7 years agoDefault window size: Increase to 1024x576, aspect ratio 16:9
paramat [Wed, 12 Jul 2017 13:44:58 +0000 (14:44 +0100)]
Default window size: Increase to 1024x576, aspect ratio 16:9

7 years agoCSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand"
rubenwardy [Sun, 2 Jul 2017 19:25:22 +0000 (20:25 +0100)]
CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand"

Original PR: #5747.
This reverts commit 39f4a2f607d44738d60db84eba4b30e3d7450204.

7 years agoSneak: Stripped down version
SmallJoker [Sat, 1 Apr 2017 18:38:14 +0000 (20:38 +0200)]
Sneak: Stripped down version

Fix taking damage caused by sneaking over a nodebox gap.
Fix strange behaviour on stair nodeboxes.
Enable jumping from node edges while sneaking.
Enable movement around corners while sneaking on a 1-node-high groove in a wall.

7 years agoRemove remaining modstore code (#6120)
Elijah Duffy [Fri, 14 Jul 2017 18:37:58 +0000 (11:37 -0700)]
Remove remaining modstore code (#6120)

7 years agoDont search for locale folders if gettext is disabled (#6133)
adrido [Fri, 14 Jul 2017 15:31:18 +0000 (17:31 +0200)]
Dont search for locale folders if gettext is disabled (#6133)

If gettext is disabled, it is defined as 0.

7 years agoAdvanced settings: Reformat noise parameter format example
paramat [Sun, 9 Jul 2017 20:09:41 +0000 (21:09 +0100)]
Advanced settings: Reformat noise parameter format example

Previously the example ran off the edge of the formspec.
Also include 'lacunarity' in the format instead of treating it as an option.

7 years agoBiomes/decorations/ores: Make relative to 'water_level' setting
paramat [Wed, 14 Jun 2017 01:00:51 +0000 (02:00 +0100)]
Biomes/decorations/ores: Make relative to 'water_level' setting

Add 'biome_zero_level' argument to 'generateBiomes()', 'deco_zero_level'
argument to 'placeAllDecos()' and 'ore_zero_level' to 'placeAllOres()'
to allow mapgens to vertically shift the registered biomes, decorations
and ores per-mapchunk.
Will also allow many realm possibilities in future mapgens.

7 years agoAdd 'plantlike_rooted' drawtype
number Zero [Thu, 11 May 2017 20:24:12 +0000 (23:24 +0300)]
Add 'plantlike_rooted' drawtype

Useful for underwater plants.
Node consists of a base cube plus a plantlike extension that can pass through
liquid nodes above without creating air bubbles or interfering with liquid flow.
Uses paramtype2 'leveled', param2 defines height of plantlike extension.

7 years agoMapgen Carpathian: Add lava_depth parameter
vlapsley [Fri, 7 Jul 2017 03:49:55 +0000 (13:49 +1000)]
Mapgen Carpathian: Add lava_depth parameter

7 years agoExpose getPointedThing to Lua
Dániel Juhász [Sat, 23 Jul 2016 19:11:20 +0000 (21:11 +0200)]
Expose getPointedThing to Lua

This commit introduces Raycast, a Lua user object, which can be
used to perform a raycast on the map. The ray is continuable, so one can
also get hidden nodes (for example to see trough glass).

7 years agoMapgen: Add Carpathian mapgen (#6015)
Vaughan Lapsley [Thu, 6 Jul 2017 11:53:56 +0000 (21:53 +1000)]
Mapgen: Add Carpathian mapgen (#6015)

7 years agoFog effect when camera is inside cloud
Ben Deutsch [Sun, 7 May 2017 16:41:47 +0000 (18:41 +0200)]
Fog effect when camera is inside cloud

Fixes issue #3576

* Clouds now take camera position as 3D, not 2D

* Cloud grid filling extracted to gridFilled method

* Clouds detect whether camera is inside cloud

* Camera in cloud changes fog by overriding sky colors
  with cloud color

* Sun, moon and stars can be temporarily disabled
  with setBodiesVisible

* Disabling fog also disables all "inside cloud" behaviors

7 years agoTreegen: Fix s16 overflow warning (#6082)
Vincent Glize [Tue, 4 Jul 2017 21:18:28 +0000 (22:18 +0100)]
Treegen: Fix s16 overflow warning (#6082)

7 years agoMain Menu: Allow copying directories from non-Minetest locations (#6095)
Elijah Duffy [Tue, 4 Jul 2017 07:27:29 +0000 (00:27 -0700)]
Main Menu: Allow copying directories from non-Minetest locations (#6095)

Allow `core.copy_dir` (main menu API) to copy directories from a
non-Minetest location. The check to disallow copying to non-Minetest
locations is retained.

7 years agoCamera: Arm inertia code cleanup (#6094)
kilbith [Tue, 4 Jul 2017 07:25:36 +0000 (09:25 +0200)]
Camera: Arm inertia code cleanup (#6094)

7 years agoFix crash due to missing pointer validation
Loic Blot [Sun, 2 Jul 2017 20:26:25 +0000 (22:26 +0200)]
Fix crash due to missing pointer validation

Fix #6092

7 years agoIrrlicht cleanup: cleanup various object to use RenderingEngine (#6088)
Loïc Blot [Sun, 2 Jul 2017 18:29:58 +0000 (20:29 +0200)]
Irrlicht cleanup: cleanup various object to use RenderingEngine (#6088)

* Irrlicht cleanup: cleanup various object to use RenderingEngine

* CAO doesn't need scenemanager in addToScene
* Camera doesn't need VideoDriver pointer or SceneManager in constructor
* Hud doesn't need driver & scene manager in constructor
* Hud doesn't need scenemanager pointer
* Tile.h doesn't need IrrlichtDevice header (just SMaterial)
* WieldMeshSceneNode: only take scene, we always use scene root node as parent

7 years agoCamera: Improve arm inertia
Jean-Patrick Guerrero [Wed, 28 Jun 2017 07:45:59 +0000 (09:45 +0200)]
Camera: Improve arm inertia

7 years agoDungeons: Add setting to prevent projecting dungeons
paramat [Mon, 26 Jun 2017 05:24:30 +0000 (06:24 +0100)]
Dungeons: Add setting to prevent projecting dungeons

Prevents dungeons generating into ignore nodes in ungenerated mapchunks,
which can occasionally result in a dungeon projecting from the terrain.

7 years agoInclude TILE_MATERIAL_OPAQUE in shaders header (#6086)
stujones11 [Sat, 1 Jul 2017 16:01:07 +0000 (17:01 +0100)]
Include TILE_MATERIAL_OPAQUE in shaders header (#6086)

7 years agoC++11 cleanup inventorymanager (#6077)
Vincent Glize [Sat, 1 Jul 2017 12:07:40 +0000 (14:07 +0200)]
C++11 cleanup inventorymanager (#6077)

* C++11 cleanup inventorymanager

7 years agoTile material: Add 'TILE_MATERIAL_OPAQUE', use for drawtype 'NDT_NORMAL'
stujones11 [Wed, 7 Jun 2017 17:52:38 +0000 (18:52 +0100)]
Tile material: Add 'TILE_MATERIAL_OPAQUE', use for drawtype 'NDT_NORMAL'

Prevents normal drawtype nodes having transparency.
Avoids clients cheating by using 'x-ray' texture packs with transparent textures.

7 years agoCreate a filesystem abstraction layer for CSM and only allow accessing files that...
red-001 [Fri, 30 Jun 2017 18:14:39 +0000 (19:14 +0100)]
Create a filesystem abstraction layer for CSM and only allow accessing files that are scanned into it. (#5965)

* Load client-side mods into memory before executing them.

This removes the remaining filesystem access that client-sided mods had and it will hopefully make then more secure.

* Lua Virtual filesystem: don't load the files into memory just scan the filenames into memory.

* Fix the issues with backtrace

* fix most of the issues

* fix code style.

* add a comment

7 years agoMapgen: Remove unnecessary 'this->' from constructors (#6069)
Paramat [Fri, 30 Jun 2017 13:32:35 +0000 (14:32 +0100)]
Mapgen: Remove unnecessary 'this->' from constructors (#6069)

7 years agoChange the server description after a search (#6074)
Vincent Glize [Thu, 29 Jun 2017 05:53:44 +0000 (07:53 +0200)]
Change the server description after a search (#6074)

7 years agoMgv7: Fix undefined 'float_mount_height'
paramat [Wed, 28 Jun 2017 08:35:46 +0000 (09:35 +0100)]
Mgv7: Fix undefined 'float_mount_height'

Commit cad10ce3b747b721fd63784915e05f12bc488128 altered the parameter
'float_mount_height' but was missing the necessary line in the constructor
to get the altered value from 'params'.

Fixes 3D floatland terrain generating everywhere.

7 years agoFix for empty key/value when reading item string with wear but no metadata (#6058) 6061/head
Jesse McDonald [Tue, 27 Jun 2017 10:34:11 +0000 (05:34 -0500)]
Fix for empty key/value when reading item string with wear but no metadata (#6058)

7 years agoFix msvc annoyances (#5963)
adrido [Tue, 27 Jun 2017 09:54:40 +0000 (11:54 +0200)]
Fix msvc annoyances (#5963)

* MSVC: Fix '/std:c++11' is not a valid compiler option

* MSVC/MINGW: Define 'WIN32_LEAN_AND_MEAN' for the whole project

In some obscure cases 'Windows.h" got includet before that definition, which leaded to compilation warnings+errors

* MSVC: '/arch:SSE' is only available for x86

* MSVC: Fix float conversation

* MSVC/MINGW: use winthreads on Windows

* MSVC: 'USE_CMAKE_CONFIG' might be already definied by CMake build system

* MSVC: Use all available cpu cores for compiling

* Add missing include ctime and use std::time_t

7 years agoFix arm inertia limit case
kilbith [Tue, 27 Jun 2017 09:26:13 +0000 (11:26 +0200)]
Fix arm inertia limit case

7 years agoFix undefined behaviour in arm movement when dividing by zero
Loic Blot [Mon, 26 Jun 2017 21:19:47 +0000 (23:19 +0200)]
Fix undefined behaviour in arm movement when dividing by zero

7 years agoIsolate irrlicht references and use a singleton (#6041)
Loïc Blot [Mon, 26 Jun 2017 18:11:17 +0000 (20:11 +0200)]
Isolate irrlicht references and use a singleton (#6041)

* Add Device3D class which will contain IrrlichtDevice interface

move getSupportedVideoDrivers to Device3D

Add Device3D singleton & use it in various places

Rename Device3D to Rendering engine & add helper functions to various device pointers

More singleton work

RenderingEngine owns draw_load_screen

move draw functions to RenderingEngine

Reduce IrrlichtDevice exposure and guienvironment

RenderingEngine: Expose get_timer_time() to remove device from guiEngine

Make irrlichtdevice & scene manager less exposed

* Code style fixes

* Move porting::getVideoDriverName, getVideoDriverFriendlyName, getDisplayDensity, getDisplaySize to RenderingEngine

Fix XORG_USED macro -> RenderingEngine + create_engine_device from RenderingEngine constructor directly

* enum paralax => enum parallax

7 years agoFix Camera::add_arm_inertia -> addArmInertia
Loic Blot [Mon, 26 Jun 2017 18:10:11 +0000 (20:10 +0200)]
Fix Camera::add_arm_inertia -> addArmInertia

7 years agoAdd Arm Inertia (#6050)
kilbith [Mon, 26 Jun 2017 18:03:48 +0000 (20:03 +0200)]
Add Arm Inertia (#6050)

7 years agoOres: Make 'absheight' flag non-functional
paramat [Thu, 22 Jun 2017 05:50:22 +0000 (06:50 +0100)]
Ores: Make 'absheight' flag non-functional

The 'absheight' flag was added years ago for the floatlands of 'indev'
mapgen (now deleted). The feature mirrored all ore placement around y = 0
to place ores in floatlands.

In MTG we now use dedicated ore registrations for floatlands.

The feature is crude, inflexible, problematic and very rarely used, it
also makes ore vertical range code more complex.
Minetest 0.5 is a good chance to remove the feature.

The flag itself remains to not break flag values.

7 years agoRevert "Ores: Make 'absheight' flag non-functional"
Loic Blot [Sun, 25 Jun 2017 21:08:31 +0000 (23:08 +0200)]
Revert "Ores: Make 'absheight' flag non-functional"

This reverts commit 90ed6fc732ca667ca970b7c38d39c809e5c3553e.

7 years agoInventory: Fix wrong stack size behaviour and item loss (#6039)
SmallJoker [Sun, 25 Jun 2017 09:39:39 +0000 (11:39 +0200)]
Inventory: Fix wrong stack size behaviour and item loss (#6039)

Also fix itemFits and remove constness-nonsense

7 years agoMgv7: Clean up divide-by-zero fix
paramat [Sun, 25 Jun 2017 03:45:40 +0000 (04:45 +0100)]
Mgv7: Clean up divide-by-zero fix

7 years agoOres: Make 'absheight' flag non-functional
paramat [Thu, 22 Jun 2017 05:50:22 +0000 (06:50 +0100)]
Ores: Make 'absheight' flag non-functional

The 'absheight' flag was added years ago for the floatlands of 'indev'
mapgen (now deleted). The feature mirrored all ore placement around y = 0
to place ores in floatlands.

In MTG we now use dedicated ore registrations for floatlands.

The feature is crude, inflexible, problematic and very rarely used, it
also makes ore vertical range code more complex.
Minetest 0.5 is a good chance to remove the feature.

The flag itself remains to not break flag values.

7 years agoHelper methods for hardware colorization (#5870)
Dániel Juhász [Sat, 24 Jun 2017 18:15:09 +0000 (18:15 +0000)]
Helper methods for hardware colorization (#5870)

7 years agoEmit liquid sound if the player walks in liquid (#6040)
Dániel Juhász [Sat, 24 Jun 2017 18:15:00 +0000 (18:15 +0000)]
Emit liquid sound if the player walks in liquid (#6040)

7 years agoC++11 cleanup on constructors guiEngine (#6036)
Vincent Glize [Sat, 24 Jun 2017 11:41:30 +0000 (13:41 +0200)]
C++11 cleanup on constructors guiEngine (#6036)

* C++11 cleanup on constructors guiEngine

7 years agoGame::showOverlayMessage: securise function
Loic Blot [Sat, 24 Jun 2017 09:43:17 +0000 (11:43 +0200)]
Game::showOverlayMessage: securise function

Do wgettext call directly in the function instead of caller, as we destroy wstd inside it

7 years agoMgv7: Avoid divide-by-zero errors
paramat [Fri, 23 Jun 2017 20:49:26 +0000 (21:49 +0100)]
Mgv7: Avoid divide-by-zero errors

Some settings of paramters can cause mgv7 variables to be -inf, nan or -nan.
This can cause massive vertical columns of water to appear above sea level.

7 years agoMgvalleys: Use existing 'lava_max_height' value in CavesRandomWalk
paramat [Thu, 22 Jun 2017 02:48:22 +0000 (03:48 +0100)]
Mgvalleys: Use existing 'lava_max_height' value in CavesRandomWalk

Now that lava depth in large caves is variable we can use the already
present 'lava_max_height' value to set the lava depth in them.

7 years agoShow param1 and param2 in debug screen (#6031)
Wuzzy [Fri, 23 Jun 2017 11:31:01 +0000 (13:31 +0200)]
Show param1 and param2 in debug screen (#6031)

* Show param1 and param2 in debug screen

* Add units and some formatting to debug screen

* Minor refactor of param1/param2 debug display

7 years agoLINT fix
Loïc Blot [Thu, 22 Jun 2017 11:20:20 +0000 (13:20 +0200)]
LINT fix

7 years agoFix CSM crash caused by move to C++11. (#6027)
red-001 [Thu, 22 Jun 2017 11:18:58 +0000 (12:18 +0100)]
Fix CSM crash caused by move to C++11. (#6027)

7 years agoCavesRandomWalk: Make 'lava_depth' a mapgen parameter
paramat [Wed, 21 Jun 2017 03:20:18 +0000 (04:20 +0100)]
CavesRandomWalk: Make 'lava_depth' a mapgen parameter

As with 'large_cave_depth', lava depth was previously a fixed y value and
therefore incompatible with the ability to shift terrain vertically.

Add 'lava_depth' mapgen parameter to mgflat, mgfractal, mgv5, mgv7.

7 years agoAdd minetest.rgba function that returns ColorString from RGBA or RGB values
Gael-de-Sailly [Fri, 27 Feb 2015 19:51:55 +0000 (20:51 +0100)]
Add minetest.rgba function that returns ColorString from RGBA or RGB values

7 years agoCpp11 initializers: last src root changeset (#6022)
Loïc Blot [Wed, 21 Jun 2017 09:51:29 +0000 (11:51 +0200)]
Cpp11 initializers: last src root changeset (#6022)

* Cpp11 initializers: last src root changeset

Finish to migrate all src root folder files to C++11 constructor initializers

7 years agoFix render order of overlays (#6008)
Dániel Juhász [Wed, 21 Jun 2017 08:47:31 +0000 (08:47 +0000)]
Fix render order of overlays (#6008)

* Fix render order of overlays

* Use C++11 loops

* Fix time_t

7 years agoC++11 cleanup on constructors dir network (#6021)
Vincent Glize [Wed, 21 Jun 2017 06:28:57 +0000 (08:28 +0200)]
C++11 cleanup on constructors dir network (#6021)

* C++11 cleanup on constructors dir network

7 years agoC++11 cleanup on constructors dir client (#6012)
Vincent Glize [Wed, 21 Jun 2017 06:04:45 +0000 (08:04 +0200)]
C++11 cleanup on constructors dir client (#6012)

* C++11 cleanup on constructors dir client

7 years agoFix console resize issue when maximising game window (#6023)
Ezhh [Wed, 21 Jun 2017 05:50:57 +0000 (06:50 +0100)]
Fix console resize issue when maximising game window (#6023)

7 years agoMgv5/v7/fractal: Add 'large_cave_depth' parameter to replace fixed value
paramat [Tue, 20 Jun 2017 03:55:32 +0000 (04:55 +0100)]
Mgv5/v7/fractal: Add 'large_cave_depth' parameter to replace fixed value

The value cannot be fixed because we can shift terrain vertically.
This also makes these mapgens consistent with mgflat and mgvalleys which
have 'large_cave_depth' parameters.

7 years agoInventory: Make addItem for empty ItemStacks respect max stack size
Jesse McDonald [Fri, 19 May 2017 03:56:49 +0000 (22:56 -0500)]
Inventory: Make addItem for empty ItemStacks respect max stack size

When adding items to an empty ItemStack, limit the number of items taken
based on the maximum stack size in the item description.
Likewise, when checking whether items will fit into an empty ItemStack,
only absorb as many items as are allowed in a single stack and return the rest.

7 years agoMerge cguittfont lib in irrlicht change folder. (#6016)
Loïc Blot [Tue, 20 Jun 2017 15:18:34 +0000 (17:18 +0200)]
Merge cguittfont lib in irrlicht change folder. (#6016)

* Merge cguittfont lib in irrlicht change folder.

This remove hack and static lib for FreeType

7 years agoFix console not being properly resized after window size changed (#6020)
Zeno- [Tue, 20 Jun 2017 10:36:58 +0000 (20:36 +1000)]
Fix console not being properly resized after window size changed (#6020)

7 years agoAutomatic item and node colorization (#5640)
Dániel Juhász [Tue, 20 Jun 2017 09:19:56 +0000 (09:19 +0000)]
Automatic item and node colorization (#5640)

* Automatic item and node colorization

Now nodes with a palette yield colored item stacks, and colored items
place colored nodes by default. The client predicts the colorization.

* Backwards compatibility

* Use nil

* Style fixes

* Fix code style

* Document changes

7 years agoAdd new travis required configuration for trusty
Loïc Blot [Tue, 20 Jun 2017 07:39:20 +0000 (09:39 +0200)]
Add new travis required configuration for trusty

7 years agoFix 1 more warning reported by GCC
Loic Blot [Mon, 19 Jun 2017 22:19:29 +0000 (00:19 +0200)]
Fix 1 more warning reported by GCC

We don't write in correct buffer size in analyze_block

7 years agoFix 2 warnings reported by GCC
Loic Blot [Mon, 19 Jun 2017 22:04:18 +0000 (00:04 +0200)]
Fix 2 warnings reported by GCC

* ClientEnvironment::m_irr is not used anymore since a recent cleanup
* l_vmanip constructor ordering

7 years agoC++11 cleanup on constructors (#6000)
Vincent Glize [Mon, 19 Jun 2017 21:54:58 +0000 (23:54 +0200)]
C++11 cleanup on constructors (#6000)

* C++11 cleanup on constructors dir script

7 years agoRemove IrrlichtDevice unused pointer from ClientActiveObject class & childs (#6010)
Loïc Blot [Mon, 19 Jun 2017 14:49:34 +0000 (16:49 +0200)]
Remove IrrlichtDevice unused pointer from ClientActiveObject class & childs (#6010)

7 years agofind_nodes_in_area: Extend maximal count to U32_MAX (#5277)
SmallJoker [Mon, 19 Jun 2017 14:30:26 +0000 (16:30 +0200)]
find_nodes_in_area: Extend maximal count to U32_MAX (#5277)

Extend documentation, limit area volume
Remove u16 count limitation

* Prevent integer overflow, replace minp/maxp with pos1/pos2

7 years agohud.h: add missing false default state on use_hotbar_selected_image
Loïc Blot [Mon, 19 Jun 2017 13:41:33 +0000 (15:41 +0200)]
hud.h: add missing false default state on use_hotbar_selected_image

7 years agohud.cpp: fix wrong indent in drawItem
Loïc Blot [Mon, 19 Jun 2017 13:20:30 +0000 (15:20 +0200)]
hud.cpp: fix wrong indent in drawItem

7 years agoVerify HudSetParams input when hotbar textures are set (#6013)
Loïc Blot [Mon, 19 Jun 2017 12:10:30 +0000 (14:10 +0200)]
Verify HudSetParams input when hotbar textures are set (#6013)

* Verify HudSetParams input when hotbar textures are set

This fix #6011