Hello all. New to the forum.
So here's the deal:
I have 2 classes: SpriteManager and Sprite. SpriteManager stores a bunch of sprites in an std::vector<Sprite>. Sprite has the following code in it's constuctor:
Sprite::Sprite(char* imagePath, int index):m_index(index+1) {
dbLoadImage(imagePath,m_index);
dbSprite(m_index,dbScreenWidth(),dbScreenHeight(),m_index);
m_Rect.top = dbScreenHeight();
m_Rect.bottom = dbScreenHeight() + dbGetImageHeight(m_index);
m_Rect.left = dbScreenWidth();
m_Rect.right = dbScreenWidth() + dbGetImageHeight(m_index);
m_width = m_Rect.right - m_Rect.left;
m_height = m_Rect.bottom - m_Rect.top;
}
So here's the thing. I have my images in the same directory as my code files (has been working in the past, don't know if that's completely correct or not.) In the code above, if I call dbImageExist() or dbSpriteExist() IN THAT METHOD, then they return 1. Funny thing is,
as soon as that method returns and I jump back once in the call stack, it returns zero.
WTF? Why would just stepping up once in the call stack suddenly kill the image? Is there some sort of insane scope issue going on here?
Thanks for any help - Sven
2A6X1B