- more cppcheck code cleanup

This commit is contained in:
Mark Vejvoda 2012-10-06 03:42:31 +00:00
parent 97ba1a27e2
commit 2a80dd7c3c
7 changed files with 25 additions and 3 deletions

View File

@ -357,6 +357,7 @@ AiRuleMassiveAttack::AiRuleMassiveAttack(Ai *ai):
AiRule(ai) AiRule(ai)
{ {
ultraAttack=false; ultraAttack=false;
field = fLand;
} }
bool AiRuleMassiveAttack::test(){ bool AiRuleMassiveAttack::test(){

View File

@ -31,7 +31,9 @@ public:
Vec3f axis; Vec3f axis;
float angle; float angle;
AxisAngle(){}; AxisAngle() {
angle = 0.0f;
}
AxisAngle(const Vec3f &axis, float angle); AxisAngle(const Vec3f &axis, float angle);
}; };
@ -43,7 +45,11 @@ class EulerAngles{
public: public:
float x, y, z; float x, y, z;
EulerAngles(){}; EulerAngles() {
x = 0.0f;
y = 0.0f;
z = 0.0f;
}
EulerAngles(float x, float y, float z); EulerAngles(float x, float y, float z);
}; };

View File

@ -26,7 +26,9 @@ private:
SoundFactory *soundFactory; SoundFactory *soundFactory;
private: private:
SoundInterface() {} SoundInterface() {
soundFactory = 0;
}
SoundInterface(SoundInterface &); SoundInterface(SoundInterface &);
void operator=(SoundInterface &); void operator=(SoundInterface &);

View File

@ -26,6 +26,9 @@ namespace Shared{ namespace Graphics{ namespace Gl{
ShaderProgramGl::ShaderProgramGl(){ ShaderProgramGl::ShaderProgramGl(){
inited= false; inited= false;
vertexShader=0;
fragmentShader=0;
handle=0;
} }
void ShaderProgramGl::init(){ void ShaderProgramGl::init(){
@ -173,6 +176,7 @@ GLint ShaderProgramGl::getLocation(const string &name){
ShaderGl::ShaderGl(){ ShaderGl::ShaderGl(){
inited= false; inited= false;
handle = 0;
} }
void ShaderGl::load(const string &path){ void ShaderGl::load(const string &path){

View File

@ -26,6 +26,9 @@ namespace Shared{ namespace Graphics{ namespace Gl{
ShaderProgramGl::ShaderProgramGl(){ ShaderProgramGl::ShaderProgramGl(){
inited= false; inited= false;
vertexShader=0;
fragmentShader=0;
handle=0;
} }
void ShaderProgramGl::init(){ void ShaderProgramGl::init(){
@ -167,6 +170,7 @@ GLint ShaderProgramGl::getLocation(const string &name){
ShaderGl::ShaderGl(){ ShaderGl::ShaderGl(){
inited= false; inited= false;
handle = 0;
} }
void ShaderGl::load(const string &path){ void ShaderGl::load(const string &path){

View File

@ -136,6 +136,7 @@ ALenum SoundSource::getFormat(Sound* sound)
StaticSoundSource::StaticSoundSource() { StaticSoundSource::StaticSoundSource() {
bufferAllocated = false; bufferAllocated = false;
buffer = 0;
} }
StaticSoundSource::~StaticSoundSource() { StaticSoundSource::~StaticSoundSource() {
@ -179,6 +180,8 @@ void StaticSoundSource::play(StaticSound* sound) {
StreamSoundSource::StreamSoundSource() StreamSoundSource::StreamSoundSource()
{ {
sound = 0; sound = 0;
fadeState = NoFading;
format = 0;
alGenBuffers(STREAMFRAGMENTS, buffers); alGenBuffers(STREAMFRAGMENTS, buffers);
SoundPlayerOpenAL::checkAlError(string(__FILE__) + string(" ") + string(__FUNCTION__) + string(" ") + intToStr(__LINE__)); SoundPlayerOpenAL::checkAlError(string(__FILE__) + string(" ") + string(__FUNCTION__) + string(" ") + intToStr(__LINE__));
} }
@ -331,6 +334,7 @@ SoundPlayerOpenAL::SoundPlayerOpenAL() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
device = 0; device = 0;
context = 0;
initOk = false; initOk = false;
if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);

View File

@ -40,6 +40,7 @@ SoundInfo::SoundInfo() {
Sound::Sound() { Sound::Sound() {
volume= 0.0f; volume= 0.0f;
fileName = ""; fileName = "";
soundFileLoader = 0;
} }
// ===================================================== // =====================================================