Skip to content

Commit

Permalink
Sprite sheets mostly working; remains a glitch with some larger ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Bananarchist committed Jan 15, 2023
1 parent 32274f6 commit 2af336c
Show file tree
Hide file tree
Showing 3 changed files with 336 additions and 118 deletions.
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ A list of things that need to be done; consider opening a pull request with one
- Storage/production is implemented for few if any of the file formats, eg, archiving files into an AFS
- Extraction for some of the containers is slow; in some cases it may just be better to load them into memory, perhaps deciding based on `File.stat`
- This also could be a matter of read size, but this too will require some cleverness
- There are recurring patterns around image tiles that can be abstracted
- At the very least, basic helpers like padding with `<<0>>` on sides can be turned into general utility functions

## Lim.ex
- Does not handle multiple palettes
Expand Down
9 changes: 7 additions & 2 deletions lib/lim.ex
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,13 @@ defmodule Lim do
|> Png.with_color_type(info.palette_data.palettes |> Enum.to_list()) # need to actually handle multiple palettes someday~
|> Png.execute(pixel_data)
do
{:ok, png_data} -> File.write(output_file_name, png_data <> <<>>)
{:error, err} -> IO.puts(err)
{:ok, png_data} ->
case File.write(output_file_name, png_data <> <<>>) do
:ok -> {:ok, png_data}
err -> err
end
{:error, err} ->
{:error, err}
end

end
Expand Down
Loading

0 comments on commit 2af336c

Please sign in to comment.