There's quite a bit of code, so I put it all on my github. (cpp files are on /src, hpp files are on /include)
This is probably really simple, but since I'm new to C++ I'm not realizing how to get there.
So I have a few textures on my project already, a background texture that occupies the whole application (640x480), some floor tiles (64x64) and a player texture, which is where I have my issue.
I wanted to make my player texture something other than 64x64, maybe 86x86 or something similar, but not 64x64.
The problem is that the tutorial basically taught me to hard code the texture size to 64x64, which you can see in this little snippet of Entity.cpp.
Entity::Entity(Vector2f p_pos, SDL_Texture* p_tex)
:pos(p_pos), tex(p_tex)
{
currentFrame.x = 0;
currentFrame.y = 0;
currentFrame.w = 64;
currentFrame.h = 64;
}
Is there any way I can let this accept different values? The problem really starts to show when I set my player texture to (for example) 86x86 on Photoshop and insert it into the code.
The player is that yellow thing, I added a face so you can understand that it's cut off, because the program is cropping it to a 64x64 square, which I do not want.
I've tried adding a new size variable to my Entity class (which already had the position variable), but due to me not being very good at the language, I didn't manage to make it work, as it gave me a lot of errors stating that it basically had no idea what that size variable was and its purpose.