Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: SDL client: tilespec and themespec
Home

[Freeciv-Dev] Re: SDL client: tilespec and themespec

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Cc: "freeciv-dev@xxxxxxxxxxx" <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: SDL client: tilespec and themespec
From: Rafa³ Bursig <bursig@xxxxxxxxx>
Date: Thu, 19 Dec 2002 14:42:31 +0100

Dnia 2002.12.19 06:13 Jason Short napisa³(a):
I am strongly opposed to making sprite_hash available outside of
tilespec.c.  This allows GUIs to add things to the tileset, but there
will be no consistency or standardization.  If enough GUI authors take
advantage of this "feature", we will eventually finding these
non-standard additions conflicting with each other.

I used to be in favor of adding a .themespec "theme" file that can be
used on a per-GUI basis.  So data/sdl-theme.themespec would define the
top-level information for the "default" SDL theme.

But on continued reflection, I see that there is no real distinction
between the tileset and the theme.  The current tilesets include
arrows
("s.right_arrow", in misc/small.png), which IMO should be part of the
theme.  It contains treaty window graphics (misc/treaty.png), intro
graphics (misc/intro.png and misc/radar.png), numbers and letters
(trident/tiles.png), government graphics, and flags.  Where do you
draw
the line between "tileset" and "theme" graphics?

Additionally, the graphics themselves are closely tied to the tileset.

If you change to using a larger-tiled tileset, you probably want to
use
larger button graphics as well.

So the solution I'm now in favor of is making these graphics a defined
part of the tileset.  We add them to named_sprites and load them along
with all the other sprites.  The GUI code can use these sprites as
needed; the only disadvantage is that they will take up memory even if
not needed.  But I suspect GUIs can find a way to use them - for
instance gui-gtk-2.0 could easily use them as icon graphics in the
menus (although I don't know if this would actually look good).

some facts :
- SDLClient can't work without tileset with gui graphics and other clients can. - If you want use tileset with gui gfx in other clients simple remove theme entry from main *.tilespec file. - If you want use existing tilesets ( without gui gfx ) you maus add this graphic and modify *.tilespec file.
- numbers of SDL theme graphic isn't const and rather will be biger.

We should change loading specfile procedure :

Client on start should read only main "*.specfile" and here should be moved some info from current *.tilespec ( like used font , paths , start resolution , etc ). In "main.specfile" should be only 2 entry of spec files :

1) *.tilespec - for map/unit/cities/fx graphic.
2) *.themespec - for gui theme graphic.

                           name.tilespec
                        /
name.specfile
                        \
                          name.themespec

Secound *.themespec file should fill secound theme_hash_table ( in tilespec.c ) which will be available outside of tilespec.c. Each client should have own theme sprite array and code to setup this array from theme_hash_table. We can unificate part of this theme array and put into common side but not all, this give us flex. to adding and removing gfx from theme and open way to new unification of some theme graphic.


As for the triplicate intro graphics, I think the best solution here
is
to provide a single graphics file that has a smallish (510x300)
content
area but has a large background.  Then the image can be displayed
*without scaling* so that the content area is centered, but as the
canvas gets larger more of the background is shown.  Imagine
freeciv-test's intro3.png with a more regular background, or
http://www.techdeck.org/freeciv-heb.jpg with the background texture
continuing as far outward as necessary.

This should be configurable by specfile ( not hard coded in code ).
Code should support all case that creator of tile theme want.
if creator want intro :
1) "solid" backgrount with center "small" texture then specfile should have such info and code should make such "solid" bcgd and draw center texture. 2) image with "w" and "h" then code should draw it ( or scal and draw ) Creator should know what is doing :)

Rafal

----------------------------------------------------------------------
Czatujesz? Zaloz konto pocztowe w domenie @CZATeria.pl
Rezerwacja dla zarejestrowanych nickow tylko do 20 grudnia!
http://link.interia.pl/f16b0




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