Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 331 vs 337 for /trunk/Source Code/Scenes/SceneInput.cpp

Diff revisions: vs.
  @@ -60,7 +60,7 @@
60 60 #endif
61 61 }
62 62
63 - for(DELEGATE_CBK<>& cbk : _selectionChangeCallbacks) {
63 + for(DELEGATE_CBK<>& cbk : _selectionChangeCallbacks) {
64 64 cbk();
65 65 }
66 66 }
  @@ -87,13 +87,13 @@
87 87 switch (button){
88 88 default: return false;
89 89
90 - case Input::MouseButton::MB_Left: {
91 - findSelection(key.state.X.abs, key.state.Y.abs);
92 - }break;
93 - case Input::MouseButton::MB_Right: {
94 - state()._angleLR = 0;
95 - state()._angleUD = 0;
96 - }break;
90 + case Input::MouseButton::MB_Left: {
91 + findSelection(key.state.X.abs, key.state.Y.abs);
92 + }break;
93 + case Input::MouseButton::MB_Right: {
94 + state()._angleLR = 0;
95 + state()._angleUD = 0;
96 + }break;
97 97 case Input::MouseButton::MB_Middle: break;
98 98 case Input::MouseButton::MB_Button3: break;
99 99 case Input::MouseButton::MB_Button4: break;
  @@ -108,10 +108,10 @@
108 108 state()._mouseXDelta = _previousMousePos.x - key.state.X.abs;
109 109 state()._mouseYDelta = _previousMousePos.y - key.state.Y.abs;
110 110 _previousMousePos.set(key.state.X.abs, key.state.Y.abs);
111 - if (_mousePressed[Input::MouseButton::MB_Right]) {
112 - state()._angleLR = -state()._mouseXDelta;
113 - state()._angleUD = -state()._mouseYDelta;
114 - }
111 + if (_mousePressed[Input::MouseButton::MB_Right]) {
112 + state()._angleLR = -state()._mouseXDelta;
113 + state()._angleUD = -state()._mouseYDelta;
114 + }
115 115 return true;
116 116 }
117 117
  @@ -119,9 +119,9 @@
