Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 813 vs 815 for /trunk/Source Code/Scenes/Headers/Scene.h

Diff revisions: vs.
  @@ -142,12 +142,10 @@
142 142 SceneGraphNode_ptr addSky(const stringImpl& nodeName = "");
143 143
144 144 /// Object picking
145 - inline SceneGraphNode_wptr getCurrentSelection() const {
146 - return _currentSelection;
147 - }
148 - inline SceneGraphNode_wptr getCurrentHoverTarget() const {
149 - return _currentHoverTarget;
145 + inline SceneGraphNode_wptr getCurrentSelection(U8 index) {
146 + return _currentSelection[index];
150 147 }
148 +
151 149 void findSelection();
152 150
153 151 inline void addSelectionCallback(const DELEGATE_CBK<>& selectionCallback) {
  @@ -182,7 +180,7 @@
182 180 virtual void loadKeyBindings();
183 181
184 182 void resetSelection();
185 - void findHoverTarget();
183 + void findHoverTarget(U8 playerIndex);
186 184 bool checkCameraUnderwater() const;
187 185 void toggleFlashlight();
188 186
  @@ -220,6 +218,8 @@
220 218 /// Draw debug entities
221 219 virtual void debugDraw(const Camera& activeCamera, RenderStage stage, RenderSubPassCmds& subPassesInOut);
222 220
221 + inline const Camera& baseCamera() const { return *_baseCamera; }
222 +
223 223 /// simple function to load the scene elements.
224 224 inline bool SCENE_LOAD(const stringImpl& name,
225 225 const bool contOnErrorRes,
  @@ -256,6 +256,7 @@
256 256 SceneGraph* _sceneGraph;
257 257 AI::AIManager* _aiManager;
258 258 SceneGUIElements* _GUI;
259 + Camera* _baseCamera;
259 260
260 261 vectorImpl<Player_ptr> _scenePlayers;
261 262 U64 _sceneTimer;
  @@ -269,8 +270,8 @@
269 270 vectorImpl<TerrainDescriptor*> _terrainInfoArray;
270 271 F32 _LRSpeedFactor;
271 272 /// Current selection
272 - SceneGraphNode_wptr _currentSelection;
273 - SceneGraphNode_wptr _currentHoverTarget;
273 + hashMapImpl<U8, SceneGraphNode_wptr> _currentSelection;
274 + hashMapImpl<U8, SceneGraphNode_wptr> _currentHoverTarget;
274 275 SceneGraphNode_wptr _currentSky;
275 276 SceneGraphNode_wptr _flashLight;
276 277
  @@ -323,6 +324,10 @@
323 324 return scene.deinitializeAI(true);
324 325 }
325 326
327 + static const Camera& baseCamera(const Scene& scene) {
328 + return scene.baseCamera();
329 + }
330 +
326 331 /// Draw debug entities
327 332 static void debugDraw(Scene& scene, const Camera& activeCamera, RenderStage stage, RenderSubPassCmds& subPassesInOut) {
328 333 scene.debugDraw(activeCamera, stage, subPassesInOut);
  @@ -393,8 +398,8 @@
393 398 class SceneGraph {
394 399 private:
395 400 static void onNodeDestroy(Scene& scene, SceneGraphNode& node) {
396 - if (!scene.getCurrentSelection().expired() &&
397 - scene.getCurrentSelection().lock()->getGUID() == node.getGUID())
401 + if (!scene.getCurrentSelection(0).expired() &&
402 + scene.getCurrentSelection(0).lock()->getGUID() == node.getGUID())
398 403 {
399 404 scene.resetSelection();
400 405 }