Commit Graph

10 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
4c5630b0d4 Remap calls to pad/mouse/keyboard to input 2022-09-20 16:56:30 +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
b0eb562b9b gui: reuse callback data
There is no need to allocate memory for these callbacks for each single
GUI element. Instead, a single, statically-allocated instance can be
shared among all GUI elements of a given type.
2022-07-02 04:08:35 +02:00
04b9219ee5 button.c: h/v-center child label by default 2022-07-02 00:50:26 +02:00
391c8958b1 button.c: fail on negative width 2022-06-29 01:01:03 +02:00
cff35e88f5 gui: implement {h,v}centered 2022-06-29 00:39:06 +02:00
7c75118429 Revamp gui component
`gui` was tighly coupled to game logic, and could not be extended for
other purposes. Therefore, a generic GUI implementation, loosely
inspired by well-known GUI frameworks such as GTK, is now provided, with
the following properties:

- Does not depend on dynamic or static memory allocation, only automatic
(i.e., stack) memory allocation required.
- Portable among existing implementations.
- Simple to extend.
- Tiny memory footprint.

`gui` is now composed by GUI elements that can be chained to form a tree
structure. This is useful e.g.: to calculate X/Y coordinates for a given
GUI element given its parent(s).

This commit also refactors the older implementation, moving
game-specific logic into `player` and making use of the new component.
2022-06-26 20:00:27 +02:00