|
|
Chris Huff <chr### [at] maccom> wrote:
> In article <396419CD.2C632411@nospamthanks.hotmail.com>, Pabs
> <pab### [at] nospamthankshotmailcom> wrote:
>
> > It is not all that complex an app - you could propably rewrite it in
> > an hr or two for the Mac (if standard low level & stream I/O libs
> > exist on the Mac) Sorry Mark I didn't mean any offense but it is true
> > :)
Yes, those libs exist on the Mac, but for some mysterious reason(s) I
could not get the following to work:
fscanf(FileNum," %d , %d , %d \n", &XDim, &YDim, &ZDim);
The value of XDim was placed somewhere randomly in memory and not in the
location of XDdim. And before you ask: XDim is a 2 byte integer. I
actually didn't change anything in the source, except for the
windows/mac specific parts. Hmmm, I did rewrite the SaveFile() function
a bit so that fopen/fwrite are used there too.
But when I use this:
float a,b,c;
fscanf(FileNum," %f , %f , %f \n", &a, &b, &c);
XDim=a; YDim=b;ZDim=c;
everything is working.
Two possibilities:
1) I'm doing something wrong but I can't see what (I never used fscanf
or scanf before)
2) There is an error in the standard c libs of CodeWarrior (My guess)
> Probably true, for someone who knows what they are doing...however, I
am
> very inexperienced with file I/O. I have never written a program that
> used binary files, for example. And the only program I have written that
> takes file input was a particle simulator :-), which took a simple scene
> description as input. (standard C and C++ functions are available with
> all major development environments, BTW.)
Well, you probably never bothered to take a look at the PowerPlant
framework.
Especially to make such a simple application as df3Maker is, you will
find it easy to use. I had everything converted in about 15 minutes but
I had to search for that fscanf bug and that took me quite a bit longer
;-)
The only bit that is a bit more complicated is the part were you make a
full path out of a FSSpec.
I did a bit off cut and paste for that, it was already in MacMegaPov.
I should rewrite that bit, using more of PowerPlant but for some reason
I never get round to it.
Ok, you can download a small archive here:
http://users.skynet.be/smellenbergh/makedf3.sit
It contains the CW project and a ready to run application. I also added
the df3Maker internet page. Allowed?
Perhaps one day I add the function to make a df3 file out of 2or more
tga files. An explanation can be found at:
http://users.skynet.be/egelie/
Just look for the eruption entry for the irtc competition 'landmarks'.
Yvo Smellenbergh
--
e-mail:sme### [at] skynetbe
http://users.skynet.be/smellenbergh
Post a reply to this message
|
|