Commit Graph

4582 Commits

Author SHA1 Message Date
red-001 98327a59c4 Minor pause/escape menu improvements (#5751)
- Split movement keys into separate entries.
- Increase buffer size due to the above change.
- Change capitalisation.
- Remove code-style violating white spaces.
2017-05-13 08:50:19 +02:00
red-001 0e0c824ea7 Rework escape/pause menu (#5719)
* Rework escape/pause menu

- Remove build information
- Use current controls instead of default controls
- Add information about the current server in place of the build information
- Add text saying the game is paused to if in singleplayer mode.
rework pause/escape menu

* improve consistency + display server_name
2017-05-11 10:39:37 +02:00
sfan5 071e114ffa Private nodemeta (#5702)
* Private node metadata that isn't sent to the client
2017-05-10 15:29:21 +02:00
red-001 8729e7daec Add cancel button to password change menu. (#5720)
* Add cancel button to password change menu.
2017-05-09 11:04:45 +02:00
paramat da88a18676 Revert custom player collision box and step height commits
These caused inability to pass through 2 node high spaces or step up onto slabs
or steps when a new client connected to an older server.
2017-05-09 03:52:28 +01:00
Loïc Blot c07c642ab0 read_schematic_replacements: ensure fields are strings (#5726)
* read_schematic_replacements: ensure fields are strings

add a type check before reading strings on read_schematic_replacements deserializer

* throw LuaError instead of asserting the whole client
2017-05-08 20:43:03 +02:00
paramat 5e04f1a335 Custom step height: Fix implementation
Recent commit 45ab62d6a3 had a coding error that
made climbing out of water difficult due to an incorrect value of the step height
when not 'touching ground'.
It also incorrectly multiplied the custom stepheight by BS, resulting in being
able to step-up 2 nodes if set to the default of 0.6, or even 0.3.
Also the implementation was wrong because it customised the step height when
not 'touching ground', this step height is for a slight rise when catching the
edge of a node during a jump, and should always remain at 0.2 * BS.
2017-05-08 05:59:19 +01:00
paramat 3342dcc4bc Shaders: Remove unused water surface shader
Also remove hardcoded MTGame node.

The 'water surface shader' was duplicated shader code in preparation for
intended new water surface shaders. For development purposes the MTGame node
'default:water_source' had it's top tile assigned to 'water surface shader'.
Due to shader duplication this commit does not cause any change to shader
behaviour.
2017-05-08 05:58:59 +01:00
Loïc Blot c1b3ed4180 Player attrs: permits to remove an attribute by setting value to nil (#5716)
* Player attrs: permits to remove an attribute by setting value to nil

When doing player:set_attribute("attr", nil) remove attribute

Also remove a useless check on C++ API part (already done by checkplayer)

Fix #5709
2017-05-07 12:13:15 +02:00
Loic Blot 0d7c37943b
LINT fix since d067894816 2017-05-07 11:07:17 +02:00
paramat 2d5bd7f414 Player properties: Set correct default collisionbox
Recent commit b6f4a9c7e1 removed a hardcoded
player collisionbox which resulted on falling back to an incorrect default.
This stopped players walking through 2-node high spaces and made the player
slightly wider.

Improve docs for custom player collisionbox feature and reformat nearby lines.
2017-05-07 06:10:13 +01:00
T0ny2 d067894816 Replace occurrence of luaL_reg in l_camera.cpp
Related to commit 41c5483. Replace an occurrence of luaL_reg in
src/script/lua_api/l_camera.cpp (added by commit de028fc).
2017-05-07 06:09:30 +01:00
ShadowNinja c6e96c645b Fix myfloor(0.0) 2017-05-06 16:10:03 -04:00
ShadowNinja 77597c4ff3 Clean up numeric.h and split FacePositionCache from it
I also optiized FacePositionCache a bit: I removed a map
lookup and vector copy from both branches of getFacePosition.
2017-05-06 16:09:45 -04:00
TeTpaAka b6f4a9c7e1 Make the player collisionbox settable 2017-05-06 15:41:05 -04:00
ShadowNinja 43d1f375d1 Use a settings object for the main settings
This unifies the settings APIs.

This also unifies the sync and async registration APIs, since the async
registration API did not support adding non-functions to the API table.
2017-05-06 15:33:19 -04:00
Loic Blot a024042bf5
Fix codestyle since CSM Camera API 2017-05-06 21:30:27 +02:00
Wuzzy 07c17db114 Add configurable key bindings for hotbar scrolling, and for changing volume. 2017-05-06 21:21:59 +02:00
Sapier 45ab62d6a3 Use stepheight from CAO instead of hardcoded value 2017-05-06 21:18:17 +02:00
red-001 5ebf8f9450 [CSM] add `on_item_use` (#5544) 2017-05-06 21:12:44 +02:00
TeTpaAka 6658ad3d94 Make players respect makes_footstep_sound in the object properties 2017-05-06 20:16:16 +02:00
bigfoot547 de028fc056 [CSM] Add camera API (#5609)
* [CSM] Add camera API
roper rebase & squash

* Address nerzhul's review
2017-05-05 22:07:36 +02:00
Paramat e8b00fdf98 Clouds API: Fix yellow clouds at dawn and dusk (#5707) 2017-05-05 22:07:25 +02:00
Loic Blot 7c82f1e5dd
Add missing server sending rule for bd921a7916 2017-05-05 20:21:04 +02:00
Wayward One fe247f38f7 Fix Android build (#5706)
* Fix Android build
2017-05-05 17:27:50 +02:00
Loïc Blot 21e0a049f8 Save minetest screen width/height options when modified (#5683)
* Save minetest screen width/height options when modified

* Add autosave_screensize setting (default true)

* Fix @SmallJoker comments
2017-05-05 13:47:11 +02:00
red-001 d6cf5450a8 Add option to also check the center to `find_node_near` (#5255)
* Add option to also check the center to `find_node_near`
2017-05-04 22:52:58 +02:00
Vaughan Lapsley c874bfa5c3 Remove CMAKE -ffast-math flag from OSX/FreeBSD
Fixes issue: #4274

I have tested on MacOS 10.12.4

Requires testing on:
FreeBSD, Windows and Linux which I do not have access to.
2017-05-04 13:24:36 +02:00
Loic Blot 9a9ae7d65c
LINT fix since cloud API merge 2017-05-04 07:52:31 +02:00
paramat dd591119a3 Directional coloured fog: Fix order of SColor components
'video::SColor pointcolor' was initialised with order RGBA instead of ARGB.
No change in behaviour as 'm_bgcolor' has alpha 255.
2017-05-04 04:26:06 +01:00
paramat 76ec6b8313 Clouds: Fix reddish clouds. Add missing alpha update
Fix accidental swap of red and blue components that caused reddish clouds
Add missing update of alpha in remoteplayer.cpp
2017-05-04 04:26:06 +01:00
red-001 ae0d8f74d7 Add function to get server info. 2017-05-04 04:25:45 +01:00
SmallJoker 468eeb618e Fading soungs: Fix client crash on older servers 2017-05-03 13:48:46 +02:00
paramat ad9fcf859e Set sky API: Add bool for clouds in front of custom skybox
Default true.
Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API.
Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of
'm_visible' (whether normal sky is visible).
2017-05-02 20:42:35 -07:00
SmallJoker f9fdb48dc8 Sneak: Improve and fix various things
Remove useless `got_teleported`.
Fix jitter when walking against the sneak limits.
Fix damage evading on sneak ladders.
2017-05-03 03:16:20 +01:00
Brandon bd921a7916 Sound API: Add fading sounds 2017-05-03 03:12:45 +01:00
Ben Deutsch f1d7a26b7c Add clouds API 2017-04-30 00:06:13 +01:00
Loïc Blot 95409da87d Optimize updateFastFaceRow processing by removing some TileSpec copy (#5678)
* Optimize updateFastFaceRow processing by removing some TileSpec copy

It permit to decrease this function from 54% runtime to 45% and reduce copy from 14% runtime to 12.5%
getTileInfo also reduced from 27% to 23%

* makeFastFace should use a const ref too

this trigger a const pointer need in the underlying function

Also fix some code style and prevent calculating 4 times the same position at a point

* Reduce a comparison cost for lights in updateFastFaceRow
2017-04-29 20:36:09 +02:00
shivajiva101 c729543ec4 Fix visual slide issue with set_detach, fixes #5620 2017-04-29 18:18:46 +02:00
Loïc Blot 3251e44938 content_cao: fix getPlayerControl structure copy on each step (#5677)
Also fix some codestyle issues around it.
2017-04-29 18:16:58 +02:00
Loïc Blot 3db66b4531 Client & ClientEnvirnment: don't create fake events (#5676)
Instead of create fake events on the stack on each loop call (Game::run), verify is queue is empty or not and handle event directly if there is.

This prevents fake ClientEvent creation & memory allocations

Same fix is also applied on ClientEnvironment, & rename getClientEvent to getClientEnvEvent to match ClientEnvEvent object
2017-04-29 17:25:25 +02:00
SmallJoker f727f54192 Fix Travis/unittest broken since b662a45 2017-04-29 16:40:56 +02:00
Loic Blot 9762650f97
Remove legacy unused define DIGGING_PARTICLES_AMOUNT 2017-04-29 12:18:58 +02:00
Vincent Glize dc5bc6cac7 [CSM] Add event on_place_node API lua (#5548)
* [CSM] Add event on_place_node API lua
2017-04-29 12:08:16 +02:00
Loic Blot ecf08255b0
Fix Lint broken by b662a4577d 2017-04-29 09:47:22 +02:00
Auke Kok 1ecc8756bc Reorder TileLayer. (#5638)
Despite the split of TileSpec into TileDef and TileLayer, the
TileLayer struct is still 66 bytes large, and doesn't fit in
a single cacheline.

I'm moving the color member to cacheline 2, in the hope that it
is less used and the compiler loads all the hot members in a single
cacheline instead. Only color sits now in cacheline 2, all the
other members are in cacheline 1.

Note: is_color is probably rarely set, most nodes will likely
not use hardware coloring, but this may change in the future.
Ideally, this class is shrunk to 64 bytes.
2017-04-29 09:16:32 +02:00
Vincent Glize 19960e26c6 [CSM] add screenshot api lua (#5674)
* [CSM] add screenshot api lua
2017-04-29 09:16:06 +02:00
ShadowNinja b662a4577d Clean up getTime helpers
This increases size of the getTime return values to 64 bits.
It also removes the TimeGetter classes since the getTime functions
are now very precise.
2017-04-28 14:43:18 -04:00
you 7f4cdbcbe9 Fix click-digging torches (#5652)
Torches are dug instantly again.
When the digging time is 0, a delay of 0.15 seconds is added between digging nodes. If the left mouse button is released, the delay is set to 0, thus click-digging.
2017-04-28 20:12:28 +02:00
Auke Kok e21a1ab3bd Allow mesh and nodeboxes to wave like plants or leaves. (#3497)
We introduce a new value for "waving" - 2:

0 - waving disabled
1 - wave like a plant
2 - wave like a leave

Plantlike nodes will only allow waving = 1, but for leaves we will
permit both 1 and 2 since current minetest_game sets it to 1 for
all leaves. This makes it somewhat backwards compatible.

For mesh and nodebox, values 1 and 2 are both valid, and the node
can wave in both fashions as desired.

I've tested this with the crops:corn plants, which are mesh nodes,
and the results are really good. The code change is trivial as
well, so I've opted to document the waving parameter in lua_api.txt
because it was missing from there.

Nodeboxes likely will not wave properly unless waving = 2. However
it's possible that waving=1 may be desired by some mod developers
for geometries I have not tried, so the code will not prohibit
either value for mesh and nodebox drawtypes.

Add lua_api.txt documentation for this feature and document both
the existing functionality and the expansion to mesh and nodebox
drawtypes.
2017-04-28 20:11:43 +02:00