Table of Contents
- ISO_MAP
- Public Attributes
- Public Attributes Documentation
- variable width
- variable terrain
- variable smooth_slope_max
- variable smooth_height
- variable show_grid
- variable segments
- variable proj
- variable overlay
- variable num_terrains
- variable neighbor_terrains_west
- variable neighbor_terrains_south
- variable neighbor_terrains_north
- variable neighbor_terrains_east
- variable neighbor_heights_west
- variable neighbor_heights_south
- variable neighbor_heights_north
- variable neighbor_heights_east
- variable max_height
- variable hover_my
- variable hover_mx
- variable heightmap
- variable height_tint_intensity
- variable height
- variable dynamic_light_map
- variable draw_order_dirty
- variable cached_draw_order_count
- variable cached_draw_order_cap
- variable cached_draw_order
- variable ambient_r
- variable ambient_g
- variable ambient_b
- variable ability
ISO_MAP
Module: GRAPHICS: isometric engine, maps, tiles, ...
Height-aware isometric map with terrain and height layers, per-cell height values, configurable projection, and terrain transition support.
#include "n_iso_engine.h"
Public Attributes
| Name | |
|---|---|
| int | width map width in tiles (X axis) |
| int * | terrain terrain type per cell [height * width], indices 0..num_terrains-1 |
| int | smooth_slope_max max height diff rendered as slope (default 1) |
| int | smooth_height 0 = CUT mode (cliff walls), 1 = SMOOTH mode (per-corner slopes) |
| int | show_grid 1 = draw grid overlay |
| ISO_TILE_SEGMENTS * | segments Per-cell height segments. |
| ISO_PROJECTION | proj current projection parameters |
| int * | overlay overlay tile index per cell [height * width], 0 = none. |
| int | num_terrains number of terrain types used |
| int * | neighbor_terrains_west [height], terrain of west neighbor's east edge |
| int * | neighbor_terrains_south [width], terrain of south neighbor's north edge |
| int * | neighbor_terrains_north [width], terrain of north neighbor's south edge |
| int * | neighbor_terrains_east [height], terrain of east neighbor's west edge |
| int * | neighbor_heights_west Heights from west neighbor chunk's east edge [height], NULL = boundary. |
| int * | neighbor_heights_south Heights from south neighbor chunk's north edge [width], NULL = boundary. |
| int * | neighbor_heights_north Heights from north neighbor chunk's south edge [width], NULL = boundary. |
| int * | neighbor_heights_east Heights from east neighbor chunk's west edge [height], NULL = boundary. |
| int | max_height maximum allowed height value |
| int | hover_my hovered tile Y (-1 = none) |
| int | hover_mx hovered tile X (-1 = none) |
| int * | heightmap height value per cell [height * width], 0..max_height |
| float | height_tint_intensity 0.0 = no tint, 0.3 = subtle, 1.0 = full range. |
| int | height map height in tiles (Y axis) |
| float * | dynamic_light_map Per-tile dynamic light accumulation buffer. |
| int | draw_order_dirty |
| int | cached_draw_order_count |
| int | cached_draw_order_cap |
| ISO_DRAW_ENTRY * | cached_draw_order Cached draw_order. |
| float | ambient_r Global ambient color (day/night + dark place tinting). |
| float | ambient_g |
| float | ambient_b |
| int * | ability walkability per cell [height * width] (WALK/SWIM/BLCK) |
Public Attributes Documentation
variable width
int width;
map width in tiles (X axis)
variable terrain
int * terrain;
terrain type per cell [height * width], indices 0..num_terrains-1
variable smooth_slope_max
int smooth_slope_max;
max height diff rendered as slope (default 1)
variable smooth_height
int smooth_height;
0 = CUT mode (cliff walls), 1 = SMOOTH mode (per-corner slopes)
variable show_grid
int show_grid;
1 = draw grid overlay
variable segments
ISO_TILE_SEGMENTS * segments;
Per-cell height segments.
NULL = use heightmap as single segment. When non-NULL, heightmap[] is derived (top of highest segment).
variable proj
ISO_PROJECTION proj;
current projection parameters
variable overlay
int * overlay;
overlay tile index per cell [height * width], 0 = none.
NULL = no overlays
variable num_terrains
int num_terrains;
number of terrain types used
variable neighbor_terrains_west
int * neighbor_terrains_west;
[height], terrain of west neighbor's east edge
variable neighbor_terrains_south
int * neighbor_terrains_south;
[width], terrain of south neighbor's north edge
variable neighbor_terrains_north
int * neighbor_terrains_north;
[width], terrain of north neighbor's south edge
variable neighbor_terrains_east
int * neighbor_terrains_east;
[height], terrain of east neighbor's west edge
variable neighbor_heights_west
int * neighbor_heights_west;
Heights from west neighbor chunk's east edge [height], NULL = boundary.
variable neighbor_heights_south
int * neighbor_heights_south;
Heights from south neighbor chunk's north edge [width], NULL = boundary.
variable neighbor_heights_north
int * neighbor_heights_north;
Heights from north neighbor chunk's south edge [width], NULL = boundary.
variable neighbor_heights_east
int * neighbor_heights_east;
Heights from east neighbor chunk's west edge [height], NULL = boundary.
variable max_height
int max_height;
maximum allowed height value
variable hover_my
int hover_my;
hovered tile Y (-1 = none)
variable hover_mx
int hover_mx;
hovered tile X (-1 = none)
variable heightmap
int * heightmap;
height value per cell [height * width], 0..max_height
variable height_tint_intensity
float height_tint_intensity;
0.0 = no tint, 0.3 = subtle, 1.0 = full range.
Higher segments are brighter, lower are darker. Applied as a multiply tint on tile top faces and walls.
variable height
int height;
map height in tiles (Y axis)
variable dynamic_light_map
float * dynamic_light_map;
Per-tile dynamic light accumulation buffer.
Caller fills this before iso_map_draw() with additive light contributions. Array of [width * height * 3] floats (r, g, b per tile). NULL = no dynamic lighting. Caller-owned.
variable draw_order_dirty
int draw_order_dirty;
variable cached_draw_order_count
int cached_draw_order_count;
variable cached_draw_order_cap
int cached_draw_order_cap;
variable cached_draw_order
ISO_DRAW_ENTRY * cached_draw_order;
Cached draw_order.
The qsort+build in [iso_map_build_draw_order](Module-ISOMETRIC_ENGINE#user-content-function-iso_map_build_draw_order) is expensive (1024+ entries x 25 chunks per frame = ~3 ms in profiled bench). Cache the result on the map and only rebuild when segments or heights change. Setters that mutate either field ([iso_map_set_segments](Module-ISOMETRIC_ENGINE#user-content-function-iso_map_set_segments) is the only public one) set [draw_order_dirty](Struct-ISO_MAP#user-content-variable-draw_order_dirty) = 1. [iso_map_draw](Module-ISOMETRIC_ENGINE#user-content-function-iso_map_draw) rebuilds into [cached_draw_order](Struct-ISO_MAP#user-content-variable-cached_draw_order) when dirty, then reuses across frames. Lifetime tied to the map; freed in [iso_map_free](Module-ISOMETRIC_ENGINE#user-content-function-iso_map_free).
variable ambient_r
float ambient_r;
Global ambient color (day/night + dark place tinting).
Applied as additional multiply on top of height tinting. Default: (1.0, 1.0, 1.0) = no change. Set by client lighting system each frame.
variable ambient_g
float ambient_g;
variable ambient_b
float ambient_b;
variable ability
int * ability;
walkability per cell [height * width] (WALK/SWIM/BLCK)
Modules
- AABB3D
- ACCEPT_POOL
- ALLEGRO4
- ALLEGRO5
- ANIM_LIB
- ASTAR
- ATLAS_LIB
- AVRO
- CLOCK_SYNC
- COMMONS
- CONFIGFILE
- CYPHER_BASE64
- CYPHER_VIGENERE
- DEAD_RECKONING
- ENUMS
- EXCEPTIONS
- GAME_ENV
- GIT
- GUI
- HASH_TABLE
- ISOMETRIC_ENGINE
- LIST
- LOG
- LOGNODUP
- LZ4
- NETWORKING
- NETWORK_MSG
- N_COOKIES
- N_DIFF
- N_DIGEST
- N_DISK_CACHE
- N_DNS
- N_ECC
- N_ENTROPY
- N_FILES
- N_FLUIDS
- N_GUI_COLOR
- N_GUI_COLORWHEEL
- N_GUI_CURVE
- N_GUI_GRID
- N_GUI_POPUP
- N_HEX
- N_HTTP3
- N_HTTP_COOKIE
- N_HTTP_FORM
- N_HTTP_MIME
- N_HTTP_REQ
- N_HTTP_RESP
- N_HTTP_ROUTER
- N_HTTP_SERVER
- N_ICC
- N_JSON
- N_KAFKA
- N_LINALG
- N_MODULE
- N_OPENSSL_COMPAT
- N_PRETTY
- N_PTH
- N_QUERY
- N_RANDOM
- N_SHA256
- N_STR
- N_TIFF
- N_TIME
- N_USER
- N_X509
- N_ZIP
- PARTICLES
- PCRE
- PHYSICS
- SIGNALS
- STACK
- THREADS
- TRAJECTORY
- TREE
- ZLIB