Commit Graph

14 Commits

Author SHA1 Message Date
Xavier Del Campo Romero 4c5630b0d4 Remap calls to pad/mouse/keyboard to input 2022-09-20 16:56:30 +02:00
Xavier Del Campo Romero 76a49ba3d5 mouse.c: Reduce threshold 2022-09-16 20:33:39 +02:00
Xavier Del Campo Romero 9da37c198e camera: implement fixed cursor movement
On platforms with PERIPHERAL_TYPE_PAD, navigating through menus and
options can be cumbersome if moving the cursor freely around the
screen.

Therefore, this commit instead defines a list of (X, Y) coordinates that
the cursor can jump to. The implementation also attempts to guess which
direction the cursor should jump to for the previous/next point, and
hence determine which button should be pressed by the user.
2022-06-24 17:45:50 +02:00
Xavier Del Campo Romero 8ddea5eef5 camera.c: refactor cursor_init
So that uninitialized members are set to 0.
2022-06-24 17:45:14 +02:00
Xavier Del Campo Romero 3cb276b19f camera: remove dependency against terrain
This will allow using camera for purposes other than showing the game
map.
2022-06-12 23:19:03 +02:00
Xavier Del Campo Romero 0f9e2d8958 Split peripheral-related logic into its own component
This has several advantages:

- `camera` no longer needs to define public functions for each
peripheral type.
- Peripheral-related is now no longer tighly coupled to human_player,
so peripheral logic can be reused elsewhere e.g.: on menus.
- Makes camera_update_touch consistent compared to equivalent functions,
since now `pan` has now been moved to `camera` (as it should be).
2022-06-12 23:18:57 +02:00
Xavier Del Campo Romero 45337576df Implement touch controls 2022-03-31 06:50:33 +02:00
Xavier Del Campo Romero 638dbd0af1 Rename MAP_{X|Y} to MAP_{W|H} 2022-03-30 08:23:15 +02:00
Xavier Del Campo Romero e9d69f9083 camera: implement mouse support 2022-03-30 08:20:21 +02:00
Xavier Del Campo Romero 244f0b26f8 Move CURSOR_{WIDTH|HEIGHT} to library scope 2022-03-30 08:20:21 +02:00
Xavier Del Campo Romero 9eee43d3bb Add support for keyboard and mouse 2022-03-30 08:20:21 +02:00
Xavier Del Campo Romero 3d90015c62 Replace x_get functions with macros
The PS1 port relies on a heap for primitives since the GPU renders the
scene asynchronously. However, SDL-based platforms render primitives
synchronously, so structures can be allocated on the stack instead.
2022-03-30 08:20:21 +02:00
Xavier Del Campo Romero 68383dad33 Refresh camera and terrain rendering on screen resize 2022-03-30 08:20:20 +02:00
Xavier Del Campo Romero 8c10334252 Add project source code 2022-03-30 08:20:20 +02:00