Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/Scenes/MainScene/MainScene.cpp

Diff revisions: vs.
  @@ -24,8 +24,8 @@
24 24 0.25f + _sun_cosy * 0.75f);
25 25
26 26 _sun->setDirection(_sunvector);
27 - _sun->setDiffuseColor(_sunColor);
28 - _currentSky->getNode<Sky>()->setSunProperties(_sunvector, _sunColor);
27 + _sun->setDiffuseColor(_sunColor);
28 + _currentSky->getNode<Sky>()->setSunProperties(_sunvector, _sunColor);
29 29 for(SceneGraphNode* const ter : _visibleTerrains){
30 30 ter->getComponent<RenderingComponent>()->getMaterialInstance()->setAmbient(_sunColor);
31 31 }
  @@ -91,7 +91,7 @@
91 91 D32 SunDisplay = getSecToMs(1.50);
92 92 if (_taskTimers[0] >= SunDisplay){
93 93 _sunAngle.y += 0.0005f;
94 - _sunvector = vec4<F32>( -cosf(_sunAngle.x) * sinf(_sunAngle.y),
94 + _sunvector = vec4<F32>( -cosf(_sunAngle.x) * sinf(_sunAngle.y),
95 95 -cosf(_sunAngle.y),
96 96 -sinf(_sunAngle.x) * sinf(_sunAngle.y),
97 97 0.0f );
  @@ -107,11 +107,11 @@
107 107 bool loadState = SCENE_LOAD(name,cameraMgr,gui,true,true);
108 108 renderState().getCamera().setMoveSpeedFactor(10.0f);
109 109
110 - _sun = addLight(LIGHT_TYPE_DIRECTIONAL)->getNode<DirectionalLight>();
110 + _sun = addLight(LIGHT_TYPE_DIRECTIONAL)->getNode<DirectionalLight>();
111 111 _sun->csmSplitCount(3); // 3 splits
112 112 _sun->csmSplitLogFactor(0.965f);
113 113 _sun->csmNearClipOffset(25.0f);
114 - _currentSky = addSky(CreateResource<Sky>(ResourceDescriptor("Default Sky")));
114 + _currentSky = addSky(CreateResource<Sky>(ResourceDescriptor("Default Sky")));
115 115
116 116 for(U8 i = 0; i < _terrainInfoArray.size(); i++){
117 117 SceneGraphNode* terrainNode = _sceneGraph->findNode(_terrainInfoArray[i]->getVariable("terrainName"));
  @@ -156,7 +156,7 @@
156 156 if(box) pos = boxNode->getComponent<PhysicsComponent>()->getPosition();
157 157
158 158 if(!switchAB){
159 - if(pos.x < 300 && pos.z == 0) pos.x++;
159 + if(pos.x < 300 && pos.z == 0) pos.x++;
160 160 if(pos.x == 300)
161 161 {
162 162 if(pos.y < 800 && pos.z == 0) pos.y++;
  @@ -177,7 +177,7 @@
177 177 }
178 178 }
179 179 }
180 - if(box) boxNode->getComponent<PhysicsComponent>()->setPosition(pos);
180 + if(box) boxNode->getComponent<PhysicsComponent>()->setPosition(pos);
181 181 }
182 182
183 183 bool MainScene::loadResources(bool continueOnErrors){
  @@ -208,7 +208,7 @@
208 208 _guiTimers.push_back(0.0); //Time
209 209
210 210 _sunAngle = vec2<F32>(0.0f, RADIANS(45.0f));
211 - _sunvector = vec4<F32>( -cosf(_sunAngle.x) * sinf(_sunAngle.y),
211 + _sunvector = vec4<F32>( -cosf(_sunAngle.x) * sinf(_sunAngle.y),
212 212 -cosf(_sunAngle.y),
213 213 -sinf(_sunAngle.x) * sinf(_sunAngle.y),
214 214 0.0f );
  @@ -216,15 +216,15 @@
216 216 Kernel* kernel = Application::getInstance().getKernel();
217 217
218 218 Task_ptr boxMove(kernel->AddTask(getMsToUs(30), 0, DELEGATE_BIND(&MainScene::test, this, stringImpl("test"), TYPE_STRING)));
219 - registerTask(boxMove);
220 - boxMove->startTask();
219 + registerTask(boxMove);
220 + boxMove->startTask();
221 221
222 222 ResourceDescriptor backgroundMusic("background music");
223 - backgroundMusic.setResourceLocation(_paramHandler.getParam<stringImpl>("assetsLocation") + "/music/background_music.ogg");
223 + backgroundMusic.setResourceLocation(_paramHandler.getParam<stringImpl>("assetsLocation") + "/music/background_music.ogg");
224 224 backgroundMusic.setFlag(true);
225 225
226 226 ResourceDescriptor beepSound("beep sound");
227 - beepSound.setResourceLocation(_paramHandler.getParam<stringImpl>("assetsLocation") + "/sounds/beep.wav");
227 + beepSound.setResourceLocation(_paramHandler.getParam<stringImpl>("assetsLocation") + "/sounds/beep.wav");
228 228 beepSound.setFlag(false);
229 229 state()._backgroundMusic["generalTheme"] = CreateResource<AudioDescriptor>(backgroundMusic);
230 230 _beep = CreateResource<AudioDescriptor>(beepSound);
  @@ -242,9 +242,9 @@
242 242
243 243 bool _playMusic = false;
244 244 bool MainScene::onKeyUp(const Input::KeyEvent& key){
245 - switch(key._key) {
245 + switch(key._key) {
246 246 default: break;
247 - case Input::KeyCode::KC_X: SFX_DEVICE.playSound(_beep); break;
247 + case Input::KeyCode::KC_X: SFX_DEVICE.playSound(_beep); break;
248 248 case Input::KeyCode::KC_M:{
249 249 _playMusic = !_playMusic;
250 250 if(_playMusic){