GRFCodec feature discussion thread

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Locked
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Re: GRFCodec feature discussion thread

Post by minime »

planetmaker wrote:There seems to happen some unwanted things, if I compile OpenGFX with the "-c" flag. See http://dev.openttdcoop.org/issues/903 and the attached screenshot. I'm not quite sure why the alignment of namely the track sprites (both some road, monorail and maglev) seems to fail. I tested with r413 (with -c) / r414 (without -c) of OpenGFX (anonymous checkout via hg clone http://mz.openttdcoop.org/hg/opengfx )
grfcodec readme wrote:-c
Enable sprite-shrinking optimizations. Note that these are not necessarily safe. In particular, sprites that will share their bounding box (as for some station sprites) must not have their upper-right hand corner moved, and the sprite defining the bounding box must not be shrunk smaller than any that will share with it.
Sprites with bit 6 of their compression byte set will never be shrunk.
i.e. some sprites in OpenGFX should have bit 6 set, but they don't -- not a GRFCodec bug
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: GRFCodec feature discussion thread

Post by Ammler »

minime wrote: i.e. some sprites in OpenGFX should have bit 6 set, but they don't -- not a GRFCodec bug
How do you find out, which sprites needs +40?
hmm, isn't bit6 +64?

http://wiki.ttdpatch.net/tiki-index.php ... ompression
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: GRFCodec feature discussion thread

Post by Yexo »

Ammler wrote:hmm, isn't bit6 +64?
+64decimal is +40hexadecimal.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: GRFCodec feature discussion thread

Post by michael blunck »

Ammler wrote: How do you find out, which sprites needs +40?
grfcodec readme wrote: [...] sprites that will share their bounding box [...] must not have their upper-right hand corner moved, and the sprite defining the bounding box must not be shrunk smaller than any that will share with it.
IIRC, there are some more "special" sprites which may not be cropped (catenary, foundations, tunnels(?), ...).

regards
Michael
Image
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Re: GRFCodec feature discussion thread

Post by minime »

Yes -- ttdpbase.grf would be a good place to inspect for those types of graphics that are common for both games - that GRF has this bit set where necessary AFAIK (catenary is certainly one of those troublesome things). Otherwise, going through the original data files from TTD should help uncover the rest (I recall at least one rail tile being special in this way) - basically any sprites there that have a transparent (blue) border on at least one complete side could be safely considered uncroppable. In the worst case you can err on the cautious side, and the resulting GRF will be negligibly bigger - not a big deal.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: GRFCodec feature discussion thread

Post by frosch »

To give a rule of thumb: All sprites which get another sprite as overlay, but are no groundsprites.
So: Foundations, station roofs with transparency overlay (the glass), industries with animation (e.g. http://dev.openttdcoop.org/issues/779 but there are some more), the weird house with lift. Well, grep for "AddChildSpriteScreen" yourself :)
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: GRFCodec feature discussion thread

Post by Rubidium »

There's a new (preview) release at http://www.tt-forums.net/viewtopic.php?f=26&t=49611
Locked

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 22 guests