Skip to content

refactor: split frontend.c into domain-grouped modules#100

Merged
Zizin13 merged 11 commits intomasterfrom
feat/split-frontend
Mar 23, 2026
Merged

refactor: split frontend.c into domain-grouped modules#100
Zizin13 merged 11 commits intomasterfrom
feat/split-frontend

Conversation

@deevus
Copy link
Copy Markdown
Collaborator

@deevus deevus commented Mar 20, 2026

Summary

  • Split the monolithic frontend.c (7,068 lines) into 10 focused source files grouped by domain
  • Added missing extern declarations to frontend.h for symbols that were previously file-local (szSelectEng, szConfigEng, font*_ascii_br, fade_redraw_bg)
  • Consolidated PREVIEW_* viewport defines into frontend.h instead of duplicating across files
  • Added menu_render*.c files to CMake, Make, and MSVC build systems (were only in build.zig)
  • Reverted font*_ascii types back to char[256] in header to match all function signatures

New file layout

File Lines Content
frontend_data.c 534 Global variables and data tables
frontend_screens.c 1093 Main menu flow (title, copy, select_screen)
frontend_select_disk.c 377 Disk/save selection
frontend_select_car.c 584 Car selection
frontend_select_players.c 412 Player setup
frontend_select_type.c 649 Game type selection
frontend_select_track.c 396 Track selection
frontend_config.c 2528 Configuration menu
frontend_network.c 462 Network lobby and restart
frontend_util.c 303 Params, cheat names, name validation

Test plan

  • Clean zig build passes with zero errors
  • Verify no regressions in game frontend menus
  • Verify Windows build (MSVC .vcxproj)

@Zizin13 Zizin13 merged commit 3d0cc81 into master Mar 23, 2026
12 checks passed
@Zizin13 Zizin13 deleted the feat/split-frontend branch March 23, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants