Commit Graph

241 Commits

Author SHA1 Message Date
Desour 7e4dccb3b5 Revert "Get rid of global guienv variable"
This reverts commit 16da954bd7.
2023-08-24 22:14:44 +02:00
Gregor Parzefall aea9242a96
Allow nodes to have their post_effect_color affected by lighting (#13637)
Co-authored-by: DS <ds.desour@proton.me>
2023-08-24 20:16:36 +02:00
Gregor Parzefall 92b6ff4721
TouchScreenGUI: Fix only 9 hotbar slots being usable (#13698)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-08-24 17:45:51 +02:00
Desour 16da954bd7 Get rid of global guienv variable
(It can already be accessed via the renderingengine.)
2023-08-14 18:13:47 +02:00
Desour 45e7a80057 Get rid of guiroot
The guienvironment already provides a root gui element, we don't need to add another one.
(For CGUIEnvironment, the env itself is the root element.)
2023-08-14 18:13:47 +02:00
ndren 53c594abe0
Introduce and start using microsecond sleep on Linux (#13445) 2023-07-22 17:19:49 +02:00
Gregor Parzefall 1837a11c22
Improve messages when changing viewing range and exceeding server-set limit (#13647) 2023-07-14 14:41:45 +02:00
Gregor Parzefall 0218963f1b
Fix max_formspec_size not taking gui_scaling into account (#13493) 2023-07-07 21:42:43 +02:00
Gregor Parzefall 26453df2f7
Don't crash if a Lua error occurs inside get_staticdata 2023-07-03 20:34:02 +02:00
lhofhansl 0ade097e99
Allow the server to control fog_distance and fog_start via the sky-api (#13448) 2023-06-30 19:11:17 -07:00
x2048 c09a3a52ac
Add antialiasing filters (FXAA, SSAA) (#13253) 2023-06-28 05:30:08 +02:00
DS edcbfa31c9
Sound refactor and improvements (#12764) 2023-06-16 20:15:21 +02:00
Muhammad Rifqi Priyo Susanto 7221de6ede Option to invert direction or disable mouse wheel for hotbar item selection
More changed callbacks for the settings are added in readSettings(). Those are also deregistered when the Game object is destroyed.
2023-05-31 12:40:00 +07:00
Gregor Parzefall fc3d6c1dd9
Place nodes with single tap on Android (+ bugfix) (#13187)
Don't place nodes when closing button bars.
Update docs (also in-game).
Rename "Default controls" -> "Controls" in Android pause menu since players can't change them (normally), so calling them "default" doesn't make sense.
2023-05-29 12:30:30 +07:00
Desour 8b73743baa Reduce number of recursively included headers
This should improve compilation speed.

Things changed:
* Prefer forward-declarations in headers.
* Move header-includes out of headers if possible.
* Move some functions definitions out of headers.
* Put some member variables into unique_ptrs (see Client).
2023-04-27 18:50:33 +02:00
rubenwardy 4158b72971
Add ability to override item images using meta (#12614) 2023-04-17 19:44:41 +01:00
DS d49d80a4a0
Store whether window is maximized (#12861) 2023-04-14 21:04:03 +02:00
Gregor Parzefall 2a1bc82887
Fix black loading screen background if `menu_clouds = false` (#13322) 2023-04-13 18:12:48 +01:00
Wuzzy d1e5dbefc7
Clarify documentation of punch key (#13238) 2023-04-13 18:12:26 +01:00
Zardshard e139749b5c
Simulate all keys being released when when game loses focus (#13336) 2023-04-13 18:06:21 +02:00
Desour 1dd13da37d Get rid of global dummySoundManager
There is no need for this to be globally unique.
2023-04-11 20:06:15 +02:00
Lars 4a742be73e Do not call updateDrawList, updateDrawListShadow, and touchMapBlocks in the same frame 2023-04-09 07:10:17 -10:00
Lars 8982998681 Add a default direction light for shadows 2023-04-09 07:10:17 -10:00
Desour 67068cfaf4 Get rid of wgettext 2023-04-08 20:17:50 +02:00
x2048 9af587c54e
Move rendering engine reset after deletion of game objects 2023-03-20 11:42:16 +01:00
DS 02346819f9
Fix rendertarget size being saved as screensize (#13313) 2023-03-12 19:56:49 +01:00
numzero d6be6682ec Drop dependency on IrrCompileConfig
The only remaining thing is IRRLICHT_SDK_VERSION via irrlicht.h
2023-03-01 09:06:23 +01:00
rubenwardy 39f4d26177
Add minetest.get_player_window_information() (#12367) 2023-02-27 22:58:41 +00:00
sofar 2083252c05
Sky: transmit body_orbit_tilt to client. (#13193)
This obsoletes the current client-side setting entirely. The server can
transmit the tilt to the client directly and will send 0.0f as default
value.

Co-authored-by: x2048 <codeforsmile@gmail.com>
Co-authored-by: sfan5 <sfan5@live.de>
2023-02-26 01:08:33 +01:00
Alex af4009d924
Add chat HUD flag (#13189) 2023-02-20 21:00:37 +01:00
sfan5 3bafbaac49 Remove dead code behind Irrlicht version checks 2023-02-18 16:46:51 +01:00
DS 8478796226
Decrease minimum for repeat_place_time (#13165) 2023-01-23 00:20:12 +01:00
ROllerozxa 390b5caaaa
Fix crash on Android with IrrlichtMt9 (#13123)
Caused by mouse control
2023-01-08 14:04:17 +01:00
iliekprogrammar fb28ca463e
Clamp player wieldindex when processing hotbar item selection (#13098) 2023-01-08 14:03:16 +01:00
x2048 6d45c243f8
Add dynamic exposure correction (#12959)
* Add uniform for frame delta time
* Adjust exposure in logarithmic (EV) space
* Add network support and LUA API
* Add testing mod
2023-01-06 22:33:25 +01:00
x2048 2715cc8bf6
Occlusion culling algorithm based on recursive descend (#13104)
Co-authored-by: DS <vorunbekannt75@web.de>
2023-01-06 22:31:06 +01:00
lhofhansl 1e7804aaf6
Allow saturation to be controlled by the server. (#13075) 2022-12-25 16:15:32 -08:00
ROllerozxa afd5caa26a
Fully remove pageflip 3D mode (#13074) 2022-12-25 10:57:39 -05:00
ndren 62ee02b8ba
Set and unset relative mouse mode where necessary (#12636)
* Set and unset relative mouse mode where necessary

Co-authored-by: sfan5 <sfan5@live.de>
2022-12-24 09:38:30 +01:00
Jude Melton-Houghton 1798ad0ec4
Avoid out-of-bounds memory access in attached node placement prediction (#13038) 2022-12-10 09:00:27 -05:00
Muhammad Rifqi Priyo Susanto 281f9a9f88
Android: Segmentation fault fix, PendingIntent flag, and other fixes (#12960)
* Android: Segmentation fault fix, PendingIntent flag, and other fixes

- Information about the crosshair is sent after camera initialization.
- Since API 31, PendingIntent requires mutability flag.
- super (class) is called in onRequestPermissionsResult().
- GameActivity suppresses "unused" warning since most of its methods are called from native code.
- Non-null safety is added for nullable function calls.
- Warning/error logging is added for various function calls' return value.

* Move utility functions into Utils.java

- Some nullable functions are changed to be non-null functions.
- Some null checking outside it is removed.
- More annotations are added to functions and parameters.
2022-11-30 10:50:06 -05:00
Wuzzy 3c7f26d937
Add support for attached facedir/4dir nodes (#11432) 2022-11-24 17:56:07 -05:00
lhofhansl 7bf64fc61a
Add configurable saturation (#12865)
* Add configurable saturation

Co-authored-by: Pevernow <3450354617@qq.com>
Co-authored-by: x2048 <codeforsmile@gmail.com>

Author:    Lars <larsh@apache.org>
2022-11-18 11:49:52 -08:00
x2048 81bfc9c7a2
Resize hotbar immediately before drawing (#12930) 2022-11-09 11:57:55 -05:00
Abdou-31 d1b80b462e
Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
x2048 9b24041394
Improve bloom effect (#12916)
* Remove the built-in exposure factor of 2.5
* Add physics-based bloom (https://learnopengl.com/Guest-Articles/2022/Phys.-Based-Bloom)
* Add luminance scaling for bloom layer to simulate HDR
* Add setting to control bloom strength
2022-11-02 09:09:48 +01:00
Muhammad Rifqi Priyo Susanto 987277de52
Send crosshair setting after the touch screen GUI has been initialized (#12910) 2022-10-31 14:17:50 +01:00
Lars Müller 077627181e
Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
sfan5 525fc3833c Implement tool use sounds 2022-09-30 14:02:14 +02:00
sfan5 bbdb1929c6 Clean up Game::handleDigging() and some related parts 2022-09-30 14:02:14 +02:00
Muhammad Rifqi Priyo Susanto 13a8948edd
Improve double tap for jump detection (#12793) 2022-09-30 14:02:06 +02:00
x2048 9df79a4b2d
Bloom (#12791)
Adds configurable light exposure control and bloom effect (light bleeding) with client-side settings.
2022-09-29 20:34:05 +02:00
Muhammad Rifqi Priyo Susanto 3978b9b8ed
Add crosshair support for Android (#7865)
If enabled, a crosshair will be shown to select object.
This will give Android players a way to play like they play on desktop.
On third-person back camera mode, player is forced to use crosshair.
On third-person front camera mode, player is unable to select anything.

Co-authored-by: ROllerozxa <temporaryemail4meh+github@gmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2022-09-29 20:30:33 +02:00
DS 0251b01da6
Pause shader animation timer in singleplayer pause menu (#12766)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-27 16:23:07 -04:00
Wuzzy 1d04903c19
Add paramtype2s for 4 horizontal rotations and 64 colors (#11431)
4dir is like facedir, but only for 4 horizontal directions: NESW. It is identical in behavior to facedir otherwise. The reason why game makers would want to use this over facedir is 1) simplicity and 2) you get 6 free bits.
It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir).

color4dir is like colorfacedir, but you get 64 colors instead of only 8.
2022-09-16 13:18:55 +02:00
Herman Semenov 038da00e79
Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-06 11:21:09 +01:00
x2048 8c29c4f620
Use Sky class to obtain directional light source position for shadows (#12662)
* Also remove unused Sky::getSkyBodyOrbitTilt method

Fixes misalignment of sun position and shadow direction at high tilt values.
2022-08-17 16:30:05 +02:00
x2048 d1cbb4bd8a
Reduce the use of porting::getTimeMs() when rendering frames (#12679)
* Avoid calling TimeTaker too frequently in renderMapXXX
* Calculate animation timer once per frame
* Remove code that breaks rendering frame at 2000ms

Co-authored-by: sfan5 <sfan5@live.de>

Co-authored-by: sfan5 <sfan5@live.de>
2022-08-13 22:33:26 +02:00
rubenwardy a871115889
Fix some warnings (#12615) 2022-07-30 12:51:23 +01:00
sfan5 6611d7e1ee Allow direction keys with autoforward again
This was unintentionally removed in commit 1d69a23.
fixes #12048
2022-07-29 10:19:23 +02:00
x2048 70c54abc2a
Restore flags texture to fix interlaced stereo mode (#12560) 2022-07-19 20:26:57 +02:00
SmallJoker 051181fa6e
Enforce limits of settings that could cause buggy behaviour (#12450)
Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
2022-07-09 22:32:08 +02:00
Wuzzy 142928e944
Allow to set maximum star opacity at daytime (#11663) 2022-07-02 19:57:48 +01:00
JosiahWI 4163c872af
Fix two memleak reports from Coverity (#12466) 2022-06-26 14:37:50 +01:00
SmallJoker a463620edb
Re-order sound-related code (#12382)
Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated
'fade' and 'pitch' values on server-side where only one was used anyway.
SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included.

Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the
future. Per-type version numbers are kept for now as a safety rope in a special case.
2022-06-20 21:56:12 +02:00
Lars Müller f4a53f7ee6
No damage effects on hp_max change (#11846) 2022-06-11 20:00:40 +02:00
rubenwardy 03d86ea0b4
Add register dialog to separate login/register (#12185)
New users find Minetest's account system confusing.
This change moves username/password to a new dialog,
with login and register buttons added to the Join Game tab.

The old registration confirmation dialog is removed in
favour of the new dialog.

Fixes #8138
2022-06-05 17:47:38 +02:00
sfan5 575caa8015 Properly keep noclip state in Game and ClientMap 2022-06-03 21:48:52 +02:00
Lars Müller c2898f53bc
HUD: Update selection mesh every frame (#12270)
Fixes outdated selection boxes after entity property changes.
2022-05-09 20:43:47 +02:00
paradust7 0704ca0550
Make logging cost free when there is no output target (#12247)
The logging streams now do almost no work when there is no output target for them.

For example, if LL_VERBOSE has no output targets, then `verbosestream << x` will return a StreamProxy with a null target. Any further `<<` operations applied to it will do nothing.
2022-05-04 20:55:01 +02:00
sfan5 71a56c3552 Fix broken FPS/dtime counters in debug info
was broken by a89afe1229
2022-05-03 20:17:43 +02:00
sfan5 a89afe1229 Deal with compiler warnings 2022-04-30 16:49:41 +02:00
paradust7 7e18a1f1be
Remove HW_buffer_counter after IrrlichtMt fix to remove HWBufferMap (#12232)
Keep code and use version check instead, for backwards compatibility
2022-04-28 18:52:19 +02:00
Lars Müller 4558793caf
Fix some debug info showing despite being disabled in the UI (#12205) 2022-04-21 21:45:47 +02:00
x2048 0f25fa7af6
Add API to control shadow intensity from the game/mod (#11944)
* Also Disable shadows when sun/moon is hidden. Fixes #11972.
2022-03-26 16:58:26 +01:00
Lars Müller b9e886726c
Readd basic_debug as a HUD flag (#12020) 2022-03-05 22:16:17 +01:00
sfan5 5da204f5bc
Get rid of `basic_debug` last minute
This isn't a revert but rather just disables the codepaths. also see #12011
2022-01-30 21:32:49 +01:00
sfan5 058846d687 Rework drawtime and related timekeeping code to use microseconds 2022-01-27 22:30:02 +01:00
Jude Melton-Houghton fc161e757c
Automatically migrate client mod storage (#11960) 2022-01-27 22:24:30 +01:00
sfan5 f8cef52ea0 Fix consistency of sky sun/moon texture behaviour
Also cleans up related code somewhat.
2022-01-22 11:18:34 -05:00
sfan5 5eb45e1ea0
Restore pass-through of direction keys (#11924)
This moves relevant code into the PlayerControl class and gets rid of separate keyPressed variable.
2022-01-09 18:46:36 +01:00
sfan5 0ea8df4d64
Socket-related cleanups
Improve error handling on Windows and reduce the size of the `Address` class
2021-12-29 23:01:26 +01:00
ROllerozxa fcf86ded8f
Disable inventory if player's inventory formspec is blank (#11827) 2021-12-13 17:43:29 +01:00
Wuzzy f71091bf52 Remove creative/damage info in Esc/Pause menu 2021-12-13 17:33:21 +01:00
sfan5 ff934d538c
Fix various code & correctness issues (#11815) 2021-12-05 14:40:30 +01:00
Riceball LEE 693f98373b
Localize error messages in mainmenu (#11495)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2021-11-01 12:27:46 +00:00
Wuzzy 6910c8d920
Fix number of tool uses being off by 1..32767 (#11110) 2021-10-31 22:33:33 +00:00
Wuzzy 86b44ecd82
Add no_texture.png as fallback for unspecified textures 2021-10-20 21:50:16 +02:00
x2048 f5040707fe
Order drawlist by distance to the camera when rendering (#11651) 2021-09-27 17:46:08 +02:00
TheBrokenRail 3dcf9e963e
Touch UI support for desktop builds (#10729) 2021-09-26 18:04:09 +02:00
DS e79d6154fc
Fix client-side performance of chat UI (#11612) 2021-09-19 20:23:35 +02:00
sfan5 75bf9b75ca
Make sure relevant std::stringstreams are set to binary 2021-09-11 21:06:57 +02:00
NeroBurner 1d69a23ba4
Joystick sensitivity for player movement (#11262)
This commit deprecates the forward, backward, left, and right binary
inputs currently used for player movement in the PlayerControl struct.
In their place, it adds the movement_speed and movement_direction
values, which represents the player movement is a polar coordinate
system.

movement_speed is a scalar from 0.0 to 1.0. movement_direction is
an angle from 0 to +-Pi:

	       FWD
	        0
	        _
	 LFT   / \   RGT
	-Pi/2 |   | +Pi/2
	       \_/
	       +-Pi
	       BCK

Boolean movement bits will still be set for server telegrams and
Lua script invocations to provide full backward compatibility.
When generating these values from an analog input, a direction is
considered active when it is 22.5 degrees away from either
orthogonal axis.

Co-authored-by: Markus Koch <markus@notsyncing.net>
Co-authored-by: sfan5 <sfan5@live.de>
2021-08-27 20:24:24 +02:00
Wuzzy 6fd8aede48
Show status message when changing block bounds (#11556) 2021-08-21 13:53:49 +02:00
rubenwardy 24b66dede0
Add fwgettext util function 2021-08-19 20:13:25 +02:00
sfan5 6e8aebf432
Add bold, italic and monospace font styling for HUD text elements (#11478)
Co-authored-by: Elias Fleckenstein <eliasfleckenstein@web.de>
2021-07-27 19:11:46 +02:00
x2048 bf3acbf388
Distribute shadow map update over multiple frames to reduce stutter (#11422)
Reduces stutter and freezes when playing.

 * Maintains double SM and SM Color textures
 * Light frustum update triggers incremental generation of shadow map into secondary 'future' textures.
 * Every incremental update renders a portion of the shadow draw list (split equally).
 * After defined number of frames (currently, 4), 'future' and 'current' textures are swapped, and DirectionalLight 'commits' the new frustum to use when rendering shadows on screen.

Co-authored-by: sfan5 <sfan5@live.de>
2021-07-25 12:36:23 +02:00
Wuzzy b7b5aad027
Fix revoke debug privs not reliably turn off stuff (#11409) 2021-07-12 20:32:18 +02:00
x2048 effb5356ca
Avoid draw list and shadow map update in the same frame to reduce dtime jitter (#11393)
* Separate draw list and shadows update to reduce jitter

* Avoid draw list update and shadow update in the same frame

* Force-update shadows when camera offset changes
2021-07-11 10:57:29 -07:00
Wuzzy 63fc728a84
Require 'basic_debug' priv to view gameplay-relevant debug info, require 'debug' priv to view wireframe (#9315)
Fixes #7245.
2021-06-24 21:21:19 +03:00