Skip to content

refactor: review 0.14 for duplication, deprecated calls and plain docs - #1200

Merged
vdmkenny merged 2 commits into
mainfrom
refactor/review-0.14
Oct 14, 2026
Merged

vdmkenny merged 2 commits into
mainfrom
refactor/review-0.14

Conversation

@vdmkenny

@vdmkenny vdmkenny commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

A review of the whole 0.14 diff (v0.13.0..main) for quality, duplication and CONTRIBUTING.md, plus the same clean-ups in the older code.

Code from 0.14:

  • Mouse.pixelsIn converts the pointer to pixels. The CD player's canvas, the HUD options menu and the scripts' pointer field each did this conversion themselves.
  • recordingStem uses recordings.Kind.of instead of its own loop.
  • recordings.Source logs a recording it leaves out in one place.
  • The CD player's track limit (96) comes from the two digits a row's number has, instead of a bare 8.
  • A comptime check ties records.room_views' fields to rooms.View.
  • An FFmpeg packet larger than a c_int fails with an error instead of a panic, since a FLAC file is sent whole.

Across the tree:

  • std.mem.print and Allocator.print replace every std.fmt.bufPrint and std.fmt.allocPrint call, which Zig 0.17 deprecates.
  • Byte sizes written as shifts or products (256 << 20, 16 * 1024 * 1024) use std.fmt.parseIntSizeSuffix, as the 0.14 code does. Three unnamed limits get names.
  • Messages print those sizes with {Bi} instead of spelling them out, so they can't disagree with the constant.
  • The game, player and load scripts share one per-mod memory limit, runtime.memory_per_mod. The tests share runtime.testing.options instead of seven copies of the same options.

Text:

  • Comments, docs and API strings from 0.14 rewritten in plain English. make definitions regenerated the reference.
  • "Added by OpenReliant:" replaces the second marker for additions, "Not the game's:".

No behaviour changes, apart from three messages that now print sizes as 16MiB rather than 16777216 bytes or 8 MiB.

Left as they are: scratch buffers in the dev tools ([16 << 10]u8) and sizes inside test data, where the arithmetic is the point.

A review of everything 0.14 changed, against CONTRIBUTING.md.

Code:
- Mouse.pixelsIn converts the pointer to pixels for the CD player's
  canvas, the HUD options menu and the scripts' pointer field, which
  each did the conversion themselves.
- recordingStem uses recordings.Kind.of instead of its own loop.
- recordings.Source logs a recording it leaves out in one place.
- std.mem.print and Allocator.print replace the deprecated
  std.fmt.bufPrint and std.fmt.allocPrint in 0.14's code.
- The CD player's track limit comes from the two digits a row's number
  has, instead of a bare 8.
- A comptime check ties records.room_views' fields to rooms.View.
- FFmpeg packets larger than a c_int fail with an error instead of a
  panic, since a FLAC file is sent whole.

Text:
- Comments, docs and API strings from 0.14 rewritten in plain English.
- "Added by OpenReliant:" replaces the second marker, "Not the game's:".
Follow-up to the 0.14 review, for the code from before 0.14.

- std.mem.print and Allocator.print replace the remaining
  std.fmt.bufPrint and std.fmt.allocPrint calls, which Zig 0.17
  deprecates.
- Byte sizes written as shifts or products (256 << 20,
  16 * 1024 * 1024) use std.fmt.parseIntSizeSuffix, as the 0.14 code
  does. Three unnamed limits get names.
- Messages print those sizes with {Bi} instead of spelling them out,
  so they can't disagree with the constant.
- The game, player and load scripts share one per-mod memory limit,
  runtime.memory_per_mod, and the tests share runtime.testing.options
  instead of seven copies of the same options.
@vdmkenny
vdmkenny merged commit a194ddc into main Oct 14, 2026
4 checks passed
@vdmkenny
vdmkenny deleted the refactor/review-0.14 branch October 14, 2026 07:29
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