YAY for Vacuus! Will be fun going though your code and helping you out. I'll answer your questions, if I can, after I've gone through your code.
EDIT: ok I think I can help with the concat string after a little googling.
Okay we'll pretend that we are passing the following information to the function:
concatstring("jelly", "fish");
Now here is what concatstring does with that:
//turns the two incoming values into szTarget[] and szSource[]
void concatstring(char szTarget[], char szSource[]) {
//now it makes the size of the szTarget array equal to target index //which starts off at zero.
int targetindex=0; while(szTarget[targetindex]) { targetindex++; }
//after this little code block targetindex will hold the size of the //value we sent to szTarget +1, so targetindex = 6
//Now this takes sztarget[targetindex] which is the end of "jelly" //and adds szsource[sourceindex] from it's start until it has got to the end, in this case it will stop just after "fish"
int sourceindex=0; while(szsource[sourceindex]) { sztarget[targetindex]=szsource[sourceindex]; targetindex++; sourceindex++ } sztarget[targetindex]='\0'; //some null termination thing :D }
So if you wanted to put a "-" in between to strings you would just do something like this:
concatstring(strFirst, "-");
then you would do this
concat(strFirst, strSecond);
Did I explaing it well? This is the page I found it on http://forums.devarticles.com/t9471/s.html
I'll get back to you on your game's source. Do you understand it now?
|