From 757207ff84de0aa66aa477f5c08c99f685f3ecc1 Mon Sep 17 00:00:00 2001 From: cynderquil Date: Sat, 7 Aug 2021 21:39:06 +0100 Subject: [PATCH 001/106] Fix Bastiodon's second icon frame --- graphics/pokemon/bastiodon/icon.png | Bin 387 -> 419 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/graphics/pokemon/bastiodon/icon.png b/graphics/pokemon/bastiodon/icon.png index 62cea4b65382ac7ac2b7fd274e1471ea143da93e..f44b735872a3f1a8c25f1414348e7b17a5ec9069 100644 GIT binary patch delta 334 zcmV-U0kQsr1ET|wBn<>-K}|sb0I`n?{9y%=AwGWq32;bRa{vGi!vFvd!vV){sAK>D z0SQS&K~y-))zUj|gfI{WU~XXf0%K*<2PyQ~gGSn%A+?J=3((t4s1VZp@q#@(ls?IH z4FCA0uliGEhST>Lj}2+Ahm^5hi+#%2R7I~2KN5*aqi8h6tjxboS23QwRuYt=GZ1fz1%`><#Meua{yqh%wrm@EK?maK7j1yDSyuxdv7Xm*w zGd^f(NFQmM)4uMu-p^2U*K{uDBwtvpy!EY+tLuDJP@Bd=to3>jid`76dsPfy-T9?= z|Nl|_Dj0pT3`TtvFp_<2V6qPdqdp24^-(s!_%j&wQNW=1*ucmE%+5y!v-w!T9DF>$ g9DO7(Kl`YvZ-0aObEY%6%;>EUgH9nMEez-sV#pPa2{1U99w2BBZ9HraoL-=V0QReGH}%Kedr2P4{yu>0000 Date: Tue, 22 Feb 2022 18:12:21 -0500 Subject: [PATCH 002/106] Move region map layout to C --- .../pokenav/region_map_section_layout.bin | Bin 420 -> 0 bytes src/data/region_map/region_map_layout.h | 18 ++++++++++++++++++ src/region_map.c | 10 +--------- 3 files changed, 19 insertions(+), 9 deletions(-) delete mode 100644 graphics/pokenav/region_map_section_layout.bin create mode 100644 src/data/region_map/region_map_layout.h diff --git a/graphics/pokenav/region_map_section_layout.bin b/graphics/pokenav/region_map_section_layout.bin deleted file mode 100644 index 4700e08b63f91475446243435b6717c81f8c4bd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 420 zcmZvTSrURk3q$U$EhljjQ!a2JW2BX8-qCv!zhY~ z4D`&l3h{=EuUmnZtL`*os_XsE9mWUH)@YWfSy2>uo@d!4P17Vv;+TkCj~%KDJ7!Zw Y{k}w+rYW-R>Mt~~EX%gpy_;2?AI!h)aR2}S diff --git a/src/data/region_map/region_map_layout.h b/src/data/region_map/region_map_layout.h new file mode 100644 index 000000000..6847ffa72 --- /dev/null +++ b/src/data/region_map/region_map_layout.h @@ -0,0 +1,18 @@ +static const u8 sRegionMap_MapSectionLayout[] = +{ + 0xD5, 0x1D, 0x1D, 0x04, 0x1C, 0x1C, 0x1C, 0x1C, 0x1A, 0xD5, 0xD5, 0x22, 0x0B, 0x23, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, + 0xD5, 0x1D, 0xD5, 0xD5, 0xD5, 0xD5, 0x38, 0x38, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0x23, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, + 0x1E, 0x1D, 0xD5, 0xD5, 0xD5, 0xD5, 0x38, 0x38, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0x23, 0xD5, 0xD5, 0x39, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, + 0x1E, 0xD5, 0xD5, 0xD5, 0xD5, 0x03, 0x1B, 0x1B, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0x23, 0x24, 0x24, 0x24, 0x24, 0x0C, 0x0C, 0x27, 0x27, 0x27, 0x27, 0x28, 0x28, 0xD5, 0xD5, + 0x1E, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0xD5, 0xD5, 0xD5, 0x25, 0xD5, 0xD5, 0xD5, 0x27, 0x27, 0x27, 0x27, 0x28, 0x28, 0xD5, 0xD5, + 0x0A, 0x1F, 0x1F, 0x1F, 0x1F, 0xD5, 0xD5, 0xD5, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0xD5, 0xD5, 0xD5, 0x25, 0xD5, 0xD5, 0xD5, 0x27, 0x27, 0x27, 0x27, 0x0D, 0x0D, 0xD5, 0xD5, + 0x0A, 0xD5, 0xD5, 0xD5, 0x05, 0x20, 0x20, 0x20, 0x09, 0x09, 0x21, 0x21, 0x26, 0x26, 0x26, 0x26, 0x26, 0xD5, 0xD5, 0xD5, 0x29, 0x29, 0x29, 0x2A, 0x2A, 0x2A, 0xD5, 0xD5, + 0x13, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x19, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x29, 0x0E, 0x29, 0x2A, 0x2A, 0x2A, 0xD5, 0xD5, + 0x13, 0xD5, 0xD5, 0xD5, 0x12, 0x12, 0x12, 0x12, 0x19, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x29, 0x29, 0x29, 0x2A, 0x2A, 0x2A, 0xD5, 0x0F, + 0x13, 0x07, 0x11, 0x11, 0x01, 0xD5, 0xD5, 0xD5, 0x19, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x2B, 0x2B, 0x2B, 0x2B, 0x0F, + 0x14, 0xD5, 0xD5, 0xD5, 0x10, 0xD5, 0xD5, 0xD5, 0x08, 0x31, 0x31, 0x31, 0x30, 0x30, 0x30, 0x2F, 0x2F, 0x06, 0x2E, 0x2E, 0x2E, 0x2D, 0x2D, 0x2D, 0x2C, 0x2C, 0xD5, 0xD5, + 0x14, 0xD5, 0xD5, 0xD5, 0x00, 0xD5, 0xD5, 0xD5, 0x08, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, + 0x14, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x18, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x3A, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, + 0x15, 0x15, 0x15, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x18, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, + 0xD5, 0xD5, 0x02, 0x16, 0x16, 0x16, 0x17, 0x17, 0x18, 0xD5, 0xD5, 0xD5, 0x49, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, +}; diff --git a/src/region_map.c b/src/region_map.c index 09e2d69bf..f1fcdf6dc 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -53,8 +53,6 @@ enum { TAG_FLY_ICON, }; -// Static type declarations - struct MultiNameFlyDest { const u8 *const *name; @@ -62,8 +60,6 @@ struct MultiNameFlyDest u16 flag; }; -// Static RAM declarations - static EWRAM_DATA struct RegionMap *gRegionMap = NULL; static EWRAM_DATA struct { @@ -78,8 +74,6 @@ static EWRAM_DATA struct { static bool32 sDrawFlyDestTextWindow; -// Static ROM declarations - static u8 ProcessRegionMapInput_Full(void); static u8 MoveRegionMapCursor_Full(void); static u8 ProcessRegionMapInput_Zoomed(void); @@ -127,8 +121,8 @@ static const u16 sRegionMapPlayerIcon_BrendanPal[] = INCBIN_U16("graphics/pokena static const u8 sRegionMapPlayerIcon_BrendanGfx[] = INCBIN_U8("graphics/pokenav/region_map/brendan_icon.4bpp"); static const u16 sRegionMapPlayerIcon_MayPal[] = INCBIN_U16("graphics/pokenav/region_map/may_icon.gbapal"); static const u8 sRegionMapPlayerIcon_MayGfx[] = INCBIN_U8("graphics/pokenav/region_map/may_icon.4bpp"); -static const u8 sRegionMap_MapSectionLayout[] = INCBIN_U8("graphics/pokenav/region_map_section_layout.bin"); +#include "data/region_map/region_map_layout.h" #include "data/region_map/region_map_entries.h" static const u16 sRegionMap_SpecialPlaceLocations[][2] = @@ -506,8 +500,6 @@ static const struct SpriteTemplate sFlyDestIconSpriteTemplate = .callback = SpriteCallbackDummy }; -// .text - void InitRegionMap(struct RegionMap *regionMap, bool8 zoomed) { InitRegionMapData(regionMap, NULL, zoomed); From ed70b81ba0dbb55f3deb46ca3dc614e6670b9b28 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 22 Feb 2022 18:23:01 -0500 Subject: [PATCH 003/106] Use constants for region map layout --- src/data/region_map/region_map_layout.h | 32 ++++++++++++------------- src/region_map.c | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/data/region_map/region_map_layout.h b/src/data/region_map/region_map_layout.h index 6847ffa72..7a67685c7 100644 --- a/src/data/region_map/region_map_layout.h +++ b/src/data/region_map/region_map_layout.h @@ -1,18 +1,18 @@ -static const u8 sRegionMap_MapSectionLayout[] = +static const u8 sRegionMap_MapSectionLayout[MAP_HEIGHT][MAP_WIDTH] = { - 0xD5, 0x1D, 0x1D, 0x04, 0x1C, 0x1C, 0x1C, 0x1C, 0x1A, 0xD5, 0xD5, 0x22, 0x0B, 0x23, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, - 0xD5, 0x1D, 0xD5, 0xD5, 0xD5, 0xD5, 0x38, 0x38, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0x23, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, - 0x1E, 0x1D, 0xD5, 0xD5, 0xD5, 0xD5, 0x38, 0x38, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0x23, 0xD5, 0xD5, 0x39, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, - 0x1E, 0xD5, 0xD5, 0xD5, 0xD5, 0x03, 0x1B, 0x1B, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0x23, 0x24, 0x24, 0x24, 0x24, 0x0C, 0x0C, 0x27, 0x27, 0x27, 0x27, 0x28, 0x28, 0xD5, 0xD5, - 0x1E, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0xD5, 0xD5, 0xD5, 0x25, 0xD5, 0xD5, 0xD5, 0x27, 0x27, 0x27, 0x27, 0x28, 0x28, 0xD5, 0xD5, - 0x0A, 0x1F, 0x1F, 0x1F, 0x1F, 0xD5, 0xD5, 0xD5, 0x1A, 0xD5, 0xD5, 0x22, 0xD5, 0xD5, 0xD5, 0xD5, 0x25, 0xD5, 0xD5, 0xD5, 0x27, 0x27, 0x27, 0x27, 0x0D, 0x0D, 0xD5, 0xD5, - 0x0A, 0xD5, 0xD5, 0xD5, 0x05, 0x20, 0x20, 0x20, 0x09, 0x09, 0x21, 0x21, 0x26, 0x26, 0x26, 0x26, 0x26, 0xD5, 0xD5, 0xD5, 0x29, 0x29, 0x29, 0x2A, 0x2A, 0x2A, 0xD5, 0xD5, - 0x13, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x19, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x29, 0x0E, 0x29, 0x2A, 0x2A, 0x2A, 0xD5, 0xD5, - 0x13, 0xD5, 0xD5, 0xD5, 0x12, 0x12, 0x12, 0x12, 0x19, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x29, 0x29, 0x29, 0x2A, 0x2A, 0x2A, 0xD5, 0x0F, - 0x13, 0x07, 0x11, 0x11, 0x01, 0xD5, 0xD5, 0xD5, 0x19, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x2B, 0x2B, 0x2B, 0x2B, 0x0F, - 0x14, 0xD5, 0xD5, 0xD5, 0x10, 0xD5, 0xD5, 0xD5, 0x08, 0x31, 0x31, 0x31, 0x30, 0x30, 0x30, 0x2F, 0x2F, 0x06, 0x2E, 0x2E, 0x2E, 0x2D, 0x2D, 0x2D, 0x2C, 0x2C, 0xD5, 0xD5, - 0x14, 0xD5, 0xD5, 0xD5, 0x00, 0xD5, 0xD5, 0xD5, 0x08, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, - 0x14, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x18, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x3A, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, - 0x15, 0x15, 0x15, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0x18, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, - 0xD5, 0xD5, 0x02, 0x16, 0x16, 0x16, 0x17, 0x17, 0x18, 0xD5, 0xD5, 0xD5, 0x49, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, + {MAPSEC_NONE, MAPSEC_ROUTE_114, MAPSEC_ROUTE_114, MAPSEC_FALLARBOR_TOWN, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_FORTREE_CITY, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_NONE, MAPSEC_ROUTE_114, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_MT_CHIMNEY, MAPSEC_MT_CHIMNEY, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_ROUTE_115, MAPSEC_ROUTE_114, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_MT_CHIMNEY, MAPSEC_MT_CHIMNEY, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_SAFARI_ZONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_ROUTE_115, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_LAVARIDGE_TOWN, MAPSEC_ROUTE_112, MAPSEC_ROUTE_112, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_ROUTE_121, MAPSEC_ROUTE_121, MAPSEC_ROUTE_121, MAPSEC_ROUTE_121, MAPSEC_LILYCOVE_CITY, MAPSEC_LILYCOVE_CITY, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_ROUTE_125, MAPSEC_ROUTE_125, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_ROUTE_115, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_122, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_ROUTE_125, MAPSEC_ROUTE_125, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_RUSTBORO_CITY, MAPSEC_ROUTE_116, MAPSEC_ROUTE_116, MAPSEC_ROUTE_116, MAPSEC_ROUTE_116, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_122, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_ROUTE_124, MAPSEC_MOSSDEEP_CITY, MAPSEC_MOSSDEEP_CITY, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_RUSTBORO_CITY, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_VERDANTURF_TOWN, MAPSEC_ROUTE_117, MAPSEC_ROUTE_117, MAPSEC_ROUTE_117, MAPSEC_MAUVILLE_CITY, MAPSEC_MAUVILLE_CITY, MAPSEC_ROUTE_118, MAPSEC_ROUTE_118, MAPSEC_ROUTE_123, MAPSEC_ROUTE_123, MAPSEC_ROUTE_123, MAPSEC_ROUTE_123, MAPSEC_ROUTE_123, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_126, MAPSEC_ROUTE_126, MAPSEC_ROUTE_126, MAPSEC_ROUTE_127, MAPSEC_ROUTE_127, MAPSEC_ROUTE_127, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_ROUTE_104, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_110, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_126, MAPSEC_SOOTOPOLIS_CITY, MAPSEC_ROUTE_126, MAPSEC_ROUTE_127, MAPSEC_ROUTE_127, MAPSEC_ROUTE_127, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_ROUTE_104, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_103, MAPSEC_ROUTE_103, MAPSEC_ROUTE_103, MAPSEC_ROUTE_103, MAPSEC_ROUTE_110, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_126, MAPSEC_ROUTE_126, MAPSEC_ROUTE_126, MAPSEC_ROUTE_127, MAPSEC_ROUTE_127, MAPSEC_ROUTE_127, MAPSEC_NONE, MAPSEC_EVER_GRANDE_CITY}, + {MAPSEC_ROUTE_104, MAPSEC_PETALBURG_CITY, MAPSEC_ROUTE_102, MAPSEC_ROUTE_102, MAPSEC_OLDALE_TOWN, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_110, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_128, MAPSEC_ROUTE_128, MAPSEC_ROUTE_128, MAPSEC_ROUTE_128, MAPSEC_EVER_GRANDE_CITY}, + {MAPSEC_ROUTE_105, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_101, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_SLATEPORT_CITY, MAPSEC_ROUTE_134, MAPSEC_ROUTE_134, MAPSEC_ROUTE_134, MAPSEC_ROUTE_133, MAPSEC_ROUTE_133, MAPSEC_ROUTE_133, MAPSEC_ROUTE_132, MAPSEC_ROUTE_132, MAPSEC_PACIFIDLOG_TOWN, MAPSEC_ROUTE_131, MAPSEC_ROUTE_131, MAPSEC_ROUTE_131, MAPSEC_ROUTE_130, MAPSEC_ROUTE_130, MAPSEC_ROUTE_130, MAPSEC_ROUTE_129, MAPSEC_ROUTE_129, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_ROUTE_105, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_LITTLEROOT_TOWN, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_SLATEPORT_CITY, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_ROUTE_105, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_109, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_BATTLE_FRONTIER, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_ROUTE_106, MAPSEC_ROUTE_106, MAPSEC_ROUTE_106, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_109, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE}, + {MAPSEC_NONE, MAPSEC_NONE, MAPSEC_DEWFORD_TOWN, MAPSEC_ROUTE_107, MAPSEC_ROUTE_107, MAPSEC_ROUTE_107, MAPSEC_ROUTE_108, MAPSEC_ROUTE_108, MAPSEC_ROUTE_109, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_SOUTHERN_ISLAND, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE}, }; diff --git a/src/region_map.c b/src/region_map.c index f1fcdf6dc..24ab5fad8 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -957,7 +957,7 @@ static u16 GetMapSecIdAt(u16 x, u16 y) } y -= MAPCURSOR_Y_MIN; x -= MAPCURSOR_X_MIN; - return sRegionMap_MapSectionLayout[x + y * MAP_WIDTH]; + return sRegionMap_MapSectionLayout[y][x]; } static void InitMapBasedOnPlayerLocation(void) From 8b43cffe09d3357a5de3dfdbde4aa99ae6ff5fc8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 22 Feb 2022 18:43:23 -0500 Subject: [PATCH 004/106] Move remaining region map graphics to region map folder --- .../{ => region_map}/city_maps/dewford_0.bin | 0 .../city_maps/ever_grande_0.bin | 0 .../city_maps/ever_grande_1.bin | 0 .../city_maps/fallarbor_0.bin | 0 .../{ => region_map}/city_maps/fortree_0.bin | 0 .../city_maps/lavaridge_0.bin | 0 .../{ => region_map}/city_maps/lilycove_0.bin | 0 .../{ => region_map}/city_maps/lilycove_1.bin | 0 .../city_maps/littleroot_0.bin | 0 .../{ => region_map}/city_maps/mauville_0.bin | 0 .../{ => region_map}/city_maps/mauville_1.bin | 0 .../{ => region_map}/city_maps/mossdeep_0.bin | 0 .../{ => region_map}/city_maps/mossdeep_1.bin | 0 .../{ => region_map}/city_maps/oldale_0.bin | 0 .../city_maps/pacifidlog_0.bin | 0 .../city_maps/petalburg_0.bin | 0 .../{ => region_map}/city_maps/rustboro_0.bin | 0 .../{ => region_map}/city_maps/rustboro_1.bin | 0 .../city_maps/slateport_0.bin | 0 .../city_maps/slateport_1.bin | 0 .../city_maps/sootopolis_0.bin | 0 .../city_maps/verdanturf_0.bin | 0 .../{ => region_map}/city_zoom_text.png | Bin .../map.bin} | Bin .../{region_map.pal => region_map/map.pal} | 0 .../{region_map.png => region_map/map.png} | Bin .../pokenav/{ => region_map}/zoom_tiles.png | Bin graphics_file_rules.mk | 2 +- src/data/region_map/city_map_tilemaps.h | 44 +++++++++--------- src/graphics.c | 4 +- src/pokenav_region_map.c | 2 +- src/region_map.c | 8 ++-- 32 files changed, 29 insertions(+), 31 deletions(-) rename graphics/pokenav/{ => region_map}/city_maps/dewford_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/ever_grande_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/ever_grande_1.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/fallarbor_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/fortree_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/lavaridge_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/lilycove_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/lilycove_1.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/littleroot_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/mauville_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/mauville_1.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/mossdeep_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/mossdeep_1.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/oldale_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/pacifidlog_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/petalburg_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/rustboro_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/rustboro_1.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/slateport_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/slateport_1.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/sootopolis_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_maps/verdanturf_0.bin (100%) rename graphics/pokenav/{ => region_map}/city_zoom_text.png (100%) rename graphics/pokenav/{region_map_map.bin => region_map/map.bin} (100%) rename graphics/pokenav/{region_map.pal => region_map/map.pal} (100%) rename graphics/pokenav/{region_map.png => region_map/map.png} (100%) rename graphics/pokenav/{ => region_map}/zoom_tiles.png (100%) diff --git a/graphics/pokenav/city_maps/dewford_0.bin b/graphics/pokenav/region_map/city_maps/dewford_0.bin similarity index 100% rename from graphics/pokenav/city_maps/dewford_0.bin rename to graphics/pokenav/region_map/city_maps/dewford_0.bin diff --git a/graphics/pokenav/city_maps/ever_grande_0.bin b/graphics/pokenav/region_map/city_maps/ever_grande_0.bin similarity index 100% rename from graphics/pokenav/city_maps/ever_grande_0.bin rename to graphics/pokenav/region_map/city_maps/ever_grande_0.bin diff --git a/graphics/pokenav/city_maps/ever_grande_1.bin b/graphics/pokenav/region_map/city_maps/ever_grande_1.bin similarity index 100% rename from graphics/pokenav/city_maps/ever_grande_1.bin rename to graphics/pokenav/region_map/city_maps/ever_grande_1.bin diff --git a/graphics/pokenav/city_maps/fallarbor_0.bin b/graphics/pokenav/region_map/city_maps/fallarbor_0.bin similarity index 100% rename from graphics/pokenav/city_maps/fallarbor_0.bin rename to graphics/pokenav/region_map/city_maps/fallarbor_0.bin diff --git a/graphics/pokenav/city_maps/fortree_0.bin b/graphics/pokenav/region_map/city_maps/fortree_0.bin similarity index 100% rename from graphics/pokenav/city_maps/fortree_0.bin rename to graphics/pokenav/region_map/city_maps/fortree_0.bin diff --git a/graphics/pokenav/city_maps/lavaridge_0.bin b/graphics/pokenav/region_map/city_maps/lavaridge_0.bin similarity index 100% rename from graphics/pokenav/city_maps/lavaridge_0.bin rename to graphics/pokenav/region_map/city_maps/lavaridge_0.bin diff --git a/graphics/pokenav/city_maps/lilycove_0.bin b/graphics/pokenav/region_map/city_maps/lilycove_0.bin similarity index 100% rename from graphics/pokenav/city_maps/lilycove_0.bin rename to graphics/pokenav/region_map/city_maps/lilycove_0.bin diff --git a/graphics/pokenav/city_maps/lilycove_1.bin b/graphics/pokenav/region_map/city_maps/lilycove_1.bin similarity index 100% rename from graphics/pokenav/city_maps/lilycove_1.bin rename to graphics/pokenav/region_map/city_maps/lilycove_1.bin diff --git a/graphics/pokenav/city_maps/littleroot_0.bin b/graphics/pokenav/region_map/city_maps/littleroot_0.bin similarity index 100% rename from graphics/pokenav/city_maps/littleroot_0.bin rename to graphics/pokenav/region_map/city_maps/littleroot_0.bin diff --git a/graphics/pokenav/city_maps/mauville_0.bin b/graphics/pokenav/region_map/city_maps/mauville_0.bin similarity index 100% rename from graphics/pokenav/city_maps/mauville_0.bin rename to graphics/pokenav/region_map/city_maps/mauville_0.bin diff --git a/graphics/pokenav/city_maps/mauville_1.bin b/graphics/pokenav/region_map/city_maps/mauville_1.bin similarity index 100% rename from graphics/pokenav/city_maps/mauville_1.bin rename to graphics/pokenav/region_map/city_maps/mauville_1.bin diff --git a/graphics/pokenav/city_maps/mossdeep_0.bin b/graphics/pokenav/region_map/city_maps/mossdeep_0.bin similarity index 100% rename from graphics/pokenav/city_maps/mossdeep_0.bin rename to graphics/pokenav/region_map/city_maps/mossdeep_0.bin diff --git a/graphics/pokenav/city_maps/mossdeep_1.bin b/graphics/pokenav/region_map/city_maps/mossdeep_1.bin similarity index 100% rename from graphics/pokenav/city_maps/mossdeep_1.bin rename to graphics/pokenav/region_map/city_maps/mossdeep_1.bin diff --git a/graphics/pokenav/city_maps/oldale_0.bin b/graphics/pokenav/region_map/city_maps/oldale_0.bin similarity index 100% rename from graphics/pokenav/city_maps/oldale_0.bin rename to graphics/pokenav/region_map/city_maps/oldale_0.bin diff --git a/graphics/pokenav/city_maps/pacifidlog_0.bin b/graphics/pokenav/region_map/city_maps/pacifidlog_0.bin similarity index 100% rename from graphics/pokenav/city_maps/pacifidlog_0.bin rename to graphics/pokenav/region_map/city_maps/pacifidlog_0.bin diff --git a/graphics/pokenav/city_maps/petalburg_0.bin b/graphics/pokenav/region_map/city_maps/petalburg_0.bin similarity index 100% rename from graphics/pokenav/city_maps/petalburg_0.bin rename to graphics/pokenav/region_map/city_maps/petalburg_0.bin diff --git a/graphics/pokenav/city_maps/rustboro_0.bin b/graphics/pokenav/region_map/city_maps/rustboro_0.bin similarity index 100% rename from graphics/pokenav/city_maps/rustboro_0.bin rename to graphics/pokenav/region_map/city_maps/rustboro_0.bin diff --git a/graphics/pokenav/city_maps/rustboro_1.bin b/graphics/pokenav/region_map/city_maps/rustboro_1.bin similarity index 100% rename from graphics/pokenav/city_maps/rustboro_1.bin rename to graphics/pokenav/region_map/city_maps/rustboro_1.bin diff --git a/graphics/pokenav/city_maps/slateport_0.bin b/graphics/pokenav/region_map/city_maps/slateport_0.bin similarity index 100% rename from graphics/pokenav/city_maps/slateport_0.bin rename to graphics/pokenav/region_map/city_maps/slateport_0.bin diff --git a/graphics/pokenav/city_maps/slateport_1.bin b/graphics/pokenav/region_map/city_maps/slateport_1.bin similarity index 100% rename from graphics/pokenav/city_maps/slateport_1.bin rename to graphics/pokenav/region_map/city_maps/slateport_1.bin diff --git a/graphics/pokenav/city_maps/sootopolis_0.bin b/graphics/pokenav/region_map/city_maps/sootopolis_0.bin similarity index 100% rename from graphics/pokenav/city_maps/sootopolis_0.bin rename to graphics/pokenav/region_map/city_maps/sootopolis_0.bin diff --git a/graphics/pokenav/city_maps/verdanturf_0.bin b/graphics/pokenav/region_map/city_maps/verdanturf_0.bin similarity index 100% rename from graphics/pokenav/city_maps/verdanturf_0.bin rename to graphics/pokenav/region_map/city_maps/verdanturf_0.bin diff --git a/graphics/pokenav/city_zoom_text.png b/graphics/pokenav/region_map/city_zoom_text.png similarity index 100% rename from graphics/pokenav/city_zoom_text.png rename to graphics/pokenav/region_map/city_zoom_text.png diff --git a/graphics/pokenav/region_map_map.bin b/graphics/pokenav/region_map/map.bin similarity index 100% rename from graphics/pokenav/region_map_map.bin rename to graphics/pokenav/region_map/map.bin diff --git a/graphics/pokenav/region_map.pal b/graphics/pokenav/region_map/map.pal similarity index 100% rename from graphics/pokenav/region_map.pal rename to graphics/pokenav/region_map/map.pal diff --git a/graphics/pokenav/region_map.png b/graphics/pokenav/region_map/map.png similarity index 100% rename from graphics/pokenav/region_map.png rename to graphics/pokenav/region_map/map.png diff --git a/graphics/pokenav/zoom_tiles.png b/graphics/pokenav/region_map/zoom_tiles.png similarity index 100% rename from graphics/pokenav/zoom_tiles.png rename to graphics/pokenav/region_map/zoom_tiles.png diff --git a/graphics_file_rules.mk b/graphics_file_rules.mk index 9e5c19193..f0e349970 100644 --- a/graphics_file_rules.mk +++ b/graphics_file_rules.mk @@ -336,7 +336,7 @@ graphics/title_screen/pokemon_logo.gbapal: %.gbapal: %.pal graphics/pokemon_jump/bg.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 63 -graphics/pokenav/region_map.8bpp: %.8bpp: %.png +graphics/pokenav/region_map/map.8bpp: %.8bpp: %.png $(GFX) $< $@ -num_tiles 233 $(MISCGFXDIR)/japanese_hof.4bpp: %.4bpp: %.png diff --git a/src/data/region_map/city_map_tilemaps.h b/src/data/region_map/city_map_tilemaps.h index fed158935..11a48c15d 100644 --- a/src/data/region_map/city_map_tilemaps.h +++ b/src/data/region_map/city_map_tilemaps.h @@ -1,22 +1,22 @@ -const u32 gPokenavCityMap_Lavaridge_0[] = INCBIN_U32("graphics/pokenav/city_maps/lavaridge_0.bin.lz"); -const u32 gPokenavCityMap_Fallarbor_0[] = INCBIN_U32("graphics/pokenav/city_maps/fallarbor_0.bin.lz"); -const u32 gPokenavCityMap_Fortree_0[] = INCBIN_U32("graphics/pokenav/city_maps/fortree_0.bin.lz"); -const u32 gPokenavCityMap_Slateport_0[] = INCBIN_U32("graphics/pokenav/city_maps/slateport_0.bin.lz"); -const u32 gPokenavCityMap_Slateport_1[] = INCBIN_U32("graphics/pokenav/city_maps/slateport_1.bin.lz"); -const u32 gPokenavCityMap_Rustboro_0[] = INCBIN_U32("graphics/pokenav/city_maps/rustboro_0.bin.lz"); -const u32 gPokenavCityMap_Rustboro_1[] = INCBIN_U32("graphics/pokenav/city_maps/rustboro_1.bin.lz"); -const u32 gPokenavCityMap_Pacifidlog_0[] = INCBIN_U32("graphics/pokenav/city_maps/pacifidlog_0.bin.lz"); -const u32 gPokenavCityMap_Mauville_1[] = INCBIN_U32("graphics/pokenav/city_maps/mauville_1.bin.lz"); -const u32 gPokenavCityMap_Mauville_0[] = INCBIN_U32("graphics/pokenav/city_maps/mauville_0.bin.lz"); -const u32 gPokenavCityMap_Oldale_0[] = INCBIN_U32("graphics/pokenav/city_maps/oldale_0.bin.lz"); -const u32 gPokenavCityMap_Lilycove_1[] = INCBIN_U32("graphics/pokenav/city_maps/lilycove_1.bin.lz"); -const u32 gPokenavCityMap_Lilycove_0[] = INCBIN_U32("graphics/pokenav/city_maps/lilycove_0.bin.lz"); -const u32 gPokenavCityMap_Littleroot_0[] = INCBIN_U32("graphics/pokenav/city_maps/littleroot_0.bin.lz"); -const u32 gPokenavCityMap_Dewford_0[] = INCBIN_U32("graphics/pokenav/city_maps/dewford_0.bin.lz"); -const u32 gPokenavCityMap_Sootopolis_0[] = INCBIN_U32("graphics/pokenav/city_maps/sootopolis_0.bin.lz"); -const u32 gPokenavCityMap_EverGrande_0[] = INCBIN_U32("graphics/pokenav/city_maps/ever_grande_0.bin.lz"); -const u32 gPokenavCityMap_EverGrande_1[] = INCBIN_U32("graphics/pokenav/city_maps/ever_grande_1.bin.lz"); -const u32 gPokenavCityMap_Verdanturf_0[] = INCBIN_U32("graphics/pokenav/city_maps/verdanturf_0.bin.lz"); -const u32 gPokenavCityMap_Mossdeep_1[] = INCBIN_U32("graphics/pokenav/city_maps/mossdeep_1.bin.lz"); -const u32 gPokenavCityMap_Mossdeep_0[] = INCBIN_U32("graphics/pokenav/city_maps/mossdeep_0.bin.lz"); -const u32 gPokenavCityMap_Petalburg_0[] = INCBIN_U32("graphics/pokenav/city_maps/petalburg_0.bin.lz"); +const u32 gPokenavCityMap_Lavaridge_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/lavaridge_0.bin.lz"); +const u32 gPokenavCityMap_Fallarbor_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/fallarbor_0.bin.lz"); +const u32 gPokenavCityMap_Fortree_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/fortree_0.bin.lz"); +const u32 gPokenavCityMap_Slateport_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/slateport_0.bin.lz"); +const u32 gPokenavCityMap_Slateport_1[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/slateport_1.bin.lz"); +const u32 gPokenavCityMap_Rustboro_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/rustboro_0.bin.lz"); +const u32 gPokenavCityMap_Rustboro_1[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/rustboro_1.bin.lz"); +const u32 gPokenavCityMap_Pacifidlog_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/pacifidlog_0.bin.lz"); +const u32 gPokenavCityMap_Mauville_1[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/mauville_1.bin.lz"); +const u32 gPokenavCityMap_Mauville_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/mauville_0.bin.lz"); +const u32 gPokenavCityMap_Oldale_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/oldale_0.bin.lz"); +const u32 gPokenavCityMap_Lilycove_1[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/lilycove_1.bin.lz"); +const u32 gPokenavCityMap_Lilycove_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/lilycove_0.bin.lz"); +const u32 gPokenavCityMap_Littleroot_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/littleroot_0.bin.lz"); +const u32 gPokenavCityMap_Dewford_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/dewford_0.bin.lz"); +const u32 gPokenavCityMap_Sootopolis_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/sootopolis_0.bin.lz"); +const u32 gPokenavCityMap_EverGrande_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/ever_grande_0.bin.lz"); +const u32 gPokenavCityMap_EverGrande_1[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/ever_grande_1.bin.lz"); +const u32 gPokenavCityMap_Verdanturf_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/verdanturf_0.bin.lz"); +const u32 gPokenavCityMap_Mossdeep_1[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/mossdeep_1.bin.lz"); +const u32 gPokenavCityMap_Mossdeep_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/mossdeep_0.bin.lz"); +const u32 gPokenavCityMap_Petalburg_0[] = INCBIN_U32("graphics/pokenav/region_map/city_maps/petalburg_0.bin.lz"); diff --git a/src/graphics.c b/src/graphics.c index 9f708f18b..45be8e908 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1323,8 +1323,8 @@ const u16 gPokenavMessageBox_Pal[] = INCBIN_U16("graphics/pokenav/message.gbapal const u32 gPokenavMessageBox_Gfx[] = INCBIN_U32("graphics/pokenav/message.4bpp.lz"); const u32 gPokenavMessageBox_Tilemap[] = INCBIN_U32("graphics/pokenav/message.bin.lz"); -const u16 gRegionMapCityZoomTiles_Pal[] = INCBIN_U16("graphics/pokenav/zoom_tiles.gbapal"); -const u32 gRegionMapCityZoomText_Gfx[] = INCBIN_U32("graphics/pokenav/city_zoom_text.4bpp.lz"); +const u16 gRegionMapCityZoomTiles_Pal[] = INCBIN_U16("graphics/pokenav/region_map/zoom_tiles.gbapal"); +const u32 gRegionMapCityZoomText_Gfx[] = INCBIN_U32("graphics/pokenav/region_map/city_zoom_text.4bpp.lz"); const u16 gPokenavConditionCancel_Pal[] = INCBIN_U16("graphics/pokenav/condition/cancel.gbapal"); const u8 gPokenavConditionCancel_Gfx[] = INCBIN_U8("graphics/pokenav/condition/cancel.4bpp"); diff --git a/src/pokenav_region_map.c b/src/pokenav_region_map.c index 16ba48070..4860aeec0 100755 --- a/src/pokenav_region_map.c +++ b/src/pokenav_region_map.c @@ -78,7 +78,7 @@ extern const u16 gRegionMapCityZoomTiles_Pal[]; extern const u32 gRegionMapCityZoomText_Gfx[]; static const u16 sMapSecInfoWindow_Pal[] = INCBIN_U16("graphics/pokenav/region_map/info_window.gbapal"); -static const u32 sRegionMapCityZoomTiles_Gfx[] = INCBIN_U32("graphics/pokenav/zoom_tiles.4bpp.lz"); +static const u32 sRegionMapCityZoomTiles_Gfx[] = INCBIN_U32("graphics/pokenav/region_map/zoom_tiles.4bpp.lz"); #include "data/region_map/city_map_tilemaps.h" diff --git a/src/region_map.c b/src/region_map.c index 24ab5fad8..1da3afb3a 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -109,14 +109,12 @@ static void CB_FadeInFlyMap(void); static void CB_HandleFlyMapInput(void); static void CB_ExitFlyMap(void); -// NOTE: Some of the below graphics are not in graphics/pokenav/region_map -// because porymap expects them to be in their current location. static const u16 sRegionMapCursorPal[] = INCBIN_U16("graphics/pokenav/region_map/cursor.gbapal"); static const u32 sRegionMapCursorSmallGfxLZ[] = INCBIN_U32("graphics/pokenav/region_map/cursor_small.4bpp.lz"); static const u32 sRegionMapCursorLargeGfxLZ[] = INCBIN_U32("graphics/pokenav/region_map/cursor_large.4bpp.lz"); -static const u16 sRegionMapBg_Pal[] = INCBIN_U16("graphics/pokenav/region_map.gbapal"); -static const u32 sRegionMapBg_GfxLZ[] = INCBIN_U32("graphics/pokenav/region_map.8bpp.lz"); -static const u32 sRegionMapBg_TilemapLZ[] = INCBIN_U32("graphics/pokenav/region_map_map.bin.lz"); +static const u16 sRegionMapBg_Pal[] = INCBIN_U16("graphics/pokenav/region_map/map.gbapal"); +static const u32 sRegionMapBg_GfxLZ[] = INCBIN_U32("graphics/pokenav/region_map/map.8bpp.lz"); +static const u32 sRegionMapBg_TilemapLZ[] = INCBIN_U32("graphics/pokenav/region_map/map.bin.lz"); static const u16 sRegionMapPlayerIcon_BrendanPal[] = INCBIN_U16("graphics/pokenav/region_map/brendan_icon.gbapal"); static const u8 sRegionMapPlayerIcon_BrendanGfx[] = INCBIN_U8("graphics/pokenav/region_map/brendan_icon.4bpp"); static const u16 sRegionMapPlayerIcon_MayPal[] = INCBIN_U16("graphics/pokenav/region_map/may_icon.gbapal"); From 3cc21a0fc8310fca8575eaa62977ba1fd43245f1 Mon Sep 17 00:00:00 2001 From: cbt6 <91667135+cbt6@users.noreply.github.com> Date: Sun, 13 Mar 2022 05:19:16 +0800 Subject: [PATCH 005/106] Format object event graphics info --- .../object_event_graphics_info.h | 4899 ++++++++++++++++- 1 file changed, 4654 insertions(+), 245 deletions(-) diff --git a/src/data/object_events/object_event_graphics_info.h b/src/data/object_events/object_event_graphics_info.h index ea424090a..cd6ce2f55 100755 --- a/src/data/object_events/object_event_graphics_info.h +++ b/src/data/object_events/object_event_graphics_info.h @@ -1,245 +1,4654 @@ -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanNormal = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 16, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanMachBike = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_BrendanMachBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanAcroBike = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_BrendanAcroBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanSurfing = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Surfing, sPicTable_BrendanSurfing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFieldMove = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_FieldMove, sPicTable_BrendanFieldMove, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_QuintyPlump = {TAG_NONE, OBJ_EVENT_PAL_TAG_QUINTY_PLUMP, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_L, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_QuintyPlump, sPicTable_QuintyPlump, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_NinjaBoy = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_NinjaBoy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Twin = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Twin, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy1 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Boy1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl1 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Girl1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy2 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Boy2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl2 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Girl2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleBoy = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_LittleBoy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleGirl = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_LittleGirl, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy3 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Boy3, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl3 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Girl3, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RichBoy = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RichBoy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman1 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FatMan = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_FatMan, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_PokefanF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man1 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman2 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ExpertM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ExpertF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man2 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman3 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman3, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_PokefanM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman4 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman4, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cook = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Cook, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkReceptionist = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_LinkReceptionist, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldMan = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_OldMan, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldWoman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_OldWoman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Camper = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Camper, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Picnicker = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Picnicker, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man3 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man3, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman5 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman5, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Youngster = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Youngster, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BugCatcher = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_BugCatcher, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_PsychicM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SchoolKidM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Maniac, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_HexManiac, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RayquazaStill = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Standard, sPicTable_RayquazaStill, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SwimmerM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SwimmerF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_BlackBelt, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Beauty = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Beauty, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist1 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Scientist1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lass = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Lass, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Gentleman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Gentleman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sailor = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Sailor, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fisherman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Fisherman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RunningTriathleteM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RunningTriathleteF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_TuberF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_TuberM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Hiker, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_CyclingTriathleteM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_CyclingTriathleteF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Nurse, sPicTable_Nurse, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ItemBall, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, NULL, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ProfBirch = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ProfBirch, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man4 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man4, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man5 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man5, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ReporterM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ReporterF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hipster = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Trader = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Storyteller = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Giddy = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan1 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan2 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedNatuDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedNatuDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMagnemiteDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedMagnemiteDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedSquirtleDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedWooperDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedPikachuDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedPorygon2Doll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_CuttableTree, sPicTable_CuttableTree, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MartEmployee, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RooftopSaleWoman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Teala, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BreakableRock = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_BreakableRock, sPicTable_BreakableRock, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PushableBoulder = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_PushableBoulder, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MrBrineysBoat = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MrBrineysBoat, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayNormal = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 16, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_MayNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayMachBike = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MayMachBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayAcroBike = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_MayAcroBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MaySurfing = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Surfing, sPicTable_MaySurfing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFieldMove = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_FieldMove, sPicTable_MayFieldMove, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Truck = {TAG_NONE, OBJ_EVENT_PAL_TAG_TRUCK, OBJ_EVENT_PAL_TAG_NONE, 1152, 48, 48, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_48x48, sAnimTable_Inanimate, sPicTable_Truck, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothCarryingBox = {TAG_NONE, OBJ_EVENT_PAL_TAG_VIGOROTH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_VigorothCarryingBox, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothFacingAway = {TAG_NONE, OBJ_EVENT_PAL_TAG_VIGOROTH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_VigorothFacingAway, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirchsBag = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_BirchsBag, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_EnemyZigzagoon = {TAG_NONE, OBJ_EVENT_PAL_TAG_ZIGZAGOON, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_EnemyZigzagoon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena = {TAG_NONE, OBJ_EVENT_PAL_TAG_POOCHYENA, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Poochyena, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Artist = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Artist, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanNormal = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanMachBike = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_BrendanMachBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanAcroBike = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_BrendanAcroBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanSurfing = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Surfing, sPicTable_BrendanSurfing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanFieldMove = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_FieldMove, sPicTable_BrendanFieldMove, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayNormal = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_MayNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayMachBike = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MayMachBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayAcroBike = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_MayAcroBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMaySurfing = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Surfing, sPicTable_MaySurfing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayFieldMove = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_FieldMove, sPicTable_MayFieldMove, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cameraman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Cameraman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanUnderwater = {TAG_NONE, OBJ_EVENT_PAL_TAG_PLAYER_UNDERWATER, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_BrendanUnderwater, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayUnderwater = {TAG_NONE, OBJ_EVENT_PAL_TAG_PLAYER_UNDERWATER, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MayUnderwater, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MovingBox = {TAG_NONE, OBJ_EVENT_PAL_TAG_MOVING_BOX, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 10, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_MovingBox, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CableCar = {TAG_NONE, OBJ_EVENT_PAL_TAG_CABLE_CAR, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Inanimate, sPicTable_CableCar, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist2 = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Scientist2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DevonEmployee = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_DevonEmployee, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_AquaMemberM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_AquaMemberF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MagmaMemberM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MagmaMemberF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sidney = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Sidney, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Phoebe = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Phoebe, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Glacia = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Glacia, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Drake = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Drake, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Roxanne = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Roxanne, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brawly = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Brawly, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wattson = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Wattson, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Flannery = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Flannery, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Norman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Norman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Winona = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Winona, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Liza = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Liza, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tate = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Tate, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wallace = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Wallace, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Steven = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Steven, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wally = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Wally, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireLittleBoy = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_RubySapphireLittleBoy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFishing = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Fishing, sPicTable_BrendanFishing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFishing = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Fishing, sPicTable_MayFishing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HotSpringsOldWoman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_HotSpringsOldWoman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SSTidal = {TAG_NONE, OBJ_EVENT_PAL_TAG_SSTIDAL, OBJ_EVENT_PAL_TAG_NONE, 1920, 96, 40, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_8x8, sOamTables_96x40, sAnimTable_Standard, sPicTable_SSTidal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SubmarineShadow = {TAG_NONE, OBJ_EVENT_PAL_TAG_SUBMARINE_SHADOW, OBJ_EVENT_PAL_TAG_NONE, 1408, 88, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_8x8, sOamTables_88x32, sAnimTable_Standard, sPicTable_SubmarineShadow, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PichuDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_PichuDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikachuDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_PikachuDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MarillDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_MarillDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TogepiDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_TogepiDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyndaquilDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_CyndaquilDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ChikoritaDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ChikoritaDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TotodileDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_TotodileDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_JigglypuffDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_JigglypuffDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MeowthDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_MeowthDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ClefairyDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ClefairyDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DittoDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_DittoDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SmoochumDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SmoochumDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TreeckoDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_TreeckoDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TorchicDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_TorchicDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MudkipDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_MudkipDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DuskullDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_DuskullDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WynautDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_WynautDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BaltoyDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_BaltoyDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_KecleonDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AzurillDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_AzurillDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SkittyDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SkittyDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwabluDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SwabluDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GulpinDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_GulpinDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LotadDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_LotadDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SeedotDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SeedotDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikaCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_PikaCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RoundCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_RoundCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KissCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_KissCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ZigzagCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ZigzagCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SpinCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SpinCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DiamondCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_DiamondCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BallCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_BallCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GrassCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_GrassCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FireCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_FireCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WaterCushion = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_WaterCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigSnorlaxDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigSnorlaxDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRhydonDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigRhydonDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigLaprasDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigLaprasDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigVenusaurDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigVenusaurDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigCharizardDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigCharizardDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigBlastoiseDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigBlastoiseDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigWailmerDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigWailmerDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegirockDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigRegirockDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegiceDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigRegiceDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegisteelDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigRegisteelDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latias = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_LatiasLatios, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latios = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_LatiasLatios, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GameboyKid = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_GameboyKid, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ContestJudge = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ContestJudge, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanWatering = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_BrendanWatering, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayWatering = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MayWatering, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating = {TAG_NONE, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Inanimate, sPicTable_BrendanDecorating, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Inanimate, sPicTable_MayDecorating, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Archie, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Maxie, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreFront = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreFront, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonFront = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_GroudonFront, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreSide = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreSide, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonSide = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_GroudonSide, sPicTable_GroudonSide, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_Fossil, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Skitty, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Kecleon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreAsleep = {TAG_NONE, OBJ_EVENT_PAL_TAG_KYOGRE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreFront, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonAsleep = {TAG_NONE, OBJ_EVENT_PAL_TAG_GROUDON, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_GroudonFront, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Rayquaza, sPicTable_Rayquaza, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Zigzagoon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Pikachu, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Azumarill, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wingull = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Wingull, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonBridgeShadow = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 128, 16, 16, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Kecleon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberMSwimming = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_TuberMSwimming, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azurill = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Azurill, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mom = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Mom, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkBrendan = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay = {TAG_NONE, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_MayNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Juan, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Scott, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MysteryEventDeliveryman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Inanimate, sPicTable_Statue, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_S, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Kirlia, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Dusclops = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Dusclops, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnionRoomAttendant = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_UnionRoomAttendant, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Red = {TAG_NONE, OBJ_EVENT_PAL_TAG_RED_LEAF, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Red, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Leaf = {TAG_NONE, OBJ_EVENT_PAL_TAG_RED_LEAF, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Leaf, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sudowoodo = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Sudowoodo, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mew = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Mew, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Deoxys = {TAG_NONE, OBJ_EVENT_PAL_TAG_DEOXYS, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Deoxys, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirthIslandStone = {TAG_NONE, OBJ_EVENT_PAL_TAG_BIRTH_ISLAND_STONE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BirthIslandStone, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Anabel = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Anabel, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tucker = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Tucker, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Greta = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Greta, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Spenser = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Spenser, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Noland = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Noland, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lucy = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Lucy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brandon = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Brandon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrendan = {TAG_NONE, OBJ_EVENT_PAL_TAG_RS_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RubySapphireBrendan, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay = {TAG_NONE, OBJ_EVENT_PAL_TAG_RS_MAY, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RubySapphireMay, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia = {TAG_NONE, OBJ_EVENT_PAL_TAG_LUGIA, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Lugia, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh = {TAG_NONE, OBJ_EVENT_PAL_TAG_HO_OH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_HoOh, sPicTable_HoOh, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanNormal = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 16, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_BrendanMayNormal, + .images = sPicTable_BrendanNormal, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanMachBike = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_BrendanMachBike, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanAcroBike = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_AcroBike, + .images = sPicTable_BrendanAcroBike, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanSurfing = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = TRUE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Surfing, + .images = sPicTable_BrendanSurfing, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFieldMove = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_FieldMove, + .images = sPicTable_BrendanFieldMove, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_QuintyPlump = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_QUINTY_PLUMP, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_L, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_QuintyPlump, + .images = sPicTable_QuintyPlump, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_NinjaBoy = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_NinjaBoy, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Twin = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Twin, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy1 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Boy1, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl1 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Girl1, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy2 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Boy2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl2 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Girl2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleBoy = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_LittleBoy, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleGirl = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_LittleGirl, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy3 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Boy3, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl3 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Girl3, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RichBoy = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_RichBoy, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman1 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Woman1, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FatMan = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_FatMan, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_PokefanF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man1 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Man1, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman2 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Woman2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_ExpertM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_ExpertF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man2 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Man2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman3 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Woman3, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_PokefanM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman4 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Woman4, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cook = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Cook, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkReceptionist = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_LinkReceptionist, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldMan = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_OldMan, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldWoman = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_OldWoman, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Camper = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Camper, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Picnicker = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Picnicker, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man3 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Man3, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman5 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Woman5, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Youngster = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Youngster, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BugCatcher = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_BugCatcher, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_PsychicM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_SchoolKidM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Maniac, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_HexManiac, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RayquazaStill = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 2048, + .width = 64, + .height = 64, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = TRUE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_64x64, + .subspriteTables = sOamTables_64x64, + .anims = sAnimTable_Standard, + .images = sPicTable_RayquazaStill, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_SwimmerM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_SwimmerF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_BlackBelt, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Beauty = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Beauty, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist1 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Scientist1, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lass = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Lass, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Gentleman = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Gentleman, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sailor = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Sailor, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fisherman = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Fisherman, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_RunningTriathleteM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_RunningTriathleteF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_TuberF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_TuberM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Hiker, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_AcroBike, + .images = sPicTable_CyclingTriathleteM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_AcroBike, + .images = sPicTable_CyclingTriathleteF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Nurse, + .images = sPicTable_Nurse, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_ItemBall, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = NULL, + .anims = sAnimTable_BerryTree, + .images = sPicTable_PechaBerryTree, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_BerryTree, + .images = sPicTable_PechaBerryTree, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_BerryTree, + .images = sPicTable_PechaBerryTree, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ProfBirch = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_ProfBirch, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man4 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Man4, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man5 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Man5, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_ReporterM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_ReporterF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MauvilleOldMan1, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hipster = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MauvilleOldMan1, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Trader = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MauvilleOldMan1, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Storyteller = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MauvilleOldMan2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Giddy = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MauvilleOldMan2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan1 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MauvilleOldMan2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan2 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MauvilleOldMan2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedNatuDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_UnusedNatuDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMagnemiteDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_UnusedMagnemiteDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_UnusedSquirtleDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_UnusedWooperDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_UnusedPikachuDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_UnusedPorygon2Doll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_CuttableTree, + .images = sPicTable_CuttableTree, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MartEmployee, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_RooftopSaleWoman, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Teala, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BreakableRock = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_BreakableRock, + .images = sPicTable_BreakableRock, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PushableBoulder = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_PushableBoulder, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MrBrineysBoat = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MrBrineysBoat, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayNormal = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 16, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_BrendanMayNormal, + .images = sPicTable_MayNormal, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayMachBike = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MayMachBike, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayAcroBike = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_AcroBike, + .images = sPicTable_MayAcroBike, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MaySurfing = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = TRUE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Surfing, + .images = sPicTable_MaySurfing, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFieldMove = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_FieldMove, + .images = sPicTable_MayFieldMove, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Truck = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_TRUCK, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 1152, + .width = 48, + .height = 48, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_48x48, + .anims = sAnimTable_Inanimate, + .images = sPicTable_Truck, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothCarryingBox = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_VIGOROTH, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_VigorothCarryingBox, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothFacingAway = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_VIGOROTH, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_VigorothFacingAway, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirchsBag = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BirchsBag, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_EnemyZigzagoon = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_ZIGZAGOON, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_EnemyZigzagoon, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_POOCHYENA, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Poochyena, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Artist = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Artist, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanNormal = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_BrendanMayNormal, + .images = sPicTable_BrendanNormal, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanMachBike = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_BrendanMachBike, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanAcroBike = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_AcroBike, + .images = sPicTable_BrendanAcroBike, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanSurfing = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = TRUE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Surfing, + .images = sPicTable_BrendanSurfing, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanFieldMove = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_FieldMove, + .images = sPicTable_BrendanFieldMove, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayNormal = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_BrendanMayNormal, + .images = sPicTable_MayNormal, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayMachBike = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MayMachBike, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayAcroBike = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_BIKE_TIRE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_AcroBike, + .images = sPicTable_MayAcroBike, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMaySurfing = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = TRUE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Surfing, + .images = sPicTable_MaySurfing, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayFieldMove = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_FieldMove, + .images = sPicTable_MayFieldMove, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cameraman = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Cameraman, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanUnderwater = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_PLAYER_UNDERWATER, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = TRUE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_BrendanUnderwater, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayUnderwater = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_PLAYER_UNDERWATER, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = TRUE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MayUnderwater, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MovingBox = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MOVING_BOX, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_MovingBox, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CableCar = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_CABLE_CAR, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 2048, + .width = 64, + .height = 64, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_64x64, + .subspriteTables = sOamTables_64x64, + .anims = sAnimTable_Inanimate, + .images = sPicTable_CableCar, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist2 = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Scientist2, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DevonEmployee = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_DevonEmployee, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_AquaMemberM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_AquaMemberF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberM = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MagmaMemberM, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberF = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MagmaMemberF, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sidney = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Sidney, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Phoebe = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Phoebe, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Glacia = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Glacia, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Drake = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Drake, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Roxanne = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Roxanne, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brawly = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Brawly, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wattson = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Wattson, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Flannery = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Flannery, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Norman = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Norman, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Winona = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Winona, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Liza = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Liza, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tate = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Tate, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wallace = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Wallace, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Steven = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Steven, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wally = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Wally, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireLittleBoy = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_RubySapphireLittleBoy, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFishing = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Fishing, + .images = sPicTable_BrendanFishing, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFishing = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Fishing, + .images = sPicTable_MayFishing, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HotSpringsOldWoman = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_HotSpringsOldWoman, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SSTidal = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_SSTIDAL, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 1920, + .width = 96, + .height = 40, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_8x8, + .subspriteTables = sOamTables_96x40, + .anims = sAnimTable_Standard, + .images = sPicTable_SSTidal, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SubmarineShadow = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_SUBMARINE_SHADOW, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 1408, + .width = 88, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_8x8, + .subspriteTables = sOamTables_88x32, + .anims = sAnimTable_Standard, + .images = sPicTable_SubmarineShadow, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PichuDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_PichuDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikachuDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_PikachuDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MarillDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_MarillDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TogepiDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_TogepiDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyndaquilDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_CyndaquilDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ChikoritaDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_ChikoritaDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TotodileDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_TotodileDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_JigglypuffDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_JigglypuffDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MeowthDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_MeowthDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ClefairyDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_ClefairyDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DittoDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_DittoDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SmoochumDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_SmoochumDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TreeckoDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_TreeckoDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TorchicDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_TorchicDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MudkipDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_MudkipDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DuskullDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_DuskullDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WynautDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_WynautDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BaltoyDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BaltoyDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_KecleonDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AzurillDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_AzurillDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SkittyDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_SkittyDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwabluDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_SwabluDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GulpinDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_GulpinDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LotadDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_LotadDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SeedotDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_SeedotDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikaCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_PikaCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RoundCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_RoundCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KissCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_KissCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ZigzagCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_ZigzagCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SpinCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_SpinCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DiamondCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_DiamondCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BallCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BallCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GrassCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_GrassCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FireCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_FireCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WaterCushion = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_WaterCushion, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigSnorlaxDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigSnorlaxDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRhydonDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigRhydonDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigLaprasDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigLaprasDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigVenusaurDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigVenusaurDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigCharizardDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigCharizardDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigBlastoiseDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigBlastoiseDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigWailmerDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigWailmerDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegirockDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigRegirockDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegiceDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigRegiceDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegisteelDoll = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BigRegisteelDoll, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latias = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_LatiasLatios, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latios = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_LatiasLatios, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GameboyKid = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_GameboyKid, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ContestJudge = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_ContestJudge, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanWatering = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_BrendanWatering, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayWatering = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 0, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MayWatering, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BrendanDecorating, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_MayDecorating, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Archie, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Maxie, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreFront = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_KyogreFront, + .affineAnims = sAffineAnimTable_KyogreGroudon, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonFront = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_GroudonFront, + .affineAnims = sAffineAnimTable_KyogreGroudon, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreSide = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_KyogreSide, + .affineAnims = sAffineAnimTable_KyogreGroudon, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonSide = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_GroudonSide, + .images = sPicTable_GroudonSide, + .affineAnims = sAffineAnimTable_KyogreGroudon, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_S, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_NONE, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Inanimate, + .images = sPicTable_Fossil, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Regi, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Regi, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Regi, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_Skitty, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_Kecleon, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreAsleep = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_KYOGRE, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_KyogreFront, + .affineAnims = sAffineAnimTable_KyogreGroudon, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonAsleep = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_GROUDON, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_GroudonFront, + .affineAnims = sAffineAnimTable_KyogreGroudon, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 2048, + .width = 64, + .height = 64, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = TRUE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_64x64, + .subspriteTables = sOamTables_64x64, + .anims = sAnimTable_Rayquaza, + .images = sPicTable_Rayquaza, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_Zigzagoon, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_Pikachu, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_Azumarill, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wingull = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_Wingull, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonBridgeShadow = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_Kecleon, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberMSwimming = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_2, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 3, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_TuberMSwimming, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azurill = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 128, + .width = 16, + .height = 16, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x16, + .subspriteTables = sOamTables_16x16, + .anims = sAnimTable_Standard, + .images = sPicTable_Azurill, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mom = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Mom, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkBrendan = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_BrendanMayNormal, + .images = sPicTable_BrendanNormal, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_BrendanMayNormal, + .images = sPicTable_MayNormal, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Juan, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Scott, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_MysteryEventDeliveryman, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_Statue, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_S, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Kirlia, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Dusclops = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Dusclops, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnionRoomAttendant = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_UnionRoomAttendant, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Red = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_RED_LEAF, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Red, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Leaf = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_RED_LEAF, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Leaf, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sudowoodo = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Sudowoodo, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mew = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Mew, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Deoxys = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_DEOXYS, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Deoxys, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirthIslandStone = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_BIRTH_ISLAND_STONE, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = TRUE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Inanimate, + .images = sPicTable_BirthIslandStone, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Anabel = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Anabel, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tucker = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Tucker, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Greta = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Greta, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Spenser = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 2, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Spenser, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Noland = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Noland, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lucy = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_4, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 5, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Lucy, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brandon = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_3, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 4, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Brandon, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrendan = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_RS_BRENDAN, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_RubySapphireBrendan, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_RS_MAY, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 256, + .width = 16, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_16x32, + .subspriteTables = sOamTables_16x32, + .anims = sAnimTable_Standard, + .images = sPicTable_RubySapphireMay, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_LUGIA, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_Standard, + .images = sPicTable_Lugia, + .affineAnims = gDummySpriteAffineAnimTable, +}; + +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh = { + .tileTag = TAG_NONE, + .paletteTag = OBJ_EVENT_PAL_TAG_HO_OH, + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, + .size = 512, + .width = 32, + .height = 32, + .paletteSlot = 10, + .shadowSize = SHADOW_SIZE_M, + .inanimate = FALSE, + .disableReflectionPaletteLoad = FALSE, + .tracks = TRACKS_FOOT, + .oam = &gObjectEventBaseOam_32x32, + .subspriteTables = sOamTables_32x32, + .anims = sAnimTable_HoOh, + .images = sPicTable_HoOh, + .affineAnims = gDummySpriteAffineAnimTable, +}; From 3fe423a6f44f2acfcfcd1be2c2a4322ff543668e Mon Sep 17 00:00:00 2001 From: garakmon Date: Mon, 4 Apr 2022 23:22:43 -0400 Subject: [PATCH 006/106] use json for region map sections - update nlohmann/json and pantor/inja in tools/ - create new inja template --- json_data_rules.mk | 6 + src/data/region_map/region_map_entries.h | 418 - src/data/region_map/region_map_sections.json | 1715 ++ .../region_map/region_map_sections.json.txt | 24 + tools/jsonproc/Makefile | 2 +- tools/jsonproc/inja.hpp | 5462 ++--- tools/jsonproc/jsonproc.cpp | 17 + tools/jsonproc/nlohmann/json.hpp | 19586 ++++++++-------- 8 files changed, 14642 insertions(+), 12588 deletions(-) delete mode 100644 src/data/region_map/region_map_entries.h create mode 100644 src/data/region_map/region_map_sections.json create mode 100644 src/data/region_map/region_map_sections.json.txt diff --git a/json_data_rules.mk b/json_data_rules.mk index 1de3c79f3..aa9e5b3a2 100755 --- a/json_data_rules.mk +++ b/json_data_rules.mk @@ -6,3 +6,9 @@ $(DATA_SRC_SUBDIR)/wild_encounters.h: $(DATA_SRC_SUBDIR)/wild_encounters.json $( $(JSONPROC) $^ $@ $(C_BUILDDIR)/wild_encounter.o: c_dep += $(DATA_SRC_SUBDIR)/wild_encounters.h + +AUTO_GEN_TARGETS += $(DATA_SRC_SUBDIR)/region_map/region_map_entries.h +$(DATA_SRC_SUBDIR)/region_map/region_map_entries.h: $(DATA_SRC_SUBDIR)/region_map/region_map_sections.json $(DATA_SRC_SUBDIR)/region_map/region_map_sections.json.txt + $(JSONPROC) $^ $@ + +$(C_BUILDDIR)/region_map.o: c_dep += $(DATA_SRC_SUBDIR)/region_map/region_map_entries.h diff --git a/src/data/region_map/region_map_entries.h b/src/data/region_map/region_map_entries.h deleted file mode 100644 index 6b433f90f..000000000 --- a/src/data/region_map/region_map_entries.h +++ /dev/null @@ -1,418 +0,0 @@ -#ifndef GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H -#define GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H - -static const u8 sMapName_LittlerootTown[] = _("LITTLEROOT TOWN"); -static const u8 sMapName_OldaleTown[] = _("OLDALE TOWN"); -static const u8 sMapName_DewfordTown[] = _("DEWFORD TOWN"); -static const u8 sMapName_LavaridgeTown[] = _("LAVARIDGE TOWN"); -static const u8 sMapName_FallarborTown[] = _("FALLARBOR TOWN"); -static const u8 sMapName_VerdanturfTown[] = _("VERDANTURF TOWN"); -static const u8 sMapName_PacifidlogTown[] = _("PACIFIDLOG TOWN"); -static const u8 sMapName_PetalburgCity[] = _("PETALBURG CITY"); -static const u8 sMapName_SlateportCity[] = _("SLATEPORT CITY"); -static const u8 sMapName_MauvilleCity[] = _("MAUVILLE CITY"); -static const u8 sMapName_RustboroCity[] = _("RUSTBORO CITY"); -static const u8 sMapName_FortreeCity[] = _("FORTREE CITY"); -static const u8 sMapName_LilycoveCity[] = _("LILYCOVE CITY"); -static const u8 sMapName_MossdeepCity[] = _("MOSSDEEP CITY"); -static const u8 sMapName_SootopolisCity[] = _("SOOTOPOLIS CITY"); -static const u8 sMapName_EverGrandeCity[] = _("EVER GRANDE CITY"); -static const u8 sMapName_Route101[] = _("ROUTE 101"); -static const u8 sMapName_Route102[] = _("ROUTE 102"); -static const u8 sMapName_Route103[] = _("ROUTE 103"); -static const u8 sMapName_Route104[] = _("ROUTE 104"); -static const u8 sMapName_Route105[] = _("ROUTE 105"); -static const u8 sMapName_Route106[] = _("ROUTE 106"); -static const u8 sMapName_Route107[] = _("ROUTE 107"); -static const u8 sMapName_Route108[] = _("ROUTE 108"); -static const u8 sMapName_Route109[] = _("ROUTE 109"); -static const u8 sMapName_Route110[] = _("ROUTE 110"); -static const u8 sMapName_Route111[] = _("ROUTE 111"); -static const u8 sMapName_Route112[] = _("ROUTE 112"); -static const u8 sMapName_Route113[] = _("ROUTE 113"); -static const u8 sMapName_Route114[] = _("ROUTE 114"); -static const u8 sMapName_Route115[] = _("ROUTE 115"); -static const u8 sMapName_Route116[] = _("ROUTE 116"); -static const u8 sMapName_Route117[] = _("ROUTE 117"); -static const u8 sMapName_Route118[] = _("ROUTE 118"); -static const u8 sMapName_Route119[] = _("ROUTE 119"); -static const u8 sMapName_Route120[] = _("ROUTE 120"); -static const u8 sMapName_Route121[] = _("ROUTE 121"); -static const u8 sMapName_Route122[] = _("ROUTE 122"); -static const u8 sMapName_Route123[] = _("ROUTE 123"); -static const u8 sMapName_Route124[] = _("ROUTE 124"); -static const u8 sMapName_Route125[] = _("ROUTE 125"); -static const u8 sMapName_Route126[] = _("ROUTE 126"); -static const u8 sMapName_Route127[] = _("ROUTE 127"); -static const u8 sMapName_Route128[] = _("ROUTE 128"); -static const u8 sMapName_Route129[] = _("ROUTE 129"); -static const u8 sMapName_Route130[] = _("ROUTE 130"); -static const u8 sMapName_Route131[] = _("ROUTE 131"); -static const u8 sMapName_Route132[] = _("ROUTE 132"); -static const u8 sMapName_Route133[] = _("ROUTE 133"); -static const u8 sMapName_Route134[] = _("ROUTE 134"); -static const u8 sMapName_Underwater[] = _("UNDERWATER"); -static const u8 sMapName_GraniteCave[] = _("GRANITE CAVE"); -static const u8 sMapName_MtChimney[] = _("MT. CHIMNEY"); -static const u8 sMapName_SafariZone[] = _("SAFARI ZONE"); -static const u8 sMapName_BattleFrontier[] = _("BATTLE FRONTIER"); -static const u8 sMapName_PetalburgWoods[] = _("PETALBURG WOODS"); -static const u8 sMapName_RusturfTunnel[] = _("RUSTURF TUNNEL"); -static const u8 sMapName_AbandonedShip[] = _("ABANDONED SHIP"); -static const u8 sMapName_NewMauville[] = _("NEW MAUVILLE"); -static const u8 sMapName_MeteorFalls[] = _("METEOR FALLS"); -static const u8 sMapName_MtPyre[] = _("MT. PYRE"); -static const u8 sMapName_AquaHideoutOld[] = _("{AQUA} HIDEOUT"); -static const u8 sMapName_ShoalCave[] = _("SHOAL CAVE"); -static const u8 sMapName_SeafloorCavern[] = _("SEAFLOOR CAVERN"); -static const u8 sMapName_VictoryRoad[] = _("VICTORY ROAD"); -static const u8 sMapName_MirageIsland[] = _("MIRAGE ISLAND"); -static const u8 sMapName_CaveOfOrigin[] = _("CAVE OF ORIGIN"); -static const u8 sMapName_SouthernIsland[] = _("SOUTHERN ISLAND"); -static const u8 sMapName_FieryPath[] = _("FIERY PATH"); -static const u8 sMapName_JaggedPass[] = _("JAGGED PASS"); -static const u8 sMapName_SealedChamber[] = _("SEALED CHAMBER"); -static const u8 sMapName_ScorchedSlab[] = _("SCORCHED SLAB"); -static const u8 sMapName_IslandCave[] = _("ISLAND CAVE"); -static const u8 sMapName_DesertRuins[] = _("DESERT RUINS"); -static const u8 sMapName_AncientTomb[] = _("ANCIENT TOMB"); -static const u8 sMapName_InsideOfTruck[] = _("INSIDE OF TRUCK"); -static const u8 sMapName_SkyPillar[] = _("SKY PILLAR"); -static const u8 sMapName_SecretBase[] = _("SECRET BASE"); -static const u8 sMapName_None[] = _(""); -static const u8 sMapName_PalletTown[] = _("PALLET TOWN"); -static const u8 sMapName_ViridianCity[] = _("VIRIDIAN CITY"); -static const u8 sMapName_PewterCity[] = _("PEWTER CITY"); -static const u8 sMapName_CeruleanCity[] = _("CERULEAN CITY"); -static const u8 sMapName_LavenderTown[] = _("LAVENDER TOWN"); -static const u8 sMapName_VermilionCity[] = _("VERMILION CITY"); -static const u8 sMapName_CeladonCity[] = _("CELADON CITY"); -static const u8 sMapName_FuchsiaCity[] = _("FUCHSIA CITY"); -static const u8 sMapName_CinnabarIsland[] = _("CINNABAR ISLAND"); -static const u8 sMapName_IndigoPlateau[] = _("INDIGO PLATEAU"); -static const u8 sMapName_SaffronCity[] = _("SAFFRON CITY"); -static const u8 sMapName_Route4[] = _("ROUTE 4"); -static const u8 sMapName_Route10[] = _("ROUTE 10"); -static const u8 sMapName_Route1[] = _("ROUTE 1"); -static const u8 sMapName_Route2[] = _("ROUTE 2"); -static const u8 sMapName_Route3[] = _("ROUTE 3"); -static const u8 sMapName_Route4_2[] = _("ROUTE 4"); -static const u8 sMapName_Route5[] = _("ROUTE 5"); -static const u8 sMapName_Route6[] = _("ROUTE 6"); -static const u8 sMapName_Route7[] = _("ROUTE 7"); -static const u8 sMapName_Route8[] = _("ROUTE 8"); -static const u8 sMapName_Route9[] = _("ROUTE 9"); -static const u8 sMapName_Route10_2[] = _("ROUTE 10"); -static const u8 sMapName_Route11[] = _("ROUTE 11"); -static const u8 sMapName_Route12[] = _("ROUTE 12"); -static const u8 sMapName_Route13[] = _("ROUTE 13"); -static const u8 sMapName_Route14[] = _("ROUTE 14"); -static const u8 sMapName_Route15[] = _("ROUTE 15"); -static const u8 sMapName_Route16[] = _("ROUTE 16"); -static const u8 sMapName_Route17[] = _("ROUTE 17"); -static const u8 sMapName_Route18[] = _("ROUTE 18"); -static const u8 sMapName_Route19[] = _("ROUTE 19"); -static const u8 sMapName_Route20[] = _("ROUTE 20"); -static const u8 sMapName_Route21[] = _("ROUTE 21"); -static const u8 sMapName_Route22[] = _("ROUTE 22"); -static const u8 sMapName_Route23[] = _("ROUTE 23"); -static const u8 sMapName_Route24[] = _("ROUTE 24"); -static const u8 sMapName_Route25[] = _("ROUTE 25"); -static const u8 sMapName_ViridianForest[] = _("VIRIDIAN FOREST"); -static const u8 sMapName_MtMoon[] = _("MT. MOON"); -static const u8 sMapName_SSAnne[] = _("S.S. ANNE"); -static const u8 sMapName_UndergroundPath[] = _("UNDERGROUND PATH"); -static const u8 sMapName_UndergroundPath2[] = _("UNDERGROUND PATH"); -static const u8 sMapName_DiglettsCave[] = _("DIGLETT'S CAVE"); -static const u8 sMapName_KantoVictoryRoad[] = _("VICTORY ROAD"); -static const u8 sMapName_RocketHideout[] = _("ROCKET HIDEOUT"); -static const u8 sMapName_SilphCo[] = _("SILPH CO."); -static const u8 sMapName_PokemonMansion[] = _("POKéMON MANSION"); -static const u8 sMapName_KantoSafariZone[] = _("SAFARI ZONE"); -static const u8 sMapName_PokemonLeague[] = _("POKéMON LEAGUE"); -static const u8 sMapName_RockTunnel[] = _("ROCK TUNNEL"); -static const u8 sMapName_SeafoamIslands[] = _("SEAFOAM ISLANDS"); -static const u8 sMapName_PokemonTower[] = _("POKéMON TOWER"); -static const u8 sMapName_CeruleanCave[] = _("CERULEAN CAVE"); -static const u8 sMapName_PowerPlant[] = _("POWER PLANT"); -static const u8 sMapName_OneIsland[] = _("ONE ISLAND"); -static const u8 sMapName_TwoIsland[] = _("TWO ISLAND"); -static const u8 sMapName_ThreeIsland[] = _("THREE ISLAND"); -static const u8 sMapName_FourIsland[] = _("FOUR ISLAND"); -static const u8 sMapName_FiveIsland[] = _("FIVE ISLAND"); -static const u8 sMapName_SevenIsland[] = _("SEVEN ISLAND"); -static const u8 sMapName_SixIsland[] = _("SIX ISLAND"); -static const u8 sMapName_KindleRoad[] = _("KINDLE ROAD"); -static const u8 sMapName_TreasureBeach[] = _("TREASURE BEACH"); -static const u8 sMapName_CapeBrink[] = _("CAPE BRINK"); -static const u8 sMapName_BondBridge[] = _("BOND BRIDGE"); -static const u8 sMapName_ThreeIslePort[] = _("THREE ISLE PORT"); -static const u8 sMapName_SeviiIsle6[] = _("SEVII ISLE 6"); -static const u8 sMapName_SeviiIsle7[] = _("SEVII ISLE 7"); -static const u8 sMapName_SeviiIsle8[] = _("SEVII ISLE 8"); -static const u8 sMapName_SeviiIsle9[] = _("SEVII ISLE 9"); -static const u8 sMapName_ResortGorgeous[] = _("RESORT GORGEOUS"); -static const u8 sMapName_WaterLabyrinth[] = _("WATER LABYRINTH"); -static const u8 sMapName_FiveIsleMeadow[] = _("FIVE ISLE MEADOW"); -static const u8 sMapName_MemorialPillar[] = _("MEMORIAL PILLAR"); -static const u8 sMapName_OutcastIsland[] = _("OUTCAST ISLAND"); -static const u8 sMapName_GreenPath[] = _("GREEN PATH"); -static const u8 sMapName_WaterPath[] = _("WATER PATH"); -static const u8 sMapName_RuinValley[] = _("RUIN VALLEY"); -static const u8 sMapName_TrainerTower[] = _("TRAINER TOWER"); -static const u8 sMapName_CanyonEntrance[] = _("CANYON ENTRANCE"); -static const u8 sMapName_SevaultCanyon[] = _("SEVAULT CANYON"); -static const u8 sMapName_TanobyRuins[] = _("TANOBY RUINS"); -static const u8 sMapName_SeviiIsle22[] = _("SEVII ISLE 22"); -static const u8 sMapName_SeviiIsle23[] = _("SEVII ISLE 23"); -static const u8 sMapName_SeviiIsle24[] = _("SEVII ISLE 24"); -static const u8 sMapName_NavelRock[] = _("NAVEL ROCK"); -static const u8 sMapName_MtEmber[] = _("MT. EMBER"); -static const u8 sMapName_BerryForest[] = _("BERRY FOREST"); -static const u8 sMapName_IcefallCave[] = _("ICEFALL CAVE"); -static const u8 sMapName_RocketWarehouse[] = _("ROCKET WAREHOUSE"); -static const u8 sMapName_TrainerTower2[] = _("TRAINER TOWER"); -static const u8 sMapName_DottedHole[] = _("DOTTED HOLE"); -static const u8 sMapName_LostCave[] = _("LOST CAVE"); -static const u8 sMapName_PatternBush[] = _("PATTERN BUSH"); -static const u8 sMapName_AlteringCave[] = _("ALTERING CAVE"); -static const u8 sMapName_TanobyChambers[] = _("TANOBY CHAMBERS"); -static const u8 sMapName_ThreeIslePath[] = _("THREE ISLE PATH"); -static const u8 sMapName_TanobyKey[] = _("TANOBY KEY"); -static const u8 sMapName_BirthIsland[] = _("BIRTH ISLAND"); -static const u8 sMapName_MoneanChamber[] = _("MONEAN CHAMBER"); -static const u8 sMapName_LiptooChamber[] = _("LIPTOO CHAMBER"); -static const u8 sMapName_WeepthChamber[] = _("WEEPTH CHAMBER"); -static const u8 sMapName_DilfordChamber[] = _("DILFORD CHAMBER"); -static const u8 sMapName_ScufibChamber[] = _("SCUFIB CHAMBER"); -static const u8 sMapName_RixyChamber[] = _("RIXY CHAMBER"); -static const u8 sMapName_ViapoisChamber[] = _("VIAPOIS CHAMBER"); -static const u8 sMapName_EmberSpa[] = _("EMBER SPA"); -static const u8 sMapName_SpecialArea[] = _("SPECIAL AREA"); -static const u8 sMapName_AquaHideout[] = _("AQUA HIDEOUT"); -static const u8 sMapName_MagmaHideout[] = _("MAGMA HIDEOUT"); -static const u8 sMapName_MirageTower[] = _("MIRAGE TOWER"); -static const u8 sMapName_FarawayIsland[] = _("FARAWAY ISLAND"); -static const u8 sMapName_ArtisanCave[] = _("ARTISAN CAVE"); -static const u8 sMapName_MarineCave[] = _("MARINE CAVE"); -static const u8 sMapName_TerraCave[] = _("TERRA CAVE"); -static const u8 sMapName_DesertUnderpass[] = _("DESERT UNDERPASS"); -static const u8 sMapName_TrainerHill[] = _("TRAINER HILL"); - -const struct RegionMapLocation gRegionMapEntries[] = { - [MAPSEC_LITTLEROOT_TOWN] = { 4, 11, 1, 1, sMapName_LittlerootTown}, - [MAPSEC_OLDALE_TOWN] = { 4, 9, 1, 1, sMapName_OldaleTown}, - [MAPSEC_DEWFORD_TOWN] = { 2, 14, 1, 1, sMapName_DewfordTown}, - [MAPSEC_LAVARIDGE_TOWN] = { 5, 3, 1, 1, sMapName_LavaridgeTown}, - [MAPSEC_FALLARBOR_TOWN] = { 3, 0, 1, 1, sMapName_FallarborTown}, - [MAPSEC_VERDANTURF_TOWN] = { 4, 6, 1, 1, sMapName_VerdanturfTown}, - [MAPSEC_PACIFIDLOG_TOWN] = {17, 10, 1, 1, sMapName_PacifidlogTown}, - [MAPSEC_PETALBURG_CITY] = { 1, 9, 1, 1, sMapName_PetalburgCity}, - [MAPSEC_SLATEPORT_CITY] = { 8, 10, 1, 2, sMapName_SlateportCity}, - [MAPSEC_MAUVILLE_CITY] = { 8, 6, 2, 1, sMapName_MauvilleCity}, - [MAPSEC_RUSTBORO_CITY] = { 0, 5, 1, 2, sMapName_RustboroCity}, - [MAPSEC_FORTREE_CITY] = {12, 0, 1, 1, sMapName_FortreeCity}, - [MAPSEC_LILYCOVE_CITY] = {18, 3, 2, 1, sMapName_LilycoveCity}, - [MAPSEC_MOSSDEEP_CITY] = {24, 5, 2, 1, sMapName_MossdeepCity}, - [MAPSEC_SOOTOPOLIS_CITY] = {21, 7, 1, 1, sMapName_SootopolisCity}, - [MAPSEC_EVER_GRANDE_CITY] = {27, 8, 1, 2, sMapName_EverGrandeCity}, - [MAPSEC_ROUTE_101] = { 4, 10, 1, 1, sMapName_Route101}, - [MAPSEC_ROUTE_102] = { 2, 9, 2, 1, sMapName_Route102}, - [MAPSEC_ROUTE_103] = { 4, 8, 4, 1, sMapName_Route103}, - [MAPSEC_ROUTE_104] = { 0, 7, 1, 3, sMapName_Route104}, - [MAPSEC_ROUTE_105] = { 0, 10, 1, 3, sMapName_Route105}, - [MAPSEC_ROUTE_106] = { 0, 13, 2, 1, sMapName_Route106}, - [MAPSEC_ROUTE_107] = { 3, 14, 3, 1, sMapName_Route107}, - [MAPSEC_ROUTE_108] = { 6, 14, 2, 1, sMapName_Route108}, - [MAPSEC_ROUTE_109] = { 8, 12, 1, 3, sMapName_Route109}, - [MAPSEC_ROUTE_110] = { 8, 7, 1, 3, sMapName_Route110}, - [MAPSEC_ROUTE_111] = { 8, 0, 1, 6, sMapName_Route111}, - [MAPSEC_ROUTE_112] = { 6, 3, 2, 1, sMapName_Route112}, - [MAPSEC_ROUTE_113] = { 4, 0, 4, 1, sMapName_Route113}, - [MAPSEC_ROUTE_114] = { 1, 0, 2, 3, sMapName_Route114}, - [MAPSEC_ROUTE_115] = { 0, 2, 1, 3, sMapName_Route115}, - [MAPSEC_ROUTE_116] = { 1, 5, 4, 1, sMapName_Route116}, - [MAPSEC_ROUTE_117] = { 5, 6, 3, 1, sMapName_Route117}, - [MAPSEC_ROUTE_118] = {10, 6, 2, 1, sMapName_Route118}, - [MAPSEC_ROUTE_119] = {11, 0, 1, 6, sMapName_Route119}, - [MAPSEC_ROUTE_120] = {13, 0, 1, 4, sMapName_Route120}, - [MAPSEC_ROUTE_121] = {14, 3, 4, 1, sMapName_Route121}, - [MAPSEC_ROUTE_122] = {16, 4, 1, 2, sMapName_Route122}, - [MAPSEC_ROUTE_123] = {12, 6, 5, 1, sMapName_Route123}, - [MAPSEC_ROUTE_124] = {20, 3, 4, 3, sMapName_Route124}, - [MAPSEC_ROUTE_125] = {24, 3, 2, 2, sMapName_Route125}, - [MAPSEC_ROUTE_126] = {20, 6, 3, 3, sMapName_Route126}, - [MAPSEC_ROUTE_127] = {23, 6, 3, 3, sMapName_Route127}, - [MAPSEC_ROUTE_128] = {23, 9, 4, 1, sMapName_Route128}, - [MAPSEC_ROUTE_129] = {24, 10, 2, 1, sMapName_Route129}, - [MAPSEC_ROUTE_130] = {21, 10, 3, 1, sMapName_Route130}, - [MAPSEC_ROUTE_131] = {18, 10, 3, 1, sMapName_Route131}, - [MAPSEC_ROUTE_132] = {15, 10, 2, 1, sMapName_Route132}, - [MAPSEC_ROUTE_133] = {12, 10, 3, 1, sMapName_Route133}, - [MAPSEC_ROUTE_134] = { 9, 10, 3, 1, sMapName_Route134}, - [MAPSEC_UNDERWATER_124] = {20, 3, 4, 3, sMapName_Underwater}, - [MAPSEC_UNDERWATER_126] = {20, 6, 3, 3, sMapName_Underwater}, - [MAPSEC_UNDERWATER_127] = {23, 6, 3, 3, sMapName_Underwater}, - [MAPSEC_UNDERWATER_128] = {23, 9, 4, 1, sMapName_Underwater}, - [MAPSEC_UNDERWATER_SOOTOPOLIS] = {21, 7, 1, 1, sMapName_Underwater}, - [MAPSEC_GRANITE_CAVE] = { 1, 13, 1, 1, sMapName_GraniteCave}, - [MAPSEC_MT_CHIMNEY] = { 6, 2, 1, 1, sMapName_MtChimney}, - [MAPSEC_SAFARI_ZONE] = {16, 2, 1, 1, sMapName_SafariZone}, - [MAPSEC_BATTLE_FRONTIER] = {22, 12, 1, 1, sMapName_BattleFrontier}, - [MAPSEC_PETALBURG_WOODS] = { 0, 8, 1, 1, sMapName_PetalburgWoods}, - [MAPSEC_RUSTURF_TUNNEL] = { 2, 5, 1, 1, sMapName_RusturfTunnel}, - [MAPSEC_ABANDONED_SHIP] = { 6, 14, 1, 1, sMapName_AbandonedShip}, - [MAPSEC_NEW_MAUVILLE] = { 8, 7, 1, 1, sMapName_NewMauville}, - [MAPSEC_METEOR_FALLS] = { 0, 3, 1, 1, sMapName_MeteorFalls}, - [MAPSEC_METEOR_FALLS2] = { 1, 2, 1, 1, sMapName_MeteorFalls}, - [MAPSEC_MT_PYRE] = {16, 4, 1, 1, sMapName_MtPyre}, - [MAPSEC_AQUA_HIDEOUT_OLD] = {19, 3, 1, 1, sMapName_AquaHideoutOld}, - [MAPSEC_SHOAL_CAVE] = {24, 4, 1, 1, sMapName_ShoalCave}, - [MAPSEC_SEAFLOOR_CAVERN] = {24, 9, 1, 1, sMapName_SeafloorCavern}, - [MAPSEC_UNDERWATER_SEAFLOOR_CAVERN] = {24, 9, 1, 1, sMapName_Underwater}, - [MAPSEC_VICTORY_ROAD] = {27, 9, 1, 1, sMapName_VictoryRoad}, - [MAPSEC_MIRAGE_ISLAND] = {17, 10, 1, 1, sMapName_MirageIsland}, - [MAPSEC_CAVE_OF_ORIGIN] = {21, 7, 1, 1, sMapName_CaveOfOrigin}, - [MAPSEC_SOUTHERN_ISLAND] = {12, 14, 1, 1, sMapName_SouthernIsland}, - [MAPSEC_FIERY_PATH] = { 6, 3, 1, 1, sMapName_FieryPath}, - [MAPSEC_FIERY_PATH2] = { 7, 3, 1, 1, sMapName_FieryPath}, - [MAPSEC_JAGGED_PASS] = { 6, 3, 1, 1, sMapName_JaggedPass}, - [MAPSEC_JAGGED_PASS2] = { 7, 2, 1, 1, sMapName_JaggedPass}, - [MAPSEC_SEALED_CHAMBER] = {11, 10, 1, 1, sMapName_SealedChamber}, - [MAPSEC_UNDERWATER_SEALED_CHAMBER] = {11, 10, 1, 1, sMapName_Underwater}, - [MAPSEC_SCORCHED_SLAB] = {13, 0, 1, 1, sMapName_ScorchedSlab}, - [MAPSEC_ISLAND_CAVE] = { 0, 10, 1, 1, sMapName_IslandCave}, - [MAPSEC_DESERT_RUINS] = { 8, 3, 1, 1, sMapName_DesertRuins}, - [MAPSEC_ANCIENT_TOMB] = {13, 2, 1, 1, sMapName_AncientTomb}, - [MAPSEC_INSIDE_OF_TRUCK] = { 0, 0, 1, 1, sMapName_InsideOfTruck}, - [MAPSEC_SKY_PILLAR] = {19, 10, 1, 1, sMapName_SkyPillar}, - [MAPSEC_SECRET_BASE] = { 0, 0, 1, 1, sMapName_SecretBase}, - [MAPSEC_DYNAMIC] = { 0, 0, 1, 1, sMapName_None}, - [MAPSEC_PALLET_TOWN] = { 0, 0, 1, 1, sMapName_PalletTown}, - [MAPSEC_VIRIDIAN_CITY] = { 0, 0, 1, 1, sMapName_ViridianCity}, - [MAPSEC_PEWTER_CITY] = { 0, 0, 1, 1, sMapName_PewterCity}, - [MAPSEC_CERULEAN_CITY] = { 0, 0, 1, 1, sMapName_CeruleanCity}, - [MAPSEC_LAVENDER_TOWN] = { 0, 0, 1, 1, sMapName_LavenderTown}, - [MAPSEC_VERMILION_CITY] = { 0, 0, 1, 1, sMapName_VermilionCity}, - [MAPSEC_CELADON_CITY] = { 0, 0, 1, 1, sMapName_CeladonCity}, - [MAPSEC_FUCHSIA_CITY] = { 0, 0, 1, 1, sMapName_FuchsiaCity}, - [MAPSEC_CINNABAR_ISLAND] = { 0, 0, 1, 1, sMapName_CinnabarIsland}, - [MAPSEC_INDIGO_PLATEAU] = { 0, 0, 1, 1, sMapName_IndigoPlateau}, - [MAPSEC_SAFFRON_CITY] = { 0, 0, 1, 1, sMapName_SaffronCity}, - [MAPSEC_ROUTE_4_FLYDUP] = { 0, 0, 1, 1, sMapName_Route4}, - [MAPSEC_ROUTE_10_FLYDUP] = { 0, 0, 1, 1, sMapName_Route10}, - [MAPSEC_ROUTE_1] = { 0, 0, 1, 1, sMapName_Route1}, - [MAPSEC_ROUTE_2] = { 0, 0, 1, 1, sMapName_Route2}, - [MAPSEC_ROUTE_3] = { 0, 0, 1, 1, sMapName_Route3}, - [MAPSEC_ROUTE_4] = { 0, 0, 1, 1, sMapName_Route4_2}, - [MAPSEC_ROUTE_5] = { 0, 0, 1, 1, sMapName_Route5}, - [MAPSEC_ROUTE_6] = { 0, 0, 1, 1, sMapName_Route6}, - [MAPSEC_ROUTE_7] = { 0, 0, 1, 1, sMapName_Route7}, - [MAPSEC_ROUTE_8] = { 0, 0, 1, 1, sMapName_Route8}, - [MAPSEC_ROUTE_9] = { 0, 0, 1, 1, sMapName_Route9}, - [MAPSEC_ROUTE_10] = { 0, 0, 1, 1, sMapName_Route10_2}, - [MAPSEC_ROUTE_11] = { 0, 0, 1, 1, sMapName_Route11}, - [MAPSEC_ROUTE_12] = { 0, 0, 1, 1, sMapName_Route12}, - [MAPSEC_ROUTE_13] = { 0, 0, 1, 1, sMapName_Route13}, - [MAPSEC_ROUTE_14] = { 0, 0, 1, 1, sMapName_Route14}, - [MAPSEC_ROUTE_15] = { 0, 0, 1, 1, sMapName_Route15}, - [MAPSEC_ROUTE_16] = { 0, 0, 1, 1, sMapName_Route16}, - [MAPSEC_ROUTE_17] = { 0, 0, 1, 1, sMapName_Route17}, - [MAPSEC_ROUTE_18] = { 0, 0, 1, 1, sMapName_Route18}, - [MAPSEC_ROUTE_19] = { 0, 0, 1, 1, sMapName_Route19}, - [MAPSEC_ROUTE_20] = { 0, 0, 1, 1, sMapName_Route20}, - [MAPSEC_ROUTE_21] = { 0, 0, 1, 1, sMapName_Route21}, - [MAPSEC_ROUTE_22] = { 0, 0, 1, 1, sMapName_Route22}, - [MAPSEC_ROUTE_23] = { 0, 0, 1, 1, sMapName_Route23}, - [MAPSEC_ROUTE_24] = { 0, 0, 1, 1, sMapName_Route24}, - [MAPSEC_ROUTE_25] = { 0, 0, 1, 1, sMapName_Route25}, - [MAPSEC_VIRIDIAN_FOREST] = { 0, 0, 1, 1, sMapName_ViridianForest}, - [MAPSEC_MT_MOON] = { 0, 0, 1, 1, sMapName_MtMoon}, - [MAPSEC_S_S_ANNE] = { 0, 0, 1, 1, sMapName_SSAnne}, - [MAPSEC_UNDERGROUND_PATH] = { 0, 0, 1, 1, sMapName_UndergroundPath}, - [MAPSEC_UNDERGROUND_PATH_2] = { 0, 0, 1, 1, sMapName_UndergroundPath2}, - [MAPSEC_DIGLETTS_CAVE] = { 0, 0, 1, 1, sMapName_DiglettsCave}, - [MAPSEC_KANTO_VICTORY_ROAD] = { 0, 0, 1, 1, sMapName_KantoVictoryRoad}, - [MAPSEC_ROCKET_HIDEOUT] = { 0, 0, 1, 1, sMapName_RocketHideout}, - [MAPSEC_SILPH_CO] = { 0, 0, 1, 1, sMapName_SilphCo}, - [MAPSEC_POKEMON_MANSION] = { 0, 0, 1, 1, sMapName_PokemonMansion}, - [MAPSEC_KANTO_SAFARI_ZONE] = { 0, 0, 1, 1, sMapName_KantoSafariZone}, - [MAPSEC_POKEMON_LEAGUE] = { 0, 0, 1, 1, sMapName_PokemonLeague}, - [MAPSEC_ROCK_TUNNEL] = { 0, 0, 1, 1, sMapName_RockTunnel}, - [MAPSEC_SEAFOAM_ISLANDS] = { 0, 0, 1, 1, sMapName_SeafoamIslands}, - [MAPSEC_POKEMON_TOWER] = { 0, 0, 1, 1, sMapName_PokemonTower}, - [MAPSEC_CERULEAN_CAVE] = { 0, 0, 1, 1, sMapName_CeruleanCave}, - [MAPSEC_POWER_PLANT] = { 0, 0, 1, 1, sMapName_PowerPlant}, - [MAPSEC_ONE_ISLAND] = { 0, 0, 1, 1, sMapName_OneIsland}, - [MAPSEC_TWO_ISLAND] = { 0, 0, 1, 1, sMapName_TwoIsland}, - [MAPSEC_THREE_ISLAND] = { 0, 0, 1, 1, sMapName_ThreeIsland}, - [MAPSEC_FOUR_ISLAND] = { 0, 0, 1, 1, sMapName_FourIsland}, - [MAPSEC_FIVE_ISLAND] = { 0, 0, 1, 1, sMapName_FiveIsland}, - [MAPSEC_SEVEN_ISLAND] = { 0, 0, 1, 1, sMapName_SevenIsland}, - [MAPSEC_SIX_ISLAND] = { 0, 0, 1, 1, sMapName_SixIsland}, - [MAPSEC_KINDLE_ROAD] = { 0, 0, 1, 1, sMapName_KindleRoad}, - [MAPSEC_TREASURE_BEACH] = { 0, 0, 1, 1, sMapName_TreasureBeach}, - [MAPSEC_CAPE_BRINK] = { 0, 0, 1, 1, sMapName_CapeBrink}, - [MAPSEC_BOND_BRIDGE] = { 0, 0, 1, 1, sMapName_BondBridge}, - [MAPSEC_THREE_ISLE_PORT] = { 0, 0, 1, 1, sMapName_ThreeIslePort}, - [MAPSEC_SEVII_ISLE_6] = { 0, 0, 1, 1, sMapName_SeviiIsle6}, - [MAPSEC_SEVII_ISLE_7] = { 0, 0, 1, 1, sMapName_SeviiIsle7}, - [MAPSEC_SEVII_ISLE_8] = { 0, 0, 1, 1, sMapName_SeviiIsle8}, - [MAPSEC_SEVII_ISLE_9] = { 0, 0, 1, 1, sMapName_SeviiIsle9}, - [MAPSEC_RESORT_GORGEOUS] = { 0, 0, 1, 1, sMapName_ResortGorgeous}, - [MAPSEC_WATER_LABYRINTH] = { 0, 0, 1, 1, sMapName_WaterLabyrinth}, - [MAPSEC_FIVE_ISLE_MEADOW] = { 0, 0, 1, 1, sMapName_FiveIsleMeadow}, - [MAPSEC_MEMORIAL_PILLAR] = { 0, 0, 1, 1, sMapName_MemorialPillar}, - [MAPSEC_OUTCAST_ISLAND] = { 0, 0, 1, 1, sMapName_OutcastIsland}, - [MAPSEC_GREEN_PATH] = { 0, 0, 1, 1, sMapName_GreenPath}, - [MAPSEC_WATER_PATH] = { 0, 0, 1, 1, sMapName_WaterPath}, - [MAPSEC_RUIN_VALLEY] = { 0, 0, 1, 1, sMapName_RuinValley}, - [MAPSEC_TRAINER_TOWER] = { 0, 0, 1, 1, sMapName_TrainerTower}, - [MAPSEC_CANYON_ENTRANCE] = { 0, 0, 1, 1, sMapName_CanyonEntrance}, - [MAPSEC_SEVAULT_CANYON] = { 0, 0, 1, 1, sMapName_SevaultCanyon}, - [MAPSEC_TANOBY_RUINS] = { 0, 0, 1, 1, sMapName_TanobyRuins}, - [MAPSEC_SEVII_ISLE_22] = { 0, 0, 1, 1, sMapName_SeviiIsle22}, - [MAPSEC_SEVII_ISLE_23] = { 0, 0, 1, 1, sMapName_SeviiIsle23}, - [MAPSEC_SEVII_ISLE_24] = { 0, 0, 1, 1, sMapName_SeviiIsle24}, - [MAPSEC_NAVEL_ROCK_FRLG] = { 0, 0, 1, 1, sMapName_NavelRock}, - [MAPSEC_MT_EMBER] = { 0, 0, 1, 1, sMapName_MtEmber}, - [MAPSEC_BERRY_FOREST] = { 0, 0, 1, 1, sMapName_BerryForest}, - [MAPSEC_ICEFALL_CAVE] = { 0, 0, 1, 1, sMapName_IcefallCave}, - [MAPSEC_ROCKET_WAREHOUSE] = { 0, 0, 1, 1, sMapName_RocketWarehouse}, - [MAPSEC_TRAINER_TOWER_2] = { 0, 0, 1, 1, sMapName_TrainerTower2}, - [MAPSEC_DOTTED_HOLE] = { 0, 0, 1, 1, sMapName_DottedHole}, - [MAPSEC_LOST_CAVE] = { 0, 0, 1, 1, sMapName_LostCave}, - [MAPSEC_PATTERN_BUSH] = { 0, 0, 1, 1, sMapName_PatternBush}, - [MAPSEC_ALTERING_CAVE_FRLG] = { 0, 0, 1, 1, sMapName_AlteringCave}, - [MAPSEC_TANOBY_CHAMBERS] = { 0, 0, 1, 1, sMapName_TanobyChambers}, - [MAPSEC_THREE_ISLE_PATH] = { 0, 0, 1, 1, sMapName_ThreeIslePath}, - [MAPSEC_TANOBY_KEY] = { 0, 0, 1, 1, sMapName_TanobyKey}, - [MAPSEC_BIRTH_ISLAND_FRLG] = { 0, 0, 1, 1, sMapName_BirthIsland}, - [MAPSEC_MONEAN_CHAMBER] = { 0, 0, 1, 1, sMapName_MoneanChamber}, - [MAPSEC_LIPTOO_CHAMBER] = { 0, 0, 1, 1, sMapName_LiptooChamber}, - [MAPSEC_WEEPTH_CHAMBER] = { 0, 0, 1, 1, sMapName_WeepthChamber}, - [MAPSEC_DILFORD_CHAMBER] = { 0, 0, 1, 1, sMapName_DilfordChamber}, - [MAPSEC_SCUFIB_CHAMBER] = { 0, 0, 1, 1, sMapName_ScufibChamber}, - [MAPSEC_RIXY_CHAMBER] = { 0, 0, 1, 1, sMapName_RixyChamber}, - [MAPSEC_VIAPOIS_CHAMBER] = { 0, 0, 1, 1, sMapName_ViapoisChamber}, - [MAPSEC_EMBER_SPA] = { 0, 0, 1, 1, sMapName_EmberSpa}, - [MAPSEC_SPECIAL_AREA] = { 0, 0, 1, 1, sMapName_SpecialArea}, - [MAPSEC_AQUA_HIDEOUT] = {19, 3, 1, 1, sMapName_AquaHideout}, - [MAPSEC_MAGMA_HIDEOUT] = { 6, 3, 1, 1, sMapName_MagmaHideout}, - [MAPSEC_MIRAGE_TOWER] = { 8, 2, 1, 1, sMapName_MirageTower}, - [MAPSEC_BIRTH_ISLAND] = { 0, 0, 1, 1, sMapName_BirthIsland}, - [MAPSEC_FARAWAY_ISLAND] = { 0, 0, 1, 1, sMapName_FarawayIsland}, - [MAPSEC_ARTISAN_CAVE] = {22, 12, 1, 1, sMapName_ArtisanCave}, - [MAPSEC_MARINE_CAVE] = { 0, 0, 1, 1, sMapName_MarineCave}, - [MAPSEC_UNDERWATER_MARINE_CAVE] = { 0, 0, 1, 1, sMapName_Underwater}, - [MAPSEC_TERRA_CAVE] = { 0, 0, 1, 1, sMapName_TerraCave}, - [MAPSEC_UNDERWATER_105] = { 0, 10, 1, 3, sMapName_Underwater}, - [MAPSEC_UNDERWATER_125] = {24, 3, 2, 2, sMapName_Underwater}, - [MAPSEC_UNDERWATER_129] = {24, 10, 2, 1, sMapName_Underwater}, - [MAPSEC_DESERT_UNDERPASS] = { 2, 0, 1, 1, sMapName_DesertUnderpass}, - [MAPSEC_ALTERING_CAVE] = { 6, 8, 1, 1, sMapName_AlteringCave}, - [MAPSEC_NAVEL_ROCK] = { 0, 0, 1, 1, sMapName_NavelRock}, - [MAPSEC_TRAINER_HILL] = { 8, 4, 1, 1, sMapName_TrainerHill} -}; - -#endif //GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H diff --git a/src/data/region_map/region_map_sections.json b/src/data/region_map/region_map_sections.json new file mode 100644 index 000000000..888f0fe73 --- /dev/null +++ b/src/data/region_map/region_map_sections.json @@ -0,0 +1,1715 @@ +{ + "map_sections": [ + { + "map_section": "MAPSEC_LITTLEROOT_TOWN", + "name": "LITTLEROOT TOWN", + "x": 4, + "y": 11, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_OLDALE_TOWN", + "name": "OLDALE TOWN", + "x": 4, + "y": 9, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_DEWFORD_TOWN", + "name": "DEWFORD TOWN", + "x": 2, + "y": 14, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_LAVARIDGE_TOWN", + "name": "LAVARIDGE TOWN", + "x": 5, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_FALLARBOR_TOWN", + "name": "FALLARBOR TOWN", + "x": 3, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_VERDANTURF_TOWN", + "name": "VERDANTURF TOWN", + "x": 4, + "y": 6, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_PACIFIDLOG_TOWN", + "name": "PACIFIDLOG TOWN", + "x": 17, + "y": 10, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_PETALBURG_CITY", + "name": "PETALBURG CITY", + "x": 1, + "y": 9, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SLATEPORT_CITY", + "name": "SLATEPORT CITY", + "x": 8, + "y": 10, + "width": 1, + "height": 2 + }, + { + "map_section": "MAPSEC_MAUVILLE_CITY", + "name": "MAUVILLE CITY", + "x": 8, + "y": 6, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_RUSTBORO_CITY", + "name": "RUSTBORO CITY", + "x": 0, + "y": 5, + "width": 1, + "height": 2 + }, + { + "map_section": "MAPSEC_FORTREE_CITY", + "name": "FORTREE CITY", + "x": 12, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_LILYCOVE_CITY", + "name": "LILYCOVE CITY", + "x": 18, + "y": 3, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_MOSSDEEP_CITY", + "name": "MOSSDEEP CITY", + "x": 24, + "y": 5, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_SOOTOPOLIS_CITY", + "name": "SOOTOPOLIS CITY", + "x": 21, + "y": 7, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_EVER_GRANDE_CITY", + "name": "EVER GRANDE CITY", + "x": 27, + "y": 8, + "width": 1, + "height": 2 + }, + { + "map_section": "MAPSEC_ROUTE_101", + "name": "ROUTE 101", + "x": 4, + "y": 10, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_102", + "name": "ROUTE 102", + "x": 2, + "y": 9, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_103", + "name": "ROUTE 103", + "x": 4, + "y": 8, + "width": 4, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_104", + "name": "ROUTE 104", + "x": 0, + "y": 7, + "width": 1, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_105", + "name": "ROUTE 105", + "x": 0, + "y": 10, + "width": 1, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_106", + "name": "ROUTE 106", + "x": 0, + "y": 13, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_107", + "name": "ROUTE 107", + "x": 3, + "y": 14, + "width": 3, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_108", + "name": "ROUTE 108", + "x": 6, + "y": 14, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_109", + "name": "ROUTE 109", + "x": 8, + "y": 12, + "width": 1, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_110", + "name": "ROUTE 110", + "x": 8, + "y": 7, + "width": 1, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_111", + "name": "ROUTE 111", + "x": 8, + "y": 0, + "width": 1, + "height": 6 + }, + { + "map_section": "MAPSEC_ROUTE_112", + "name": "ROUTE 112", + "x": 6, + "y": 3, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_113", + "name": "ROUTE 113", + "x": 4, + "y": 0, + "width": 4, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_114", + "name": "ROUTE 114", + "x": 1, + "y": 0, + "width": 2, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_115", + "name": "ROUTE 115", + "x": 0, + "y": 2, + "width": 1, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_116", + "name": "ROUTE 116", + "x": 1, + "y": 5, + "width": 4, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_117", + "name": "ROUTE 117", + "x": 5, + "y": 6, + "width": 3, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_118", + "name": "ROUTE 118", + "x": 10, + "y": 6, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_119", + "name": "ROUTE 119", + "x": 11, + "y": 0, + "width": 1, + "height": 6 + }, + { + "map_section": "MAPSEC_ROUTE_120", + "name": "ROUTE 120", + "x": 13, + "y": 0, + "width": 1, + "height": 4 + }, + { + "map_section": "MAPSEC_ROUTE_121", + "name": "ROUTE 121", + "x": 14, + "y": 3, + "width": 4, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_122", + "name": "ROUTE 122", + "x": 16, + "y": 4, + "width": 1, + "height": 2 + }, + { + "map_section": "MAPSEC_ROUTE_123", + "name": "ROUTE 123", + "x": 12, + "y": 6, + "width": 5, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_124", + "name": "ROUTE 124", + "x": 20, + "y": 3, + "width": 4, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_125", + "name": "ROUTE 125", + "x": 24, + "y": 3, + "width": 2, + "height": 2 + }, + { + "map_section": "MAPSEC_ROUTE_126", + "name": "ROUTE 126", + "x": 20, + "y": 6, + "width": 3, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_127", + "name": "ROUTE 127", + "x": 23, + "y": 6, + "width": 3, + "height": 3 + }, + { + "map_section": "MAPSEC_ROUTE_128", + "name": "ROUTE 128", + "x": 23, + "y": 9, + "width": 4, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_129", + "name": "ROUTE 129", + "x": 24, + "y": 10, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_130", + "name": "ROUTE 130", + "x": 21, + "y": 10, + "width": 3, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_131", + "name": "ROUTE 131", + "x": 18, + "y": 10, + "width": 3, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_132", + "name": "ROUTE 132", + "x": 15, + "y": 10, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_133", + "name": "ROUTE 133", + "x": 12, + "y": 10, + "width": 3, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_134", + "name": "ROUTE 134", + "x": 9, + "y": 10, + "width": 3, + "height": 1 + }, + { + "map_section": "MAPSEC_UNDERWATER_124", + "name": "UNDERWATER", + "x": 20, + "y": 3, + "width": 4, + "height": 3 + }, + { + "map_section": "MAPSEC_UNDERWATER_126", + "name": "UNDERWATER", + "x": 20, + "y": 6, + "width": 3, + "height": 3 + }, + { + "map_section": "MAPSEC_UNDERWATER_127", + "name": "UNDERWATER", + "x": 23, + "y": 6, + "width": 3, + "height": 3 + }, + { + "map_section": "MAPSEC_UNDERWATER_128", + "name": "UNDERWATER", + "x": 23, + "y": 9, + "width": 4, + "height": 1 + }, + { + "map_section": "MAPSEC_UNDERWATER_SOOTOPOLIS", + "name": "UNDERWATER", + "x": 21, + "y": 7, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_GRANITE_CAVE", + "name": "GRANITE CAVE", + "x": 1, + "y": 13, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MT_CHIMNEY", + "name": "MT. CHIMNEY", + "x": 6, + "y": 2, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SAFARI_ZONE", + "name": "SAFARI ZONE", + "x": 16, + "y": 2, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_BATTLE_FRONTIER", + "name": "BATTLE FRONTIER", + "x": 22, + "y": 12, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_PETALBURG_WOODS", + "name": "PETALBURG WOODS", + "x": 0, + "y": 8, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_RUSTURF_TUNNEL", + "name": "RUSTURF TUNNEL", + "x": 2, + "y": 5, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ABANDONED_SHIP", + "name": "ABANDONED SHIP", + "x": 6, + "y": 14, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_NEW_MAUVILLE", + "name": "NEW MAUVILLE", + "x": 8, + "y": 7, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_METEOR_FALLS", + "name": "METEOR FALLS", + "x": 0, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_METEOR_FALLS2", + "name": "METEOR FALLS", + "x": 1, + "y": 2, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MT_PYRE", + "name": "MT. PYRE", + "x": 16, + "y": 4, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_AQUA_HIDEOUT_OLD", + "name": "{AQUA} HIDEOUT", + "name_clone": true, + "x": 19, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SHOAL_CAVE", + "name": "SHOAL CAVE", + "x": 24, + "y": 4, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEAFLOOR_CAVERN", + "name": "SEAFLOOR CAVERN", + "x": 24, + "y": 9, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_UNDERWATER_SEAFLOOR_CAVERN", + "name": "UNDERWATER", + "x": 24, + "y": 9, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_VICTORY_ROAD", + "name": "VICTORY ROAD", + "x": 27, + "y": 9, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MIRAGE_ISLAND", + "name": "MIRAGE ISLAND", + "x": 17, + "y": 10, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_CAVE_OF_ORIGIN", + "name": "CAVE OF ORIGIN", + "x": 21, + "y": 7, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SOUTHERN_ISLAND", + "name": "SOUTHERN ISLAND", + "x": 12, + "y": 14, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_FIERY_PATH", + "name": "FIERY PATH", + "x": 6, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_FIERY_PATH2", + "name": "FIERY PATH", + "x": 7, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_JAGGED_PASS", + "name": "JAGGED PASS", + "x": 6, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_JAGGED_PASS2", + "name": "JAGGED PASS", + "x": 7, + "y": 2, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEALED_CHAMBER", + "name": "SEALED CHAMBER", + "x": 11, + "y": 10, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_UNDERWATER_SEALED_CHAMBER", + "name": "UNDERWATER", + "x": 11, + "y": 10, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SCORCHED_SLAB", + "name": "SCORCHED SLAB", + "x": 13, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ISLAND_CAVE", + "name": "ISLAND CAVE", + "x": 0, + "y": 10, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_DESERT_RUINS", + "name": "DESERT RUINS", + "x": 8, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ANCIENT_TOMB", + "name": "ANCIENT TOMB", + "x": 13, + "y": 2, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_INSIDE_OF_TRUCK", + "name": "INSIDE OF TRUCK", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SKY_PILLAR", + "name": "SKY PILLAR", + "x": 19, + "y": 10, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SECRET_BASE", + "name": "SECRET BASE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_DYNAMIC", + "name": "", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_PALLET_TOWN", + "name": "PALLET TOWN", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_VIRIDIAN_CITY", + "name": "VIRIDIAN CITY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_PEWTER_CITY", + "name": "PEWTER CITY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_CERULEAN_CITY", + "name": "CERULEAN CITY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_LAVENDER_TOWN", + "name": "LAVENDER TOWN", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_VERMILION_CITY", + "name": "VERMILION CITY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_CELADON_CITY", + "name": "CELADON CITY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_FUCHSIA_CITY", + "name": "FUCHSIA CITY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_CINNABAR_ISLAND", + "name": "CINNABAR ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_INDIGO_PLATEAU", + "name": "INDIGO PLATEAU", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SAFFRON_CITY", + "name": "SAFFRON CITY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_4_FLYDUP", + "name": "ROUTE 4", + "name_clone": true, + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_10_FLYDUP", + "name": "ROUTE 10", + "name_clone": true, + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_1", + "name": "ROUTE 1", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_2", + "name": "ROUTE 2", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_3", + "name": "ROUTE 3", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_4", + "name": "ROUTE 4", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_5", + "name": "ROUTE 5", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_6", + "name": "ROUTE 6", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_7", + "name": "ROUTE 7", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_8", + "name": "ROUTE 8", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_9", + "name": "ROUTE 9", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_10", + "name": "ROUTE 10", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_11", + "name": "ROUTE 11", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_12", + "name": "ROUTE 12", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_13", + "name": "ROUTE 13", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_14", + "name": "ROUTE 14", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_15", + "name": "ROUTE 15", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_16", + "name": "ROUTE 16", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_17", + "name": "ROUTE 17", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_18", + "name": "ROUTE 18", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_19", + "name": "ROUTE 19", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_20", + "name": "ROUTE 20", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_21", + "name": "ROUTE 21", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_22", + "name": "ROUTE 22", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_23", + "name": "ROUTE 23", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_24", + "name": "ROUTE 24", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROUTE_25", + "name": "ROUTE 25", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_VIRIDIAN_FOREST", + "name": "VIRIDIAN FOREST", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MT_MOON", + "name": "MT. MOON", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_S_S_ANNE", + "name": "S.S. ANNE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_UNDERGROUND_PATH", + "name": "UNDERGROUND PATH", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_UNDERGROUND_PATH_2", + "name": "UNDERGROUND PATH", + "name_clone": true, + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_DIGLETTS_CAVE", + "name": "DIGLETT'S CAVE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_KANTO_VICTORY_ROAD", + "name": "VICTORY ROAD", + "name_clone": true, + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROCKET_HIDEOUT", + "name": "ROCKET HIDEOUT", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SILPH_CO", + "name": "SILPH CO.", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_POKEMON_MANSION", + "name": "POKéMON MANSION", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_KANTO_SAFARI_ZONE", + "name": "SAFARI ZONE", + "name_clone": true, + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_POKEMON_LEAGUE", + "name": "POKéMON LEAGUE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROCK_TUNNEL", + "name": "ROCK TUNNEL", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEAFOAM_ISLANDS", + "name": "SEAFOAM ISLANDS", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_POKEMON_TOWER", + "name": "POKéMON TOWER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_CERULEAN_CAVE", + "name": "CERULEAN CAVE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_POWER_PLANT", + "name": "POWER PLANT", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ONE_ISLAND", + "name": "ONE ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TWO_ISLAND", + "name": "TWO ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_THREE_ISLAND", + "name": "THREE ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_FOUR_ISLAND", + "name": "FOUR ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_FIVE_ISLAND", + "name": "FIVE ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVEN_ISLAND", + "name": "SEVEN ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SIX_ISLAND", + "name": "SIX ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_KINDLE_ROAD", + "name": "KINDLE ROAD", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TREASURE_BEACH", + "name": "TREASURE BEACH", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_CAPE_BRINK", + "name": "CAPE BRINK", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_BOND_BRIDGE", + "name": "BOND BRIDGE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_THREE_ISLE_PORT", + "name": "THREE ISLE PORT", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVII_ISLE_6", + "name": "SEVII ISLE 6", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVII_ISLE_7", + "name": "SEVII ISLE 7", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVII_ISLE_8", + "name": "SEVII ISLE 8", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVII_ISLE_9", + "name": "SEVII ISLE 9", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_RESORT_GORGEOUS", + "name": "RESORT GORGEOUS", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_WATER_LABYRINTH", + "name": "WATER LABYRINTH", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_FIVE_ISLE_MEADOW", + "name": "FIVE ISLE MEADOW", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MEMORIAL_PILLAR", + "name": "MEMORIAL PILLAR", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_OUTCAST_ISLAND", + "name": "OUTCAST ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_GREEN_PATH", + "name": "GREEN PATH", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_WATER_PATH", + "name": "WATER PATH", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_RUIN_VALLEY", + "name": "RUIN VALLEY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TRAINER_TOWER", + "name": "TRAINER TOWER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_CANYON_ENTRANCE", + "name": "CANYON ENTRANCE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVAULT_CANYON", + "name": "SEVAULT CANYON", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TANOBY_RUINS", + "name": "TANOBY RUINS", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVII_ISLE_22", + "name": "SEVII ISLE 22", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVII_ISLE_23", + "name": "SEVII ISLE 23", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SEVII_ISLE_24", + "name": "SEVII ISLE 24", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_NAVEL_ROCK_FRLG", + "name": "NAVEL ROCK", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MT_EMBER", + "name": "MT. EMBER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_BERRY_FOREST", + "name": "BERRY FOREST", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ICEFALL_CAVE", + "name": "ICEFALL CAVE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ROCKET_WAREHOUSE", + "name": "ROCKET WAREHOUSE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TRAINER_TOWER_2", + "name": "TRAINER TOWER", + "name_clone": true, + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_DOTTED_HOLE", + "name": "DOTTED HOLE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_LOST_CAVE", + "name": "LOST CAVE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_PATTERN_BUSH", + "name": "PATTERN BUSH", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ALTERING_CAVE_FRLG", + "name": "ALTERING CAVE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TANOBY_CHAMBERS", + "name": "TANOBY CHAMBERS", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_THREE_ISLE_PATH", + "name": "THREE ISLE PATH", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TANOBY_KEY", + "name": "TANOBY KEY", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_BIRTH_ISLAND_FRLG", + "name": "BIRTH ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MONEAN_CHAMBER", + "name": "MONEAN CHAMBER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_LIPTOO_CHAMBER", + "name": "LIPTOO CHAMBER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_WEEPTH_CHAMBER", + "name": "WEEPTH CHAMBER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_DILFORD_CHAMBER", + "name": "DILFORD CHAMBER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SCUFIB_CHAMBER", + "name": "SCUFIB CHAMBER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_RIXY_CHAMBER", + "name": "RIXY CHAMBER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_VIAPOIS_CHAMBER", + "name": "VIAPOIS CHAMBER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_EMBER_SPA", + "name": "EMBER SPA", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_SPECIAL_AREA", + "name": "SPECIAL AREA", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_AQUA_HIDEOUT", + "name": "AQUA HIDEOUT", + "x": 19, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MAGMA_HIDEOUT", + "name": "MAGMA HIDEOUT", + "x": 6, + "y": 3, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MIRAGE_TOWER", + "name": "MIRAGE TOWER", + "x": 8, + "y": 2, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_BIRTH_ISLAND", + "name": "BIRTH ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_FARAWAY_ISLAND", + "name": "FARAWAY ISLAND", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ARTISAN_CAVE", + "name": "ARTISAN CAVE", + "x": 22, + "y": 12, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_MARINE_CAVE", + "name": "MARINE CAVE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_UNDERWATER_MARINE_CAVE", + "name": "UNDERWATER", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TERRA_CAVE", + "name": "TERRA CAVE", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_UNDERWATER_105", + "name": "UNDERWATER", + "x": 0, + "y": 10, + "width": 1, + "height": 3 + }, + { + "map_section": "MAPSEC_UNDERWATER_125", + "name": "UNDERWATER", + "x": 24, + "y": 3, + "width": 2, + "height": 2 + }, + { + "map_section": "MAPSEC_UNDERWATER_129", + "name": "UNDERWATER", + "x": 24, + "y": 10, + "width": 2, + "height": 1 + }, + { + "map_section": "MAPSEC_DESERT_UNDERPASS", + "name": "DESERT UNDERPASS", + "x": 2, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_ALTERING_CAVE", + "name": "ALTERING CAVE", + "x": 6, + "y": 8, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_NAVEL_ROCK", + "name": "NAVEL ROCK", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + { + "map_section": "MAPSEC_TRAINER_HILL", + "name": "TRAINER HILL", + "x": 8, + "y": 4, + "width": 1, + "height": 1 + } + ] +} \ No newline at end of file diff --git a/src/data/region_map/region_map_sections.json.txt b/src/data/region_map/region_map_sections.json.txt new file mode 100644 index 000000000..e9c372cb5 --- /dev/null +++ b/src/data/region_map/region_map_sections.json.txt @@ -0,0 +1,24 @@ +{{ doNotModifyHeader }} +#ifndef GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H +#define GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H + +## for map_section in map_sections +{% if isEmptyString(getVar(map_section.name)) and not existsIn(map_section, "name_clone") %}{{ setVar(map_section.name, map_section.map_section) }}{% endif %} +## endfor + +## for map_section in map_sections +{% if getVar(map_section.name) == map_section.map_section %} +static const u8 sMapName_{{ cleanString(map_section.name) }}[] = _("{{ map_section.name }}"); +{% endif %} +{% if existsIn(map_section, "name_clone") %} +static const u8 sMapName_{{ cleanString(map_section.name) }}_Clone[] = _("{{ map_section.name }}"); +{% endif %} +## endfor + +const struct RegionMapLocation gRegionMapEntries[] = { +## for map_section in map_sections + [{{ map_section.map_section }}] = { {{ map_section.x }}, {{ map_section.y }}, {{ map_section.width }}, {{ map_section.height }}, sMapName_{{ cleanString(map_section.name) }}{% if existsIn(map_section, "name_clone") %}_Clone{% endif %} }, +## endfor +}; + +#endif // GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H diff --git a/tools/jsonproc/Makefile b/tools/jsonproc/Makefile index eec73eb7b..653d58567 100755 --- a/tools/jsonproc/Makefile +++ b/tools/jsonproc/Makefile @@ -1,6 +1,6 @@ CXX ?= g++ -CXXFLAGS := -Wall -std=c++11 -O2 +CXXFLAGS := -Wall -std=c++17 -O2 INCLUDES := -I . diff --git a/tools/jsonproc/inja.hpp b/tools/jsonproc/inja.hpp index d5bf5bcba..5b469745f 100755 --- a/tools/jsonproc/inja.hpp +++ b/tools/jsonproc/inja.hpp @@ -1,1427 +1,841 @@ -// MIT License +/* + ___ _ Version 3.3 + |_ _|_ __ (_) __ _ https://github.com/pantor/inja + | || '_ \ | |/ _` | Licensed under the MIT License . + | || | | || | (_| | + |___|_| |_|/ |\__,_| Copyright (c) 2018-2021 Lars Berscheid + |__/ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ -// Copyright (c) 2018 lbersch +#ifndef INCLUDE_INJA_INJA_HPP_ +#define INCLUDE_INJA_INJA_HPP_ -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: +#include -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. +namespace inja { +#ifndef INJA_DATA_TYPE +using json = nlohmann::json; +#else +using json = INJA_DATA_TYPE; +#endif +} // namespace inja -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(INJA_NOEXCEPTION) +#ifndef INJA_THROW +#define INJA_THROW(exception) throw exception +#endif +#else +#include +#ifndef INJA_THROW +#define INJA_THROW(exception) \ + std::abort(); \ + std::ignore = exception +#endif +#ifndef INJA_NOEXCEPTION +#define INJA_NOEXCEPTION +#endif +#endif +// #include "environment.hpp" +#ifndef INCLUDE_INJA_ENVIRONMENT_HPP_ +#define INCLUDE_INJA_ENVIRONMENT_HPP_ -// --- - - -// Copyright (c) 2009-2018 FIRST -// All rights reserved. - -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// * Neither the name of the FIRST nor the -// names of its contributors may be used to endorse or promote products -// derived from this software without specific prior written permission. - -// THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef PANTOR_INJA_HPP -#define PANTOR_INJA_HPP - -#include +#include #include -#include #include #include #include +#include + +// #include "config.hpp" +#ifndef INCLUDE_INJA_CONFIG_HPP_ +#define INCLUDE_INJA_CONFIG_HPP_ + +#include +#include + +// #include "template.hpp" +#ifndef INCLUDE_INJA_TEMPLATE_HPP_ +#define INCLUDE_INJA_TEMPLATE_HPP_ + +#include +#include +#include #include -#include +// #include "node.hpp" +#ifndef INCLUDE_INJA_NODE_HPP_ +#define INCLUDE_INJA_NODE_HPP_ -// #include "environment.hpp" -#ifndef PANTOR_INJA_ENVIRONMENT_HPP -#define PANTOR_INJA_ENVIRONMENT_HPP - -#include -#include -#include #include +#include +#include -#include - -// #include "config.hpp" -#ifndef PANTOR_INJA_CONFIG_HPP -#define PANTOR_INJA_CONFIG_HPP - -#include -#include - -// #include "string_view.hpp" -// Copyright 2017-2019 by Martin Moene -// -// string-view lite, a C++17-like string_view for C++98 and later. -// For more information see https://github.com/martinmoene/string-view-lite -// -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - - - -#ifndef NONSTD_SV_LITE_H_INCLUDED -#define NONSTD_SV_LITE_H_INCLUDED - -#define string_view_lite_MAJOR 1 -#define string_view_lite_MINOR 1 -#define string_view_lite_PATCH 0 - -#define string_view_lite_VERSION nssv_STRINGIFY(string_view_lite_MAJOR) "." nssv_STRINGIFY(string_view_lite_MINOR) "." nssv_STRINGIFY(string_view_lite_PATCH) - -#define nssv_STRINGIFY( x ) nssv_STRINGIFY_( x ) -#define nssv_STRINGIFY_( x ) #x - -// string-view lite configuration: - -#define nssv_STRING_VIEW_DEFAULT 0 -#define nssv_STRING_VIEW_NONSTD 1 -#define nssv_STRING_VIEW_STD 2 - -#if !defined( nssv_CONFIG_SELECT_STRING_VIEW ) -# define nssv_CONFIG_SELECT_STRING_VIEW ( nssv_HAVE_STD_STRING_VIEW ? nssv_STRING_VIEW_STD : nssv_STRING_VIEW_NONSTD ) -#endif - -#if defined( nssv_CONFIG_SELECT_STD_STRING_VIEW ) || defined( nssv_CONFIG_SELECT_NONSTD_STRING_VIEW ) -# error nssv_CONFIG_SELECT_STD_STRING_VIEW and nssv_CONFIG_SELECT_NONSTD_STRING_VIEW are deprecated and removed, please use nssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_... -#endif - -#ifndef nssv_CONFIG_STD_SV_OPERATOR -# define nssv_CONFIG_STD_SV_OPERATOR 0 -#endif - -#ifndef nssv_CONFIG_USR_SV_OPERATOR -# define nssv_CONFIG_USR_SV_OPERATOR 1 -#endif - -#ifdef nssv_CONFIG_CONVERSION_STD_STRING -# define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS nssv_CONFIG_CONVERSION_STD_STRING -# define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS nssv_CONFIG_CONVERSION_STD_STRING -#endif - -#ifndef nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS -# define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS 1 -#endif - -#ifndef nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS -# define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS 1 -#endif - -// Control presence of exception handling (try and auto discover): - -#ifndef nssv_CONFIG_NO_EXCEPTIONS -# if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND) -# define nssv_CONFIG_NO_EXCEPTIONS 0 -# else -# define nssv_CONFIG_NO_EXCEPTIONS 1 -# endif -#endif - -// C++ language version detection (C++20 is speculative): -// Note: VC14.0/1900 (VS2015) lacks too much from C++14. - -#ifndef nssv_CPLUSPLUS -# if defined(_MSVC_LANG ) && !defined(__clang__) -# define nssv_CPLUSPLUS (_MSC_VER == 1900 ? 201103L : _MSVC_LANG ) -# else -# define nssv_CPLUSPLUS __cplusplus -# endif -#endif - -#define nssv_CPP98_OR_GREATER ( nssv_CPLUSPLUS >= 199711L ) -#define nssv_CPP11_OR_GREATER ( nssv_CPLUSPLUS >= 201103L ) -#define nssv_CPP11_OR_GREATER_ ( nssv_CPLUSPLUS >= 201103L ) -#define nssv_CPP14_OR_GREATER ( nssv_CPLUSPLUS >= 201402L ) -#define nssv_CPP17_OR_GREATER ( nssv_CPLUSPLUS >= 201703L ) -#define nssv_CPP20_OR_GREATER ( nssv_CPLUSPLUS >= 202000L ) - -// use C++17 std::string_view if available and requested: - -#if nssv_CPP17_OR_GREATER && defined(__has_include ) -# if __has_include( ) -# define nssv_HAVE_STD_STRING_VIEW 1 -# else -# define nssv_HAVE_STD_STRING_VIEW 0 -# endif -#else -# define nssv_HAVE_STD_STRING_VIEW 0 -#endif - -#define nssv_USES_STD_STRING_VIEW ( (nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_STD) || ((nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_DEFAULT) && nssv_HAVE_STD_STRING_VIEW) ) - -#define nssv_HAVE_STARTS_WITH ( nssv_CPP20_OR_GREATER || !nssv_USES_STD_STRING_VIEW ) -#define nssv_HAVE_ENDS_WITH nssv_HAVE_STARTS_WITH - -// -// Use C++17 std::string_view: -// - -#if nssv_USES_STD_STRING_VIEW +// #include "function_storage.hpp" +#ifndef INCLUDE_INJA_FUNCTION_STORAGE_HPP_ +#define INCLUDE_INJA_FUNCTION_STORAGE_HPP_ #include +#include -// Extensions for std::string: +namespace inja { -#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS +using Arguments = std::vector; +using CallbackFunction = std::function; +using VoidCallbackFunction = std::function; -namespace nonstd { +/*! + * \brief Class for builtin functions and user-defined callbacks. + */ +class FunctionStorage { +public: + enum class Operation { + Not, + And, + Or, + In, + Equal, + NotEqual, + Greater, + GreaterEqual, + Less, + LessEqual, + Add, + Subtract, + Multiplication, + Division, + Power, + Modulo, + AtId, + At, + Default, + DivisibleBy, + Even, + Exists, + ExistsInObject, + First, + Float, + Int, + IsArray, + IsBoolean, + IsFloat, + IsInteger, + IsNumber, + IsObject, + IsString, + Last, + Length, + Lower, + Max, + Min, + Odd, + Range, + Round, + Sort, + Upper, + Super, + Join, + Callback, + ParenLeft, + ParenRight, + None, + }; -template< class CharT, class Traits, class Allocator = std::allocator > -std::basic_string -to_string( std::basic_string_view v, Allocator const & a = Allocator() ) -{ - return std::basic_string( v.begin(), v.end(), a ); -} + struct FunctionData { + explicit FunctionData(const Operation& op, const CallbackFunction& cb = CallbackFunction {}): operation(op), callback(cb) {} + const Operation operation; + const CallbackFunction callback; + }; -template< class CharT, class Traits, class Allocator > -std::basic_string_view -to_string_view( std::basic_string const & s ) -{ - return std::basic_string_view( s.data(), s.size() ); -} +private: + const int VARIADIC {-1}; -// Literal operators sv and _sv: + std::map, FunctionData> function_storage = { + {std::make_pair("at", 2), FunctionData {Operation::At}}, + {std::make_pair("default", 2), FunctionData {Operation::Default}}, + {std::make_pair("divisibleBy", 2), FunctionData {Operation::DivisibleBy}}, + {std::make_pair("even", 1), FunctionData {Operation::Even}}, + {std::make_pair("exists", 1), FunctionData {Operation::Exists}}, + {std::make_pair("existsIn", 2), FunctionData {Operation::ExistsInObject}}, + {std::make_pair("first", 1), FunctionData {Operation::First}}, + {std::make_pair("float", 1), FunctionData {Operation::Float}}, + {std::make_pair("int", 1), FunctionData {Operation::Int}}, + {std::make_pair("isArray", 1), FunctionData {Operation::IsArray}}, + {std::make_pair("isBoolean", 1), FunctionData {Operation::IsBoolean}}, + {std::make_pair("isFloat", 1), FunctionData {Operation::IsFloat}}, + {std::make_pair("isInteger", 1), FunctionData {Operation::IsInteger}}, + {std::make_pair("isNumber", 1), FunctionData {Operation::IsNumber}}, + {std::make_pair("isObject", 1), FunctionData {Operation::IsObject}}, + {std::make_pair("isString", 1), FunctionData {Operation::IsString}}, + {std::make_pair("last", 1), FunctionData {Operation::Last}}, + {std::make_pair("length", 1), FunctionData {Operation::Length}}, + {std::make_pair("lower", 1), FunctionData {Operation::Lower}}, + {std::make_pair("max", 1), FunctionData {Operation::Max}}, + {std::make_pair("min", 1), FunctionData {Operation::Min}}, + {std::make_pair("odd", 1), FunctionData {Operation::Odd}}, + {std::make_pair("range", 1), FunctionData {Operation::Range}}, + {std::make_pair("round", 2), FunctionData {Operation::Round}}, + {std::make_pair("sort", 1), FunctionData {Operation::Sort}}, + {std::make_pair("upper", 1), FunctionData {Operation::Upper}}, + {std::make_pair("super", 0), FunctionData {Operation::Super}}, + {std::make_pair("super", 1), FunctionData {Operation::Super}}, + {std::make_pair("join", 2), FunctionData {Operation::Join}}, + }; -#if nssv_CONFIG_STD_SV_OPERATOR +public: + void add_builtin(std::string_view name, int num_args, Operation op) { + function_storage.emplace(std::make_pair(static_cast(name), num_args), FunctionData {op}); + } -using namespace std::literals::string_view_literals; + void add_callback(std::string_view name, int num_args, const CallbackFunction& callback) { + function_storage.emplace(std::make_pair(static_cast(name), num_args), FunctionData {Operation::Callback, callback}); + } -#endif + FunctionData find_function(std::string_view name, int num_args) const { + auto it = function_storage.find(std::make_pair(static_cast(name), num_args)); + if (it != function_storage.end()) { + return it->second; -#if nssv_CONFIG_USR_SV_OPERATOR + // Find variadic function + } else if (num_args > 0) { + it = function_storage.find(std::make_pair(static_cast(name), VARIADIC)); + if (it != function_storage.end()) { + return it->second; + } + } -inline namespace literals { -inline namespace string_view_literals { + return FunctionData {Operation::None}; + } +}; +} // namespace inja -constexpr std::string_view operator "" _sv( const char* str, size_t len ) noexcept // (1) -{ - return std::string_view{ str, len }; -} +#endif // INCLUDE_INJA_FUNCTION_STORAGE_HPP_ -constexpr std::u16string_view operator "" _sv( const char16_t* str, size_t len ) noexcept // (2) -{ - return std::u16string_view{ str, len }; -} - -constexpr std::u32string_view operator "" _sv( const char32_t* str, size_t len ) noexcept // (3) -{ - return std::u32string_view{ str, len }; -} - -constexpr std::wstring_view operator "" _sv( const wchar_t* str, size_t len ) noexcept // (4) -{ - return std::wstring_view{ str, len }; -} - -}} // namespace literals::string_view_literals - -#endif // nssv_CONFIG_USR_SV_OPERATOR - -} // namespace nonstd - -#endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS - -namespace nonstd { - -using std::string_view; -using std::wstring_view; -using std::u16string_view; -using std::u32string_view; -using std::basic_string_view; - -// literal "sv" and "_sv", see above - -using std::operator==; -using std::operator!=; -using std::operator<; -using std::operator<=; -using std::operator>; -using std::operator>=; - -using std::operator<<; - -} // namespace nonstd - -#else // nssv_HAVE_STD_STRING_VIEW - -// -// Before C++17: use string_view lite: -// - -// Compiler versions: -// -// MSVC++ 6.0 _MSC_VER == 1200 (Visual Studio 6.0) -// MSVC++ 7.0 _MSC_VER == 1300 (Visual Studio .NET 2002) -// MSVC++ 7.1 _MSC_VER == 1310 (Visual Studio .NET 2003) -// MSVC++ 8.0 _MSC_VER == 1400 (Visual Studio 2005) -// MSVC++ 9.0 _MSC_VER == 1500 (Visual Studio 2008) -// MSVC++ 10.0 _MSC_VER == 1600 (Visual Studio 2010) -// MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012) -// MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013) -// MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015) -// MSVC++ 14.1 _MSC_VER >= 1910 (Visual Studio 2017) - -#if defined(_MSC_VER ) && !defined(__clang__) -# define nssv_COMPILER_MSVC_VER (_MSC_VER ) -# define nssv_COMPILER_MSVC_VERSION (_MSC_VER / 10 - 10 * ( 5 + (_MSC_VER < 1900 ) ) ) -#else -# define nssv_COMPILER_MSVC_VER 0 -# define nssv_COMPILER_MSVC_VERSION 0 -#endif - -#define nssv_COMPILER_VERSION( major, minor, patch ) (10 * ( 10 * major + minor) + patch) - -#if defined(__clang__) -# define nssv_COMPILER_CLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__) -#else -# define nssv_COMPILER_CLANG_VERSION 0 -#endif - -#if defined(__GNUC__) && !defined(__clang__) -# define nssv_COMPILER_GNUC_VERSION nssv_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) -#else -# define nssv_COMPILER_GNUC_VERSION 0 -#endif - -// half-open range [lo..hi): -#define nssv_BETWEEN( v, lo, hi ) ( (lo) <= (v) && (v) < (hi) ) - -// Presence of language and library features: - -#ifdef _HAS_CPP0X -# define nssv_HAS_CPP0X _HAS_CPP0X -#else -# define nssv_HAS_CPP0X 0 -#endif - -// Unless defined otherwise below, consider VC14 as C++11 for variant-lite: - -#if nssv_COMPILER_MSVC_VER >= 1900 -# undef nssv_CPP11_OR_GREATER -# define nssv_CPP11_OR_GREATER 1 -#endif - -#define nssv_CPP11_90 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1500) -#define nssv_CPP11_100 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1600) -#define nssv_CPP11_110 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1700) -#define nssv_CPP11_120 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1800) -#define nssv_CPP11_140 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1900) -#define nssv_CPP11_141 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1910) - -#define nssv_CPP14_000 (nssv_CPP14_OR_GREATER) -#define nssv_CPP17_000 (nssv_CPP17_OR_GREATER) - -// Presence of C++11 language features: - -#define nssv_HAVE_CONSTEXPR_11 nssv_CPP11_140 -#define nssv_HAVE_EXPLICIT_CONVERSION nssv_CPP11_140 -#define nssv_HAVE_INLINE_NAMESPACE nssv_CPP11_140 -#define nssv_HAVE_NOEXCEPT nssv_CPP11_140 -#define nssv_HAVE_NULLPTR nssv_CPP11_100 -#define nssv_HAVE_REF_QUALIFIER nssv_CPP11_140 -#define nssv_HAVE_UNICODE_LITERALS nssv_CPP11_140 -#define nssv_HAVE_USER_DEFINED_LITERALS nssv_CPP11_140 -#define nssv_HAVE_WCHAR16_T nssv_CPP11_100 -#define nssv_HAVE_WCHAR32_T nssv_CPP11_100 - -#if ! ( ( nssv_CPP11 && nssv_COMPILER_CLANG_VERSION ) || nssv_BETWEEN( nssv_COMPILER_CLANG_VERSION, 300, 400 ) ) -# define nssv_HAVE_STD_DEFINED_LITERALS nssv_CPP11_140 -#endif - -// Presence of C++14 language features: - -#define nssv_HAVE_CONSTEXPR_14 nssv_CPP14_000 - -// Presence of C++17 language features: - -#define nssv_HAVE_NODISCARD nssv_CPP17_000 - -// Presence of C++ library features: - -#define nssv_HAVE_STD_HASH nssv_CPP11_120 - -// C++ feature usage: - -#if nssv_HAVE_CONSTEXPR_11 -# define nssv_constexpr constexpr -#else -# define nssv_constexpr /*constexpr*/ -#endif - -#if nssv_HAVE_CONSTEXPR_14 -# define nssv_constexpr14 constexpr -#else -# define nssv_constexpr14 /*constexpr*/ -#endif - -#if nssv_HAVE_EXPLICIT_CONVERSION -# define nssv_explicit explicit -#else -# define nssv_explicit /*explicit*/ -#endif - -#if nssv_HAVE_INLINE_NAMESPACE -# define nssv_inline_ns inline -#else -# define nssv_inline_ns /*inline*/ -#endif - -#if nssv_HAVE_NOEXCEPT -# define nssv_noexcept noexcept -#else -# define nssv_noexcept /*noexcept*/ -#endif - -//#if nssv_HAVE_REF_QUALIFIER -//# define nssv_ref_qual & -//# define nssv_refref_qual && -//#else -//# define nssv_ref_qual /*&*/ -//# define nssv_refref_qual /*&&*/ -//#endif - -#if nssv_HAVE_NULLPTR -# define nssv_nullptr nullptr -#else -# define nssv_nullptr NULL -#endif - -#if nssv_HAVE_NODISCARD -# define nssv_nodiscard [[nodiscard]] -#else -# define nssv_nodiscard /*[[nodiscard]]*/ -#endif - -// Additional includes: +// #include "utils.hpp" +#ifndef INCLUDE_INJA_UTILS_HPP_ +#define INCLUDE_INJA_UTILS_HPP_ #include -#include -#include -#include -#include -#include // std::char_traits<> +#include +#include +#include +#include -#if ! nssv_CONFIG_NO_EXCEPTIONS -# include -#endif +// #include "exceptions.hpp" +#ifndef INCLUDE_INJA_EXCEPTIONS_HPP_ +#define INCLUDE_INJA_EXCEPTIONS_HPP_ -#if nssv_CPP11_OR_GREATER -# include -#endif +#include +#include -// Clang, GNUC, MSVC warning suppression macros: +namespace inja { -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wreserved-user-defined-literal" -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wuser-defined-literals" -#elif defined(__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wliteral-suffix" -#endif // __clang__ - -#if nssv_COMPILER_MSVC_VERSION >= 140 -# define nssv_SUPPRESS_MSGSL_WARNING(expr) [[gsl::suppress(expr)]] -# define nssv_SUPPRESS_MSVC_WARNING(code, descr) __pragma(warning(suppress: code) ) -# define nssv_DISABLE_MSVC_WARNINGS(codes) __pragma(warning(push)) __pragma(warning(disable: codes)) -#else -# define nssv_SUPPRESS_MSGSL_WARNING(expr) -# define nssv_SUPPRESS_MSVC_WARNING(code, descr) -# define nssv_DISABLE_MSVC_WARNINGS(codes) -#endif - -#if defined(__clang__) -# define nssv_RESTORE_WARNINGS() _Pragma("clang diagnostic pop") -#elif defined(__GNUC__) -# define nssv_RESTORE_WARNINGS() _Pragma("GCC diagnostic pop") -#elif nssv_COMPILER_MSVC_VERSION >= 140 -# define nssv_RESTORE_WARNINGS() __pragma(warning(pop )) -#else -# define nssv_RESTORE_WARNINGS() -#endif - -// Suppress the following MSVC (GSL) warnings: -// - C4455, non-gsl : 'operator ""sv': literal suffix identifiers that do not -// start with an underscore are reserved -// - C26472, gsl::t.1 : don't use a static_cast for arithmetic conversions; -// use brace initialization, gsl::narrow_cast or gsl::narow -// - C26481: gsl::b.1 : don't use pointer arithmetic. Use span instead - -nssv_DISABLE_MSVC_WARNINGS( 4455 26481 26472 ) -//nssv_DISABLE_CLANG_WARNINGS( "-Wuser-defined-literals" ) -//nssv_DISABLE_GNUC_WARNINGS( -Wliteral-suffix ) - -namespace nonstd { namespace sv_lite { - -template -< - class CharT, - class Traits = std::char_traits -> -class basic_string_view; - -// -// basic_string_view: -// - -template -< - class CharT, - class Traits /* = std::char_traits */ -> -class basic_string_view -{ -public: - // Member types: - - typedef Traits traits_type; - typedef CharT value_type; - - typedef CharT * pointer; - typedef CharT const * const_pointer; - typedef CharT & reference; - typedef CharT const & const_reference; - - typedef const_pointer iterator; - typedef const_pointer const_iterator; - typedef std::reverse_iterator< const_iterator > reverse_iterator; - typedef std::reverse_iterator< const_iterator > const_reverse_iterator; - - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - - // 24.4.2.1 Construction and assignment: - - nssv_constexpr basic_string_view() nssv_noexcept - : data_( nssv_nullptr ) - , size_( 0 ) - {} - -#if nssv_CPP11_OR_GREATER - nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept = default; -#else - nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept - : data_( other.data_) - , size_( other.size_) - {} -#endif - - nssv_constexpr basic_string_view( CharT const * s, size_type count ) - : data_( s ) - , size_( count ) - {} - - nssv_constexpr basic_string_view( CharT const * s) - : data_( s ) - , size_( Traits::length(s) ) - {} - - // Assignment: - -#if nssv_CPP11_OR_GREATER - nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept = default; -#else - nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept - { - data_ = other.data_; - size_ = other.size_; - return *this; - } -#endif - - // 24.4.2.2 Iterator support: - - nssv_constexpr const_iterator begin() const nssv_noexcept { return data_; } - nssv_constexpr const_iterator end() const nssv_noexcept { return data_ + size_; } - - nssv_constexpr const_iterator cbegin() const nssv_noexcept { return begin(); } - nssv_constexpr const_iterator cend() const nssv_noexcept { return end(); } - - nssv_constexpr const_reverse_iterator rbegin() const nssv_noexcept { return const_reverse_iterator( end() ); } - nssv_constexpr const_reverse_iterator rend() const nssv_noexcept { return const_reverse_iterator( begin() ); } - - nssv_constexpr const_reverse_iterator crbegin() const nssv_noexcept { return rbegin(); } - nssv_constexpr const_reverse_iterator crend() const nssv_noexcept { return rend(); } - - // 24.4.2.3 Capacity: - - nssv_constexpr size_type size() const nssv_noexcept { return size_; } - nssv_constexpr size_type length() const nssv_noexcept { return size_; } - nssv_constexpr size_type max_size() const nssv_noexcept { return (std::numeric_limits< size_type >::max)(); } - - // since C++20 - nssv_nodiscard nssv_constexpr bool empty() const nssv_noexcept - { - return 0 == size_; - } - - // 24.4.2.4 Element access: - - nssv_constexpr const_reference operator[]( size_type pos ) const - { - return data_at( pos ); - } - - nssv_constexpr14 const_reference at( size_type pos ) const - { -#if nssv_CONFIG_NO_EXCEPTIONS - assert( pos < size() ); -#else - if ( pos >= size() ) - { - throw std::out_of_range("nonst::string_view::at()"); - } -#endif - return data_at( pos ); - } - - nssv_constexpr const_reference front() const { return data_at( 0 ); } - nssv_constexpr const_reference back() const { return data_at( size() - 1 ); } - - nssv_constexpr const_pointer data() const nssv_noexcept { return data_; } - - // 24.4.2.5 Modifiers: - - nssv_constexpr14 void remove_prefix( size_type n ) - { - assert( n <= size() ); - data_ += n; - size_ -= n; - } - - nssv_constexpr14 void remove_suffix( size_type n ) - { - assert( n <= size() ); - size_ -= n; - } - - nssv_constexpr14 void swap( basic_string_view & other ) nssv_noexcept - { - using std::swap; - swap( data_, other.data_ ); - swap( size_, other.size_ ); - } - - // 24.4.2.6 String operations: - - size_type copy( CharT * dest, size_type n, size_type pos = 0 ) const - { -#if nssv_CONFIG_NO_EXCEPTIONS - assert( pos <= size() ); -#else - if ( pos > size() ) - { - throw std::out_of_range("nonst::string_view::copy()"); - } -#endif - const size_type rlen = (std::min)( n, size() - pos ); - - (void) Traits::copy( dest, data() + pos, rlen ); - - return rlen; - } - - nssv_constexpr14 basic_string_view substr( size_type pos = 0, size_type n = npos ) const - { -#if nssv_CONFIG_NO_EXCEPTIONS - assert( pos <= size() ); -#else - if ( pos > size() ) - { - throw std::out_of_range("nonst::string_view::substr()"); - } -#endif - return basic_string_view( data() + pos, (std::min)( n, size() - pos ) ); - } - - // compare(), 6x: - - nssv_constexpr14 int compare( basic_string_view other ) const nssv_noexcept // (1) - { - if ( const int result = Traits::compare( data(), other.data(), (std::min)( size(), other.size() ) ) ) - return result; - - return size() == other.size() ? 0 : size() < other.size() ? -1 : 1; - } - - nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other ) const // (2) - { - return substr( pos1, n1 ).compare( other ); - } - - nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other, size_type pos2, size_type n2 ) const // (3) - { - return substr( pos1, n1 ).compare( other.substr( pos2, n2 ) ); - } - - nssv_constexpr int compare( CharT const * s ) const // (4) - { - return compare( basic_string_view( s ) ); - } - - nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s ) const // (5) - { - return substr( pos1, n1 ).compare( basic_string_view( s ) ); - } - - nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s, size_type n2 ) const // (6) - { - return substr( pos1, n1 ).compare( basic_string_view( s, n2 ) ); - } - - // 24.4.2.7 Searching: - - // starts_with(), 3x, since C++20: - - nssv_constexpr bool starts_with( basic_string_view v ) const nssv_noexcept // (1) - { - return size() >= v.size() && compare( 0, v.size(), v ) == 0; - } - - nssv_constexpr bool starts_with( CharT c ) const nssv_noexcept // (2) - { - return starts_with( basic_string_view( &c, 1 ) ); - } - - nssv_constexpr bool starts_with( CharT const * s ) const // (3) - { - return starts_with( basic_string_view( s ) ); - } - - // ends_with(), 3x, since C++20: - - nssv_constexpr bool ends_with( basic_string_view v ) const nssv_noexcept // (1) - { - return size() >= v.size() && compare( size() - v.size(), npos, v ) == 0; - } - - nssv_constexpr bool ends_with( CharT c ) const nssv_noexcept // (2) - { - return ends_with( basic_string_view( &c, 1 ) ); - } - - nssv_constexpr bool ends_with( CharT const * s ) const // (3) - { - return ends_with( basic_string_view( s ) ); - } - - // find(), 4x: - - nssv_constexpr14 size_type find( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) - { - return assert( v.size() == 0 || v.data() != nssv_nullptr ) - , pos >= size() - ? npos - : to_pos( std::search( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) ); - } - - nssv_constexpr14 size_type find( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) - { - return find( basic_string_view( &c, 1 ), pos ); - } - - nssv_constexpr14 size_type find( CharT const * s, size_type pos, size_type n ) const // (3) - { - return find( basic_string_view( s, n ), pos ); - } - - nssv_constexpr14 size_type find( CharT const * s, size_type pos = 0 ) const // (4) - { - return find( basic_string_view( s ), pos ); - } - - // rfind(), 4x: - - nssv_constexpr14 size_type rfind( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) - { - if ( size() < v.size() ) - return npos; - - if ( v.empty() ) - return (std::min)( size(), pos ); - - const_iterator last = cbegin() + (std::min)( size() - v.size(), pos ) + v.size(); - const_iterator result = std::find_end( cbegin(), last, v.cbegin(), v.cend(), Traits::eq ); - - return result != last ? size_type( result - cbegin() ) : npos; - } - - nssv_constexpr14 size_type rfind( CharT c, size_type pos = npos ) const nssv_noexcept // (2) - { - return rfind( basic_string_view( &c, 1 ), pos ); - } - - nssv_constexpr14 size_type rfind( CharT const * s, size_type pos, size_type n ) const // (3) - { - return rfind( basic_string_view( s, n ), pos ); - } - - nssv_constexpr14 size_type rfind( CharT const * s, size_type pos = npos ) const // (4) - { - return rfind( basic_string_view( s ), pos ); - } - - // find_first_of(), 4x: - - nssv_constexpr size_type find_first_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) - { - return pos >= size() - ? npos - : to_pos( std::find_first_of( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) ); - } - - nssv_constexpr size_type find_first_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) - { - return find_first_of( basic_string_view( &c, 1 ), pos ); - } - - nssv_constexpr size_type find_first_of( CharT const * s, size_type pos, size_type n ) const // (3) - { - return find_first_of( basic_string_view( s, n ), pos ); - } - - nssv_constexpr size_type find_first_of( CharT const * s, size_type pos = 0 ) const // (4) - { - return find_first_of( basic_string_view( s ), pos ); - } - - // find_last_of(), 4x: - - nssv_constexpr size_type find_last_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) - { - return empty() - ? npos - : pos >= size() - ? find_last_of( v, size() - 1 ) - : to_pos( std::find_first_of( const_reverse_iterator( cbegin() + pos + 1 ), crend(), v.cbegin(), v.cend(), Traits::eq ) ); - } - - nssv_constexpr size_type find_last_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2) - { - return find_last_of( basic_string_view( &c, 1 ), pos ); - } - - nssv_constexpr size_type find_last_of( CharT const * s, size_type pos, size_type count ) const // (3) - { - return find_last_of( basic_string_view( s, count ), pos ); - } - - nssv_constexpr size_type find_last_of( CharT const * s, size_type pos = npos ) const // (4) - { - return find_last_of( basic_string_view( s ), pos ); - } - - // find_first_not_of(), 4x: - - nssv_constexpr size_type find_first_not_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) - { - return pos >= size() - ? npos - : to_pos( std::find_if( cbegin() + pos, cend(), not_in_view( v ) ) ); - } - - nssv_constexpr size_type find_first_not_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) - { - return find_first_not_of( basic_string_view( &c, 1 ), pos ); - } - - nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos, size_type count ) const // (3) - { - return find_first_not_of( basic_string_view( s, count ), pos ); - } - - nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos = 0 ) const // (4) - { - return find_first_not_of( basic_string_view( s ), pos ); - } - - // find_last_not_of(), 4x: - - nssv_constexpr size_type find_last_not_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) - { - return empty() - ? npos - : pos >= size() - ? find_last_not_of( v, size() - 1 ) - : to_pos( std::find_if( const_reverse_iterator( cbegin() + pos + 1 ), crend(), not_in_view( v ) ) ); - } - - nssv_constexpr size_type find_last_not_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2) - { - return find_last_not_of( basic_string_view( &c, 1 ), pos ); - } - - nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos, size_type count ) const // (3) - { - return find_last_not_of( basic_string_view( s, count ), pos ); - } - - nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos = npos ) const // (4) - { - return find_last_not_of( basic_string_view( s ), pos ); - } - - // Constants: - -#if nssv_CPP17_OR_GREATER - static nssv_constexpr size_type npos = size_type(-1); -#elif nssv_CPP11_OR_GREATER - enum : size_type { npos = size_type(-1) }; -#else - enum { npos = size_type(-1) }; -#endif - -private: - struct not_in_view - { - const basic_string_view v; - - nssv_constexpr not_in_view( basic_string_view v ) : v( v ) {} - - nssv_constexpr bool operator()( CharT c ) const - { - return npos == v.find_first_of( c ); - } - }; - - nssv_constexpr size_type to_pos( const_iterator it ) const - { - return it == cend() ? npos : size_type( it - cbegin() ); - } - - nssv_constexpr size_type to_pos( const_reverse_iterator it ) const - { - return it == crend() ? npos : size_type( crend() - it - 1 ); - } - - nssv_constexpr const_reference data_at( size_type pos ) const - { -#if nssv_BETWEEN( nssv_COMPILER_GNUC_VERSION, 1, 500 ) - return data_[pos]; -#else - return assert( pos < size() ), data_[pos]; -#endif - } - -private: - const_pointer data_; - size_type size_; - -public: -#if nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS - - template< class Allocator > - basic_string_view( std::basic_string const & s ) nssv_noexcept - : data_( s.data() ) - , size_( s.size() ) - {} - -#if nssv_HAVE_EXPLICIT_CONVERSION - - template< class Allocator > - explicit operator std::basic_string() const - { - return to_string( Allocator() ); - } - -#endif // nssv_HAVE_EXPLICIT_CONVERSION - -#if nssv_CPP11_OR_GREATER - - template< class Allocator = std::allocator > - std::basic_string - to_string( Allocator const & a = Allocator() ) const - { - return std::basic_string( begin(), end(), a ); - } - -#else - - std::basic_string - to_string() const - { - return std::basic_string( begin(), end() ); - } - - template< class Allocator > - std::basic_string - to_string( Allocator const & a ) const - { - return std::basic_string( begin(), end(), a ); - } - -#endif // nssv_CPP11_OR_GREATER - -#endif // nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS +struct SourceLocation { + size_t line; + size_t column; }; -// -// Non-member functions: -// +struct InjaError : public std::runtime_error { + const std::string type; + const std::string message; -// 24.4.3 Non-member comparison functions: -// lexicographically compare two string views (function template): + const SourceLocation location; -template< class CharT, class Traits > -nssv_constexpr bool operator== ( - basic_string_view lhs, - basic_string_view rhs ) nssv_noexcept -{ return lhs.compare( rhs ) == 0 ; } + explicit InjaError(const std::string& type, const std::string& message) + : std::runtime_error("[inja.exception." + type + "] " + message), type(type), message(message), location({0, 0}) {} -template< class CharT, class Traits > -nssv_constexpr bool operator!= ( - basic_string_view lhs, - basic_string_view rhs ) nssv_noexcept -{ return lhs.compare( rhs ) != 0 ; } - -template< class CharT, class Traits > -nssv_constexpr bool operator< ( - basic_string_view lhs, - basic_string_view rhs ) nssv_noexcept -{ return lhs.compare( rhs ) < 0 ; } - -template< class CharT, class Traits > -nssv_constexpr bool operator<= ( - basic_string_view lhs, - basic_string_view rhs ) nssv_noexcept -{ return lhs.compare( rhs ) <= 0 ; } - -template< class CharT, class Traits > -nssv_constexpr bool operator> ( - basic_string_view lhs, - basic_string_view rhs ) nssv_noexcept -{ return lhs.compare( rhs ) > 0 ; } - -template< class CharT, class Traits > -nssv_constexpr bool operator>= ( - basic_string_view lhs, - basic_string_view rhs ) nssv_noexcept -{ return lhs.compare( rhs ) >= 0 ; } - -// Let S be basic_string_view, and sv be an instance of S. -// Implementations shall provide sufficient additional overloads marked -// constexpr and noexcept so that an object t with an implicit conversion -// to S can be compared according to Table 67. - -#if nssv_CPP11_OR_GREATER && ! nssv_BETWEEN( nssv_COMPILER_MSVC_VERSION, 100, 141 ) - -#define nssv_BASIC_STRING_VIEW_I(T,U) typename std::decay< basic_string_view >::type - -#if nssv_BETWEEN( nssv_COMPILER_MSVC_VERSION, 140, 150 ) -# define nssv_MSVC_ORDER(x) , int=x -#else -# define nssv_MSVC_ORDER(x) /*, int=x*/ -#endif - -// == - -template< class CharT, class Traits nssv_MSVC_ORDER(1) > -nssv_constexpr bool operator==( - basic_string_view lhs, - nssv_BASIC_STRING_VIEW_I(CharT, Traits) rhs ) nssv_noexcept -{ return lhs.compare( rhs ) == 0; } - -template< class CharT, class Traits nssv_MSVC_ORDER(2) > -nssv_constexpr bool operator==( - nssv_BASIC_STRING_VIEW_I(CharT, Traits) lhs, - basic_string_view rhs ) nssv_noexcept -{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } - -// != - -template< class CharT, class Traits nssv_MSVC_ORDER(1) > -nssv_constexpr bool operator!= ( - basic_string_view < CharT, Traits > lhs, - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept -{ return lhs.size() != rhs.size() || lhs.compare( rhs ) != 0 ; } - -template< class CharT, class Traits nssv_MSVC_ORDER(2) > -nssv_constexpr bool operator!= ( - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, - basic_string_view < CharT, Traits > rhs ) nssv_noexcept -{ return lhs.compare( rhs ) != 0 ; } - -// < - -template< class CharT, class Traits nssv_MSVC_ORDER(1) > -nssv_constexpr bool operator< ( - basic_string_view < CharT, Traits > lhs, - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept -{ return lhs.compare( rhs ) < 0 ; } - -template< class CharT, class Traits nssv_MSVC_ORDER(2) > -nssv_constexpr bool operator< ( - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, - basic_string_view < CharT, Traits > rhs ) nssv_noexcept -{ return lhs.compare( rhs ) < 0 ; } - -// <= - -template< class CharT, class Traits nssv_MSVC_ORDER(1) > -nssv_constexpr bool operator<= ( - basic_string_view < CharT, Traits > lhs, - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept -{ return lhs.compare( rhs ) <= 0 ; } - -template< class CharT, class Traits nssv_MSVC_ORDER(2) > -nssv_constexpr bool operator<= ( - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, - basic_string_view < CharT, Traits > rhs ) nssv_noexcept -{ return lhs.compare( rhs ) <= 0 ; } - -// > - -template< class CharT, class Traits nssv_MSVC_ORDER(1) > -nssv_constexpr bool operator> ( - basic_string_view < CharT, Traits > lhs, - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept -{ return lhs.compare( rhs ) > 0 ; } - -template< class CharT, class Traits nssv_MSVC_ORDER(2) > -nssv_constexpr bool operator> ( - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, - basic_string_view < CharT, Traits > rhs ) nssv_noexcept -{ return lhs.compare( rhs ) > 0 ; } - -// >= - -template< class CharT, class Traits nssv_MSVC_ORDER(1) > -nssv_constexpr bool operator>= ( - basic_string_view < CharT, Traits > lhs, - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept -{ return lhs.compare( rhs ) >= 0 ; } - -template< class CharT, class Traits nssv_MSVC_ORDER(2) > -nssv_constexpr bool operator>= ( - nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, - basic_string_view < CharT, Traits > rhs ) nssv_noexcept -{ return lhs.compare( rhs ) >= 0 ; } - -#undef nssv_MSVC_ORDER -#undef nssv_BASIC_STRING_VIEW_I - -#endif // nssv_CPP11_OR_GREATER - -// 24.4.4 Inserters and extractors: - -namespace detail { - -template< class Stream > -void write_padding( Stream & os, std::streamsize n ) -{ - for ( std::streamsize i = 0; i < n; ++i ) - os.rdbuf()->sputc( os.fill() ); -} - -template< class Stream, class View > -Stream & write_to_stream( Stream & os, View const & sv ) -{ - typename Stream::sentry sentry( os ); - - if ( !os ) - return os; - - const std::streamsize length = static_cast( sv.length() ); - - // Whether, and how, to pad: - const bool pad = ( length < os.width() ); - const bool left_pad = pad && ( os.flags() & std::ios_base::adjustfield ) == std::ios_base::right; - - if ( left_pad ) - write_padding( os, os.width() - length ); - - // Write span characters: - os.rdbuf()->sputn( sv.begin(), length ); - - if ( pad && !left_pad ) - write_padding( os, os.width() - length ); - - // Reset output stream width: - os.width( 0 ); - - return os; -} - -} // namespace detail - -template< class CharT, class Traits > -std::basic_ostream & -operator<<( - std::basic_ostream& os, - basic_string_view sv ) -{ - return detail::write_to_stream( os, sv ); -} - -// Several typedefs for common character types are provided: - -typedef basic_string_view string_view; -typedef basic_string_view wstring_view; -#if nssv_HAVE_WCHAR16_T -typedef basic_string_view u16string_view; -typedef basic_string_view u32string_view; -#endif - -}} // namespace nonstd::sv_lite - -// -// 24.4.6 Suffix for basic_string_view literals: -// - -#if nssv_HAVE_USER_DEFINED_LITERALS - -namespace nonstd { -nssv_inline_ns namespace literals { -nssv_inline_ns namespace string_view_literals { - -#if nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS - -nssv_constexpr nonstd::sv_lite::string_view operator "" sv( const char* str, size_t len ) nssv_noexcept // (1) -{ - return nonstd::sv_lite::string_view{ str, len }; -} - -nssv_constexpr nonstd::sv_lite::u16string_view operator "" sv( const char16_t* str, size_t len ) nssv_noexcept // (2) -{ - return nonstd::sv_lite::u16string_view{ str, len }; -} - -nssv_constexpr nonstd::sv_lite::u32string_view operator "" sv( const char32_t* str, size_t len ) nssv_noexcept // (3) -{ - return nonstd::sv_lite::u32string_view{ str, len }; -} - -nssv_constexpr nonstd::sv_lite::wstring_view operator "" sv( const wchar_t* str, size_t len ) nssv_noexcept // (4) -{ - return nonstd::sv_lite::wstring_view{ str, len }; -} - -#endif // nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS - -#if nssv_CONFIG_USR_SV_OPERATOR - -nssv_constexpr nonstd::sv_lite::string_view operator "" _sv( const char* str, size_t len ) nssv_noexcept // (1) -{ - return nonstd::sv_lite::string_view{ str, len }; -} - -nssv_constexpr nonstd::sv_lite::u16string_view operator "" _sv( const char16_t* str, size_t len ) nssv_noexcept // (2) -{ - return nonstd::sv_lite::u16string_view{ str, len }; -} - -nssv_constexpr nonstd::sv_lite::u32string_view operator "" _sv( const char32_t* str, size_t len ) nssv_noexcept // (3) -{ - return nonstd::sv_lite::u32string_view{ str, len }; -} - -nssv_constexpr nonstd::sv_lite::wstring_view operator "" _sv( const wchar_t* str, size_t len ) nssv_noexcept // (4) -{ - return nonstd::sv_lite::wstring_view{ str, len }; -} - -#endif // nssv_CONFIG_USR_SV_OPERATOR - -}}} // namespace nonstd::literals::string_view_literals - -#endif - -// -// Extensions for std::string: -// - -#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS - -namespace nonstd { -namespace sv_lite { - -// Exclude MSVC 14 (19.00): it yields ambiguous to_string(): - -#if nssv_CPP11_OR_GREATER && nssv_COMPILER_MSVC_VERSION != 140 - -template< class CharT, class Traits, class Allocator = std::allocator > -std::basic_string -to_string( basic_string_view v, Allocator const & a = Allocator() ) -{ - return std::basic_string( v.begin(), v.end(), a ); -} - -#else - -template< class CharT, class Traits > -std::basic_string -to_string( basic_string_view v ) -{ - return std::basic_string( v.begin(), v.end() ); -} - -template< class CharT, class Traits, class Allocator > -std::basic_string -to_string( basic_string_view v, Allocator const & a ) -{ - return std::basic_string( v.begin(), v.end(), a ); -} - -#endif // nssv_CPP11_OR_GREATER - -template< class CharT, class Traits, class Allocator > -basic_string_view -to_string_view( std::basic_string const & s ) -{ - return basic_string_view( s.data(), s.size() ); -} - -}} // namespace nonstd::sv_lite - -#endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS - -// -// make types and algorithms available in namespace nonstd: -// - -namespace nonstd { - -using sv_lite::basic_string_view; -using sv_lite::string_view; -using sv_lite::wstring_view; - -#if nssv_HAVE_WCHAR16_T -using sv_lite::u16string_view; -#endif -#if nssv_HAVE_WCHAR32_T -using sv_lite::u32string_view; -#endif - -// literal "sv" - -using sv_lite::operator==; -using sv_lite::operator!=; -using sv_lite::operator<; -using sv_lite::operator<=; -using sv_lite::operator>; -using sv_lite::operator>=; - -using sv_lite::operator<<; - -#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS -using sv_lite::to_string; -using sv_lite::to_string_view; -#endif - -} // namespace nonstd - -// 24.4.5 Hash support (C++11): - -// Note: The hash value of a string view object is equal to the hash value of -// the corresponding string object. - -#if nssv_HAVE_STD_HASH - -#include - -namespace std { - -template<> -struct hash< nonstd::string_view > -{ -public: - std::size_t operator()( nonstd::string_view v ) const nssv_noexcept - { - return std::hash()( std::string( v.data(), v.size() ) ); - } + explicit InjaError(const std::string& type, const std::string& message, SourceLocation location) + : std::runtime_error("[inja.exception." + type + "] (at " + std::to_string(location.line) + ":" + std::to_string(location.column) + ") " + message), + type(type), message(message), location(location) {} }; -template<> -struct hash< nonstd::wstring_view > -{ -public: - std::size_t operator()( nonstd::wstring_view v ) const nssv_noexcept - { - return std::hash()( std::wstring( v.data(), v.size() ) ); - } +struct ParserError : public InjaError { + explicit ParserError(const std::string& message, SourceLocation location): InjaError("parser_error", message, location) {} }; -template<> -struct hash< nonstd::u16string_view > -{ -public: - std::size_t operator()( nonstd::u16string_view v ) const nssv_noexcept - { - return std::hash()( std::u16string( v.data(), v.size() ) ); - } +struct RenderError : public InjaError { + explicit RenderError(const std::string& message, SourceLocation location): InjaError("render_error", message, location) {} }; -template<> -struct hash< nonstd::u32string_view > -{ -public: - std::size_t operator()( nonstd::u32string_view v ) const nssv_noexcept - { - return std::hash()( std::u32string( v.data(), v.size() ) ); - } +struct FileError : public InjaError { + explicit FileError(const std::string& message): InjaError("file_error", message) {} + explicit FileError(const std::string& message, SourceLocation location): InjaError("file_error", message, location) {} }; -} // namespace std +struct DataError : public InjaError { + explicit DataError(const std::string& message, SourceLocation location): InjaError("data_error", message, location) {} +}; -#endif // nssv_HAVE_STD_HASH - -nssv_RESTORE_WARNINGS() - -#endif // nssv_HAVE_STD_STRING_VIEW -#endif // NONSTD_SV_LITE_H_INCLUDED +} // namespace inja +#endif // INCLUDE_INJA_EXCEPTIONS_HPP_ namespace inja { -enum class ElementNotation { - Dot, - Pointer +namespace string_view { +inline std::string_view slice(std::string_view view, size_t start, size_t end) { + start = std::min(start, view.size()); + end = std::min(std::max(start, end), view.size()); + return view.substr(start, end - start); +} + +inline std::pair split(std::string_view view, char Separator) { + size_t idx = view.find(Separator); + if (idx == std::string_view::npos) { + return std::make_pair(view, std::string_view()); + } + return std::make_pair(slice(view, 0, idx), slice(view, idx + 1, std::string_view::npos)); +} + +inline bool starts_with(std::string_view view, std::string_view prefix) { + return (view.size() >= prefix.size() && view.compare(0, prefix.size(), prefix) == 0); +} +} // namespace string_view + +inline SourceLocation get_source_location(std::string_view content, size_t pos) { + // Get line and offset position (starts at 1:1) + auto sliced = string_view::slice(content, 0, pos); + std::size_t last_newline = sliced.rfind("\n"); + + if (last_newline == std::string_view::npos) { + return {1, sliced.length() + 1}; + } + + // Count newlines + size_t count_lines = 0; + size_t search_start = 0; + while (search_start <= sliced.size()) { + search_start = sliced.find("\n", search_start) + 1; + if (search_start == 0) { + break; + } + count_lines += 1; + } + + return {count_lines + 1, sliced.length() - last_newline}; +} + +inline void replace_substring(std::string& s, const std::string& f, const std::string& t) { + if (f.empty()) { + return; + } + for (auto pos = s.find(f); // find first occurrence of f + pos != std::string::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} +} + +} // namespace inja + +#endif // INCLUDE_INJA_UTILS_HPP_ + + +namespace inja { + +class NodeVisitor; +class BlockNode; +class TextNode; +class ExpressionNode; +class LiteralNode; +class DataNode; +class FunctionNode; +class ExpressionListNode; +class StatementNode; +class ForStatementNode; +class ForArrayStatementNode; +class ForObjectStatementNode; +class IfStatementNode; +class IncludeStatementNode; +class ExtendsStatementNode; +class BlockStatementNode; +class SetStatementNode; + +class NodeVisitor { +public: + virtual ~NodeVisitor() = default; + + virtual void visit(const BlockNode& node) = 0; + virtual void visit(const TextNode& node) = 0; + virtual void visit(const ExpressionNode& node) = 0; + virtual void visit(const LiteralNode& node) = 0; + virtual void visit(const DataNode& node) = 0; + virtual void visit(const FunctionNode& node) = 0; + virtual void visit(const ExpressionListNode& node) = 0; + virtual void visit(const StatementNode& node) = 0; + virtual void visit(const ForStatementNode& node) = 0; + virtual void visit(const ForArrayStatementNode& node) = 0; + virtual void visit(const ForObjectStatementNode& node) = 0; + virtual void visit(const IfStatementNode& node) = 0; + virtual void visit(const IncludeStatementNode& node) = 0; + virtual void visit(const ExtendsStatementNode& node) = 0; + virtual void visit(const BlockStatementNode& node) = 0; + virtual void visit(const SetStatementNode& node) = 0; }; +/*! + * \brief Base node class for the abstract syntax tree (AST). + */ +class AstNode { +public: + virtual void accept(NodeVisitor& v) const = 0; + + size_t pos; + + AstNode(size_t pos): pos(pos) {} + virtual ~AstNode() {} +}; + +class BlockNode : public AstNode { +public: + std::vector> nodes; + + explicit BlockNode(): AstNode(0) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class TextNode : public AstNode { +public: + const size_t length; + + explicit TextNode(size_t pos, size_t length): AstNode(pos), length(length) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class ExpressionNode : public AstNode { +public: + explicit ExpressionNode(size_t pos): AstNode(pos) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class LiteralNode : public ExpressionNode { +public: + const json value; + + explicit LiteralNode(std::string_view data_text, size_t pos): ExpressionNode(pos), value(json::parse(data_text)) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class DataNode : public ExpressionNode { +public: + const std::string name; + const json::json_pointer ptr; + + static std::string convert_dot_to_ptr(std::string_view ptr_name) { + std::string result; + do { + std::string_view part; + std::tie(part, ptr_name) = string_view::split(ptr_name, '.'); + result.push_back('/'); + result.append(part.begin(), part.end()); + } while (!ptr_name.empty()); + return result; + } + + explicit DataNode(std::string_view ptr_name, size_t pos): ExpressionNode(pos), name(ptr_name), ptr(json::json_pointer(convert_dot_to_ptr(ptr_name))) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class FunctionNode : public ExpressionNode { + using Op = FunctionStorage::Operation; + +public: + enum class Associativity { + Left, + Right, + }; + + unsigned int precedence; + Associativity associativity; + + Op operation; + + std::string name; + int number_args; // Should also be negative -> -1 for unknown number + std::vector> arguments; + CallbackFunction callback; + + explicit FunctionNode(std::string_view name, size_t pos) + : ExpressionNode(pos), precedence(8), associativity(Associativity::Left), operation(Op::Callback), name(name), number_args(1) {} + explicit FunctionNode(Op operation, size_t pos): ExpressionNode(pos), operation(operation), number_args(1) { + switch (operation) { + case Op::Not: { + number_args = 1; + precedence = 4; + associativity = Associativity::Left; + } break; + case Op::And: { + number_args = 2; + precedence = 1; + associativity = Associativity::Left; + } break; + case Op::Or: { + number_args = 2; + precedence = 1; + associativity = Associativity::Left; + } break; + case Op::In: { + number_args = 2; + precedence = 2; + associativity = Associativity::Left; + } break; + case Op::Equal: { + number_args = 2; + precedence = 2; + associativity = Associativity::Left; + } break; + case Op::NotEqual: { + number_args = 2; + precedence = 2; + associativity = Associativity::Left; + } break; + case Op::Greater: { + number_args = 2; + precedence = 2; + associativity = Associativity::Left; + } break; + case Op::GreaterEqual: { + number_args = 2; + precedence = 2; + associativity = Associativity::Left; + } break; + case Op::Less: { + number_args = 2; + precedence = 2; + associativity = Associativity::Left; + } break; + case Op::LessEqual: { + number_args = 2; + precedence = 2; + associativity = Associativity::Left; + } break; + case Op::Add: { + number_args = 2; + precedence = 3; + associativity = Associativity::Left; + } break; + case Op::Subtract: { + number_args = 2; + precedence = 3; + associativity = Associativity::Left; + } break; + case Op::Multiplication: { + number_args = 2; + precedence = 4; + associativity = Associativity::Left; + } break; + case Op::Division: { + number_args = 2; + precedence = 4; + associativity = Associativity::Left; + } break; + case Op::Power: { + number_args = 2; + precedence = 5; + associativity = Associativity::Right; + } break; + case Op::Modulo: { + number_args = 2; + precedence = 4; + associativity = Associativity::Left; + } break; + case Op::AtId: { + number_args = 2; + precedence = 8; + associativity = Associativity::Left; + } break; + default: { + precedence = 1; + associativity = Associativity::Left; + } + } + } + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class ExpressionListNode : public AstNode { +public: + std::shared_ptr root; + + explicit ExpressionListNode(): AstNode(0) {} + explicit ExpressionListNode(size_t pos): AstNode(pos) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class StatementNode : public AstNode { +public: + StatementNode(size_t pos): AstNode(pos) {} + + virtual void accept(NodeVisitor& v) const = 0; +}; + +class ForStatementNode : public StatementNode { +public: + ExpressionListNode condition; + BlockNode body; + BlockNode* const parent; + + ForStatementNode(BlockNode* const parent, size_t pos): StatementNode(pos), parent(parent) {} + + virtual void accept(NodeVisitor& v) const = 0; +}; + +class ForArrayStatementNode : public ForStatementNode { +public: + const std::string value; + + explicit ForArrayStatementNode(const std::string& value, BlockNode* const parent, size_t pos): ForStatementNode(parent, pos), value(value) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class ForObjectStatementNode : public ForStatementNode { +public: + const std::string key; + const std::string value; + + explicit ForObjectStatementNode(const std::string& key, const std::string& value, BlockNode* const parent, size_t pos) + : ForStatementNode(parent, pos), key(key), value(value) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class IfStatementNode : public StatementNode { +public: + ExpressionListNode condition; + BlockNode true_statement; + BlockNode false_statement; + BlockNode* const parent; + + const bool is_nested; + bool has_false_statement {false}; + + explicit IfStatementNode(BlockNode* const parent, size_t pos): StatementNode(pos), parent(parent), is_nested(false) {} + explicit IfStatementNode(bool is_nested, BlockNode* const parent, size_t pos): StatementNode(pos), parent(parent), is_nested(is_nested) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class IncludeStatementNode : public StatementNode { +public: + const std::string file; + + explicit IncludeStatementNode(const std::string& file, size_t pos): StatementNode(pos), file(file) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +class ExtendsStatementNode : public StatementNode { +public: + const std::string file; + + explicit ExtendsStatementNode(const std::string& file, size_t pos): StatementNode(pos), file(file) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + }; +}; + +class BlockStatementNode : public StatementNode { +public: + const std::string name; + BlockNode block; + BlockNode* const parent; + + explicit BlockStatementNode(BlockNode* const parent, const std::string& name, size_t pos): StatementNode(pos), name(name), parent(parent) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + }; +}; + +class SetStatementNode : public StatementNode { +public: + const std::string key; + ExpressionListNode expression; + + explicit SetStatementNode(const std::string& key, size_t pos): StatementNode(pos), key(key) {} + + void accept(NodeVisitor& v) const { + v.visit(*this); + } +}; + +} // namespace inja + +#endif // INCLUDE_INJA_NODE_HPP_ + +// #include "statistics.hpp" +#ifndef INCLUDE_INJA_STATISTICS_HPP_ +#define INCLUDE_INJA_STATISTICS_HPP_ + +// #include "node.hpp" + + +namespace inja { + +/*! + * \brief A class for counting statistics on a Template. + */ +class StatisticsVisitor : public NodeVisitor { + void visit(const BlockNode& node) { + for (auto& n : node.nodes) { + n->accept(*this); + } + } + + void visit(const TextNode&) {} + void visit(const ExpressionNode&) {} + void visit(const LiteralNode&) {} + + void visit(const DataNode&) { + variable_counter += 1; + } + + void visit(const FunctionNode& node) { + for (auto& n : node.arguments) { + n->accept(*this); + } + } + + void visit(const ExpressionListNode& node) { + node.root->accept(*this); + } + + void visit(const StatementNode&) {} + void visit(const ForStatementNode&) {} + + void visit(const ForArrayStatementNode& node) { + node.condition.accept(*this); + node.body.accept(*this); + } + + void visit(const ForObjectStatementNode& node) { + node.condition.accept(*this); + node.body.accept(*this); + } + + void visit(const IfStatementNode& node) { + node.condition.accept(*this); + node.true_statement.accept(*this); + node.false_statement.accept(*this); + } + + void visit(const IncludeStatementNode&) {} + + void visit(const ExtendsStatementNode&) {} + + void visit(const BlockStatementNode& node) { + node.block.accept(*this); + } + + void visit(const SetStatementNode&) {} + +public: + unsigned int variable_counter; + + explicit StatisticsVisitor(): variable_counter(0) {} +}; + +} // namespace inja + +#endif // INCLUDE_INJA_STATISTICS_HPP_ + + +namespace inja { + +/*! + * \brief The main inja Template. + */ +struct Template { + BlockNode root; + std::string content; + std::map> block_storage; + + explicit Template() {} + explicit Template(const std::string& content): content(content) {} + + /// Return number of variables (total number, not distinct ones) in the template + int count_variables() { + auto statistic_visitor = StatisticsVisitor(); + root.accept(statistic_visitor); + return statistic_visitor.variable_counter; + } +}; + +using TemplateStorage = std::map; + +} // namespace inja + +#endif // INCLUDE_INJA_TEMPLATE_HPP_ + + +namespace inja { + /*! * \brief Class for lexer configuration. */ struct LexerConfig { std::string statement_open {"{%"}; + std::string statement_open_no_lstrip {"{%+"}; + std::string statement_open_force_lstrip {"{%-"}; std::string statement_close {"%}"}; + std::string statement_close_force_rstrip {"-%}"}; std::string line_statement {"##"}; std::string expression_open {"{{"}; + std::string expression_open_force_lstrip {"{{-"}; std::string expression_close {"}}"}; + std::string expression_close_force_rstrip {"-}}"}; std::string comment_open {"{#"}; + std::string comment_open_force_lstrip {"{#-"}; std::string comment_close {"#}"}; + std::string comment_close_force_rstrip {"-#}"}; std::string open_chars {"#{"}; bool trim_blocks {false}; @@ -1435,12 +849,24 @@ struct LexerConfig { if (open_chars.find(statement_open[0]) == std::string::npos) { open_chars += statement_open[0]; } + if (open_chars.find(statement_open_no_lstrip[0]) == std::string::npos) { + open_chars += statement_open_no_lstrip[0]; + } + if (open_chars.find(statement_open_force_lstrip[0]) == std::string::npos) { + open_chars += statement_open_force_lstrip[0]; + } if (open_chars.find(expression_open[0]) == std::string::npos) { open_chars += expression_open[0]; } + if (open_chars.find(expression_open_force_lstrip[0]) == std::string::npos) { + open_chars += expression_open_force_lstrip[0]; + } if (open_chars.find(comment_open[0]) == std::string::npos) { open_chars += comment_open[0]; } + if (open_chars.find(comment_open_force_lstrip[0]) == std::string::npos) { + open_chars += comment_open_force_lstrip[0]; + } } }; @@ -1448,245 +874,43 @@ struct LexerConfig { * \brief Class for parser configuration. */ struct ParserConfig { - ElementNotation notation {ElementNotation::Dot}; + bool search_included_templates_in_files {true}; + + std::function include_callback; }; -} - -#endif // PANTOR_INJA_CONFIG_HPP - -// #include "function_storage.hpp" -#ifndef PANTOR_INJA_FUNCTION_STORAGE_HPP -#define PANTOR_INJA_FUNCTION_STORAGE_HPP - -#include - -// #include "bytecode.hpp" -#ifndef PANTOR_INJA_BYTECODE_HPP -#define PANTOR_INJA_BYTECODE_HPP - -#include -#include - -#include - -// #include "string_view.hpp" - - - -namespace inja { - -using json = nlohmann::json; - - -struct Bytecode { - enum class Op : uint8_t { - Nop, - // print StringRef (always immediate) - PrintText, - // print value - PrintValue, - // push value onto stack (always immediate) - Push, - - // builtin functions - // result is pushed to stack - // args specify number of arguments - // all functions can take their "last" argument either immediate - // or popped off stack (e.g. if immediate, it's like the immediate was - // just pushed to the stack) - Not, - And, - Or, - In, - Equal, - Greater, - GreaterEqual, - Less, - LessEqual, - At, - Different, - DivisibleBy, - Even, - First, - Float, - Int, - Last, - Length, - Lower, - Max, - Min, - Odd, - Range, - Result, - Round, - Sort, - Upper, - Exists, - ExistsInObject, - IsBoolean, - IsNumber, - IsInteger, - IsFloat, - IsObject, - IsArray, - IsString, - Default, - - // include another template - // value is the template name - Include, - - // callback function - // str is the function name (this means it cannot be a lookup) - // args specify number of arguments - // as with builtin functions, "last" argument can be immediate - Callback, - - // unconditional jump - // args is the index of the bytecode to jump to. - Jump, - - // conditional jump - // value popped off stack is checked for truthyness - // if false, args is the index of the bytecode to jump to. - // if true, no action is taken (falls through) - ConditionalJump, - - // start loop - // value popped off stack is what is iterated over - // args is index of bytecode after end loop (jumped to if iterable is - // empty) - // immediate value is key name (for maps) - // str is value name - StartLoop, - - // end a loop - // args is index of the first bytecode in the loop body - EndLoop, - }; - - enum Flag { - // location of value for value-taking ops (mask) - ValueMask = 0x03, - // pop value off stack - ValuePop = 0x00, - // value is immediate rather than on stack - ValueImmediate = 0x01, - // lookup immediate str (dot notation) - ValueLookupDot = 0x02, - // lookup immediate str (json pointer notation) - ValueLookupPointer = 0x03, - }; - - Op op {Op::Nop}; - uint32_t args: 30; - uint32_t flags: 2; - - json value; - std::string str; - - Bytecode(): args(0), flags(0) {} - explicit Bytecode(Op op, unsigned int args = 0): op(op), args(args), flags(0) {} - explicit Bytecode(Op op, nonstd::string_view str, unsigned int flags): op(op), args(0), flags(flags), str(str) {} - explicit Bytecode(Op op, json&& value, unsigned int flags): op(op), args(0), flags(flags), value(std::move(value)) {} -}; - -} // namespace inja - -#endif // PANTOR_INJA_BYTECODE_HPP - -// #include "string_view.hpp" - - - -namespace inja { - -using namespace nlohmann; - -using Arguments = std::vector; -using CallbackFunction = std::function; - /*! - * \brief Class for builtin functions and user-defined callbacks. + * \brief Class for render configuration. */ -class FunctionStorage { - public: - void add_builtin(nonstd::string_view name, unsigned int num_args, Bytecode::Op op) { - auto& data = get_or_new(name, num_args); - data.op = op; - } - - void add_callback(nonstd::string_view name, unsigned int num_args, const CallbackFunction& function) { - auto& data = get_or_new(name, num_args); - data.function = function; - } - - Bytecode::Op find_builtin(nonstd::string_view name, unsigned int num_args) const { - if (auto ptr = get(name, num_args)) { - return ptr->op; - } - return Bytecode::Op::Nop; - } - - CallbackFunction find_callback(nonstd::string_view name, unsigned int num_args) const { - if (auto ptr = get(name, num_args)) { - return ptr->function; - } - return nullptr; - } - - private: - struct FunctionData { - unsigned int num_args {0}; - Bytecode::Op op {Bytecode::Op::Nop}; // for builtins - CallbackFunction function; // for callbacks - }; - - FunctionData& get_or_new(nonstd::string_view name, unsigned int num_args) { - auto &vec = m_map[static_cast(name)]; - for (auto &i: vec) { - if (i.num_args == num_args) return i; - } - vec.emplace_back(); - vec.back().num_args = num_args; - return vec.back(); - } - - const FunctionData* get(nonstd::string_view name, unsigned int num_args) const { - auto it = m_map.find(static_cast(name)); - if (it == m_map.end()) return nullptr; - for (auto &&i: it->second) { - if (i.num_args == num_args) return &i; - } - return nullptr; - } - - std::map> m_map; +struct RenderConfig { + bool throw_at_missing_includes {true}; }; -} +} // namespace inja -#endif // PANTOR_INJA_FUNCTION_STORAGE_HPP +#endif // INCLUDE_INJA_CONFIG_HPP_ + +// #include "function_storage.hpp" // #include "parser.hpp" -#ifndef PANTOR_INJA_PARSER_HPP -#define PANTOR_INJA_PARSER_HPP +#ifndef INCLUDE_INJA_PARSER_HPP_ +#define INCLUDE_INJA_PARSER_HPP_ #include +#include #include -#include +#include #include -// #include "bytecode.hpp" - // #include "config.hpp" +// #include "exceptions.hpp" + // #include "function_storage.hpp" // #include "lexer.hpp" -#ifndef PANTOR_INJA_LEXER_HPP -#define PANTOR_INJA_LEXER_HPP +#ifndef INCLUDE_INJA_LEXER_HPP_ +#define INCLUDE_INJA_LEXER_HPP_ #include #include @@ -1694,130 +918,81 @@ class FunctionStorage { // #include "config.hpp" // #include "token.hpp" -#ifndef PANTOR_INJA_TOKEN_HPP -#define PANTOR_INJA_TOKEN_HPP +#ifndef INCLUDE_INJA_TOKEN_HPP_ +#define INCLUDE_INJA_TOKEN_HPP_ #include - -// #include "string_view.hpp" - - +#include namespace inja { /*! - * \brief Helper-class for the inja Parser. + * \brief Helper-class for the inja Lexer. */ struct Token { enum class Kind { Text, - ExpressionOpen, // {{ - ExpressionClose, // }} - LineStatementOpen, // ## - LineStatementClose, // \n - StatementOpen, // {% - StatementClose, // %} - CommentOpen, // {# - CommentClose, // #} - Id, // this, this.foo - Number, // 1, 2, -1, 5.2, -5.3 - String, // "this" - Comma, // , - Colon, // : - LeftParen, // ( - RightParen, // ) - LeftBracket, // [ - RightBracket, // ] - LeftBrace, // { - RightBrace, // } - Equal, // == - GreaterThan, // > - GreaterEqual, // >= - LessThan, // < - LessEqual, // <= - NotEqual, // != + ExpressionOpen, // {{ + ExpressionClose, // }} + LineStatementOpen, // ## + LineStatementClose, // \n + StatementOpen, // {% + StatementClose, // %} + CommentOpen, // {# + CommentClose, // #} + Id, // this, this.foo + Number, // 1, 2, -1, 5.2, -5.3 + String, // "this" + Plus, // + + Minus, // - + Times, // * + Slash, // / + Percent, // % + Power, // ^ + Comma, // , + Dot, // . + Colon, // : + LeftParen, // ( + RightParen, // ) + LeftBracket, // [ + RightBracket, // ] + LeftBrace, // { + RightBrace, // } + Equal, // == + NotEqual, // != + GreaterThan, // > + GreaterEqual, // >= + LessThan, // < + LessEqual, // <= Unknown, - Eof - } kind {Kind::Unknown}; + Eof, + }; - nonstd::string_view text; + Kind kind {Kind::Unknown}; + std::string_view text; - constexpr Token() = default; - constexpr Token(Kind kind, nonstd::string_view text): kind(kind), text(text) {} + explicit constexpr Token() = default; + explicit constexpr Token(Kind kind, std::string_view text): kind(kind), text(text) {} std::string describe() const { switch (kind) { - case Kind::Text: - return ""; - case Kind::LineStatementClose: - return ""; - case Kind::Eof: - return ""; - default: - return static_cast(text); + case Kind::Text: + return ""; + case Kind::LineStatementClose: + return ""; + case Kind::Eof: + return ""; + default: + return static_cast(text); } } }; -} +} // namespace inja -#endif // PANTOR_INJA_TOKEN_HPP +#endif // INCLUDE_INJA_TOKEN_HPP_ // #include "utils.hpp" -#ifndef PANTOR_INJA_UTILS_HPP -#define PANTOR_INJA_UTILS_HPP - -#include -#include -#include -#include -#include - -// #include "string_view.hpp" - - - -namespace inja { - -inline void inja_throw(const std::string& type, const std::string& message) { - throw std::runtime_error("[inja.exception." + type + "] " + message); -} - -inline std::ifstream open_file_or_throw(const std::string& path) { - std::ifstream file; - file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - try { - file.open(path); - } catch(const std::ios_base::failure& e) { - inja_throw("file_error", "failed accessing file at '" + path + "'"); - } - return file; -} - -namespace string_view { - inline nonstd::string_view slice(nonstd::string_view view, size_t start, size_t end) { - start = std::min(start, view.size()); - end = std::min(std::max(start, end), view.size()); - return view.substr(start, end - start); // StringRef(Data + Start, End - Start); - } - - inline std::pair split(nonstd::string_view view, char Separator) { - size_t idx = view.find(Separator); - if (idx == nonstd::string_view::npos) { - return std::make_pair(view, nonstd::string_view()); - } - return std::make_pair(slice(view, 0, idx), slice(view, idx + 1, nonstd::string_view::npos)); - } - - inline bool starts_with(nonstd::string_view view, nonstd::string_view prefix) { - return (view.size() >= prefix.size() && view.compare(0, prefix.size(), prefix) == 0); - } -} // namespace string - -} // namespace inja - -#endif // PANTOR_INJA_UTILS_HPP - namespace inja { @@ -1829,236 +1004,190 @@ class Lexer { enum class State { Text, ExpressionStart, + ExpressionStartForceLstrip, ExpressionBody, LineStart, LineBody, StatementStart, + StatementStartNoLstrip, + StatementStartForceLstrip, StatementBody, CommentStart, - CommentBody - } m_state; + CommentStartForceLstrip, + CommentBody, + }; - const LexerConfig& m_config; - nonstd::string_view m_in; - size_t m_tok_start; - size_t m_pos; + enum class MinusState { + Operator, + Number, + }; - public: - explicit Lexer(const LexerConfig& config) : m_config(config) {} + const LexerConfig& config; - void start(nonstd::string_view in) { - m_in = in; - m_tok_start = 0; - m_pos = 0; - m_state = State::Text; - } + State state; + MinusState minus_state; + std::string_view m_in; + size_t tok_start; + size_t pos; - Token scan() { - m_tok_start = m_pos; - - again: - if (m_tok_start >= m_in.size()) return make_token(Token::Kind::Eof); - - switch (m_state) { - default: - case State::Text: { - // fast-scan to first open character - size_t open_start = m_in.substr(m_pos).find_first_of(m_config.open_chars); - if (open_start == nonstd::string_view::npos) { - // didn't find open, return remaining text as text token - m_pos = m_in.size(); - return make_token(Token::Kind::Text); - } - m_pos += open_start; - - // try to match one of the opening sequences, and get the close - nonstd::string_view open_str = m_in.substr(m_pos); - bool must_lstrip = false; - if (inja::string_view::starts_with(open_str, m_config.expression_open)) { - m_state = State::ExpressionStart; - } else if (inja::string_view::starts_with(open_str, m_config.statement_open)) { - m_state = State::StatementStart; - must_lstrip = m_config.lstrip_blocks; - } else if (inja::string_view::starts_with(open_str, m_config.comment_open)) { - m_state = State::CommentStart; - must_lstrip = m_config.lstrip_blocks; - } else if ((m_pos == 0 || m_in[m_pos - 1] == '\n') && - inja::string_view::starts_with(open_str, m_config.line_statement)) { - m_state = State::LineStart; - } else { - m_pos += 1; // wasn't actually an opening sequence - goto again; - } - - nonstd::string_view text = string_view::slice(m_in, m_tok_start, m_pos); - if (must_lstrip) - text = clear_final_line_if_whitespace(text); - - if (text.empty()) goto again; // don't generate empty token - return Token(Token::Kind::Text, text); - } - case State::ExpressionStart: { - m_state = State::ExpressionBody; - m_pos += m_config.expression_open.size(); - return make_token(Token::Kind::ExpressionOpen); - } - case State::LineStart: { - m_state = State::LineBody; - m_pos += m_config.line_statement.size(); - return make_token(Token::Kind::LineStatementOpen); - } - case State::StatementStart: { - m_state = State::StatementBody; - m_pos += m_config.statement_open.size(); - return make_token(Token::Kind::StatementOpen); - } - case State::CommentStart: { - m_state = State::CommentBody; - m_pos += m_config.comment_open.size(); - return make_token(Token::Kind::CommentOpen); - } - case State::ExpressionBody: - return scan_body(m_config.expression_close, Token::Kind::ExpressionClose); - case State::LineBody: - return scan_body("\n", Token::Kind::LineStatementClose); - case State::StatementBody: - return scan_body(m_config.statement_close, Token::Kind::StatementClose, m_config.trim_blocks); - case State::CommentBody: { - // fast-scan to comment close - size_t end = m_in.substr(m_pos).find(m_config.comment_close); - if (end == nonstd::string_view::npos) { - m_pos = m_in.size(); - return make_token(Token::Kind::Eof); - } - // return the entire comment in the close token - m_state = State::Text; - m_pos += end + m_config.comment_close.size(); - Token tok = make_token(Token::Kind::CommentClose); - if (m_config.trim_blocks) - skip_newline(); - return tok; - } - } - } - - const LexerConfig& get_config() const { return m_config; } - - private: - Token scan_body(nonstd::string_view close, Token::Kind closeKind, bool trim = false) { + Token scan_body(std::string_view close, Token::Kind closeKind, std::string_view close_trim = std::string_view(), bool trim = false) { again: // skip whitespace (except for \n as it might be a close) - if (m_tok_start >= m_in.size()) return make_token(Token::Kind::Eof); - char ch = m_in[m_tok_start]; + if (tok_start >= m_in.size()) { + return make_token(Token::Kind::Eof); + } + const char ch = m_in[tok_start]; if (ch == ' ' || ch == '\t' || ch == '\r') { - m_tok_start += 1; + tok_start += 1; goto again; } // check for close - if (inja::string_view::starts_with(m_in.substr(m_tok_start), close)) { - m_state = State::Text; - m_pos = m_tok_start + close.size(); - Token tok = make_token(closeKind); - if (trim) - skip_newline(); + if (!close_trim.empty() && inja::string_view::starts_with(m_in.substr(tok_start), close_trim)) { + state = State::Text; + pos = tok_start + close_trim.size(); + const Token tok = make_token(closeKind); + skip_whitespaces_and_newlines(); + return tok; + } + + if (inja::string_view::starts_with(m_in.substr(tok_start), close)) { + state = State::Text; + pos = tok_start + close.size(); + const Token tok = make_token(closeKind); + if (trim) { + skip_whitespaces_and_first_newline(); + } return tok; } // skip \n if (ch == '\n') { - m_tok_start += 1; + tok_start += 1; goto again; } - m_pos = m_tok_start + 1; - if (std::isalpha(ch)) return scan_id(); + pos = tok_start + 1; + if (std::isalpha(ch)) { + minus_state = MinusState::Operator; + return scan_id(); + } + + const MinusState current_minus_state = minus_state; + if (minus_state == MinusState::Operator) { + minus_state = MinusState::Number; + } + switch (ch) { - case ',': - return make_token(Token::Kind::Comma); - case ':': - return make_token(Token::Kind::Colon); - case '(': - return make_token(Token::Kind::LeftParen); - case ')': - return make_token(Token::Kind::RightParen); - case '[': - return make_token(Token::Kind::LeftBracket); - case ']': - return make_token(Token::Kind::RightBracket); - case '{': - return make_token(Token::Kind::LeftBrace); - case '}': - return make_token(Token::Kind::RightBrace); - case '>': - if (m_pos < m_in.size() && m_in[m_pos] == '=') { - m_pos += 1; - return make_token(Token::Kind::GreaterEqual); - } - return make_token(Token::Kind::GreaterThan); - case '<': - if (m_pos < m_in.size() && m_in[m_pos] == '=') { - m_pos += 1; - return make_token(Token::Kind::LessEqual); - } - return make_token(Token::Kind::LessThan); - case '=': - if (m_pos < m_in.size() && m_in[m_pos] == '=') { - m_pos += 1; - return make_token(Token::Kind::Equal); - } - return make_token(Token::Kind::Unknown); - case '!': - if (m_pos < m_in.size() && m_in[m_pos] == '=') { - m_pos += 1; - return make_token(Token::Kind::NotEqual); - } - return make_token(Token::Kind::Unknown); - case '\"': - return scan_string(); - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '-': - return scan_number(); - case '_': - return scan_id(); - default: - return make_token(Token::Kind::Unknown); + case '+': + return make_token(Token::Kind::Plus); + case '-': + if (current_minus_state == MinusState::Operator) { + return make_token(Token::Kind::Minus); + } + return scan_number(); + case '*': + return make_token(Token::Kind::Times); + case '/': + return make_token(Token::Kind::Slash); + case '^': + return make_token(Token::Kind::Power); + case '%': + return make_token(Token::Kind::Percent); + case '.': + return make_token(Token::Kind::Dot); + case ',': + return make_token(Token::Kind::Comma); + case ':': + return make_token(Token::Kind::Colon); + case '(': + return make_token(Token::Kind::LeftParen); + case ')': + minus_state = MinusState::Operator; + return make_token(Token::Kind::RightParen); + case '[': + return make_token(Token::Kind::LeftBracket); + case ']': + minus_state = MinusState::Operator; + return make_token(Token::Kind::RightBracket); + case '{': + return make_token(Token::Kind::LeftBrace); + case '}': + minus_state = MinusState::Operator; + return make_token(Token::Kind::RightBrace); + case '>': + if (pos < m_in.size() && m_in[pos] == '=') { + pos += 1; + return make_token(Token::Kind::GreaterEqual); + } + return make_token(Token::Kind::GreaterThan); + case '<': + if (pos < m_in.size() && m_in[pos] == '=') { + pos += 1; + return make_token(Token::Kind::LessEqual); + } + return make_token(Token::Kind::LessThan); + case '=': + if (pos < m_in.size() && m_in[pos] == '=') { + pos += 1; + return make_token(Token::Kind::Equal); + } + return make_token(Token::Kind::Unknown); + case '!': + if (pos < m_in.size() && m_in[pos] == '=') { + pos += 1; + return make_token(Token::Kind::NotEqual); + } + return make_token(Token::Kind::Unknown); + case '\"': + return scan_string(); + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + minus_state = MinusState::Operator; + return scan_number(); + case '_': + case '@': + case '$': + minus_state = MinusState::Operator; + return scan_id(); + default: + return make_token(Token::Kind::Unknown); } } Token scan_id() { for (;;) { - if (m_pos >= m_in.size()) { + if (pos >= m_in.size()) { break; } - char ch = m_in[m_pos]; + const char ch = m_in[pos]; if (!std::isalnum(ch) && ch != '.' && ch != '/' && ch != '_' && ch != '-') { break; } - m_pos += 1; + pos += 1; } return make_token(Token::Kind::Id); } Token scan_number() { for (;;) { - if (m_pos >= m_in.size()) { + if (pos >= m_in.size()) { break; } - char ch = m_in[m_pos]; + const char ch = m_in[pos]; // be very permissive in lexer (we'll catch errors when conversion happens) - if (!std::isdigit(ch) && ch != '.' && ch != 'e' && ch != 'E' && ch != '+' && ch != '-') { + if (!(std::isdigit(ch) || ch == '.' || ch == 'e' || ch == 'E' || (ch == '+' && (pos == 0 || m_in[pos-1] == 'e' || m_in[pos-1] == 'E')) || (ch == '-' && (pos == 0 || m_in[pos-1] == 'e' || m_in[pos-1] == 'E')))) { break; } - m_pos += 1; + pos += 1; } return make_token(Token::Kind::Number); } @@ -2066,11 +1195,13 @@ class Lexer { Token scan_string() { bool escape {false}; for (;;) { - if (m_pos >= m_in.size()) break; - char ch = m_in[m_pos++]; + if (pos >= m_in.size()) { + break; + } + const char ch = m_in[pos++]; if (ch == '\\') { escape = true; - } else if (!escape && ch == m_in[m_tok_start]) { + } else if (!escape && ch == m_in[tok_start]) { break; } else { escape = false; @@ -2080,675 +1211,870 @@ class Lexer { } Token make_token(Token::Kind kind) const { - return Token(kind, string_view::slice(m_in, m_tok_start, m_pos)); + return Token(kind, string_view::slice(m_in, tok_start, pos)); } - void skip_newline() { - if (m_pos < m_in.size()) { - char ch = m_in[m_pos]; - if (ch == '\n') - m_pos += 1; - else if (ch == '\r') { - m_pos += 1; - if (m_pos < m_in.size() && m_in[m_pos] == '\n') - m_pos += 1; + void skip_whitespaces_and_newlines() { + if (pos < m_in.size()) { + while (pos < m_in.size() && (m_in[pos] == ' ' || m_in[pos] == '\t' || m_in[pos] == '\n' || m_in[pos] == '\r')) { + pos += 1; } } } - static nonstd::string_view clear_final_line_if_whitespace(nonstd::string_view text) - { - nonstd::string_view result = text; + void skip_whitespaces_and_first_newline() { + if (pos < m_in.size()) { + while (pos < m_in.size() && (m_in[pos] == ' ' || m_in[pos] == '\t')) { + pos += 1; + } + } + + if (pos < m_in.size()) { + const char ch = m_in[pos]; + if (ch == '\n') { + pos += 1; + } else if (ch == '\r') { + pos += 1; + if (pos < m_in.size() && m_in[pos] == '\n') { + pos += 1; + } + } + } + } + + static std::string_view clear_final_line_if_whitespace(std::string_view text) { + std::string_view result = text; while (!result.empty()) { - char ch = result.back(); - if (ch == ' ' || ch == '\t') - result.remove_suffix(1); - else if (ch == '\n' || ch == '\r') + const char ch = result.back(); + if (ch == ' ' || ch == '\t') { + result.remove_suffix(1); + } else if (ch == '\n' || ch == '\r') { break; - else + } else { return text; + } } return result; } + +public: + explicit Lexer(const LexerConfig& config): config(config), state(State::Text), minus_state(MinusState::Number) {} + + SourceLocation current_position() const { + return get_source_location(m_in, tok_start); + } + + void start(std::string_view input) { + m_in = input; + tok_start = 0; + pos = 0; + state = State::Text; + minus_state = MinusState::Number; + + // Consume byte order mark (BOM) for UTF-8 + if (inja::string_view::starts_with(m_in, "\xEF\xBB\xBF")) { + m_in = m_in.substr(3); + } + } + + Token scan() { + tok_start = pos; + + again: + if (tok_start >= m_in.size()) { + return make_token(Token::Kind::Eof); + } + + switch (state) { + default: + case State::Text: { + // fast-scan to first open character + const size_t open_start = m_in.substr(pos).find_first_of(config.open_chars); + if (open_start == std::string_view::npos) { + // didn't find open, return remaining text as text token + pos = m_in.size(); + return make_token(Token::Kind::Text); + } + pos += open_start; + + // try to match one of the opening sequences, and get the close + std::string_view open_str = m_in.substr(pos); + bool must_lstrip = false; + if (inja::string_view::starts_with(open_str, config.expression_open)) { + if (inja::string_view::starts_with(open_str, config.expression_open_force_lstrip)) { + state = State::ExpressionStartForceLstrip; + must_lstrip = true; + } else { + state = State::ExpressionStart; + } + } else if (inja::string_view::starts_with(open_str, config.statement_open)) { + if (inja::string_view::starts_with(open_str, config.statement_open_no_lstrip)) { + state = State::StatementStartNoLstrip; + } else if (inja::string_view::starts_with(open_str, config.statement_open_force_lstrip)) { + state = State::StatementStartForceLstrip; + must_lstrip = true; + } else { + state = State::StatementStart; + must_lstrip = config.lstrip_blocks; + } + } else if (inja::string_view::starts_with(open_str, config.comment_open)) { + if (inja::string_view::starts_with(open_str, config.comment_open_force_lstrip)) { + state = State::CommentStartForceLstrip; + must_lstrip = true; + } else { + state = State::CommentStart; + must_lstrip = config.lstrip_blocks; + } + } else if ((pos == 0 || m_in[pos - 1] == '\n') && inja::string_view::starts_with(open_str, config.line_statement)) { + state = State::LineStart; + } else { + pos += 1; // wasn't actually an opening sequence + goto again; + } + + std::string_view text = string_view::slice(m_in, tok_start, pos); + if (must_lstrip) { + text = clear_final_line_if_whitespace(text); + } + + if (text.empty()) { + goto again; // don't generate empty token + } + return Token(Token::Kind::Text, text); + } + case State::ExpressionStart: { + state = State::ExpressionBody; + pos += config.expression_open.size(); + return make_token(Token::Kind::ExpressionOpen); + } + case State::ExpressionStartForceLstrip: { + state = State::ExpressionBody; + pos += config.expression_open_force_lstrip.size(); + return make_token(Token::Kind::ExpressionOpen); + } + case State::LineStart: { + state = State::LineBody; + pos += config.line_statement.size(); + return make_token(Token::Kind::LineStatementOpen); + } + case State::StatementStart: { + state = State::StatementBody; + pos += config.statement_open.size(); + return make_token(Token::Kind::StatementOpen); + } + case State::StatementStartNoLstrip: { + state = State::StatementBody; + pos += config.statement_open_no_lstrip.size(); + return make_token(Token::Kind::StatementOpen); + } + case State::StatementStartForceLstrip: { + state = State::StatementBody; + pos += config.statement_open_force_lstrip.size(); + return make_token(Token::Kind::StatementOpen); + } + case State::CommentStart: { + state = State::CommentBody; + pos += config.comment_open.size(); + return make_token(Token::Kind::CommentOpen); + } + case State::CommentStartForceLstrip: { + state = State::CommentBody; + pos += config.comment_open_force_lstrip.size(); + return make_token(Token::Kind::CommentOpen); + } + case State::ExpressionBody: + return scan_body(config.expression_close, Token::Kind::ExpressionClose, config.expression_close_force_rstrip); + case State::LineBody: + return scan_body("\n", Token::Kind::LineStatementClose); + case State::StatementBody: + return scan_body(config.statement_close, Token::Kind::StatementClose, config.statement_close_force_rstrip, config.trim_blocks); + case State::CommentBody: { + // fast-scan to comment close + const size_t end = m_in.substr(pos).find(config.comment_close); + if (end == std::string_view::npos) { + pos = m_in.size(); + return make_token(Token::Kind::Eof); + } + + // Check for trim pattern + const bool must_rstrip = inja::string_view::starts_with(m_in.substr(pos + end - 1), config.comment_close_force_rstrip); + + // return the entire comment in the close token + state = State::Text; + pos += end + config.comment_close.size(); + Token tok = make_token(Token::Kind::CommentClose); + + if (must_rstrip || config.trim_blocks) { + skip_whitespaces_and_first_newline(); + } + return tok; + } + } + } + + const LexerConfig& get_config() const { + return config; + } }; -} +} // namespace inja -#endif // PANTOR_INJA_LEXER_HPP +#endif // INCLUDE_INJA_LEXER_HPP_ + +// #include "node.hpp" // #include "template.hpp" -#ifndef PANTOR_INJA_TEMPLATE_HPP -#define PANTOR_INJA_TEMPLATE_HPP - -#include -#include -#include - -// #include "bytecode.hpp" - - - -namespace inja { - -/*! - * \brief The main inja Template. - */ -struct Template { - std::vector bytecodes; - std::string content; -}; - -using TemplateStorage = std::map; - -} - -#endif // PANTOR_INJA_TEMPLATE_HPP // #include "token.hpp" // #include "utils.hpp" -#include - - namespace inja { -class ParserStatic { - ParserStatic() { - functions.add_builtin("at", 2, Bytecode::Op::At); - functions.add_builtin("default", 2, Bytecode::Op::Default); - functions.add_builtin("divisibleBy", 2, Bytecode::Op::DivisibleBy); - functions.add_builtin("even", 1, Bytecode::Op::Even); - functions.add_builtin("first", 1, Bytecode::Op::First); - functions.add_builtin("float", 1, Bytecode::Op::Float); - functions.add_builtin("int", 1, Bytecode::Op::Int); - functions.add_builtin("last", 1, Bytecode::Op::Last); - functions.add_builtin("length", 1, Bytecode::Op::Length); - functions.add_builtin("lower", 1, Bytecode::Op::Lower); - functions.add_builtin("max", 1, Bytecode::Op::Max); - functions.add_builtin("min", 1, Bytecode::Op::Min); - functions.add_builtin("odd", 1, Bytecode::Op::Odd); - functions.add_builtin("range", 1, Bytecode::Op::Range); - functions.add_builtin("round", 2, Bytecode::Op::Round); - functions.add_builtin("sort", 1, Bytecode::Op::Sort); - functions.add_builtin("upper", 1, Bytecode::Op::Upper); - functions.add_builtin("exists", 1, Bytecode::Op::Exists); - functions.add_builtin("existsIn", 2, Bytecode::Op::ExistsInObject); - functions.add_builtin("isBoolean", 1, Bytecode::Op::IsBoolean); - functions.add_builtin("isNumber", 1, Bytecode::Op::IsNumber); - functions.add_builtin("isInteger", 1, Bytecode::Op::IsInteger); - functions.add_builtin("isFloat", 1, Bytecode::Op::IsFloat); - functions.add_builtin("isObject", 1, Bytecode::Op::IsObject); - functions.add_builtin("isArray", 1, Bytecode::Op::IsArray); - functions.add_builtin("isString", 1, Bytecode::Op::IsString); - } - - public: - ParserStatic(const ParserStatic&) = delete; - ParserStatic& operator=(const ParserStatic&) = delete; - - static const ParserStatic& get_instance() { - static ParserStatic inst; - return inst; - } - - FunctionStorage functions; -}; - /*! * \brief Class for parsing an inja Template. */ class Parser { - public: - explicit Parser(const ParserConfig& parser_config, const LexerConfig& lexer_config, TemplateStorage& included_templates): m_config(parser_config), m_lexer(lexer_config), m_included_templates(included_templates), m_static(ParserStatic::get_instance()) { } + const ParserConfig& config; - bool parse_expression(Template& tmpl) { - if (!parse_expression_and(tmpl)) return false; - if (m_tok.kind != Token::Kind::Id || m_tok.text != static_cast("or")) return true; - get_next_token(); - if (!parse_expression_and(tmpl)) return false; - append_function(tmpl, Bytecode::Op::Or, 2); - return true; + Lexer lexer; + TemplateStorage& template_storage; + const FunctionStorage& function_storage; + + Token tok, peek_tok; + bool have_peek_tok {false}; + + size_t current_paren_level {0}; + size_t current_bracket_level {0}; + size_t current_brace_level {0}; + + std::string_view literal_start; + + BlockNode* current_block {nullptr}; + ExpressionListNode* current_expression_list {nullptr}; + std::stack> function_stack; + std::vector> arguments; + + std::stack> operator_stack; + std::stack if_statement_stack; + std::stack for_statement_stack; + std::stack block_statement_stack; + + inline void throw_parser_error(const std::string& message) const { + INJA_THROW(ParserError(message, lexer.current_position())); } - bool parse_expression_and(Template& tmpl) { - if (!parse_expression_not(tmpl)) return false; - if (m_tok.kind != Token::Kind::Id || m_tok.text != static_cast("and")) return true; - get_next_token(); - if (!parse_expression_not(tmpl)) return false; - append_function(tmpl, Bytecode::Op::And, 2); - return true; - } - - bool parse_expression_not(Template& tmpl) { - if (m_tok.kind == Token::Kind::Id && m_tok.text == static_cast("not")) { - get_next_token(); - if (!parse_expression_not(tmpl)) return false; - append_function(tmpl, Bytecode::Op::Not, 1); - return true; + inline void get_next_token() { + if (have_peek_tok) { + tok = peek_tok; + have_peek_tok = false; } else { - return parse_expression_comparison(tmpl); + tok = lexer.scan(); } } - bool parse_expression_comparison(Template& tmpl) { - if (!parse_expression_datum(tmpl)) return false; - Bytecode::Op op; - switch (m_tok.kind) { - case Token::Kind::Id: - if (m_tok.text == static_cast("in")) - op = Bytecode::Op::In; - else - return true; - break; - case Token::Kind::Equal: - op = Bytecode::Op::Equal; - break; - case Token::Kind::GreaterThan: - op = Bytecode::Op::Greater; - break; - case Token::Kind::LessThan: - op = Bytecode::Op::Less; - break; - case Token::Kind::LessEqual: - op = Bytecode::Op::LessEqual; - break; - case Token::Kind::GreaterEqual: - op = Bytecode::Op::GreaterEqual; - break; - case Token::Kind::NotEqual: - op = Bytecode::Op::Different; - break; - default: - return true; + inline void get_peek_token() { + if (!have_peek_tok) { + peek_tok = lexer.scan(); + have_peek_tok = true; } - get_next_token(); - if (!parse_expression_datum(tmpl)) return false; - append_function(tmpl, op, 2); - return true; } - bool parse_expression_datum(Template& tmpl) { - nonstd::string_view json_first; - size_t bracket_level = 0; - size_t brace_level = 0; + inline void add_literal(const char* content_ptr) { + std::string_view data_text(literal_start.data(), tok.text.data() - literal_start.data() + tok.text.size()); + arguments.emplace_back(std::make_shared(data_text, data_text.data() - content_ptr)); + } - for (;;) { - switch (m_tok.kind) { - case Token::Kind::LeftParen: { - get_next_token(); - if (!parse_expression(tmpl)) return false; - if (m_tok.kind != Token::Kind::RightParen) { - inja_throw("parser_error", "unmatched '('"); - } - get_next_token(); - return true; + inline void add_operator() { + auto function = operator_stack.top(); + operator_stack.pop(); + + for (int i = 0; i < function->number_args; ++i) { + function->arguments.insert(function->arguments.begin(), arguments.back()); + arguments.pop_back(); + } + arguments.emplace_back(function); + } + + void add_to_template_storage(std::string_view path, std::string& template_name) { + if (template_storage.find(template_name) != template_storage.end()) { + return; + } + + std::string original_path = static_cast(path); + std::string original_name = template_name; + + if (config.search_included_templates_in_files) { + // Build the relative path + template_name = original_path + original_name; + if (template_name.compare(0, 2, "./") == 0) { + template_name.erase(0, 2); + } + + if (template_storage.find(template_name) == template_storage.end()) { + // Load file + std::ifstream file; + file.open(template_name); + if (!file.fail()) { + std::string text((std::istreambuf_iterator(file)), std::istreambuf_iterator()); + + auto include_template = Template(text); + template_storage.emplace(template_name, include_template); + parse_into_template(template_storage[template_name], template_name); + return; + } else if (!config.include_callback) { + INJA_THROW(FileError("failed accessing file at '" + template_name + "'")); } - case Token::Kind::Id: - get_peek_token(); - if (m_peek_tok.kind == Token::Kind::LeftParen) { - // function call, parse arguments - Token func_token = m_tok; - get_next_token(); // id - get_next_token(); // leftParen - unsigned int num_args = 0; - if (m_tok.kind == Token::Kind::RightParen) { - // no args - get_next_token(); - } else { - for (;;) { - if (!parse_expression(tmpl)) { - inja_throw("parser_error", "expected expression, got '" + m_tok.describe() + "'"); - } - num_args += 1; - if (m_tok.kind == Token::Kind::RightParen) { - get_next_token(); - break; - } - if (m_tok.kind != Token::Kind::Comma) { - inja_throw("parser_error", "expected ')' or ',', got '" + m_tok.describe() + "'"); - } - get_next_token(); - } - } + } + } - auto op = m_static.functions.find_builtin(func_token.text, num_args); + // Try include callback + if (config.include_callback) { + auto include_template = config.include_callback(original_path, original_name); + template_storage.emplace(template_name, include_template); + } + } - if (op != Bytecode::Op::Nop) { - // swap arguments for default(); see comment in RenderTo() - if (op == Bytecode::Op::Default) - std::swap(tmpl.bytecodes.back(), *(tmpl.bytecodes.rbegin() + 1)); - append_function(tmpl, op, num_args); - return true; - } else { - append_callback(tmpl, func_token.text, num_args); - return true; - } - } else if (m_tok.text == static_cast("true") || - m_tok.text == static_cast("false") || - m_tok.text == static_cast("null")) { - // true, false, null are json literals - if (brace_level == 0 && bracket_level == 0) { - json_first = m_tok.text; - goto returnJson; - } - break; + std::string parse_filename(const Token& tok) const { + if (tok.kind != Token::Kind::String) { + throw_parser_error("expected string, got '" + tok.describe() + "'"); + } + + if (tok.text.length() < 2) { + throw_parser_error("expected filename, got '" + static_cast(tok.text) + "'"); + } + + // Remove first and last character "" + return std::string {tok.text.substr(1, tok.text.length() - 2)}; + } + + bool parse_expression(Template& tmpl, Token::Kind closing) { + while (tok.kind != closing && tok.kind != Token::Kind::Eof) { + // Literals + switch (tok.kind) { + case Token::Kind::String: { + if (current_brace_level == 0 && current_bracket_level == 0) { + literal_start = tok.text; + add_literal(tmpl.content.c_str()); + } + } break; + case Token::Kind::Number: { + if (current_brace_level == 0 && current_bracket_level == 0) { + literal_start = tok.text; + add_literal(tmpl.content.c_str()); + } + } break; + case Token::Kind::LeftBracket: { + if (current_brace_level == 0 && current_bracket_level == 0) { + literal_start = tok.text; + } + current_bracket_level += 1; + } break; + case Token::Kind::LeftBrace: { + if (current_brace_level == 0 && current_bracket_level == 0) { + literal_start = tok.text; + } + current_brace_level += 1; + } break; + case Token::Kind::RightBracket: { + if (current_bracket_level == 0) { + throw_parser_error("unexpected ']'"); + } + + current_bracket_level -= 1; + if (current_brace_level == 0 && current_bracket_level == 0) { + add_literal(tmpl.content.c_str()); + } + } break; + case Token::Kind::RightBrace: { + if (current_brace_level == 0) { + throw_parser_error("unexpected '}'"); + } + + current_brace_level -= 1; + if (current_brace_level == 0 && current_bracket_level == 0) { + add_literal(tmpl.content.c_str()); + } + } break; + case Token::Kind::Id: { + get_peek_token(); + + // Data Literal + if (tok.text == static_cast("true") || tok.text == static_cast("false") || + tok.text == static_cast("null")) { + if (current_brace_level == 0 && current_bracket_level == 0) { + literal_start = tok.text; + add_literal(tmpl.content.c_str()); + } + + // Operator + } else if (tok.text == "and" || tok.text == "or" || tok.text == "in" || tok.text == "not") { + goto parse_operator; + + // Functions + } else if (peek_tok.kind == Token::Kind::LeftParen) { + operator_stack.emplace(std::make_shared(static_cast(tok.text), tok.text.data() - tmpl.content.c_str())); + function_stack.emplace(operator_stack.top().get(), current_paren_level); + + // Variables + } else { + arguments.emplace_back(std::make_shared(static_cast(tok.text), tok.text.data() - tmpl.content.c_str())); + } + + // Operators + } break; + case Token::Kind::Equal: + case Token::Kind::NotEqual: + case Token::Kind::GreaterThan: + case Token::Kind::GreaterEqual: + case Token::Kind::LessThan: + case Token::Kind::LessEqual: + case Token::Kind::Plus: + case Token::Kind::Minus: + case Token::Kind::Times: + case Token::Kind::Slash: + case Token::Kind::Power: + case Token::Kind::Percent: + case Token::Kind::Dot: { + + parse_operator: + FunctionStorage::Operation operation; + switch (tok.kind) { + case Token::Kind::Id: { + if (tok.text == "and") { + operation = FunctionStorage::Operation::And; + } else if (tok.text == "or") { + operation = FunctionStorage::Operation::Or; + } else if (tok.text == "in") { + operation = FunctionStorage::Operation::In; + } else if (tok.text == "not") { + operation = FunctionStorage::Operation::Not; } else { - // normal literal (json read) - tmpl.bytecodes.emplace_back( - Bytecode::Op::Push, m_tok.text, - m_config.notation == ElementNotation::Pointer ? Bytecode::Flag::ValueLookupPointer : Bytecode::Flag::ValueLookupDot); - get_next_token(); - return true; + throw_parser_error("unknown operator in parser."); } - // json passthrough - case Token::Kind::Number: - case Token::Kind::String: - if (brace_level == 0 && bracket_level == 0) { - json_first = m_tok.text; - goto returnJson; + } break; + case Token::Kind::Equal: { + operation = FunctionStorage::Operation::Equal; + } break; + case Token::Kind::NotEqual: { + operation = FunctionStorage::Operation::NotEqual; + } break; + case Token::Kind::GreaterThan: { + operation = FunctionStorage::Operation::Greater; + } break; + case Token::Kind::GreaterEqual: { + operation = FunctionStorage::Operation::GreaterEqual; + } break; + case Token::Kind::LessThan: { + operation = FunctionStorage::Operation::Less; + } break; + case Token::Kind::LessEqual: { + operation = FunctionStorage::Operation::LessEqual; + } break; + case Token::Kind::Plus: { + operation = FunctionStorage::Operation::Add; + } break; + case Token::Kind::Minus: { + operation = FunctionStorage::Operation::Subtract; + } break; + case Token::Kind::Times: { + operation = FunctionStorage::Operation::Multiplication; + } break; + case Token::Kind::Slash: { + operation = FunctionStorage::Operation::Division; + } break; + case Token::Kind::Power: { + operation = FunctionStorage::Operation::Power; + } break; + case Token::Kind::Percent: { + operation = FunctionStorage::Operation::Modulo; + } break; + case Token::Kind::Dot: { + operation = FunctionStorage::Operation::AtId; + } break; + default: { + throw_parser_error("unknown operator in parser."); + } + } + auto function_node = std::make_shared(operation, tok.text.data() - tmpl.content.c_str()); + + while (!operator_stack.empty() && + ((operator_stack.top()->precedence > function_node->precedence) || + (operator_stack.top()->precedence == function_node->precedence && function_node->associativity == FunctionNode::Associativity::Left)) && + (operator_stack.top()->operation != FunctionStorage::Operation::ParenLeft)) { + add_operator(); + } + + operator_stack.emplace(function_node); + } break; + case Token::Kind::Comma: { + if (current_brace_level == 0 && current_bracket_level == 0) { + if (function_stack.empty()) { + throw_parser_error("unexpected ','"); } - break; - case Token::Kind::Comma: - case Token::Kind::Colon: - if (brace_level == 0 && bracket_level == 0) { - inja_throw("parser_error", "unexpected token '" + m_tok.describe() + "'"); + + function_stack.top().first->number_args += 1; + } + } break; + case Token::Kind::Colon: { + if (current_brace_level == 0 && current_bracket_level == 0) { + throw_parser_error("unexpected ':'"); + } + } break; + case Token::Kind::LeftParen: { + current_paren_level += 1; + operator_stack.emplace(std::make_shared(FunctionStorage::Operation::ParenLeft, tok.text.data() - tmpl.content.c_str())); + + get_peek_token(); + if (peek_tok.kind == Token::Kind::RightParen) { + if (!function_stack.empty() && function_stack.top().second == current_paren_level - 1) { + function_stack.top().first->number_args = 0; } - break; - case Token::Kind::LeftBracket: - if (brace_level == 0 && bracket_level == 0) { - json_first = m_tok.text; + } + } break; + case Token::Kind::RightParen: { + current_paren_level -= 1; + while (!operator_stack.empty() && operator_stack.top()->operation != FunctionStorage::Operation::ParenLeft) { + add_operator(); + } + + if (!operator_stack.empty() && operator_stack.top()->operation == FunctionStorage::Operation::ParenLeft) { + operator_stack.pop(); + } + + if (!function_stack.empty() && function_stack.top().second == current_paren_level) { + auto func = function_stack.top().first; + auto function_data = function_storage.find_function(func->name, func->number_args); + if (function_data.operation == FunctionStorage::Operation::None) { + throw_parser_error("unknown function " + func->name); } - bracket_level += 1; - break; - case Token::Kind::LeftBrace: - if (brace_level == 0 && bracket_level == 0) { - json_first = m_tok.text; + func->operation = function_data.operation; + if (function_data.operation == FunctionStorage::Operation::Callback) { + func->callback = function_data.callback; } - brace_level += 1; - break; - case Token::Kind::RightBracket: - if (bracket_level == 0) { - inja_throw("parser_error", "unexpected ']'"); + + if (operator_stack.empty()) { + throw_parser_error("internal error at function " + func->name); } - --bracket_level; - if (brace_level == 0 && bracket_level == 0) goto returnJson; - break; - case Token::Kind::RightBrace: - if (brace_level == 0) { - inja_throw("parser_error", "unexpected '}'"); - } - --brace_level; - if (brace_level == 0 && bracket_level == 0) goto returnJson; - break; - default: - if (brace_level != 0) { - inja_throw("parser_error", "unmatched '{'"); - } - if (bracket_level != 0) { - inja_throw("parser_error", "unmatched '['"); - } - return false; + + add_operator(); + function_stack.pop(); + } + } + default: + break; } get_next_token(); } - returnJson: - // bridge across all intermediate tokens - nonstd::string_view json_text(json_first.data(), m_tok.text.data() - json_first.data() + m_tok.text.size()); - tmpl.bytecodes.emplace_back(Bytecode::Op::Push, json::parse(json_text), Bytecode::Flag::ValueImmediate); - get_next_token(); + while (!operator_stack.empty()) { + add_operator(); + } + + if (arguments.size() == 1) { + current_expression_list->root = arguments[0]; + arguments = {}; + } else if (arguments.size() > 1) { + throw_parser_error("malformed expression"); + } + return true; } - bool parse_statement(Template& tmpl, nonstd::string_view path) { - if (m_tok.kind != Token::Kind::Id) return false; + bool parse_statement(Template& tmpl, Token::Kind closing, std::string_view path) { + if (tok.kind != Token::Kind::Id) { + return false; + } - if (m_tok.text == static_cast("if")) { + if (tok.text == static_cast("if")) { get_next_token(); - // evaluate expression - if (!parse_expression(tmpl)) return false; + auto if_statement_node = std::make_shared(current_block, tok.text.data() - tmpl.content.c_str()); + current_block->nodes.emplace_back(if_statement_node); + if_statement_stack.emplace(if_statement_node.get()); + current_block = &if_statement_node->true_statement; + current_expression_list = &if_statement_node->condition; - // start a new if block on if stack - m_if_stack.emplace_back(tmpl.bytecodes.size()); - - // conditional jump; destination will be filled in by else or endif - tmpl.bytecodes.emplace_back(Bytecode::Op::ConditionalJump); - } else if (m_tok.text == static_cast("endif")) { - if (m_if_stack.empty()) { - inja_throw("parser_error", "endif without matching if"); + if (!parse_expression(tmpl, closing)) { + return false; } - auto& if_data = m_if_stack.back(); + } else if (tok.text == static_cast("else")) { + if (if_statement_stack.empty()) { + throw_parser_error("else without matching if"); + } + auto& if_statement_data = if_statement_stack.top(); get_next_token(); - // previous conditional jump jumps here - if (if_data.prev_cond_jump != std::numeric_limits::max()) { - tmpl.bytecodes[if_data.prev_cond_jump].args = tmpl.bytecodes.size(); - } + if_statement_data->has_false_statement = true; + current_block = &if_statement_data->false_statement; - // update all previous unconditional jumps to here - for (unsigned int i: if_data.uncond_jumps) { - tmpl.bytecodes[i].args = tmpl.bytecodes.size(); - } - - // pop if stack - m_if_stack.pop_back(); - } else if (m_tok.text == static_cast("else")) { - if (m_if_stack.empty()) - inja_throw("parser_error", "else without matching if"); - auto& if_data = m_if_stack.back(); - get_next_token(); - - // end previous block with unconditional jump to endif; destination will be - // filled in by endif - if_data.uncond_jumps.push_back(tmpl.bytecodes.size()); - tmpl.bytecodes.emplace_back(Bytecode::Op::Jump); - - // previous conditional jump jumps here - tmpl.bytecodes[if_data.prev_cond_jump].args = tmpl.bytecodes.size(); - if_data.prev_cond_jump = std::numeric_limits::max(); - - // chained else if - if (m_tok.kind == Token::Kind::Id && m_tok.text == static_cast("if")) { + // Chained else if + if (tok.kind == Token::Kind::Id && tok.text == static_cast("if")) { get_next_token(); - // evaluate expression - if (!parse_expression(tmpl)) return false; + auto if_statement_node = std::make_shared(true, current_block, tok.text.data() - tmpl.content.c_str()); + current_block->nodes.emplace_back(if_statement_node); + if_statement_stack.emplace(if_statement_node.get()); + current_block = &if_statement_node->true_statement; + current_expression_list = &if_statement_node->condition; - // update "previous jump" - if_data.prev_cond_jump = tmpl.bytecodes.size(); - - // conditional jump; destination will be filled in by else or endif - tmpl.bytecodes.emplace_back(Bytecode::Op::ConditionalJump); + if (!parse_expression(tmpl, closing)) { + return false; + } } - } else if (m_tok.text == static_cast("for")) { + } else if (tok.text == static_cast("endif")) { + if (if_statement_stack.empty()) { + throw_parser_error("endif without matching if"); + } + + // Nested if statements + while (if_statement_stack.top()->is_nested) { + if_statement_stack.pop(); + } + + auto& if_statement_data = if_statement_stack.top(); + get_next_token(); + + current_block = if_statement_data->parent; + if_statement_stack.pop(); + } else if (tok.text == static_cast("block")) { + get_next_token(); + + if (tok.kind != Token::Kind::Id) { + throw_parser_error("expected block name, got '" + tok.describe() + "'"); + } + + const std::string block_name = static_cast(tok.text); + + auto block_statement_node = std::make_shared(current_block, block_name, tok.text.data() - tmpl.content.c_str()); + current_block->nodes.emplace_back(block_statement_node); + block_statement_stack.emplace(block_statement_node.get()); + current_block = &block_statement_node->block; + auto success = tmpl.block_storage.emplace(block_name, block_statement_node); + if (!success.second) { + throw_parser_error("block with the name '" + block_name + "' does already exist"); + } + + get_next_token(); + } else if (tok.text == static_cast("endblock")) { + if (block_statement_stack.empty()) { + throw_parser_error("endblock without matching block"); + } + + auto& block_statement_data = block_statement_stack.top(); + get_next_token(); + + current_block = block_statement_data->parent; + block_statement_stack.pop(); + } else if (tok.text == static_cast("for")) { get_next_token(); // options: for a in arr; for a, b in obj - if (m_tok.kind != Token::Kind::Id) - inja_throw("parser_error", "expected id, got '" + m_tok.describe() + "'"); - Token value_token = m_tok; + if (tok.kind != Token::Kind::Id) { + throw_parser_error("expected id, got '" + tok.describe() + "'"); + } + + Token value_token = tok; get_next_token(); - Token key_token; - if (m_tok.kind == Token::Kind::Comma) { + // Object type + std::shared_ptr for_statement_node; + if (tok.kind == Token::Kind::Comma) { get_next_token(); - if (m_tok.kind != Token::Kind::Id) - inja_throw("parser_error", "expected id, got '" + m_tok.describe() + "'"); - key_token = std::move(value_token); - value_token = m_tok; + if (tok.kind != Token::Kind::Id) { + throw_parser_error("expected id, got '" + tok.describe() + "'"); + } + + Token key_token = std::move(value_token); + value_token = tok; get_next_token(); + + for_statement_node = std::make_shared(static_cast(key_token.text), static_cast(value_token.text), + current_block, tok.text.data() - tmpl.content.c_str()); + + // Array type + } else { + for_statement_node = + std::make_shared(static_cast(value_token.text), current_block, tok.text.data() - tmpl.content.c_str()); } - if (m_tok.kind != Token::Kind::Id || m_tok.text != static_cast("in")) - inja_throw("parser_error", - "expected 'in', got '" + m_tok.describe() + "'"); + current_block->nodes.emplace_back(for_statement_node); + for_statement_stack.emplace(for_statement_node.get()); + current_block = &for_statement_node->body; + current_expression_list = &for_statement_node->condition; + + if (tok.kind != Token::Kind::Id || tok.text != static_cast("in")) { + throw_parser_error("expected 'in', got '" + tok.describe() + "'"); + } get_next_token(); - if (!parse_expression(tmpl)) return false; - - m_loop_stack.push_back(tmpl.bytecodes.size()); - - tmpl.bytecodes.emplace_back(Bytecode::Op::StartLoop); - if (!key_token.text.empty()) { - tmpl.bytecodes.back().value = key_token.text; + if (!parse_expression(tmpl, closing)) { + return false; } - tmpl.bytecodes.back().str = static_cast(value_token.text); - } else if (m_tok.text == static_cast("endfor")) { - get_next_token(); - if (m_loop_stack.empty()) { - inja_throw("parser_error", "endfor without matching for"); + } else if (tok.text == static_cast("endfor")) { + if (for_statement_stack.empty()) { + throw_parser_error("endfor without matching for"); } - // update loop with EndLoop index (for empty case) - tmpl.bytecodes[m_loop_stack.back()].args = tmpl.bytecodes.size(); - - tmpl.bytecodes.emplace_back(Bytecode::Op::EndLoop); - tmpl.bytecodes.back().args = m_loop_stack.back() + 1; // loop body - m_loop_stack.pop_back(); - } else if (m_tok.text == static_cast("include")) { + auto& for_statement_data = for_statement_stack.top(); get_next_token(); - if (m_tok.kind != Token::Kind::String) { - inja_throw("parser_error", "expected string, got '" + m_tok.describe() + "'"); - } + current_block = for_statement_data->parent; + for_statement_stack.pop(); + } else if (tok.text == static_cast("include")) { + get_next_token(); - // build the relative path - json json_name = json::parse(m_tok.text); - std::string pathname = static_cast(path); - pathname += json_name.get_ref(); - if (pathname.compare(0, 2, "./") == 0) { - pathname.erase(0, 2); - } - // sys::path::remove_dots(pathname, true, sys::path::Style::posix); + std::string template_name = parse_filename(tok); + add_to_template_storage(path, template_name); - if (m_included_templates.find(pathname) == m_included_templates.end()) { - Template include_template = parse_template(pathname); - m_included_templates.emplace(pathname, include_template); - } - - // generate a reference bytecode - tmpl.bytecodes.emplace_back(Bytecode::Op::Include, json(pathname), Bytecode::Flag::ValueImmediate); + current_block->nodes.emplace_back(std::make_shared(template_name, tok.text.data() - tmpl.content.c_str())); get_next_token(); + } else if (tok.text == static_cast("extends")) { + get_next_token(); + + std::string template_name = parse_filename(tok); + add_to_template_storage(path, template_name); + + current_block->nodes.emplace_back(std::make_shared(template_name, tok.text.data() - tmpl.content.c_str())); + + get_next_token(); + } else if (tok.text == static_cast("set")) { + get_next_token(); + + if (tok.kind != Token::Kind::Id) { + throw_parser_error("expected variable name, got '" + tok.describe() + "'"); + } + + std::string key = static_cast(tok.text); + get_next_token(); + + auto set_statement_node = std::make_shared(key, tok.text.data() - tmpl.content.c_str()); + current_block->nodes.emplace_back(set_statement_node); + current_expression_list = &set_statement_node->expression; + + if (tok.text != static_cast("=")) { + throw_parser_error("expected '=', got '" + tok.describe() + "'"); + } + get_next_token(); + + if (!parse_expression(tmpl, closing)) { + return false; + } } else { return false; } return true; } - void append_function(Template& tmpl, Bytecode::Op op, unsigned int num_args) { - // we can merge with back-to-back push - if (!tmpl.bytecodes.empty()) { - Bytecode& last = tmpl.bytecodes.back(); - if (last.op == Bytecode::Op::Push) { - last.op = op; - last.args = num_args; - return; - } - } - - // otherwise just add it to the end - tmpl.bytecodes.emplace_back(op, num_args); - } - - void append_callback(Template& tmpl, nonstd::string_view name, unsigned int num_args) { - // we can merge with back-to-back push value (not lookup) - if (!tmpl.bytecodes.empty()) { - Bytecode& last = tmpl.bytecodes.back(); - if (last.op == Bytecode::Op::Push && - (last.flags & Bytecode::Flag::ValueMask) == Bytecode::Flag::ValueImmediate) { - last.op = Bytecode::Op::Callback; - last.args = num_args; - last.str = static_cast(name); - return; - } - } - - // otherwise just add it to the end - tmpl.bytecodes.emplace_back(Bytecode::Op::Callback, num_args); - tmpl.bytecodes.back().str = static_cast(name); - } - - void parse_into(Template& tmpl, nonstd::string_view path) { - m_lexer.start(tmpl.content); + void parse_into(Template& tmpl, std::string_view path) { + lexer.start(tmpl.content); + current_block = &tmpl.root; for (;;) { get_next_token(); - switch (m_tok.kind) { - case Token::Kind::Eof: - if (!m_if_stack.empty()) inja_throw("parser_error", "unmatched if"); - if (!m_loop_stack.empty()) inja_throw("parser_error", "unmatched for"); - return; - case Token::Kind::Text: - tmpl.bytecodes.emplace_back(Bytecode::Op::PrintText, m_tok.text, 0u); - break; - case Token::Kind::StatementOpen: - get_next_token(); - if (!parse_statement(tmpl, path)) { - inja_throw("parser_error", "expected statement, got '" + m_tok.describe() + "'"); - } - if (m_tok.kind != Token::Kind::StatementClose) { - inja_throw("parser_error", "expected statement close, got '" + m_tok.describe() + "'"); - } - break; - case Token::Kind::LineStatementOpen: - get_next_token(); - parse_statement(tmpl, path); - if (m_tok.kind != Token::Kind::LineStatementClose && - m_tok.kind != Token::Kind::Eof) { - inja_throw("parser_error", "expected line statement close, got '" + m_tok.describe() + "'"); - } - break; - case Token::Kind::ExpressionOpen: - get_next_token(); - if (!parse_expression(tmpl)) { - inja_throw("parser_error", "expected expression, got '" + m_tok.describe() + "'"); - } - append_function(tmpl, Bytecode::Op::PrintValue, 1); - if (m_tok.kind != Token::Kind::ExpressionClose) { - inja_throw("parser_error", "expected expression close, got '" + m_tok.describe() + "'"); - } - break; - case Token::Kind::CommentOpen: - get_next_token(); - if (m_tok.kind != Token::Kind::CommentClose) { - inja_throw("parser_error", "expected comment close, got '" + m_tok.describe() + "'"); - } - break; - default: - inja_throw("parser_error", "unexpected token '" + m_tok.describe() + "'"); - break; + switch (tok.kind) { + case Token::Kind::Eof: { + if (!if_statement_stack.empty()) { + throw_parser_error("unmatched if"); + } + if (!for_statement_stack.empty()) { + throw_parser_error("unmatched for"); + } + } + return; + case Token::Kind::Text: { + current_block->nodes.emplace_back(std::make_shared(tok.text.data() - tmpl.content.c_str(), tok.text.size())); + } break; + case Token::Kind::StatementOpen: { + get_next_token(); + if (!parse_statement(tmpl, Token::Kind::StatementClose, path)) { + throw_parser_error("expected statement, got '" + tok.describe() + "'"); + } + if (tok.kind != Token::Kind::StatementClose) { + throw_parser_error("expected statement close, got '" + tok.describe() + "'"); + } + } break; + case Token::Kind::LineStatementOpen: { + get_next_token(); + if (!parse_statement(tmpl, Token::Kind::LineStatementClose, path)) { + throw_parser_error("expected statement, got '" + tok.describe() + "'"); + } + if (tok.kind != Token::Kind::LineStatementClose && tok.kind != Token::Kind::Eof) { + throw_parser_error("expected line statement close, got '" + tok.describe() + "'"); + } + } break; + case Token::Kind::ExpressionOpen: { + get_next_token(); + + auto expression_list_node = std::make_shared(tok.text.data() - tmpl.content.c_str()); + current_block->nodes.emplace_back(expression_list_node); + current_expression_list = expression_list_node.get(); + + if (!parse_expression(tmpl, Token::Kind::ExpressionClose)) { + throw_parser_error("expected expression, got '" + tok.describe() + "'"); + } + + if (tok.kind != Token::Kind::ExpressionClose) { + throw_parser_error("expected expression close, got '" + tok.describe() + "'"); + } + } break; + case Token::Kind::CommentOpen: { + get_next_token(); + if (tok.kind != Token::Kind::CommentClose) { + throw_parser_error("expected comment close, got '" + tok.describe() + "'"); + } + } break; + default: { + throw_parser_error("unexpected token '" + tok.describe() + "'"); + } break; } } } - Template parse(nonstd::string_view input, nonstd::string_view path) { - Template result; - result.content = static_cast(input); +public: + explicit Parser(const ParserConfig& parser_config, const LexerConfig& lexer_config, TemplateStorage& template_storage, + const FunctionStorage& function_storage) + : config(parser_config), lexer(lexer_config), template_storage(template_storage), function_storage(function_storage) {} + + Template parse(std::string_view input, std::string_view path) { + auto result = Template(static_cast(input)); parse_into(result, path); return result; } - Template parse(nonstd::string_view input) { + Template parse(std::string_view input) { return parse(input, "./"); } - Template parse_template(nonstd::string_view filename) { - Template result; - result.content = load_file(filename); + void parse_into_template(Template& tmpl, std::string_view filename) { + std::string_view path = filename.substr(0, filename.find_last_of("/\\") + 1); - nonstd::string_view path = filename.substr(0, filename.find_last_of("/\\") + 1); - // StringRef path = sys::path::parent_path(filename); - Parser(m_config, m_lexer.get_config(), m_included_templates).parse_into(result, path); - return result; + // StringRef path = sys::path::parent_path(filename); + auto sub_parser = Parser(config, lexer.get_config(), template_storage, function_storage); + sub_parser.parse_into(tmpl, path); } - std::string load_file(nonstd::string_view filename) { - std::ifstream file = open_file_or_throw(static_cast(filename)); + std::string load_file(const std::string& filename) { + std::ifstream file; + file.open(filename); + if (file.fail()) { + INJA_THROW(FileError("failed accessing file at '" + filename + "'")); + } std::string text((std::istreambuf_iterator(file)), std::istreambuf_iterator()); return text; } - - private: - const ParserConfig& m_config; - Lexer m_lexer; - Token m_tok; - Token m_peek_tok; - bool m_have_peek_tok {false}; - TemplateStorage& m_included_templates; - const ParserStatic& m_static; - - struct IfData { - unsigned int prev_cond_jump; - std::vector uncond_jumps; - - explicit IfData(unsigned int condJump): prev_cond_jump(condJump) {} - }; - - std::vector m_if_stack; - std::vector m_loop_stack; - - void get_next_token() { - if (m_have_peek_tok) { - m_tok = m_peek_tok; - m_have_peek_tok = false; - } else { - m_tok = m_lexer.scan(); - } - } - - void get_peek_token() { - if (!m_have_peek_tok) { - m_peek_tok = m_lexer.scan(); - m_have_peek_tok = true; - } - } }; -} // namespace inja +} // namespace inja -#endif // PANTOR_INJA_PARSER_HPP - -// #include "polyfill.hpp" -#ifndef PANTOR_INJA_POLYFILL_HPP -#define PANTOR_INJA_POLYFILL_HPP - - -#if __cplusplus < 201402L - -#include -#include -#include -#include - - -namespace stdinja { - template struct _Unique_if { - typedef std::unique_ptr _Single_object; - }; - - template struct _Unique_if { - typedef std::unique_ptr _Unknown_bound; - }; - - template struct _Unique_if { - typedef void _Known_bound; - }; - - template - typename _Unique_if::_Single_object - make_unique(Args&&... args) { - return std::unique_ptr(new T(std::forward(args)...)); - } - - template - typename _Unique_if::_Unknown_bound - make_unique(size_t n) { - typedef typename std::remove_extent::type U; - return std::unique_ptr(new U[n]()); - } - - template - typename _Unique_if::_Known_bound - make_unique(Args&&...) = delete; -} - -#else - -namespace stdinja = std; - -#endif // memory */ - - -#endif // PANTOR_INJA_POLYFILL_HPP +#endif // INCLUDE_INJA_PARSER_HPP_ // #include "renderer.hpp" -#ifndef PANTOR_INJA_RENDERER_HPP -#define PANTOR_INJA_RENDERER_HPP +#ifndef INCLUDE_INJA_RENDERER_HPP_ +#define INCLUDE_INJA_RENDERER_HPP_ #include #include @@ -2756,677 +2082,735 @@ namespace stdinja = std; #include #include -#include +// #include "config.hpp" -// #include "bytecode.hpp" +// #include "exceptions.hpp" + +// #include "node.hpp" // #include "template.hpp" // #include "utils.hpp" - namespace inja { -inline nonstd::string_view convert_dot_to_json_pointer(nonstd::string_view dot, std::string& out) { - out.clear(); - do { - nonstd::string_view part; - std::tie(part, dot) = string_view::split(dot, '.'); - out.push_back('/'); - out.append(part.begin(), part.end()); - } while (!dot.empty()); - return nonstd::string_view(out.data(), out.size()); -} - /*! * \brief Class for rendering a Template with data. */ -class Renderer { - std::vector& get_args(const Bytecode& bc) { - m_tmp_args.clear(); +class Renderer : public NodeVisitor { + using Op = FunctionStorage::Operation; - bool has_imm = ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop); + const RenderConfig config; + const TemplateStorage& template_storage; + const FunctionStorage& function_storage; - // get args from stack - unsigned int pop_args = bc.args; - if (has_imm) { - pop_args -= 1; - } + const Template* current_template; + size_t current_level {0}; + std::vector template_stack; + std::vector block_statement_stack; - for (auto i = std::prev(m_stack.end(), pop_args); i != m_stack.end(); i++) { - m_tmp_args.push_back(&(*i)); - } + const json* data_input; + std::ostream* output_stream; - // get immediate arg - if (has_imm) { - m_tmp_args.push_back(get_imm(bc)); - } + json additional_data; + json* current_loop_data = &additional_data["loop"]; - return m_tmp_args; - } + std::vector> data_tmp_stack; + std::stack data_eval_stack; + std::stack not_found_stack; - void pop_args(const Bytecode& bc) { - unsigned int popArgs = bc.args; - if ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop) { - popArgs -= 1; - } - for (unsigned int i = 0; i < popArgs; ++i) { - m_stack.pop_back(); - } - } + bool break_rendering {false}; - const json* get_imm(const Bytecode& bc) { - std::string ptr_buffer; - nonstd::string_view ptr; - switch (bc.flags & Bytecode::Flag::ValueMask) { - case Bytecode::Flag::ValuePop: - return nullptr; - case Bytecode::Flag::ValueImmediate: - return &bc.value; - case Bytecode::Flag::ValueLookupDot: - ptr = convert_dot_to_json_pointer(bc.str, ptr_buffer); - break; - case Bytecode::Flag::ValueLookupPointer: - ptr_buffer += '/'; - ptr_buffer += bc.str; - ptr = ptr_buffer; - break; - } - try { - return &m_data->at(json::json_pointer(ptr.data())); - } catch (std::exception&) { - // try to evaluate as a no-argument callback - if (auto callback = m_callbacks.find_callback(bc.str, 0)) { - std::vector arguments {}; - m_tmp_val = callback(arguments); - return &m_tmp_val; - } - inja_throw("render_error", "variable '" + static_cast(bc.str) + "' not found"); - return nullptr; - } - } - - bool truthy(const json& var) const { - if (var.empty()) { + static bool truthy(const json* data) { + if (data->is_boolean()) { + return data->get(); + } else if (data->is_number()) { + return (*data != 0); + } else if (data->is_null()) { return false; - } else if (var.is_number()) { - return (var != 0); - } else if (var.is_string()) { - return !var.empty(); - } - - try { - return var.get(); - } catch (json::type_error& e) { - inja_throw("json_error", e.what()); - throw; } + return !data->empty(); } - void update_loop_data() { - LoopLevel& level = m_loop_stack.back(); - - if (level.loop_type == LoopLevel::Type::Array) { - level.data[static_cast(level.value_name)] = level.values.at(level.index); // *level.it; - auto& loopData = level.data["loop"]; - loopData["index"] = level.index; - loopData["index1"] = level.index + 1; - loopData["is_first"] = (level.index == 0); - loopData["is_last"] = (level.index == level.size - 1); + void print_data(const std::shared_ptr value) { + if (value->is_string()) { + *output_stream << value->get_ref(); + } else if (value->is_number_integer()) { + *output_stream << value->get(); + } else if (value->is_null()) { } else { - level.data[static_cast(level.key_name)] = level.map_it->first; - level.data[static_cast(level.value_name)] = *level.map_it->second; + *output_stream << value->dump(); } } - const TemplateStorage& m_included_templates; - const FunctionStorage& m_callbacks; + const std::shared_ptr eval_expression_list(const ExpressionListNode& expression_list) { + if (!expression_list.root) { + throw_renderer_error("empty expression", expression_list); + } - std::vector m_stack; + expression_list.root->accept(*this); + if (data_eval_stack.empty()) { + throw_renderer_error("empty expression", expression_list); + } else if (data_eval_stack.size() != 1) { + throw_renderer_error("malformed expression", expression_list); + } - struct LoopLevel { - enum class Type { Map, Array }; + const auto result = data_eval_stack.top(); + data_eval_stack.pop(); - Type loop_type; - nonstd::string_view key_name; // variable name for keys - nonstd::string_view value_name; // variable name for values - json data; // data with loop info added + if (!result) { + if (not_found_stack.empty()) { + throw_renderer_error("expression could not be evaluated", expression_list); + } - json values; // values to iterate over + auto node = not_found_stack.top(); + not_found_stack.pop(); - // loop over list - size_t index; // current list index - size_t size; // length of list - - // loop over map - using KeyValue = std::pair; - using MapValues = std::vector; - MapValues map_values; // values to iterate over - MapValues::iterator map_it; // iterator over values - - }; - - std::vector m_loop_stack; - const json* m_data; - - std::vector m_tmp_args; - json m_tmp_val; - - - public: - Renderer(const TemplateStorage& included_templates, const FunctionStorage& callbacks): m_included_templates(included_templates), m_callbacks(callbacks) { - m_stack.reserve(16); - m_tmp_args.reserve(4); - m_loop_stack.reserve(16); + throw_renderer_error("variable '" + static_cast(node->name) + "' not found", *node); + } + return std::make_shared(*result); } - void render_to(std::ostream& os, const Template& tmpl, const json& data) { - m_data = &data; + void throw_renderer_error(const std::string& message, const AstNode& node) { + SourceLocation loc = get_source_location(current_template->content, node.pos); + INJA_THROW(RenderError(message, loc)); + } - for (size_t i = 0; i < tmpl.bytecodes.size(); ++i) { - const auto& bc = tmpl.bytecodes[i]; + void make_result(const json&& result) { + auto result_ptr = std::make_shared(result); + data_tmp_stack.push_back(result_ptr); + data_eval_stack.push(result_ptr.get()); + } - switch (bc.op) { - case Bytecode::Op::Nop: { - break; - } - case Bytecode::Op::PrintText: { - os << bc.str; - break; - } - case Bytecode::Op::PrintValue: { - const json& val = *get_args(bc)[0]; - if (val.is_string()) { - os << val.get_ref(); - } else { - os << val.dump(); - } - pop_args(bc); - break; - } - case Bytecode::Op::Push: { - m_stack.emplace_back(*get_imm(bc)); - break; - } - case Bytecode::Op::Upper: { - auto result = get_args(bc)[0]->get(); - std::transform(result.begin(), result.end(), result.begin(), ::toupper); - pop_args(bc); - m_stack.emplace_back(std::move(result)); - break; - } - case Bytecode::Op::Lower: { - auto result = get_args(bc)[0]->get(); - std::transform(result.begin(), result.end(), result.begin(), ::tolower); - pop_args(bc); - m_stack.emplace_back(std::move(result)); - break; - } - case Bytecode::Op::Range: { - int number = get_args(bc)[0]->get(); - std::vector result(number); - std::iota(std::begin(result), std::end(result), 0); - pop_args(bc); - m_stack.emplace_back(std::move(result)); - break; - } - case Bytecode::Op::Length: { - const json& val = *get_args(bc)[0]; + template std::array get_arguments(const FunctionNode& node) { + if (node.arguments.size() < N_start + N) { + throw_renderer_error("function needs " + std::to_string(N_start + N) + " variables, but has only found " + std::to_string(node.arguments.size()), node); + } - int result; - if (val.is_string()) { - result = val.get_ref().length(); - } else { - result = val.size(); - } + for (size_t i = N_start; i < N_start + N; i += 1) { + node.arguments[i]->accept(*this); + } - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Sort: { - auto result = get_args(bc)[0]->get>(); - std::sort(result.begin(), result.end()); - pop_args(bc); - m_stack.emplace_back(std::move(result)); - break; - } - case Bytecode::Op::At: { - auto args = get_args(bc); - auto result = args[0]->at(args[1]->get()); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::First: { - auto result = get_args(bc)[0]->front(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Last: { - auto result = get_args(bc)[0]->back(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Round: { - auto args = get_args(bc); - double number = args[0]->get(); - int precision = args[1]->get(); - pop_args(bc); - m_stack.emplace_back(std::round(number * std::pow(10.0, precision)) / std::pow(10.0, precision)); - break; - } - case Bytecode::Op::DivisibleBy: { - auto args = get_args(bc); - int number = args[0]->get(); - int divisor = args[1]->get(); - pop_args(bc); - m_stack.emplace_back((divisor != 0) && (number % divisor == 0)); - break; - } - case Bytecode::Op::Odd: { - int number = get_args(bc)[0]->get(); - pop_args(bc); - m_stack.emplace_back(number % 2 != 0); - break; - } - case Bytecode::Op::Even: { - int number = get_args(bc)[0]->get(); - pop_args(bc); - m_stack.emplace_back(number % 2 == 0); - break; - } - case Bytecode::Op::Max: { - auto args = get_args(bc); - auto result = *std::max_element(args[0]->begin(), args[0]->end()); - pop_args(bc); - m_stack.emplace_back(std::move(result)); - break; - } - case Bytecode::Op::Min: { - auto args = get_args(bc); - auto result = *std::min_element(args[0]->begin(), args[0]->end()); - pop_args(bc); - m_stack.emplace_back(std::move(result)); - break; - } - case Bytecode::Op::Not: { - bool result = !truthy(*get_args(bc)[0]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::And: { - auto args = get_args(bc); - bool result = truthy(*args[0]) && truthy(*args[1]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Or: { - auto args = get_args(bc); - bool result = truthy(*args[0]) || truthy(*args[1]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::In: { - auto args = get_args(bc); - bool result = std::find(args[1]->begin(), args[1]->end(), *args[0]) != - args[1]->end(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Equal: { - auto args = get_args(bc); - bool result = (*args[0] == *args[1]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Greater: { - auto args = get_args(bc); - bool result = (*args[0] > *args[1]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Less: { - auto args = get_args(bc); - bool result = (*args[0] < *args[1]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::GreaterEqual: { - auto args = get_args(bc); - bool result = (*args[0] >= *args[1]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::LessEqual: { - auto args = get_args(bc); - bool result = (*args[0] <= *args[1]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Different: { - auto args = get_args(bc); - bool result = (*args[0] != *args[1]); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Float: { - double result = - std::stod(get_args(bc)[0]->get_ref()); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Int: { - int result = std::stoi(get_args(bc)[0]->get_ref()); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Exists: { - auto&& name = get_args(bc)[0]->get_ref(); - bool result = (data.find(name) != data.end()); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::ExistsInObject: { - auto args = get_args(bc); - auto&& name = args[1]->get_ref(); - bool result = (args[0]->find(name) != args[0]->end()); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::IsBoolean: { - bool result = get_args(bc)[0]->is_boolean(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::IsNumber: { - bool result = get_args(bc)[0]->is_number(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::IsInteger: { - bool result = get_args(bc)[0]->is_number_integer(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::IsFloat: { - bool result = get_args(bc)[0]->is_number_float(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::IsObject: { - bool result = get_args(bc)[0]->is_object(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::IsArray: { - bool result = get_args(bc)[0]->is_array(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::IsString: { - bool result = get_args(bc)[0]->is_string(); - pop_args(bc); - m_stack.emplace_back(result); - break; - } - case Bytecode::Op::Default: { - // default needs to be a bit "magic"; we can't evaluate the first - // argument during the push operation, so we swap the arguments during - // the parse phase so the second argument is pushed on the stack and - // the first argument is in the immediate - try { - const json* imm = get_imm(bc); - // if no exception was raised, replace the stack value with it - m_stack.back() = *imm; - } catch (std::exception&) { - // couldn't read immediate, just leave the stack as is - } - break; - } - case Bytecode::Op::Include: - Renderer(m_included_templates, m_callbacks).render_to(os, m_included_templates.find(get_imm(bc)->get_ref())->second, *m_data); - break; - case Bytecode::Op::Callback: { - auto callback = m_callbacks.find_callback(bc.str, bc.args); - if (!callback) { - inja_throw("render_error", "function '" + static_cast(bc.str) + "' (" + std::to_string(static_cast(bc.args)) + ") not found"); - } - json result = callback(get_args(bc)); - pop_args(bc); - m_stack.emplace_back(std::move(result)); - break; - } - case Bytecode::Op::Jump: { - i = bc.args - 1; // -1 due to ++i in loop - break; - } - case Bytecode::Op::ConditionalJump: { - if (!truthy(m_stack.back())) { - i = bc.args - 1; // -1 due to ++i in loop - } - m_stack.pop_back(); - break; - } - case Bytecode::Op::StartLoop: { - // jump past loop body if empty - if (m_stack.back().empty()) { - m_stack.pop_back(); - i = bc.args; // ++i in loop will take it past EndLoop - break; - } + if (data_eval_stack.size() < N) { + throw_renderer_error("function needs " + std::to_string(N) + " variables, but has only found " + std::to_string(data_eval_stack.size()), node); + } - m_loop_stack.emplace_back(); - LoopLevel& level = m_loop_stack.back(); - level.value_name = bc.str; - level.values = std::move(m_stack.back()); - level.data = (*m_data); - m_stack.pop_back(); + std::array result; + for (size_t i = 0; i < N; i += 1) { + result[N - i - 1] = data_eval_stack.top(); + data_eval_stack.pop(); - if (bc.value.is_string()) { - // map iterator - if (!level.values.is_object()) { - m_loop_stack.pop_back(); - inja_throw("render_error", "for key, value requires object"); - } - level.loop_type = LoopLevel::Type::Map; - level.key_name = bc.value.get_ref(); + if (!result[N - i - 1]) { + const auto data_node = not_found_stack.top(); + not_found_stack.pop(); - // sort by key - for (auto it = level.values.begin(), end = level.values.end(); it != end; ++it) { - level.map_values.emplace_back(it.key(), &it.value()); - } - std::sort(level.map_values.begin(), level.map_values.end(), [](const LoopLevel::KeyValue& a, const LoopLevel::KeyValue& b) { return a.first < b.first; }); - level.map_it = level.map_values.begin(); - } else { - if (!level.values.is_array()) { - m_loop_stack.pop_back(); - inja_throw("render_error", "type must be array"); - } - - // list iterator - level.loop_type = LoopLevel::Type::Array; - level.index = 0; - level.size = level.values.size(); - } - - // provide parent access in nested loop - auto parent_loop_it = level.data.find("loop"); - if (parent_loop_it != level.data.end()) { - json loop_copy = *parent_loop_it; - (*parent_loop_it)["parent"] = std::move(loop_copy); - } - - // set "current" data to loop data - m_data = &level.data; - update_loop_data(); - break; - } - case Bytecode::Op::EndLoop: { - if (m_loop_stack.empty()) { - inja_throw("render_error", "unexpected state in renderer"); - } - LoopLevel& level = m_loop_stack.back(); - - bool done; - if (level.loop_type == LoopLevel::Type::Array) { - level.index += 1; - done = (level.index == level.values.size()); - } else { - level.map_it += 1; - done = (level.map_it == level.map_values.end()); - } - - if (done) { - m_loop_stack.pop_back(); - // set "current" data to outer loop data or main data as appropriate - if (!m_loop_stack.empty()) { - m_data = &m_loop_stack.back().data; - } else { - m_data = &data; - } - break; - } - - update_loop_data(); - - // jump back to start of loop - i = bc.args - 1; // -1 due to ++i in loop - break; - } - default: { - inja_throw("render_error", "unknown op in renderer: " + std::to_string(static_cast(bc.op))); + if (throw_not_found) { + throw_renderer_error("variable '" + static_cast(data_node->name) + "' not found", *data_node); } } } + return result; + } + + template Arguments get_argument_vector(const FunctionNode& node) { + const size_t N = node.arguments.size(); + for (auto a : node.arguments) { + a->accept(*this); + } + + if (data_eval_stack.size() < N) { + throw_renderer_error("function needs " + std::to_string(N) + " variables, but has only found " + std::to_string(data_eval_stack.size()), node); + } + + Arguments result {N}; + for (size_t i = 0; i < N; i += 1) { + result[N - i - 1] = data_eval_stack.top(); + data_eval_stack.pop(); + + if (!result[N - i - 1]) { + const auto data_node = not_found_stack.top(); + not_found_stack.pop(); + + if (throw_not_found) { + throw_renderer_error("variable '" + static_cast(data_node->name) + "' not found", *data_node); + } + } + } + return result; + } + + void visit(const BlockNode& node) { + for (auto& n : node.nodes) { + n->accept(*this); + + if (break_rendering) { + break; + } + } + } + + void visit(const TextNode& node) { + output_stream->write(current_template->content.c_str() + node.pos, node.length); + } + + void visit(const ExpressionNode&) {} + + void visit(const LiteralNode& node) { + data_eval_stack.push(&node.value); + } + + void visit(const DataNode& node) { + if (additional_data.contains(node.ptr)) { + data_eval_stack.push(&(additional_data[node.ptr])); + } else if (data_input->contains(node.ptr)) { + data_eval_stack.push(&(*data_input)[node.ptr]); + } else { + // Try to evaluate as a no-argument callback + const auto function_data = function_storage.find_function(node.name, 0); + if (function_data.operation == FunctionStorage::Operation::Callback) { + Arguments empty_args {}; + const auto value = std::make_shared(function_data.callback(empty_args)); + data_tmp_stack.push_back(value); + data_eval_stack.push(value.get()); + } else { + data_eval_stack.push(nullptr); + not_found_stack.emplace(&node); + } + } + } + + void visit(const FunctionNode& node) { + switch (node.operation) { + case Op::Not: { + const auto args = get_arguments<1>(node); + make_result(!truthy(args[0])); + } break; + case Op::And: { + make_result(truthy(get_arguments<1, 0>(node)[0]) && truthy(get_arguments<1, 1>(node)[0])); + } break; + case Op::Or: { + make_result(truthy(get_arguments<1, 0>(node)[0]) || truthy(get_arguments<1, 1>(node)[0])); + } break; + case Op::In: { + const auto args = get_arguments<2>(node); + make_result(std::find(args[1]->begin(), args[1]->end(), *args[0]) != args[1]->end()); + } break; + case Op::Equal: { + const auto args = get_arguments<2>(node); + make_result(*args[0] == *args[1]); + } break; + case Op::NotEqual: { + const auto args = get_arguments<2>(node); + make_result(*args[0] != *args[1]); + } break; + case Op::Greater: { + const auto args = get_arguments<2>(node); + make_result(*args[0] > *args[1]); + } break; + case Op::GreaterEqual: { + const auto args = get_arguments<2>(node); + make_result(*args[0] >= *args[1]); + } break; + case Op::Less: { + const auto args = get_arguments<2>(node); + make_result(*args[0] < *args[1]); + } break; + case Op::LessEqual: { + const auto args = get_arguments<2>(node); + make_result(*args[0] <= *args[1]); + } break; + case Op::Add: { + const auto args = get_arguments<2>(node); + if (args[0]->is_string() && args[1]->is_string()) { + make_result(args[0]->get_ref() + args[1]->get_ref()); + } else if (args[0]->is_number_integer() && args[1]->is_number_integer()) { + make_result(args[0]->get() + args[1]->get()); + } else { + make_result(args[0]->get() + args[1]->get()); + } + } break; + case Op::Subtract: { + const auto args = get_arguments<2>(node); + if (args[0]->is_number_integer() && args[1]->is_number_integer()) { + make_result(args[0]->get() - args[1]->get()); + } else { + make_result(args[0]->get() - args[1]->get()); + } + } break; + case Op::Multiplication: { + const auto args = get_arguments<2>(node); + if (args[0]->is_number_integer() && args[1]->is_number_integer()) { + make_result(args[0]->get() * args[1]->get()); + } else { + make_result(args[0]->get() * args[1]->get()); + } + } break; + case Op::Division: { + const auto args = get_arguments<2>(node); + if (args[1]->get() == 0) { + throw_renderer_error("division by zero", node); + } + make_result(args[0]->get() / args[1]->get()); + } break; + case Op::Power: { + const auto args = get_arguments<2>(node); + if (args[0]->is_number_integer() && args[1]->get() >= 0) { + int result = static_cast(std::pow(args[0]->get(), args[1]->get())); + make_result(result); + } else { + double result = std::pow(args[0]->get(), args[1]->get()); + make_result(result); + } + } break; + case Op::Modulo: { + const auto args = get_arguments<2>(node); + make_result(args[0]->get() % args[1]->get()); + } break; + case Op::AtId: { + const auto container = get_arguments<1, 0, false>(node)[0]; + node.arguments[1]->accept(*this); + if (not_found_stack.empty()) { + throw_renderer_error("could not find element with given name", node); + } + const auto id_node = not_found_stack.top(); + not_found_stack.pop(); + data_eval_stack.pop(); + data_eval_stack.push(&container->at(id_node->name)); + } break; + case Op::At: { + const auto args = get_arguments<2>(node); + if (args[0]->is_object()) { + data_eval_stack.push(&args[0]->at(args[1]->get())); + } else { + data_eval_stack.push(&args[0]->at(args[1]->get())); + } + } break; + case Op::Default: { + const auto test_arg = get_arguments<1, 0, false>(node)[0]; + data_eval_stack.push(test_arg ? test_arg : get_arguments<1, 1>(node)[0]); + } break; + case Op::DivisibleBy: { + const auto args = get_arguments<2>(node); + const int divisor = args[1]->get(); + make_result((divisor != 0) && (args[0]->get() % divisor == 0)); + } break; + case Op::Even: { + make_result(get_arguments<1>(node)[0]->get() % 2 == 0); + } break; + case Op::Exists: { + auto&& name = get_arguments<1>(node)[0]->get_ref(); + make_result(data_input->contains(json::json_pointer(DataNode::convert_dot_to_ptr(name)))); + } break; + case Op::ExistsInObject: { + const auto args = get_arguments<2>(node); + auto&& name = args[1]->get_ref(); + make_result(args[0]->find(name) != args[0]->end()); + } break; + case Op::First: { + const auto result = &get_arguments<1>(node)[0]->front(); + data_eval_stack.push(result); + } break; + case Op::Float: { + make_result(std::stod(get_arguments<1>(node)[0]->get_ref())); + } break; + case Op::Int: { + make_result(std::stoi(get_arguments<1>(node)[0]->get_ref())); + } break; + case Op::Last: { + const auto result = &get_arguments<1>(node)[0]->back(); + data_eval_stack.push(result); + } break; + case Op::Length: { + const auto val = get_arguments<1>(node)[0]; + if (val->is_string()) { + make_result(val->get_ref().length()); + } else { + make_result(val->size()); + } + } break; + case Op::Lower: { + std::string result = get_arguments<1>(node)[0]->get(); + std::transform(result.begin(), result.end(), result.begin(), ::tolower); + make_result(std::move(result)); + } break; + case Op::Max: { + const auto args = get_arguments<1>(node); + const auto result = std::max_element(args[0]->begin(), args[0]->end()); + data_eval_stack.push(&(*result)); + } break; + case Op::Min: { + const auto args = get_arguments<1>(node); + const auto result = std::min_element(args[0]->begin(), args[0]->end()); + data_eval_stack.push(&(*result)); + } break; + case Op::Odd: { + make_result(get_arguments<1>(node)[0]->get() % 2 != 0); + } break; + case Op::Range: { + std::vector result(get_arguments<1>(node)[0]->get()); + std::iota(result.begin(), result.end(), 0); + make_result(std::move(result)); + } break; + case Op::Round: { + const auto args = get_arguments<2>(node); + const int precision = args[1]->get(); + const double result = std::round(args[0]->get() * std::pow(10.0, precision)) / std::pow(10.0, precision); + if (precision == 0) { + make_result(int(result)); + } else { + make_result(result); + } + } break; + case Op::Sort: { + auto result_ptr = std::make_shared(get_arguments<1>(node)[0]->get>()); + std::sort(result_ptr->begin(), result_ptr->end()); + data_tmp_stack.push_back(result_ptr); + data_eval_stack.push(result_ptr.get()); + } break; + case Op::Upper: { + std::string result = get_arguments<1>(node)[0]->get(); + std::transform(result.begin(), result.end(), result.begin(), ::toupper); + make_result(std::move(result)); + } break; + case Op::IsBoolean: { + make_result(get_arguments<1>(node)[0]->is_boolean()); + } break; + case Op::IsNumber: { + make_result(get_arguments<1>(node)[0]->is_number()); + } break; + case Op::IsInteger: { + make_result(get_arguments<1>(node)[0]->is_number_integer()); + } break; + case Op::IsFloat: { + make_result(get_arguments<1>(node)[0]->is_number_float()); + } break; + case Op::IsObject: { + make_result(get_arguments<1>(node)[0]->is_object()); + } break; + case Op::IsArray: { + make_result(get_arguments<1>(node)[0]->is_array()); + } break; + case Op::IsString: { + make_result(get_arguments<1>(node)[0]->is_string()); + } break; + case Op::Callback: { + auto args = get_argument_vector(node); + make_result(node.callback(args)); + } break; + case Op::Super: { + const auto args = get_argument_vector(node); + const size_t old_level = current_level; + const size_t level_diff = (args.size() == 1) ? args[0]->get() : 1; + const size_t level = current_level + level_diff; + + if (block_statement_stack.empty()) { + throw_renderer_error("super() call is not within a block", node); + } + + if (level < 1 || level > template_stack.size() - 1) { + throw_renderer_error("level of super() call does not match parent templates (between 1 and " + std::to_string(template_stack.size() - 1) + ")", node); + } + + const auto current_block_statement = block_statement_stack.back(); + const Template* new_template = template_stack.at(level); + const Template* old_template = current_template; + const auto block_it = new_template->block_storage.find(current_block_statement->name); + if (block_it != new_template->block_storage.end()) { + current_template = new_template; + current_level = level; + block_it->second->block.accept(*this); + current_level = old_level; + current_template = old_template; + } else { + throw_renderer_error("could not find block with name '" + current_block_statement->name + "'", node); + } + make_result(nullptr); + } break; + case Op::Join: { + const auto args = get_arguments<2>(node); + const auto separator = args[1]->get(); + std::ostringstream os; + std::string sep; + for (const auto& value : *args[0]) { + os << sep; + if (value.is_string()) { + os << value.get(); // otherwise the value is surrounded with "" + } else { + os << value.dump(); + } + sep = separator; + } + make_result(os.str()); + } break; + case Op::ParenLeft: + case Op::ParenRight: + case Op::None: + break; + } + } + + void visit(const ExpressionListNode& node) { + print_data(eval_expression_list(node)); + } + + void visit(const StatementNode&) {} + + void visit(const ForStatementNode&) {} + + void visit(const ForArrayStatementNode& node) { + const auto result = eval_expression_list(node.condition); + if (!result->is_array()) { + throw_renderer_error("object must be an array", node); + } + + if (!current_loop_data->empty()) { + auto tmp = *current_loop_data; // Because of clang-3 + (*current_loop_data)["parent"] = std::move(tmp); + } + + size_t index = 0; + (*current_loop_data)["is_first"] = true; + (*current_loop_data)["is_last"] = (result->size() <= 1); + for (auto it = result->begin(); it != result->end(); ++it) { + additional_data[static_cast(node.value)] = *it; + + (*current_loop_data)["index"] = index; + (*current_loop_data)["index1"] = index + 1; + if (index == 1) { + (*current_loop_data)["is_first"] = false; + } + if (index == result->size() - 1) { + (*current_loop_data)["is_last"] = true; + } + + node.body.accept(*this); + ++index; + } + + additional_data[static_cast(node.value)].clear(); + if (!(*current_loop_data)["parent"].empty()) { + const auto tmp = (*current_loop_data)["parent"]; + *current_loop_data = std::move(tmp); + } else { + current_loop_data = &additional_data["loop"]; + } + } + + void visit(const ForObjectStatementNode& node) { + const auto result = eval_expression_list(node.condition); + if (!result->is_object()) { + throw_renderer_error("object must be an object", node); + } + + if (!current_loop_data->empty()) { + (*current_loop_data)["parent"] = std::move(*current_loop_data); + } + + size_t index = 0; + (*current_loop_data)["is_first"] = true; + (*current_loop_data)["is_last"] = (result->size() <= 1); + for (auto it = result->begin(); it != result->end(); ++it) { + additional_data[static_cast(node.key)] = it.key(); + additional_data[static_cast(node.value)] = it.value(); + + (*current_loop_data)["index"] = index; + (*current_loop_data)["index1"] = index + 1; + if (index == 1) { + (*current_loop_data)["is_first"] = false; + } + if (index == result->size() - 1) { + (*current_loop_data)["is_last"] = true; + } + + node.body.accept(*this); + ++index; + } + + additional_data[static_cast(node.key)].clear(); + additional_data[static_cast(node.value)].clear(); + if (!(*current_loop_data)["parent"].empty()) { + *current_loop_data = std::move((*current_loop_data)["parent"]); + } else { + current_loop_data = &additional_data["loop"]; + } + } + + void visit(const IfStatementNode& node) { + const auto result = eval_expression_list(node.condition); + if (truthy(result.get())) { + node.true_statement.accept(*this); + } else if (node.has_false_statement) { + node.false_statement.accept(*this); + } + } + + void visit(const IncludeStatementNode& node) { + auto sub_renderer = Renderer(config, template_storage, function_storage); + const auto included_template_it = template_storage.find(node.file); + if (included_template_it != template_storage.end()) { + sub_renderer.render_to(*output_stream, included_template_it->second, *data_input, &additional_data); + } else if (config.throw_at_missing_includes) { + throw_renderer_error("include '" + node.file + "' not found", node); + } + } + + void visit(const ExtendsStatementNode& node) { + const auto included_template_it = template_storage.find(node.file); + if (included_template_it != template_storage.end()) { + const Template* parent_template = &included_template_it->second; + render_to(*output_stream, *parent_template, *data_input, &additional_data); + break_rendering = true; + } else if (config.throw_at_missing_includes) { + throw_renderer_error("extends '" + node.file + "' not found", node); + } + } + + void visit(const BlockStatementNode& node) { + const size_t old_level = current_level; + current_level = 0; + current_template = template_stack.front(); + const auto block_it = current_template->block_storage.find(node.name); + if (block_it != current_template->block_storage.end()) { + block_statement_stack.emplace_back(&node); + block_it->second->block.accept(*this); + block_statement_stack.pop_back(); + } + current_level = old_level; + current_template = template_stack.back(); + } + + void visit(const SetStatementNode& node) { + std::string ptr = node.key; + replace_substring(ptr, ".", "/"); + ptr = "/" + ptr; + additional_data[json::json_pointer(ptr)] = *eval_expression_list(node.expression); + } + +public: + Renderer(const RenderConfig& config, const TemplateStorage& template_storage, const FunctionStorage& function_storage) + : config(config), template_storage(template_storage), function_storage(function_storage) {} + + void render_to(std::ostream& os, const Template& tmpl, const json& data, json* loop_data = nullptr) { + output_stream = &os; + current_template = &tmpl; + data_input = &data; + if (loop_data) { + additional_data = *loop_data; + current_loop_data = &additional_data["loop"]; + } + + template_stack.emplace_back(current_template); + current_template->root.accept(*this); + + data_tmp_stack.clear(); } }; -} // namespace inja +} // namespace inja -#endif // PANTOR_INJA_RENDERER_HPP - -// #include "string_view.hpp" +#endif // INCLUDE_INJA_RENDERER_HPP_ // #include "template.hpp" // #include "utils.hpp" - namespace inja { -using namespace nlohmann; - /*! * \brief Class for changing the configuration. */ class Environment { - class Impl { - public: - std::string input_path; - std::string output_path; + std::string input_path; + std::string output_path; - LexerConfig lexer_config; - ParserConfig parser_config; + LexerConfig lexer_config; + ParserConfig parser_config; + RenderConfig render_config; - FunctionStorage callbacks; - TemplateStorage included_templates; - }; + FunctionStorage function_storage; + TemplateStorage template_storage; - std::unique_ptr m_impl; +public: + Environment(): Environment("") {} - public: - Environment(): Environment("") { } + explicit Environment(const std::string& global_path): input_path(global_path), output_path(global_path) {} - explicit Environment(const std::string& global_path): m_impl(stdinja::make_unique()) { - m_impl->input_path = global_path; - m_impl->output_path = global_path; - } - - explicit Environment(const std::string& input_path, const std::string& output_path): m_impl(stdinja::make_unique()) { - m_impl->input_path = input_path; - m_impl->output_path = output_path; - } + Environment(const std::string& input_path, const std::string& output_path): input_path(input_path), output_path(output_path) {} /// Sets the opener and closer for template statements void set_statement(const std::string& open, const std::string& close) { - m_impl->lexer_config.statement_open = open; - m_impl->lexer_config.statement_close = close; - m_impl->lexer_config.update_open_chars(); + lexer_config.statement_open = open; + lexer_config.statement_open_no_lstrip = open + "+"; + lexer_config.statement_open_force_lstrip = open + "-"; + lexer_config.statement_close = close; + lexer_config.statement_close_force_rstrip = "-" + close; + lexer_config.update_open_chars(); } /// Sets the opener for template line statements void set_line_statement(const std::string& open) { - m_impl->lexer_config.line_statement = open; - m_impl->lexer_config.update_open_chars(); + lexer_config.line_statement = open; + lexer_config.update_open_chars(); } /// Sets the opener and closer for template expressions void set_expression(const std::string& open, const std::string& close) { - m_impl->lexer_config.expression_open = open; - m_impl->lexer_config.expression_close = close; - m_impl->lexer_config.update_open_chars(); + lexer_config.expression_open = open; + lexer_config.expression_open_force_lstrip = open + "-"; + lexer_config.expression_close = close; + lexer_config.expression_close_force_rstrip = "-" + close; + lexer_config.update_open_chars(); } /// Sets the opener and closer for template comments void set_comment(const std::string& open, const std::string& close) { - m_impl->lexer_config.comment_open = open; - m_impl->lexer_config.comment_close = close; - m_impl->lexer_config.update_open_chars(); + lexer_config.comment_open = open; + lexer_config.comment_open_force_lstrip = open + "-"; + lexer_config.comment_close = close; + lexer_config.comment_close_force_rstrip = "-" + close; + lexer_config.update_open_chars(); } /// Sets whether to remove the first newline after a block void set_trim_blocks(bool trim_blocks) { - m_impl->lexer_config.trim_blocks = trim_blocks; + lexer_config.trim_blocks = trim_blocks; } /// Sets whether to strip the spaces and tabs from the start of a line to a block void set_lstrip_blocks(bool lstrip_blocks) { - m_impl->lexer_config.lstrip_blocks = lstrip_blocks; + lexer_config.lstrip_blocks = lstrip_blocks; } /// Sets the element notation syntax - void set_element_notation(ElementNotation notation) { - m_impl->parser_config.notation = notation; + void set_search_included_templates_in_files(bool search_in_files) { + parser_config.search_included_templates_in_files = search_in_files; } + /// Sets whether a missing include will throw an error + void set_throw_at_missing_includes(bool will_throw) { + render_config.throw_at_missing_includes = will_throw; + } - Template parse(nonstd::string_view input) { - Parser parser(m_impl->parser_config, m_impl->lexer_config, m_impl->included_templates); + Template parse(std::string_view input) { + Parser parser(parser_config, lexer_config, template_storage, function_storage); return parser.parse(input); } Template parse_template(const std::string& filename) { - Parser parser(m_impl->parser_config, m_impl->lexer_config, m_impl->included_templates); - return parser.parse_template(m_impl->input_path + static_cast(filename)); - } + Parser parser(parser_config, lexer_config, template_storage, function_storage); + auto result = Template(parser.load_file(input_path + static_cast(filename))); + parser.parse_into_template(result, input_path + static_cast(filename)); + return result; + } - std::string render(nonstd::string_view input, const json& data) { + Template parse_file(const std::string& filename) { + return parse_template(filename); + } + + std::string render(std::string_view input, const json& data) { return render(parse(input), data); } @@ -3437,55 +2821,85 @@ class Environment { } std::string render_file(const std::string& filename, const json& data) { - return render(parse_template(filename), data); - } + return render(parse_template(filename), data); + } std::string render_file_with_json_file(const std::string& filename, const std::string& filename_data) { - const json data = load_json(filename_data); - return render_file(filename, data); - } + const json data = load_json(filename_data); + return render_file(filename, data); + } void write(const std::string& filename, const json& data, const std::string& filename_out) { - std::ofstream file(m_impl->output_path + filename_out); - file << render_file(filename, data); - file.close(); - } + std::ofstream file(output_path + filename_out); + file << render_file(filename, data); + file.close(); + } void write(const Template& temp, const json& data, const std::string& filename_out) { - std::ofstream file(m_impl->output_path + filename_out); - file << render(temp, data); - file.close(); - } + std::ofstream file(output_path + filename_out); + file << render(temp, data); + file.close(); + } - void write_with_json_file(const std::string& filename, const std::string& filename_data, const std::string& filename_out) { - const json data = load_json(filename_data); - write(filename, data, filename_out); - } + void write_with_json_file(const std::string& filename, const std::string& filename_data, const std::string& filename_out) { + const json data = load_json(filename_data); + write(filename, data, filename_out); + } - void write_with_json_file(const Template& temp, const std::string& filename_data, const std::string& filename_out) { - const json data = load_json(filename_data); - write(temp, data, filename_out); - } + void write_with_json_file(const Template& temp, const std::string& filename_data, const std::string& filename_out) { + const json data = load_json(filename_data); + write(temp, data, filename_out); + } std::ostream& render_to(std::ostream& os, const Template& tmpl, const json& data) { - Renderer(m_impl->included_templates, m_impl->callbacks).render_to(os, tmpl, data); + Renderer(render_config, template_storage, function_storage).render_to(os, tmpl, data); return os; } std::string load_file(const std::string& filename) { - Parser parser(m_impl->parser_config, m_impl->lexer_config, m_impl->included_templates); - return parser.load_file(m_impl->input_path + filename); - } + Parser parser(parser_config, lexer_config, template_storage, function_storage); + return parser.load_file(input_path + filename); + } json load_json(const std::string& filename) { - std::ifstream file = open_file_or_throw(m_impl->input_path + filename); - json j; - file >> j; - return j; + std::ifstream file; + file.open(input_path + filename); + if (file.fail()) { + INJA_THROW(FileError("failed accessing file at '" + input_path + filename + "'")); } - void add_callback(const std::string& name, unsigned int numArgs, const CallbackFunction& callback) { - m_impl->callbacks.add_callback(name, numArgs, callback); + return json::parse(std::istreambuf_iterator(file), std::istreambuf_iterator()); + } + + /*! + @brief Adds a variadic callback + */ + void add_callback(const std::string& name, const CallbackFunction& callback) { + add_callback(name, -1, callback); + } + + /*! + @brief Adds a variadic void callback + */ + void add_void_callback(const std::string& name, const VoidCallbackFunction& callback) { + add_void_callback(name, -1, callback); + } + + /*! + @brief Adds a callback with given number or arguments + */ + void add_callback(const std::string& name, int num_args, const CallbackFunction& callback) { + function_storage.add_callback(name, num_args, callback); + } + + /*! + @brief Adds a void callback with given number or arguments + */ + void add_void_callback(const std::string& name, int num_args, const VoidCallbackFunction& callback) { + function_storage.add_callback(name, num_args, [callback](Arguments& args) { + callback(args); + return json(); + }); } /** Includes a template with a given name into the environment. @@ -3493,37 +2907,43 @@ class Environment { * include "" syntax. */ void include_template(const std::string& name, const Template& tmpl) { - m_impl->included_templates[name] = tmpl; + template_storage[name] = tmpl; + } + + /*! + @brief Sets a function that is called when an included file is not found + */ + void set_include_callback(const std::function& callback) { + parser_config.include_callback = callback; } }; /*! @brief render with default settings to a string */ -inline std::string render(nonstd::string_view input, const json& data) { +inline std::string render(std::string_view input, const json& data) { return Environment().render(input, data); } /*! @brief render with default settings to the given output stream */ -inline void render_to(std::ostream& os, nonstd::string_view input, const json& data) { +inline void render_to(std::ostream& os, std::string_view input, const json& data) { Environment env; env.render_to(os, env.parse(input), data); } -} +} // namespace inja -#endif // PANTOR_INJA_ENVIRONMENT_HPP +#endif // INCLUDE_INJA_ENVIRONMENT_HPP_ -// #include "string_view.hpp" - -// #include "template.hpp" +// #include "exceptions.hpp" // #include "parser.hpp" // #include "renderer.hpp" +// #include "template.hpp" -#endif // PANTOR_INJA_HPP +#endif // INCLUDE_INJA_INJA_HPP_ diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp index 2ba5fd082..099ac81af 100755 --- a/tools/jsonproc/jsonproc.cpp +++ b/tools/jsonproc/jsonproc.cpp @@ -7,6 +7,9 @@ #include using std::string; using std::to_string; +#include +using std::replace_if; + #include using namespace inja; using json = nlohmann::json; @@ -33,6 +36,7 @@ int main(int argc, char *argv[]) string outputFilepath = argv[3]; Environment env; + env.set_trim_blocks(true); // Add custom command callbacks. env.add_callback("doNotModifyHeader", 0, [jsonfilepath, templateFilepath](Arguments& args) { @@ -96,6 +100,19 @@ int main(int argc, char *argv[]) return args.at(0)->empty(); }); + env.add_callback("isEmptyString", 1, [](Arguments& args) { + return args.at(0)->get().empty(); + }); + + env.add_callback("cleanString", 1, [](Arguments& args) { + string badChars = ".'{} \n\t-_\u00e9"; + string str = args.at(0)->get(); + str.erase(remove_if(str.begin(), str.end(), [&badChars](const char &c) { + return badChars.find(c) != std::string::npos; + }), str.end()); + return str; + }); + try { env.write_with_json_file(templateFilepath, jsonfilepath, outputFilepath); diff --git a/tools/jsonproc/nlohmann/json.hpp b/tools/jsonproc/nlohmann/json.hpp index 5003a4fa2..33a91164c 100755 --- a/tools/jsonproc/nlohmann/json.hpp +++ b/tools/jsonproc/nlohmann/json.hpp @@ -1,12 +1,12 @@ /* __ _____ _____ _____ __| | __| | | | JSON for Modern C++ -| | |__ | | | | | | version 3.6.1 +| | |__ | | | | | | version 3.10.5 |_____|_____|_____|_|___| https://github.com/nlohmann/json Licensed under the MIT License . SPDX-License-Identifier: MIT -Copyright (c) 2013-2019 Niels Lohmann . +Copyright (c) 2013-2022 Niels Lohmann . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -27,20 +27,29 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/****************************************************************************\ + * Note on documentation: The source files contain links to the online * + * documentation of the public API at https://json.nlohmann.me. This URL * + * contains the most recent documentation and should also be applicable to * + * previous versions; documentation for deprecated functions is not * + * removed, but marked deprecated. See "Generate documentation" section in * + * file doc/README.md. * +\****************************************************************************/ + #ifndef INCLUDE_NLOHMANN_JSON_HPP_ #define INCLUDE_NLOHMANN_JSON_HPP_ #define NLOHMANN_JSON_VERSION_MAJOR 3 -#define NLOHMANN_JSON_VERSION_MINOR 6 -#define NLOHMANN_JSON_VERSION_PATCH 1 +#define NLOHMANN_JSON_VERSION_MINOR 10 +#define NLOHMANN_JSON_VERSION_PATCH 5 #include // all_of, find, for_each -#include // assert -#include // and, not, or #include // nullptr_t, ptrdiff_t, size_t #include // hash, less #include // initializer_list -#include // istream, ostream +#ifndef JSON_NO_IO + #include // istream, ostream +#endif // JSON_NO_IO #include // random_access_iterator_tag #include // unique_ptr #include // accumulate @@ -51,6 +60,7 @@ SOFTWARE. // #include +#include #include // #include @@ -58,7 +68,6 @@ SOFTWARE. #include // transform #include // array -#include // and, not #include // forward_list #include // inserter, front_inserter, end #include // map @@ -75,383 +84,2222 @@ SOFTWARE. #include // exception #include // runtime_error #include // to_string +#include // vector -// #include +// #include +#include // array #include // size_t +#include // uint8_t +#include // string namespace nlohmann { namespace detail { -/// struct to capture the start position of the current token -struct position_t -{ - /// the total number of characters read - std::size_t chars_read_total = 0; - /// the number of characters read in the current line - std::size_t chars_read_current_line = 0; - /// the number of lines read - std::size_t lines_read = 0; - - /// conversion to size_t to preserve SAX interface - constexpr operator size_t() const - { - return chars_read_total; - } -}; - -} // namespace detail -} // namespace nlohmann - - -namespace nlohmann -{ -namespace detail -{ -//////////////// -// exceptions // -//////////////// +/////////////////////////// +// JSON type enumeration // +/////////////////////////// /*! -@brief general exception of the @ref basic_json class +@brief the JSON type enumeration -This class is an extension of `std::exception` objects with a member @a id for -exception ids. It is used as the base class for all exceptions thrown by the -@ref basic_json class. This class can hence be used as "wildcard" to catch -exceptions. +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. -Subclasses: -- @ref parse_error for exceptions indicating a parse error -- @ref invalid_iterator for exceptions indicating errors with iterators -- @ref type_error for exceptions indicating executing a member function with - a wrong type -- @ref out_of_range for exceptions indicating access out of the defined range -- @ref other_error for exceptions indicating other library errors +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. -@internal -@note To have nothrow-copy-constructible exceptions, we internally use - `std::runtime_error` which can cope with arbitrary-length error messages. - Intermediate strings are built with static functions and then passed to - the actual constructor. -@endinternal +@sa see @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type -@liveexample{The following code shows how arbitrary library exceptions can be -caught.,exception} - -@since version 3.0.0 +@since version 1.0.0 */ -class exception : public std::exception +enum class value_t : std::uint8_t { - public: - /// returns the explanatory string - const char* what() const noexcept override - { - return m.what(); - } - - /// the id of the exception - const int id; - - protected: - exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} - - static std::string name(const std::string& ename, int id_) - { - return "[json.exception." + ename + "." + std::to_string(id_) + "] "; - } - - private: - /// an exception object as storage for error messages - std::runtime_error m; + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function }; /*! -@brief exception indicating a parse error +@brief comparison operator for JSON types -This exception is thrown by the library when a parse error occurs. Parse errors -can occur during the deserialization of JSON text, CBOR, MessagePack, as well -as when using JSON Patch. +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. -Member @a byte holds the byte index of the last read character in the input -file. - -Exceptions have ids 1xx. - -name / id | example message | description ------------------------------- | --------------- | ------------------------- -json.exception.parse_error.101 | parse error at 2: unexpected end of input; expected string literal | This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member @a byte indicates the error position. -json.exception.parse_error.102 | parse error at 14: missing or wrong low surrogate | JSON uses the `\uxxxx` format to describe Unicode characters. Code points above above 0xFFFF are split into two `\uxxxx` entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point. -json.exception.parse_error.103 | parse error: code points above 0x10FFFF are invalid | Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid. -json.exception.parse_error.104 | parse error: JSON patch must be an array of objects | [RFC 6902](https://tools.ietf.org/html/rfc6902) requires a JSON Patch document to be a JSON document that represents an array of objects. -json.exception.parse_error.105 | parse error: operation must have string member 'op' | An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors. -json.exception.parse_error.106 | parse error: array index '01' must not begin with '0' | An array index in a JSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)) may be `0` or any number without a leading `0`. -json.exception.parse_error.107 | parse error: JSON pointer must be empty or begin with '/' - was: 'foo' | A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a `/` character. -json.exception.parse_error.108 | parse error: escape character '~' must be followed with '0' or '1' | In a JSON Pointer, only `~0` and `~1` are valid escape sequences. -json.exception.parse_error.109 | parse error: array index 'one' is not a number | A JSON Pointer array index must be a number. -json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vector | When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read. -json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xF8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read. -json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read. -json.exception.parse_error.114 | parse error: Unsupported BSON record type 0x0F | The parsing of the corresponding BSON record type is not implemented (yet). - -@note For an input with n bytes, 1 is the index of the first character and n+1 - is the index of the terminating null byte or the end of file. This also - holds true when reading a byte vector (CBOR or MessagePack). - -@liveexample{The following code shows how a `parse_error` exception can be -caught.,parse_error} - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref invalid_iterator for exceptions indicating errors with iterators -@sa - @ref type_error for exceptions indicating executing a member function with - a wrong type -@sa - @ref out_of_range for exceptions indicating access out of the defined range -@sa - @ref other_error for exceptions indicating other library errors - -@since version 3.0.0 +@since version 1.0.0 */ -class parse_error : public exception +inline bool operator<(const value_t lhs, const value_t rhs) noexcept { - public: - /*! - @brief create a parse error exception - @param[in] id_ the id of the exception - @param[in] pos the position where the error occurred (or with - chars_read_total=0 if the position cannot be - determined) - @param[in] what_arg the explanatory string - @return parse_error object - */ - static parse_error create(int id_, const position_t& pos, const std::string& what_arg) - { - std::string w = exception::name("parse_error", id_) + "parse error" + - position_string(pos) + ": " + what_arg; - return parse_error(id_, pos.chars_read_total, w.c_str()); - } + static constexpr std::array order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; - static parse_error create(int id_, std::size_t byte_, const std::string& what_arg) - { - std::string w = exception::name("parse_error", id_) + "parse error" + - (byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") + - ": " + what_arg; - return parse_error(id_, byte_, w.c_str()); - } - - /*! - @brief byte index of the parse error - - The byte index of the last read character in the input file. - - @note For an input with n bytes, 1 is the index of the first character and - n+1 is the index of the terminating null byte or the end of file. - This also holds true when reading a byte vector (CBOR or MessagePack). - */ - const std::size_t byte; - - private: - parse_error(int id_, std::size_t byte_, const char* what_arg) - : exception(id_, what_arg), byte(byte_) {} - - static std::string position_string(const position_t& pos) - { - return " at line " + std::to_string(pos.lines_read + 1) + - ", column " + std::to_string(pos.chars_read_current_line); - } -}; - -/*! -@brief exception indicating errors with iterators - -This exception is thrown if iterators passed to a library function do not match -the expected semantics. - -Exceptions have ids 2xx. - -name / id | example message | description ------------------------------------ | --------------- | ------------------------- -json.exception.invalid_iterator.201 | iterators are not compatible | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. -json.exception.invalid_iterator.202 | iterator does not fit current value | In an erase or insert function, the passed iterator @a pos does not belong to the JSON value for which the function was called. It hence does not define a valid position for the deletion/insertion. -json.exception.invalid_iterator.203 | iterators do not fit current value | Either iterator passed to function @ref erase(IteratorType first, IteratorType last) does not belong to the JSON value from which values shall be erased. It hence does not define a valid range to delete values from. -json.exception.invalid_iterator.204 | iterators out of range | When an iterator range for a primitive type (number, boolean, or string) is passed to a constructor or an erase function, this range has to be exactly (@ref begin(), @ref end()), because this is the only way the single stored value is expressed. All other ranges are invalid. -json.exception.invalid_iterator.205 | iterator out of range | When an iterator for a primitive type (number, boolean, or string) is passed to an erase function, the iterator has to be the @ref begin() iterator, because it is the only way to address the stored value. All other iterators are invalid. -json.exception.invalid_iterator.206 | cannot construct with iterators from null | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) belong to a JSON null value and hence to not define a valid range. -json.exception.invalid_iterator.207 | cannot use key() for non-object iterators | The key() member function can only be used on iterators belonging to a JSON object, because other types do not have a concept of a key. -json.exception.invalid_iterator.208 | cannot use operator[] for object iterators | The operator[] to specify a concrete offset cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. -json.exception.invalid_iterator.209 | cannot use offsets with object iterators | The offset operators (+, -, +=, -=) cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. -json.exception.invalid_iterator.210 | iterators do not fit | The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. -json.exception.invalid_iterator.211 | passed iterators may not belong to container | The iterator range passed to the insert function must not be a subrange of the container to insert to. -json.exception.invalid_iterator.212 | cannot compare iterators of different containers | When two iterators are compared, they must belong to the same container. -json.exception.invalid_iterator.213 | cannot compare order of object iterators | The order of object iterators cannot be compared, because JSON objects are unordered. -json.exception.invalid_iterator.214 | cannot get value | Cannot get value for iterator: Either the iterator belongs to a null value or it is an iterator to a primitive type (number, boolean, or string), but the iterator is different to @ref begin(). - -@liveexample{The following code shows how an `invalid_iterator` exception can be -caught.,invalid_iterator} - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref parse_error for exceptions indicating a parse error -@sa - @ref type_error for exceptions indicating executing a member function with - a wrong type -@sa - @ref out_of_range for exceptions indicating access out of the defined range -@sa - @ref other_error for exceptions indicating other library errors - -@since version 3.0.0 -*/ -class invalid_iterator : public exception -{ - public: - static invalid_iterator create(int id_, const std::string& what_arg) - { - std::string w = exception::name("invalid_iterator", id_) + what_arg; - return invalid_iterator(id_, w.c_str()); - } - - private: - invalid_iterator(int id_, const char* what_arg) - : exception(id_, what_arg) {} -}; - -/*! -@brief exception indicating executing a member function with a wrong type - -This exception is thrown in case of a type error; that is, a library function is -executed on a JSON value whose type does not match the expected semantics. - -Exceptions have ids 3xx. - -name / id | example message | description ------------------------------ | --------------- | ------------------------- -json.exception.type_error.301 | cannot create object from initializer list | To create an object from an initializer list, the initializer list must consist only of a list of pairs whose first element is a string. When this constraint is violated, an array is created instead. -json.exception.type_error.302 | type must be object, but is array | During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types. -json.exception.type_error.303 | incompatible ReferenceType for get_ref, actual type is object | To retrieve a reference to a value stored in a @ref basic_json object with @ref get_ref, the type of the reference must match the value type. For instance, for a JSON array, the @a ReferenceType must be @ref array_t &. -json.exception.type_error.304 | cannot use at() with string | The @ref at() member functions can only be executed for certain JSON types. -json.exception.type_error.305 | cannot use operator[] with string | The @ref operator[] member functions can only be executed for certain JSON types. -json.exception.type_error.306 | cannot use value() with string | The @ref value() member functions can only be executed for certain JSON types. -json.exception.type_error.307 | cannot use erase() with string | The @ref erase() member functions can only be executed for certain JSON types. -json.exception.type_error.308 | cannot use push_back() with string | The @ref push_back() and @ref operator+= member functions can only be executed for certain JSON types. -json.exception.type_error.309 | cannot use insert() with | The @ref insert() member functions can only be executed for certain JSON types. -json.exception.type_error.310 | cannot use swap() with number | The @ref swap() member functions can only be executed for certain JSON types. -json.exception.type_error.311 | cannot use emplace_back() with string | The @ref emplace_back() member function can only be executed for certain JSON types. -json.exception.type_error.312 | cannot use update() with string | The @ref update() member functions can only be executed for certain JSON types. -json.exception.type_error.313 | invalid value to unflatten | The @ref unflatten function converts an object whose keys are JSON Pointers back into an arbitrary nested JSON value. The JSON Pointers must not overlap, because then the resulting value would not be well defined. -json.exception.type_error.314 | only objects can be unflattened | The @ref unflatten function only works for an object whose keys are JSON Pointers. -json.exception.type_error.315 | values in object must be primitive | The @ref unflatten function only works for an object whose keys are JSON Pointers and whose values are primitive. -json.exception.type_error.316 | invalid UTF-8 byte at index 10: 0x7E | The @ref dump function only works with UTF-8 encoded strings; that is, if you assign a `std::string` to a JSON value, make sure it is UTF-8 encoded. | -json.exception.type_error.317 | JSON value cannot be serialized to requested format | The dynamic type of the object cannot be represented in the requested serialization format (e.g. a raw `true` or `null` JSON object cannot be serialized to BSON) | - -@liveexample{The following code shows how a `type_error` exception can be -caught.,type_error} - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref parse_error for exceptions indicating a parse error -@sa - @ref invalid_iterator for exceptions indicating errors with iterators -@sa - @ref out_of_range for exceptions indicating access out of the defined range -@sa - @ref other_error for exceptions indicating other library errors - -@since version 3.0.0 -*/ -class type_error : public exception -{ - public: - static type_error create(int id_, const std::string& what_arg) - { - std::string w = exception::name("type_error", id_) + what_arg; - return type_error(id_, w.c_str()); - } - - private: - type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} -}; - -/*! -@brief exception indicating access out of the defined range - -This exception is thrown in case a library function is called on an input -parameter that exceeds the expected range, for instance in case of array -indices or nonexisting object keys. - -Exceptions have ids 4xx. - -name / id | example message | description -------------------------------- | --------------- | ------------------------- -json.exception.out_of_range.401 | array index 3 is out of range | The provided array index @a i is larger than @a size-1. -json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it. -json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object. -json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved. -json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value. -json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF. -json.exception.out_of_range.407 | number overflow serializing '9223372036854775808' | UBJSON and BSON only support integer numbers up to 9223372036854775807. | -json.exception.out_of_range.408 | excessive array size: 8658170730974374167 | The size (following `#`) of an UBJSON array or object exceeds the maximal capacity. | -json.exception.out_of_range.409 | BSON key cannot contain code point U+0000 (at byte 2) | Key identifiers to be serialized to BSON cannot contain code point U+0000, since the key is stored as zero-terminated c-string | - -@liveexample{The following code shows how an `out_of_range` exception can be -caught.,out_of_range} - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref parse_error for exceptions indicating a parse error -@sa - @ref invalid_iterator for exceptions indicating errors with iterators -@sa - @ref type_error for exceptions indicating executing a member function with - a wrong type -@sa - @ref other_error for exceptions indicating other library errors - -@since version 3.0.0 -*/ -class out_of_range : public exception -{ - public: - static out_of_range create(int id_, const std::string& what_arg) - { - std::string w = exception::name("out_of_range", id_) + what_arg; - return out_of_range(id_, w.c_str()); - } - - private: - out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} -}; - -/*! -@brief exception indicating other library errors - -This exception is thrown in case of errors that cannot be classified with the -other exception types. - -Exceptions have ids 5xx. - -name / id | example message | description ------------------------------- | --------------- | ------------------------- -json.exception.other_error.501 | unsuccessful: {"op":"test","path":"/baz", "value":"bar"} | A JSON Patch operation 'test' failed. The unsuccessful operation is also printed. - -@sa - @ref exception for the base class of the library exceptions -@sa - @ref parse_error for exceptions indicating a parse error -@sa - @ref invalid_iterator for exceptions indicating errors with iterators -@sa - @ref type_error for exceptions indicating executing a member function with - a wrong type -@sa - @ref out_of_range for exceptions indicating access out of the defined range - -@liveexample{The following code shows how an `other_error` exception can be -caught.,other_error} - -@since version 3.0.0 -*/ -class other_error : public exception -{ - public: - static other_error create(int id_, const std::string& what_arg) - { - std::string w = exception::name("other_error", id_) + what_arg; - return other_error(id_, w.c_str()); - } - - private: - other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} -}; + const auto l_index = static_cast(lhs); + const auto r_index = static_cast(rhs); + return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; +} } // namespace detail } // namespace nlohmann +// #include + + +#include // #include -#include // pair +#include // declval, pair +// #include + + +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + * + * To the extent possible under law, the author(s) have dedicated all + * copyright and related and neighboring rights to this software to + * the public domain worldwide. This software is distributed without + * any warranty. + * + * For details, see . + * SPDX-License-Identifier: CC0-1.0 + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 15 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(JSON_HEDLEY_MSVC_VERSION) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #undef JSON_HEDLEY_INTEL_CL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL) + #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #undef JSON_HEDLEY_MCST_LCC_VERSION +#endif +#if defined(__LCC__) && defined(__LCC_MINOR__) + #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK) + #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_CRAY_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) && \ + !defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if \ + defined(__has_attribute) && \ + ( \ + (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \ + ) +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunused-function") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion")) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#else + #define JSON_HEDLEY_FLAGS +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if \ + (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + +// #include + + +#include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; +} // namespace detail +} // namespace nlohmann + + +// https://en.cppreference.com/w/cpp/experimental/is_detected +namespace nlohmann +{ +namespace detail +{ +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template class Op, class... Args> +using is_detected = typename detector::value_t; + +template class Op, class... Args> +struct is_detected_lazy : is_detected { }; + +template class Op, class... Args> +using detected_t = typename detector::type; + +template class Op, class... Args> +using detected_or = detector; + +template class Op, class... Args> +using detected_or_t = typename detected_or::type; + +template class Op, class... Args> +using is_detected_exact = std::is_same>; + +template class Op, class... Args> +using is_detected_convertible = + std::is_convertible, To>; +} // namespace detail +} // namespace nlohmann + // This file contains all internal macro definitions // You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them @@ -469,41 +2317,100 @@ class other_error : public exception #endif #endif -// disable float-equal warnings on GCC/clang -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wfloat-equal" +// C++ language standard detection +// if the user manually specified the used c++ version this is skipped +#if !defined(JSON_HAS_CPP_20) && !defined(JSON_HAS_CPP_17) && !defined(JSON_HAS_CPP_14) && !defined(JSON_HAS_CPP_11) + #if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 + #endif + // the cpp 11 flag is always specified because it is the minimal required version + #define JSON_HAS_CPP_11 +#endif + +#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM) + #ifdef JSON_HAS_CPP_17 + #if defined(__cpp_lib_filesystem) + #define JSON_HAS_FILESYSTEM 1 + #elif defined(__cpp_lib_experimental_filesystem) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif !defined(__has_include) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #endif + + // std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/ + #if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before GCC 8: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before Clang 7: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__clang_major__) && __clang_major__ < 7 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before MSVC 19.14: https://en.cppreference.com/w/cpp/compiler_support + #if defined(_MSC_VER) && _MSC_VER < 1914 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before iOS 13 + #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before macOS Catalina + #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + #endif +#endif + +#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_FILESYSTEM + #define JSON_HAS_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_THREE_WAY_COMPARISON + #if defined(__cpp_lib_three_way_comparison) && __cpp_lib_three_way_comparison >= 201907L \ + && defined(__cpp_impl_three_way_comparison)&& __cpp_impl_three_way_comparison >= 201907L + #define JSON_HAS_THREE_WAY_COMPARISON 1 + #else + #define JSON_HAS_THREE_WAY_COMPARISON 0 + #endif #endif // disable documentation warnings on clang #if defined(__clang__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdocumentation" + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdocumentation" + #pragma clang diagnostic ignored "-Wdocumentation-unknown-command" #endif -// allow for portable deprecation warnings -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) - #define JSON_DEPRECATED __declspec(deprecated) -#else - #define JSON_DEPRECATED -#endif - -// allow for portable nodiscard warnings -#if defined(__has_cpp_attribute) - #if __has_cpp_attribute(nodiscard) - #define JSON_NODISCARD [[nodiscard]] - #elif __has_cpp_attribute(gnu::warn_unused_result) - #define JSON_NODISCARD [[gnu::warn_unused_result]] - #else - #define JSON_NODISCARD - #endif -#else - #define JSON_NODISCARD -#endif - -// allow to disable exceptions +// allow disabling exceptions #if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) #define JSON_THROW(exception) throw exception #define JSON_TRY try @@ -537,21 +2444,17 @@ class other_error : public exception #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER #endif -// manual branch prediction -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_LIKELY(x) __builtin_expect(x, 1) - #define JSON_UNLIKELY(x) __builtin_expect(x, 0) -#else - #define JSON_LIKELY(x) x - #define JSON_UNLIKELY(x) x +// allow overriding assert +#if !defined(JSON_ASSERT) + #include // assert + #define JSON_ASSERT(x) assert(x) #endif -// C++ language standard detection -#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 - #define JSON_HAS_CPP_17 - #define JSON_HAS_CPP_14 -#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) - #define JSON_HAS_CPP_14 +// allow to access some private functions (needed by the test suite) +#if defined(JSON_TESTS_PRIVATE) + #define JSON_PRIVATE_UNLESS_TESTED public +#else + #define JSON_PRIVATE_UNLESS_TESTED private #endif /*! @@ -559,30 +2462,30 @@ class other_error : public exception @def NLOHMANN_JSON_SERIALIZE_ENUM @since version 3.4.0 */ -#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ - template \ - inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ - { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if(std::begin(m), std::end(m), \ - [e](const std::pair& ej_pair) -> bool \ - { \ - return ej_pair.first == e; \ - }); \ - j = ((it != std::end(m)) ? it : std::begin(m))->second; \ - } \ - template \ - inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ - { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if(std::begin(m), std::end(m), \ - [j](const std::pair& ej_pair) -> bool \ - { \ - return ej_pair.second == j; \ - }); \ - e = ((it != std::end(m)) ? it : std::begin(m))->first; \ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ } // Ugly macros to avoid uglier copy-paste when specializing basic_json. They @@ -594,62 +2497,689 @@ class other_error : public exception class StringType, class BooleanType, class NumberIntegerType, \ class NumberUnsignedType, class NumberFloatType, \ template class AllocatorType, \ - template class JSONSerializer> + template class JSONSerializer, \ + class BinaryType> #define NLOHMANN_BASIC_JSON_TPL \ basic_json + AllocatorType, JSONSerializer, BinaryType> -// #include +// Macros to simplify conversion from/to types + +#define NLOHMANN_JSON_EXPAND( x ) x +#define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME +#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \ + NLOHMANN_JSON_PASTE64, \ + NLOHMANN_JSON_PASTE63, \ + NLOHMANN_JSON_PASTE62, \ + NLOHMANN_JSON_PASTE61, \ + NLOHMANN_JSON_PASTE60, \ + NLOHMANN_JSON_PASTE59, \ + NLOHMANN_JSON_PASTE58, \ + NLOHMANN_JSON_PASTE57, \ + NLOHMANN_JSON_PASTE56, \ + NLOHMANN_JSON_PASTE55, \ + NLOHMANN_JSON_PASTE54, \ + NLOHMANN_JSON_PASTE53, \ + NLOHMANN_JSON_PASTE52, \ + NLOHMANN_JSON_PASTE51, \ + NLOHMANN_JSON_PASTE50, \ + NLOHMANN_JSON_PASTE49, \ + NLOHMANN_JSON_PASTE48, \ + NLOHMANN_JSON_PASTE47, \ + NLOHMANN_JSON_PASTE46, \ + NLOHMANN_JSON_PASTE45, \ + NLOHMANN_JSON_PASTE44, \ + NLOHMANN_JSON_PASTE43, \ + NLOHMANN_JSON_PASTE42, \ + NLOHMANN_JSON_PASTE41, \ + NLOHMANN_JSON_PASTE40, \ + NLOHMANN_JSON_PASTE39, \ + NLOHMANN_JSON_PASTE38, \ + NLOHMANN_JSON_PASTE37, \ + NLOHMANN_JSON_PASTE36, \ + NLOHMANN_JSON_PASTE35, \ + NLOHMANN_JSON_PASTE34, \ + NLOHMANN_JSON_PASTE33, \ + NLOHMANN_JSON_PASTE32, \ + NLOHMANN_JSON_PASTE31, \ + NLOHMANN_JSON_PASTE30, \ + NLOHMANN_JSON_PASTE29, \ + NLOHMANN_JSON_PASTE28, \ + NLOHMANN_JSON_PASTE27, \ + NLOHMANN_JSON_PASTE26, \ + NLOHMANN_JSON_PASTE25, \ + NLOHMANN_JSON_PASTE24, \ + NLOHMANN_JSON_PASTE23, \ + NLOHMANN_JSON_PASTE22, \ + NLOHMANN_JSON_PASTE21, \ + NLOHMANN_JSON_PASTE20, \ + NLOHMANN_JSON_PASTE19, \ + NLOHMANN_JSON_PASTE18, \ + NLOHMANN_JSON_PASTE17, \ + NLOHMANN_JSON_PASTE16, \ + NLOHMANN_JSON_PASTE15, \ + NLOHMANN_JSON_PASTE14, \ + NLOHMANN_JSON_PASTE13, \ + NLOHMANN_JSON_PASTE12, \ + NLOHMANN_JSON_PASTE11, \ + NLOHMANN_JSON_PASTE10, \ + NLOHMANN_JSON_PASTE9, \ + NLOHMANN_JSON_PASTE8, \ + NLOHMANN_JSON_PASTE7, \ + NLOHMANN_JSON_PASTE6, \ + NLOHMANN_JSON_PASTE5, \ + NLOHMANN_JSON_PASTE4, \ + NLOHMANN_JSON_PASTE3, \ + NLOHMANN_JSON_PASTE2, \ + NLOHMANN_JSON_PASTE1)(__VA_ARGS__)) +#define NLOHMANN_JSON_PASTE2(func, v1) func(v1) +#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2) +#define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3) +#define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4) +#define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5) +#define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6) +#define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7) +#define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8) +#define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9) +#define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10) +#define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) +#define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) +#define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) +#define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) +#define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) +#define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) +#define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) +#define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) +#define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) +#define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) +#define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) +#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) +#define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) +#define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) +#define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) +#define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) +#define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) +#define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) +#define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) +#define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) +#define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) +#define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) +#define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) +#define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) +#define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) +#define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) +#define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) +#define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) +#define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) +#define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) +#define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) +#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) +#define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) +#define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) +#define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) +#define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) +#define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) +#define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) +#define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) +#define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) +#define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) +#define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) +#define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) +#define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) +#define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) +#define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) +#define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) +#define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) +#define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) +#define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) +#define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) +#define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) +#define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) + +#define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1; +#define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1); +#define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) nlohmann_json_t.v1 = nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1); + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { Type nlohmann_json_default_obj; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { Type nlohmann_json_default_obj; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } -#include // not -#include // size_t -#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +// inspired from https://stackoverflow.com/a/26745591 +// allows to call any std function as if (e.g. with begin): +// using std::begin; begin(x); +// +// it allows using the detected idiom to retrieve the return type +// of such an expression +#define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \ + namespace detail { \ + using std::std_name; \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + } \ + \ + namespace detail2 { \ + struct std_name##_tag \ + { \ + }; \ + \ + template \ + std_name##_tag std_name(T&&...); \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + \ + template \ + struct would_call_std_##std_name \ + { \ + static constexpr auto const value = ::nlohmann::detail:: \ + is_detected_exact::value; \ + }; \ + } /* namespace detail2 */ \ + \ + template \ + struct would_call_std_##std_name : detail2::would_call_std_##std_name \ + { \ + } + +#ifndef JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_USE_IMPLICIT_CONVERSIONS 1 +#endif + +#if JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_EXPLICIT +#else + #define JSON_EXPLICIT explicit +#endif + +#ifndef JSON_DIAGNOSTICS + #define JSON_DIAGNOSTICS 0 +#endif + + +namespace nlohmann +{ +namespace detail +{ + +/*! +@brief replace all occurrences of a substring by another string + +@param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t +@param[in] f the substring to replace with @a t +@param[in] t the string to replace @a f + +@pre The search string @a f must not be empty. **This precondition is +enforced with an assertion.** + +@since version 2.0.0 +*/ +inline void replace_substring(std::string& s, const std::string& f, + const std::string& t) +{ + JSON_ASSERT(!f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != std::string::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} +} + +/*! + * @brief string escaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to escape + * @return escaped string + * + * Note the order of escaping "~" to "~0" and "/" to "~1" is important. + */ +inline std::string escape(std::string s) +{ + replace_substring(s, "~", "~0"); + replace_substring(s, "/", "~1"); + return s; +} + +/*! + * @brief string unescaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to unescape + * @return unescaped string + * + * Note the order of escaping "~1" to "/" and "~0" to "~" is important. + */ +static void unescape(std::string& s) +{ + replace_substring(s, "~1", "/"); + replace_substring(s, "~0", "~"); +} + +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // size_t + +namespace nlohmann +{ +namespace detail +{ +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +} // namespace nlohmann + +// #include + + +namespace nlohmann +{ +namespace detail +{ +//////////////// +// exceptions // +//////////////// + +/// @brief general exception of the @ref basic_json class +/// @sa https://json.nlohmann.me/api/basic_json/exception/ +class exception : public std::exception +{ + public: + /// returns the explanatory string + const char* what() const noexcept override + { + return m.what(); + } + + /// the id of the exception + const int id; // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes) + + protected: + JSON_HEDLEY_NON_NULL(3) + exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} // NOLINT(bugprone-throw-keyword-missing) + + static std::string name(const std::string& ename, int id_) + { + return "[json.exception." + ename + "." + std::to_string(id_) + "] "; + } + + template + static std::string diagnostics(const BasicJsonType& leaf_element) + { +#if JSON_DIAGNOSTICS + std::vector tokens; + for (const auto* current = &leaf_element; current->m_parent != nullptr; current = current->m_parent) + { + switch (current->m_parent->type()) + { + case value_t::array: + { + for (std::size_t i = 0; i < current->m_parent->m_value.array->size(); ++i) + { + if (¤t->m_parent->m_value.array->operator[](i) == current) + { + tokens.emplace_back(std::to_string(i)); + break; + } + } + break; + } + + case value_t::object: + { + for (const auto& element : *current->m_parent->m_value.object) + { + if (&element.second == current) + { + tokens.emplace_back(element.first.c_str()); + break; + } + } + break; + } + + case value_t::null: // LCOV_EXCL_LINE + case value_t::string: // LCOV_EXCL_LINE + case value_t::boolean: // LCOV_EXCL_LINE + case value_t::number_integer: // LCOV_EXCL_LINE + case value_t::number_unsigned: // LCOV_EXCL_LINE + case value_t::number_float: // LCOV_EXCL_LINE + case value_t::binary: // LCOV_EXCL_LINE + case value_t::discarded: // LCOV_EXCL_LINE + default: // LCOV_EXCL_LINE + break; // LCOV_EXCL_LINE + } + } + + if (tokens.empty()) + { + return ""; + } + + return "(" + std::accumulate(tokens.rbegin(), tokens.rend(), std::string{}, + [](const std::string & a, const std::string & b) + { + return a + "/" + detail::escape(b); + }) + ") "; +#else + static_cast(leaf_element); + return ""; +#endif + } + + private: + /// an exception object as storage for error messages + std::runtime_error m; +}; + +/// @brief exception indicating a parse error +/// @sa https://json.nlohmann.me/api/basic_json/parse_error/ +class parse_error : public exception +{ + public: + /*! + @brief create a parse error exception + @param[in] id_ the id of the exception + @param[in] pos the position where the error occurred (or with + chars_read_total=0 if the position cannot be + determined) + @param[in] what_arg the explanatory string + @return parse_error object + */ + template + static parse_error create(int id_, const position_t& pos, const std::string& what_arg, const BasicJsonType& context) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + position_string(pos) + ": " + exception::diagnostics(context) + what_arg; + return {id_, pos.chars_read_total, w.c_str()}; + } + + template + static parse_error create(int id_, std::size_t byte_, const std::string& what_arg, const BasicJsonType& context) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + (byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") + + ": " + exception::diagnostics(context) + what_arg; + return {id_, byte_, w.c_str()}; + } + + /*! + @brief byte index of the parse error + + The byte index of the last read character in the input file. + + @note For an input with n bytes, 1 is the index of the first character and + n+1 is the index of the terminating null byte or the end of file. + This also holds true when reading a byte vector (CBOR or MessagePack). + */ + const std::size_t byte; + + private: + parse_error(int id_, std::size_t byte_, const char* what_arg) + : exception(id_, what_arg), byte(byte_) {} + + static std::string position_string(const position_t& pos) + { + return " at line " + std::to_string(pos.lines_read + 1) + + ", column " + std::to_string(pos.chars_read_current_line); + } +}; + +/// @brief exception indicating errors with iterators +/// @sa https://json.nlohmann.me/api/basic_json/invalid_iterator/ +class invalid_iterator : public exception +{ + public: + template + static invalid_iterator create(int id_, const std::string& what_arg, const BasicJsonType& context) + { + std::string w = exception::name("invalid_iterator", id_) + exception::diagnostics(context) + what_arg; + return {id_, w.c_str()}; + } + + private: + JSON_HEDLEY_NON_NULL(3) + invalid_iterator(int id_, const char* what_arg) + : exception(id_, what_arg) {} +}; + +/// @brief exception indicating executing a member function with a wrong type +/// @sa https://json.nlohmann.me/api/basic_json/type_error/ +class type_error : public exception +{ + public: + template + static type_error create(int id_, const std::string& what_arg, const BasicJsonType& context) + { + std::string w = exception::name("type_error", id_) + exception::diagnostics(context) + what_arg; + return {id_, w.c_str()}; + } + + private: + JSON_HEDLEY_NON_NULL(3) + type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/// @brief exception indicating access out of the defined range +/// @sa https://json.nlohmann.me/api/basic_json/out_of_range/ +class out_of_range : public exception +{ + public: + template + static out_of_range create(int id_, const std::string& what_arg, const BasicJsonType& context) + { + std::string w = exception::name("out_of_range", id_) + exception::diagnostics(context) + what_arg; + return {id_, w.c_str()}; + } + + private: + JSON_HEDLEY_NON_NULL(3) + out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/// @brief exception indicating other library errors +/// @sa https://json.nlohmann.me/api/basic_json/other_error/ +class other_error : public exception +{ + public: + template + static other_error create(int id_, const std::string& what_arg, const BasicJsonType& context) + { + std::string w = exception::name("other_error", id_) + exception::diagnostics(context) + what_arg; + return {id_, w.c_str()}; + } + + private: + JSON_HEDLEY_NON_NULL(3) + other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#include // index_sequence, make_index_sequence, index_sequence_for + +// #include + namespace nlohmann { namespace detail { -// alias templates to reduce boilerplate -template -using enable_if_t = typename std::enable_if::type; template using uncvref_t = typename std::remove_cv::type>::type; -// implementation of C++14 index_sequence and affiliates -// source: https://stackoverflow.com/a/32223343 -template -struct index_sequence +#ifdef JSON_HAS_CPP_14 + +// the following utilities are natively available in C++14 +using std::enable_if_t; +using std::index_sequence; +using std::make_index_sequence; +using std::index_sequence_for; + +#else + +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +// The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h +// which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0. + +//// START OF CODE FROM GOOGLE ABSEIL + +// integer_sequence +// +// Class template representing a compile-time integer sequence. An instantiation +// of `integer_sequence` has a sequence of integers encoded in its +// type through its template arguments (which is a common need when +// working with C++11 variadic templates). `absl::integer_sequence` is designed +// to be a drop-in replacement for C++14's `std::integer_sequence`. +// +// Example: +// +// template< class T, T... Ints > +// void user_function(integer_sequence); +// +// int main() +// { +// // user_function's `T` will be deduced to `int` and `Ints...` +// // will be deduced to `0, 1, 2, 3, 4`. +// user_function(make_integer_sequence()); +// } +template +struct integer_sequence { - using type = index_sequence; - using value_type = std::size_t; + using value_type = T; static constexpr std::size_t size() noexcept { return sizeof...(Ints); } }; -template -struct merge_and_renumber; +// index_sequence +// +// A helper template for an `integer_sequence` of `size_t`, +// `absl::index_sequence` is designed to be a drop-in replacement for C++14's +// `std::index_sequence`. +template +using index_sequence = integer_sequence; -template -struct merge_and_renumber, index_sequence> - : index_sequence < I1..., (sizeof...(I1) + I2)... > {}; +namespace utility_internal +{ -template -struct make_index_sequence - : merge_and_renumber < typename make_index_sequence < N / 2 >::type, - typename make_index_sequence < N - N / 2 >::type > {}; +template +struct Extend; -template<> struct make_index_sequence<0> : index_sequence<> {}; -template<> struct make_index_sequence<1> : index_sequence<0> {}; +// Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency. +template +struct Extend, SeqSize, 0> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >; +}; -template +template +struct Extend, SeqSize, 1> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >; +}; + +// Recursion helper for 'make_integer_sequence'. +// 'Gen::type' is an alias for 'integer_sequence'. +template +struct Gen +{ + using type = + typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type; +}; + +template +struct Gen +{ + using type = integer_sequence; +}; + +} // namespace utility_internal + +// Compile-time sequences of integers + +// make_integer_sequence +// +// This template alias is equivalent to +// `integer_sequence`, and is designed to be a drop-in +// replacement for C++14's `std::make_integer_sequence`. +template +using make_integer_sequence = typename utility_internal::Gen::type; + +// make_index_sequence +// +// This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`, +// and is designed to be a drop-in replacement for C++14's +// `std::make_index_sequence`. +template +using make_index_sequence = make_integer_sequence; + +// index_sequence_for +// +// Converts a typename pack into an index sequence of the same length, and +// is designed to be a drop-in replacement for C++14's +// `std::index_sequence_for()` +template using index_sequence_for = make_index_sequence; +//// END OF CODE FROM GOOGLE ABSEIL + +#endif + // dispatch utility (taken from ranges-v3) template struct priority_tag : priority_tag < N - 1 > {}; template<> struct priority_tag<0> {}; @@ -661,18 +3191,38 @@ struct static_const static constexpr T value{}; }; -template -constexpr T static_const::value; +#ifndef JSON_HAS_CPP_17 + + template + constexpr T static_const::value; // NOLINT(readability-redundant-declaration) + +#endif + +} // namespace detail +} // namespace nlohmann + +// #include + + +namespace nlohmann +{ +namespace detail +{ +// dispatching helper struct +template struct identity_tag {}; } // namespace detail } // namespace nlohmann // #include -#include // not #include // numeric_limits #include // false_type, is_constructible, is_integral, is_same, true_type #include // declval +#include // tuple + +// #include + // #include @@ -681,19 +3231,6 @@ constexpr T static_const::value; // #include - -namespace nlohmann -{ -namespace detail -{ -template struct make_void -{ - using type = void; -}; -template using void_t = typename make_void::type; -} // namespace detail -} // namespace nlohmann - // #include @@ -701,10 +3238,10 @@ namespace nlohmann { namespace detail { -template +template struct iterator_types {}; -template +template struct iterator_types < It, void_t +template struct iterator_traits { }; -template +template struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> : iterator_types { }; -template +template struct iterator_traits::value>> { using iterator_category = std::random_access_iterator_tag; @@ -742,71 +3279,32 @@ struct iterator_traits::value>> } // namespace detail } // namespace nlohmann +// #include + + // #include + +namespace nlohmann +{ +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); +} // namespace nlohmann + +// #include + + +// #include + + +namespace nlohmann +{ +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); +} // namespace nlohmann + // #include // #include - -#include - -// #include - - -// http://en.cppreference.com/w/cpp/experimental/is_detected -namespace nlohmann -{ -namespace detail -{ -struct nonesuch -{ - nonesuch() = delete; - ~nonesuch() = delete; - nonesuch(nonesuch const&) = delete; - nonesuch(nonesuch const&&) = delete; - void operator=(nonesuch const&) = delete; - void operator=(nonesuch&&) = delete; -}; - -template class Op, - class... Args> -struct detector -{ - using value_t = std::false_type; - using type = Default; -}; - -template class Op, class... Args> -struct detector>, Op, Args...> -{ - using value_t = std::true_type; - using type = Op; -}; - -template