-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobal.cpp
85 lines (69 loc) · 1.6 KB
/
Global.cpp
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
78
79
80
81
82
83
84
85
#include "Global.h"
//Private functions
void Global::initVariables()
{
float factorX = 1.0, factorY = 1.0;
this->wallWidth = 150;
this->videoMode = sf::VideoMode((888 )*factorX, 600*factorY);
sf::VideoMode bound = sf::VideoMode((888 - 2*wallWidth)*factorX, 600*factorY*0.915);
this->boundaries = sf::FloatRect(
videoMode.width/2.f - bound.width/2.f, //.left, aka PosX
0, //.top, aka PosY
bound.width, //.width
bound.height //.heght
);
this->cameraOfst = sf::Vector2f(0.f, 0.f);
}
//Constructors / Destructors
Global::Global()
{
this->initVariables();
}
Global::~Global()
{
}
//Accessors
sf::VideoMode Global::getScreenSize()
{
return this->videoMode;
}
void Global::setScreenSize(sf::VideoMode videoMode)
{
this->videoMode = videoMode;
}
sf::FloatRect Global::getBoundaries()
{
return this->boundaries;
}
void Global::setBoundaries(sf::FloatRect boundaries)
{
this->boundaries = boundaries;
}
sf::Vector2f Global::getMousePos()
{
return this->mousePosView;
}
void Global::setMousePos(sf::Vector2f mousePosView)
{
this->mousePosView = mousePosView;
}
sf::Vector2f Global::getCameraOfst()
{
return this->cameraOfst;
}
void Global::setCameraOfst(sf::Vector2f cameraOfst)
{
this->cameraOfst = cameraOfst;
}
sf::Event Global::getEvent()
{
return this->event;
}
void Global::setEvent(sf::Event event)
{
this->event = event;
}
float Global::getWallWidth()
{
return this->wallWidth;
}