PDA

View Full Version : 3ds file loading



Vlasko
10-16-2003, 10:31 AM
I'm trying to make a 3ds loader file but it seems to have difficulties dealing with chunk 0x4000 - it contains name of object.

code
FILE *file;
unsigned char temp1;
case 0x4000 :
do
{
fread(&temp1,1,1,file);
i++;
}while(temp1!='\0');
break;
It doesn't recognise the \0 sign what wrong?

10-19-2003, 03:04 AM
Well i use a ReadString function to do that when 0x4000 chunk is found, try it !




void ReadString(FILE *f,char name[255])
{
char c[2];

c[1]='\0';

while ( (c[0] = fgetc(f)) != EOF && c[0] != '\0') strcat(name,c);
}


taked in the Panard Vision 3ds loader.
Hope that's help.