aboutsummaryrefslogtreecommitdiff
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Allow multiple button typesXavier Del Campo Romero2022-07-075-108/+190
|
* button.c: fix wrong function callXavier Del Campo Romero2022-07-071-1/+1
|
* rounded_rect.h: fix typoXavier Del Campo Romero2022-07-071-1/+1
|
* gui/container: support spacing between GUI elementsXavier Del Campo Romero2022-07-022-1/+7
|
* gui/bar: support arbitrary x/y and widthXavier Del Campo Romero2022-07-022-20/+46
|
* gui: reuse callback dataXavier Del Campo Romero2022-07-028-26/+60
| | | | | | 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.
* gui: implement containerXavier Del Campo Romero2022-07-023-0/+91
| | | | | Containers, somewhat inspired by GtkBox, allow to packed other GUI elements into a single row or column.
* button.c: h/v-center child label by defaultXavier Del Campo Romero2022-07-021-0/+2
|
* gui.c: fix wrong logic on gui_coordsXavier Del Campo Romero2022-07-021-1/+3
| | | | | | | The older logic would iterate for all parents, where each parent would again iterate for all of its parents, until no more parents found. This is however not needed, since only inspecting the closest parent will already cause the (recursive) algorithm to iterate for all parents.
* gui: allow custom add_child callbackXavier Del Campo Romero2022-07-022-0/+4
|
* button.c: fail on negative widthXavier Del Campo Romero2022-06-291-0/+2
|
* gui: implement {h,v}centeredXavier Del Campo Romero2022-06-295-3/+70
|
* Revamp gui componentXavier Del Campo Romero2022-06-2614-440/+862
| | | | | | | | | | | | | | | | | | | | `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.
* Replace x_get functions with macrosXavier Del Campo Romero2022-03-301-46/+25
| | | | | | 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.
* Add project source codeXavier Del Campo Romero2022-03-303-0/+512