texpage split and conversion script

Discuss the future of Warzone 2100 with us.
Post Reply
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

texpage split and conversion script

Post by kage »

this script has reached initial release quality -- it will take any old-style warzone terrain texpage and do as necessary to make it compatible with recent svn builds (creating a radar file, splitting texpages into individual pngs within resolution-specific directories). the attached zip contains the script, a configuration file, and a quick readme put together by coyote, which is slightly out of date, but will be remedied when i get more time. if anyone wants to stick this in svn, it's probably better that the zip contents are first unpacked.
Attachments
texpage2mipmap.zip
(9.6 KiB) Downloaded 240 times
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: texpage split and conversion script

Post by Giel »

Committed in r2383.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: texpage split and conversion script

Post by Giel »

Found the first "bug" in your script already. It doesn't name the first ten tiles like tile-01.png, tile-02.png, tile-03.png, etc. instead it leaves out the leading zero.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: texpage split and conversion script

Post by kage »

Giel wrote: Found the first "bug" in your script already. It doesn't name the first ten tiles like tile-01.png, tile-02.png, tile-03.png, etc. instead it leaves out the leading zero.
i talked with per about that specifically as i was developing this -- since warzone uses sscanf to find the tiles, it won't make any difference in game, and it was easier for me not to have to mv the files (since, afaik, there's no way to control imagemagick output like that along a set format). if there's enough demand for this, though, i will put it in, but as the default for a disableable option, as it should make no difference in warzone (it would've been more code for per for it to have made a difference), and it would take more time to process, as well as having more disk-bound operations.
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: texpage split and conversion script

Post by Giel »

Ah, in that case the problem is with the sscanf code. Since it currently bails out complaining that it can't find tile-00.png when tile-0.png is available.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: texpage split and conversion script

Post by Per »

Giel wrote: Ah, in that case the problem is with the sscanf code. Since it currently bails out complaining that it can't find tile-00.png when tile-0.png is available.
That is because you are using an older version of the code...  ::)

I realized I actually did check zero padding in the code, and fixed it a few hours ago.
"Make a man a fire, you keep him warm for a day. Set a man on fire, you keep him warm for the rest of his life."
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: texpage split and conversion script

Post by Giel »

[me=Giel]does "svn update" and :-X's up[/me]
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: texpage split and conversion script

Post by kage »

all ironic, because if i had known, i would've made zero-padded output. however, it's better that you don't check to make sure it's zero padded on load, because the only actual benefit to zero padding is that some directory listing sort algorithms won't sort numerically on that, meaning it's less human readable, and also makes per's original sh script work as well as it does. happily, sscanf works the way it does, though.
Post Reply