Commit graph

145 commits

Author SHA1 Message Date
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
f42f5f69c8 Implement FindENET.cmake
This library will be later used for networking over UDP/IPv4 in future
commits.
2022-09-20 17:22:45 +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
39dc70c385 orig/LICENSE: Minor changes 2022-09-20 13:52:12 +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
7bc21417c5 Split res-related CMake functions into their own file 2022-09-16 14:28:53 +02:00
a30aee8b90 CMakeLists.txt: bump minimum CMake version 2022-09-16 14:27:18 +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
37ee2c11f3 ps1.cmake: import PSXSDK using find_package 2022-07-23 04:23:05 +02:00
538a03f160 README.md: Update documentation for Win9x builds 2022-07-23 04:23:05 +02:00
f9e46c950f ps1: Use exported target PSXSDK::PSXSDK 2022-07-23 04:23:05 +02:00
127a21a34f Implement FindPSXSDK.cmake 2022-07-23 04:23:05 +02:00
8f3403dffa Update FindSDL_gfx.cmake as of today's upstream
Ongoing PR:
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7475
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
79c0164c21 Create cdroot directory on common CMakeLists.txt 2022-07-23 04:23:05 +02:00
7a6f5cd2e6 README.md: Document dependencies for Ubuntu builds 2022-07-23 04:16:57 +02:00
6b46057728 CMakeLists.txt: Define rts as a C-only project
While it is true "extern C" is used on all headers, there is no need for
CMake to check the C++ compiler.
2022-07-23 04:16:57 +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
360ea710e0 Implement FindSDL_gfx.cmake
Surprisingly, as of today (July 2022) CMake ships with FindSDL*.cmake
files for several SDL libraries such as SDL_mixer or SDL_image, but not
for SDL_gfx, so one was created, based on FindSDL_mixer.cmake.

Reference:
8a3004d5c2/Modules/FindSDL_mixer.cmake
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