This works on linux...but why not windows?
I am trying to get a game I've been working on for linux to run on windows. It is all compiling ok but when I try and read in the quake to models, fseek is failing to read all the data on the windows build.
using the following code
Code:
if ( fseek( fp, model_header->offset_triangles, SEEK_SET ) == 0 ) {
if (( model->nr_triangles = fread( model->triangle,
sizeof(*model->triangle), model_header->nr_triangles, fp ))
!= model_header->nr_triangles ) {
fprintf( stderr,"Error reading triangles from model file (%d).\n", model->nr_triangles );
return NULL;
}
}
the value for model_header->nr_triangles is correct but the value that fread returns is not it and the app is failing with the error message.
This works fine on the linux build... is windows different or is my code bad?