Skip to content

Commit

Permalink
add: add export palette with sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelesaux committed May 4, 2024
1 parent b1a8492 commit feefd46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/martine-ui/export_sprite_board.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,15 @@ func (m *MartineUI) ExportSpriteBoard(s *menu.SpriteMenu) {
for _, v := range s.SpritesData {
data = append(data, v...)
}
kitPalette := palette.KitPalette{}
for i := 0; i < len(s.Palette()); i++ {
kitPalette.Colors[i] = constants.NewCpcPlusColor(s.Palette()[i])
}
header := fmt.Sprintf("' from file %s\n", s.FilePath)
code := header + ascii.SpritesHardText(data, s.ExportCompression)
code += "palette:\n"
code += kitPalette.ToString()

filename := s.ExportFolderPath + string(filepath.Separator) + "SPRITES.ASM"
err := amsdos.SaveStringOSFile(filename, code)
if err != nil {
Expand Down

0 comments on commit feefd46

Please sign in to comment.