Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 816 vs 817 for /trunk/Source Code/Scenes/Headers/Scene.h

Diff revisions: vs.
  @@ -82,6 +82,7 @@
82 82 class SceneRenderPass;
83 83 class SceneLoadSave;
84 84 class SceneGUI;
85 + class SceneInput;
85 86 };
86 87
87 88 /// The scene is a resource (to enforce load/unload and setName) and it has a 2 states:
  @@ -93,6 +94,7 @@
93 94 friend class Attorney::SceneRenderPass;
94 95 friend class Attorney::SceneLoadSave;
95 96 friend class Attorney::SceneGUI;
97 + friend class Attorney::SceneInput;
96 98
97 99 protected:
98 100 typedef std::stack<FileData, vectorImpl<FileData> > FileDataStack;
  @@ -124,6 +126,7 @@
124 126 inline SceneRenderState& renderState() { return _sceneState->renderState(); }
125 127 inline const SceneRenderState& renderState() const { return _sceneState->renderState(); }
126 128 inline SceneInput& input() { return *_input; }
129 + inline const SceneInput& input() const { return *_input; }
127 130
128 131 inline SceneGraph& sceneGraph() { return *_sceneGraph; }
129 132 void registerTask(const TaskHandle& taskItem);
  @@ -160,7 +163,6 @@
160 163 return _vegetationDataArray;
161 164 }
162 165
163 -
164 166 inline AI::AIManager& aiManager() { return *_aiManager; }
165 167 inline const AI::AIManager& aiManager() const { return *_aiManager; }
166 168
  @@ -181,7 +183,7 @@
181 183
182 184 void resetSelection();
183 185 void findHoverTarget(U8 playerIndex);
184 - bool checkCameraUnderwater() const;
186 + bool checkCameraUnderwater(U8 playerIndex) const;
185 187 void toggleFlashlight();
186 188
187 189 virtual bool save(ByteBuffer& outputBuffer) const;
  @@ -197,6 +199,8 @@
197 199 /// loaded.
198 200 /// Useful for loading one model per frame
199 201 virtual void loadXMLAssets(bool singleStep = false);
202 + virtual void loadBaseCamera();
203 +
200 204 virtual bool load(const stringImpl& name);
201 205 bool loadModel(const FileData& data);
202 206 bool loadGeometry(const FileData& data);
  @@ -218,8 +222,19 @@
218 222 /// Draw debug entities
219 223 virtual void debugDraw(const Camera& activeCamera, RenderStage stage, RenderSubPassCmds& subPassesInOut);
220 224
225 + inline Camera& baseCamera() { return *_baseCamera; }
226 +
221 227 inline const Camera& baseCamera() const { return *_baseCamera; }
222 228
229 + bool mouseMoved(const Input::MouseEvent& arg);
230 +
231 + U8 getSceneIndexForPlayer(U8 playerIndex) const;
232 + const Player_ptr& getPlayerForIndex(U8 playerIndex) const;
233 +
234 + U8 getPlayerIndexForDevice(U8 deviceIndex) const;
235 +
236 + void addPlayerInternal(bool queue);
237 + void removePlayerInternal(U8 playerIndex);
223 238 void onPlayerAdd(const Player_ptr& player);
224 239 void onPlayerRemove(const Player_ptr& player);
225 240
  @@ -252,6 +267,8 @@
252 267
253 268 stringImpl getPlayerSGNName(U8 playerIndex);
254 269
270 + void currentPlayerPass(U8 playerIndex);
271 +
255 272 protected:
256 273 /// Global info
257 274 SceneManager& _parent;
  @@ -275,8 +292,9 @@
275 292 vectorImpl<TerrainDescriptor*> _terrainInfoArray;
276 293 F32 _LRSpeedFactor;
277 294 /// Current selection
278 - hashMapImpl<U8, SceneGraphNode_wptr> _currentSelection;
279 - hashMapImpl<U8, SceneGraphNode_wptr> _currentHoverTarget;
295 + hashMapImpl<U8 /*player index*/, SceneGraphNode_wptr> _currentSelection;
296 + hashMapImpl<U8 /*player index*/, SceneGraphNode_wptr> _currentHoverTarget;
297 +
280 298 SceneGraphNode_wptr _currentSky;
281 299 SceneGraphNode_wptr _flashLight;
282 300
  @@ -329,6 +347,10 @@
329 347 return scene.deinitializeAI(true);
330 348 }
331 349
350 + static Camera& baseCamera(Scene& scene) {
351 + return scene.baseCamera();
352 + }
353 +
332 354 static const Camera& baseCamera(const Scene& scene) {
333 355 return scene.baseCamera();
334 356 }
  @@ -341,6 +363,10 @@
341 363 scene.onPlayerRemove(player);
342 364 }
343 365
366 + static void currentPlayerPass(Scene& scene, U8 playerIndex) {
367 + scene.currentPlayerPass(playerIndex);
368 + }
369 +
344 370 /// Draw debug entities
345 371 static void debugDraw(Scene& scene, const Camera& activeCamera, RenderStage stage, RenderSubPassCmds& subPassesInOut) {
346 372 scene.debugDraw(activeCamera, stage, subPassesInOut);
  @@ -429,6 +455,15 @@
429 455 friend class Divide::GUI;
430 456 };
431 457
458 + class SceneInput {
459 + private:
460 + static bool mouseMoved(Scene& scene, const Input::MouseEvent& arg) {
461 + return scene.mouseMoved(arg);
462 + }
463 +
464 + friend class Divide::SceneInput;
465 + };
466 +
432 467 }; // namespace Attorney
433 468 }; // namespace Divide
434 469