From: ryan <> Date: Wed, 28 Dec 2016 02:30:05 +0000 (+0000) Subject: Cleanups X-Git-Url: http://git.sourceforge.jp/view?p=skyscrapersim%2Fskyscraper.git;a=commitdiff_plain;h=33927058265c37e7f4e5a0236669d8ce9240cffd Cleanups --- diff --git a/src/sbs/movingwalkway.cpp b/src/sbs/movingwalkway.cpp index cfea9d46..99ef1742 100644 --- a/src/sbs/movingwalkway.cpp +++ b/src/sbs/movingwalkway.cpp @@ -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; diff --git a/src/sbs/sbs.cpp b/src/sbs/sbs.cpp index be82351e..eb52b24c 100644 --- a/src/sbs/sbs.cpp +++ b/src/sbs/sbs.cpp @@ -37,26 +37,20 @@ #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 diff --git a/src/sbs/sbs.h b/src/sbs/sbs.h index 539b1b1b..329a9ef8 100644 --- a/src/sbs/sbs.h +++ b/src/sbs/sbs.h @@ -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;