Skip to content

Commit 6d60144

Browse files
committed
Convert indentation to spaces
1 parent 0a7c91f commit 6d60144

4 files changed

Lines changed: 192 additions & 192 deletions

File tree

engine/core/Scene.cpp

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -20,174 +20,174 @@
2020
using namespace Supernova;
2121

2222
Scene::Scene(){
23-
registerSystem<ActionSystem>();
24-
registerSystem<MeshSystem>();
25-
registerSystem<UISystem>();
26-
registerSystem<RenderSystem>();
27-
registerSystem<PhysicsSystem>();
28-
registerSystem<AudioSystem>();
23+
registerSystem<ActionSystem>();
24+
registerSystem<MeshSystem>();
25+
registerSystem<UISystem>();
26+
registerSystem<RenderSystem>();
27+
registerSystem<PhysicsSystem>();
28+
registerSystem<AudioSystem>();
2929

30-
camera = NULL_ENTITY;
31-
defaultCamera = NULL_ENTITY;
30+
camera = NULL_ENTITY;
31+
defaultCamera = NULL_ENTITY;
3232

33-
backgroundColor = Vector4(0.0, 0.0, 0.0, 1.0); //sRGB
34-
shadowsPCF = true;
33+
backgroundColor = Vector4(0.0, 0.0, 0.0, 1.0); //sRGB
34+
shadowsPCF = true;
3535

36-
lightState = LightState::AUTO;
37-
globalIllumColor = Vector3(1.0, 1.0, 1.0);
38-
globalIllumIntensity = 0.1;
36+
lightState = LightState::AUTO;
37+
globalIllumColor = Vector3(1.0, 1.0, 1.0);
38+
globalIllumIntensity = 0.1;
3939

40-
enableUIEvents = true;
40+
enableUIEvents = true;
4141
}
4242

4343
Scene::~Scene(){
44-
destroy();
44+
destroy();
4545
}
4646

4747
void Scene::setCamera(Camera* camera){
48-
setCamera(camera->getEntity());
48+
setCamera(camera->getEntity());
4949
}
5050

5151
void Scene::setCamera(Entity camera){
52-
if (findComponent<CameraComponent>(camera)){
53-
this->camera = camera;
54-
if (defaultCamera != NULL_ENTITY){
55-
destroyEntity(defaultCamera);
56-
defaultCamera = NULL_ENTITY;
57-
}
58-
}else{
59-
Log::error("Invalid camera entity: need CameraComponent");
60-
}
52+
if (findComponent<CameraComponent>(camera)){
53+
this->camera = camera;
54+
if (defaultCamera != NULL_ENTITY){
55+
destroyEntity(defaultCamera);
56+
defaultCamera = NULL_ENTITY;
57+
}
58+
}else{
59+
Log::error("Invalid camera entity: need CameraComponent");
60+
}
6161
}
6262

6363
Entity Scene::getCamera() const{
64-
return camera;
64+
return camera;
6565
}
6666

6767
Entity Scene::createDefaultCamera(){
68-
defaultCamera = createEntity();
69-
addComponent<CameraComponent>(defaultCamera, {});
70-
addComponent<Transform>(defaultCamera, {});
68+
defaultCamera = createEntity();
69+
addComponent<CameraComponent>(defaultCamera, {});
70+
addComponent<Transform>(defaultCamera, {});
7171

72-
CameraComponent& camera = getComponent<CameraComponent>(defaultCamera);
73-
camera.type = CameraType::CAMERA_2D;
74-
camera.transparentSort = false;
72+
CameraComponent& camera = getComponent<CameraComponent>(defaultCamera);
73+
camera.type = CameraType::CAMERA_2D;
74+
camera.transparentSort = false;
7575

76-
Transform& cameratransform = getComponent<Transform>(defaultCamera);
77-
cameratransform.position = Vector3(0.0, 0.0, 1.0);
76+
Transform& cameratransform = getComponent<Transform>(defaultCamera);
77+
cameratransform.position = Vector3(0.0, 0.0, 1.0);
7878

79-
return defaultCamera;
79+
return defaultCamera;
8080
}
8181

8282
void Scene::setBackgroundColor(Vector4 color){
83-
this->backgroundColor = color;
83+
this->backgroundColor = color;
8484
}
8585

8686
void Scene::setBackgroundColor(float red, float green, float blue){
87-
setBackgroundColor(Vector4(red, green, blue, 1.0));
87+
setBackgroundColor(Vector4(red, green, blue, 1.0));
8888
}
8989

9090
void Scene::setBackgroundColor(float red, float green, float blue, float alpha){
91-
setBackgroundColor(Vector4(red, green, blue, alpha));
91+
setBackgroundColor(Vector4(red, green, blue, alpha));
9292
}
9393

