aboutsummaryrefslogtreecommitdiff
path: root/src/player
Commit message (Collapse)AuthorAgeFilesLines
* Remove resource, tech and old game resourcesXavier Del Campo Romero2024-01-276-508/+44
|
* WIPXavier Del Campo Romero2022-11-013-24/+16
|
* Remap calls to pad/mouse/keyboard to inputXavier Del Campo Romero2022-09-203-16/+27
|
* human_player_gui.c: use gui_container for top gui_barXavier Del Campo Romero2022-07-021-9/+16
|
* human_player_gui.c: fix segfault when selecting one unitXavier Del Campo Romero2022-06-271-1/+1
| | | | | | | Checking against `sel` is just plain wrong, since it always expected to be non-NULL, since `h->sel` is an array defined in `struct human_player`. Instead, `sel->d.i` is the pointer that should be checked.
* human_player: deprecate memset(3) for zero-initXavier Del Campo Romero2022-06-262-7/+12
|
* human_player.c: reset deselected instancesXavier Del Campo Romero2022-06-261-0/+9
|
* Fix hp bar not being displayed when carryingXavier Del Campo Romero2022-06-261-7/+6
|
* Revamp gui componentXavier Del Campo Romero2022-06-264-4/+368
| | | | | | | | | | | | | | | | | | | | `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.
* Deprecate memset(3) over C99 compound literals for zero-initXavier Del Campo Romero2022-06-261-1/+1
| | | | | Using memset(3) does not ensure pointers are assigned to NULL for all platforms.
* player: limit data sizes for resources and populationXavier Del Campo Romero2022-06-263-3/+6
| | | | | - All platforms should allow for the same resources. - Population is not expected to exceed UCHAR_MAX on any platform.
* peripheral: provide common actionsXavier Del Campo Romero2022-06-242-36/+9
| | | | | | Whereas some actions are context-specific (e.g.: selecting a player), some are context-independent and can be executed for all screens (e.g.: exiting the game).
* camera: remove dependency against terrainXavier Del Campo Romero2022-06-121-0/+1
| | | | | This will allow using camera for purposes other than showing the game map.
* Split peripheral-related logic into its own componentXavier Del Campo Romero2022-06-122-62/+25
| | | | | | | | | | | 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).
* Remove unused minor stuffXavier Del Campo Romero2022-03-311-1/+0
|
* Fix exit conditionXavier Del Campo Romero2022-03-311-1/+1
|
* Implement touch controlsXavier Del Campo Romero2022-03-312-13/+105
|
* Add support for keyboard and mouseXavier Del Campo Romero2022-03-303-53/+193
|
* Add project source codeXavier Del Campo Romero2022-03-305-0/+838