GRF-Codec for Mac?

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

Moderator: Graphics Moderators

Post Reply
DonRazzi
Traffic Manager
Traffic Manager
Posts: 216
Joined: 07 Sep 2006 21:44
Location: Western Germany, KBS 395

GRF-Codec for Mac?

Post by DonRazzi »

Hi,

just a singel question:

Is there any solution to generate a .grf on a (PPC) Mac running OS X 10.4?

Greets,

DonRazzi
Best OTTD Screenshots in 2007 !!! Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: GRF-Codec for Mac?

Post by DaleStan »

Yes. Download the source (svn co svn://svn.ttdpatch.net/misc/grfcodec) and compile it yourself (make grfcodec).

I'm told it works, but I have no Mac on which to test.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
DonRazzi
Traffic Manager
Traffic Manager
Posts: 216
Joined: 07 Sep 2006 21:44
Location: Western Germany, KBS 395

Re: GRF-Codec for Mac?

Post by DonRazzi »

Damnit... I don't have the developers stuff installed on my machnine. Where's the hero with the Quad Core Mac Pro or Power Mac G5 to do this little job for me?

Greets,

Don
Best OTTD Screenshots in 2007 !!! Image Image
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5656
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: GRF-Codec for Mac?

Post by andythenorth »

DaleStan wrote:Yes. Download the source (svn co svn://svn.ttdpatch.net/misc/grfcodec) and compile it yourself (make grfcodec).
I got a friend (who I trust as a programmer) to compile grfcodec for Mac. I have an Intel Mac running OS X Leopard (10.5.4). However when I try grfcodec -d foobar.grf, I get an error, 'Offset too large'. I've tried a range of different grfs. Very possibly I need to read the instructions again, however if anyone has an insight into potential fixes, it would be much appreciated.

If it helps, I think I would be allowed within the terms of GPL to post the compiled version here, but I'd need to check the Grfcodec notes & forum rules before doing so.

cheers,

Andy
grf_codec_error.png
grf_codec_error.png (9.92 KiB) Viewed 4199 times
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: GRF-Codec for Mac?

Post by DaleStan »

I expect that means that the endianness detection broke. If you're compiling for Intel, make sure it's compiled with __BIG_ENDIAN__ undefined, or provide a patch that makes the #ifdef __BIG_ENDIAN__ lines do the right thing.

Also, that's version 1854E. That "E" means that your friend did not compile a pristine checkout. Likely it's just makefile changes, but check to make sure.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5656
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: GRF-Codec for Mac?

Post by andythenorth »

DaleStan wrote:I expect that means that the endianness detection broke. If you're compiling for Intel, make sure it's compiled with __BIG_ENDIAN__ undefined, or provide a patch that makes the #ifdef __BIG_ENDIAN__ lines do the right thing.

Also, that's version 1854E. That "E" means that your friend did not compile a pristine checkout. Likely it's just makefile changes, but check to make sure.
Ok, thanks, for the analysis. Unfortunately I can't provide a time estimate on when I might twist an arm to try compiling again for Mac (and patching if necessary).

cheers,

Andy
User avatar
lobster
Tycoon
Tycoon
Posts: 5667
Joined: 21 Dec 2003 23:30
Location: Atlantic Ocean
Contact:

Re: GRF-Codec for Mac?

Post by lobster »

Intel mac? get CrossOver (6 or 7) and run grfcodec in a windows 2k bottle. no sweat, easy-peasy.
"Your mother was a lobster, and your father... was also a lobster" -- The rascal formerly known as astath -- Last.fm -- Official TT-Dave Worley Fan Club

Image

<orudge> make love to me while I surf, dear lobster
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5656
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: GRF-Codec for Mac?

Post by andythenorth »

lobster wrote:Intel mac? get CrossOver (6 or 7) and run grfcodec in a windows 2k bottle. no sweat, easy-peasy.
Thanks - great idea, I'll give it a go. That, or I'll try putting a Linux VM in VMWare (I neither have nor want to buy a spare Windows license).

Would be nice to have grfcodec compiled for Mac and working, but that's beyond my current abilities (or spare time).
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: GRF-Codec for Mac?

Post by DaleStan »

I think it should run in wine/darwine too.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5656
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: GRF-Codec for Mac?

Post by andythenorth »

andythenorth wrote:
lobster wrote:Intel mac? get CrossOver (6 or 7) and run grfcodec in a windows 2k bottle. no sweat, easy-peasy.
Good news - I can confirm that grfcodec will work with Crossover (using Intel Macbook, OS X 10.5 Leopard) - at least for decoding a simple grf. I can't resist showing the results - this is a decode of a test grf for Heavy Equipment:
hts.png
hts.png (5.24 KiB) Viewed 3693 times
Mac users can find Crossover at http://www.codeweavers.com/
Grfcodec is found at http://www.ttdpatch.net/grfcodec/grfcodec.html

To use, I created a Win 2000 bottle called Grfcodec (following the easy instructions provided with Crossover).

This will provide a windows-like folder structure
"~/Library/Application Support/CrossOver/Bottles/Grfcodec/drive_c/Program\ Files"

There may be alternative methods, but I placed the grfcodec.exe, grfdiff.exe and grfmerge.exe into the Program Files folder at the path above. I also placed the grf to be decoded in the same folder.

To run grfcodec go to the "Programs" menu in Crossover, and chose "Run Command...". Use "Browse..." to find grfcodec.exe. This will place the path to grfcodec into the text input box, in double quote marks. Place the grfcodec options (such as -d) outside the quote marks. Then place the path to the grf after the options, again in quote marks.

It might be handy if this info could be added to the grfcodec page? My instructions might not be the clearest - I'm winging it slightly. Seems to work though.

Thanks for the tip, now I have NO excuses not to learn NFO.

cheers,

Andy
Absolutis
Transport Coordinator
Transport Coordinator
Posts: 356
Joined: 16 Oct 2009 17:39

Re: GRF-Codec for Mac?

Post by Absolutis »

That's too expensive for just GRFCodec use.
ImageImage
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: GRF-Codec for Mac?

Post by Rubidium »

Absolutis wrote:That's too expensive for just GRFCodec use.
Then use the cheap solution: http://www.openttd.org/download-grfcodec
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: Google Adsense [Bot] and 6 guests