Hi! I'm still using PF 0.7 and encountered a strnge behavor last night.
During initialization i created custom surface:
After that i fill it with stupid looking rectangles
And, after DrawLevel() any attempt to call LoadImage() results in out of memory error in release and
HEAP[GalaxyGate.exe]: HEAP: Free Heap block e4d4e8 modified at e4d4f8 after it was freed message in debug. What's wrong?
During initialization i created custom surface:
- Code:
drawpic= m_pDD->CreateSurface(110,130);
drawpic->SetColorMask(Color(0,0,0));
After that i fill it with stupid looking rectangles
- Code:
void DrawLevel(int l)
{
m_pDD->SetRenderTarget(drawpic);
std::vector<_level>::iterator Lev_It=m_pState->Levels.begin()+l;
for(int x=0;x<11;x++)
for(int y=0;y<13;y++)
{
switch((*Lev_It).map[x][y])
{
case 1:
m_pDD->DrawRect(x*10,y*10,x*10+10,y*10+10,Color(0,0,0));
m_pDD->FillRect(x*10+1,y*10+1,x*10+9,y*10+9,Color(255,0,0));
break;
case 2:
m_pDD->DrawRect(x*10,y*10,x*10+10,y*10+10,Color(0,0,0));
m_pDD->FillRect(x*10+1,y*10+1,x*10+9,y*10+9,Color(0,255,0));
break;
case 3:
m_pDD->DrawRect(x*10,y*10,x*10+10,y*10+10,Color(0,0,0));
m_pDD->FillRect(x*10+1,y*10+1,x*10+9,y*10+9,Color(0,0,255));
break;
case 4:
m_pDD->DrawRect(x*10,y*10,x*10+10,y*10+10,Color(0,0,0));
m_pDD->FillRect(x*10+1,y*10+1,x*10+9,y*10+9,Color(255,255,0));
break;
default:
m_pDD->DrawRect(x*10,y*10,x*10+10,y*10+10,Color(0,0,0));
m_pDD->FillRect(x*10+1,y*10+1,x*10+9,y*10+9,Color(128,128,128));
break;
};
}
m_pDD->Update();
m_pDD->SetRenderTarget(0);
};
And, after DrawLevel() any attempt to call LoadImage() results in out of memory error in release and
HEAP[GalaxyGate.exe]: HEAP: Free Heap block e4d4e8 modified at e4d4f8 after it was freed message in debug. What's wrong?