Skip to main content

Module target

Module target 

Source
Expand description

check --target <id>: whether the game fits a target (ADR-0008 §1), by the target’s profile and the game’s setting for it in shuyi.ron (TargetSetting). Five checks for now:

  • Fits. The frame times its scale fits the display inside its safe area.
  • Text. The smallest text (the font’s cell height × the scale) is at least the profile’s min_text_px (an error) and its good_text_px (a warning).
  • Controls. On every screen of the game, the required actions it declares bind to distinct inputs of the target, in the keymap file’s table named after it (shuyi_ui::input::fit; controls). It needs the game’s tools (GameTools::controls).
  • One bit. On a target whose display is black and white, every role of the skin’s palette has patterns, the roles that tell things apart stay distinct, and text is black on white or the inverse (ADR-0008 §4; shuyi_assets::onebit::check; one_bit). It needs the game’s tools (GameTools::one_bit).
  • App. Who the game is, shuyi.ron’s app part: its name, id, version, build and storage’s name, and whether the Rust file app-info writes is up to date (crate::app_info; app). The same on every target.

The engine’s profiles are the files of targets/ at the repository’s root, embedded; a game’s own (shuyi.ron’s target_profiles) add to them, or replace one by its id.

Structs§

Factor
The scale a frame is shown at, as a fraction: num / den.
Profile
A target profile and the file it came from.
TargetProblem
A problem of the game on one target.
TargetReport
What check --target found on one target.

Enums§

Level
How bad a target problem is.
TargetCheck
Which check found a target problem.

Constants§

ALL
What --target all asks for: every target in the game’s shuyi.ron.

Functions§

app
The problems of the game’s app part (crate::app_info::problems), as target problems about its fields (app.id).
asked
The targets target asks for in config: itself, or every one with ALL; an error if shuyi.ron doesn’t list it.
check_target
The game’s setting for target id checked against profile: every problem, display size by display size. A display of any size (a window) shows the frame at scale 1.
controls
What the controls’ check found on target id (FitProblems), as target problems: errors, but for a screen that doesn’t declare its actions, a warning.
engine_profiles
The engine’s profiles, by id.
one_bit
What the one-bit check finds of skin (shuyi_assets::onebit::check), as target problems about its pattern map: errors, but for text that isn’t black and white, a warning.
profile
The profile (with its file) of target id (the engine’s or the game’s of config, from root), or the code and what is wrong: the profiles don’t load, or none has that id. Both are codes::TARGET.
profiles
The engine’s profiles, with the game’s of config (from root) added or in place of the engine’s of the same id.
scale_on
The scale scale gives frame (width, height) on space (the display inside its safe area): for Scale::Integer, the largest whole number that fits, which is 0 when even 1 doesn’t; for Scale::Fit, the largest factor that fits.