diff --git a/export/file/imp.go b/export/file/imp.go index 144f0f4..1236c01 100644 --- a/export/file/imp.go +++ b/export/file/imp.go @@ -12,24 +12,24 @@ import ( ) type ImpFooter struct { - Height byte Width byte + Height byte NbFrames byte } func Imp(sprites []byte, nbFrames, width, height, mode uint, filename string, export *x.ExportType) error { - h := height + w := width switch mode { case 0: - h /= 2 + w /= 2 case 1: - h /= 4 + w /= 4 case 2: - h /= 8 + w /= 8 } impHeader := ImpFooter{ - Height: byte(h), - Width: byte(width), + Width: byte(w), + Height: byte(height), NbFrames: byte(nbFrames), } output := make([]byte, 0) @@ -70,7 +70,7 @@ func TileMap(data []byte, filename string, export *x.ExportType) error { Size: uint16(binary.Size(output)), Size2: uint16(binary.Size(output)), LogicalSize: uint16(binary.Size(output))} - copy(header.Filename[:], export.GetAmsdosFilename(filename, ".IMP")) + copy(header.Filename[:], export.GetAmsdosFilename(filename, ".TIL")) header.Checksum = uint16(header.ComputedChecksum16()) impPath := filepath.Join(export.OutputPath, export.GetAmsdosFilename(filename, ".TIL")) fw, err := os.Create(impPath) diff --git a/main.go b/main.go index cc8629f..0b3974c 100644 --- a/main.go +++ b/main.go @@ -114,7 +114,7 @@ var ( filloutGif = flag.Bool("fillout", false, "Fill out the gif frames needed some case with deltapacking") saturationPal = flag.Int("contrast", 0, "apply contrast on the color of the palette on amstrad plus screen. (max value 100 and only on CPC PLUS).") brightnessPal = flag.Int("brightness", 0, "apply brightness on the color of the palette on amstrad plus screen. (max value 100 and only on CPC PLUS).") - appVersion = "0.30" + appVersion = "0.31" version = flag.Bool("version", false, "print martine's version") ) @@ -584,11 +584,11 @@ func main() { os.Exit(-1) } f.Close() - nbFrames++ if i >= maxTiles { fmt.Fprintf(os.Stderr, "Maximum of %d tiles accepted, skipping...\n", maxTiles) break } + nbFrames++ } } // save the file sprites