Skip to content

Commit

Permalink
rem name, short
Browse files Browse the repository at this point in the history
  • Loading branch information
cryham committed Aug 30, 2015
1 parent 2a22e81 commit e36bbf1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 44 deletions.
10 changes: 4 additions & 6 deletions source/sound/SoundMgr.cpp
Expand Up @@ -10,7 +10,7 @@ using namespace Ogre;
// Init
//---------------------------------------------------------------------------------------
SoundMgr::SoundMgr()
:disabled(true), instance_counter(0), sound_mgr(0)
:disabled(true), sound_mgr(0)
{
sound_mgr = new SoundBaseMgr();
if (!sound_mgr)
Expand All @@ -20,7 +20,7 @@ SoundMgr::SoundMgr()
if (disabled)
{ LogO("@ SoundScript: Sound Manager is disabled"); return; }

LogO("@ SoundScript: Sound Manager started with " + toStr(sound_mgr->getNumHardwareSources())+" sources");
LogO("@ SoundScript: Sound Manager started with " + toStr(sound_mgr->hw_sources_num)+" sources");
}

SoundMgr::~SoundMgr()
Expand Down Expand Up @@ -60,9 +60,7 @@ Sound* SoundMgr::createInstance(Ogre::String name, int car)

SoundTemplate* templ = templates[name];

Sound* inst = new Sound(car, templ, sound_mgr,
/*templ->file_name+*/"c"+toStr(car)+"-"+toStr(instance_counter));
++instance_counter;
Sound* inst = new Sound(car, templ, sound_mgr);

String ss = name.substr(0,4);
inst->set2D(ss=="hud/"); // set 2d
Expand Down Expand Up @@ -213,7 +211,7 @@ bool SoundTemplate::setParameter(Ogre::StringVector vec)

/// Sound
//---------------------------------------------------------------------------------------------------------
Sound::Sound(int car1, SoundTemplate* tpl, SoundBaseMgr* mgr1, Ogre::String name)
Sound::Sound(int car1, SoundTemplate* tpl, SoundBaseMgr* mgr1)
:car(car1), templ(tpl), sound_mgr(mgr1)
,start_sound(NULL), stop_sound(NULL)
,lastgain(1.0f), is2D(false), engine(false)
Expand Down
3 changes: 1 addition & 2 deletions source/sound/SoundMgr.h
Expand Up @@ -37,7 +37,7 @@ class Sound
friend class SoundMgr;

public:
Sound(int car, SoundTemplate* tpl, SoundBaseMgr* mgr, Ogre::String name);
Sound(int car, SoundTemplate* tpl, SoundBaseMgr* mgr);
~Sound();

void setGain(float value);
Expand Down Expand Up @@ -94,7 +94,6 @@ class SoundMgr
void skipToNextOpenBrace(Ogre::FileStreamDataStream* chunk);

bool disabled;
int instance_counter;

std::map <Ogre::String, SoundTemplate*> templates;
std::vector<SoundTemplate*> v_templ; // to delete
Expand Down
37 changes: 17 additions & 20 deletions source/vdrift/car.cpp
Expand Up @@ -54,7 +54,7 @@ bool CAR::Load(class App* pApp1,
const std::string & carname,
const MATHVECTOR<float,3> & init_pos, const QUATERNION<float> & init_rot,
COLLISION_WORLD & world,
bool defaultabs, bool defaulttcs,
bool abs, bool tcs,
bool isRemote, int idCar,
bool debugmode)
{
Expand Down Expand Up @@ -114,30 +114,27 @@ bool CAR::Load(class App* pApp1,


// load cardynamics
{
if (!cd.Load(pGame, cf)) return false;
if (!cd.Load(pGame, cf))
return false;

MATHVECTOR<double,3> position;
QUATERNION<double> orientation;
position = init_pos;
orientation = init_rot;
MATHVECTOR<double,3> pos = init_pos;
QUATERNION<double> rot; rot = init_rot;

float stOfsY = 0.f;
cf.GetParam("collision.start-offsetY", stOfsY);
position[2] += stOfsY -0.4/**/ + cd.com_ofs_H; //|
float stOfsY = 0.f;
cf.GetParam("collision.start-offsetY", stOfsY);
pos[2] += stOfsY -0.4/**/ + cd.com_ofs_H; //|

posAtStart = posLastCheck = position;
rotAtStart = rotLastCheck = orientation;
dmgLastCheck = 0.f;
cd.Init(pSet, pApp->scn->sc, pApp->scn->data->fluids,
world, position, orientation);
posAtStart = posLastCheck = pos;
rotAtStart = rotLastCheck = rot;
dmgLastCheck = 0.f;

cd.Init(pSet, pApp->scn->sc, pApp->scn->data->fluids,
world, pos, rot);

sphYawAtStart = cd.sphereYaw;
sphYawAtStart = cd.sphereYaw;

cd.SetABS(abs); cd.SetTCS(tcs);

cd.SetABS(defaultabs);
cd.SetTCS(defaulttcs);
}

// load sounds
if (!pGame->snd->isDisabled())
Expand Down
22 changes: 7 additions & 15 deletions source/vdrift/car.h
Expand Up @@ -28,8 +28,8 @@ class CAR
bool Load(class App* pApp1,
CONFIGFILE & carconf, const std::string & carname,
const MATHVECTOR<float,3> & init_pos, const QUATERNION<float> & init_rot,
COLLISION_WORLD & world,
bool defaultabs, bool defaulttcs, bool isRemote, int idCar, bool debugmode);
COLLISION_WORLD & world, bool abs, bool tcs,
bool isRemote, int idCar, bool debugmode);

// will align car relative to track surface, returns false if the car isn't near ground
void SetPosition(const MATHVECTOR<float,3> & pos, const QUATERNION<float> & rot);
Expand Down Expand Up @@ -61,25 +61,17 @@ class CAR


int GetGear() const
{
return dynamics.GetTransmission().GetGear();
}
{ return dynamics.GetTransmission().GetGear(); }

void SetGear(int gear)
{
dynamics.ShiftGear(gear);
}
{ dynamics.ShiftGear(gear); }

float GetClutch() const
{
return dynamics.GetClutch().GetClutch();
}

{ return dynamics.GetClutch().GetClutch(); }

void SetAutoClutch(bool value)
{
dynamics.SetAutoClutch(value);
}
{ dynamics.SetAutoClutch(value); }


void SetAutoShift(bool value){ dynamics.SetAutoShift(value); }
void SetAutoRear(bool value){ dynamics.SetAutoRear(value); }
Expand Down
4 changes: 3 additions & 1 deletion source/vdrift/car_sound.cpp
Expand Up @@ -21,6 +21,7 @@
#include "../ogre/SplitScreen.h" // num plr
#include "../sound/SoundMgr.h"
#include "../sound/SoundBase.h"
#include "../sound/SoundBaseMgr.h"
#include <OgreCamera.h>
using namespace std;
using namespace Ogre;
Expand Down Expand Up @@ -131,7 +132,6 @@ void CAR::CARsounds::Destroy()
delete water[i];

delete mud; delete mud_cont; delete water_cont;
//--instance_counter;
}


Expand Down Expand Up @@ -438,6 +438,8 @@ if (bSound)
{
if (bSound)
{
//case 1: pGame->snd->sound_mgr->SetReverb("UNDERWATER"); break;

s.crash[i]->setGain(gain * pSet->vol_car_crash);
if (hitp)
s.crash[i]->setPosition(hp, ev);
Expand Down

0 comments on commit e36bbf1

Please sign in to comment.