SeaCreature is a class (Contains XPos,YPos, and Sprite, where Sprite is an instance of a class with the listed values and more.)
c:\usrsrc\cpp\cozSprite\SeaCreature.cpp(89) : error C2662: 'cozSprite::SpriteHeight' : cannot convert 'this' pointer from 'const cozSprite' to 'cozSprite &'PHP Code:
void SeaCreature::CheckPosition(const SeaCreature &enemy)
{
SDL_Rect thisRect, enemyRect, colRect;
thisRect.x = XPos;
thisRect.y = YPos;
thisRect.w = Sprite.SpriteWidth();
thisRect.h = Sprite.SpriteHeight();
enemyRect.x = enemy.XPos;
enemyRect.y = enemy.YPos;
enemyRect.w = enemy.Sprite.SpriteWidth();
enemyRect.h = enemy.Sprite.SpriteHeight();
...
}
the lines:
enemyRect.w = enemy.Sprite.SpriteWidth();
enemyRect.h = enemy.Sprite.SpriteHeight();
gave me two compile-time errors.
I need to be able to modify enemy (if at all possible, so i used the & symbol)
Thanks.. I've gotta get some rest