gbtiles 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ead8106729b3a84988e0fec3f04c932a1aa870df
4
- data.tar.gz: a0e02dfa4cca73ae5253ede1e000ab12311efcd8
3
+ metadata.gz: b2ea88232e440e03bf1a2237ef9fac06e90b9d46
4
+ data.tar.gz: 012cdd0b79076577127be0b0a4f09e9010600ea3
5
5
  SHA512:
6
- metadata.gz: fb813f183e1c213ff6b82991c49dd999c4179a5134a4a1e333f4e701a9bfc032decd53ea5fded7b17d023e027aa3693a76057b3575186fd78faaeda408fab8c9
7
- data.tar.gz: 10b070b7f0ce28e32d00255517a1d1c1ac5e69385a2637930eefedf8382cfa127e919247dae4c04dde605743680c263eb76212b85633c7c0490cb8eb73d354a7
6
+ metadata.gz: 788dbde8ee48c62db027cf4f95390d991f739997375cd8626432b34be93e3739cd43ba4474e45528d5f57b6b2ebdea82e786801ad8237f93382e5d7aea2718c9
7
+ data.tar.gz: 9ca2431d18aa9d2df5230d8f07d14a94fc2353e808089129b8defc11446757f6d98c8ab00228f58dc5b3f6c4857e3d0470a1e24f24634ada981e2a8d9279bb07
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # GBTiles
2
2
 
3
- Version 0.0.1
4
-
5
3
  Converts `.GBR` files created with
6
4
  [Harry Mulder's Tile Designer (GBTD)](http://www.devrs.com/gb/hmgd/gbtd.html)
7
5
  and `.GBM` files created with
@@ -39,7 +39,8 @@ module GBTiles
39
39
  output_stream.write(render_s)
40
40
 
41
41
  if output_stream.is_a? File then
42
- header_path = "#{File.basename(output_stream.path, ".s")}.h"
42
+ header_filename = "#{File.basename(output_stream.path, ".s")}.h"
43
+ header_path = "#{File.dirname(File.expand_path(output_stream.path))}/#{header_filename}"
43
44
  header_stream = File.open(header_path, "w")
44
45
  header_stream.write(render_h)
45
46
  header_stream.close
@@ -17,11 +17,10 @@
17
17
  .dw _<%= map_export_settings.label_name %>
18
18
 
19
19
  _<%= map_export_settings.label_name %>:
20
- <% (1..map.height).each do |row| -%>
21
- <% row_tile_data = map_tile_data.row(map.width, row) -%>
20
+ <% (1..(map.width*map.height/16.0).ceil).each do |row| -%>
21
+ <% row_tile_data = map_tile_data.row(row, 16) -%>
22
22
  <% if !row_tile_data.nil? -%>
23
- .db <%= map_tile_data
24
- .row(map.width, row)
23
+ .db <%= row_tile_data
25
24
  .map {|x| sprintf("0x%02x", x.tile_number) }
26
25
  .join(',')
27
26
  %>
@@ -30,7 +30,7 @@ module GBTiles
30
30
  object
31
31
  end
32
32
 
33
- def row width, row
33
+ def row row, width = 16
34
34
  @records[(width * (row - 1))..((width * row) - 1)]
35
35
  end
36
36
  end
@@ -39,7 +39,8 @@ module GBTiles
39
39
  output_stream.write(render_s)
40
40
 
41
41
  if output_stream.is_a? File then
42
- header_path = "#{File.basename(output_stream.path, ".s")}.h"
42
+ header_filename = "#{File.basename(output_stream.path, ".s")}.h"
43
+ header_path = "#{File.dirname(File.expand_path(output_stream.path))}/#{header_filename}"
43
44
  header_stream = File.open(header_path, "w")
44
45
  header_stream.write(render_h)
45
46
  header_stream.close
@@ -1,3 +1,3 @@
1
1
  module GBTiles
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gbtiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bashkim Isai