30 lines
538 B
C++
30 lines
538 B
C++
|
#include "global.hpp"
|
||
|
|
||
|
|
||
|
void drawQuad ( SDL_Surface * screen, short int x, short int y, int color )
|
||
|
{
|
||
|
SDL_Rect rect = {x, y, SIZE, SIZE};
|
||
|
|
||
|
SDL_FillRect ( screen, &rect, color );
|
||
|
}
|
||
|
|
||
|
void apply_surface ( int x, int y, SDL_Surface * source, SDL_Surface * destination, SDL_Rect * clip )
|
||
|
{
|
||
|
//Holds offsets
|
||
|
SDL_Rect offset;
|
||
|
|
||
|
//Get offsets
|
||
|
offset.x = x;
|
||
|
offset.y = y;
|
||
|
|
||
|
//Blit
|
||
|
SDL_BlitSurface ( source, clip, destination, &offset );
|
||
|
}
|
||
|
|
||
|
SDL_Color make_color ( Uint8 r, Uint8 g, Uint8 b )
|
||
|
{
|
||
|
SDL_Color color = {r, g, b};
|
||
|
|
||
|
return color;
|
||
|
}
|