@@ -153,7 +153,7 @@ void Canvas::RedrawTile(int row, int column)
153153 QPixmap pix;
154154 QTransform trans= QTransform ();
155155
156- if (project.tileset .format == Tileset::GBA_4bpp )
156+ if (project.tileset .isPalettedFormat () )
157157 {
158158 // Clamp 256 color indexes to 16 colors of one of 16 palettes
159159 QImage pix_tf= project.tileset .tiles [ttile->tileset_offset ];
@@ -216,7 +216,7 @@ void Canvas::OpenContextMenu(QPoint screen_pos, QPoint canvas_pos)
216216 context_menu_palette_sel->addAction (" " +QString::number (i));
217217 }
218218 connect (context_menu_palette_sel, &QMenu::triggered, this , &Canvas::onMenuChangePal_triggered);
219- context_menu_palette_sel->setEnabled (project.tileset .format == Tileset::GBA_4bpp );
219+ context_menu_palette_sel->setEnabled (project.tileset .isPalettedFormat () );
220220 context_menu->addAction (" Flip tile horizontally" );
221221 context_menu->actions ().last ()->setCheckable (true );
222222 context_menu->actions ().last ()->setChecked (tiles[tilen].hflip );
@@ -417,7 +417,7 @@ QImage Canvas::GetImage()
417417 for (int ix=0 ; ix<TILE_W ; ix++)
418418 {
419419 unsigned char pixel= tile_scanline[ix];
420- if (project.tileset .format == Tileset::GBA_4bpp )
420+ if (project.tileset .isPalettedFormat () )
421421 pixel= tiles[tm_ti].palette_index *PALETTE_W +pixel%PALETTE_W ;
422422
423423 if (!tiles[tm_ti].hflip )
0 commit comments