osx, command line and making pngs

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
seanth
Posts: 12
Joined: Thu Feb 08, 2007 12:09 pm

osx, command line and making pngs

Post by seanth »

Hi-

I have a number of cfdg files (over 100 files) that I want to make into pngs so I can make an animation. With OSX, is there a way to pass arguments to context free to tell it to render a given .cfdg file to a .png?

Edit:

Essentially I am trying to do this with osx vs other *nixs:
cfdg ziggy_flowers.cfdg -z -a 20 output.png
(found this in another thread)

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

If you have XCode installed then you should be able to cd to the directory with the source tree and type 'make cfdg'.

User avatar
dz79
Posts: 4
Joined: Fri Oct 14, 2005 12:06 am
Location: St. Louis, MO, USA
Contact:

Success!

Post by dz79 »

I've been trying to do this, too, as I'd like to be able to script creating PNGs in bulk. It took my a while to figure out how to do this. It wasn't quite as simple as MtnViewJohn makes it out to be ;)

(I did have XCode pre-installed.)

First, I used DarwinPorts (now MacPorts) to install libpng:

Code: Select all

sudo port install libpng 
--->  Fetching zlib
--->  Attempting to fetch zlib-1.2.3.tar.bz2 from http://www.zlib.net/
--->  Verifying checksum(s) for zlib
--->  Extracting zlib
--->  Applying patches to zlib
--->  Configuring zlib
--->  Building zlib with target all
--->  Staging zlib into destroot
--->  Installing zlib 1.2.3_1
--->  Activating zlib 1.2.3_1
--->  Cleaning zlib
--->  Fetching libpng
--->  Attempting to fetch libpng-1.2.18.tar.bz2 from http://downloads.sourceforge.net/libpng
--->  Verifying checksum(s) for libpng
--->  Extracting libpng
--->  Configuring libpng
--->  Building libpng with target all
--->  Staging libpng into destroot
--->  Installing libpng 1.2.18_0+darwin_8
--->  Activating libpng 1.2.18_0+darwin_8
--->  Cleaning libpng
Then I edited the "Makefile" so that the line

Code: Select all

       $(LINK.o) $^ -L/usr/local/lib -lstdc++ -lpng -lz -fexceptions -o $@
now reads

Code: Select all

        g++ $^ -L/usr/local/lib -lstdc++ -L/opt/local/lib -lpng -lz -fexceptions -o $@
And I edited the file "src-unix/pngCanvas.cpp" such that the line

Code: Select all

#include "png.h"
became

Code: Select all

#include "/opt/local/include/libpng12/png.h"
Everything was hunky dory then...

Yeah! Tight!

Post Reply