Could someone please help me sort out the conflicting types I'm suffering.
Code:
I have this function:
SDL_Rect sprite_getClipRect(Sprite *ptr_sprite, int col, int row)
{
return ptr_sprite->clip[col][row];
}
And I'm trying to use it here:
SDL_RenderCopy(renderer, sprite_getTexture(spaceship_sprite), &sprite_getClipRect(spaceship_sprite, 1, 0), &spaceship_rect);
The cheap fix i used was this:
SDL_Rect rect = sprite_getClipRect(spaceship_sprite, 1, 0);
SDL_RenderCopy(renderer, sprite_getTexture(spaceship_sprite), &rect, &spaceship_rect);
But I should not need to create this local variable.
But the return type: SDL_Rect doesn't seem to match the parameter demand of SDL_Rect* source.
int SDL_RenderCopy(SDL_Renderer* renderer,
SDL_Texture* texture,
const SDL_Rect* srcrect,
const SDL_Rect* dstrect)