Commit Graph

111 Commits

Author SHA1 Message Date
c5f04adaea
wip3 2023-04-07 02:56:36 +02:00
850ed93367
wip2 2022-12-08 17:00:23 +01:00
02febc7367
Add tests for transport 2022-11-11 00:37:37 +01:00
9e1f1069cc
WIP 2022-11-01 16:26:16 +01:00
28d624a7b8 unit.h: remove unused constant MAX_UNIT_DIRECTIONS 2022-09-26 02:25:18 +02:00
b79ccb900a gui/line_edit: Allow setting input filters 2022-09-26 02:24:46 +02:00
98aa3ceb13 Swap U offset for idle/pressed cursor sprites
Since the cursor is mostly idle, it makes sense to set its sprite as
the default.
2022-09-26 02:23:23 +02:00
cc1278e0b6 net: Relocate source files for consistency 2022-09-24 06:42:02 +02:00
b4c08b585c net.h: Add missing extern "C" 2022-09-23 04:39:36 +02:00
e6ae88aa87 input.c: do not fail on input_render
Implementation is still incomplete, and should not crash the
application.
2022-09-23 04:38:33 +02:00
eed4687120 join_menu.c: Update serial/IPv4 GUI menus 2022-09-23 04:38:33 +02:00
6f5058c584 ps1/net.c: return 0 on net_init
Even if the implementation is not finished yet, this will avoid the
program from crashing on startup.
2022-09-23 04:38:33 +02:00
8435b3f5fd net: Implement net_available 2022-09-23 04:38:33 +02:00
b108afb6e7 net: Implement net_serial_devices
This function provides a platform-specific list of serial devices that
can be accessed.
2022-09-23 04:38:20 +02:00
26692e8cb9 keyboard: Add KEYBOARD_KEY_SLASH 2022-09-23 04:20:57 +02:00
f8c74babda label.c: Set empty text by default
This will avoid crashing the application on rendering due to
uninitialized labels.
2022-09-23 04:20:13 +02:00
9e308d97d9 gui.c: Remove unneeded condition
Even if neither hcentered or vcentered are used, GUI element position
must be determined by that of its parents.
2022-09-23 04:18:20 +02:00
68ccd085fc gui.c: Fix minor const-correctness issues 2022-09-23 04:17:44 +02:00
d989dc6f49 gui: Allow elements to be hidden
When a GUI element is hidden, no rendering or updating is done to it or
its children. This can be useful to define a complex GUI tree structure
that changes under specific conditions, without redefining it.
2022-09-23 04:15:55 +02:00
d0089e7ddf gfx: Provide functions for fullscreen handling 2022-09-23 04:12:56 +02:00
9d3e754f36 Implement checkbox GUI element 2022-09-23 04:12:07 +02:00
467f09e952 net: Group events into struct 2022-09-21 18:27:58 +02:00
85d4af0266 gui: fix wrong logic on update/render/deinit
The older implementation caused some elements to be
update/rendered/deinitialized more than once per call. For example,
considering the following tree of GUI elements:

A
    B
    C
        D
    E

The older implementation would update/render/deinitialize C and E more
than once, as shown below:

Update A
Update B
Update C
Update D
Update E
Update C

This was because a GUI element was acting on its siblings, but the
siblings would also act on theirs, causing the extra calls.

OTOH, as an additional improvement, no nested call is now required for
siblings.
2022-09-21 18:14:44 +02:00
3eef29c327 menu: Implement join_menu 2022-09-20 17:34:25 +02:00
8f9737b776 Implement GUI line edit 2022-09-20 17:34:25 +02:00
e3356fde2d gui: Implement gui_deinit 2022-09-20 17:34:25 +02:00
84c834c000 Implement net component 2022-09-20 17:34:21 +02:00
4c5630b0d4 Remap calls to pad/mouse/keyboard to input 2022-09-20 16:56:30 +02:00
684587a3c3 Implement input component
It is required to redirect keyboard input (both physical or not) when
a GUI line edit is focused. This means other components cannot be
activated on key presses.

Therefore, this new component is meant as a higher-level abstraction
compared to the `keyboard`/`pad`/`mouse` components, which:

- Implements the same APIs provided by `keyboard`, `mouse` and `pad`.
- Returns the same results as the APIs above if no GUI element is
focused, no input otherwise.

Note: replacing calls to `keyboard`/`pad`/`mouse` with `input` will be
implemented in a future commit.
2022-09-20 13:52:14 +02:00
b8d3eff412 keyboard: Add new public functions
These will be used by future commits.
2022-09-20 13:52:14 +02:00
ade4a509e9 Minor code style fixes 2022-09-20 13:51:08 +02:00
a3f167ee04 sdl-1.2: Remap missing keyboard keys 2022-09-20 12:30:06 +02:00
481a312e76 keyboard_key.h: add more keys 2022-09-20 12:29:45 +02:00
b8def012d5 sdl-1.2: Remap SDLK_ESCAPE to KEYBOARD_KEY_ESC 2022-09-16 20:35:04 +02:00
76a49ba3d5 mouse.c: Reduce threshold 2022-09-16 20:33:39 +02:00
da22c8d922 Split CMakeLists.txt for src 2022-09-16 20:29:47 +02:00
5829ef82c4 Use find_package for SDL libraries
CMake already distributes FindSDL*.cmake files for SDL and SDL_mixer,
which support custom prefixes via environment variables, removing the
need for ad-hoc logic in Win9x builds.

Also, according to FindSDL.cmake, #include <SDL.h> is the preferred way
for portability reasons, instead of #include <SDL/SDL.h>, which is the
option that has been used so far.
2022-07-23 04:23:05 +02:00
f9e46c950f ps1: Use exported target PSXSDK::PSXSDK 2022-07-23 04:23:05 +02:00
c37cd892a0 system/CMakeLists.txt: group common private dependencies into var 2022-07-23 04:23:05 +02:00
f753ede740 SDL-1.2: Implement X mirroring for quads 2022-07-15 01:35:46 +02:00
2d22b88695 Import SDL_gfx 2022-07-15 01:03:36 +02:00
96dbdea21e gui: Update elements in reverse order
This allows to calculate dimensions for containers with children
containers in it.
2022-07-15 01:03:36 +02:00
1ea5a4d4a4 Deprecate memset(3) in favour of C99 compound literals 2022-07-15 01:03:31 +02:00
e636accfd5 Allow children of gui_container be resized anytime
So far, their position inside the container was determined when
initializing the interface. However, if a child were resized
afterwards, the container would not adjust its elements accordingly.
Moreover, the implementation for gui_container relied on hacking the
children's X/Y coordinates, which could only be done once.

Now, two additional members have been added to gui_common so that
specific X/Y offset can be determined by the parent, additionally to the
traditional rules followed by gui_coords. Despite the extra memory
footprint, it now allows containers to set specific X/Y offsets for
their children on every game cycle.
2022-07-10 00:26:48 +02:00
08951d4af5 Implement join/host and game cfg menus 2022-07-07 02:45:23 +02:00
c9dee333fe Implement system_can_exit 2022-07-07 02:45:23 +02:00
251bd41c44 Allow multiple button types 2022-07-07 02:37:25 +02:00
a0363cef85 button.c: fix wrong function call 2022-07-07 02:37:25 +02:00
4f714af054 rounded_rect.h: fix typo 2022-07-07 02:37:25 +02:00
bebf6d6b5f font.c: set null dimensions on null str 2022-07-02 04:50:50 +02:00