ddnet/src/engine
bors[bot] fce6776c38
Merge #4095 #4176
4095: [Concept] Add new mouse state (ingame mouse) r=def- a=Jupeyy

This would remove ui_mousesense and use the desktop cursor position instead for menus and editor
This would also fix the editor cursor to not move faster than in menus.
That's probably how most games would handle menus, instead of using relative mouse mode
And this would work for touch inputs.

The normal gameplay relative mouse is ofc NOT affected by any kind

Opinions?

Missing:
- [x] m_MouseSlow in menus
- [x] Make desktop cursor invisible
- [x] Some components that use ui mouse
- [x] Remove focus in/out relative mouse state changes, fixed with next SDL version


## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


4176: Entity switch prediction r=def- a=trml

Adds the prediction for pickups and projectiles (based on #4108)

For blinking entities (deactivated by switch) I also used the extended info to make the blinking effect happen client-side. So instead of the server omitting the projectile/pickup from the snapshot every N ticks (which prevented some things like explosive bullets from being predicted correctly), the server will keep sending the item and let the client decide how to show it.

Added doors as well, and changed how they are sent (and rendered) in a similar way (by always sending both endpoints and using a fixed m_StartTick instead of updating it every tick).

An idea was that this could potentially reduce network traffic a bit (in addition to helping with prediction), especially for stationary items that are rarely/never have to be updated (doors and pickups).

This makes CItems::OnRender a bit more complex, and it could perhaps be cleaned up some way (either using something like CProjectileData, or by moving more of the logic into RenderProjectile/Laser/Pickup).

Some things missing:
- Add more entities (draggers, light, gun)
- Entities are not correctly shown when in super (e.g. doors are shown as closed, and should be open)

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: trml <trml@users.noreply.github.com>
2021-10-16 16:38:18 +00:00
..
client Merge #4095 #4176 2021-10-16 16:38:18 +00:00
docs Fix a woopsie in snapshot docs 2021-05-29 11:07:33 +02:00
external Rename VERSION to VERSION.txt 2021-10-06 16:13:36 +02:00
server remove missused volatile 2021-10-15 12:15:39 +02:00
shared Merge #4095 #4176 2021-10-16 16:38:18 +00:00
antibot.h Allow the antibot to get more insight into the network 2021-06-24 20:32:41 +02:00
client.h Make emoticons smoother 2021-09-13 16:26:48 +02:00
config.h Port CConfig API from the upstream (0.7.5) 2021-01-10 17:10:19 +03:00
console.h More colors from chat in console 2021-03-08 01:20:28 +01:00
demo.h Run clang-format 2020-09-26 21:50:15 +02:00
discord.h Put the Discord stuff into its own file 2021-01-31 10:17:21 +01:00
editor.h Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
engine.h Add serverbrowser ping cache 2021-05-14 01:00:41 +02:00
friends.h Run clang-format 2020-09-26 21:50:15 +02:00
ghost.h Update ghost format to v6: Replace CRC with SHA256 2020-10-14 17:08:58 +02:00
graphics.h Add new mouse state 2021-10-07 16:48:25 +02:00
input.h Add new mouse state 2021-10-07 16:48:25 +02:00
kernel.h Run clang-format 2020-09-26 21:50:15 +02:00
keys.h Use scancodes instead of keycodes for input (fixes #796, please test) 2017-07-21 19:53:49 +02:00
map.h Run clang-format 2020-09-26 21:50:15 +02:00
masterserver.h Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
message.h Run clang-format 2020-09-26 21:50:15 +02:00
server.h Move team and practice mode recording to the beginning of the tick 2021-09-14 22:33:09 +02:00
serverbrowser.h uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
sound.h Modulize skins, particles, emoticons and game 2020-10-09 09:07:19 +02:00
sqlite.h Add sqlite3 to the client 2021-05-14 01:00:41 +02:00
steam.h Allow joining and inviting others via Steam friend list while ingame 2020-09-06 17:08:38 +02:00
storage.h Make use of IO_MAX_PATH_LENGTH 2021-09-13 12:14:50 +02:00
textrender.h Add basic selection support for ui ex edit boxes 2021-10-04 19:58:25 +02:00
updater.h Overhauled job system 2017-11-23 15:47:38 +01:00
uuid.h Make sure headers compile standalone 2020-09-26 21:50:27 +02:00
warning.h Add block list for drivers 2020-11-05 21:07:14 +01:00