#include <trx/config/enum.h>
#include <trx/core/enum_map.h>
#include <trx/core/log.h>
#include <trx/game/catalog/manager.h>
#include <trx/game/console/enum.h>
#include <trx/game/game_buf.h>
#include <trx/game/game_flow/types.h>
#include <trx/game/gun/types.h>
#include <trx/game/gym.h>
#include <trx/game/input/enum.h>
#include <trx/game/items/actions/ids.h>
#include <trx/game/items/enum.h>
#include <trx/game/lara/enum.h>
#include <trx/game/lara/skin/types.h>
#include <trx/game/lara/types.h>
#include <trx/game/lua/events.h>
#include <trx/game/music/enum.h>
#include <trx/game/music/ids.h>
#include <trx/game/objects/general/generic_switch.h>
#include <trx/game/objects/general/pickup.h>
#include <trx/game/objects/ids.h>
#include <trx/game/rooms/enum.h>
#include <trx/game/savegame/types.h>
#include <trx/game/screenshot.h>
#include <trx/game/shell/mod.h>
#include <trx/game/sound/ids.h>
#include <trx/game/ui/settings.h>

static __attribute__((constructor)) void M_Init(void)
{
#define X_INPUT_ROLE(role_name, state_name)                                    \
    ENUM_MAP(INPUT_ROLE, role_name, #state_name);
#include <trx/game/input/roles.def>
#undef X_INPUT_ROLE

    // The catalogs: every object, sample, music track, Lara state, Lara
    // animation and item action TRX knows, by its canonical name. These are the
    // names a script says - the O_/SFX_/MX_ prefixes come off in the
    // declaration, not here, because the prefix is what tells them apart in C.
#define X_CATALOG_ID(enum_value) ENUM_MAP_SELF(OBJECT_ID, enum_value);
#include <trx/game/catalog/objects.def>
#undef X_CATALOG_ID

#define X_CATALOG_ID(enum_value) ENUM_MAP_SELF(SAMPLE_TRX_ID, enum_value);
#include <trx/game/catalog/samples.def>
#undef X_CATALOG_ID

#define X_CATALOG_ID(enum_value) ENUM_MAP_SELF(MUSIC_TRX_ID, enum_value);
#include <trx/game/catalog/music.def>
#undef X_CATALOG_ID

#define X_CATALOG_ID(enum_value) ENUM_MAP_SELF(LARA_TRX_STATE, enum_value);
#include <trx/game/catalog/lara_states.def>
#undef X_CATALOG_ID

#define X_CATALOG_ID(enum_value) ENUM_MAP_SELF(LARA_TRX_ANIMATION, enum_value);
#include <trx/game/catalog/lara_anims.def>
#undef X_CATALOG_ID

#define X_CATALOG_ID(enum_value) ENUM_MAP_SELF(ITEM_TRX_ACTION, enum_value);
#include <trx/game/catalog/item_actions.def>
#undef X_CATALOG_ID

    ENUM_MAP(CATALOG_CONTEXT, CATALOG_OBJECTS, "objects");
    ENUM_MAP(CATALOG_CONTEXT, CATALOG_MUSIC, "music");
    ENUM_MAP(CATALOG_CONTEXT, CATALOG_SAMPLES, "samples");
    ENUM_MAP(CATALOG_CONTEXT, CATALOG_LARA_STATES, "lara_states");
    ENUM_MAP(CATALOG_CONTEXT, CATALOG_LARA_ANIMS, "lara_anims");
    ENUM_MAP(CATALOG_CONTEXT, CATALOG_ITEM_ACTIONS, "item_actions");

    ENUM_MAP(GAME_BUFFER, GBUF_TEXTURE_PAGES, "Texture pages");
    ENUM_MAP(GAME_BUFFER, GBUF_PALETTES, "Color palettes");
    ENUM_MAP(GAME_BUFFER, GBUF_OBJECT_TEXTURES, "Object textures");
    ENUM_MAP(GAME_BUFFER, GBUF_SPRITE_TEXTURES, "Sprite textures");
    ENUM_MAP(GAME_BUFFER, GBUF_STATIC_OBJECTS_3D, "Static objects (3D)");
    ENUM_MAP(GAME_BUFFER, GBUF_STATIC_OBJECTS_2D, "Static objects (2D)");
    ENUM_MAP(GAME_BUFFER, GBUF_MESH_POINTERS, "Mesh pointers");
    ENUM_MAP(GAME_BUFFER, GBUF_MESHES, "Meshes");
    ENUM_MAP(GAME_BUFFER, GBUF_ANIMS, "Animations");
    ENUM_MAP(GAME_BUFFER, GBUF_ANIM_CHANGES, "Animation changes");
    ENUM_MAP(GAME_BUFFER, GBUF_ANIM_RANGES, "Animation ranges");
    ENUM_MAP(GAME_BUFFER, GBUF_ANIM_COMMANDS, "Animation commands");
    ENUM_MAP(GAME_BUFFER, GBUF_ANIM_BONES, "Animation bones");
    ENUM_MAP(GAME_BUFFER, GBUF_ANIM_FRAMES, "Animation frames");
    ENUM_MAP(GAME_BUFFER, GBUF_ROOMS, "Rooms");
    ENUM_MAP(GAME_BUFFER, GBUF_ROOM_MESH, "Room meshes");
    ENUM_MAP(GAME_BUFFER, GBUF_ROOM_PORTALS, "Room portals");
    ENUM_MAP(GAME_BUFFER, GBUF_ROOM_SECTORS, "Room sectors");
    ENUM_MAP(GAME_BUFFER, GBUF_ROOM_LIGHTS, "Room lights");
    ENUM_MAP(GAME_BUFFER, GBUF_ROOM_STATIC_MESHES, "Room static meshes");
    ENUM_MAP(GAME_BUFFER, GBUF_FLOOR_DATA, "Floor data");
    ENUM_MAP(GAME_BUFFER, GBUF_ITEMS, "Items");
    ENUM_MAP(GAME_BUFFER, GBUF_ITEM_DATA, "Item data");
    ENUM_MAP(GAME_BUFFER, GBUF_EFFECTS, "Effects");
    ENUM_MAP(GAME_BUFFER, GBUF_CAMERAS, "Cameras");
    ENUM_MAP(GAME_BUFFER, GBUF_SOUND_SOURCES, "Sound sources");
    ENUM_MAP(GAME_BUFFER, GBUF_BOXES, "Boxes");
    ENUM_MAP(GAME_BUFFER, GBUF_OVERLAPS, "Overlaps");
    ENUM_MAP(GAME_BUFFER, GBUF_GROUND_ZONE, "Ground zones");
    ENUM_MAP(GAME_BUFFER, GBUF_FLY_ZONE, "Fly zones");
    ENUM_MAP(
        GAME_BUFFER, GBUF_ANIMATED_TEXTURE_RANGES, "Animated texture ranges");
    ENUM_MAP(GAME_BUFFER, GBUF_CINEMATIC_FRAMES, "Cinematic frames");
    ENUM_MAP(GAME_BUFFER, GBUF_DEMO_BUFFER, "Demo buffer");
    ENUM_MAP(GAME_BUFFER, GBUF_CREATURE_DATA, "Creature data");
    ENUM_MAP(GAME_BUFFER, GBUF_CREATURE_LOT, "Creature pathfinding");
    ENUM_MAP(GAME_BUFFER, GBUF_SAMPLE_INFOS, "Sample information");
    ENUM_MAP(GAME_BUFFER, GBUF_SAMPLES, "Samples");
    ENUM_MAP(GAME_BUFFER, GBUF_WALKABLES, "Walkables buffer");

    ENUM_MAP(COMMAND_RESULT, CR_SUCCESS, "ok");
    ENUM_MAP(COMMAND_RESULT, CR_FAILURE, "failure");
    ENUM_MAP(COMMAND_RESULT, CR_UNAVAILABLE, "unavailable");
    ENUM_MAP(COMMAND_RESULT, CR_BAD_INVOCATION, "bad_invocation");

    // GYM_TRACK_NONE and GYM_TRACK_NUMBER_OF are sentinels, not tracks: leaving
    // them unmapped keeps them out of trx.assault.Track.
    ENUM_MAP(GYM_TRACK_TYPE, GYM_TRACK_ASSAULT, "course");
    ENUM_MAP(GYM_TRACK_TYPE, GYM_TRACK_QUAD, "quad");

    ENUM_MAP(ITEM_TRIGGER_KIND, ITEM_TRIGGER_NORMAL, "trigger");
    ENUM_MAP(ITEM_TRIGGER_KIND, ITEM_TRIGGER_HEAVY, "heavy");
    ENUM_MAP(ITEM_TRIGGER_KIND, ITEM_TRIGGER_SWITCH, "switch");
    ENUM_MAP(ITEM_TRIGGER_KIND, ITEM_TRIGGER_HEAVY_SWITCH, "heavy_switch");
    ENUM_MAP(ITEM_TRIGGER_KIND, ITEM_TRIGGER_ANTI, "antitrigger");

    // LUA_EVENT_NUMBER_OF is a sentinel, not an event.
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_GAME_START, "game_start");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_TITLE_START, "title_start");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_PICKUP, "pickup");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_BEFORE_CONTROL, "before_control");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_AFTER_CONTROL, "after_control");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_FLIP_EFFECT, "flip_effect");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_ROOM_CHANGE, "room_change");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_TRIGGER, "trigger");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_SHOW, "show");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_HIDE, "hide");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_FINISH, "finish");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_ENTER_SIM, "enter_sim");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_LEAVE_SIM, "leave_sim");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_ACTIVATE, "activate");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_DEACTIVATE, "deactivate");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_DESTROY, "destroy");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_ENTER_WORLD, "enter_world");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_LEAVE_WORLD, "leave_world");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_HIT, "hit");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_KILL, "kill");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_FLYBY_END, "flyby_end");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_CUTSCENE_TRIGGER, "cutscene_trigger");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_CUTSCENE_START, "cutscene_start");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_CUTSCENE_END, "cutscene_end");
    ENUM_MAP(LUA_EVENT_TYPE, LUA_EVENT_LEVEL_UNLOAD, "level_unload");

    // LOG_LEVEL_MAX is a sentinel, not a level.
    ENUM_MAP(LOG_LEVEL, LOG_LEVEL_DEBUG, "debug");
    ENUM_MAP(LOG_LEVEL, LOG_LEVEL_INFO, "info");
    ENUM_MAP(LOG_LEVEL, LOG_LEVEL_WARNING, "warning");
    ENUM_MAP(LOG_LEVEL, LOG_LEVEL_ERROR, "error");

    ENUM_MAP(MUSIC_PLAY_MODE, MPM_ONCE, "once");
    ENUM_MAP(MUSIC_PLAY_MODE, MPM_LOOP, "loop");
    ENUM_MAP(MUSIC_PLAY_MODE, MPM_DELAY, "delay");
    ENUM_MAP(MUSIC_PLAY_MODE, MPM_NO_REPEAT, "no_repeat");
    ENUM_MAP(MUSIC_PLAY_MODE, MPM_OVERLAY, "overlay");

    ENUM_MAP(PICKUP_MODE, PICKUP_MODE_NORMAL, "normal");
    ENUM_MAP(PICKUP_MODE, PICKUP_MODE_PLINTH_LOW, "plinth_low");
    ENUM_MAP(PICKUP_MODE, PICKUP_MODE_PLINTH_HIGH, "plinth_high");
    ENUM_MAP(PICKUP_MODE, PICKUP_MODE_HIDDEN, "hidden");
    ENUM_MAP(PICKUP_MODE, PICKUP_MODE_CROWBAR, "crowbar");
    ENUM_MAP(PICKUP_MODE, PICKUP_MODE_SARCOPHAGUS, "sarcophagus");

    ENUM_MAP(ROOM_FLIP_STATUS, RFS_NONE, "none");
    ENUM_MAP(ROOM_FLIP_STATUS, RFS_UNFLIPPED, "unflipped");
    ENUM_MAP(ROOM_FLIP_STATUS, RFS_FLIPPED, "flipped");

    ENUM_MAP(SWITCH_MODE, SWITCH_MODE_NORMAL, "normal");
    ENUM_MAP(SWITCH_MODE, SWITCH_MODE_HIDDEN_REACH, "hidden_reach");
    ENUM_MAP(SWITCH_MODE, SWITCH_MODE_HIDDEN_PICKUP, "hidden_pickup");
    ENUM_MAP(SWITCH_MODE, SWITCH_MODE_SHOVE, "shove");

    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_LOOP_GAME, "loop_game");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_PLAY_FMV, "play_fmv");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_PLAY_CUTSCENE, "play_cutscene");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_PLAY_MUSIC, "play_music");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_LOADING_SCREEN, "loading_screen");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_DISPLAY_PICTURE, "display_picture");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_LEVEL_STATS, "level_stats");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_TOTAL_STATS, "total_stats");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_GLOBE_SELECT, "globe_select");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_EXIT_TO_TITLE, "exit_to_title");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_LEVEL_COMPLETE, "level_complete");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_ADD_ITEM, "give_item");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_REMOVE_WEAPONS, "remove_weapons");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_REMOVE_AMMO, "remove_ammo");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_REMOVE_MEDIPACKS, "remove_medipacks");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_REMOVE_FLARES, "remove_flares");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_DISABLE_FLOOR, "disable_floor");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_REMOVE_SCIONS, "remove_scions");
    ENUM_MAP(
        GF_SEQUENCE_EVENT_TYPE, GFS_REMOVE_BINOCULARS, "remove_binoculars");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_ENABLE_SUNSET, "enable_sunset");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_SETUP_HORIZON, "setup_horizon");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_SETUP_UV_ROTATE, "setup_uv_rotate");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_ENABLE_LIGHTNING, "enable_lightning");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_SETUP_LENS_FLARE, "setup_lens_flare");
    ENUM_MAP(GF_SEQUENCE_EVENT_TYPE, GFS_SET_START_ANIM, "set_lara_start_anim");
    ENUM_MAP(
        GF_SEQUENCE_EVENT_TYPE, GFS_ADD_SECRET_REWARD, "add_secret_reward");

    ENUM_MAP(GF_LEVEL_TABLE_TYPE, GFLT_TITLE, "title");
    ENUM_MAP(GF_LEVEL_TABLE_TYPE, GFLT_MAIN, "main");
    ENUM_MAP(GF_LEVEL_TABLE_TYPE, GFLT_CUTSCENES, "cutscenes");
    ENUM_MAP(GF_LEVEL_TABLE_TYPE, GFLT_DEMOS, "demos");

    ENUM_MAP(GF_LEVEL_TYPE, GFL_TITLE, "title");
    ENUM_MAP(GF_LEVEL_TYPE, GFL_NORMAL, "normal");
    ENUM_MAP(GF_LEVEL_TYPE, GFL_CUTSCENE, "cutscene");
    ENUM_MAP(GF_LEVEL_TYPE, GFL_DEMO, "demo");
    ENUM_MAP(GF_LEVEL_TYPE, GFL_GYM, "gym");
    ENUM_MAP(GF_LEVEL_TYPE, GFL_BONUS, "bonus");
    ENUM_MAP(GF_LEVEL_TYPE, GFL_DUMMY, "dummy");
    ENUM_MAP(GF_LEVEL_TYPE, GFL_CURRENT, "current");

    ENUM_MAP(WEATHER_TYPE, WEATHER_NONE, "none");
    ENUM_MAP(WEATHER_TYPE, WEATHER_RAIN, "rain");
    ENUM_MAP(WEATHER_TYPE, WEATHER_SNOW, "snow");

    ENUM_MAP(SHELL_MOD_TYPE, MOD_BASE_GAME, "base_game");
    ENUM_MAP(SHELL_MOD_TYPE, MOD_EXPANSION_PACK, "expansion_pack");
    ENUM_MAP(SHELL_MOD_TYPE, MOD_MISC, "misc");
    ENUM_MAP(SHELL_MOD_TYPE, MOD_DIRECT_LEVEL, "direct_level");
    ENUM_MAP(SHELL_MOD_TYPE, MOD_CUSTOM, "custom");

    ENUM_MAP(SAVEGAME_SLOT_POOL, SAVEGAME_SLOT_POOL_NORMAL, "normal");
    ENUM_MAP(SAVEGAME_SLOT_POOL, SAVEGAME_SLOT_POOL_QUICK, "quick");

    ENUM_MAP(GF_DEATH_TILE, GF_DEATH_TILE_LAVA, "lava");
    ENUM_MAP(GF_DEATH_TILE, GF_DEATH_TILE_RAPIDS, "rapids");
    ENUM_MAP(GF_DEATH_TILE, GF_DEATH_TILE_ELECTRIC, "electric");

    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_UNARMED);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_PISTOLS);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_MAGNUMS);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_UZIS);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_SHOTGUN);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_M16);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_MP5);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_GRENADE);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_HARPOON);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_FLARE);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_SKIDOO);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_AUTOS);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_DESERT_EAGLE);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_ROCKET);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_CROSSBOW);
    ENUM_MAP_SELF(LARA_GUN_TYPE, LGT_REVOLVER);

    ENUM_MAP_SELF(WEAPON_TYPE, WEAPON_TYPE_DUAL_PISTOLS);
    ENUM_MAP_SELF(WEAPON_TYPE, WEAPON_TYPE_SINGLE_PISTOL);
    ENUM_MAP_SELF(WEAPON_TYPE, WEAPON_TYPE_RIFLE);
    ENUM_MAP_SELF(WEAPON_TYPE, WEAPON_TYPE_MOUNTED);

    ENUM_MAP(UI_BAR_TYPE, UI_BAR_LARA_HP, "lara_hp");
    ENUM_MAP(UI_BAR_TYPE, UI_BAR_LARA_HP_POISON, "lara_hp_poison");
    ENUM_MAP(UI_BAR_TYPE, UI_BAR_LARA_AIR, "lara_air");
    ENUM_MAP(UI_BAR_TYPE, UI_BAR_LARA_STAMINA, "lara_stamina");
    ENUM_MAP(UI_BAR_TYPE, UI_BAR_LARA_EXPOSURE, "lara_exposure");
    ENUM_MAP(UI_BAR_TYPE, UI_BAR_ENEMY_HP, "enemy_hp");
    ENUM_MAP(UI_BAR_TYPE, UI_BAR_ALLY_HP, "ally_hp");
    ENUM_MAP(UI_BAR_TYPE, UI_BAR_PROGRESS, "progress");

    ENUM_MAP(LARA_MESH, LM_HIPS, "hips");
    ENUM_MAP(LARA_MESH, LM_THIGH_L, "thigh_l");
    ENUM_MAP(LARA_MESH, LM_CALF_L, "calf_l");
    ENUM_MAP(LARA_MESH, LM_FOOT_L, "foot_l");
    ENUM_MAP(LARA_MESH, LM_THIGH_R, "thigh_r");
    ENUM_MAP(LARA_MESH, LM_CALF_R, "calf_r");
    ENUM_MAP(LARA_MESH, LM_FOOT_R, "foot_r");
    ENUM_MAP(LARA_MESH, LM_TORSO, "torso");
    ENUM_MAP(LARA_MESH, LM_UARM_R, "uarm_r");
    ENUM_MAP(LARA_MESH, LM_LARM_R, "larm_r");
    ENUM_MAP(LARA_MESH, LM_HAND_R, "hand_r");
    ENUM_MAP(LARA_MESH, LM_UARM_L, "uarm_l");
    ENUM_MAP(LARA_MESH, LM_LARM_L, "larm_l");
    ENUM_MAP(LARA_MESH, LM_HAND_L, "hand_l");
    ENUM_MAP(LARA_MESH, LM_HEAD, "head");

    ENUM_MAP(LARA_WATER_STATE, LWS_ABOVE_WATER, "above_water");
    ENUM_MAP(LARA_WATER_STATE, LWS_UNDERWATER, "underwater");
    ENUM_MAP(LARA_WATER_STATE, LWS_SURFACE, "surface");
    ENUM_MAP(LARA_WATER_STATE, LWS_CHEAT, "cheat");
    ENUM_MAP(LARA_WATER_STATE, LWS_WADE, "wade");

    ENUM_MAP(LARA_GUN_STATE, LGS_ARMLESS, "armless");
    ENUM_MAP(LARA_GUN_STATE, LGS_HANDS_BUSY, "hands_busy");
    ENUM_MAP(LARA_GUN_STATE, LGS_DRAW, "draw");
    ENUM_MAP(LARA_GUN_STATE, LGS_UNDRAW, "undraw");
    ENUM_MAP(LARA_GUN_STATE, LGS_READY, "ready");
    ENUM_MAP(LARA_GUN_STATE, LGS_SPECIAL, "special");

    ENUM_MAP_SELF(LARA_SKIN_BRAID_MODE, BRAID_MODE_NONE);
    ENUM_MAP_SELF(LARA_SKIN_BRAID_MODE, BRAID_MODE_TR1_HEAD_ONLY);
    ENUM_MAP_SELF(LARA_SKIN_BRAID_MODE, BRAID_MODE_TR1_FULL);
    ENUM_MAP_SELF(LARA_SKIN_BRAID_MODE, BRAID_MODE_TR1_MAULED);
    ENUM_MAP_SELF(LARA_SKIN_BRAID_MODE, BRAID_MODE_TR1_GOLD);

    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_TR1_BRAID_DEFAULT_HEAD);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_TR1_BRAID_COMBAT_HEAD);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_TR1_BRAID_DEFAULT_TORSO);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_TR1_BRAID_MAULED_TORSO);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_TR1_BRAID_GOLD_HEAD);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_TR1_BRAID_GOLD_TORSO);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_DAGGER_HAND);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_DAGGER_HIPS);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_OAR);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_SPANNER);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_DRINK_CAN);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_GLASSES_OPAQUE);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_GLASSES_TRANSPARENT);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_CROWBAR);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_WOODEN_TORCH);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_BINOCULARS);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_HOOK_AND_POLE);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_DETONATOR);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_SHOVEL);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_JERRYCAN);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_SANDBAG);
    ENUM_MAP_SELF(LARA_SKIN_EXTRA_MESH, EXTRA_MESH_WATERSKIN);

    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_BREATH);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_TREX_KILL);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_SCION_PICKUP_1);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_USE_MIDAS);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_MIDAS_KILL);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_SCION_PICKUP_2);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_TORSO_KILL);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_PLUNGER);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_START_ANIM);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_AIRLOCK);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_SHARK_KILL);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_YETI_KILL);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_GONG_BONG);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_GUARD_KILL);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_PULL_DAGGER);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_START_HOUSE);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_END_HOUSE);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_SHIVA_KILL);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_RAPIDS_DROWN);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_TRAIN_KILL);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_JAIL_WAKE_UP);
    ENUM_MAP_SELF(LARA_EXTRA_STATE, LS_EXTRA_WILLARD_KILL);
}
