[nostalgia/core] Add support for drawing NostalgiaGraphics in SDL
This commit is contained in:
@@ -75,7 +75,7 @@ namespace {
|
||||
|
||||
QMap<QRgb, int> colors;
|
||||
auto ng = std::make_unique<core::NostalgiaGraphic>();
|
||||
ng->pal.resize(countColors(src, argTiles));
|
||||
ng->pal.colors.resize(countColors(src, argTiles));
|
||||
if (argBpp == 4) {
|
||||
ng->tiles.resize(Pixels / 2);
|
||||
} else {
|
||||
@@ -112,7 +112,7 @@ namespace {
|
||||
// store colors in palette with the corresponding color id
|
||||
for (auto key : colors.keys()) {
|
||||
auto colorId = colors[key];
|
||||
ng->pal[colorId] = toGbaColor(key);
|
||||
ng->pal.colors[colorId] = toGbaColor(key);
|
||||
}
|
||||
|
||||
return ng;
|
||||
|
||||
@@ -73,7 +73,7 @@ int ImportTilesheetWizardPalettePage::accept() {
|
||||
if (palette != PaletteOptions.indexOf(PaletteOption_Bundle)) {
|
||||
const auto outPath = PaletteDir + paletteName + FileExt_npal;
|
||||
core::NostalgiaPalette pal;
|
||||
pal.colors = std::move(ng->pal);
|
||||
pal = std::move(ng->pal);
|
||||
auto [buff, err] = toBuffer(&pal);
|
||||
oxReturnError(err);
|
||||
oxReturnError(m_ctx->project->write(outPath, buff.data(), buff.size()));
|
||||
|
||||
Reference in New Issue
Block a user