Commit Graph

230 Commits

Author SHA1 Message Date
SmallJoker 539f016c1b
Better F6 profiler (#8750)
Update the profiler names to make more sense of what they actually represent
Move the profiler code from header to its source file
Use monospace font to align lines
Format the statistics line to align better with surrounding values
Refresh the profiler each 3 seconds (roughly)
2019-08-13 19:56:55 +02:00
Jozef Behran 86d7f84b89 Merge pull request #8776 from osjc/FixGetNode
Finish getNode cleanup
2019-08-10 19:45:44 +02:00
sfan5 cf64054390 Implement adding velocity to player from Lua
The intended usecase is knockback, but there's potential for more.
2019-08-10 19:44:27 +02:00
SmallJoker 0c533dc436 Game: Fix double BS multiplication 2019-08-07 21:23:01 +02:00
ANAND e788ee283f Client::Interact: Use InteractAction enum instead of numeric constants
This replaces the magic numbers used as interaction modes both client-side and server-side, primarily for the sake of ease-of-readability.
2019-08-07 19:21:14 +02:00
SmallJoker e462a9a5ef
Unify wield item handling (#8677)
This moves the wield item functions to Player and the tool utils for range calculation
Also 'local_inventory' was removed due to redundancy in Client
2019-08-07 19:16:31 +02:00
ANAND fa6bc699bc Hide chat when console is open (#8656) 2019-08-07 19:15:33 +02:00
DS 1cef09ff10 Fix inventory_overlay for nodes without inventory_image (#8433) 2019-08-07 12:07:30 +02:00
sfan5 19426387d4 Optimize usage of TOSERVER_GOTBLOCKS packet 2019-08-07 11:32:16 +02:00
SmallJoker 233cb86e86
Clean up and fix freetype=false crashes (#8641)
A IGUIFont of type bitmap/vector cannot be converted to CGUITTFont
Fixes various segfaults in gameplay
Shorter font cache code, cleaned up (?)
2019-08-06 21:33:13 +02:00
sfan5 6c2ded4cac Unify GLES support in gui scaling filter 2019-08-04 16:12:52 +02:00
sfan5 ca363d3ef8 Unify OpenGL ES support 2019-08-04 16:12:52 +02:00
rubenwardy 9541165752 Add styles to most elements 2019-08-03 19:36:30 +01:00
rubenwardy d1a1c5cbf0 Add custom colorable GUIButton implementation 2019-08-03 19:36:30 +01:00
SmallJoker 3ceef8e6a0 Mainmenu: Use textarea in error formspecs 2019-08-01 15:56:28 +02:00
Methacrylon cdc7eb2d4c Sky: Refactor of moon and sun drawing (#8683)
Split sun and moon render parts from the main render function.
2019-07-30 20:25:47 +02:00
SmallJoker 4aa9a669cb
ContentCAO: Fix broken attachments on join (#8701)
What happened:
1) Object data is received. Client begins to read the data
2) Client initializes all its children (gob_cmd_update_infant)
3) Children try to attach to parent (yet not added)
4) Parent initializes, is added to the environment

And somewhere in between, Irrlicht wrecks up the attachments due to the missing matrix node.

The solution here is to:
1) Use the same structure as ServerActiveObject
2) Attach all children after the parent is really initialized
2019-07-29 19:14:07 +02:00
Pierre-Yves Rollo c3daf2a8be Fix missing item images clipping in formspecs (#8652)
* Fix clipping of itemimage

* Code style

* More code styling
2019-07-26 19:44:29 +02:00
Lars Hofhansl 9fe3246154 Optimize getting active objects a bit. #8674 2019-07-16 15:55:17 -07:00
DS-Minetest 140aeabd87 Do predict when sneak-place to node with on_rightclick 2019-07-08 14:21:27 +02:00
Vitaliy 93f7e10e0d Optimize and unify mesh processing (#7851) 2019-06-28 03:22:16 +01:00
rubenwardy 429a989648 Add support for 9-sliced backgrounds (#8600)
9-slice textures are commonly used in GUIs to allow scaling them to match any resolution without distortion.

https://en.wikipedia.org/wiki/9-slice_scaling
2019-06-22 16:03:54 +02:00
SmallJoker 4e3c1916f7 Fix segfault on quitting with open node formspec (#8608) 2019-06-21 21:00:30 +02:00
SmallJoker e2f8f4da83
Formspecs: Close on metadata removal (#8348)
Formspecs will now close as soon the formspec string in the node metadata turns invalid.
2019-06-10 13:01:07 +02:00
SmallJoker e40be619f2
Add disable_jump to liquids and ladders (#7688)
Remove second nodedef check by improving the colliding node detection
Also remove the 2nd check in old_move, correct standing node a bit
2019-06-10 13:00:35 +02:00
SmallJoker a1459a9eac Fix persistent ^[brighten after damage again (#5739)
The old texture modifier is restored by passing `m_previous_texture_modifier`.
Either copy it manually or let the function parameter do that.

Victims so far:
8e0b80a Apr 2018
eb2bda7 May 2019
2019-05-26 09:54:26 +02:00
DS 9d09c87f13 Make autoforward simulate the 'up' key (#8249) 2019-05-21 19:50:00 +01:00
Jozef Behran eb2bda7d0b Optimize string (mis)handling (#8128)
* Optimize statbar drawing

The texture name of the statbar is a string passed by value.
That slows down the client and creates litter in the heap
as the content of the string is allocated there. Convert the
offending parameter to a const reference to avoid the
performance hit.

* Optimize texture cache

There is an unnecessary temporary created when the texture
path is being generated. This slows down the cache each time
a new texture is encountered and it needs to be loaded into
the cache. Additionally, the heap litter created by this
unnecessary temporary is particularly troublesome here as
the following code then piles another string (the resulting
full path of the texture) on top of it, followed by the
texture itself, which both are quite long term objects as
they are subsequently inserted into the cache where they can
remain for quite a while (especially if the texture turns
out to be a common one like dirt, grass or stone).

Use std::string.append to get rid of the temporary which
solves both issues (speed and heap fragmentation).

* Optimize animations in client

Each time an animated node is updated, an unnecessary copy of
the texture name is created, littering the heap with lots of
fragments. This can be specifically troublesome when looking
at oceans or large lava lakes as both of these nodes are
usually animated (the lava animation is pretty visible).
Convert the parameter of GenericCAO::updateTextures to a
const reference to get rid of the unnecessary copy.

There is a comment stating "std::string copy is mandatory as
mod can be a class member and there is a swap on those class
members ... do NOT pass by reference", reinforcing the
belief that the unnecessary copy is in fact necessary.
However one of the first things the code of the method does
is to assign the parameter to its class member, creating
another copy. By rearranging the code a little bit this
"another copy" can then be used by the subsequent code,
getting rid of the need to pass the parameter by value and
thus saving that copying effort.

* Optimize chat console history handling

The GUIChatConsole::replaceAndAddToHistory was getting the
line to work on by value which turns out to be unnecessary.
Get rid of that unnecessary copy by converting the parameter
to a const reference.

* Optimize gui texture setting

The code used to set the texture for GUI components was
getting the name of the texture by value, creating
unnecessary performance bottleneck for mods/games with
heavily textured GUIs. Get rid of the bottleneck by passing
the texture name as a const reference.

* Optimize sound playing code in GUIEngine

The GUIEngine's code receives the specification of the sound
to be played by value, which turns out to be most likely a
mistake as the underlying sound manager interface receives
the same thing by reference. Convert the offending parameter
to a const reference to get rid of the rather bulky copying
effort and the associated performance hit.

* Silence CLANG TIDY warnings for unit tests

Change "std::string" to "const std::string &" to avoid an
unnecessary local value copy, silencing the CLANG TIDY
process.

* Optimize formspec handling

The "formspec prepend" parameter was passed to the formspec
handling code by value, creating unnecessary copy of
std::string and slowing down the game if mods add things like
textured backgrounds for the player inventory and/or other
forms. Get rid of that performance bottleneck by converting
the parameter to a const reference.

* Optimize hotbar image handling

The code that sets the background images for the hotbar is
getting the name of the image by value, creating an
unnecessary std::string copying effort. Fix that by
converting the relevant parameters to const references.

* Optimize inventory deserialization

The inventory manager deserialization code gets the
serialized version of the inventory by value, slowing the
server and the client down when there are inventory updates.
This can get particularly troublesome with pipeworks which
adds nodes that can mess around with inventories
automatically or with mods that have mobs with inventories
that actively use them.

* Optimize texture scaling cache

There is an io::path parameter passed by value in the
procedure used to add images converted from textures,
leading to slowdown when the image is not yet created and
the conversion is thus needed. The performance hit is
quite significant as io::path is similar to std::string
so convert the parameter to a const reference to get rid of
it.

* Optimize translation file loader

Use "std::string::append" when calculating the final index
for the translation table to avoid unnecessary temporary
strings. This speeds the translation file loader up
significantly as std::string uses heap allocation which
tends to be rather slow. Additionally, the heap is no
longer being littered by these unnecessary string
temporaries, increasing performance of code that gets
executed after the translation file loader finishes.

* Optimize server map saving

When the directory structure for the world data is created
during server map saving, an unnecessary value passing of
the directory name slows things down. Remove that overhead
by converting the offending parameter to a const reference.
2019-05-18 17:19:13 +02:00
Paramat ad8d68c06a
Remove unnecessary CSM warning (#8485) 2019-04-28 00:44:26 +01:00
ANAND d71e1e0949 Improve readability of debug menu by using '|' (#8488)
* Improve readability of debug menu by using '|'

* Restore whitespace to separate yaw and cardinal direction

Co-Authored-By: ClobberXD <ClobberXD@gmail.com>
2019-04-27 12:45:44 +02:00
Muhammad Rifqi Priyo Susanto 695d9edcd4 Use player as starting point instead of camera when pointing node (#8261)
Same pointing area on both camera modes.
This fix is inapplicable for non-crosshair input.
2019-04-27 12:44:56 +02:00
stujones11 cff1e9ca27 Android: Clear chat open flag on cancel or completion (#8478) 2019-04-19 12:06:47 +02:00
paramat 38b94f248a Attend to review, re-arrange blank lines, update lua_api.txt 2019-04-14 22:21:51 +01:00
Pedro Gimeno 12a63021d0 Fix regression in automatic_face_movement_max_rotation_per_sec
Values <= 0 should make the yaw change instant. This worked in 0.4.16 but was broken in 089f594582.

Per bug report by oil_boi_minetest on IRC.
2019-04-14 22:21:51 +01:00
ANAND d111865890 Change sign of pitch angle in debug menu (#8438)
Co-Authored-By: ClobberXD <ClobberXD@gmail.com>
2019-04-04 22:42:18 +01:00
Paramat 42e1a12714
Require 'waving = 3' in a nodedef to apply the liquid waving shader (#8418)
Makes the liquid waving shader per-nodedef like waving leaves/plants,
instead of being applied to all liquids.
Like the waving leaves/plants shaders, the liquid waving shader can
also be applied to meshes and nodeboxes.

Derived from a PR by t0ny2.
2019-03-27 00:18:43 +00:00
sfan5 5b99abb847 Fix texture rotation for wallmounted nodeboxes
fixes #8358
2019-03-19 22:36:51 +01:00
Loïc Blot e22a69d61a Drop GUIConfirmRegistration::m_address unused field 2019-03-12 16:53:21 +01:00
Ragulan R c8914664a3 Display pitch angle in debug menu (#8321) 2019-03-10 11:16:27 +01:00
rubenwardy c735497a65 Fix clang tidy error due to incorrect use of quotes for character 2019-03-06 14:41:37 +00:00
sofar b5defcffba Add referer to remote media requests. (#8135)
This sends the following header to a remote media server:

    Referer: minetest://<server_name>:port

This was verified with CTF and the Minetest Public Remove Media
server. If the servername was a plain IPv6 address it will
contain `:` characters and will be encapsulated in `[]` to
be a valid URI.
2019-03-05 08:12:02 +01:00
Loïc Blot 170dd409cb
Fix particle spawners not visible since CSM spawner implementation (#8289)
* Drop the ID mapper, use a big u64 instead. This will permit to resync server ids properly with the manager code
* Modernize some code parts (std::unordered_map, auto)
* generate id on client part on U32_MAX + 1 ids, lower are for server ids
2019-03-01 20:16:11 +01:00
Loïc Blot 111f1dc9c5 Revert "Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)"
This reverts commit 01cd63bd3b.
2019-02-26 08:53:53 +01:00
Paramat 01cd63bd3b
Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)
Reverts 5dab742645
"[CSM] Add functions to create particles and particlespawners."
2019-02-26 04:26:25 +00:00
ANAND 242c9bc36e Remove 's' from 'automatic forwards' (#8272) 2019-02-23 01:12:33 +00:00
ANAND 7a0e52acd6 Revert RTT fixes (#8187)
The reverted commit 968ce9af59
is suspected (through the use of bisection) of causing network slowdowns.
Revert for now as we are close to release.
2019-02-15 23:39:22 +00:00
SmallJoker ffb17f1c9a Consistent HP and damage types (#8167)
Remove deprecated HUDs and chat message handling.
Remove unused m_damage variable (compat break).
HP: s32 for setter/calculations, u16 for getter.
2019-02-10 23:03:26 +00:00
SmallJoker ba5a9f2b36
Slippery: Do not apply when swimming (#8198) 2019-02-10 17:04:04 +01:00
SmallJoker 6d6a813614
Autojump: Disable in fly mode, support continuous forward (#8200)
Correctly disable in fly mode (issue #8199)
Also autojump in continuous forward mode (issue #8201)
2019-02-09 21:44:04 +01:00
Paul Ouellette d5456da69d Use true pitch/yaw/roll rotations without loss of precision by pgimeno (#8019)
Store the rotation in the node as a 4x4 transformation matrix internally (through IDummyTransformationSceneNode), which allows more manipulations without losing precision or having gimbal lock issues.

Network rotation is still transmitted as Eulers, though, not as matrix. But it will stay this way in 5.0.
2019-02-07 21:26:06 +00:00