20constexpr Rgba32 grass_bulk{112, 192, 160};
21constexpr Rgba32 grass_light{160, 224, 192};
22constexpr Rgba32 grass_dark{56, 192, 128};
23constexpr Rgba32 mud_bulk{111, 81, 22};
24constexpr Rgba32 mud_light{114, 97, 55};
25constexpr Rgba32 mud_dark{111, 64, 49};
26constexpr Rgba32 flower_petal{255, 197, 148};
27constexpr Rgba32 flower_core{205, 65, 82};
28constexpr Rgba32 flower_shadow{24, 164, 106};
29constexpr Rgba32 flower_outline_light{57, 139, 49};
30constexpr Rgba32 flower_outline_dark{57, 82, 0};
31constexpr Rgba32 flower_leaf{131, 197, 98};
32constexpr Rgba32 roof_shared_grey_light{148, 164, 180};
33constexpr Rgba32 roof_shared_grey_medium{123, 123, 131};
34constexpr Rgba32 roof_shared_grey_dark{90, 90, 115};
35constexpr Rgba32 roof_center_bulk{255, 205, 139};
36constexpr Rgba32 roof_mart_bulk{156, 213, 255};
37constexpr Rgba32 roof_alternate_bulk{234, 140, 243};
38constexpr Rgba32 roof_center_light{238, 148, 115};
39constexpr Rgba32 roof_mart_light{115, 189, 246};
40constexpr Rgba32 roof_alternate_light{222, 80, 231};
41constexpr Rgba32 roof_center_medium{222, 106, 98};
42constexpr Rgba32 roof_mart_medium{98, 164, 222};
43constexpr Rgba32 roof_alternate_medium{152, 32, 238};
44constexpr Rgba32 roof_center_dark{205, 82, 74};
45constexpr Rgba32 roof_mart_dark{74, 131, 197};
46constexpr Rgba32 roof_alternate_dark{95, 22, 243};
48constexpr std::array grass_layer{
353constexpr std::array mud_layer{
658constexpr std::array tall_grass_layer{
771 flower_outline_dark},
885 flower_outline_dark},
963constexpr std::array roof_center_layer{
1010 roof_shared_grey_light,
1011 roof_shared_grey_medium,
1012 roof_shared_grey_medium,
1013 roof_shared_grey_light,
1027 roof_shared_grey_medium,
1034 roof_shared_grey_medium,
1045 roof_shared_grey_dark,
1054 roof_shared_grey_dark,
1063 roof_shared_grey_dark,
1074 roof_shared_grey_dark,
1081 roof_shared_grey_dark,
1094 roof_shared_grey_dark,
1099 roof_shared_grey_dark,
1114 roof_shared_grey_dark,
1118 roof_shared_grey_dark,
1133 roof_shared_grey_dark,
1138 roof_shared_grey_dark,
1151 roof_shared_grey_dark,
1158 roof_shared_grey_dark,
1169 roof_shared_grey_dark,
1178 roof_shared_grey_dark,
1187 roof_shared_grey_dark,
1198 roof_shared_grey_medium,
1205 roof_shared_grey_medium,
1219 roof_shared_grey_light,
1220 roof_shared_grey_medium,
1221 roof_shared_grey_medium,
1222 roof_shared_grey_light,
1270constexpr std::array roof_mart_layer{
1317 roof_shared_grey_light,
1318 roof_shared_grey_medium,
1319 roof_shared_grey_medium,
1320 roof_shared_grey_light,
1334 roof_shared_grey_medium,
1341 roof_shared_grey_medium,
1352 roof_shared_grey_dark,
1361 roof_shared_grey_dark,
1370 roof_shared_grey_dark,
1381 roof_shared_grey_dark,
1388 roof_shared_grey_dark,
1401 roof_shared_grey_dark,
1406 roof_shared_grey_dark,
1421 roof_shared_grey_dark,
1425 roof_shared_grey_dark,
1440 roof_shared_grey_dark,
1445 roof_shared_grey_dark,
1458 roof_shared_grey_dark,
1465 roof_shared_grey_dark,
1476 roof_shared_grey_dark,
1485 roof_shared_grey_dark,
1494 roof_shared_grey_dark,
1505 roof_shared_grey_medium,
1512 roof_shared_grey_medium,
1526 roof_shared_grey_light,
1527 roof_shared_grey_medium,
1528 roof_shared_grey_medium,
1529 roof_shared_grey_light,
1577constexpr std::array roof_alternate_layer{
1624 roof_shared_grey_light,
1625 roof_shared_grey_medium,
1626 roof_shared_grey_medium,
1627 roof_shared_grey_light,
1641 roof_shared_grey_medium,
1642 roof_alternate_medium,
1643 roof_alternate_bulk,
1644 roof_alternate_bulk,
1645 roof_alternate_bulk,
1646 roof_alternate_bulk,
1647 roof_alternate_medium,
1648 roof_shared_grey_medium,
1659 roof_shared_grey_dark,
1660 roof_alternate_bulk,
1661 roof_alternate_bulk,
1662 roof_alternate_bulk,
1663 roof_alternate_bulk,
1664 roof_alternate_bulk,
1665 roof_alternate_bulk,
1666 roof_alternate_bulk,
1667 roof_alternate_bulk,
1668 roof_shared_grey_dark,
1677 roof_shared_grey_dark,
1678 roof_alternate_bulk,
1679 roof_alternate_bulk,
1680 roof_alternate_bulk,
1681 roof_alternate_bulk,
1682 roof_alternate_light,
1683 roof_alternate_light,
1684 roof_alternate_bulk,
1685 roof_alternate_bulk,
1686 roof_alternate_bulk,
1687 roof_alternate_bulk,
1688 roof_shared_grey_dark,
1695 roof_shared_grey_dark,
1696 roof_alternate_bulk,
1697 roof_alternate_bulk,
1698 roof_alternate_bulk,
1699 roof_alternate_light,
1700 roof_alternate_light,
1701 roof_alternate_light,
1702 roof_alternate_light,
1703 roof_alternate_light,
1704 roof_alternate_light,
1705 roof_alternate_bulk,
1706 roof_alternate_bulk,
1707 roof_alternate_bulk,
1708 roof_shared_grey_dark,
1713 roof_shared_grey_dark,
1714 roof_alternate_bulk,
1715 roof_alternate_bulk,
1716 roof_alternate_medium,
1717 roof_alternate_medium,
1718 roof_alternate_dark,
1719 roof_alternate_dark,
1720 roof_alternate_light,
1721 roof_alternate_light,
1722 roof_alternate_dark,
1723 roof_alternate_dark,
1724 roof_alternate_medium,
1725 roof_alternate_medium,
1726 roof_alternate_bulk,
1727 roof_alternate_bulk,
1728 roof_shared_grey_dark,
1732 roof_shared_grey_dark,
1733 roof_alternate_bulk,
1734 roof_alternate_bulk,
1735 roof_alternate_medium,
1736 roof_alternate_medium,
1737 roof_alternate_dark,
1738 roof_alternate_dark,
1739 roof_alternate_light,
1740 roof_alternate_light,
1741 roof_alternate_dark,
1742 roof_alternate_dark,
1743 roof_alternate_medium,
1744 roof_alternate_medium,
1745 roof_alternate_bulk,
1746 roof_alternate_bulk,
1747 roof_shared_grey_dark,
1752 roof_shared_grey_dark,
1753 roof_alternate_bulk,
1754 roof_alternate_bulk,
1755 roof_alternate_bulk,
1756 roof_alternate_light,
1757 roof_alternate_light,
1758 roof_alternate_light,
1759 roof_alternate_light,
1760 roof_alternate_light,
1761 roof_alternate_light,
1762 roof_alternate_bulk,
1763 roof_alternate_bulk,
1764 roof_alternate_bulk,
1765 roof_shared_grey_dark,
1772 roof_shared_grey_dark,
1773 roof_alternate_bulk,
1774 roof_alternate_bulk,
1775 roof_alternate_bulk,
1776 roof_alternate_bulk,
1777 roof_alternate_light,
1778 roof_alternate_light,
1779 roof_alternate_bulk,
1780 roof_alternate_bulk,
1781 roof_alternate_bulk,
1782 roof_alternate_bulk,
1783 roof_shared_grey_dark,
1792 roof_shared_grey_dark,
1793 roof_alternate_bulk,
1794 roof_alternate_bulk,
1795 roof_alternate_bulk,
1796 roof_alternate_bulk,
1797 roof_alternate_bulk,
1798 roof_alternate_bulk,
1799 roof_alternate_bulk,
1800 roof_alternate_bulk,
1801 roof_shared_grey_dark,
1812 roof_shared_grey_medium,
1813 roof_alternate_medium,
1814 roof_alternate_bulk,
1815 roof_alternate_bulk,
1816 roof_alternate_bulk,
1817 roof_alternate_bulk,
1818 roof_alternate_medium,
1819 roof_shared_grey_medium,
1833 roof_shared_grey_light,
1834 roof_shared_grey_medium,
1835 roof_shared_grey_medium,
1836 roof_shared_grey_light,
1884constexpr std::array flower_frame_key{
1930 flower_outline_light,
1931 flower_outline_light,
1934 flower_outline_light,
1948 flower_outline_light,
1955 flower_outline_light,
1965 flower_outline_light,
1966 flower_outline_dark,
1967 flower_outline_dark,
1974 flower_outline_dark,
1975 flower_outline_light,
1976 flower_outline_light,
1977 flower_outline_light,
1983 flower_outline_light,
1987 flower_outline_dark,
1988 flower_outline_dark,
1991 flower_outline_dark,
1992 flower_outline_dark,
1993 flower_outline_light,
1997 flower_outline_light},
2002 flower_outline_light,
2005 flower_outline_light,
2006 flower_outline_light,
2007 flower_outline_light,
2008 flower_outline_dark,
2009 flower_outline_dark,
2010 flower_outline_light,
2013 flower_outline_light,
2016 flower_outline_dark},
2022 flower_outline_light,
2025 flower_outline_dark,
2026 flower_outline_light,
2027 flower_outline_light,
2034 flower_outline_dark,
2046 flower_outline_dark,
2053 flower_outline_dark,
2065 flower_outline_dark,
2066 flower_outline_dark,
2067 flower_outline_dark,
2070 flower_outline_dark,
2071 flower_outline_dark,
2079 flower_outline_dark,
2082 flower_outline_dark,
2083 flower_outline_dark,
2084 flower_outline_light,
2086 flower_outline_dark,
2087 flower_outline_dark,
2088 flower_outline_dark,
2089 flower_outline_dark,
2090 flower_outline_dark,
2097 flower_outline_light,
2098 flower_outline_light,
2099 flower_outline_dark,
2100 flower_outline_dark,
2101 flower_outline_light,
2102 flower_outline_dark,
2105 flower_outline_dark,
2106 flower_outline_light,
2107 flower_outline_light,
2108 flower_outline_light,
2110 flower_outline_light,
2116 flower_outline_dark,
2119 flower_outline_light,
2120 flower_outline_dark,
2122 flower_outline_dark,
2123 flower_outline_dark,
2125 flower_outline_dark,
2126 flower_outline_light,
2129 flower_outline_dark,
2135 flower_outline_dark,
2137 flower_outline_light,
2138 flower_outline_dark,
2145 flower_outline_dark,
2147 flower_outline_light,
2148 flower_outline_dark,
2155 flower_outline_dark,
2156 flower_outline_dark,
2165 flower_outline_dark,
2166 flower_outline_dark,
2193constexpr std::array flower_frame_right{
2240 flower_outline_light,
2241 flower_outline_light,
2244 flower_outline_light,
2258 flower_outline_light,
2265 flower_outline_light,
2274 flower_outline_light,
2275 flower_outline_dark,
2276 flower_outline_dark,
2277 flower_outline_dark,
2284 flower_outline_dark,
2285 flower_outline_light,
2286 flower_outline_light,
2292 flower_outline_light,
2296 flower_outline_dark,
2297 flower_outline_dark,
2298 flower_outline_dark,
2301 flower_outline_dark,
2302 flower_outline_dark,
2306 flower_outline_light},
2311 flower_outline_light,
2314 flower_outline_light,
2315 flower_outline_light,
2316 flower_outline_light,
2317 flower_outline_light,
2318 flower_outline_dark,
2319 flower_outline_dark,
2320 flower_outline_light,
2325 flower_outline_light},
2331 flower_outline_light,
2332 flower_outline_light,
2335 flower_outline_dark,
2336 flower_outline_light,
2337 flower_outline_dark,
2344 flower_outline_dark},
2356 flower_outline_dark,
2363 flower_outline_dark},
2375 flower_outline_dark,
2376 flower_outline_dark,
2377 flower_outline_dark,
2380 flower_outline_dark,
2381 flower_outline_dark,
2389 flower_outline_dark,
2392 flower_outline_dark,
2393 flower_outline_dark,
2395 flower_outline_dark,
2396 flower_outline_light,
2397 flower_outline_dark,
2398 flower_outline_dark,
2399 flower_outline_dark,
2407 flower_outline_dark,
2409 flower_outline_dark,
2410 flower_outline_dark,
2411 flower_outline_dark,
2414 flower_outline_dark,
2415 flower_outline_light,
2416 flower_outline_light,
2417 flower_outline_light,
2419 flower_outline_light,
2425 flower_outline_light,
2428 flower_outline_light,
2429 flower_outline_dark,
2431 flower_outline_dark,
2432 flower_outline_dark,
2434 flower_outline_dark,
2435 flower_outline_light,
2438 flower_outline_dark,
2444 flower_outline_dark,
2446 flower_outline_light,
2447 flower_outline_dark,
2454 flower_outline_dark,
2456 flower_outline_light,
2457 flower_outline_dark,
2464 flower_outline_dark,
2465 flower_outline_dark,
2474 flower_outline_dark,
2475 flower_outline_dark,
2498constexpr std::array flower_frame_left{
2543 flower_outline_light,
2544 flower_outline_light,
2547 flower_outline_light,
2561 flower_outline_light,
2568 flower_outline_light,
2579 flower_outline_light,
2580 flower_outline_dark,
2587 flower_outline_dark,
2589 flower_outline_light,
2590 flower_outline_light,
2591 flower_outline_light,
2597 flower_outline_light,
2600 flower_outline_dark,
2601 flower_outline_dark,
2604 flower_outline_dark,
2605 flower_outline_dark,
2606 flower_outline_light,
2607 flower_outline_dark,
2611 flower_outline_light},
2616 flower_outline_light,
2619 flower_outline_light,
2620 flower_outline_light,
2621 flower_outline_light,
2622 flower_outline_dark,
2623 flower_outline_light,
2626 flower_outline_light,
2627 flower_outline_light,
2628 flower_outline_light,
2630 flower_outline_dark},
2634 flower_outline_light,
2635 flower_outline_light,
2638 flower_outline_dark,
2639 flower_outline_light,
2640 flower_outline_light,
2647 flower_outline_light,
2648 flower_outline_dark,
2659 flower_outline_dark,
2666 flower_outline_dark,
2667 flower_outline_dark,
2678 flower_outline_dark,
2679 flower_outline_dark,
2680 flower_outline_dark,
2683 flower_outline_dark,
2684 flower_outline_dark,
2692 flower_outline_dark,
2695 flower_outline_dark,
2696 flower_outline_dark,
2697 flower_outline_dark,
2698 flower_outline_dark,
2700 flower_outline_dark,
2701 flower_outline_dark,
2702 flower_outline_dark,
2703 flower_outline_light,
2704 flower_outline_dark,
2711 flower_outline_dark,
2712 flower_outline_light,
2713 flower_outline_dark,
2714 flower_outline_dark,
2715 flower_outline_light,
2716 flower_outline_dark,
2719 flower_outline_dark,
2720 flower_outline_light,
2721 flower_outline_light,
2722 flower_outline_light,
2724 flower_outline_light,
2730 flower_outline_dark,
2733 flower_outline_light,
2734 flower_outline_dark,
2736 flower_outline_dark,
2737 flower_outline_dark,
2739 flower_outline_dark,
2740 flower_outline_light,
2743 flower_outline_dark,
2749 flower_outline_dark,
2751 flower_outline_light,
2752 flower_outline_dark,
2759 flower_outline_dark,
2761 flower_outline_light,
2762 flower_outline_dark,
2769 flower_outline_dark,
2770 flower_outline_dark,
2779 flower_outline_dark,
2780 flower_outline_dark,
2803void set_grass_at(Image<Rgba32> &img, std::size_t metatile_index)
2808 img.set(row, col_offset + col, grass_layer[row][col]);
2813void set_mud_at(Image<Rgba32> &img, std::size_t metatile_index)
2818 img.set(row, col_offset + col, mud_layer[row][col]);
2823void set_tall_grass_at(Image<Rgba32> &img, std::size_t metatile_index)
2828 img.set(row, col_offset + col, tall_grass_layer[row][col]);
2833void set_roof_center_at(Image<Rgba32> &img, std::size_t metatile_index)
2838 img.set(row, col_offset + col, roof_center_layer[row][col]);
2843void set_roof_mart_at(Image<Rgba32> &img, std::size_t metatile_index)
2848 img.set(row, col_offset + col, roof_mart_layer[row][col]);
2853void set_roof_alternate_at(Image<Rgba32> &img, std::size_t metatile_index)
2858 img.set(row, col_offset + col, roof_alternate_layer[row][col]);
2863void set_flower_key_frame_at(Image<Rgba32> &img, std::size_t metatile_index)
2868 img.set(row, col_offset + col, flower_frame_key[row][col]);
2882[[nodiscard]] std::vector<PixelTile<Rgba32>> metatile_array_to_tiles(
2885 std::vector<PixelTile<Rgba32>> tiles;
2889 for (std::size_t tile_row = 0; tile_row < 2; ++tile_row) {
2890 for (std::size_t tile_col = 0; tile_col < 2; ++tile_col) {
2891 std::array<Rgba32, tile::size_pix> tile_pixels{};
2901 tiles.emplace_back(tile_pixels);
2910ChainableResult<std::unique_ptr<PorytilesTilesetComponent>>
2914 config_, extrinsic_transparency, tileset_name, std::unique_ptr<PorytilesTilesetComponent>);
2916 auto component = std::make_unique<PorytilesTilesetComponent>();
2922 set_grass_at(middle, 1);
2923 set_flower_key_frame_at(middle, 2);
2924 set_grass_at(bottom, 2);
2925 set_tall_grass_at(middle, 3);
2926 set_grass_at(bottom, 4);
2927 set_roof_center_at(middle, 4);
2928 set_grass_at(bottom, 5);
2929 set_roof_mart_at(middle, 5);
2931 component->bottom(bottom);
2932 component->middle(middle);
2933 component->top(top);
2939 const auto behavior_result = behavior_map_->
lookup(
"MB_TALL_GRASS");
2940 if (behavior_result.has_value()) {
2945 AnimFrame flower_key{
"key", metatile_array_to_tiles(flower_frame_key)};
2946 AnimFrame flower_center{
"center", metatile_array_to_tiles(flower_frame_center)};
2947 AnimFrame flower_right{
"right", metatile_array_to_tiles(flower_frame_right)};
2948 AnimFrame flower_left{
"left", metatile_array_to_tiles(flower_frame_left)};
2953 flower_params.frame_order(
2959 flower_params.width_tiles(2);
2960 flower_params.height_tiles(2);
2964 flower.put_frame(flower_center.frame_name(), flower_center);
2965 flower.put_frame(flower_right.frame_name(), flower_right);
2966 flower.put_frame(flower_left.frame_name(), flower_left);
2967 component->add_anim(flower);
2976 config_, extrinsic_transparency, tileset_name, std::unique_ptr<PorytilesTilesetComponent>);
2978 auto component = std::make_unique<PorytilesTilesetComponent>();
2984 set_mud_at(middle, 1);
2985 set_mud_at(bottom, 2);
2986 set_flower_key_frame_at(middle, 2);
2987 set_grass_at(bottom, 3);
2988 set_roof_alternate_at(middle, 3);
2990 component->bottom(bottom);
2991 component->middle(middle);
2992 component->top(top);
Represents a single frame of an animation, containing tiles and a frame name.
Configuration parameters for a single tileset animation.
const std::vector< DynamicCasedName > & frame_names() const
Returns the unique frame definitions.
A complete tileset animation with name, configuration, and frame data.
const AnimFrame< PixelType > & key_frame() const
Returns the key frame of this animation.
virtual ChainableResult< std::uint16_t > lookup(const std::string &behavior_name) const =0
Looks up the numeric value for a behavior constant name.
A result type that maintains a chainable sequence of errors for debugging and error reporting.
A smart string wrapper that preserves word structure for lossless case format conversion.
A template for two-dimensional images with arbitrarily typed pixel values.
ChainableResult< std::unique_ptr< PorytilesTilesetComponent > > create_sample_primary_porytiles_component(const std::string &tileset_name) const
Creates a new basic primary PorytilesTilesetComponent with some default assets.
ChainableResult< std::unique_ptr< PorytilesTilesetComponent > > create_sample_secondary_porytiles_component(const std::string &tileset_name) const
Creates a new basic secondary PorytilesTilesetComponent with some default assets.
constexpr std::size_t side_length_pix
constexpr Rgba32 rgba_magenta
#define PT_UNWRAP_TILESET_CONFIG_PTR(ptr, config, tileset_name, return_type)
Unwraps a tileset-scoped config value via pointer access, returning early if the value is not availab...