119 119 bool Scene::onKeyDown(const Input::KeyEvent& key){
120 120 switch(key._key){
121 121 default: return false;
122 - case KeyCode::KC_END : {
123 - deleteSelection();
124 - } break;
122 + case KeyCode::KC_END : {
123 + deleteSelection();
124 + } break;
125 125 case KeyCode::KC_ADD : {
126 126 Camera& cam = renderState().getCamera();
127 127 F32 currentCamMoveSpeedFactor = cam.getMoveSpeedFactor();
  @@ -130,7 +130,7 @@
130 130 cam.setTurnSpeedFactor( cam.getTurnSpeedFactor() + 1.0f);
131 131 }
132 132 } break;
133 - case KeyCode::KC_SUBTRACT : {
133 + case KeyCode::KC_SUBTRACT : {
134 134 Camera& cam = renderState().getCamera();
135 135 F32 currentCamMoveSpeedFactor = cam.getMoveSpeedFactor();
136 136 if (currentCamMoveSpeedFactor > 1.0f){
  @@ -138,103 +138,103 @@
138 138 cam.setTurnSpeedFactor( cam.getTurnSpeedFactor() - 1.0f);
139 139 }
140 140 } break;
141 - case KeyCode::KC_W: {
142 - state()._moveFB = 1;
143 - } break;
144 - case KeyCode::KC_S: {
145 - state()._moveFB = -1;
146 - } break;
147 - case KeyCode::KC_A: {
148 - state()._moveLR = -1;
149 - } break;
150 - case KeyCode::KC_D: {
151 - state()._moveLR = 1;
152 - } break;
153 - case KeyCode::KC_Q: {
154 - state()._roll = 1;
155 - } break;
156 - case KeyCode::KC_E: {
157 - state()._roll = -1;
158 - } break;
159 - case KeyCode::KC_RIGHT: {
160 - state()._angleLR = 1;
161 - }break;
162 - case KeyCode::KC_LEFT: {
163 - state()._angleLR = -1;
164 - } break;
165 - case KeyCode::KC_UP: {
166 - state()._angleUD = -1;
167 - } break;
168 - case KeyCode::KC_DOWN: {
169 - state()._angleUD = 1;
170 - } break;
141 + case KeyCode::KC_W: {
142 + state()._moveFB = 1;
143 + } break;
144 + case KeyCode::KC_S: {
145 + state()._moveFB = -1;
146 + } break;
147 + case KeyCode::KC_A: {
148 + state()._moveLR = -1;
149 + } break;
150 + case KeyCode::KC_D: {
151 + state()._moveLR = 1;
152 + } break;
153 + case KeyCode::KC_Q: {
154 + state()._roll = 1;
155 + } break;
156 + case KeyCode::KC_E: {
157 + state()._roll = -1;
158 + } break;
159 + case KeyCode::KC_RIGHT: {
160 + state()._angleLR = 1;
161 + }break;
162 + case KeyCode::KC_LEFT: {
163 + state()._angleLR = -1;
164 + } break;
165 + case KeyCode::KC_UP: {
166 + state()._angleUD = -1;
167 + } break;
168 + case KeyCode::KC_DOWN: {
169 + state()._angleUD = 1;
170 + } break;
171 171 }
172 172 return true;
173 173 }
174 174
175 175 bool Scene::onKeyUp(const Input::KeyEvent& key){
176 176 switch( key._key ) {
177 - case KeyCode::KC_P: {
178 - _paramHandler.setParam("freezeLoopTime",
177 + case KeyCode::KC_P: {
178 + _paramHandler.setParam("freezeLoopTime",
179 179 !_paramHandler.getParam("freezeLoopTime", false));
180 - } break;
181 - case KeyCode::KC_F2: {
182 - renderState().toggleSkeletons();
183 - } break;
184 - case KeyCode::KC_F3: {
185 - _paramHandler.setParam("postProcessing.enableDepthOfField",
180 + } break;
181 + case KeyCode::KC_F2: {
182 + renderState().toggleSkeletons();
183 + } break;
184 + case KeyCode::KC_F3: {
185 + _paramHandler.setParam("postProcessing.enableDepthOfField",
186 186 !_paramHandler.getParam<bool>("postProcessing.enableDepthOfField"));
187 - } break;
188 - case KeyCode::KC_F4: {
189 - _paramHandler.setParam("postProcessing.enableBloom",
187 + } break;
188 + case KeyCode::KC_F4: {
189 + _paramHandler.setParam("postProcessing.enableBloom",
190 190 !_paramHandler.getParam<bool>("postProcessing.enableBloom"));
191 - } break;
192 - case KeyCode::KC_F5: {
193 - renderState().toggleAxisLines();
194 - } break;
191 + } break;
192 + case KeyCode::KC_F5: {
193 + renderState().toggleAxisLines();
194 + } break;
195 195 case KeyCode::KC_B: {
196 196 renderState().toggleBoundingBoxes();
197 197 } break;
198 - case KeyCode::KC_F8: {
199 - renderState().drawDebugLines(!renderState()._debugDrawLines);
200 - } break;
201 - # ifdef _DEBUG
202 - case KeyCode::KC_F9: {
203 - for (U8 i = 0; i < DEBUG_LINE_PLACEHOLDER; ++i) {
204 - _lines[i].clear();
205 - }
206 - } break;
207 - # endif
208 - case KeyCode::KC_F10: {
198 + case KeyCode::KC_F8: {
199 + renderState().drawDebugLines(!renderState()._debugDrawLines);
200 + } break;
201 + # ifdef _DEBUG
202 + case KeyCode::KC_F9: {
203 + for (U8 i = 0; i < DEBUG_LINE_PLACEHOLDER; ++i) {
204 + _lines[i].clear();
205 + }
206 + } break;
207 + # endif
208 + case KeyCode::KC_F10: {
209 209 ParamHandler& param = ParamHandler::getInstance();
210 - LightManager::getInstance().togglePreviewShadowMaps();
210 + LightManager::getInstance().togglePreviewShadowMaps();
211 211 param.setParam<bool>("rendering.previewDepthBuffer",
212 212 !param.getParam<bool>("rendering.previewDepthBuffer", false));
213 - } break;
213 + } break;
214 214 case KeyCode::KC_F7: {
215 215 GFX_DEVICE.Screenshot("screenshot_");
216 216 } break;
217 - case KeyCode::KC_W:
218 - case KeyCode::KC_S: {
219 - state()._moveFB = 0;
220 - } break;
221 - case KeyCode::KC_A:
222 - case KeyCode::KC_D: {
223 - state()._moveLR = 0;
224 - } break;
225 - case KeyCode::KC_Q:
226 - case KeyCode::KC_E: {
227 - state()._roll = 0;
228 - } break;
229 - case KeyCode::KC_RIGHT:
230 - case KeyCode::KC_LEFT: {
231 - state()._angleLR = 0;
232 - } break;
233 - case KeyCode::KC_UP:
234 - case KeyCode::KC_DOWN: {
235 - state()._angleUD = 0;
236 - } break;
237 - default: return false;
217 + case KeyCode::KC_W:
218 + case KeyCode::KC_S: {
219 + state()._moveFB = 0;
220 + } break;
221 + case KeyCode::KC_A:
222 + case KeyCode::KC_D: {
223 + state()._moveLR = 0;
224 + } break;
225 + case KeyCode::KC_Q:
226 + case KeyCode::KC_E: {
227 + state()._roll = 0;
228 + } break;
229 + case KeyCode::KC_RIGHT:
230 + case KeyCode::KC_LEFT: {
231 + state()._angleLR = 0;
232 + } break;
233 + case KeyCode::KC_UP:
234 + case KeyCode::KC_DOWN: {
235 + state()._angleUD = 0;
236 + } break;
237 + default: return false;
238 238 }
239 239 return true;
240 240 }