aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow multiple button typesXavier Del Campo Romero2022-07-076-117/+218
|
* 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
|
* font.c: set null dimensions on null strXavier Del Campo Romero2022-07-021-0/+11
|
* human_player_gui.c: use gui_container for top gui_barXavier Del Campo Romero2022-07-021-9/+16
|
* 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.
* menu: implement main menu using new GUI improvementsXavier Del Campo Romero2022-07-021-8/+19
|
* 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
|
* host.cmake, win9x.cmake: fetch libfixmath if missingXavier Del Campo Romero2022-06-303-0/+10
|
* menu.c: center play button on screenXavier Del Campo Romero2022-06-291-2/+2
|
* 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
|
* font: implement font_dimXavier Del Campo Romero2022-06-292-16/+46
|
* Deprecate memset(3) for zero-initXavier Del Campo Romero2022-06-272-2/+2
|
* 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
|
* ps1/heap.c: bump heap sizeXavier Del Campo Romero2022-06-261-1/+1
|
* Implement main menuXavier Del Campo Romero2022-06-268-12/+106
|
* terrain: fix wrong renderingXavier Del Campo Romero2022-06-261-2/+2
| | | | | The older implementation would leave empty areas on the right side of the screen.
* font: deprecate font_printfXavier Del Campo Romero2022-06-262-20/+0
| | | | This function is no longer needed since `gui` was revamped.
* Revamp gui componentXavier Del Campo Romero2022-06-2624-599/+1245
| | | | | | | | | | | | | | | | | | | | `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.
* font: add font_putsXavier Del Campo Romero2022-06-262-0/+7
|
* peripheral.c: initialize common members onlyXavier Del Campo Romero2022-06-261-1/+1
| | | | Other members will be initialized according to peripheral configuration.
* Deprecate memset(3) over C99 compound literals for zero-initXavier Del Campo Romero2022-06-263-3/+3
| | | | | 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.
* camera: implement fixed cursor movementXavier Del Campo Romero2022-06-243-3/+77
| | | | | | | | | | | On platforms with PERIPHERAL_TYPE_PAD, navigating through menus and options can be cumbersome if moving the cursor freely around the screen. Therefore, this commit instead defines a list of (X, Y) coordinates that the cursor can jump to. The implementation also attempts to guess which direction the cursor should jump to for the previous/next point, and hence determine which button should be pressed by the user.
* camera.c: refactor cursor_initXavier Del Campo Romero2022-06-241-4/+15
| | | | So that uninitialized members are set to 0.
* peripheral: provide common actionsXavier Del Campo Romero2022-06-246-38/+38
| | | | | | 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).
* README.md: add copyright noticeXavier Del Campo Romero2022-06-241-7/+12
|
* README.md: update according to current statusXavier Del Campo Romero2022-06-241-2/+8
|
* cmake/ps1.cmake: use add_library for libpsx.aXavier Del Campo Romero2022-06-191-5/+7
|
* Deprecate <TARGET>_BUILD in favor of CMAKE_TOOLCHAIN_FILEXavier Del Campo Romero2022-06-192-23/+32
|
* camera: remove dependency against terrainXavier Del Campo Romero2022-06-126-9/+20
| | | | | 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-1213-78/+165
| | | | | | | | | | | 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).
* CMakeLists.txt: limit libraries linked to by ${PROJECT_NAME}Xavier Del Campo Romero2022-06-121-1/+2
| | | | | Old behaviour was linking to all components, but main.c currently only needs a few of them.
* sdl-1.2/sound.c: use SDL_WasInitXavier Del Campo Romero2022-06-111-4/+2
|
* sdl-1.2: return to original dimensions on fullscreen exitXavier Del Campo Romero2022-06-111-3/+8
|
* Implement button componentXavier Del Campo Romero2022-06-116-1/+170
|
* res: add btn_{left,mid,right}Xavier Del Campo Romero2022-06-118-0/+33
|
* res/CMakeLists.txt: do not use transparency for sel_mid_vXavier Del Campo Romero2022-06-111-1/+1
|
* README.md: reflect current statusXavier Del Campo Romero2022-06-081-11/+18
|
* win9x.cmake: remove unneeded dependenciesXavier Del Campo Romero2022-06-081-5/+1
|
* win9x.cmake: use target commands for SDL and SDL_mixerXavier Del Campo Romero2022-06-081-8/+12
| | | | | | | | | | | | Since libSDL.a and libSDL_mixer.a are compiled separately from this project, some hacks had been used to get the build running. However, this approach did not make proper use of target-level properties, which are encouraged according to modern CMake standards over global-level commands such as include_directories() or link_libraries(). OTOH, Win32 dependencies were being imported using link_libraries(), but they in fact are SDL dependencies, so target_link_libraries() can be used instead.