It is, indeed.
The problem appears when I try to access them in the same class, in
void drawTile()
method, and in
class Equipment : public Textures
class with this
void drawEq(sf::RenderWindow & okno, int eqOriginX, int eqOriginY, float cameraX, float cameraY)
{
for(int i=0; i<4; i++)
{
for(int j=0; j<7; j++)
{
drawTile(okno, 1, eqContainer[ i ][ j ], cameraX+eqOriginX+i*50, cameraY+eqOriginY+j*50); //(rendered window, tileType, tileID- from array, somewhereX, somewhereY)
}
}
}
method.
Aren't sprites global objects? If so, how should I pass them by reference to any other function?
I've got them loaded in
cTex object of
Texture class, so from my main function it would be like this? (passing)
some_function(cTex.sprWeapon1h, cTex.texWeapon1h)
and receiving
some_function(vector<sf::Sprite> & sprites, vector<sf::Texture> & textures)
Is the size of vectors saved anyway? I mean, should I use them as usual after this operation?
Ad ps: It's yet simplified code, but I'll take it into account.