Skip to content

refactor: group hard-coded settings into config.h - #9

Merged
Periicles merged 1 commit into
mainfrom
feat/config-constants
Jun 17, 2026
Merged

refactor: group hard-coded settings into config.h#9
Periicles merged 1 commit into
mainfrom
feat/config-constants

Conversation

@Periicles

Copy link
Copy Markdown
Owner

Why

The server address/port, the framerate cap and the default resolution / fps /
volume were bare literals scattered across connection.c, start_game.c and
create/window.c. The hard-coded server IP in particular was flagged in the
audit.

What

New config.h:

  • SERVER_IP, SERVER_PORT, SERVER_TIMEOUT
  • DEFAULT_FPS, FPS_CAP, DEFAULT_VOLUME, DEFAULT_WIDTH, DEFAULT_HEIGHT,
    DEFAULT_BPP

Values are identical to before, so no behaviour change — this just gives the
settings one named home, ready to become a real config source when networking is
re-enabled and hardened.

Verification

  • make re: warning-free.
  • Banana: touched files + config.h clean (full project stays at 0).
  • make tests_run: 20/20 passing.

Note

Per-widget sizes and the raycasting projection constants (e.g. the 1920 used in
the FOV math) are intentionally left alone — they are not configuration.

The server address/port, the window framerate cap and the default
resolution/fps/volume were scattered as bare literals across
connection.c, start_game.c and create/window.c. Collect them in config.h
(SERVER_IP/PORT/TIMEOUT, DEFAULT_FPS, FPS_CAP, DEFAULT_VOLUME,
DEFAULT_WIDTH/HEIGHT/BPP). Values are unchanged, so behaviour is
identical; the hard-coded server IP flagged in the audit is now in one
named place ready to be made configurable when networking is hardened.
@Periicles
Periicles merged commit 96d576a into main Jun 17, 2026
8 checks passed
@Periicles
Periicles deleted the feat/config-constants branch June 17, 2026 11:30
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.

1 participant