diff options
author | Einar Johan Trøan Sømåen | 2012-06-26 01:30:01 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-26 01:30:01 +0200 |
commit | cb16242d5dfe7d8ccbb1828c0898ab1f5a92e41a (patch) | |
tree | c2c70ad8a7252d2c8ef418b336dbaf5fbe4e9d60 /engines | |
parent | 293e12f7d082806f1fb60f22bf348cbe47381430 (diff) | |
download | scummvm-rg350-cb16242d5dfe7d8ccbb1828c0898ab1f5a92e41a.tar.gz scummvm-rg350-cb16242d5dfe7d8ccbb1828c0898ab1f5a92e41a.tar.bz2 scummvm-rg350-cb16242d5dfe7d8ccbb1828c0898ab1f5a92e41a.zip |
WINTERMUTE: Rename FuncName->funcName in the Particle Engine
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/Base/PartEmitter.cpp | 56 | ||||
-rw-r--r-- | engines/wintermute/Base/PartEmitter.h | 27 | ||||
-rw-r--r-- | engines/wintermute/Base/PartParticle.cpp | 12 | ||||
-rw-r--r-- | engines/wintermute/Base/PartParticle.h | 6 |
4 files changed, 51 insertions, 50 deletions
diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp index 5f7f8f5906..1ff3bf1122 100644 --- a/engines/wintermute/Base/PartEmitter.cpp +++ b/engines/wintermute/Base/PartEmitter.cpp @@ -116,7 +116,7 @@ CPartEmitter::~CPartEmitter(void) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::AddSprite(const char *Filename) {
+HRESULT CPartEmitter::addSprite(const char *Filename) {
if (!Filename) return E_FAIL;
// do we already have the file?
@@ -139,7 +139,7 @@ HRESULT CPartEmitter::AddSprite(const char *Filename) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::RemoveSprite(const char *Filename) {
+HRESULT CPartEmitter::removeSprite(const char *Filename) {
for (int i = 0; i < _sprites.GetSize(); i++) {
if (scumm_stricmp(Filename, _sprites[i]) == 0) {
delete [] _sprites[i];
@@ -151,7 +151,7 @@ HRESULT CPartEmitter::RemoveSprite(const char *Filename) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::InitParticle(CPartParticle *Particle, uint32 CurrentTime, uint32 TimerDelta) {
+HRESULT CPartEmitter::initParticle(CPartParticle *Particle, uint32 CurrentTime, uint32 TimerDelta) {
if (!Particle) return E_FAIL;
if (_sprites.GetSize() == 0) return E_FAIL;
@@ -217,8 +217,8 @@ HRESULT CPartEmitter::InitParticle(CPartParticle *Particle, uint32 CurrentTime, Particle->_angVelocity = AngVelocity;
Particle->_growthRate = GrowthRate;
Particle->_exponentialGrowth = _exponentialGrowth;
- Particle->_isDead = FAILED(Particle->SetSprite(_sprites[SpriteIndex]));
- Particle->FadeIn(CurrentTime, _fadeInTime);
+ Particle->_isDead = FAILED(Particle->setSprite(_sprites[SpriteIndex]));
+ Particle->fadeIn(CurrentTime, _fadeInTime);
if (Particle->_isDead) return E_FAIL;
@@ -228,11 +228,11 @@ HRESULT CPartEmitter::InitParticle(CPartParticle *Particle, uint32 CurrentTime, //////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::update() {
if (!_running) return S_OK;
- else return UpdateInternal(Game->_timer, Game->_timerDelta);
+ else return updateInternal(Game->_timer, Game->_timerDelta);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::UpdateInternal(uint32 CurrentTime, uint32 TimerDelta) {
+HRESULT CPartEmitter::updateInternal(uint32 CurrentTime, uint32 TimerDelta) {
int NumLive = 0;
for (int i = 0; i < _particles.GetSize(); i++) {
@@ -269,14 +269,14 @@ HRESULT CPartEmitter::UpdateInternal(uint32 CurrentTime, uint32 TimerDelta) { Particle = new CPartParticle(Game);
_particles.Add(Particle);
}
- InitParticle(Particle, CurrentTime, TimerDelta);
+ initParticle(Particle, CurrentTime, TimerDelta);
NeedsSort = true;
ToGen--;
}
}
if (NeedsSort && (_scaleZBased || _velocityZBased || _lifeTimeZBased))
- SortParticlesByZ();
+ sortParticlesByZ();
// we actually generated some particles and we're not in fast-forward mode
if (NeedsSort && _overheadTime == 0) {
@@ -305,7 +305,7 @@ HRESULT CPartEmitter::display(CBRegion *Region) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::Start() {
+HRESULT CPartEmitter::start() {
for (int i = 0; i < _particles.GetSize(); i++) {
_particles[i]->_isDead = true;
}
@@ -319,7 +319,7 @@ HRESULT CPartEmitter::Start() { uint32 CurrentTime = Game->_timer - _overheadTime;
for (int i = 0; i < Steps; i++) {
- UpdateInternal(CurrentTime, Delta);
+ updateInternal(CurrentTime, Delta);
CurrentTime += Delta;
}
_overheadTime = 0;
@@ -330,14 +330,14 @@ HRESULT CPartEmitter::Start() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::SortParticlesByZ() {
+HRESULT CPartEmitter::sortParticlesByZ() {
// sort particles by _posY
- qsort(_particles.GetData(), _particles.GetSize(), sizeof(CPartParticle *), CPartEmitter::CompareZ);
+ qsort(_particles.GetData(), _particles.GetSize(), sizeof(CPartParticle *), CPartEmitter::compareZ);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-int CPartEmitter::CompareZ(const void *Obj1, const void *Obj2) {
+int CPartEmitter::compareZ(const void *Obj1, const void *Obj2) {
CPartParticle *P1 = *(CPartParticle **)Obj1;
CPartParticle *P2 = *(CPartParticle **)Obj2;
@@ -347,14 +347,14 @@ int CPartEmitter::CompareZ(const void *Obj1, const void *Obj2) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::SetBorder(int X, int Y, int Width, int Height) {
+HRESULT CPartEmitter::setBorder(int X, int Y, int Width, int Height) {
CBPlatform::SetRect(&_border, X, Y, X + Width, Y + Height);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::SetBorderThickness(int ThicknessLeft, int ThicknessRight, int ThicknessTop, int ThicknessBottom) {
+HRESULT CPartEmitter::setBorderThickness(int ThicknessLeft, int ThicknessRight, int ThicknessTop, int ThicknessBottom) {
_borderThicknessLeft = ThicknessLeft;
_borderThicknessRight = ThicknessRight;
_borderThicknessTop = ThicknessTop;
@@ -364,7 +364,7 @@ HRESULT CPartEmitter::SetBorderThickness(int ThicknessLeft, int ThicknessRight, }
//////////////////////////////////////////////////////////////////////////
-CPartForce *CPartEmitter::AddForceByName(const char *Name) {
+CPartForce *CPartEmitter::addForceByName(const char *Name) {
CPartForce *Force = NULL;
for (int i = 0; i < _forces.GetSize(); i++) {
@@ -385,8 +385,8 @@ CPartForce *CPartEmitter::AddForceByName(const char *Name) { //////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::AddForce(const char *Name, CPartForce::TForceType Type, int PosX, int PosY, float Angle, float Strength) {
- CPartForce *Force = AddForceByName(Name);
+HRESULT CPartEmitter::addForce(const char *Name, CPartForce::TForceType Type, int PosX, int PosY, float Angle, float Strength) {
+ CPartForce *Force = addForceByName(Name);
if (!Force) return E_FAIL;
Force->_type = Type;
@@ -401,7 +401,7 @@ HRESULT CPartEmitter::AddForce(const char *Name, CPartForce::TForceType Type, in }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::RemoveForce(const char *Name) {
+HRESULT CPartEmitter::removeForce(const char *Name) {
for (int i = 0; i < _forces.GetSize(); i++) {
if (scumm_stricmp(Name, _forces[i]->_name) == 0) {
delete _forces[i];
@@ -427,7 +427,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack int BorderWidth = Stack->Pop()->GetInt();
int BorderHeight = Stack->Pop()->GetInt();
- Stack->PushBool(SUCCEEDED(SetBorder(BorderX, BorderY, BorderWidth, BorderHeight)));
+ Stack->PushBool(SUCCEEDED(setBorder(BorderX, BorderY, BorderWidth, BorderHeight)));
return S_OK;
}
@@ -441,7 +441,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack int Top = Stack->Pop()->GetInt();
int Bottom = Stack->Pop()->GetInt();
- Stack->PushBool(SUCCEEDED(SetBorderThickness(Left, Right, Top, Bottom)));
+ Stack->PushBool(SUCCEEDED(setBorderThickness(Left, Right, Top, Bottom)));
return S_OK;
}
@@ -451,7 +451,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack else if (strcmp(Name, "AddSprite") == 0) {
Stack->CorrectParams(1);
const char *SpriteFile = Stack->Pop()->GetString();
- Stack->PushBool(SUCCEEDED(AddSprite(SpriteFile)));
+ Stack->PushBool(SUCCEEDED(addSprite(SpriteFile)));
return S_OK;
}
@@ -461,7 +461,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack else if (strcmp(Name, "RemoveSprite") == 0) {
Stack->CorrectParams(1);
const char *SpriteFile = Stack->Pop()->GetString();
- Stack->PushBool(SUCCEEDED(RemoveSprite(SpriteFile)));
+ Stack->PushBool(SUCCEEDED(removeSprite(SpriteFile)));
return S_OK;
}
@@ -472,7 +472,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack else if (strcmp(Name, "Start") == 0) {
Stack->CorrectParams(1);
_overheadTime = Stack->Pop()->GetInt();
- Stack->PushBool(SUCCEEDED(Start()));
+ Stack->PushBool(SUCCEEDED(start()));
return S_OK;
}
@@ -525,7 +525,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack float Angle = Stack->Pop()->GetFloat();
float Strength = Stack->Pop()->GetFloat();
- Stack->PushBool(SUCCEEDED(AddForce(forceName, CPartForce::FORCE_GLOBAL, 0, 0, Angle, Strength)));
+ Stack->PushBool(SUCCEEDED(addForce(forceName, CPartForce::FORCE_GLOBAL, 0, 0, Angle, Strength)));
return S_OK;
}
@@ -541,7 +541,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack float Angle = Stack->Pop()->GetFloat();
float Strength = Stack->Pop()->GetFloat();
- Stack->PushBool(SUCCEEDED(AddForce(forceName, CPartForce::FORCE_GLOBAL, PosX, PosY, Angle, Strength)));
+ Stack->PushBool(SUCCEEDED(addForce(forceName, CPartForce::FORCE_GLOBAL, PosX, PosY, Angle, Strength)));
return S_OK;
}
@@ -553,7 +553,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack Stack->CorrectParams(1);
const char *forceName = Stack->Pop()->GetString();
- Stack->PushBool(SUCCEEDED(RemoveForce(forceName)));
+ Stack->PushBool(SUCCEEDED(removeForce(forceName)));
return S_OK;
}
diff --git a/engines/wintermute/Base/PartEmitter.h b/engines/wintermute/Base/PartEmitter.h index f4ef67fe69..1fd061f95b 100644 --- a/engines/wintermute/Base/PartEmitter.h +++ b/engines/wintermute/Base/PartEmitter.h @@ -100,19 +100,20 @@ public: char *_emitEvent;
CBScriptHolder *_owner;
- HRESULT Start();
+ HRESULT start();
HRESULT update();
- HRESULT display(CBRegion *Region = NULL);
+ HRESULT display() { return display(NULL); } // To avoid shadowing the inherited display-function.
+ HRESULT display(CBRegion *Region);
- HRESULT SortParticlesByZ();
- HRESULT AddSprite(const char *Filename);
- HRESULT RemoveSprite(const char *Filename);
- HRESULT SetBorder(int X, int Y, int Width, int Height);
- HRESULT SetBorderThickness(int ThicknessLeft, int ThicknessRight, int ThicknessTop, int ThicknessBottom);
+ HRESULT sortParticlesByZ();
+ HRESULT addSprite(const char *Filename);
+ HRESULT removeSprite(const char *Filename);
+ HRESULT setBorder(int X, int Y, int Width, int Height);
+ HRESULT setBorderThickness(int ThicknessLeft, int ThicknessRight, int ThicknessTop, int ThicknessBottom);
- HRESULT AddForce(const char *Name, CPartForce::TForceType Type, int PosX, int PosY, float Angle, float Strength);
- HRESULT RemoveForce(const char *Name);
+ HRESULT addForce(const char *Name, CPartForce::TForceType Type, int PosX, int PosY, float Angle, float Strength);
+ HRESULT removeForce(const char *Name);
CBArray<CPartForce *, CPartForce *> _forces;
@@ -124,10 +125,10 @@ public: private:
- CPartForce *AddForceByName(const char *Name);
- int static CompareZ(const void *Obj1, const void *Obj2);
- HRESULT InitParticle(CPartParticle *Particle, uint32 CurrentTime, uint32 TimerDelta);
- HRESULT UpdateInternal(uint32 CurrentTime, uint32 TimerDelta);
+ CPartForce *addForceByName(const char *Name);
+ int static compareZ(const void *Obj1, const void *Obj2);
+ HRESULT initParticle(CPartParticle *Particle, uint32 CurrentTime, uint32 TimerDelta);
+ HRESULT updateInternal(uint32 CurrentTime, uint32 TimerDelta);
uint32 _lastGenTime;
CBArray<CPartParticle *, CPartParticle *> _particles;
CBArray<char *, char *> _sprites;
diff --git a/engines/wintermute/Base/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp index 69b933b518..4b1475f780 100644 --- a/engines/wintermute/Base/PartParticle.cpp +++ b/engines/wintermute/Base/PartParticle.cpp @@ -72,7 +72,7 @@ CPartParticle::~CPartParticle(void) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartParticle::SetSprite(const char *Filename) {
+HRESULT CPartParticle::setSprite(const char *Filename) {
if (_sprite && _sprite->_filename && scumm_stricmp(Filename, _sprite->_filename) == 0) {
_sprite->Reset();
return S_OK;
@@ -116,7 +116,7 @@ HRESULT CPartParticle::update(CPartEmitter *Emitter, uint32 CurrentTime, uint32 if (_lifeTime > 0) {
if (CurrentTime - _creationTime >= _lifeTime) {
if (Emitter->_fadeOutTime > 0)
- FadeOut(CurrentTime, Emitter->_fadeOutTime);
+ fadeOut(CurrentTime, Emitter->_fadeOutTime);
else
_isDead = true;
}
@@ -127,7 +127,7 @@ HRESULT CPartParticle::update(CPartEmitter *Emitter, uint32 CurrentTime, uint32 POINT p;
p.x = _pos.x;
p.y = _pos.y;
- if (!CBPlatform::PtInRect(&_border, p)) FadeOut(CurrentTime, Emitter->_fadeOutTime);
+ if (!CBPlatform::PtInRect(&_border, p)) fadeOut(CurrentTime, Emitter->_fadeOutTime);
}
if (_state != PARTICLE_NORMAL) return S_OK;
@@ -195,7 +195,7 @@ HRESULT CPartParticle::display(CPartEmitter *Emitter) { //////////////////////////////////////////////////////////////////////////
-HRESULT CPartParticle::FadeIn(uint32 CurrentTime, int FadeTime) {
+HRESULT CPartParticle::fadeIn(uint32 CurrentTime, int FadeTime) {
_currentAlpha = 0;
_fadeStart = CurrentTime;
_fadeTime = FadeTime;
@@ -205,7 +205,7 @@ HRESULT CPartParticle::FadeIn(uint32 CurrentTime, int FadeTime) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartParticle::FadeOut(uint32 CurrentTime, int FadeTime) {
+HRESULT CPartParticle::fadeOut(uint32 CurrentTime, int FadeTime) {
//_currentAlpha = 255;
_fadeStartAlpha = _currentAlpha;
_fadeStart = CurrentTime;
@@ -243,7 +243,7 @@ HRESULT CPartParticle::persist(CBPersistMgr *persistMgr) { char *Filename;
persistMgr->transfer(TMEMBER(Filename));
CSysClassRegistry::GetInstance()->_disabled = true;
- SetSprite(Filename);
+ setSprite(Filename);
CSysClassRegistry::GetInstance()->_disabled = false;
delete[] Filename;
Filename = NULL;
diff --git a/engines/wintermute/Base/PartParticle.h b/engines/wintermute/Base/PartParticle.h index 9618954475..9edc999426 100644 --- a/engines/wintermute/Base/PartParticle.h +++ b/engines/wintermute/Base/PartParticle.h @@ -71,10 +71,10 @@ public: HRESULT update(CPartEmitter *Emitter, uint32 CurrentTime, uint32 TimerDelta);
HRESULT display(CPartEmitter *Emitter);
- HRESULT SetSprite(const char *Filename);
+ HRESULT setSprite(const char *Filename);
- HRESULT FadeIn(uint32 CurrentTime, int FadeTime);
- HRESULT FadeOut(uint32 CurrentTime, int FadeTime);
+ HRESULT fadeIn(uint32 CurrentTime, int FadeTime);
+ HRESULT fadeOut(uint32 CurrentTime, int FadeTime);
HRESULT persist(CBPersistMgr *PersistMgr);
private:
|