ok I''m getting an assert on a function... it does when I go to return from the function... if I comment out a class(and all places its used) I don''t get an assert... I use the class all over the place yet it only does it in this one function... I''ve looked both the function and the class all over for memory leeks but I haven''t found anyways where....
the class is of the same kind as the class the function belongs to... I''m starting to get mad... anyways heres the function... if you need to see more then let me know...
bool CDrawSurface_0::Load(char*filename){
char id[3];
sdword bm_file_size;
sdword bm_off;
sword bbp;
sdword width;
sdword height;
char*data;
ifstream file;
file.open(filename,ios::in/ios::binary);
file.read(id,2);
id[2]=NULL;
if(strcmp(id,"BM"))
return false;
file.read((char*)&bm_file_size,sizeof(bm_file_size));
file.seekg(10,ios::beg);
file.read((char*)&bm_off,sizeof(bm_off));
file.seekg(18,ios::beg);
file.read((char*)&width,sizeof(width));
file.read((char*)&height,sizeof(height));
file.seekg(28,ios::beg);
file.read((char*)&bbp,sizeof(bbp));
data=new char[bm_file_size-bm_off];
file.seekg(bm_off,ios::beg);
file.read(data,bm_file_size-bm_off);
file.close();
CDrawSurface tsurf;
tsurf.Init(m_cdraw,width,height);
sdword s=0;
sdword ss=width*height*(bbp/8);
char*temp=new char[bm_file_size-bm_off];
switch(bbp){
case 16:
break;
case 24:
sdword s2=ss-3;
for(sdword s1=0;s1Lock(NULL,&tsurf.m_ddsd,DDLOCK_WAIT / DDLOCK_SURFACEMEMORYPTR,NULL)))
return false;
memcpy(tsurf.m_ddsd.lpSurface,data,ss);
if(Error(tsurf.m_surface->Unlock(NULL)))
return false;
if(!Blt(tsurf,0,0,m_width,m_height,0,0,width,height))
return false;
tsurf.Release();
delete[]data;
data=NULL;
ClearError();
return true;
}
if I click ignore it gives me another assert click ignore again and everything works perfectly from there on out...
Any Ideas?
Great Milenko
Words Of Wisdom:
"Never Stick A Pretzel In Your Butt It Might Break Off In There."
http://www.crosswinds.net/~milenko
http://www.crosswinds.net/~pirotech
The Great Milenko"Don't stick a pretzel up your ass, it might get stuck in there.""Computer Programming is findding the right wrench to hammer in the correct screw."