-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphics.cpp
More file actions
77 lines (70 loc) · 1.5 KB
/
Graphics.cpp
File metadata and controls
77 lines (70 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "Graphics.hpp"
using namespace std;
void Graphics::draw(int x, int y)
{
moverRect = {x, y, srcRect.w, srcRect.h};
SDL_RenderCopy(Drawing::gRenderer, Drawing::assets, &srcRect, &moverRect); // drawing the object
}
Graphics::Graphics() {}
SDL_Rect Graphics::get_src_rect()
{
return srcRect;
}
SDL_Rect Graphics::get_mover_rect()
{
return moverRect;
}
void Graphics::set_src_rect(int x, int y, int w, int h)
{
Graphics::set_src_rect_x(x);
Graphics::set_src_rect_y(y);
Graphics::set_src_rect_size(w, h);
}
void Graphics::set_mover_rect(int x, int y, int w, int h)
{
Graphics::set_mover_rect_x(x);
Graphics::set_mover_rect_y(y);
Graphics::set_mover_rect_size(w, h);
}
void Graphics::set_src_rect_size(int w, int h)
{
Graphics::set_src_rect_w(w);
Graphics::set_src_rect_h(h);
}
void Graphics::set_mover_rect_size(int w, int h)
{
Graphics::set_mover_rect_w(w);
Graphics::set_mover_rect_h(h);
}
void Graphics::set_src_rect_x(int x)
{
srcRect.x = x;
}
void Graphics::set_src_rect_y(int y)
{
srcRect.y = y;
}
void Graphics::set_src_rect_w(int w)
{
srcRect.w = w;
}
void Graphics::set_src_rect_h(int h)
{
srcRect.h = h;
}
void Graphics::set_mover_rect_x(int x)
{
moverRect.x = x;
}
void Graphics::set_mover_rect_y(int y)
{
moverRect.y = y;
}
void Graphics::set_mover_rect_w(int w)
{
moverRect.w = w;
}
void Graphics::set_mover_rect_h(int h)
{
moverRect.h = h;
}