18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 06:35:21 +01:00
Files
maszyna/input
miloszunio 5350d9ba6b fix(driver): the flashlight after the review of 24.11: a local command, a shadow map of its own, a free key
The command went over the network. flashlighttoggle was a simulation command, and those are sent to
every machine of a network game: one player's key switched the flashlight of all of them. It is an
entity command now, as the commands of the camera are; those stay on the machine they were given on
(command_queue::is_network_target()). TCamera::OnCommand() takes it, simulation.cpp no longer does.

The shadows took the budget of the scenery lamps. The flashlight is the light nearest to the camera,
so it took the first of the gfx.lights.shadows.lamps slots, and as it moves with the player its map
was drawn anew in nearly every frame, out of the scenery drawings a frame allows the lamps (one a
frame at levels 1 and 2): the lamps kept waiting for their shadows. The flashlight now has a slot of
its own past those of the lamps, made when it is first switched on, and its map is drawn when it
needs it, not counted against the lamps. With gfx.lights.shadows.lamps 0 it has no shadows, as before.

The key. Ctrl+Shift+L is motorconnectorsclose in the eu07_input-keyboard.ini the game ships with, and
bind() gives a key two commands share to the later one in user_command, so the flashlight took it
over. The default is Ctrl+Shift+F, which neither that file nor the defaults in the code use. For the
files of the players that do use it: a default of the flashlight on a key their file binds to another
command is dropped (keyboard_input::yield_default()), with a line in the log, so their binding keeps
working; they bind the flashlight to a key of their choice.
2026-11-30 12:33:36 +00:00
..
2026-06-17 01:19:59 +02:00