Compile-Time Configuration
All configuration lives in two header files that are set at compile time. Runtime settings (sound on/off, zoom, accelerometer) are handled separately by GameData.
Configuration Files
| File | Role |
|---|---|
include/WindowsPhoneSpeedyBlupi/ConfigDef.hpp | Defines LEGACY_MODE or MODERN_MODE macro — exactly one must be active |
include/WindowsPhoneSpeedyBlupi/Config.hpp | FPS value, TIME_SCALE, SPEED_SCALE, resolution scale enum — derived from ConfigDef |
Config.hpp affect timing, resolution, and feature flags across the entire project.
Never mix LEGACY and MODERN headers in a single build.
Two Operating Modes
Exactly one mode is active at compile time. The mode is selected by defining a macro in ConfigDef.hpp.
LEGACY Mode
Faithfully reproduces original Windows Phone behaviour.
- FPS: locked at 20
TIME_SCALE = 1.0SPEED_SCALE = 1.0- Touch buttons always visible
- No resolution scaling
MODERN Mode (default)
Experimental extended mode with higher FPS support.
- Configurable FPS: 20, 30, 60, 90, 120, 144
TIME_SCALE = FPS / 20SPEED_SCALE = 20 / FPS- Touch buttons hidden on non-touch platforms
- Resolution scaling helpers available
FPS Settings (MODERN mode)
The target FPS is set in Config.hpp. The game logic was originally designed for 20 FPS; the scaling factors adjust physics and animation timing automatically.
| FPS | TIME_SCALE | SPEED_SCALE | Notes |
|---|---|---|---|
| 20 | 1.0 | 1.0 | Original speed (same as LEGACY) |
| 30 | 1.5 | 0.667 | Smooth on older hardware |
| 60 | 3.0 | 0.333 | Standard modern target |
| 90 | 4.5 | 0.222 | High-refresh monitors |
| 120 | 6.0 | 0.167 | 120 Hz displays |
| 144 | 7.2 | 0.139 | 144 Hz gaming monitors |
Scaling Helper Functions
Three inline helpers in Config.hpp are used throughout the codebase to adapt timing values:
| Function | Formula | Use Case |
|---|---|---|
ScaleTime(t) | t × TIME_SCALE | Multiply a tick count to stay proportional at higher FPS |
ScaleDiv(t) | t × SPEED_SCALE | Divide a speed value so objects don't move faster at higher FPS |
ScaleAsset(path) | Inserts 4x suffix | Returns path to high-DPI asset when resolution scale is 4× |
Resolution Scaling (MODERN mode, experimental)
The Zoom enum controls the render resolution. Larger scales require the corresponding 4x asset directories.
| Enum Value | Scale | Resolution | Asset directories |
|---|---|---|---|
ScaleResolution1 | 1× | 640×480 | icons/, backgrounds/ |
ScaleResolution2 | 2× | 1280×960 | future |
ScaleResolution4 | 4× | 2560×1920 | icons4x/, backgrounds4x/ |
Content/backgrounds4x/ (35 files) and Content/icons4x/ (8 files) are already
present in the repository. The 4× resolution mode is functional but experimental.
Key Game Constants
Defined in include/WindowsPhoneSpeedyBlupi/Def.hpp. These are fixed regardless of mode:
| Constant | Value | Description |
|---|---|---|
LXIMAGE | 640 | Game viewport width in pixels |
LYIMAGE | 480 | Game viewport height in pixels |
MAXCELX | 100 | Maximum tile columns per world |
MAXCELY | 100 | Maximum tile rows per world |
DIMOBJX | 64 | Object sprite width in pixels |
DIMOBJY | 64 | Object sprite height in pixels |
DIMBLUPIX | 60 | Player sprite width in pixels |
DIMBLUPIY | 60 | Player sprite height in pixels |
Coordinate Systems
- Tile coordinates: integer grid
[0, 100) × [0, 100) - Game-space pixels:
tile_index × DIMOBJX/DIMOBJY(64 pixels per tile) - Screen-space: game-space + scroll offset, managed by
Pixmapvia CNA SpriteBatch