Consider this:
When m_pRast blits this for the third time, it actually Blits nothing to m_pRast - at least, then blitting m_pRast's target surface to the display doesn't display anything.
HOWEVER, doing this:
Means it now works perfectly, but only when the additional CreateSurface call makes a surface similar to the dimensions shown.
This most probably isn't a bug in PF, but it's beat me, and none of my debugging is getting anywhere (takes me right into assembler). Anyone know what could cause this? I'm quite sure it's some pointer botching somewhere, but wondered if anyone else had a better understanding of why creating an unrelated surface before the blit would cause the blit to succeed.
- Code:
Surface * src = 0;
if(state > 0)
src = m_pBubbleType->getPopped(abs(state) - 1, true);
else if(state < 0)
src = m_pBubbleType->getNormal(abs(state) - 1, true);
if(src != 0)
m_pRast->Blit(pos.x, pos.y, src);
When m_pRast blits this for the third time, it actually Blits nothing to m_pRast - at least, then blitting m_pRast's target surface to the display doesn't display anything.
HOWEVER, doing this:
- Code:
Surface * src = 0;
if(state > 0)
src = m_pBubbleType->getPopped(abs(state) - 1, true);
else if(state < 0)
src = m_pBubbleType->getNormal(abs(state) - 1, true);
Display->CreateSurface(216, 64); // EXTRA LINE!
if(src != 0)
m_pRast->Blit(pos.x, pos.y, src);
Means it now works perfectly, but only when the additional CreateSurface call makes a surface similar to the dimensions shown.
This most probably isn't a bug in PF, but it's beat me, and none of my debugging is getting anywhere (takes me right into assembler). Anyone know what could cause this? I'm quite sure it's some pointer botching somewhere, but wondered if anyone else had a better understanding of why creating an unrelated surface before the blit would cause the blit to succeed.