Hello
so, here's my problem:
I can build it perfectly on PC or Caanoo version (i use CodeBlocks).
On my PC it run properly, but on Caanoo, it crash ( black screen and return to Caanoo menu...)
(the problem is this fonction, if i remove it, it work.... but i need this fonction )
Thank you
(excuse my bad language, i'm french )
so, here's my problem:
Code:
void ChargementData()
{
FILE *fichier;
char chaine[200];
char *fin;
int i,j;
char temp[50];
float x,y,z;
int decalage=0;
fichier = fopen("donnees.txt","r");
do
{
fin=fgets(chaine,100,fichier);
if (!strncmp(chaine,"Vertex",6))
{
if (strncmp(chaine,"Vertex list",11))
{
i=0;
while(chaine[i]!='X') i++;
i+=2;
while(chaine[i]==' ') i++;
sscanf(chaine+i,"%f",&x);
while(chaine[i]!='Y') i++;
i+=2;
while(chaine[i]==' ') i++;
sscanf(chaine+i,"%f",&y);
while(chaine[i]!='Z') i++;
i+=2;
while(chaine[i]==' ') i++;
sscanf(chaine+i,"%f",&z);
Sommet[Nb_points].x=x;
Sommet[Nb_points].y=y;
Sommet[Nb_points].z=z;
Nb_points++;
}
}
else
{
if (!strncmp(chaine,"Face",4))
{
if (strncmp(chaine,"Face list",9))
{
i=j=0;
while(chaine[i]!='A') i++;
i+=2;
j=i;
while(chaine[j]!=' ') j++;
strncpy(temp,chaine+i,j-i);
temp[j-i]=0;
Facette[Nb_faces].a=atoi(temp)+decalage;
while(chaine[i]!='B') i++;
i+=2;
j=i;
while(chaine[j]!=' ') j++;
strncpy(temp,chaine+i,j-i);
temp[j-i]=0;
Facette[Nb_faces].b=atoi(temp)+decalage;
while(chaine[i]!='C') i++;
i+=2;
j=i;
while(chaine[j]!=' ') j++;
strncpy(temp,chaine+i,j-i);
temp[j-i]=0;
Facette[Nb_faces].c=atoi(temp)+decalage;
while(chaine[i]!='A') i++;
strncpy(temp,chaine+i+3,1);
temp[j-i]=0;
Facette[Nb_faces].ab=atoi(temp);
strncpy(temp,chaine+i+8,1);
temp[j-i]=0;
Facette[Nb_faces].bc=atoi(temp);
strncpy(temp,chaine+i+13,1);
temp[j-i]=0;
Facette[Nb_faces].ac=atoi(temp);
Nb_faces++;
}
}
else if (!strncmp(chaine,"Named object",12)) decalage=Nb_points;
}
} while(fin!=NULL);
fclose(fichier);
}
I can build it perfectly on PC or Caanoo version (i use CodeBlocks).
On my PC it run properly, but on Caanoo, it crash ( black screen and return to Caanoo menu...)
(the problem is this fonction, if i remove it, it work.... but i need this fonction )
Thank you
(excuse my bad language, i'm french )