dsekai
World engine for retrocomputers.
Loading...
Searching...
No Matches
Globally Unique Identifiers

Identifiers for objects that are unique among ALL TILEMAP objects and persistant between Engine Locking cycles. More...

Files

file  gid.h
 Contains macros and typedefs for globally unique identifiers.
 

Macros

#define SPAWN_GID_PLAYER   0xffff
 Special case unique identifier for the spawner of the player-controlled MOBILE.
 
#define MOBILE_GID_NONE   0
 
#define MOBILE_GID_PLAYER   0xffffffff
 Special case unique identifier for the player-controlled MOBILE.
 
#define MOBILE_MAP_GID_ALL   0xffff
 MOBILE::map_gid value indicating mobile is present on all tilemaps.
 
#define MOBILE_GID_FMT   "%04d:%04d"
 Insert into logging format strings when a mobile's Globally Unique Identifiers is needed.
 
#define mobile_get_gid_fmt(m)
 Insert into the args provided to a format string using MOBILE_GID_FMT.
 

Typedefs

typedef uint32_t MOBILE_GID
 Globally unique identifier for MOBILE objects.
 
typedef uint16_t SPAWN_GID
 Globally unique identifier for TILEMAP_SPAWN objects.
 
typedef uint16_t TILEMAP_GID
 Globally unique identifier for TILEMAP objects.
 

Detailed Description

Identifiers for objects that are unique among ALL TILEMAP objects and persistant between Engine Locking cycles.

These should be used in cases longer than one unilayer_loop_iter(), as a MEMORY_PTR may be relocated in memory when unlocked and array indexes may change if the array is compacted.

Macro Definition Documentation

◆ mobile_get_gid_fmt

#define mobile_get_gid_fmt ( m)
related
Value:
(m)->map_gid, (m)->spawner_gid
TILEMAP_GID map_gid
TILEMAP::gid of the tilemap this mobile was spawned on.
Definition mobile.h:265

Insert into the args provided to a format string using MOBILE_GID_FMT.

Parameters
mLocked MEMORY_PTR to the mobile to examine.

◆ MOBILE_MAP_GID_ALL

#define MOBILE_MAP_GID_ALL   0xffff
related

MOBILE::map_gid value indicating mobile is present on all tilemaps.

This is generally only used for the player.

◆ SPAWN_GID_PLAYER

#define SPAWN_GID_PLAYER   0xffff

Special case unique identifier for the spawner of the player-controlled MOBILE.

This should exist only on one tilemap (the first tilemap loaded in a new world).