Complete.Org: Mailing Lists: Archives: freeciv-data: July 2003:
[freeciv-data] adding nations more easily by splitting flags
Home

[freeciv-data] adding nations more easily by splitting flags

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv-data <freeciv-data@xxxxxxxxxxx>
Subject: [freeciv-data] adding nations more easily by splitting flags
From: Mike Kaufman <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 12 Jul 2003 13:14:52 -0500
Reply-to: freeciv-data@xxxxxxxxxxx

proposal: move flags into individual png files.

benefits: facilitate adding and/or removing nations easily by freeciv
          non-cognicenti. merge redundant flags.png files from trident/ 
          and isotrident/ directories. make isotrident_shields easy to 
          accomplish.

problems: flags sprites in trident and isotrident have different sizes,
          specifically differing amounts of transparency. Also, shields.png
          for trident_shields needs to be updated concurrently with any
          added nation.

cons: only a single [uniform] grid in png files will be allowed: pngs other
      than the flags.pngs will have to be modified.

method: create a data/misc/flags directory and create a png file for each
        nation named for example "italy.png". Each png would have a 2x1
        (or 1x2) grid with the regular flag in the first space and the
        'shields' flag in the second. The .spec file would be located in
        the data/<tileset>/ directory.

specifics:

to create spec files that can deal with multiple graphics files and
different transparency sizes,

change header [file] to [file_*]
gfx = <filename>
; specify the  the size of the grid. we no longer need [xy]_top_left since
; we only allow one grid.
grid  = { "dx", "dy", "is_pixel_border" }
; each tile can have a different width, height, and offset from the top
; left of the sprite. a scaling feature can be added later.
tiles = { "row", "column", "width", "height", "x_offset", "y_offset", "tag"
}

and use secfile_get_secnames_prefix(file, "file_", &num_files) to access
each
graphics file.

spec files with multiple [grid_*] sections must be changed: probably means
pngs
will have to be split.
 o trident/roads.spec -> 2 grids
 o isotrident/terrain1.spec -> 3 grids
 o isotrident/terrain2.spec -> 2 grids

so a flags specfile would look like:

[spec]
options = "+spec3"

[info]
artists = "..."

[file_italy]
gfx = "trident/flags/italy.png"
grid  = { "dx", "dy", "is_pixel_border"
  26, 20, 0
}
tiles = { "row", "column", "height", "width", "offset_x", "offset_y", "tag"
 0,  0, 30,  30,  0,  0,  "f.italy"
}

[file_iraq_old]
gfx = "trident/flags/iraq_old.png"
grid  = { "dx", "dy", "is_pixel_border"
  26, 20, 0
}
tiles = { "row", "column", "height", "width", "offset_x", "offset_y", "tag"
  0,  0,  30,  30,  0,  0, "f.iraq_old"
}

...

the _shields specfile would be similar except:

[file_italy]
gfx = "trident/flags/italy.png"
grid  = { "dx", "dy", "is_pixel_border"
  26, 20, 0
}
tiles = { "row", "column", "height", "width", "offset_x", "offset_y", "tag"
 0,  1, 45,  45,  0,  4,  "f.italy" ; why this is 45x45? holdover from engels?
}

this is not a complete proposal by any means. I haven't actually attempted
to do this so for all I know there are serious flaws here.

-mike


[Prev in Thread] Current Thread [Next in Thread]