Commit Graph

99 Commits

Author SHA1 Message Date
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