9494
Vector4 Scene::getBackgroundColor() const{
95-
return backgroundColor;
95+
return backgroundColor;
9696
}
9797

9898
void Scene::setShadowsPCF(bool shadowsPCF){
99-
if (this->shadowsPCF != shadowsPCF){
100-
this->shadowsPCF = shadowsPCF;
101-
getSystem<RenderSystem>()->needReloadMeshes();
102-
}
99+
if (this->shadowsPCF != shadowsPCF){
100+
this->shadowsPCF = shadowsPCF;
101+
getSystem<RenderSystem>()->needReloadMeshes();
102+
}
103103
}
104104

105105
bool Scene::isShadowsPCF() const{
106-
return this->shadowsPCF;
106+
return this->shadowsPCF;
107107
}
108108

109109
void Scene::setLightState(LightState state){
110-
if (this->lightState != state){
111-
this->lightState = state;
112-
getSystem<RenderSystem>()->needReloadMeshes();
113-
}
110+
if (this->lightState != state){
111+
this->lightState = state;
112+
getSystem<RenderSystem>()->needReloadMeshes();
113+
}
114114
}
115115

116116
LightState Scene::getLightState() const{
117-
return this->lightState;
117+
return this->lightState;
118118
}
119119

120120
void Scene::setGlobalIllumination(float intensity, Vector3 color){
121-
this->globalIllumIntensity = intensity;
122-
this->globalIllumColor = Color::sRGBToLinear(color);
121+
this->globalIllumIntensity = intensity;
122+
this->globalIllumColor = Color::sRGBToLinear(color);
123123
}
124124

125125
void Scene::setGlobalIllumination(float intensity){
126-
this->globalIllumIntensity = intensity;
126+
this->globalIllumIntensity = intensity;
127127
}
128128

129129
void Scene::setGlobalIllumination(Vector3 color){
130-
this->globalIllumColor = Color::sRGBToLinear(color);
130+
this->globalIllumColor = Color::sRGBToLinear(color);
131131
}
132132

133133
float Scene::getGlobalIlluminationIntensity() const{
134-
return this->globalIllumIntensity;
134+
return this->globalIllumIntensity;
135135
}
136136

137137
Vector3 Scene::getGlobalIlluminationColor() const{
138-
return Color::linearTosRGB(this->globalIllumColor);
138+
return Color::linearTosRGB(this->globalIllumColor);
139139
}
140140

141141
Vector3 Scene::getGlobalIlluminationColorLinear() const{
142-
return this->globalIllumColor;
142+
return this->globalIllumColor;
143143
}
144144

145145
bool Scene::canReceiveUIEvents(){
146-
if (Engine::getLastScene() == this && this->enableUIEvents){
147-
return true;
148-
}
149-
return false;
146+
if (Engine::getLastScene() == this && this->enableUIEvents){
147+
return true;
148+
}
149+
return false;
150150
}
151151

152152
bool Scene::isEnableUIEvents() const{
153-
return this->enableUIEvents;
153+
return this->enableUIEvents;
154154
}
155155

156156
void Scene::setEnableUIEvents(bool enableUIEvents){
157-
this->enableUIEvents = enableUIEvents;
157+
this->enableUIEvents = enableUIEvents;
158158
}
159159

160160
void Scene::load(){
161-
if (camera == NULL_ENTITY){
162-
camera = createDefaultCamera();
163-
}
164-
165-
for (auto const &pair: systems) {
166-
if (Engine::isViewLoaded()){
167-
pair.second->load();
168-
}
169-
}
161+
if (camera == NULL_ENTITY){
162+
camera = createDefaultCamera();
163+
}
164+
165+
for (auto const &pair: systems) {
166+
if (Engine::isViewLoaded()){
167+
pair.second->load();
168+
}
169+
}
170170
}
171171

172172
void Scene::destroy(){
173-
for (auto const& pair : systems){
174-
pair.second->destroy();
175-
}
173+
for (auto const& pair : systems){
174+
pair.second->destroy();
175+
}
176176
}
177177

178178
void Scene::draw(){
179-
for (auto const& pair : systems){
180-
pair.second->draw();
181-
}
179+
for (auto const& pair : systems){
180+
pair.second->draw();
181+
}
182182
}
183183

184184

185185
void Scene::update(double dt){
186-
for (auto const& pair : systems){
187-
pair.second->update(dt);
188-
}
186+
for (auto const& pair : systems){
187+
pair.second->update(dt);
188+
}
189189
}
190190

191191
void Scene::updateSizeFromCamera(){
192-
getSystem<RenderSystem>()->updateCameraSize(getCamera());
192+
getSystem<RenderSystem>()->updateCameraSize(getCamera());
193193
}

0 commit comments

Comments
 (0)