gif2c: Produce nicer formatted C code.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Fabian Schlenz 2019-06-14 05:36:25 +02:00
parent 60aacb0531
commit 0af76f2195
1 changed files with 10 additions and 1 deletions

View File

@ -166,7 +166,16 @@ puts "uint16_t animation_#{name}_delays[] = {#{times.join(",")}};"
s=0
puts "uint16_t animation_#{name}_offsets[] = {#{(data.map{|d| t=s; s+=d.count; t} + [s]).join(",")}};"
puts "AnimationData animation_#{name} = {&animation_#{name}_colors[0], &animation_#{name}_data[0], &animation_#{name}_offsets[0], &animation_#{name}_delays[0], #{individual_frame_times}, #{colors.count-2}, #{frames_data.count}, #{total_x}, #{total_y}};"
puts "AnimationData animation_#{name} = {"
puts " &animation_#{name}_colors[0],"
puts " &animation_#{name}_data[0],"
puts " &animation_#{name}_offsets[0],"
puts " &animation_#{name}_delays[0],"
puts " #{individual_frame_times}, /* individual_frame_times */"
puts " #{colors.count-2}, /* color_count */"
puts " #{frames_data.count}, /* frames_count */"
puts " #{total_x}, #{total_y} /* width, height */"
puts "};"
puts
STDERR.puts
STDERR.puts "Space usage:"