DungeonEditor upgrades and other QoL

This commit is contained in:
Justin Scofield
2023-11-22 16:08:18 -05:00
parent 97bbae3de0
commit 5f3ca25c80
8 changed files with 172 additions and 35 deletions

View File

@@ -262,6 +262,26 @@ PaletteGroup CreatePaletteGroupFromColFile(
return toret;
}
// Take a SNESPalette with N many colors and divide it into palettes of 8 colors
// each
PaletteGroup CreatePaletteGroupFromLargePalette(SNESPalette& palette) {
PaletteGroup toret;
std::cout << "Palette size is " << palette.size() << std::endl;
for (int i = 0; i < palette.size(); i += 8) {
SNESPalette new_palette;
if (i + 8 < palette.size()) {
for (int j = 0; j < 8; j++) {
new_palette.AddColor(palette[i + j]);
}
}
toret.AddPalette(new_palette);
}
return toret;
}
} // namespace gfx
} // namespace app
} // namespace yaze

View File

@@ -261,6 +261,8 @@ struct PaletteGroup {
PaletteGroup CreatePaletteGroupFromColFile(std::vector<SNESColor>& colors);
PaletteGroup CreatePaletteGroupFromLargePalette(SNESPalette& palette);
} // namespace gfx
} // namespace app
} // namespace yaze