1
0
mirror of https://github.com/minetest/minetest.git synced 2024-09-27 06:50:29 +02:00
Commit Graph

167 Commits

Author SHA1 Message Date
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
Liso
c47313db65
Shadow mapping render pass (#11244)
Co-authored-by: x2048 <codeforsmile@gmail.com>
2021-06-06 18:51:21 +02:00
Loic Blot
de85bc9227 fix: some code tidy about includes & irr namespaces 2021-05-03 19:49:19 +02:00
Loic Blot
48d5abd5be refacto: remove get_gui_env & draw_load_screen from RenderingEngine singleton 2021-05-03 19:49:19 +02:00
Loic Blot
ccdd886e27 refacto: Hud: make driver, client, player, inventory, tsrc private & drop unused guienv
also fix c_content.h, on client it includes the src/client/hud.h instead of src/hud.h, which leads to wrong file dependency on the lua stack
2021-05-03 19:49:19 +02:00
Loic Blot
1bc855646e refacto: protect some RenderingEngine::get_scene_manager
* protect it from Camera, Sky, ClientMap object calls
* rename Game::sky to Game::m_sky
2021-05-03 19:49:19 +02:00
Loic Blot
258101a910 refacto: RenderingEngine is now better hidden
* No more access to the singleton instance from everywhere (RenderingEngine::get_instance dropped)
* RenderingEngine::get_timer_time is now non static
* RenderingEngine::draw_menu_scene is now non static
* RenderingEngine::draw_scene is now non static
* RenderingEngine::{initialize,finalize} are now non static
* RenderingEngine::run is now non static
* RenderingEngine::getWindowSize now have a static helper. It was mandatory to hide the global get_instance access
2021-05-03 19:49:19 +02:00
Loic Blot
74125a74d3 refacto: hide mesh_cache inside the rendering engine
This permit cleaner access to meshCache and ensure we don't access to it from all the code
2021-05-03 19:49:19 +02:00
Loic Blot
e34d28af9f refacto: rendering engine singleton removal step 1 (filesystem)
Make the RenderingEngine filesystem member non accessible from everywhere

This permits also to determine that some lua code has directly a logic to extract zip file. Move this logic inside client, it's not the lua stack role to perform a such complex operation

Found also another irrlicht <1.8 compat code to remove
2021-05-03 19:49:19 +02:00
Seth Traverse
16e5b39e1d
Add a key to toggle map block bounds (#11172)
It's often useful to know where the map block boundaries are for doing server admin work and the like.
Adds three modes: single mapblock, range of 5, and disabled.
2021-04-20 19:23:31 +02:00
sfan5
19c283546c Don't apply connection timeout limit to locally hosted servers
fixes #11085
2021-04-05 15:21:43 +02:00
SmallJoker
c11208c4b5
Game: Scale damage flash to max HP
The flash intensity is calculated proportionally to the maximal HP.
2021-04-05 13:38:50 +02:00
sfan5
1e4913cd76
Irrlicht support code maintenance 2021-03-31 13:15:47 +02:00
SmallJoker
f4118a4fde
Consistent title bar + render information in mainmenu (#10764) 2021-03-30 21:49:15 +02:00
Vitaliy
44ed05ddf0
Restore minimal normal texture support (for minimap shading) 2021-03-21 23:22:22 +01:00
Elias Åström
59a1b53d67
Scale mouse/joystick sensitivity depending on FOV (#11007) 2021-03-19 21:43:01 +01:00
sfan5
bf8fb2672e
Use place_param2 client-side for item appearance & prediction (#11024) 2021-03-09 00:56:53 +01:00
sfan5
593d5f4465 Clean up ClientEvent hudadd/hudchange internals 2021-03-06 23:02:10 +01:00
Vitaliy
abb0c99a6c Pause animations while game is paused (#10658)
Pauses all mesh animations while game is paused.
2021-03-05 16:30:01 +01:00
savilli
3edb1ddb81
Fix hud_change and hud_remove after hud_add (#10997) 2021-02-26 21:21:20 +01:00
Wuzzy
827224635b
Use "Aux1" key name consistently everywhere 2021-02-24 11:45:30 +01:00
Jean-Patrick Guerrero
1d64e6537c Pause menu: Fix segfault on u/down key input 2021-02-08 18:56:51 +01:00
sfan5
74762470b2 Fix some minor code issues all over the place 2020-12-24 13:44:54 +01:00
Markus
af22dd86e3
Fix some more joystick issues (#10624) 2020-12-19 22:01:05 +01:00
Vitaliy
ccbf8029ea
Cleanup shader generation code (#10663)
Shader generation is a mess. This commit cleans some parts up, including dropping remains of HLSL support which was never actually implemented.
2020-12-19 20:57:10 +01:00
SmallJoker
3176daee79 Input: Fix on_rightclick called when placing into air 2020-11-29 19:20:45 +01:00
numzero
cdcf7dca7c Sky: support GLES2
IrrLicht built-in shader is broken, have to write my own
2020-11-26 12:49:10 -08:00
Pierre-Yves Rollo
78273027bf Add sound to press event of some formspecs elements (#10402) 2020-11-23 21:28:25 +01:00
Markus Koch
e1142ee57f Joystick: Remap joystick-specific KeyTypes to generic ones
According to the following table:
	* MOUSE_L     -> DIG
	* MOUSE_R     -> PLACE
	* SCROLL_UP   -> HOTBAR_NEXT
	* SCROLL_DOWN -> HOTBAR_PREV

This commit entirely removes the special KeyTypes used for joysticks.

Support for the MOUSE KeyTypes had already been removed in the main
game code without adapting the joystick code, breaking joystick
input. This commit restores joystick functionality.
2020-11-09 11:58:50 +01:00
Maksim
5c0a57f606
Fix Media... 0% on loading screen (#9478) 2020-10-21 20:42:40 +01:00
Lars
738f624218 Periodically release all mesh HW buffers to avoid an Irrlicht bottleneck. 2020-10-17 13:22:30 -07:00
Lars
ed22260822 Remove all bump mapping and parallax occlusion related code. 2020-10-17 13:09:16 -07:00
Pierre-Yves Rollo
81c66d6efb Minimap as HUD element with API control
Features:
 * Define Minimap available modes (surface/radar, scale) from Lua, using player:set_minimap_modes()
 * New HUD elements for displaying minimap with custom size and placing
 * New minimap mode for displaying a texture instead of the map
2020-10-04 15:24:34 +02:00
Jordan Snelling
3068853e8a
Add First Person Attachments (#10360)
Fixes some other third person camera specific attachments.
Implements a single new flag for entities to be forced visible in first person mode.
Old mods do not need to be updated to use the new flag and are fully backwards compatible.
2020-10-04 15:10:34 +02:00
HybridDog
9dc29a75b4
Reduce the FPS when the window is unfocused (#8837) 2020-10-03 17:33:51 +01:00
Desour
f27cf47779 Properly handle mod-errors in on_shutdown 2020-08-24 19:55:25 +03:00
ANAND
291a6b70d6 Allow binding dig, place actions to keys; remove LMB/RMB hardcoding
Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
2020-08-15 12:19:20 +03:00
Wuzzy
ae83edd165
Play place_failed sound if occupied or cannot attach (#9486) 2020-07-27 19:40:33 +02:00
LoneWolfHT
88ffd64124 Add object crosshair, disable entity selectionboxes by default (#9523)
Adds new object crosshair base pack texture
2020-07-14 19:13:04 +02:00
SmallJoker
4fa1e03f68
Cleanup ClientLauncher structure (#10160)
Remove duplicated variables and unify the startup data into a new (inherited) struct.
2020-07-14 19:10:37 +02:00
Lars Müller
e7e065f553
Exposing the zoom key to Lua API (#9903)
Co-authored-by: Raul Ferriz <raul.ferriz@gmail.com>
2020-06-13 22:46:20 +02:00
MoNTE48
b9f618746c TouchScreenGUI: fix some bugs, cleanup 2020-06-09 19:35:25 +02:00
sfan5
471e567657 Value copy / allocation optimizations mostly in server, SAO and serialize code 2020-05-27 21:58:40 +02:00
SmallJoker
836dd4a1e4
Add chat_log_level setting (#9223)
Log all higher levels in LogOutputBuffer
Move StreamLogOutput::logRaw to source file like LogOutputBuffer::logRaw for compiling speed
2020-05-14 19:26:15 +02:00
Wuzzy
6e1372bd89
Add support for statbar “off state” icons (#9462)
This adds support for optional “off state” icons for statbars. “off state icons” can be used to denote the lack of something, like missing hearts or bubbles.

Add "off state" textures to the builtin statbars.

Co-authored-by: SmallJoker <mk939@ymail.com>
2020-05-11 21:40:45 +02:00
Loïc Blot
454dbf83a9
Server class code cleanups (#9769)
* Server::overrideDayNightRatio doesn't require to return bool
There is no sense to sending null player, the caller should send a valid object

* Server::init: make private & cleanup
This function is always called before start() and loads some variables which can be loaded in constructor directly.
Make it private and call it directly in start

* Split Server inventory responsibility to a dedicated object

This splits permit to found various historical issues:
* duplicate lookups on player connection
* sending inventory to non related player when a player connects
* non friendly lookups on detached inventories ownership

This reduce the detached inventory complexity and also increased the
lookup performance in a quite interesting way for servers with thousands
of inventories.
2020-05-07 22:38:41 +02:00
Loïc Blot
f1a05d0f71
Fix broken client if openal cannot be opened (#9804) 2020-05-05 08:38:18 +02:00
SmallJoker
cad5b987ad Sky API: Rename *_tint to fog_*_tint for consistency 2020-05-05 08:37:04 +02:00
Paul Ouellette
49ed0ca00a
Ensure game is shutdown if server throws exception (#9742) 2020-04-25 09:42:18 +02:00
EvidenceB Kidscode
cee3c5e73d
Add server side translations capability (#9733)
* Add server side translations capability
2020-04-25 07:20:00 +02:00
SmallJoker
ce5b0932f8
Camera: Fix shootline line offsets II (#9730) 2020-04-23 12:16:36 +02:00
SmallJoker
45999b74e6
Camera: Fix shooting line offsets (#9681)
Removes duplicated offset calculations from Game and use whatever the Camera class returns.
This keeps the eye position nicely in sync, and gets rid of duplicated code.
2020-04-16 18:32:07 +02:00
Wuzzy
7e21b3cd48
Remove sound menu and show proper msgs if sound is off (#9069) 2020-04-13 20:26:54 +02:00
Wuzzy
a24d3b3600
Play 'player_jump' when player jumps (#9373) 2020-04-12 00:50:40 +01:00
Hugues Ross
f780bae05c
Formspecs: Add state-selection to style elements (#9378) 2020-04-11 21:39:30 +01:00
sfan5
f105bc8dc2 A few initialization cleanups 2020-04-11 13:12:51 +02:00
sfan5
de73f989eb
Overall improvements to log messages (#9598)
Hide some unnecessarily verbose ones behind --trace or disable them entirely.
Remove duplicate ones. Improve their contents in some places.
2020-04-08 20:13:23 +02:00
Wuzzy
625b100593
Add comments for translators (#9510)
* Add translator comments for "special" strings

* Add translator comments for some "tricky" strings
2020-03-20 09:41:07 +01:00
Jordach
946c03c69b set_sky improvements, set_sun, set_moon and set_stars 2020-03-05 20:12:19 +01:00
Pierre-Yves Rollo
cf7fda0083 Add z-index management to HUD 2019-12-06 20:31:26 +00:00
sfan5
3f271564e0 Run on_item_use CSM callback even if item is not marked usable
Mods may want to to handle item interaction even if the item
is not marked usable (= server-side callback exists).
2019-11-11 14:06:48 +01:00
Paramat
f483a1a9b2
Fix isDead()/autoforward crash (#9031)
Crash occurred in singleplayer when leaving a world with
autoforward enabled then re-entering a world.
2019-10-09 19:39:50 +01:00
ANAND
3799ffd9d5 Move Quicktune code to util/ (#8871) 2019-09-29 13:41:13 +02:00
lhofhansl
5fde69798c
Simple shader fixes. (#8991)
1. Pass current camera offset to shader, so shader have access to the global coordinates
2. Pass animation timer to fragment shader. C++ code is already there, just wasn't declared in the shader
3. Delay animation timer wrap-around (from 100s to about 16 minutes)
2019-09-26 13:57:39 -07:00
DS-Minetest
cf78e37da3 Move the code for meta formspec into bool Game::nodePlacement(const ItemDefinition &selected_def, 2019-09-22 22:12:49 +02:00
Anand S
47da640d77 Add support for per-player FOV overrides and multipliers 2019-09-19 20:14:16 +02:00
DS-Minetest
0b5c5499ec Trigger on_place in many situations even if prediction failed 2019-09-19 16:36:02 +02:00
SmallJoker
1de4ca1f9d Built-in formspecs: Force version 1 2019-09-14 20:42:54 +02:00
SmallJoker
9acd36bf99 Formspecs: Introduce formspec_version to mods 2019-09-14 19:43:08 +02:00
SmallJoker
23677be951 Load CSM environment after the restrictions are known
Safety-guards for CSM callbacks to abort on a bad implementation
Only run callbacks when the mods are loaded (and with it: builtin)

Duplication checks inside constructors
2019-09-14 19:42:25 +02:00
SmallJoker
0b4f424f41
Inventory: Send dirty lists where appropriate (#8742)
This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time.

Raises protocol version to 38 to ensure correct backwards-compatible code.
2019-08-24 19:07:38 +02:00
ANAND
3c395d908f Disable autoforward if player is dead 2019-08-20 18:48:28 +02:00
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
SmallJoker
0c533dc436 Game: Fix double BS multiplication 2019-08-07 21:23:01 +02:00