From c684fa2339c77499e902178289da52f97afc967b Mon Sep 17 00:00:00 2001 From: grunt-lucas Date: Sat, 14 Sep 2024 14:41:13 -0700 Subject: [PATCH 1/6] Fixed issue #57 --- include/errors_warnings.h | 3 +++ src/decompiler.cpp | 11 +++-------- src/errors_warnings.cpp | 10 ++++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/errors_warnings.h b/include/errors_warnings.h index f668a7b..c8d5f5f 100644 --- a/include/errors_warnings.h +++ b/include/errors_warnings.h @@ -253,6 +253,9 @@ void fatalerror_assignCacheInvalidValue(const ErrorsAndWarnings &err, const Comp void fatalerror_paletteAssignParamSearchMatrixFailed(const ErrorsAndWarnings &err, const CompilerSourcePaths &srcs, const CompilerMode &mode); +void fatalerror_noImpliedLayerType(const ErrorsAndWarnings &err, const DecompilerSourcePaths &srcs, + DecompilerMode mode); + /* * Compilation warnings (due to possible mistakes in user input), compilation can continue */ diff --git a/src/decompiler.cpp b/src/decompiler.cpp index 5100ae3..5e440be 100644 --- a/src/decompiler.cpp +++ b/src/decompiler.cpp @@ -88,8 +88,8 @@ std::unique_ptr decompile(PorytilesContext &ctx, DecompilerMo * attribute count (i.e. the true metatile count). If division by 8 matches, then we are dual layer. If 12 matches, we * are triple. Otherwise, we have corruption and should fail. */ - std::size_t dualImpliedMetatileCount = compiledTileset.metatileEntries.size() / TILES_PER_METATILE_DUAL; - std::size_t tripleImpliedMetatileCount = compiledTileset.metatileEntries.size() / TILES_PER_METATILE_TRIPLE; + auto dualImpliedMetatileCount = compiledTileset.metatileEntries.size() / TILES_PER_METATILE_DUAL; + auto tripleImpliedMetatileCount = compiledTileset.metatileEntries.size() / TILES_PER_METATILE_TRIPLE; if (dualImpliedMetatileCount == attributesMap.size()) { decompiledTileset->tripleLayer = false; @@ -98,12 +98,7 @@ std::unique_ptr decompile(PorytilesContext &ctx, DecompilerMo decompiledTileset->tripleLayer = true; } else { - // TODO 1.0.0 : we should create a custom warning here so users know what happened - // TODO 1.0.0 : handle this via CLI flag? - internalerror( - fmt::format("emitter::emitDecompiled compiledTileset.metatileEntries.size()={}, attributesMap.size()={} " - "did not imply a layer type", - compiledTileset.metatileEntries.size(), attributesMap.size())); + fatalerror_noImpliedLayerType(ctx.err, ctx.decompilerSrcPaths, mode); } std::size_t metatileIndex = 0; diff --git a/src/errors_warnings.cpp b/src/errors_warnings.cpp index 4e3a4dd..2bed29a 100644 --- a/src/errors_warnings.cpp +++ b/src/errors_warnings.cpp @@ -542,6 +542,16 @@ void fatalerror_paletteAssignParamSearchMatrixFailed(const ErrorsAndWarnings &er die_compilationTerminated(err, srcs.modeBasedSrcPath(mode), fmt::format("palette assign param search matrix failed")); } +void fatalerror_noImpliedLayerType(const ErrorsAndWarnings &err, const DecompilerSourcePaths &srcs, DecompilerMode mode) +{ + if (err.printErrors) { + pt_fatal_err("no layer type was implied by the supplied metatiles and attributes"); + pt_note("either you forgot to supply the correct `-target-base-game' option, or a file is corrupted"); + pt_println(stderr, ""); + } + die_decompilationTerminated(err, srcs.modeBasedSrcPath(mode), fmt::format("no implied layer type")); +} + static void printWarning(ErrorsAndWarnings &err, WarningMode warningMode, const std::string_view &warningName, const std::string &message) { From e2d46bfeddfd16cf36de02e7c78423141773bdf1 Mon Sep 17 00:00:00 2001 From: grunt-lucas Date: Sat, 14 Sep 2024 15:33:39 -0700 Subject: [PATCH 2/6] Update --help menus to stick to 80 col limit --- include/cli_options.h | 183 ++++++++++++++++--------------- src/cli_parser.cpp | 246 ++++++++++++++++++++++++------------------ src/decompiler.cpp | 5 - 3 files changed, 243 insertions(+), 191 deletions(-) diff --git a/include/cli_options.h b/include/cli_options.h index 9415056..3bb1e21 100644 --- a/include/cli_options.h +++ b/include/cli_options.h @@ -19,8 +19,6 @@ namespace porytiles { // @formatter:off // clang-format off -// TODO 1.0.0 : make option descriptions fit in 80 col limit? - /* * Global Options * @@ -69,9 +67,9 @@ const std::string OUTPUT = "output"; const std::string OUTPUT_SHORT = "o"; const std::string OUTPUT_DESC = std::string{fmt::format(R"( -{}, -{}= - Output generated files to the directory specified by OUTPUT-PATH. If any element of - OUTPUT-PATH does not exist, it will be created. Defaults to the current working - directory (i.e. `.'). + Output generated files to the directory specified by OUTPUT-PATH. + If any element of OUTPUT-PATH does not exist, it will be created. + Defaults to the current working directory (i.e. `.'). )", OUTPUT_SHORT, OUTPUT )}.substr(1); @@ -80,9 +78,10 @@ constexpr int OUTPUT_VAL = 1000; const std::string TILES_OUTPUT_PAL = "tiles-output-pal"; const std::string TILES_OUTPUT_PAL_DESC = std::string{fmt::format(R"( -{}= - Set the palette mode for the output `tiles.png'. Valid settings are `true-color' or - `greyscale'. These settings are for human visual purposes only and have no effect on - the final in-game tiles. Default value is `greyscale'. + Set the palette mode for the output `tiles.png'. Valid settings are + `true-color' or `greyscale'. These settings are for human visual + purposes only and have no effect on the final in-game tiles. Default + value is `greyscale'. )", TILES_OUTPUT_PAL )}.substr(1); @@ -91,8 +90,8 @@ constexpr int TILES_OUTPUT_PAL_VAL = 1001; const std::string DISABLE_METATILE_GENERATION = "disable-metatile-generation"; const std::string DISABLE_METATILE_GENERATION_DESC = std::string{fmt::format(R"( -{} - Disable generation of `metatiles.bin'. Only enable this if you want to manage - metatiles manually via Porymap. + Disable generation of `metatiles.bin'. Only enable this if you want + to manage metatiles manually via Porymap. )", DISABLE_METATILE_GENERATION )}.substr(1); @@ -101,8 +100,8 @@ constexpr int DISABLE_METATILE_GENERATION_VAL = 1002; const std::string DISABLE_ATTRIBUTE_GENERATION = "disable-attribute-generation"; const std::string DISABLE_ATTRIBUTE_GENERATION_DESC = std::string{fmt::format(R"( -{} - Disable generation of `metatile_attributes.bin'. Only enable this if you want to - manage metatile attributes manually via Porymap. + Disable generation of `metatile_attributes.bin'. Only enable this if + you want to manage metatile attributes manually via Porymap. )", DISABLE_ATTRIBUTE_GENERATION )}.substr(1); @@ -118,10 +117,12 @@ constexpr int DISABLE_ATTRIBUTE_GENERATION_VAL = 1003; const std::string TARGET_BASE_GAME = "target-base-game"; const std::string TARGET_BASE_GAME_DESC = std::string{fmt::format(R"( -{}= - Set the (de)compilation target base game to TARGET. This option affects default - values for the fieldmap parameters, as well as the metatile attribute format. Valid - settings for TARGET are `pokeemerald', `pokefirered', or `pokeruby'. If this option - is not specified, defaults to `pokeemerald'. See the wiki docs for more information. + Set the (de)compilation target base game to TARGET. This option + affects default values for the fieldmap parameters, as well as the + metatile attribute format. Valid settings for TARGET are + `pokeemerald', `pokefirered', or `pokeruby'. If this option is not + specified, defaults to `pokeemerald'. See the wiki docs for more + information. )", TARGET_BASE_GAME )}.substr(1); @@ -130,10 +131,11 @@ constexpr int TARGET_BASE_GAME_VAL = 2000; const std::string DUAL_LAYER = "dual-layer"; const std::string DUAL_LAYER_DESC = std::string{fmt::format(R"( -{} - Enable dual-layer compilation mode. The layer type will be inferred from your source - layer PNGs, so compilation will error out if any metatiles contain content on all - three layers. If this option is not supplied, Porytiles assumes you are compiling - a triple-layer tileset. + Enable dual-layer compilation mode. The layer type will be inferred + from your source layer PNGs, so compilation will error out if any + metatiles contain content on all three layers. If this option is not + supplied, Porytiles assumes you are compiling a triple-layer + tileset. )", DUAL_LAYER )}.substr(1); @@ -142,8 +144,8 @@ constexpr int DUAL_LAYER_VAL = 2001; const std::string TRANSPARENCY_COLOR = "transparency-color"; const std::string TRANSPARENCY_COLOR_DESC = std::string{fmt::format(R"( -{}= - Select RGB color to represent transparency in your layer source PNGs. - Defaults to `255,0,255'. + Select RGB color to represent transparency in your layer + source PNGs. Defaults to `255,0,255'. )", TRANSPARENCY_COLOR )}.substr(1); @@ -152,9 +154,10 @@ constexpr int TRANSPARENCY_COLOR_VAL = 2002; const std::string DEFAULT_BEHAVIOR = "default-behavior"; const std::string DEFAULT_BEHAVIOR_DESC = std::string{fmt::format(R"( -{}= - Select the default behavior for metatiles that do not have an entry in the - `attributes.csv' file. You may use either a raw integral value or a metatile behavior - label defined in the provided behaviors header. If unspecified, defaults to `0'. + Select the default behavior for metatiles that do not have an entry + in the `attributes.csv' file. You may use either a raw integral + value or a metatile behavior label defined in the provided behaviors + header. If unspecified, defaults to `0'. )", DEFAULT_BEHAVIOR )}.substr(1); @@ -163,10 +166,10 @@ constexpr int DEFAULT_BEHAVIOR_VAL = 2004; const std::string DEFAULT_ENCOUNTER_TYPE = "default-encounter-type"; const std::string DEFAULT_ENCOUNTER_TYPE_DESC = std::string{fmt::format(R"( -{}= - Select the default encounter type for metatiles that do not have an entry in the - `attributes.csv' file. You may use either a raw integral value or an EncounterType - label defined in the `include/global.fieldmap.h' file. If unspecified, defaults to - `0'. + Select the default encounter type for metatiles that do not have an + entry in the `attributes.csv' file. You may use either a raw + integral value or an EncounterType label defined in the + `include/global.fieldmap.h' file. If unspecified, defaults to `0'. )", DEFAULT_ENCOUNTER_TYPE )}.substr(1); @@ -175,10 +178,10 @@ constexpr int DEFAULT_ENCOUNTER_TYPE_VAL = 2005; const std::string DEFAULT_TERRAIN_TYPE = "default-terrain-type"; const std::string DEFAULT_TERRAIN_TYPE_DESC = std::string{fmt::format(R"( -{}= - Select the default terrain type for metatiles that do not have an entry in the - `attributes.csv' file. You may use either a raw integral value or an TerrainType - label defined in the `include/global.fieldmap.h' file. If unspecified, defaults to - `0'. + Select the default terrain type for metatiles that do not have an + entry in the `attributes.csv' file. You may use either a raw + integral value or an TerrainType label defined in the + `include/global.fieldmap.h' file. If unspecified, defaults to `0'. )", DEFAULT_TERRAIN_TYPE )}.substr(1); @@ -187,10 +190,10 @@ constexpr int DEFAULT_TERRAIN_TYPE_VAL = 2006; const std::string NORMALIZE_TRANSPARENCY = "normalize-transparency"; const std::string NORMALIZE_TRANSPARENCY_DESC = std::string{fmt::format(R"( -{}[=] - When emitting the decompiled tileset, replace all source transparent colors with - the given RGB color. The default Porytiles behavior is equivalent to: - `-normalize-transparency=255,0,255', which is best suited for decompiling the vanilla - tilesets. + When emitting the decompiled tileset, replace all source transparent + colors with the given RGB color. The default Porytiles behavior is + equivalent to: `-normalize-transparency=255,0,255', which is best + suited for decompiling the vanilla tilesets. )", NORMALIZE_TRANSPARENCY )}.substr(1); @@ -199,9 +202,9 @@ constexpr int NORMALIZE_TRANSPARENCY_VAL = 2007; const std::string PRESERVE_TRANSPARENCY = "preserve-transparency"; const std::string PRESERVE_TRANSPARENCY_DESC = std::string{fmt::format(R"( -{} - Preserve the original transparency colors in the source tileset. This option may be - useful when decompiling custom tilesets for which you are already satisfied with the - transparency configuration. + Preserve the original transparency colors in the source tileset. + This option may be useful when decompiling custom tilesets for which + you are already satisfied with the transparency configuration. )", PRESERVE_TRANSPARENCY )}.substr(1); @@ -217,8 +220,8 @@ constexpr int PRESERVE_TRANSPARENCY_VAL = 2008; const std::string ASSIGN_ALGO = "assign-algorithm"; const std::string ASSIGN_ALGO_DESC = std::string{fmt::format(R"( -{}= - Select the palette assignment algorithm. Valid options are `dfs' and `bfs'. Default - is `dfs'. + Select the palette assignment algorithm. Valid options are `dfs' and + `bfs'. Default is `dfs'. )", ASSIGN_ALGO )}.substr(1); @@ -227,9 +230,10 @@ constexpr int ASSIGN_ALGO_VAL = 3000; const std::string EXPLORE_CUTOFF = "explore-cutoff"; const std::string EXPLORE_CUTOFF_DESC = std::string{fmt::format(R"( -{}= - Select the cutoff for palette assignment tree node exploration. Defaults to 2000000, - which should be sufficient for most cases. Increase the number to let the algorithm - run for longer before failing out. + Select the cutoff for palette assignment tree node exploration. + Defaults to 2000000, which should be sufficient for most cases. + Increase the number to let the algorithm run for longer before + failing out. )", EXPLORE_CUTOFF )}.substr(1); @@ -238,9 +242,10 @@ constexpr int EXPLORE_CUTOFF_VAL = 3001; const std::string BEST_BRANCHES = "best-branches"; const std::string BEST_BRANCHES_DESC = std::string{fmt::format(R"( -{}= - Use only the N most promising branches at each node in the assignment tree search. - Specify `smart' instead of an integer to use a computed `smart' cutoff at each node - instead of a constant integer cutoff. Default is to use all available branches. + Use only the N most promising branches at each node in the + assignment tree search. Specify `smart' instead of an integer to use + a computed `smart' cutoff at each node instead of a constant integer + cutoff. Default is to use all available branches. )", BEST_BRANCHES )}.substr(1); @@ -250,8 +255,8 @@ const std::string SMART_PRUNE = "smart"; const std::string DISABLE_ASSIGN_CACHING = "disable-assign-caching"; const std::string DISABLE_ASSIGN_CACHING_DESC = std::string{fmt::format(R"( -{} - Do not write palette assignment search parameters to `assign.cache' after a successful - compilation. + Do not write palette assignment search parameters to `assign.cache' + after a successful compilation. )", DISABLE_ASSIGN_CACHING )}.substr(1); @@ -260,8 +265,9 @@ constexpr int DISABLE_ASSIGN_CACHING_VAL = 3003; const std::string FORCE_ASSIGN_PARAM_MATRIX = "force-assign-param-matrix"; const std::string FORCE_ASSIGN_PARAM_MATRIX_DESC = std::string{fmt::format(R"( -{} - Force the full palette assignment parameter search matrix to run. If `assign.cache' - exists in either source folder, its contents will be ignored. + Force the full palette assignment parameter search matrix to run. If + `assign.cache' exists in either source folder, its contents will be + ignored. )", FORCE_ASSIGN_PARAM_MATRIX )}.substr(1); @@ -270,8 +276,8 @@ constexpr int FORCE_ASSIGN_PARAM_MATRIX_VAL = 3004; const std::string PRIMARY_ASSIGN_ALGO = "primary-assign-algorithm"; const std::string PRIMARY_ASSIGN_ALGO_DESC = std::string{fmt::format(R"( -{}= - Same as `-assign-algorithm', but for the paired primary set. Only to be used - when compiling in secondary mode via `compile-secondary'. + Same as `-assign-algorithm', but for the paired primary set. Only to + be used when compiling in secondary mode via `compile-secondary'. )", PRIMARY_ASSIGN_ALGO )}.substr(1); @@ -280,8 +286,9 @@ constexpr int PRIMARY_ASSIGN_ALGO_VAL = 3005; const std::string PRIMARY_EXPLORE_CUTOFF = "primary-explore-cutoff"; const std::string PRIMARY_EXPLORE_CUTOFF_DESC = std::string{fmt::format(R"( -{}= - Same as `-assign-explore-cutoff', but for the paired primary set. Only to be used - when compiling in secondary mode via `compile-secondary'. + Same as `-assign-explore-cutoff', but for the paired primary set. + Only to be used when compiling in secondary mode via + `compile-secondary'. )", PRIMARY_EXPLORE_CUTOFF )}.substr(1); @@ -290,8 +297,8 @@ constexpr int PRIMARY_EXPLORE_CUTOFF_VAL = 3006; const std::string PRIMARY_BEST_BRANCHES = "primary-best-branches"; const std::string PRIMARY_BEST_BRANCHES_DESC = std::string{fmt::format(R"( -{}= - Same as `-best-branches', but for the paired primary set. Only to be used - when compiling in secondary mode via `compile-secondary'. + Same as `-best-branches', but for the paired primary set. Only to be + used when compiling in secondary mode via `compile-secondary'. )", PRIMARY_BEST_BRANCHES )}.substr(1); @@ -308,9 +315,10 @@ constexpr int PRIMARY_BEST_BRANCHES_VAL = 3007; const std::string TILES_PRIMARY_OVERRIDE = "tiles-primary-override"; const std::string TILES_PRIMARY_OVERRIDE_DESC = std::string{fmt::format(R"( -{}= - Override the target base game's default number of primary set tiles. The value - specified here should match the corresponding value in your project's `fieldmap.h'. - Defaults to 512 (inherited from `pokeemerald' default target base game). + Override the target base game's default number of primary set tiles. + The value specified here should match the corresponding value in + your project's `fieldmap.h'. Defaults to 512 (inherited from + `pokeemerald' default target base game). )", TILES_PRIMARY_OVERRIDE )}.substr(1); @@ -319,9 +327,10 @@ constexpr int TILES_PRIMARY_OVERRIDE_VAL = 4000; const std::string TILES_TOTAL_OVERRIDE = "tiles-total-override"; const std::string TILES_TOTAL_OVERRIDE_DESC = std::string{fmt::format(R"( -{}= - Override the target base game's default number of total tiles. The value specified - here should match the corresponding value in your project's `fieldmap.h'. Defaults - to 1024 (inherited from `pokeemerald' default target base game). + Override the target base game's default number of total tiles. The + value specified here should match the corresponding value in your + project's `fieldmap.h'. Defaults to 1024 (inherited from + `pokeemerald' default target base game). )", TILES_TOTAL_OVERRIDE )}.substr(1); @@ -330,9 +339,10 @@ constexpr int TILES_TOTAL_OVERRIDE_VAL = 4001; const std::string METATILES_PRIMARY_OVERRIDE = "metatiles-primary-override"; const std::string METATILES_PRIMARY_OVERRIDE_DESC = std::string{fmt::format(R"( -{}= - Override the target base game's default number of primary set metatiles. The value - specified here should match the corresponding value in your project's `fieldmap.h'. - Defaults to 512 (inherited from `pokeemerald' default target base game). + Override the target base game's default number of primary set + metatiles. The value specified here should match the corresponding + value in your project's `fieldmap.h'. Defaults to 512 (inherited + from `pokeemerald' default target base game). )", METATILES_PRIMARY_OVERRIDE )}.substr(1); @@ -341,9 +351,10 @@ constexpr int METATILES_PRIMARY_OVERRIDE_VAL = 4002; const std::string METATILES_TOTAL_OVERRIDE = "metatiles-total-override"; const std::string METATILES_TOTAL_OVERRIDE_DESC = std::string{fmt::format(R"( -{}= - Override the target base game's default number of total metatiles. The value specified - here should match the corresponding value in your project's `fieldmap.h'. Defaults - to 1024 (inherited from `pokeemerald' default target base game). + Override the target base game's default number of total metatiles. + The value specified here should match the corresponding value in + your project's `fieldmap.h'. Defaults to 1024 (inherited from + `pokeemerald' default target base game). )", METATILES_TOTAL_OVERRIDE )}.substr(1); @@ -352,9 +363,10 @@ constexpr int METATILES_TOTAL_OVERRIDE_VAL = 4003; const std::string PALS_PRIMARY_OVERRIDE = "pals-primary-override"; const std::string PALS_PRIMARY_OVERRIDE_DESC = std::string{fmt::format(R"( -{}= - Override the target base game's default number of primary set palettes. The value - specified here should match the corresponding value in your project's `fieldmap.h'. - Defaults to 6 (inherited from `pokeemerald' default target base game). + Override the target base game's default number of primary set + palettes. The value specified here should match the corresponding + value in your project's `fieldmap.h'. Defaults to 6 (inherited from + `pokeemerald' default target base game). )", PALS_PRIMARY_OVERRIDE )}.substr(1); @@ -363,9 +375,10 @@ constexpr int PALS_PRIMARY_OVERRIDE_VAL = 4004; const std::string PALS_TOTAL_OVERRIDE = "pals-total-override"; const std::string PALS_TOTAL_OVERRIDE_DESC = std::string{fmt::format(R"( -{}= - Override the target base game's default number of total palettes. The value specified - here should match the corresponding value in your project's `fieldmap.h'. Defaults - Defaults to 13 (inherited from `pokeemerald' default target base game). + Override the target base game's default number of total palettes. + The value specified here should match the corresponding value in + your project's `fieldmap.h'. Defaults to 13 (inherited from + `pokeemerald' default target base game). )", PALS_TOTAL_OVERRIDE )}.substr(1); @@ -390,10 +403,11 @@ constexpr int WALL_VAL = 5000; const std::string W_GENERAL = "W"; const std::string W_GENERAL_DESC = std::string{fmt::format(R"( -{}, -{}no- - Explicitly enable warning WARNING, or explicitly disable it if the `no' form of the - option is specified. If WARNING is already off, the `no' form will no-op. If more - than one specifier for the same warning appears on the same command line, the - right-most specifier will take precedence. + Explicitly enable warning WARNING, or explicitly disable it if the + `no' form of the option is specified. If WARNING is already off, the + `no' form will no-op. If more than one specifier for the same + warning appears on the same command line, the right-most specifier + will take precedence. )", W_GENERAL, W_GENERAL )}.substr(1); @@ -414,10 +428,11 @@ constexpr int WNO_ERROR_VAL = 5002; const std::string WERROR = "Werror"; const std::string WERROR_DESC = std::string{fmt::format(R"( -{}[=], -{}= - Force all enabled warnings to generate errors, or optionally force WARNING to enable - as an error. If the `no' form of the option is specified, downgrade WARNING from an - error to the highest previously seen level. If WARNING is already off, the `no' form - will no-op. If more than one specifier for the same warning appears on the same + Force all enabled warnings to generate errors, or optionally force + WARNING to enable as an error. If the `no' form of the option is + specified, downgrade WARNING from an error to the highest previously + seen level. If WARNING is already off, the `no' form will no-op. If + more than one specifier for the same warning appears on the same command line, the right-most specifier will take precedence. )", WERROR, WNO_ERROR diff --git a/src/cli_parser.cpp b/src/cli_parser.cpp index a95e7cf..4d6a8f5 100644 --- a/src/cli_parser.cpp +++ b/src/cli_parser.cpp @@ -40,9 +40,10 @@ const std::string GLOBAL_HELP = std::string{fmt::format(R"( porytiles {} {} grunt-lucas -Overworld tileset compiler for use with the pokeruby, pokefirered, and pokeemerald Pokémon -Generation 3 decompilation projects from pret. Also compatible with pokeemerald-expansion from -rh-hideout. Builds Porymap-ready tilesets from RGBA (or indexed) tile assets. +Overworld tileset compiler for use with the pokeruby, pokefirered, and +pokeemerald Pokémon Generation 3 decompilation projects from pret. Also +compatible with pokeemerald-expansion from rh-hideout. Builds Porymap-ready +tilesets from RGBA (or indexed) tile assets. Project home page: https://github.com/grunt-lucas/porytiles @@ -59,22 +60,27 @@ GLOBAL OPTIONS SUBCOMMANDS {} - Compile a primary tileset. All files are generated in-place at the output location. - Compilation transforms RGBA (or indexed) tile assets into a Porymap-ready tileset. + Compile a primary tileset. All files are generated in-place at the + output location. Compilation transforms RGBA (or indexed) tile assets + into a Porymap-ready tileset. {} - Compile a secondary tileset. All files are generated in-place at the output location. - Compilation transforms RGBA (or indexed) tile assets into a Porymap-ready tileset. + Compile a secondary tileset. All files are generated in-place at the + output location. Compilation transforms RGBA (or indexed) tile assets + into a Porymap-ready tileset. {} - Decompile a primary tileset. All files are generated in-place at the output location. - Decompilation transforms a Porymap-ready tileset into RGBA tile assets. + Decompile a primary tileset. All files are generated in-place at the + output location. Decompilation transforms a Porymap-ready tileset into + RGBA tile assets. {} - Decompile a secondary tileset. All files are generated in-place at the output location. - Decompilation transforms a Porymap-ready tileset into RGBA tile assets. + Decompile a secondary tileset. All files are generated in-place at the + output location. Decompilation transforms a Porymap-ready tileset into + RGBA tile assets. -Run `porytiles SUBCOMMAND --help' for more information about a subcommand and its OPTIONS and ARGS. +Run `porytiles SUBCOMMAND --help' for more information about a subcommand and +its OPTIONS and ARGS. To get more help with Porytiles, check out the guides at: https://github.com/grunt-lucas/porytiles/wiki @@ -93,50 +99,77 @@ COMPILE_PRIMARY_COMMAND, COMPILE_SECONDARY_COMMAND, DECOMPILE_PRIMARY_COMMAND, D const std::string COMPILATION_INPUT_DIRECTORY_FORMAT = std::string{fmt::format(R"( Compilation Input Directory Format - The compilation input directory must conform to the following format. `[]' indicates - optional assets. + The compilation input directory must conform to the following format. + `[]' indicates optional assets. src/ - bottom.png # bottom metatile layer (RGBA, 8-bit, or 16-bit indexed) - middle.png # middle metatile layer (RGBA, 8-bit, or 16-bit indexed) - top.png # top metatile layer (RGBA, 8-bit, or 16-bit indexed) - [assign.cache] # cached configuration for palette assignment algorithm - [attributes.csv] # missing metatile entries will receive default values - [anim/] # `anim' folder is optional - [anim1/] # animation names can be arbitrary, but must be unique - key.png # you must specify a key frame PNG for each anim - 00.png # you must specify at least one animation frame for each anim - [01.png] # frames must be named numerically, in order - ... # you may specify an arbitrary number of additional frames - ... # you may specify an arbitrary number of additional animations - [palette-primers] # `palette-primers' folder is optional - [foliage.pal] # e.g. a pal file containing all the colors for your trees and grass - ... # you may specify an arbitrary number of additional primer palettes + # bottom metatile layer (RGBA, 8-bit, or 16-bit indexed) + bottom.png + # middle metatile layer (RGBA, 8-bit, or 16-bit indexed) + middle.png + # top metatile layer (RGBA, 8-bit, or 16-bit indexed) + top.png + # cached configuration for palette assignment algorithm + [assign.cache] + # missing metatile entries will receive default values + [attributes.csv] + [anim/] + # animation names can be arbitrary, but must be unique + [anim1/] + # you must specify a key frame PNG for each anim + key.png + # you must specify at least a 00.png anim frame + 00.png + # frames must be named numerically, in order + [01.png] + # you may specify an arbitrary number of frames + ... + # you may specify an arbitrary number of animations + ... + # `palette-primers' folder is optional + [palette-primers] + # e.g. a pal file containing all the colors for your foliage + [foliage.pal] + # you may specify an arbitrary number of primer palettes + ... )" )}.substr(1); const std::string DECOMPILATION_INPUT_DIRECTORY_FORMAT = std::string{fmt::format(R"( Decompilation Input Directory Format\n" - The decompilation input directory must conform to the following format. `[]' indicates - optional assets. + The decompilation input directory must conform to the following format. + `[]' indicates optional assets. bin/ - metatile_attributes.bin # binary file containing attributes of each metatile - metatiles.bin # binary file containing metatile entries - tiles.png # indexed png of raw tiles - palettes # directory of palette files - 00.pal # JASC pal file for palette 0 - ... # number of pal files must match base game pals total count - [anim/] # `anim' folder is optional - [anim1/] # animation names can be arbitrary, but must be unique - 00.png # you must specify at least one animation frame for each anim - [01.png] # frames must be named numerically, in order - ... # you may specify an arbitrary number of additional frames - ... # you may specify an arbitrary number of additional animations + # binary file containing attributes of each metatile + metatile_attributes.bin + # binary file containing metatile entries + metatiles.bin + # indexed png of raw tiles + tiles.png + # directory of palette files + palettes + # JASC pal file for palette 0 + 00.pal + # number of pal files must match base game pals total count + ... + # `anim' folder is optional + [anim/] + # animation names can be arbitrary, but must be unique + [anim1/] + # you must specify at least a 00.png anim frame + 00.png + # frames must be named numerically, in order + [01.png] + # you may specify an arbitrary number of frames + ... + # you may specify an arbitrary number of animations + ... )" )}.substr(1); const std::string WARN_OPTIONS_HEADER = std::string{fmt::format(R"( - Use these options to enable or disable additional warnings, as well as set specific - warnings as errors. For more information and a full list of available warnings, check: + Use these options to enable or disable additional warnings, as well as + set specific warnings as errors. For more information and a full list of + available warnings, check: https://github.com/grunt-lucas/porytiles/wiki/Warnings-and-Errors )" )}.substr(1); @@ -145,26 +178,28 @@ const std::string COMPILE_PRIMARY_HELP = std::string{fmt::format(R"( USAGE porytiles {} [OPTIONS] INPUT-PATH BEHAVIORS-HEADER -Compile RGBA tile assets into a Porymap-ready primary tileset. `compile-primary' expects an input -path containing the target assets organized according to the format outlined in the Compilation -Input Directory Format subsection. You must also supply your project's `metatile_behaviors.h' file. -By default, `compile-primary' will write output to the current working directory, but you can -change this behavior by supplying the `-o' option. +Compile RGBA tile assets into a Porymap-ready primary tileset. `compile-primary' +expects an input path containing the target assets organized according to the +format outlined in the Compilation Input Directory Format subsection. You must +also supply your project's `metatile_behaviors.h' file. By default, +`compile-primary' will write output to the current working directory, but you +can change this behavior by supplying the `-o' option. ARGS - Path to a directory containing the RGBA tile assets for the target primary set. The - directory must conform to the Compilation Input Directory Format outlined below. This - tileset is the `target tileset.' + Path to a directory containing the RGBA tile assets for the target + primary set. The directory must conform to the Compilation Input + Directory Format outlined below. This tileset is the `target tileset.' - Path to your project's `metatile_behaviors.h' file. This file is likely located in your - project's `include/constants' folder. + Path to your project's `metatile_behaviors.h' file. This file is likely + located in your project's `include/constants' folder. {} OPTIONS - For more detailed information about the options below, check out the options pages here: - https://github.com/grunt-lucas/porytiles/wiki#advanced-topics + For more detailed information about the options below, check out the options + pages here: + https://github.com/grunt-lucas/porytiles/wiki#advanced-topics Driver Options {} @@ -215,33 +250,36 @@ const std::string COMPILE_SECONDARY_HELP = std::string{fmt::format(R"( USAGE porytiles {} [OPTIONS] INPUT-PATH PRIMARY-INPUT-PATH BEHAVIORS-HEADER -Compile RGBA tile assets into a Porymap-ready secondary tileset. `compile-secondary' expects an -input path containing the target assets organized according to the format outlined in the -Compilation Input Directory Format subsection. You must also supply the RGBA tile assets for a -paired primary tileset, so Porytiles can take advantage of the Generation 3 engine's tile re-use -system. Like `compile-primary', you must also supply your project's `metatile_behaviors.h' file. By -default, `compile-secondary' will write output to the current working directory, but you can change -this behavior by supplying the `-o' option. +Compile RGBA tile assets into a Porymap-ready secondary tileset. +`compile-secondary' expects an input path containing the target assets organized +according to the format outlined in the Compilation Input Directory Format +subsection. You must also supply the RGBA tile assets for a paired primary +tileset, so Porytiles can take advantage of the Generation 3 engine's tile +re-use system. Like `compile-primary', you must also supply your project's +`metatile_behaviors.h' file. By default, `compile-secondary' will write output +to the current working directory, but you can change this behavior by supplying +the `-o' option. ARGS - Path to a directory containing the RGBA tile assets for the target secondary set. The - directory must conform to the Compilation Input Directory Format outlined below. This - tileset is the `target tileset.' + Path to a directory containing the RGBA tile assets for the target + secondary set. The directory must conform to the Compilation Input + Directory Format outlined below. This tileset is the `target tileset.' - Path to a directory containing the RGBA tile assets for the paired primary set of the - target secondary tileset. The directory must conform to the Compilation Input Directory - Format outlined below. + Path to a directory containing the RGBA tile assets for the paired + primary set of the target secondary tileset. The directory must conform + to the Compilation Input Directory Format outlined below. - Path to your project's `metatile_behaviors.h' file. This file is likely located in your - project's `include/constants' folder. + Path to your project's `metatile_behaviors.h' file. This file is likely + located in your project's `include/constants' folder. {} OPTIONS - For more detailed information about the options below, check out the options pages here: - https://github.com/grunt-lucas/porytiles/wiki#advanced-topics + For more detailed information about the options below, check out the options + pages here: + https://github.com/grunt-lucas/porytiles/wiki#advanced-topics Driver Options {} @@ -298,26 +336,28 @@ const std::string DECOMPILE_PRIMARY_HELP = std::string{fmt::format(R"( USAGE porytiles {} [OPTIONS] INPUT-PATH BEHAVIORS-HEADER -Decompile a Porymap-ready primary tileset back into Porytiles-compatible RGBA tile assets. -`decompile-primary' expects an input path containing target compiled tile assets organized -according to the format outlined in the Decompilation Input Directory Format subsection. Like the -compilation commands, `decompile-primary' requires your project's `metatile_behaviors.h' file. -You can control its output location via the `-o' option. +Decompile a Porymap-ready primary tileset back into Porytiles-compatible RGBA +tile assets. `decompile-primary' expects an input path containing target +compiled tile assets organized according to the format outlined in the +Decompilation Input Directory Format subsection. Like the compilation commands, +`decompile-primary' requires your project's `metatile_behaviors.h' file. You can +control its output location via the `-o' option. ARGS - Path to a directory containing the compiled primary tileset. The directory must conform - to the Decompilation Input Directory Format outlined below. This tileset is the `target - tileset.' + Path to a directory containing the compiled primary tileset. The + directory must conform to the Decompilation Input Directory Format + outlined below. This tileset is the `target tileset.' - Path to your project's `metatile_behaviors.h' file. This file is likely located in your - project's `include/constants' folder. + Path to your project's `metatile_behaviors.h' file. This file is likely + located in your project's `include/constants' folder. {} OPTIONS - For more detailed information about the options below, check out the options pages here: - https://github.com/grunt-lucas/porytiles/wiki#advanced-topics + For more detailed information about the options below, check out the options + pages here: + https://github.com/grunt-lucas/porytiles/wiki#advanced-topics Driver Options {} @@ -352,32 +392,34 @@ const std::string DECOMPILE_SECONDARY_HELP = std::string{fmt::format(R"( USAGE porytiles {} [OPTIONS] INPUT-PATH PRIMARY-INPUT-PATH BEHAVIORS-HEADER -Decompile a Porymap-ready secondary tileset back into Porytiles-compatible RGBA tile assets. -`decompile-secondary' expects an input path containing target compiled tile assets organized -according to the format outlined in the Decompilation Input Directory Format subsection. You must -also supply the compiled tile assets of the target tileset's paired primary. `decompile-secondary' -requires your project's `metatile_behaviors.h' file. You can control its output location via the -`-o' option. +Decompile a Porymap-ready secondary tileset back into Porytiles-compatible RGBA +tile assets. `decompile-secondary' expects an input path containing target +compiled tile assets organized according to the format outlined in the +Decompilation Input Directory Format subsection. You must also supply the +compiled tile assets of the target tileset's paired primary. +`decompile-secondary' requires your project's `metatile_behaviors.h' file. You +can control its output location via the `-o' option. ARGS - Path to a directory containing the compiled secondary tileset. The directory must conform - to the Decompilation Input Directory Format outlined below. This tileset is the `target - tileset.' + Path to a directory containing the compiled secondary tileset. The + directory must conform to the Decompilation Input Directory Format + outlined below. This tileset is the `target tileset.' - Path to a directory containing the compiled paired primary tileset for the target secondary - tileset. The directory must conform to the Decompilation Input Directory Format outlined - below. + Path to a directory containing the compiled paired primary tileset for + the target secondary tileset. The directory must conform to the + Decompilation Input Directory Format outlined below. - Path to your project's `metatile_behaviors.h' file. This file is likely located in your - project's `include/constants' folder. + Path to your project's `metatile_behaviors.h' file. This file is likely + located in your project's `include/constants' folder. {} OPTIONS - For more detailed information about the options below, check out the options pages here: - https://github.com/grunt-lucas/porytiles/wiki#advanced-topics + For more detailed information about the options below, check out the options + pages here: + https://github.com/grunt-lucas/porytiles/wiki#advanced-topics Driver Options {} diff --git a/src/decompiler.cpp b/src/decompiler.cpp index 5e440be..665ca60 100644 --- a/src/decompiler.cpp +++ b/src/decompiler.cpp @@ -14,11 +14,6 @@ namespace porytiles { -/* - * FIXME 1.0.0 : decompiler will break if attribute format is wonky, see rusturf_tunnel example from Josh - * To fix this, we should add out-of-range warnings like we did for the tile and palette indexes - */ - static RGBATile setTilePixels(const PorytilesContext &ctx, const GBATile &gbaTile, const GBAPalette &palette, bool hFlip, bool vFlip) { From 444cca0d691f856ab7fcc833cdf3aad89a9948b8 Mon Sep 17 00:00:00 2001 From: grunt-lucas Date: Sun, 15 Sep 2024 07:22:49 -0700 Subject: [PATCH 3/6] Removed/updated some TODOs --- include/types.h | 4 ++-- src/cli_parser.cpp | 2 +- src/driver.cpp | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/types.h b/include/types.h index d4aebdc..87ce4ca 100644 --- a/include/types.h +++ b/include/types.h @@ -644,11 +644,11 @@ enum class AssignAlgorithm { DFS, BFS }; enum class DecompilerMode { PRIMARY, SECONDARY }; /* - * TODO 1.0.0 : combine CompilerMode and DecompilerMode into a single type: CompilationMode ? + * TODO : combine CompilerMode and DecompilerMode into a single type: CompilationMode ? */ /* - * TODO 1.0.0 : Remove all checks against Subcommand type in the codebase, prefer explicit CompilationMode parameters + * TODO : Remove all checks against Subcommand type in the codebase, prefer explicit CompilationMode parameters */ std::string subcommandString(Subcommand subcommand); diff --git a/src/cli_parser.cpp b/src/cli_parser.cpp index 4d6a8f5..2b57995 100644 --- a/src/cli_parser.cpp +++ b/src/cli_parser.cpp @@ -954,7 +954,7 @@ static void parseSubcommandOptions(PorytilesContext &ctx, int argc, char *const ctx.decompilerConfig.normalizeTransparencyColor = parseRgbColor(ctx.err, NORMALIZE_TRANSPARENCY, optarg); } else { - // TODO 1.0.0 : remove this deprecation warning + // TODO : remove this deprecation warning at some point in the future pt_warn("the no-arg version of `normalize-transparency' has been deprecated"); pt_println(stderr, " It is now the default Porytiles behavior, so you no longer need to specify this option."); diff --git a/src/driver.cpp b/src/driver.cpp index 992ed82..9a1f1cf 100644 --- a/src/driver.cpp +++ b/src/driver.cpp @@ -731,7 +731,6 @@ static void driveDecompilePrimary(PorytilesContext &ctx) /* * Import behavior header, if it was supplied */ - // TODO 1.0.0 : better error message if file did not exist? see compile version auto [behaviorMap, behaviorReverseMap] = prepareBehaviorsHeaderForImport(ctx, DecompilerMode::PRIMARY, ctx.decompilerSrcPaths.metatileBehaviors); @@ -755,7 +754,6 @@ static void driveDecompileSecondary(PorytilesContext &ctx) /* * Import behavior header, if it was supplied */ - // TODO 1.0.0 : better error message if file did not exist? see compile version auto [behaviorMap, behaviorReverseMap] = prepareBehaviorsHeaderForImport(ctx, DecompilerMode::SECONDARY, ctx.decompilerSrcPaths.metatileBehaviors); From 59aba4479922c8fde79dd3f2a2c89e043f99a37b Mon Sep 17 00:00:00 2001 From: grunt-lucas Date: Tue, 24 Sep 2024 07:27:00 -0700 Subject: [PATCH 4/6] Update todo script and created a tests category for TODOs --- script/todo.sh | 13 +++++++++++++ src/driver.cpp | 6 +++--- src/emitter.cpp | 4 ++-- src/importer.cpp | 6 +++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/script/todo.sh b/script/todo.sh index 7338668..7d664d2 100755 --- a/script/todo.sh +++ b/script/todo.sh @@ -10,6 +10,7 @@ Usage: todo.sh all todo.sh {NOTE,note} todo.sh {FEATURE,feature} todo.sh 1.0.0 + todo.sh tests todo.sh --help Display TODO related note comments. @@ -55,10 +56,20 @@ fi parse_params "$@" if [[ ${args[0]} == "all" ]]; then + # regular rg 'TODO :' rg 'FIXME :' rg 'NOTE :' rg 'FEATURE :' + + # 1.0.0 + rg 'TODO 1.0.0 :' + rg 'FIXME 1.0.0 :' + rg 'NOTE 1.0.0 :' + rg 'FEATURE 1.0.0 :' + + # tests + rg 'TODO tests :' elif [[ ${args[0]} == "TODO" || ${args[0]} == "todo" ]]; then rg 'TODO :' elif [[ ${args[0]} == "FIXME" || ${args[0]} == "fixme" ]]; then @@ -72,6 +83,8 @@ elif [[ ${args[0]} == "1.0.0" ]] then rg 'FIXME 1.0.0 :' rg 'NOTE 1.0.0 :' rg 'FEATURE 1.0.0 :' +elif [[ ${args[0]} == "tests" ]] then + rg 'TODO tests :' else echo "error: unknown command \`${args[0]}'" usage_exit_error diff --git a/src/driver.cpp b/src/driver.cpp index 9a1f1cf..a1f750b 100644 --- a/src/driver.cpp +++ b/src/driver.cpp @@ -1001,7 +1001,7 @@ TEST_CASE("drive should emit all expected files for anim_metatiles_2 primary set porytiles::drive(ctx); - // TODO 1.0.0 : test impl check pal files + // TODO tests : (drive should emit all expected files...) test palette files are correct // Check tiles.png @@ -1168,7 +1168,7 @@ TEST_CASE("drive should emit all expected files for anim_metatiles_2 secondary s porytiles::drive(ctx); - // TODO 1.0.0 : test impl check pal files + // TODO tests : (drive should emit all expected files...) test palette files are correct // Check tiles.png @@ -1386,7 +1386,7 @@ TEST_CASE("drive should emit all expected files for compiled_emerald_general") std::filesystem::path{"res/tests/compiled_emerald_general/expected_decompiled/attributes.csv"}, parentDir / std::filesystem::path{"attributes.csv"}); - // TODO : test animations once we implement anim decomp + // TODO tests : (drive should emit all expected files) test animations once we implement anim decomp std::filesystem::remove_all(parentDir); } diff --git a/src/emitter.cpp b/src/emitter.cpp index 0027047..f426a52 100644 --- a/src/emitter.cpp +++ b/src/emitter.cpp @@ -559,7 +559,7 @@ TEST_CASE("emitMetatilesBin should emit metatiles.bin as expected based on setti TEST_CASE("emitAnim should correctly emit compiled animation PNG files") { - // TODO 1.0.0 : test impl emitAnim should correctly emit compiled animation PNG files + // TODO tests : (emitAnim should correctly emit compiled animation PNG files) } TEST_CASE("emitAttributes should correctly emit metatile attributes") @@ -736,5 +736,5 @@ TEST_CASE("emitAttributes should correctly emit metatile attributes") TEST_CASE("emitDecompiled should correctly emit the decompiled tileset files") { - // TODO 1.0.0 : test impl emitDecompiled should correctly emit the decompiled tileset files + // TODO tests : (emitDecompiled should correctly emit the decompiled tileset files) } diff --git a/src/importer.cpp b/src/importer.cpp index d313ebc..aa293bb 100644 --- a/src/importer.cpp +++ b/src/importer.cpp @@ -1746,7 +1746,7 @@ TEST_CASE("importCompiledTileset should import a triple-layer pokeemerald tilese std::filesystem::path paletteFile = decompileCtx.decompilerSrcPaths.primaryPalettes() / filename.str(); paletteFiles.push_back(std::make_unique(paletteFile)); } - // TODO 1.0.0 : actually test anims import + // TODO tests : (importCompiledTileset should import a triple-layer...) actually test anims import auto [importedTileset, attributesMap] = porytiles::importCompiledTileset(decompileCtx, porytiles::DecompilerMode::PRIMARY, metatiles, attributes, std::unordered_map{}, tilesheetPng, paletteFiles, @@ -1780,12 +1780,12 @@ TEST_CASE("importCompiledTileset should import a triple-layer pokeemerald tilese } } - // TODO 1.0.0 : test impl check attributes map + // TODO tests : (importCompiledTileset should import a triple-layer...) check attributes map correctness std::filesystem::remove_all(parentDir); } TEST_CASE("importCompiledTileset should import a dual-layer pokefirered tileset correctly") { - // TODO 1.0.0 : test impl importCompiledTileset should import a dual-layer pokefirered tileset correctly + // TODO tests : (importCompiledTileset should import a dual-layer pokefirered tileset correctly) } From 72b0d8c14ee155e29dc029086c39b1f20d1e62a1 Mon Sep 17 00:00:00 2001 From: grunt-lucas Date: Thu, 10 Oct 2024 10:07:49 -0700 Subject: [PATCH 5/6] Remove some TODOs and fix hardcoded 128 as metatile sheet width --- include/types.h | 1 + src/driver.cpp | 7 +++---- src/emitter.cpp | 2 +- src/errors_warnings.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/types.h b/include/types.h index 87ce4ca..aa401e0 100644 --- a/include/types.h +++ b/include/types.h @@ -26,6 +26,7 @@ constexpr std::size_t TILE_NUM_PIX = TILE_SIDE_LENGTH_PIX * TILE_SIDE_LENGTH_PIX constexpr std::size_t METATILE_TILE_SIDE_LENGTH_TILES = 2; constexpr std::size_t METATILE_SIDE_LENGTH = TILE_SIDE_LENGTH_PIX * METATILE_TILE_SIDE_LENGTH_TILES; constexpr std::size_t METATILES_IN_ROW = 8; +constexpr std::size_t METATILE_SHEET_WIDTH = METATILE_SIDE_LENGTH * METATILES_IN_ROW; constexpr std::size_t PAL_SIZE = 16; constexpr std::size_t MAX_BG_PALETTES = 16; constexpr std::size_t TILES_PER_METATILE_DUAL = 8; diff --git a/src/driver.cpp b/src/driver.cpp index a1f750b..6c1a3c3 100644 --- a/src/driver.cpp +++ b/src/driver.cpp @@ -597,10 +597,9 @@ static void driveEmitDecompiledTileset(PorytilesContext &ctx, DecompilerMode mod std::ostringstream outAttributesContent{}; std::size_t metatileCount = attributesMap.size(); std::size_t imageHeight = std::ceil(metatileCount / 8.0) * 16; - // TODO 1.0.0 : replace the 128s strewn about the code with a named constant METATILE_SHEET_WIDTH or something - png::image bottomPng{128, static_cast(imageHeight)}; - png::image middlePng{128, static_cast(imageHeight)}; - png::image topPng{128, static_cast(imageHeight)}; + png::image bottomPng{METATILE_SHEET_WIDTH, static_cast(imageHeight)}; + png::image middlePng{METATILE_SHEET_WIDTH, static_cast(imageHeight)}; + png::image topPng{METATILE_SHEET_WIDTH, static_cast(imageHeight)}; porytiles::emitDecompiled(ctx, mode, bottomPng, middlePng, topPng, outAttributesContent, tileset, attributesMap, behaviorReverseMap); diff --git a/src/emitter.cpp b/src/emitter.cpp index f426a52..ae7f1c7 100644 --- a/src/emitter.cpp +++ b/src/emitter.cpp @@ -325,7 +325,7 @@ void emitDecompiled(PorytilesContext &ctx, DecompilerMode mode, png::image Date: Thu, 10 Oct 2024 10:13:02 -0700 Subject: [PATCH 6/6] Updated a few more comments --- src/importer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/importer.cpp b/src/importer.cpp index aa293bb..f38a730 100644 --- a/src/importer.cpp +++ b/src/importer.cpp @@ -836,14 +836,14 @@ static std::vector importCompiledPalettes(PorytilesContext &ctx, Dec for (const std::unique_ptr &stream : paletteFiles) { std::string line; - /* * TODO : should fatal errors here have better messages? Users shouldn't ever really see these errors, since * compiled palettes will always presumably have correct formatting unless a user has manually messed with one */ - - // FIXME 1.0.0 : this function assumes the pal file is DOS format, need to fix this - + /* + * FIXME : this function assumes the pal file is DOS format, need to fix this + * Pret PR here recently addressed the gbagfx DOS line ending issue: https://github.com/pret/pokeemerald/pull/2004 + */ std::getline(*stream, line); if (line.size() == 0) { fatalerror(ctx.err, ctx.decompilerSrcPaths, decompilerMode, "invalid blank line in pal file"); @@ -1142,7 +1142,10 @@ RGBATile importPalettePrimer(PorytilesContext &ctx, CompilerMode compilerMode, s * TODO : fatalerrors in this function need better messaging */ - // FIXME 1.0.0 : this function assumes the pal file is DOS format, need to fix this + /* + * FIXME : this function assumes the pal file is DOS format, need to fix this + * Pret PR here recently addressed the gbagfx DOS line ending issue: https://github.com/pret/pokeemerald/pull/2004 + */ std::string line; std::getline(paletteFile, line);