Hi all,
I'M using VS.net 2003.
I'm following my code and at some point I found that the test I'M doing seems to not work at all...
Code:
if ( false == true )
{
m_Type = GL_RGB;
m_NbComp = 3;
}
It's going in the m_Type = GL_RGB, and so on...
It's an importer from 3dsmax, one model was working good, I made some changes and it stop working, because of the lines over...
On the other model, it was the new that was crashing. Both are crashing around almost the same code, maybe the error is linked.
Here's the code before my function :
Code:
//In the main
char* ImportFileName = "gob.amd";
printf("%s\n",ImportFileName);
if( data.m_Modele.Creer(ImportFileName) )
.
.
.
// In the m_Modele.Creer Function
if (Withalpha)
{
monomat->m_Tex = new Texture(TextureName,TexAlphaName,false,true);
}
else
{
monomat->m_Tex = new Texture(TextureName,true);
}
//
Texture::Texture(const char * File, Boolean GenID)
: m_Type(0), m_NbComp(0), m_Height(0), m_Width(0), m_ID(-1), m_Texels(NULL)
{
Creer(File,GenID);
}
//Now the place that it is crashing
void Texture::Creer(const char * File, Boolean GenID)
{
if (m_Type)
Detruire();
BMP_24bits BMP;
bool loadOk = LoadBMP(BMP,File);
loadOk = false;
if ( loadOk ) // false == true is entering here
{
m_Type = GL_RGB;
m_NbComp = 3;
.
.
.
}
//This function return false because file dosen't exist.
Boolean LoadBMP(BMP_24bits & BMP, const char * BMPFileName)
{
FILE *fichier;
unsigned char Header[0x36];
unsigned int DataPos,DataSize;
int Components;
long NbPixels;
int rest,i,offset;
unsigned int linesize;
//Read file and header
fichier = fopen(BMPFileName,"rb");if (!fichier) return false;
.
.
.
}
I don't know what to search in the MSDN, this bug is too weird!
By the way, I've rebuild all my code just to be sure that it wasn't a bad compilation problem.
Thanx for the help!