OSDN Git Service

Cleanups
authorryan <>
Wed, 28 Dec 2016 02:30:05 +0000 (02:30 +0000)
committerryan <>
Wed, 28 Dec 2016 02:30:05 +0000 (02:30 +0000)
src/sbs/movingwalkway.cpp
src/sbs/sbs.cpp
src/sbs/sbs.h

index cfea9d4..99ef174 100644 (file)
@@ -48,7 +48,7 @@ MovingWalkway::MovingWalkway(Object *parent, const std::string &name, int run, f
        is_enabled = true;
        Run = run;
        Speed = speed;
-       //sbs->IncrementEscalatorCount();
+       sbs->IncrementMovingWalkwayCount();
        start = 0;
        end = 0;
 
index be82351..eb52b24 100644 (file)
 #include "manager.h"
 #include "camera.h"
 #include "dynamicmesh.h"
-#include "mesh.h"
 #include "floor.h"
 #include "elevator.h"
 #include "elevatorcar.h"
-#include "elevatordoor.h"
 #include "shaft.h"
 #include "stairs.h"
 #include "action.h"
 #include "person.h"
 #include "texture.h"
-#include "escalator.h"
-#include "polygon.h"
 #include "light.h"
 #include "wall.h"
-#include "callbutton.h"
 #include "control.h"
 #include "trigger.h"
 #include "soundsystem.h"
 #include "sound.h"
-#include "door.h"
 #include "model.h"
 #include "timer.h"
 #include "profiler.h"
@@ -171,6 +165,7 @@ SBS::SBS(Ogre::SceneManager* mSceneManager, FMOD::System *fmodsystem, int instan
        SmoothFrames = GetConfigInt("Skyscraper.SBS.SmoothFrames", 200);
        RenderOnStartup = GetConfigBool("Skyscraper.SBS.RenderOnStartup", false);
        EscalatorCount = 0;
+       MovingWalkwayCount = 0;
        RandomActivity = GetConfigBool("Skyscraper.SBS.RandomActivity", false);
        Headless = false;
 
@@ -2582,6 +2577,8 @@ bool SBS::DeleteObject(Object *object)
 
                deleted = true;
        }
+       else if (type == "MovingWalkway")
+               deleted = true;
 
        //delete object
        if (deleted == true)
@@ -3564,6 +3561,22 @@ void SBS::DecrementEscalatorCount()
        EscalatorCount--;
 }
 
+int SBS::GetMovingWalkwayCount()
+{
+       //return total number of allocated sounds
+       return MovingWalkwayCount;
+}
+
+void SBS::IncrementMovingWalkwayCount()
+{
+       MovingWalkwayCount++;
+}
+
+void SBS::DecrementMovingWalkwayCount()
+{
+       MovingWalkwayCount--;
+}
+
 bool SBS::HitBeam(const Ogre::Ray &ray, float max_distance, MeshObject *&mesh, Wall *&wall, Ogre::Vector3 &hit_position)
 {
        //use a given ray and distance, and return the nearest hit mesh and if applicable, wall object
index 539b1b1..329a9ef 100644 (file)
@@ -337,6 +337,9 @@ public:
        int GetEscalatorCount();
        void IncrementEscalatorCount();
        void DecrementEscalatorCount();
+       int GetMovingWalkwayCount();
+       void IncrementMovingWalkwayCount();
+       void DecrementMovingWalkwayCount();
        bool HitBeam(const Ogre::Ray &ray, float max_distance, MeshObject *&mesh, Wall *&wall, Ogre::Vector3 &hit_position);
        void EnableRandomActivity(bool value);
        SoundSystem* GetSoundSystem();
@@ -486,6 +489,8 @@ private:
 
        int EscalatorCount; //number of escalators
 
+       int MovingWalkwayCount; //number of moving walkways
+
        //internal clock
        unsigned long current_time;
        unsigned long current_virtual_time;