Files
major_tom/include/config.h
Thomas df3bc29fb7 Support large maps up to 8192x8192 tiles
Raise hard map size cap from 4096 to 8192 via MAX_MAP_SIZE constant.
Replace fixed 16 KB fgets buffer with dynamic line reader that handles
arbitrarily long tile rows. Check calloc returns for tile layer
allocation.

Add entity distance culling: skip updates for entities beyond 2x screen
width from camera, skip rendering beyond 64 px margin. Dead entities
bypass culling so cleanup callbacks always run. Player, spacecraft,
drone, and moving platforms set ENTITY_ALWAYS_UPDATE to opt out.

Replace naive 4-neighbor flood fill with scanline algorithm (O(height)
stack instead of O(area)) for safe use on large maps.

Raise MAX_ENTITY_SPAWNS from 128 to 512 and MAX_EXIT_ZONES from 8 to
16 to support populated large levels.
2026-03-01 15:17:58 +00:00

45 lines
2.5 KiB
C

#ifndef JNR_CONFIG_H
#define JNR_CONFIG_H
/* ── Window ─────────────────────────────────────────── */
#define WINDOW_TITLE "Jump 'n Run"
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 360
#define WINDOW_SCALE 2 /* integer scale for crisp pixels */
/* ── Timing ─────────────────────────────────────────── */
#define TICK_RATE 60 /* physics updates per second */
#define DT (1.0f / TICK_RATE)
#define MAX_FRAME_SKIP 5 /* prevent spiral of death */
/* ── Physics ────────────────────────────────────────── */
#define DEFAULT_GRAVITY 980.0f /* pixels/s^2 (Earth-like) */
#define MAX_FALL_SPEED 600.0f /* terminal velocity */
/* ── Tiles ──────────────────────────────────────────── */
#define TILE_SIZE 16 /* pixels per tile */
#define MAX_TILE_DEFS 256 /* unique tile types */
#define MAX_MAP_SIZE 8192 /* max width or height in tiles */
/* ── Entities ───────────────────────────────────────── */
#define MAX_ENTITIES 512
#define MAX_ENTITY_SPAWNS 512 /* max entity spawns per level */
/* ── Level transitions ─────────────────────────────── */
#define MAX_EXIT_ZONES 16 /* max exit zones per level */
/* ── Rendering ──────────────────────────────────────── */
#define MAX_SPRITES 2048 /* max queued sprites per frame */
/* ── Audio ──────────────────────────────────────────── */
#define AUDIO_FREQUENCY 48000
#define AUDIO_CHANNELS 2
#define AUDIO_CHUNK_SIZE 4096
#define MAX_SFX_CHANNELS 16
/* ── Assets ─────────────────────────────────────────── */
#define MAX_ASSETS 128
#define ASSET_PATH_MAX 256
#endif /* JNR_CONFIG_H */