Calculator Community > Calculator C

[TIGCC] 68k C

<< < (2/15) > >>

Liazon:
So I should think of C functions as calls, except I have to pass all the pointers for all the data I want to change using the function.  Can I write a function that checks the state of something and then return 0 if false, 1 if true?

So
if (myfunction(&x,&y,&z)=0){
}

But that would probably be really ineffcient right?  How many functions are there in a good 68k C game?  How many of them are inline.  Can you use inline with code like the above?

Ranman:
QUOTE So I should think of C functions as calls,
Yes.

QuoteBegin-->QUOTE except I have to pass all the pointers for all the data I want to change using the function.
Yes. If you want the function to actually modify the data. This is called "passing by reference". If you just want the function to use the data, you can pass in the actual value. This is called "passing by value".

QuoteBegin-->QUOTE Can I write a function that checks the state of something and then return 0 if false, 1 if true?

So
if (myfunction(&x,&y,&z)=0){
}

Yes... See, you are getting the hang of it!

QuoteBegin-->QUOTE But that would probably be really ineffcient right?

Liazon:
By the way, how do you tile map the Ti-89Ti's 100x160 pixel screen?

What are the dimensions (#rows,#columns) of your tiles?  What are the dimensions of the sprites?

At first I was thinking of using 10x16 tiles and 20x16 tiles, but I'm not sure if that'd work.

DJ Omnimaga:
arent tiles clipped in 68k C so you can use 16x16 ones even if they dont fit the screen? Because I saw games liek Zelda using 16x16 sprites with no problem on the 160x100 screen

Liazon:
I thought you had to combine the routines with bit manipulations to get clipped sprites.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version