diff options
author | Einar Johan Trøan Sømåen | 2012-07-03 04:31:32 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-03 04:31:32 +0200 |
commit | f4f64a26a9010989fba2758fa53c4b913d37e142 (patch) | |
tree | 4e8624d08d2e802caf9dc85e8405827905f8426a /engines | |
parent | 453e597b31a11cec3f7f2af4d6ff4f66e9e9acf2 (diff) | |
download | scummvm-rg350-f4f64a26a9010989fba2758fa53c4b913d37e142.tar.gz scummvm-rg350-f4f64a26a9010989fba2758fa53c4b913d37e142.tar.bz2 scummvm-rg350-f4f64a26a9010989fba2758fa53c4b913d37e142.zip |
WINTERMUTE: Mass rename varName->VarName
Diffstat (limited to 'engines')
77 files changed, 2847 insertions, 2847 deletions
diff --git a/engines/wintermute/Ad/AdActor.cpp b/engines/wintermute/Ad/AdActor.cpp index 9090f3038e..7e76ab4737 100644 --- a/engines/wintermute/Ad/AdActor.cpp +++ b/engines/wintermute/Ad/AdActor.cpp @@ -850,17 +850,17 @@ void CAdActor::initLine(CBPoint startPt, CBPoint endPt) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *name) {
+HRESULT CAdActor::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GoTo / GoToAsync
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "GoTo") == 0 || strcmp(name, "GoToAsync") == 0) {
- Stack->CorrectParams(2);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
+ stack->CorrectParams(2);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
goTo(X, Y);
- if (strcmp(name, "GoToAsync") != 0) Script->WaitForExclusive(this);
- Stack->PushNULL();
+ if (strcmp(name, "GoToAsync") != 0) script->WaitForExclusive(this);
+ stack->PushNULL();
return S_OK;
}
@@ -868,24 +868,24 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi // GoToObject / GoToObjectAsync
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GoToObject") == 0 || strcmp(name, "GoToObjectAsync") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (!Val->IsNative()) {
- Script->RuntimeError("actor.%s method accepts an entity refrence only", name);
- Stack->PushNULL();
+ script->RuntimeError("actor.%s method accepts an entity refrence only", name);
+ stack->PushNULL();
return S_OK;
}
CAdObject *Obj = (CAdObject *)Val->GetNative();
if (!Obj || Obj->_type != OBJECT_ENTITY) {
- Script->RuntimeError("actor.%s method accepts an entity refrence only", name);
- Stack->PushNULL();
+ script->RuntimeError("actor.%s method accepts an entity refrence only", name);
+ stack->PushNULL();
return S_OK;
}
CAdEntity *Ent = (CAdEntity *)Obj;
if (Ent->_walkToX == 0 && Ent->_walkToY == 0) goTo(Ent->_posX, Ent->_posY);
else goTo(Ent->_walkToX, Ent->_walkToY, Ent->_walkToDir);
- if (strcmp(name, "GoToObjectAsync") != 0) Script->WaitForExclusive(this);
- Stack->PushNULL();
+ if (strcmp(name, "GoToObjectAsync") != 0) script->WaitForExclusive(this);
+ stack->PushNULL();
return S_OK;
}
@@ -893,9 +893,9 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi // TurnTo / TurnToAsync
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "TurnTo") == 0 || strcmp(name, "TurnToAsync") == 0) {
- Stack->CorrectParams(1);
+ stack->CorrectParams(1);
int dir;
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
// turn to object?
if (val->IsNative() && Game->ValidObject((CBObject *)val->GetNative())) {
@@ -908,9 +908,9 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi if (dir >= 0 && dir < NUM_DIRECTIONS) {
turnTo((TDirection)dir);
- if (strcmp(name, "TurnToAsync") != 0) Script->WaitForExclusive(this);
+ if (strcmp(name, "TurnToAsync") != 0) script->WaitForExclusive(this);
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -918,8 +918,8 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi // IsWalking
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "IsWalking") == 0) {
- Stack->CorrectParams(0);
- Stack->PushBool(_state == STATE_FOLLOWING_PATH);
+ stack->CorrectParams(0);
+ stack->PushBool(_state == STATE_FOLLOWING_PATH);
return S_OK;
}
@@ -927,8 +927,8 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi // MergeAnims
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "MergeAnims") == 0) {
- Stack->CorrectParams(1);
- Stack->PushBool(SUCCEEDED(mergeAnims(Stack->Pop()->GetString())));
+ stack->CorrectParams(1);
+ stack->PushBool(SUCCEEDED(mergeAnims(stack->Pop()->GetString())));
return S_OK;
}
@@ -936,8 +936,8 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi // UnloadAnim
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "UnloadAnim") == 0) {
- Stack->CorrectParams(1);
- const char *AnimName = Stack->Pop()->GetString();
+ stack->CorrectParams(1);
+ const char *AnimName = stack->Pop()->GetString();
bool Found = false;
for (int i = 0; i < _anims.GetSize(); i++) {
@@ -954,7 +954,7 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi Found = true;
}
}
- Stack->PushBool(Found);
+ stack->PushBool(Found);
return S_OK;
}
@@ -962,13 +962,13 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi // HasAnim
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "HasAnim") == 0) {
- Stack->CorrectParams(1);
- const char *AnimName = Stack->Pop()->GetString();
- Stack->PushBool(getAnimByName(AnimName) != NULL);
+ stack->CorrectParams(1);
+ const char *AnimName = stack->Pop()->GetString();
+ stack->PushBool(getAnimByName(AnimName) != NULL);
return S_OK;
}
- else return CAdTalkHolder::scCallMethod(Script, Stack, ThisStack, name);
+ else return CAdTalkHolder::scCallMethod(script, stack, thisStack, name);
}
diff --git a/engines/wintermute/Ad/AdEntity.cpp b/engines/wintermute/Ad/AdEntity.cpp index 22f85d58cf..d4252f9f55 100644 --- a/engines/wintermute/Ad/AdEntity.cpp +++ b/engines/wintermute/Ad/AdEntity.cpp @@ -625,27 +625,27 @@ HRESULT CAdEntity::update() { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CAdEntity::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// StopSound
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "StopSound") == 0 && _subtype == ENTITY_SOUND) {
- Stack->CorrectParams(0);
+ if (strcmp(name, "StopSound") == 0 && _subtype == ENTITY_SOUND) {
+ stack->CorrectParams(0);
- if (FAILED(stopSFX(false))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(stopSFX(false))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// PlayTheora
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PlayTheora") == 0) {
- Stack->CorrectParams(4);
- const char *Filename = Stack->Pop()->GetString();
- bool Looping = Stack->Pop()->GetBool(false);
- CScValue *ValAlpha = Stack->Pop();
- int StartTime = Stack->Pop()->GetInt();
+ else if (strcmp(name, "PlayTheora") == 0) {
+ stack->CorrectParams(4);
+ const char *Filename = stack->Pop()->GetString();
+ bool Looping = stack->Pop()->GetBool(false);
+ CScValue *ValAlpha = stack->Pop();
+ int StartTime = stack->Pop()->GetInt();
delete _theora;
_theora = new CVidTheoraPlayer(Game);
@@ -653,10 +653,10 @@ HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th if (!ValAlpha->IsNULL()) _theora->setAlphaImage(ValAlpha->GetString());
_theora->play(VID_PLAY_POS, 0, 0, false, false, Looping, StartTime, _scale >= 0.0f ? _scale : -1.0f, _sFXVolume);
//if(m_Scale>=0) m_Theora->m_PlayZoom = m_Scale;
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
- Script->RuntimeError("Entity.PlayTheora - error playing video '%s'", Filename);
- Stack->PushBool(false);
+ script->RuntimeError("Entity.PlayTheora - error playing video '%s'", Filename);
+ stack->PushBool(false);
}
return S_OK;
@@ -665,14 +665,14 @@ HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// StopTheora
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StopTheora") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "StopTheora") == 0) {
+ stack->CorrectParams(0);
if (_theora) {
_theora->stop();
delete _theora;
_theora = NULL;
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -680,10 +680,10 @@ HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// IsTheoraPlaying
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsTheoraPlaying") == 0) {
- Stack->CorrectParams(0);
- if (_theora && _theora->isPlaying()) Stack->PushBool(true);
- else Stack->PushBool(false);
+ else if (strcmp(name, "IsTheoraPlaying") == 0) {
+ stack->CorrectParams(0);
+ if (_theora && _theora->isPlaying()) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -691,12 +691,12 @@ HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// PauseTheora
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PauseTheora") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "PauseTheora") == 0) {
+ stack->CorrectParams(0);
if (_theora && _theora->isPlaying()) {
_theora->pause();
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -704,12 +704,12 @@ HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// ResumeTheora
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ResumeTheora") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ResumeTheora") == 0) {
+ stack->CorrectParams(0);
if (_theora && _theora->isPaused()) {
_theora->resume();
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -717,10 +717,10 @@ HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// IsTheoraPaused
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsTheoraPaused") == 0) {
- Stack->CorrectParams(0);
- if (_theora && _theora->isPaused()) Stack->PushBool(true);
- else Stack->PushBool(false);
+ else if (strcmp(name, "IsTheoraPaused") == 0) {
+ stack->CorrectParams(0);
+ if (_theora && _theora->isPaused()) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -729,14 +729,14 @@ HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// CreateRegion
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateRegion") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "CreateRegion") == 0) {
+ stack->CorrectParams(0);
if (!_region) {
_region = new CBRegion(Game);
Game->RegisterObject(_region);
}
- if (_region) Stack->PushNative(_region, true);
- else Stack->PushNULL();
+ if (_region) stack->PushNative(_region, true);
+ else stack->PushNULL();
return S_OK;
}
@@ -744,29 +744,29 @@ HRESULT CAdEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// DeleteRegion
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteRegion") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "DeleteRegion") == 0) {
+ stack->CorrectParams(0);
if (_region) {
Game->UnregisterObject(_region);
_region = NULL;
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
- else return CAdTalkHolder::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CAdTalkHolder::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CAdEntity::scGetProperty(const char *Name) {
+CScValue *CAdEntity::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("entity");
return _scValue;
}
@@ -774,7 +774,7 @@ CScValue *CAdEntity::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Item
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Item") == 0) {
+ else if (strcmp(name, "Item") == 0) {
if (_item) _scValue->SetString(_item);
else _scValue->SetNULL();
@@ -784,7 +784,7 @@ CScValue *CAdEntity::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Subtype (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Subtype") == 0) {
+ else if (strcmp(name, "Subtype") == 0) {
if (_subtype == ENTITY_SOUND)
_scValue->SetString("sound");
else
@@ -796,7 +796,7 @@ CScValue *CAdEntity::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// WalkToX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WalkToX") == 0) {
+ else if (strcmp(name, "WalkToX") == 0) {
_scValue->SetInt(_walkToX);
return _scValue;
}
@@ -804,7 +804,7 @@ CScValue *CAdEntity::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// WalkToY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WalkToY") == 0) {
+ else if (strcmp(name, "WalkToY") == 0) {
_scValue->SetInt(_walkToY);
return _scValue;
}
@@ -812,7 +812,7 @@ CScValue *CAdEntity::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// WalkToDirection
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WalkToDirection") == 0) {
+ else if (strcmp(name, "WalkToDirection") == 0) {
_scValue->SetInt((int)_walkToDir);
return _scValue;
}
@@ -820,23 +820,23 @@ CScValue *CAdEntity::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Region (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Region") == 0) {
+ else if (strcmp(name, "Region") == 0) {
if (_region) _scValue->SetNative(_region, true);
else _scValue->SetNULL();
return _scValue;
}
- else return CAdTalkHolder::scGetProperty(Name);
+ else return CAdTalkHolder::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdEntity::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CAdEntity::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Item
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Item") == 0) {
+ if (strcmp(name, "Item") == 0) {
SetItem(Value->GetString());
return S_OK;
}
@@ -844,7 +844,7 @@ HRESULT CAdEntity::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// WalkToX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WalkToX") == 0) {
+ else if (strcmp(name, "WalkToX") == 0) {
_walkToX = Value->GetInt();
return S_OK;
}
@@ -852,7 +852,7 @@ HRESULT CAdEntity::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// WalkToY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WalkToY") == 0) {
+ else if (strcmp(name, "WalkToY") == 0) {
_walkToY = Value->GetInt();
return S_OK;
}
@@ -860,13 +860,13 @@ HRESULT CAdEntity::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// WalkToDirection
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WalkToDirection") == 0) {
+ else if (strcmp(name, "WalkToDirection") == 0) {
int Dir = Value->GetInt();
if (Dir >= 0 && Dir < NUM_DIRECTIONS) _walkToDir = (TDirection)Dir;
return S_OK;
}
- else return CAdTalkHolder::scSetProperty(Name, Value);
+ else return CAdTalkHolder::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Ad/AdEntity.h b/engines/wintermute/Ad/AdEntity.h index 0d6864d8eb..380cf7fcae 100644 --- a/engines/wintermute/Ad/AdEntity.h +++ b/engines/wintermute/Ad/AdEntity.h @@ -56,9 +56,9 @@ public: TEntityType _subtype;
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp index 7758737359..34d9c600a7 100644 --- a/engines/wintermute/Ad/AdGame.cpp +++ b/engines/wintermute/Ad/AdGame.cpp @@ -316,27 +316,27 @@ void CAdGame::FinishSentences() { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// ChangeScene
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "ChangeScene") == 0) {
- Stack->CorrectParams(3);
- const char *Filename = Stack->Pop()->GetString();
- CScValue *valFadeOut = Stack->Pop();
- CScValue *valFadeIn = Stack->Pop();
+ if (strcmp(name, "ChangeScene") == 0) {
+ stack->CorrectParams(3);
+ const char *Filename = stack->Pop()->GetString();
+ CScValue *valFadeOut = stack->Pop();
+ CScValue *valFadeIn = stack->Pop();
bool TransOut = valFadeOut->IsNULL() ? true : valFadeOut->GetBool();
bool TransIn = valFadeIn->IsNULL() ? true : valFadeIn->GetBool();
ScheduleChangeScene(Filename, TransIn);
if (TransOut) _transMgr->start(TRANSITION_FADE_OUT, true);
- Stack->PushNULL();
+ stack->PushNULL();
- //HRESULT ret = ChangeScene(Stack->Pop()->GetString());
- //if(FAILED(ret)) Stack->PushBool(false);
- //else Stack->PushBool(true);
+ //HRESULT ret = ChangeScene(stack->Pop()->GetString());
+ //if(FAILED(ret)) stack->PushBool(false);
+ //else stack->PushBool(true);
return S_OK;
}
@@ -344,16 +344,16 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// LoadActor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadActor") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "LoadActor") == 0) {
+ stack->CorrectParams(1);
CAdActor *act = new CAdActor(Game);
- if (act && SUCCEEDED(act->loadFile(Stack->Pop()->GetString()))) {
+ if (act && SUCCEEDED(act->loadFile(stack->Pop()->GetString()))) {
AddObject(act);
- Stack->PushNative(act, true);
+ stack->PushNative(act, true);
} else {
delete act;
act = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
}
return S_OK;
}
@@ -361,16 +361,16 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// LoadEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadEntity") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "LoadEntity") == 0) {
+ stack->CorrectParams(1);
CAdEntity *ent = new CAdEntity(Game);
- if (ent && SUCCEEDED(ent->loadFile(Stack->Pop()->GetString()))) {
+ if (ent && SUCCEEDED(ent->loadFile(stack->Pop()->GetString()))) {
AddObject(ent);
- Stack->PushNative(ent, true);
+ stack->PushNative(ent, true);
} else {
delete ent;
ent = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
}
return S_OK;
}
@@ -378,51 +378,51 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// UnloadObject / UnloadActor / UnloadEntity / DeleteEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "UnloadObject") == 0 || strcmp(Name, "UnloadActor") == 0 || strcmp(Name, "UnloadEntity") == 0 || strcmp(Name, "DeleteEntity") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ else if (strcmp(name, "UnloadObject") == 0 || strcmp(name, "UnloadActor") == 0 || strcmp(name, "UnloadEntity") == 0 || strcmp(name, "DeleteEntity") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
CAdObject *obj = (CAdObject *)val->GetNative();
RemoveObject(obj);
if (val->GetType() == VAL_VARIABLE_REF) val->SetNULL();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// CreateEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateEntity") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "CreateEntity") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdEntity *Ent = new CAdEntity(Game);
AddObject(Ent);
if (!Val->IsNULL()) Ent->setName(Val->GetString());
- Stack->PushNative(Ent, true);
+ stack->PushNative(Ent, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// CreateItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateItem") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "CreateItem") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdItem *Item = new CAdItem(Game);
AddItem(Item);
if (!Val->IsNULL()) Item->setName(Val->GetString());
- Stack->PushNative(Item, true);
+ stack->PushNative(Item, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DeleteItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteItem") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "DeleteItem") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdItem *Item = NULL;
if (Val->IsNative()) Item = (CAdItem *)Val->GetNative();
@@ -432,16 +432,16 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This DeleteItem(Item);
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// QueryItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "QueryItem") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "QueryItem") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdItem *Item = NULL;
if (Val->IsInt()) {
@@ -451,8 +451,8 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This Item = GetItemByName(Val->GetString());
}
- if (Item) Stack->PushNative(Item, true);
- else Stack->PushNULL();
+ if (Item) stack->PushNative(Item, true);
+ else stack->PushNULL();
return S_OK;
}
@@ -461,14 +461,14 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// AddResponse/AddResponseOnce/AddResponseOnceGame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddResponse") == 0 || strcmp(Name, "AddResponseOnce") == 0 || strcmp(Name, "AddResponseOnceGame") == 0) {
- Stack->CorrectParams(6);
- int id = Stack->Pop()->GetInt();
- const char *text = Stack->Pop()->GetString();
- CScValue *val1 = Stack->Pop();
- CScValue *val2 = Stack->Pop();
- CScValue *val3 = Stack->Pop();
- CScValue *val4 = Stack->Pop();
+ else if (strcmp(name, "AddResponse") == 0 || strcmp(name, "AddResponseOnce") == 0 || strcmp(name, "AddResponseOnceGame") == 0) {
+ stack->CorrectParams(6);
+ int id = stack->Pop()->GetInt();
+ const char *text = stack->Pop()->GetString();
+ CScValue *val1 = stack->Pop();
+ CScValue *val2 = stack->Pop();
+ CScValue *val3 = stack->Pop();
+ CScValue *val4 = stack->Pop();
if (_responseBox) {
CAdResponse *res = new CAdResponse(Game);
@@ -481,15 +481,15 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This if (!val3->IsNULL()) res->SetIconPressed(val3->GetString());
if (!val4->IsNULL()) res->SetFont(val4->GetString());
- if (strcmp(Name, "AddResponseOnce") == 0) res->_responseType = RESPONSE_ONCE;
- else if (strcmp(Name, "AddResponseOnceGame") == 0) res->_responseType = RESPONSE_ONCE_GAME;
+ if (strcmp(name, "AddResponseOnce") == 0) res->_responseType = RESPONSE_ONCE;
+ else if (strcmp(name, "AddResponseOnceGame") == 0) res->_responseType = RESPONSE_ONCE_GAME;
_responseBox->_responses.Add(res);
}
} else {
- Script->RuntimeError("Game.AddResponse: response box is not defined");
+ script->RuntimeError("Game.AddResponse: response box is not defined");
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -497,56 +497,56 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ResetResponse
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ResetResponse") == 0) {
- Stack->CorrectParams(1);
- int ID = Stack->Pop()->GetInt(-1);
+ else if (strcmp(name, "ResetResponse") == 0) {
+ stack->CorrectParams(1);
+ int ID = stack->Pop()->GetInt(-1);
ResetResponse(ID);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ClearResponses
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ClearResponses") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ClearResponses") == 0) {
+ stack->CorrectParams(0);
_responseBox->clearResponses();
_responseBox->clearButtons();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetResponse
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetResponse") == 0) {
- Stack->CorrectParams(1);
- bool AutoSelectLast = Stack->Pop()->GetBool();
+ else if (strcmp(name, "GetResponse") == 0) {
+ stack->CorrectParams(1);
+ bool AutoSelectLast = stack->Pop()->GetBool();
if (_responseBox) {
_responseBox->weedResponses();
if (_responseBox->_responses.GetSize() == 0) {
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
if (_responseBox->_responses.GetSize() == 1 && AutoSelectLast) {
- Stack->PushInt(_responseBox->_responses[0]->_iD);
+ stack->PushInt(_responseBox->_responses[0]->_iD);
_responseBox->handleResponse(_responseBox->_responses[0]);
_responseBox->clearResponses();
return S_OK;
}
_responseBox->createButtons();
- _responseBox->_waitingScript = Script;
- Script->WaitForExclusive(_responseBox);
+ _responseBox->_waitingScript = script;
+ script->WaitForExclusive(_responseBox);
_state = GAME_SEMI_FROZEN;
_stateEx = GAME_WAITING_RESPONSE;
} else {
- Script->RuntimeError("Game.GetResponse: response box is not defined");
- Stack->PushNULL();
+ script->RuntimeError("Game.GetResponse: response box is not defined");
+ stack->PushNULL();
}
return S_OK;
}
@@ -555,14 +555,14 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// GetNumResponses
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetNumResponses") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetNumResponses") == 0) {
+ stack->CorrectParams(0);
if (_responseBox) {
_responseBox->weedResponses();
- Stack->PushInt(_responseBox->_responses.GetSize());
+ stack->PushInt(_responseBox->_responses.GetSize());
} else {
- Script->RuntimeError("Game.GetNumResponses: response box is not defined");
- Stack->PushNULL();
+ script->RuntimeError("Game.GetNumResponses: response box is not defined");
+ stack->PushNULL();
}
return S_OK;
}
@@ -571,16 +571,16 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// StartDlgBranch
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StartDlgBranch") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "StartDlgBranch") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
Common::String BranchName;
if (Val->IsNULL()) {
- BranchName.format("line%d", Script->_currentLine);
+ BranchName.format("line%d", script->_currentLine);
} else BranchName = Val->GetString();
- StartDlgBranch(BranchName.c_str(), Script->_filename == NULL ? "" : Script->_filename, Script->_threadEvent == NULL ? "" : Script->_threadEvent);
- Stack->PushNULL();
+ StartDlgBranch(BranchName.c_str(), script->_filename == NULL ? "" : script->_filename, script->_threadEvent == NULL ? "" : script->_threadEvent);
+ stack->PushNULL();
return S_OK;
}
@@ -588,15 +588,15 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// EndDlgBranch
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "EndDlgBranch") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "EndDlgBranch") == 0) {
+ stack->CorrectParams(1);
const char *BranchName = NULL;
- CScValue *Val = Stack->Pop();
+ CScValue *Val = stack->Pop();
if (!Val->IsNULL()) BranchName = Val->GetString();
- EndDlgBranch(BranchName, Script->_filename == NULL ? "" : Script->_filename, Script->_threadEvent == NULL ? "" : Script->_threadEvent);
+ EndDlgBranch(BranchName, script->_filename == NULL ? "" : script->_filename, script->_threadEvent == NULL ? "" : script->_threadEvent);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -604,12 +604,12 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// GetCurrentDlgBranch
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetCurrentDlgBranch") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetCurrentDlgBranch") == 0) {
+ stack->CorrectParams(0);
if (_dlgPendingBranches.GetSize() > 0) {
- Stack->PushString(_dlgPendingBranches[_dlgPendingBranches.GetSize() - 1]);
- } else Stack->PushNULL();
+ stack->PushString(_dlgPendingBranches[_dlgPendingBranches.GetSize() - 1]);
+ } else stack->PushNULL();
return S_OK;
}
@@ -617,67 +617,67 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// TakeItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TakeItem") == 0) {
- return _invObject->scCallMethod(Script, Stack, ThisStack, Name);
+ else if (strcmp(name, "TakeItem") == 0) {
+ return _invObject->scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
// DropItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DropItem") == 0) {
- return _invObject->scCallMethod(Script, Stack, ThisStack, Name);
+ else if (strcmp(name, "DropItem") == 0) {
+ return _invObject->scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
// GetItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetItem") == 0) {
- return _invObject->scCallMethod(Script, Stack, ThisStack, Name);
+ else if (strcmp(name, "GetItem") == 0) {
+ return _invObject->scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
// HasItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HasItem") == 0) {
- return _invObject->scCallMethod(Script, Stack, ThisStack, Name);
+ else if (strcmp(name, "HasItem") == 0) {
+ return _invObject->scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
// IsItemTaken
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsItemTaken") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "IsItemTaken") == 0) {
+ stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
if (!val->IsNULL()) {
for (int i = 0; i < _inventories.GetSize(); i++) {
CAdInventory *Inv = _inventories[i];
for (int j = 0; j < Inv->_takenItems.GetSize(); j++) {
if (val->GetNative() == Inv->_takenItems[j]) {
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
} else if (scumm_stricmp(val->GetString(), Inv->_takenItems[j]->_name) == 0) {
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
}
}
- } else Script->RuntimeError("Game.IsItemTaken: item name expected");
+ } else script->RuntimeError("Game.IsItemTaken: item name expected");
- Stack->PushBool(false);
+ stack->PushBool(false);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetInventoryWindow
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetInventoryWindow") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetInventoryWindow") == 0) {
+ stack->CorrectParams(0);
if (_inventoryBox && _inventoryBox->_window)
- Stack->PushNative(_inventoryBox->_window, true);
+ stack->PushNative(_inventoryBox->_window, true);
else
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -685,12 +685,12 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// GetResponsesWindow
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetResponsesWindow") == 0 || strcmp(Name, "GetResponseWindow") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetResponsesWindow") == 0 || strcmp(name, "GetResponseWindow") == 0) {
+ stack->CorrectParams(0);
if (_responseBox && _responseBox->_window)
- Stack->PushNative(_responseBox->_window, true);
+ stack->PushNative(_responseBox->_window, true);
else
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -698,19 +698,19 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// LoadResponseBox
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadResponseBox") == 0) {
- Stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ else if (strcmp(name, "LoadResponseBox") == 0) {
+ stack->CorrectParams(1);
+ const char *Filename = stack->Pop()->GetString();
Game->UnregisterObject(_responseBox);
_responseBox = new CAdResponseBox(Game);
if (_responseBox && !FAILED(_responseBox->loadFile(Filename))) {
RegisterObject(_responseBox);
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
delete _responseBox;
_responseBox = NULL;
- Stack->PushBool(false);
+ stack->PushBool(false);
}
return S_OK;
}
@@ -718,19 +718,19 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// LoadInventoryBox
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadInventoryBox") == 0) {
- Stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ else if (strcmp(name, "LoadInventoryBox") == 0) {
+ stack->CorrectParams(1);
+ const char *Filename = stack->Pop()->GetString();
Game->UnregisterObject(_inventoryBox);
_inventoryBox = new CAdInventoryBox(Game);
if (_inventoryBox && !FAILED(_inventoryBox->loadFile(Filename))) {
RegisterObject(_inventoryBox);
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
delete _inventoryBox;
_inventoryBox = NULL;
- Stack->PushBool(false);
+ stack->PushBool(false);
}
return S_OK;
}
@@ -738,13 +738,13 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// LoadItems
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadItems") == 0) {
- Stack->CorrectParams(2);
- const char *Filename = Stack->Pop()->GetString();
- bool Merge = Stack->Pop()->GetBool(false);
+ else if (strcmp(name, "LoadItems") == 0) {
+ stack->CorrectParams(2);
+ const char *Filename = stack->Pop()->GetString();
+ bool Merge = stack->Pop()->GetBool(false);
HRESULT Ret = LoadItemsFile(Filename, Merge);
- Stack->PushBool(SUCCEEDED(Ret));
+ stack->PushBool(SUCCEEDED(Ret));
return S_OK;
}
@@ -752,10 +752,10 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// AddSpeechDir
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddSpeechDir") == 0) {
- Stack->CorrectParams(1);
- const char *Dir = Stack->Pop()->GetString();
- Stack->PushBool(SUCCEEDED(AddSpeechDir(Dir)));
+ else if (strcmp(name, "AddSpeechDir") == 0) {
+ stack->CorrectParams(1);
+ const char *Dir = stack->Pop()->GetString();
+ stack->PushBool(SUCCEEDED(AddSpeechDir(Dir)));
return S_OK;
}
@@ -763,10 +763,10 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// RemoveSpeechDir
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RemoveSpeechDir") == 0) {
- Stack->CorrectParams(1);
- const char *Dir = Stack->Pop()->GetString();
- Stack->PushBool(SUCCEEDED(RemoveSpeechDir(Dir)));
+ else if (strcmp(name, "RemoveSpeechDir") == 0) {
+ stack->CorrectParams(1);
+ const char *Dir = stack->Pop()->GetString();
+ stack->PushBool(SUCCEEDED(RemoveSpeechDir(Dir)));
return S_OK;
}
@@ -774,12 +774,12 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// SetSceneViewport
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetSceneViewport") == 0) {
- Stack->CorrectParams(4);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
- int Width = Stack->Pop()->GetInt();
- int Height = Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetSceneViewport") == 0) {
+ stack->CorrectParams(4);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
+ int Width = stack->Pop()->GetInt();
+ int Height = stack->Pop()->GetInt();
if (Width <= 0) Width = _renderer->_width;
if (Height <= 0) Height = _renderer->_height;
@@ -787,31 +787,31 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This if (!_sceneViewport) _sceneViewport = new CBViewport(Game);
if (_sceneViewport) _sceneViewport->setRect(X, Y, X + Width, Y + Height);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
- else return CBGame::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBGame::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CAdGame::scGetProperty(const char *Name) {
+CScValue *CAdGame::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("game");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Scene
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scene") == 0) {
+ else if (strcmp(name, "Scene") == 0) {
if (_scene) _scValue->SetNative(_scene, true);
else _scValue->SetNULL();
@@ -820,7 +820,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SelectedItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SelectedItem") == 0) {
+ else if (strcmp(name, "SelectedItem") == 0) {
//if(_selectedItem) _scValue->SetString(_selectedItem->_name);
if (_selectedItem) _scValue->SetNative(_selectedItem, true);
else _scValue->SetNULL();
@@ -830,14 +830,14 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumItems
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumItems") == 0) {
- return _invObject->scGetProperty(Name);
+ else if (strcmp(name, "NumItems") == 0) {
+ return _invObject->scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
// SmartItemCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SmartItemCursor") == 0) {
+ else if (strcmp(name, "SmartItemCursor") == 0) {
_scValue->SetBool(_smartItemCursor);
return _scValue;
}
@@ -845,7 +845,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// InventoryVisible
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InventoryVisible") == 0) {
+ else if (strcmp(name, "InventoryVisible") == 0) {
_scValue->SetBool(_inventoryBox && _inventoryBox->_visible);
return _scValue;
}
@@ -853,7 +853,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// InventoryScrollOffset
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InventoryScrollOffset") == 0) {
+ else if (strcmp(name, "InventoryScrollOffset") == 0) {
if (_inventoryBox) _scValue->SetInt(_inventoryBox->_scrollOffset);
else _scValue->SetInt(0);
@@ -863,7 +863,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ResponsesVisible (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ResponsesVisible") == 0) {
+ else if (strcmp(name, "ResponsesVisible") == 0) {
_scValue->SetBool(_stateEx == GAME_WAITING_RESPONSE);
return _scValue;
}
@@ -871,7 +871,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// PrevScene / PreviousScene (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PrevScene") == 0 || strcmp(Name, "PreviousScene") == 0) {
+ else if (strcmp(name, "PrevScene") == 0 || strcmp(name, "PreviousScene") == 0) {
if (!_prevSceneName) _scValue->SetString("");
else _scValue->SetString(_prevSceneName);
return _scValue;
@@ -880,7 +880,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// PrevSceneFilename / PreviousSceneFilename (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PrevSceneFilename") == 0 || strcmp(Name, "PreviousSceneFilename") == 0) {
+ else if (strcmp(name, "PrevSceneFilename") == 0 || strcmp(name, "PreviousSceneFilename") == 0) {
if (!_prevSceneFilename) _scValue->SetString("");
else _scValue->SetString(_prevSceneFilename);
return _scValue;
@@ -889,7 +889,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// LastResponse (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LastResponse") == 0) {
+ else if (strcmp(name, "LastResponse") == 0) {
if (!_responseBox || !_responseBox->_lastResponseText) _scValue->SetString("");
else _scValue->SetString(_responseBox->_lastResponseText);
return _scValue;
@@ -898,7 +898,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// LastResponseOrig (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LastResponseOrig") == 0) {
+ else if (strcmp(name, "LastResponseOrig") == 0) {
if (!_responseBox || !_responseBox->_lastResponseTextOrig) _scValue->SetString("");
else _scValue->SetString(_responseBox->_lastResponseTextOrig);
return _scValue;
@@ -907,7 +907,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// InventoryObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InventoryObject") == 0) {
+ else if (strcmp(name, "InventoryObject") == 0) {
if (_inventoryOwner == _invObject) _scValue->SetNative(this, true);
else _scValue->SetNative(_inventoryOwner, true);
@@ -917,7 +917,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// TotalNumItems
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TotalNumItems") == 0) {
+ else if (strcmp(name, "TotalNumItems") == 0) {
_scValue->SetInt(_items.GetSize());
return _scValue;
}
@@ -925,7 +925,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// TalkSkipButton
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TalkSkipButton") == 0) {
+ else if (strcmp(name, "TalkSkipButton") == 0) {
_scValue->SetInt(_talkSkipButton);
return _scValue;
}
@@ -933,7 +933,7 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ChangingScene
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ChangingScene") == 0) {
+ else if (strcmp(name, "ChangingScene") == 0) {
_scValue->SetBool(_scheduledScene != NULL);
return _scValue;
}
@@ -941,23 +941,23 @@ CScValue *CAdGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// StartupScene
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StartupScene") == 0) {
+ else if (strcmp(name, "StartupScene") == 0) {
if (!_startupScene) _scValue->SetNULL();
else _scValue->SetString(_startupScene);
return _scValue;
}
- else return CBGame::scGetProperty(Name);
+ else return CBGame::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CAdGame::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// SelectedItem
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SelectedItem") == 0) {
+ if (strcmp(name, "SelectedItem") == 0) {
if (Value->IsNULL()) _selectedItem = NULL;
else {
if (Value->IsNative()) {
@@ -980,7 +980,7 @@ HRESULT CAdGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SmartItemCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SmartItemCursor") == 0) {
+ else if (strcmp(name, "SmartItemCursor") == 0) {
_smartItemCursor = Value->GetBool();
return S_OK;
}
@@ -988,7 +988,7 @@ HRESULT CAdGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// InventoryVisible
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InventoryVisible") == 0) {
+ else if (strcmp(name, "InventoryVisible") == 0) {
if (_inventoryBox) _inventoryBox->_visible = Value->GetBool();
return S_OK;
}
@@ -996,7 +996,7 @@ HRESULT CAdGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// InventoryObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InventoryObject") == 0) {
+ else if (strcmp(name, "InventoryObject") == 0) {
if (_inventoryOwner && _inventoryBox) _inventoryOwner->getInventory()->_scrollOffset = _inventoryBox->_scrollOffset;
if (Value->IsNULL()) _inventoryOwner = _invObject;
@@ -1014,7 +1014,7 @@ HRESULT CAdGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// InventoryScrollOffset
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InventoryScrollOffset") == 0) {
+ else if (strcmp(name, "InventoryScrollOffset") == 0) {
if (_inventoryBox) _inventoryBox->_scrollOffset = Value->GetInt();
return S_OK;
}
@@ -1022,7 +1022,7 @@ HRESULT CAdGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// TalkSkipButton
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TalkSkipButton") == 0) {
+ else if (strcmp(name, "TalkSkipButton") == 0) {
int Val = Value->GetInt();
if (Val < 0) Val = 0;
if (Val > TALK_SKIP_NONE) Val = TALK_SKIP_NONE;
@@ -1033,7 +1033,7 @@ HRESULT CAdGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// StartupScene
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StartupScene") == 0) {
+ else if (strcmp(name, "StartupScene") == 0) {
if (Value == NULL) {
delete[] _startupScene;
_startupScene = NULL;
@@ -1042,7 +1042,7 @@ HRESULT CAdGame::scSetProperty(const char *Name, CScValue *Value) { return S_OK;
}
- else return CBGame::scSetProperty(Name, Value);
+ else return CBGame::scSetProperty(name, Value);
}
@@ -1058,35 +1058,35 @@ void CAdGame::PublishNatives() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::ExternalCall(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name) {
+HRESULT CAdGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStack, char *name) {
CScValue *this_obj;
//////////////////////////////////////////////////////////////////////////
// Actor
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Actor") == 0) {
- Stack->CorrectParams(0);
- this_obj = ThisStack->GetTop();
+ if (strcmp(name, "Actor") == 0) {
+ stack->CorrectParams(0);
+ this_obj = thisStack->GetTop();
this_obj->SetNative(new CAdActor(Game));
- Stack->PushNULL();
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// Entity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Entity") == 0) {
- Stack->CorrectParams(0);
- this_obj = ThisStack->GetTop();
+ else if (strcmp(name, "Entity") == 0) {
+ stack->CorrectParams(0);
+ this_obj = thisStack->GetTop();
this_obj->SetNative(new CAdEntity(Game));
- Stack->PushNULL();
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// call parent
- else return CBGame::ExternalCall(Script, Stack, ThisStack, Name);
+ else return CBGame::ExternalCall(script, stack, thisStack, name);
return S_OK;
@@ -1334,23 +1334,23 @@ void CAdGame::AfterLoadScene(void *Scene, void *Data) { //////////////////////////////////////////////////////////////////////////
-void CAdGame::SetPrevSceneName(const char *Name) {
+void CAdGame::SetPrevSceneName(const char *name) {
delete[] _prevSceneName;
_prevSceneName = NULL;
- if (Name) {
- _prevSceneName = new char[strlen(Name) + 1];
- if (_prevSceneName) strcpy(_prevSceneName, Name);
+ if (name) {
+ _prevSceneName = new char[strlen(name) + 1];
+ if (_prevSceneName) strcpy(_prevSceneName, name);
}
}
//////////////////////////////////////////////////////////////////////////
-void CAdGame::SetPrevSceneFilename(const char *Name) {
+void CAdGame::SetPrevSceneFilename(const char *name) {
delete[] _prevSceneFilename;
_prevSceneFilename = NULL;
- if (Name) {
- _prevSceneFilename = new char[strlen(Name) + 1];
- if (_prevSceneFilename) strcpy(_prevSceneFilename, Name);
+ if (name) {
+ _prevSceneFilename = new char[strlen(name) + 1];
+ if (_prevSceneFilename) strcpy(_prevSceneFilename, name);
}
}
@@ -1518,14 +1518,14 @@ HRESULT CAdGame::WindowLoadHook(CUIWindow *Win, char **Buffer, char **params) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScStack *Stack, const char *Name) {
- if (strcmp(Name, "CreateEntityContainer") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+HRESULT CAdGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *script, CScStack *stack, const char *name) {
+ if (strcmp(name, "CreateEntityContainer") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CUIEntity *Ent = new CUIEntity(Game);
if (!Val->IsNULL()) Ent->setName(Val->GetString());
- Stack->PushNative(Ent, true);
+ stack->PushNative(Ent, true);
Ent->_parent = Win;
Win->_widgets.Add(Ent);
@@ -1537,10 +1537,10 @@ HRESULT CAdGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScSt //////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::StartDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName) {
- char *Name = new char[strlen(BranchName) + 1 + strlen(ScriptName) + 1 + strlen(EventName) + 1];
- if (Name) {
- sprintf(Name, "%s.%s.%s", BranchName, ScriptName, EventName);
- _dlgPendingBranches.Add(Name);
+ char *name = new char[strlen(BranchName) + 1 + strlen(ScriptName) + 1 + strlen(EventName) + 1];
+ if (name) {
+ sprintf(name, "%s.%s.%s", BranchName, ScriptName, EventName);
+ _dlgPendingBranches.Add(name);
}
return S_OK;
}
@@ -1548,26 +1548,26 @@ HRESULT CAdGame::StartDlgBranch(const char *BranchName, const char *ScriptName, //////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName) {
- char *Name = NULL;
+ char *name = NULL;
bool DeleteName = false;
if (BranchName == NULL && _dlgPendingBranches.GetSize() > 0) {
- Name = _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1];
+ name = _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1];
} else {
if (BranchName != NULL) {
- Name = new char[strlen(BranchName) + 1 + strlen(ScriptName) + 1 + strlen(EventName) + 1];
- if (Name) {
- sprintf(Name, "%s.%s.%s", BranchName, ScriptName, EventName);
+ name = new char[strlen(BranchName) + 1 + strlen(ScriptName) + 1 + strlen(EventName) + 1];
+ if (name) {
+ sprintf(name, "%s.%s.%s", BranchName, ScriptName, EventName);
DeleteName = true;
}
}
}
- if (Name == NULL) return S_OK;
+ if (name == NULL) return S_OK;
int StartIndex = -1;
for (int i = _dlgPendingBranches.GetSize() - 1; i >= 0; i--) {
- if (scumm_stricmp(Name, _dlgPendingBranches[i]) == 0) {
+ if (scumm_stricmp(name, _dlgPendingBranches[i]) == 0) {
StartIndex = i;
break;
}
@@ -1587,16 +1587,16 @@ HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, co _responsesBranch.RemoveAll();
}
- if (DeleteName) delete [] Name;
+ if (DeleteName) delete [] name;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::ClearBranchResponses(char *Name) {
+HRESULT CAdGame::ClearBranchResponses(char *name) {
for (int i = 0; i < _responsesBranch.GetSize(); i++) {
- if (scumm_stricmp(Name, _responsesBranch[i]->_context) == 0) {
+ if (scumm_stricmp(name, _responsesBranch[i]->_context) == 0) {
delete _responsesBranch[i];
_responsesBranch.RemoveAt(i);
i--;
@@ -1790,9 +1790,9 @@ bool CAdGame::IsItemTaken(char *ItemName) { }
//////////////////////////////////////////////////////////////////////////
-CAdItem *CAdGame::GetItemByName(const char *Name) {
+CAdItem *CAdGame::GetItemByName(const char *name) {
for (int i = 0; i < _items.GetSize(); i++) {
- if (scumm_stricmp(_items[i]->_name, Name) == 0) return _items[i];
+ if (scumm_stricmp(_items[i]->_name, name) == 0) return _items[i];
}
return NULL;
}
@@ -2066,8 +2066,8 @@ HRESULT CAdGame::DisplayDebugInfo() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::OnScriptShutdown(CScScript *Script) {
- if (_responseBox && _responseBox->_waitingScript == Script)
+HRESULT CAdGame::OnScriptShutdown(CScScript *script) {
+ if (_responseBox && _responseBox->_waitingScript == script)
_responseBox->_waitingScript = NULL;
return S_OK;
diff --git a/engines/wintermute/Ad/AdGame.h b/engines/wintermute/Ad/AdGame.h index 10f99b345a..c9fbbadc6f 100644 --- a/engines/wintermute/Ad/AdGame.h +++ b/engines/wintermute/Ad/AdGame.h @@ -44,7 +44,7 @@ class CAdResponseContext; class CAdResponseBox;
class CAdGame : public CBGame {
public:
- virtual HRESULT OnScriptShutdown(CScScript *Script);
+ virtual HRESULT OnScriptShutdown(CScScript *script);
virtual HRESULT OnMouseLeftDown();
virtual HRESULT OnMouseLeftUp();
@@ -70,7 +70,7 @@ public: bool _tempDisableSaveState;
virtual HRESULT ResetContent();
HRESULT AddItem(CAdItem *Item);
- CAdItem *GetItemByName(const char *Name);
+ CAdItem *GetItemByName(const char *name);
CBArray<CAdItem *, CAdItem *> _items;
CAdObject *_inventoryOwner;
bool IsItemTaken(char *ItemName);
@@ -89,11 +89,11 @@ public: bool BranchResponseUsed(int ID);
HRESULT AddBranchResponse(int ID);
- HRESULT ClearBranchResponses(char *Name);
+ HRESULT ClearBranchResponses(char *name);
HRESULT StartDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName);
HRESULT EndDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName);
virtual HRESULT WindowLoadHook(CUIWindow *Win, char **Buf, char **Params);
- virtual HRESULT WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScStack *Stack, const char *Name);
+ virtual HRESULT WindowScriptMethodHook(CUIWindow *Win, CScScript *script, CScStack *stack, const char *name);
CAdSceneState *GetSceneState(const char *Filename, bool Saving);
CBViewport *_sceneViewport;
@@ -108,8 +108,8 @@ public: HRESULT ScheduleChangeScene(const char *Filename, bool FadeIn);
char *_scheduledScene;
bool _scheduledFadeIn;
- void SetPrevSceneName(const char *Name);
- void SetPrevSceneFilename(const char *Name);
+ void SetPrevSceneName(const char *name);
+ void SetPrevSceneFilename(const char *name);
char *_prevSceneName;
char *_prevSceneFilename;
virtual HRESULT LoadGame(const char *Filename);
@@ -148,12 +148,12 @@ public: virtual void PublishNatives();
- virtual HRESULT ExternalCall(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name);
+ virtual HRESULT ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStack, char *name);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
bool ValidMouse();
};
diff --git a/engines/wintermute/Ad/AdInventory.cpp b/engines/wintermute/Ad/AdInventory.cpp index fd94d906e6..edc1fa65b9 100644 --- a/engines/wintermute/Ad/AdInventory.cpp +++ b/engines/wintermute/Ad/AdInventory.cpp @@ -49,15 +49,15 @@ CAdInventory::~CAdInventory() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdInventory::InsertItem(const char *Name, const char *InsertAfter) {
- if (Name == NULL) return E_FAIL;
+HRESULT CAdInventory::InsertItem(const char *name, const char *InsertAfter) {
+ if (name == NULL) return E_FAIL;
- CAdItem *item = ((CAdGame *)Game)->GetItemByName(Name);
+ CAdItem *item = ((CAdGame *)Game)->GetItemByName(name);
if (item == NULL) return E_FAIL;
int InsertIndex = -1;
for (int i = 0; i < _takenItems.GetSize(); i++) {
- if (scumm_stricmp(_takenItems[i]->_name, Name) == 0) {
+ if (scumm_stricmp(_takenItems[i]->_name, name) == 0) {
_takenItems.RemoveAt(i);
i--;
continue;
@@ -74,11 +74,11 @@ HRESULT CAdInventory::InsertItem(const char *Name, const char *InsertAfter) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdInventory::RemoveItem(const char *Name) {
- if (Name == NULL) return E_FAIL;
+HRESULT CAdInventory::RemoveItem(const char *name) {
+ if (name == NULL) return E_FAIL;
for (int i = 0; i < _takenItems.GetSize(); i++) {
- if (scumm_stricmp(_takenItems[i]->_name, Name) == 0) {
+ if (scumm_stricmp(_takenItems[i]->_name, name) == 0) {
if (((CAdGame *)Game)->_selectedItem == _takenItems[i])((CAdGame *)Game)->_selectedItem = NULL;
_takenItems.RemoveAt(i);
return S_OK;
diff --git a/engines/wintermute/Ad/AdInventory.h b/engines/wintermute/Ad/AdInventory.h index 12aca999f7..f372fec6e9 100644 --- a/engines/wintermute/Ad/AdInventory.h +++ b/engines/wintermute/Ad/AdInventory.h @@ -38,9 +38,9 @@ class CAdItem; class CAdInventory : public CBObject {
public:
DECLARE_PERSISTENT(CAdInventory, CBObject)
- HRESULT RemoveItem(const char *Name);
+ HRESULT RemoveItem(const char *name);
HRESULT RemoveItem(CAdItem *Item);
- HRESULT InsertItem(const char *Name, const char *InsertAfter = NULL);
+ HRESULT InsertItem(const char *name, const char *InsertAfter = NULL);
CAdInventory(CBGame *inGame);
virtual ~CAdInventory();
CBArray<CAdItem *, CAdItem *> _takenItems;
diff --git a/engines/wintermute/Ad/AdItem.cpp b/engines/wintermute/Ad/AdItem.cpp index 11bfe39747..f9b92afba6 100644 --- a/engines/wintermute/Ad/AdItem.cpp +++ b/engines/wintermute/Ad/AdItem.cpp @@ -429,28 +429,28 @@ HRESULT CAdItem::display(int X, int Y) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdItem::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CAdItem::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetHoverSprite
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetHoverSprite") == 0) {
- Stack->CorrectParams(1);
+ if (strcmp(name, "SetHoverSprite") == 0) {
+ stack->CorrectParams(1);
bool SetCurrent = false;
if (_currentSprite && _currentSprite == _spriteHover) SetCurrent = true;
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
delete _spriteHover;
_spriteHover = NULL;
CBSprite *spr = new CBSprite(Game, this);
if (!spr || FAILED(spr->loadFile(Filename))) {
- Stack->PushBool(false);
- Script->RuntimeError("Item.SetHoverSprite failed for file '%s'", Filename);
+ stack->PushBool(false);
+ script->RuntimeError("Item.SetHoverSprite failed for file '%s'", Filename);
} else {
_spriteHover = spr;
if (SetCurrent) _currentSprite = _spriteHover;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -458,41 +458,41 @@ HRESULT CAdItem::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// GetHoverSprite
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetHoverSprite") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetHoverSprite") == 0) {
+ stack->CorrectParams(0);
- if (!_spriteHover || !_spriteHover->_filename) Stack->PushNULL();
- else Stack->PushString(_spriteHover->_filename);
+ if (!_spriteHover || !_spriteHover->_filename) stack->PushNULL();
+ else stack->PushString(_spriteHover->_filename);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetHoverSpriteObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetHoverSpriteObject") == 0) {
- Stack->CorrectParams(0);
- if (!_spriteHover) Stack->PushNULL();
- else Stack->PushNative(_spriteHover, true);
+ else if (strcmp(name, "GetHoverSpriteObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_spriteHover) stack->PushNULL();
+ else stack->PushNative(_spriteHover, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetNormalCursor
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetNormalCursor") == 0) {
- Stack->CorrectParams(1);
+ if (strcmp(name, "SetNormalCursor") == 0) {
+ stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
delete _cursorNormal;
_cursorNormal = NULL;
CBSprite *spr = new CBSprite(Game);
if (!spr || FAILED(spr->loadFile(Filename))) {
- Stack->PushBool(false);
- Script->RuntimeError("Item.SetNormalCursor failed for file '%s'", Filename);
+ stack->PushBool(false);
+ script->RuntimeError("Item.SetNormalCursor failed for file '%s'", Filename);
} else {
_cursorNormal = spr;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -500,42 +500,42 @@ HRESULT CAdItem::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// GetNormalCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetNormalCursor") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetNormalCursor") == 0) {
+ stack->CorrectParams(0);
- if (!_cursorNormal || !_cursorNormal->_filename) Stack->PushNULL();
- else Stack->PushString(_cursorNormal->_filename);
+ if (!_cursorNormal || !_cursorNormal->_filename) stack->PushNULL();
+ else stack->PushString(_cursorNormal->_filename);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetNormalCursorObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetNormalCursorObject") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetNormalCursorObject") == 0) {
+ stack->CorrectParams(0);
- if (!_cursorNormal) Stack->PushNULL();
- else Stack->PushNative(_cursorNormal, true);
+ if (!_cursorNormal) stack->PushNULL();
+ else stack->PushNative(_cursorNormal, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetHoverCursor
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetHoverCursor") == 0) {
- Stack->CorrectParams(1);
+ if (strcmp(name, "SetHoverCursor") == 0) {
+ stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
delete _cursorHover;
_cursorHover = NULL;
CBSprite *spr = new CBSprite(Game);
if (!spr || FAILED(spr->loadFile(Filename))) {
- Stack->PushBool(false);
- Script->RuntimeError("Item.SetHoverCursor failed for file '%s'", Filename);
+ stack->PushBool(false);
+ script->RuntimeError("Item.SetHoverCursor failed for file '%s'", Filename);
} else {
_cursorHover = spr;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -543,37 +543,37 @@ HRESULT CAdItem::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// GetHoverCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetHoverCursor") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetHoverCursor") == 0) {
+ stack->CorrectParams(0);
- if (!_cursorHover || !_cursorHover->_filename) Stack->PushNULL();
- else Stack->PushString(_cursorHover->_filename);
+ if (!_cursorHover || !_cursorHover->_filename) stack->PushNULL();
+ else stack->PushString(_cursorHover->_filename);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetHoverCursorObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetHoverCursorObject") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetHoverCursorObject") == 0) {
+ stack->CorrectParams(0);
- if (!_cursorHover) Stack->PushNULL();
- else Stack->PushNative(_cursorHover, true);
+ if (!_cursorHover) stack->PushNULL();
+ else stack->PushNative(_cursorHover, true);
return S_OK;
}
- else return CAdTalkHolder::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CAdTalkHolder::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CAdItem::scGetProperty(const char *Name) {
+CScValue *CAdItem::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("item");
return _scValue;
}
@@ -581,7 +581,7 @@ CScValue *CAdItem::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Name") == 0) {
+ else if (strcmp(name, "Name") == 0) {
_scValue->SetString(_name);
return _scValue;
}
@@ -589,7 +589,7 @@ CScValue *CAdItem::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// DisplayAmount
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DisplayAmount") == 0) {
+ else if (strcmp(name, "DisplayAmount") == 0) {
_scValue->SetBool(_displayAmount);
return _scValue;
}
@@ -597,7 +597,7 @@ CScValue *CAdItem::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Amount
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Amount") == 0) {
+ else if (strcmp(name, "Amount") == 0) {
_scValue->SetInt(_amount);
return _scValue;
}
@@ -605,7 +605,7 @@ CScValue *CAdItem::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AmountOffsetX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AmountOffsetX") == 0) {
+ else if (strcmp(name, "AmountOffsetX") == 0) {
_scValue->SetInt(_amountOffsetX);
return _scValue;
}
@@ -613,7 +613,7 @@ CScValue *CAdItem::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AmountOffsetY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AmountOffsetY") == 0) {
+ else if (strcmp(name, "AmountOffsetY") == 0) {
_scValue->SetInt(_amountOffsetY);
return _scValue;
}
@@ -621,7 +621,7 @@ CScValue *CAdItem::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AmountAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AmountAlign") == 0) {
+ else if (strcmp(name, "AmountAlign") == 0) {
_scValue->SetInt(_amountAlign);
return _scValue;
}
@@ -629,7 +629,7 @@ CScValue *CAdItem::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AmountString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AmountString") == 0) {
+ else if (strcmp(name, "AmountString") == 0) {
if (!_amountString) _scValue->SetNULL();
else _scValue->SetString(_amountString);
return _scValue;
@@ -638,21 +638,21 @@ CScValue *CAdItem::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// CursorCombined
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CursorCombined") == 0) {
+ else if (strcmp(name, "CursorCombined") == 0) {
_scValue->SetBool(_cursorCombined);
return _scValue;
}
- else return CAdTalkHolder::scGetProperty(Name);
+ else return CAdTalkHolder::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdItem::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CAdItem::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
}
@@ -660,7 +660,7 @@ HRESULT CAdItem::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// DisplayAmount
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DisplayAmount") == 0) {
+ else if (strcmp(name, "DisplayAmount") == 0) {
_displayAmount = Value->GetBool();
return S_OK;
}
@@ -668,7 +668,7 @@ HRESULT CAdItem::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Amount
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Amount") == 0) {
+ else if (strcmp(name, "Amount") == 0) {
_amount = Value->GetInt();
return S_OK;
}
@@ -676,7 +676,7 @@ HRESULT CAdItem::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AmountOffsetX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AmountOffsetX") == 0) {
+ else if (strcmp(name, "AmountOffsetX") == 0) {
_amountOffsetX = Value->GetInt();
return S_OK;
}
@@ -684,7 +684,7 @@ HRESULT CAdItem::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AmountOffsetY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AmountOffsetY") == 0) {
+ else if (strcmp(name, "AmountOffsetY") == 0) {
_amountOffsetY = Value->GetInt();
return S_OK;
}
@@ -692,7 +692,7 @@ HRESULT CAdItem::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AmountAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AmountAlign") == 0) {
+ else if (strcmp(name, "AmountAlign") == 0) {
_amountAlign = (TTextAlign)Value->GetInt();
return S_OK;
}
@@ -700,7 +700,7 @@ HRESULT CAdItem::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AmountString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AmountString") == 0) {
+ else if (strcmp(name, "AmountString") == 0) {
if (Value->IsNULL()) {
delete[] _amountString;
_amountString = NULL;
@@ -713,12 +713,12 @@ HRESULT CAdItem::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// CursorCombined
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CursorCombined") == 0) {
+ else if (strcmp(name, "CursorCombined") == 0) {
_cursorCombined = Value->GetBool();
return S_OK;
}
- else return CAdTalkHolder::scSetProperty(Name, Value);
+ else return CAdTalkHolder::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Ad/AdItem.h b/engines/wintermute/Ad/AdItem.h index 201e2450fb..c80cbee7d4 100644 --- a/engines/wintermute/Ad/AdItem.h +++ b/engines/wintermute/Ad/AdItem.h @@ -59,9 +59,9 @@ public: HRESULT loadBuffer(byte *Buffer, bool Complete = true);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Ad/AdLayer.cpp b/engines/wintermute/Ad/AdLayer.cpp index 5f5ae728dd..7f1d09ef59 100644 --- a/engines/wintermute/Ad/AdLayer.cpp +++ b/engines/wintermute/Ad/AdLayer.cpp @@ -227,13 +227,13 @@ HRESULT CAdLayer::loadBuffer(byte *Buffer, bool Complete) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdLayer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CAdLayer::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetNode
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "GetNode") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ if (strcmp(name, "GetNode") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
int node = -1;
if (val->_type == VAL_INT) node = val->GetInt();
@@ -247,17 +247,17 @@ HRESULT CAdLayer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi }
}
- if (node < 0 || node >= _nodes.GetSize()) Stack->PushNULL();
+ if (node < 0 || node >= _nodes.GetSize()) stack->PushNULL();
else {
switch (_nodes[node]->_type) {
case OBJECT_ENTITY:
- Stack->PushNative(_nodes[node]->_entity, true);
+ stack->PushNative(_nodes[node]->_entity, true);
break;
case OBJECT_REGION:
- Stack->PushNative(_nodes[node]->_region, true);
+ stack->PushNative(_nodes[node]->_region, true);
break;
default:
- Stack->PushNULL();
+ stack->PushNULL();
}
}
return S_OK;
@@ -266,21 +266,21 @@ HRESULT CAdLayer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// AddRegion / AddEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddRegion") == 0 || strcmp(Name, "AddEntity") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "AddRegion") == 0 || strcmp(name, "AddEntity") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdSceneNode *Node = new CAdSceneNode(Game);
- if (strcmp(Name, "AddRegion") == 0) {
+ if (strcmp(name, "AddRegion") == 0) {
CAdRegion *Region = new CAdRegion(Game);
if (!Val->IsNULL()) Region->setName(Val->GetString());
Node->setRegion(Region);
- Stack->PushNative(Region, true);
+ stack->PushNative(Region, true);
} else {
CAdEntity *Entity = new CAdEntity(Game);
if (!Val->IsNULL()) Entity->setName(Val->GetString());
Node->setEntity(Entity);
- Stack->PushNative(Entity, true);
+ stack->PushNative(Entity, true);
}
_nodes.Add(Node);
return S_OK;
@@ -289,22 +289,22 @@ HRESULT CAdLayer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// InsertRegion / InsertEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InsertRegion") == 0 || strcmp(Name, "InsertEntity") == 0) {
- Stack->CorrectParams(2);
- int Index = Stack->Pop()->GetInt();
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "InsertRegion") == 0 || strcmp(name, "InsertEntity") == 0) {
+ stack->CorrectParams(2);
+ int Index = stack->Pop()->GetInt();
+ CScValue *Val = stack->Pop();
CAdSceneNode *Node = new CAdSceneNode(Game);
- if (strcmp(Name, "InsertRegion") == 0) {
+ if (strcmp(name, "InsertRegion") == 0) {
CAdRegion *Region = new CAdRegion(Game);
if (!Val->IsNULL()) Region->setName(Val->GetString());
Node->setRegion(Region);
- Stack->PushNative(Region, true);
+ stack->PushNative(Region, true);
} else {
CAdEntity *Entity = new CAdEntity(Game);
if (!Val->IsNULL()) Entity->setName(Val->GetString());
Node->setEntity(Entity);
- Stack->PushNative(Entity, true);
+ stack->PushNative(Entity, true);
}
if (Index < 0) Index = 0;
if (Index <= _nodes.GetSize() - 1) _nodes.InsertAt(Index, Node);
@@ -316,9 +316,9 @@ HRESULT CAdLayer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// DeleteNode
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteNode") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "DeleteNode") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdSceneNode *ToDelete = NULL;
if (Val->IsNative()) {
@@ -336,7 +336,7 @@ HRESULT CAdLayer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi }
}
if (ToDelete == NULL) {
- Stack->PushBool(false);
+ stack->PushBool(false);
return S_OK;
}
@@ -348,22 +348,22 @@ HRESULT CAdLayer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi break;
}
}
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
- else return CBObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CAdLayer::scGetProperty(const char *Name) {
+CScValue *CAdLayer::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("layer");
return _scValue;
}
@@ -371,7 +371,7 @@ CScValue *CAdLayer::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumNodes (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumNodes") == 0) {
+ else if (strcmp(name, "NumNodes") == 0) {
_scValue->SetInt(_nodes.GetSize());
return _scValue;
}
@@ -379,7 +379,7 @@ CScValue *CAdLayer::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Width") == 0) {
+ else if (strcmp(name, "Width") == 0) {
_scValue->SetInt(_width);
return _scValue;
}
@@ -387,7 +387,7 @@ CScValue *CAdLayer::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Height") == 0) {
+ else if (strcmp(name, "Height") == 0) {
_scValue->SetInt(_height);
return _scValue;
}
@@ -395,7 +395,7 @@ CScValue *CAdLayer::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Main (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Main") == 0) {
+ else if (strcmp(name, "Main") == 0) {
_scValue->SetBool(_main);
return _scValue;
}
@@ -403,7 +403,7 @@ CScValue *CAdLayer::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// CloseUp
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CloseUp") == 0) {
+ else if (strcmp(name, "CloseUp") == 0) {
_scValue->SetBool(_closeUp);
return _scValue;
}
@@ -411,21 +411,21 @@ CScValue *CAdLayer::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Active") == 0) {
+ else if (strcmp(name, "Active") == 0) {
_scValue->SetBool(_active);
return _scValue;
}
- else return CBObject::scGetProperty(Name);
+ else return CBObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdLayer::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CAdLayer::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
}
@@ -433,7 +433,7 @@ HRESULT CAdLayer::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// CloseUp
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CloseUp") == 0) {
+ else if (strcmp(name, "CloseUp") == 0) {
_closeUp = Value->GetBool();
return S_OK;
}
@@ -441,7 +441,7 @@ HRESULT CAdLayer::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Width") == 0) {
+ else if (strcmp(name, "Width") == 0) {
_width = Value->GetInt();
if (_width < 0) _width = 0;
return S_OK;
@@ -450,7 +450,7 @@ HRESULT CAdLayer::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Height") == 0) {
+ else if (strcmp(name, "Height") == 0) {
_height = Value->GetInt();
if (_height < 0) _height = 0;
return S_OK;
@@ -459,7 +459,7 @@ HRESULT CAdLayer::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Active") == 0) {
+ else if (strcmp(name, "Active") == 0) {
bool b = Value->GetBool();
if (b == false && _main) {
Game->LOG(0, "Warning: cannot deactivate scene's main layer");
@@ -467,7 +467,7 @@ HRESULT CAdLayer::scSetProperty(const char *Name, CScValue *Value) { return S_OK;
}
- else return CBObject::scSetProperty(Name, Value);
+ else return CBObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Ad/AdLayer.h b/engines/wintermute/Ad/AdLayer.h index 824e843828..059eac06dc 100644 --- a/engines/wintermute/Ad/AdLayer.h +++ b/engines/wintermute/Ad/AdLayer.h @@ -47,9 +47,9 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Ad/AdNodeState.cpp b/engines/wintermute/Ad/AdNodeState.cpp index 0e6c718ae0..1eb831a1e0 100644 --- a/engines/wintermute/Ad/AdNodeState.cpp +++ b/engines/wintermute/Ad/AdNodeState.cpp @@ -68,10 +68,10 @@ CAdNodeState::~CAdNodeState() { //////////////////////////////////////////////////////////////////////////
-void CAdNodeState::setName(const char *Name) {
+void CAdNodeState::setName(const char *name) {
delete[] _name;
_name = NULL;
- CBUtils::SetString(&_name, Name);
+ CBUtils::SetString(&_name, name);
}
diff --git a/engines/wintermute/Ad/AdNodeState.h b/engines/wintermute/Ad/AdNodeState.h index d180a3543e..9c75cf8092 100644 --- a/engines/wintermute/Ad/AdNodeState.h +++ b/engines/wintermute/Ad/AdNodeState.h @@ -36,7 +36,7 @@ class CAdEntity; class CAdNodeState : public CBBase {
public:
HRESULT TransferEntity(CAdEntity *Entity, bool IncludingSprites, bool Saving);
- void setName(const char *Name);
+ void setName(const char *name);
void setFilename(const char *Filename);
void SetCursor(const char *Filename);
DECLARE_PERSISTENT(CAdNodeState, CBBase)
diff --git a/engines/wintermute/Ad/AdObject.cpp b/engines/wintermute/Ad/AdObject.cpp index e89e83905f..38c2ab94d7 100644 --- a/engines/wintermute/Ad/AdObject.cpp +++ b/engines/wintermute/Ad/AdObject.cpp @@ -187,17 +187,17 @@ HRESULT CAdObject::update() { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// PlayAnim / PlayAnimAsync
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "PlayAnim") == 0 || strcmp(Name, "PlayAnimAsync") == 0) {
- Stack->CorrectParams(1);
- if (FAILED(playAnim(Stack->Pop()->GetString()))) Stack->PushBool(false);
+ if (strcmp(name, "PlayAnim") == 0 || strcmp(name, "PlayAnimAsync") == 0) {
+ stack->CorrectParams(1);
+ if (FAILED(playAnim(stack->Pop()->GetString()))) stack->PushBool(false);
else {
- if (strcmp(Name, "PlayAnimAsync") != 0) Script->WaitFor(this);
- Stack->PushBool(true);
+ if (strcmp(name, "PlayAnimAsync") != 0) script->WaitFor(this);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -205,47 +205,47 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// Reset
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Reset") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Reset") == 0) {
+ stack->CorrectParams(0);
reset();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// IsTalking
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsTalking") == 0) {
- Stack->CorrectParams(0);
- Stack->PushBool(_state == STATE_TALKING);
+ else if (strcmp(name, "IsTalking") == 0) {
+ stack->CorrectParams(0);
+ stack->PushBool(_state == STATE_TALKING);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// StopTalk / StopTalking
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StopTalk") == 0 || strcmp(Name, "StopTalking") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "StopTalk") == 0 || strcmp(name, "StopTalking") == 0) {
+ stack->CorrectParams(0);
if (_sentence) _sentence->finish();
if (_state == STATE_TALKING) {
_state = _nextState;
_nextState = STATE_READY;
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ForceTalkAnim
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ForceTalkAnim") == 0) {
- Stack->CorrectParams(1);
- const char *AnimName = Stack->Pop()->GetString();
+ else if (strcmp(name, "ForceTalkAnim") == 0) {
+ stack->CorrectParams(1);
+ const char *AnimName = stack->Pop()->GetString();
delete[] _forcedTalkAnimName;
_forcedTalkAnimName = new char[strlen(AnimName) + 1];
strcpy(_forcedTalkAnimName, AnimName);
_forcedTalkAnimUsed = false;
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -253,18 +253,18 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// Talk / TalkAsync
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Talk") == 0 || strcmp(Name, "TalkAsync") == 0) {
- Stack->CorrectParams(5);
+ else if (strcmp(name, "Talk") == 0 || strcmp(name, "TalkAsync") == 0) {
+ stack->CorrectParams(5);
- const char *Text = Stack->Pop()->GetString();
- CScValue *SoundVal = Stack->Pop();
- int Duration = Stack->Pop()->GetInt();
- CScValue *ValStances = Stack->Pop();
+ const char *Text = stack->Pop()->GetString();
+ CScValue *SoundVal = stack->Pop();
+ int Duration = stack->Pop()->GetInt();
+ CScValue *ValStances = stack->Pop();
const char *Stances = ValStances->IsNULL() ? NULL : ValStances->GetString();
int Align;
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
if (val->IsNULL()) Align = TAL_CENTER;
else Align = val->GetInt();
@@ -273,23 +273,23 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th const char *Sound = SoundVal->IsNULL() ? NULL : SoundVal->GetString();
talk(Text, Sound, Duration, Stances, (TTextAlign)Align);
- if (strcmp(Name, "TalkAsync") != 0) Script->WaitForExclusive(this);
+ if (strcmp(name, "TalkAsync") != 0) script->WaitForExclusive(this);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// StickToRegion
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StickToRegion") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "StickToRegion") == 0) {
+ stack->CorrectParams(1);
CAdLayer *Main = ((CAdGame *)Game)->_scene->_mainLayer;
bool RegFound = false;
int i;
- CScValue *Val = Stack->Pop();
+ CScValue *Val = stack->Pop();
if (Val->IsNULL() || !Main) {
_stickRegion = NULL;
RegFound = true;
@@ -316,106 +316,106 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th }
if (!RegFound) _stickRegion = NULL;
- Stack->PushBool(RegFound);
+ stack->PushBool(RegFound);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetFont
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetFont") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "SetFont") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (Val->IsNULL()) SetFont(NULL);
else SetFont(Val->GetString());
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetFont
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetFont") == 0) {
- Stack->CorrectParams(0);
- if (_font && _font->_filename) Stack->PushString(_font->_filename);
- else Stack->PushNULL();
+ else if (strcmp(name, "GetFont") == 0) {
+ stack->CorrectParams(0);
+ if (_font && _font->_filename) stack->PushString(_font->_filename);
+ else stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// TakeItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TakeItem") == 0) {
- Stack->CorrectParams(2);
+ else if (strcmp(name, "TakeItem") == 0) {
+ stack->CorrectParams(2);
if (!_inventory) {
_inventory = new CAdInventory(Game);
((CAdGame *)Game)->RegisterInventory(_inventory);
}
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
if (!val->IsNULL()) {
const char *ItemName = val->GetString();
- val = Stack->Pop();
+ val = stack->Pop();
const char *InsertAfter = val->IsNULL() ? NULL : val->GetString();
- if (FAILED(_inventory->InsertItem(ItemName, InsertAfter))) Script->RuntimeError("Cannot add item '%s' to inventory", ItemName);
+ if (FAILED(_inventory->InsertItem(ItemName, InsertAfter))) script->RuntimeError("Cannot add item '%s' to inventory", ItemName);
else {
// hide associated entities
((CAdGame *)Game)->_scene->handleItemAssociations(ItemName, false);
}
- } else Script->RuntimeError("TakeItem: item name expected");
+ } else script->RuntimeError("TakeItem: item name expected");
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DropItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DropItem") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "DropItem") == 0) {
+ stack->CorrectParams(1);
if (!_inventory) {
_inventory = new CAdInventory(Game);
((CAdGame *)Game)->RegisterInventory(_inventory);
}
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
if (!val->IsNULL()) {
- if (FAILED(_inventory->RemoveItem(val->GetString()))) Script->RuntimeError("Cannot remove item '%s' from inventory", val->GetString());
+ if (FAILED(_inventory->RemoveItem(val->GetString()))) script->RuntimeError("Cannot remove item '%s' from inventory", val->GetString());
else {
// show associated entities
((CAdGame *)Game)->_scene->handleItemAssociations(val->GetString(), true);
}
- } else Script->RuntimeError("DropItem: item name expected");
+ } else script->RuntimeError("DropItem: item name expected");
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetItem") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "GetItem") == 0) {
+ stack->CorrectParams(1);
if (!_inventory) {
_inventory = new CAdInventory(Game);
((CAdGame *)Game)->RegisterInventory(_inventory);
}
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
if (val->_type == VAL_STRING) {
CAdItem *item = ((CAdGame *)Game)->GetItemByName(val->GetString());
- if (item) Stack->PushNative(item, true);
- else Stack->PushNULL();
+ if (item) stack->PushNative(item, true);
+ else stack->PushNULL();
} else if (val->IsNULL() || val->GetInt() < 0 || val->GetInt() >= _inventory->_takenItems.GetSize())
- Stack->PushNULL();
+ stack->PushNULL();
else
- Stack->PushNative(_inventory->_takenItems[val->GetInt()], true);
+ stack->PushNative(_inventory->_takenItems[val->GetInt()], true);
return S_OK;
}
@@ -423,43 +423,43 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// HasItem
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HasItem") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "HasItem") == 0) {
+ stack->CorrectParams(1);
if (!_inventory) {
_inventory = new CAdInventory(Game);
((CAdGame *)Game)->RegisterInventory(_inventory);
}
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
if (!val->IsNULL()) {
for (int i = 0; i < _inventory->_takenItems.GetSize(); i++) {
if (val->GetNative() == _inventory->_takenItems[i]) {
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
} else if (scumm_stricmp(val->GetString(), _inventory->_takenItems[i]->_name) == 0) {
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
}
- } else Script->RuntimeError("HasItem: item name expected");
+ } else script->RuntimeError("HasItem: item name expected");
- Stack->PushBool(false);
+ stack->PushBool(false);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// CreateParticleEmitter
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateParticleEmitter") == 0) {
- Stack->CorrectParams(3);
- bool FollowParent = Stack->Pop()->GetBool();
- int OffsetX = Stack->Pop()->GetInt();
- int OffsetY = Stack->Pop()->GetInt();
+ else if (strcmp(name, "CreateParticleEmitter") == 0) {
+ stack->CorrectParams(3);
+ bool FollowParent = stack->Pop()->GetBool();
+ int OffsetX = stack->Pop()->GetInt();
+ int OffsetY = stack->Pop()->GetInt();
CPartEmitter *Emitter = createParticleEmitter(FollowParent, OffsetX, OffsetY);
- if (Emitter) Stack->PushNative(_partEmitter, true);
- else Stack->PushNULL();
+ if (Emitter) stack->PushNative(_partEmitter, true);
+ else stack->PushNULL();
return S_OK;
}
@@ -467,13 +467,13 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// DeleteParticleEmitter
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteParticleEmitter") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "DeleteParticleEmitter") == 0) {
+ stack->CorrectParams(0);
if (_partEmitter) {
Game->UnregisterObject(_partEmitter);
_partEmitter = NULL;
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -481,20 +481,20 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// AddAttachment
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddAttachment") == 0) {
- Stack->CorrectParams(4);
- const char *Filename = Stack->Pop()->GetString();
- bool PreDisplay = Stack->Pop()->GetBool(true);
- int OffsetX = Stack->Pop()->GetInt();
- int OffsetY = Stack->Pop()->GetInt();
+ else if (strcmp(name, "AddAttachment") == 0) {
+ stack->CorrectParams(4);
+ const char *Filename = stack->Pop()->GetString();
+ bool PreDisplay = stack->Pop()->GetBool(true);
+ int OffsetX = stack->Pop()->GetInt();
+ int OffsetY = stack->Pop()->GetInt();
HRESULT res;
CAdEntity *Ent = new CAdEntity(Game);
if (FAILED(res = Ent->loadFile(Filename))) {
delete Ent;
Ent = NULL;
- Script->RuntimeError("AddAttachment() failed loading entity '%s'", Filename);
- Stack->PushBool(false);
+ script->RuntimeError("AddAttachment() failed loading entity '%s'", Filename);
+ stack->PushBool(false);
} else {
Game->RegisterObject(Ent);
@@ -505,7 +505,7 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th if (PreDisplay) _attachmentsPre.Add(Ent);
else _attachmentsPost.Add(Ent);
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
@@ -514,9 +514,9 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// RemoveAttachment
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RemoveAttachment") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "RemoveAttachment") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
bool Found = false;
if (Val->IsNative()) {
CBScriptable *Obj = Val->GetNative();
@@ -555,7 +555,7 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th }
}
}
- Stack->PushBool(Found);
+ stack->PushBool(Found);
return S_OK;
}
@@ -563,9 +563,9 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetAttachment
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetAttachment") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "GetAttachment") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdObject *Ret = NULL;
if (Val->IsInt()) {
@@ -597,24 +597,24 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th }
}
- if (Ret != NULL) Stack->PushNative(Ret, true);
- else Stack->PushNULL();
+ if (Ret != NULL) stack->PushNative(Ret, true);
+ else stack->PushNULL();
return S_OK;
}
- else return CBObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CAdObject::scGetProperty(const char *Name) {
+CScValue *CAdObject::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("object");
return _scValue;
}
@@ -622,7 +622,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Active") == 0) {
+ else if (strcmp(name, "Active") == 0) {
_scValue->SetBool(_active);
return _scValue;
}
@@ -630,7 +630,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// IgnoreItems
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IgnoreItems") == 0) {
+ else if (strcmp(name, "IgnoreItems") == 0) {
_scValue->SetBool(_ignoreItems);
return _scValue;
}
@@ -638,7 +638,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SceneIndependent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SceneIndependent") == 0) {
+ else if (strcmp(name, "SceneIndependent") == 0) {
_scValue->SetBool(_sceneIndependent);
return _scValue;
}
@@ -646,7 +646,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SubtitlesWidth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesWidth") == 0) {
+ else if (strcmp(name, "SubtitlesWidth") == 0) {
_scValue->SetInt(_subtitlesWidth);
return _scValue;
}
@@ -654,7 +654,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SubtitlesPosRelative
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesPosRelative") == 0) {
+ else if (strcmp(name, "SubtitlesPosRelative") == 0) {
_scValue->SetBool(_subtitlesModRelative);
return _scValue;
}
@@ -662,7 +662,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SubtitlesPosX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesPosX") == 0) {
+ else if (strcmp(name, "SubtitlesPosX") == 0) {
_scValue->SetInt(_subtitlesModX);
return _scValue;
}
@@ -670,7 +670,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SubtitlesPosY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesPosY") == 0) {
+ else if (strcmp(name, "SubtitlesPosY") == 0) {
_scValue->SetInt(_subtitlesModY);
return _scValue;
}
@@ -678,7 +678,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SubtitlesPosXCenter
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesPosXCenter") == 0) {
+ else if (strcmp(name, "SubtitlesPosXCenter") == 0) {
_scValue->SetBool(_subtitlesModXCenter);
return _scValue;
}
@@ -686,7 +686,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumItems (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumItems") == 0) {
+ else if (strcmp(name, "NumItems") == 0) {
_scValue->SetInt(getInventory()->_takenItems.GetSize());
return _scValue;
}
@@ -694,7 +694,7 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ParticleEmitter (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ParticleEmitter") == 0) {
+ else if (strcmp(name, "ParticleEmitter") == 0) {
if (_partEmitter) _scValue->SetNative(_partEmitter, true);
else _scValue->SetNULL();
@@ -704,23 +704,23 @@ CScValue *CAdObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumAttachments (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumAttachments") == 0) {
+ else if (strcmp(name, "NumAttachments") == 0) {
_scValue->SetInt(_attachmentsPre.GetSize() + _attachmentsPost.GetSize());
return _scValue;
}
- else return CBObject::scGetProperty(Name);
+ else return CBObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdObject::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CAdObject::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Active") == 0) {
+ if (strcmp(name, "Active") == 0) {
_active = Value->GetBool();
return S_OK;
}
@@ -728,7 +728,7 @@ HRESULT CAdObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// IgnoreItems
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IgnoreItems") == 0) {
+ else if (strcmp(name, "IgnoreItems") == 0) {
_ignoreItems = Value->GetBool();
return S_OK;
}
@@ -736,7 +736,7 @@ HRESULT CAdObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SceneIndependent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SceneIndependent") == 0) {
+ else if (strcmp(name, "SceneIndependent") == 0) {
_sceneIndependent = Value->GetBool();
return S_OK;
}
@@ -744,7 +744,7 @@ HRESULT CAdObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SubtitlesWidth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesWidth") == 0) {
+ else if (strcmp(name, "SubtitlesWidth") == 0) {
_subtitlesWidth = Value->GetInt();
return S_OK;
}
@@ -752,7 +752,7 @@ HRESULT CAdObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SubtitlesPosRelative
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesPosRelative") == 0) {
+ else if (strcmp(name, "SubtitlesPosRelative") == 0) {
_subtitlesModRelative = Value->GetBool();
return S_OK;
}
@@ -760,7 +760,7 @@ HRESULT CAdObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SubtitlesPosX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesPosX") == 0) {
+ else if (strcmp(name, "SubtitlesPosX") == 0) {
_subtitlesModX = Value->GetInt();
return S_OK;
}
@@ -768,7 +768,7 @@ HRESULT CAdObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SubtitlesPosY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesPosY") == 0) {
+ else if (strcmp(name, "SubtitlesPosY") == 0) {
_subtitlesModY = Value->GetInt();
return S_OK;
}
@@ -776,12 +776,12 @@ HRESULT CAdObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SubtitlesPosXCenter
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesPosXCenter") == 0) {
+ else if (strcmp(name, "SubtitlesPosXCenter") == 0) {
_subtitlesModXCenter = Value->GetBool();
return S_OK;
}
- else return CBObject::scSetProperty(Name, Value);
+ else return CBObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Ad/AdRegion.cpp b/engines/wintermute/Ad/AdRegion.cpp index 3e4fe2ea6d..44a7fb8e37 100644 --- a/engines/wintermute/Ad/AdRegion.cpp +++ b/engines/wintermute/Ad/AdRegion.cpp @@ -219,32 +219,32 @@ HRESULT CAdRegion::loadBuffer(byte *Buffer, bool Complete) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdRegion::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CAdRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
/*
//////////////////////////////////////////////////////////////////////////
// SkipTo
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SkipTo")==0) {
- Stack->CorrectParams(2);
- _posX = Stack->Pop()->GetInt();
- _posY = Stack->Pop()->GetInt();
- Stack->PushNULL();
+ if (strcmp(name, "SkipTo")==0) {
+ stack->CorrectParams(2);
+ _posX = stack->Pop()->GetInt();
+ _posY = stack->Pop()->GetInt();
+ stack->PushNULL();
return S_OK;
}
- else*/ return CBRegion::scCallMethod(Script, Stack, ThisStack, Name);
+ else*/ return CBRegion::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CAdRegion::scGetProperty(const char *Name) {
+CScValue *CAdRegion::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("ad region");
return _scValue;
}
@@ -252,7 +252,7 @@ CScValue *CAdRegion::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Name") == 0) {
+ else if (strcmp(name, "Name") == 0) {
_scValue->SetString(_name);
return _scValue;
}
@@ -260,7 +260,7 @@ CScValue *CAdRegion::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Blocked
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Blocked") == 0) {
+ else if (strcmp(name, "Blocked") == 0) {
_scValue->SetBool(_blocked);
return _scValue;
}
@@ -268,7 +268,7 @@ CScValue *CAdRegion::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Decoration
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Decoration") == 0) {
+ else if (strcmp(name, "Decoration") == 0) {
_scValue->SetBool(_decoration);
return _scValue;
}
@@ -276,7 +276,7 @@ CScValue *CAdRegion::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Scale
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scale") == 0) {
+ else if (strcmp(name, "Scale") == 0) {
_scValue->SetFloat(_zoom);
return _scValue;
}
@@ -284,21 +284,21 @@ CScValue *CAdRegion::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AlphaColor") == 0) {
+ else if (strcmp(name, "AlphaColor") == 0) {
_scValue->SetInt((int)_alpha);
return _scValue;
}
- else return CBRegion::scGetProperty(Name);
+ else return CBRegion::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdRegion::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CAdRegion::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
}
@@ -306,7 +306,7 @@ HRESULT CAdRegion::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Blocked
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Blocked") == 0) {
+ else if (strcmp(name, "Blocked") == 0) {
_blocked = Value->GetBool();
return S_OK;
}
@@ -314,7 +314,7 @@ HRESULT CAdRegion::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Decoration
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Decoration") == 0) {
+ else if (strcmp(name, "Decoration") == 0) {
_decoration = Value->GetBool();
return S_OK;
}
@@ -322,7 +322,7 @@ HRESULT CAdRegion::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Scale
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scale") == 0) {
+ else if (strcmp(name, "Scale") == 0) {
_zoom = Value->GetFloat();
return S_OK;
}
@@ -330,12 +330,12 @@ HRESULT CAdRegion::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AlphaColor") == 0) {
+ else if (strcmp(name, "AlphaColor") == 0) {
_alpha = (uint32)Value->GetInt();
return S_OK;
}
- else return CBRegion::scSetProperty(Name, Value);
+ else return CBRegion::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Ad/AdRegion.h b/engines/wintermute/Ad/AdRegion.h index 86bd577d3f..237936f578 100644 --- a/engines/wintermute/Ad/AdRegion.h +++ b/engines/wintermute/Ad/AdRegion.h @@ -47,9 +47,9 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp index 022924da84..1f86fa77fb 100644 --- a/engines/wintermute/Ad/AdScene.cpp +++ b/engines/wintermute/Ad/AdScene.cpp @@ -1248,20 +1248,20 @@ void CAdScene::skipTo(int OffsetX, int OffsetY) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CAdScene::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// LoadActor
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "LoadActor") == 0) {
- Stack->CorrectParams(1);
+ if (strcmp(name, "LoadActor") == 0) {
+ stack->CorrectParams(1);
CAdActor *act = new CAdActor(Game);
- if (act && SUCCEEDED(act->loadFile(Stack->Pop()->GetString()))) {
+ if (act && SUCCEEDED(act->loadFile(stack->Pop()->GetString()))) {
addObject(act);
- Stack->PushNative(act, true);
+ stack->PushNative(act, true);
} else {
delete act;
act = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
}
return S_OK;
}
@@ -1269,16 +1269,16 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// LoadEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadEntity") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "LoadEntity") == 0) {
+ stack->CorrectParams(1);
CAdEntity *ent = new CAdEntity(Game);
- if (ent && SUCCEEDED(ent->loadFile(Stack->Pop()->GetString()))) {
+ if (ent && SUCCEEDED(ent->loadFile(stack->Pop()->GetString()))) {
addObject(ent);
- Stack->PushNative(ent, true);
+ stack->PushNative(ent, true);
} else {
delete ent;
ent = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
}
return S_OK;
}
@@ -1286,85 +1286,85 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// CreateEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateEntity") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "CreateEntity") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdEntity *Ent = new CAdEntity(Game);
addObject(Ent);
if (!Val->IsNULL()) Ent->setName(Val->GetString());
- Stack->PushNative(Ent, true);
+ stack->PushNative(Ent, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// UnloadObject / UnloadActor / UnloadEntity / UnloadActor3D / DeleteEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "UnloadObject") == 0 || strcmp(Name, "UnloadActor") == 0 || strcmp(Name, "UnloadEntity") == 0 || strcmp(Name, "UnloadActor3D") == 0 || strcmp(Name, "DeleteEntity") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ else if (strcmp(name, "UnloadObject") == 0 || strcmp(name, "UnloadActor") == 0 || strcmp(name, "UnloadEntity") == 0 || strcmp(name, "UnloadActor3D") == 0 || strcmp(name, "DeleteEntity") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
CAdObject *obj = (CAdObject *)val->GetNative();
removeObject(obj);
if (val->GetType() == VAL_VARIABLE_REF) val->SetNULL();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SkipTo
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SkipTo") == 0) {
- Stack->CorrectParams(2);
- CScValue *val1 = Stack->Pop();
- CScValue *val2 = Stack->Pop();
+ else if (strcmp(name, "SkipTo") == 0) {
+ stack->CorrectParams(2);
+ CScValue *val1 = stack->Pop();
+ CScValue *val2 = stack->Pop();
if (val1->IsNative()) {
skipToObject((CBObject *)val1->GetNative());
} else {
skipTo(val1->GetInt(), val2->GetInt());
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ScrollTo / ScrollToAsync
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollTo") == 0 || strcmp(Name, "ScrollToAsync") == 0) {
- Stack->CorrectParams(2);
- CScValue *val1 = Stack->Pop();
- CScValue *val2 = Stack->Pop();
+ else if (strcmp(name, "ScrollTo") == 0 || strcmp(name, "ScrollToAsync") == 0) {
+ stack->CorrectParams(2);
+ CScValue *val1 = stack->Pop();
+ CScValue *val2 = stack->Pop();
if (val1->IsNative()) {
scrollToObject((CBObject *)val1->GetNative());
} else {
scrollTo(val1->GetInt(), val2->GetInt());
}
- if (strcmp(Name, "ScrollTo") == 0) Script->WaitForExclusive(this);
- Stack->PushNULL();
+ if (strcmp(name, "ScrollTo") == 0) script->WaitForExclusive(this);
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetLayer
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetLayer") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ else if (strcmp(name, "GetLayer") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
if (val->IsInt()) {
int layer = val->GetInt();
- if (layer < 0 || layer >= _layers.GetSize()) Stack->PushNULL();
- else Stack->PushNative(_layers[layer], true);
+ if (layer < 0 || layer >= _layers.GetSize()) stack->PushNULL();
+ else stack->PushNative(_layers[layer], true);
} else {
const char *LayerName = val->GetString();
bool LayerFound = false;
for (int i = 0; i < _layers.GetSize(); i++) {
if (scumm_stricmp(LayerName, _layers[i]->_name) == 0) {
- Stack->PushNative(_layers[i], true);
+ stack->PushNative(_layers[i], true);
LayerFound = true;
break;
}
}
- if (!LayerFound) Stack->PushNULL();
+ if (!LayerFound) stack->PushNULL();
}
return S_OK;
}
@@ -1372,24 +1372,24 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// GetWaypointGroup
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetWaypointGroup") == 0) {
- Stack->CorrectParams(1);
- int group = Stack->Pop()->GetInt();
- if (group < 0 || group >= _waypointGroups.GetSize()) Stack->PushNULL();
- else Stack->PushNative(_waypointGroups[group], true);
+ else if (strcmp(name, "GetWaypointGroup") == 0) {
+ stack->CorrectParams(1);
+ int group = stack->Pop()->GetInt();
+ if (group < 0 || group >= _waypointGroups.GetSize()) stack->PushNULL();
+ else stack->PushNative(_waypointGroups[group], true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetNode
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetNode") == 0) {
- Stack->CorrectParams(1);
- const char *nodeName = Stack->Pop()->GetString();
+ else if (strcmp(name, "GetNode") == 0) {
+ stack->CorrectParams(1);
+ const char *nodeName = stack->Pop()->GetString();
CBObject *node = getNodeByName(nodeName);
- if (node) Stack->PushNative((CBScriptable *)node, true);
- else Stack->PushNULL();
+ if (node) stack->PushNative((CBScriptable *)node, true);
+ else stack->PushNULL();
return S_OK;
}
@@ -1397,9 +1397,9 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// GetFreeNode
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetFreeNode") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "GetFreeNode") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdObject *Ret = NULL;
if (Val->IsInt()) {
@@ -1414,8 +1414,8 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi }
}
}
- if (Ret) Stack->PushNative(Ret, true);
- else Stack->PushNULL();
+ if (Ret) stack->PushNative(Ret, true);
+ else stack->PushNULL();
return S_OK;
}
@@ -1423,11 +1423,11 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// GetRegionAt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetRegionAt") == 0) {
- Stack->CorrectParams(3);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "GetRegionAt") == 0) {
+ stack->CorrectParams(3);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
+ CScValue *Val = stack->Pop();
bool IncludeDecors = false;
if (!Val->IsNULL()) IncludeDecors = Val->GetBool();
@@ -1438,142 +1438,142 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi if (Node->_type == OBJECT_REGION && Node->_region->_active && Node->_region->PointInRegion(X, Y)) {
if (Node->_region->_decoration && !IncludeDecors) continue;
- Stack->PushNative(Node->_region, true);
+ stack->PushNative(Node->_region, true);
return S_OK;
}
}
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// IsBlockedAt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsBlockedAt") == 0) {
- Stack->CorrectParams(2);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
+ else if (strcmp(name, "IsBlockedAt") == 0) {
+ stack->CorrectParams(2);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
- Stack->PushBool(isBlockedAt(X, Y));
+ stack->PushBool(isBlockedAt(X, Y));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// IsWalkableAt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsWalkableAt") == 0) {
- Stack->CorrectParams(2);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
+ else if (strcmp(name, "IsWalkableAt") == 0) {
+ stack->CorrectParams(2);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
- Stack->PushBool(isWalkableAt(X, Y));
+ stack->PushBool(isWalkableAt(X, Y));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetScaleAt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetScaleAt") == 0) {
- Stack->CorrectParams(2);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
+ else if (strcmp(name, "GetScaleAt") == 0) {
+ stack->CorrectParams(2);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
- Stack->PushFloat(getZoomAt(X, Y));
+ stack->PushFloat(getZoomAt(X, Y));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetRotationAt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetRotationAt") == 0) {
- Stack->CorrectParams(2);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
+ else if (strcmp(name, "GetRotationAt") == 0) {
+ stack->CorrectParams(2);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
- Stack->PushFloat(getRotationAt(X, Y));
+ stack->PushFloat(getRotationAt(X, Y));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// IsScrolling
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsScrolling") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "IsScrolling") == 0) {
+ stack->CorrectParams(0);
bool Ret = false;
if (_autoScroll) {
if (_targetOffsetLeft != _offsetLeft || _targetOffsetTop != _offsetTop) Ret = true;
}
- Stack->PushBool(Ret);
+ stack->PushBool(Ret);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// FadeOut / FadeOutAsync
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeOut") == 0 || strcmp(Name, "FadeOutAsync") == 0) {
- Stack->CorrectParams(5);
- uint32 Duration = Stack->Pop()->GetInt(500);
- byte Red = Stack->Pop()->GetInt(0);
- byte Green = Stack->Pop()->GetInt(0);
- byte Blue = Stack->Pop()->GetInt(0);
- byte Alpha = Stack->Pop()->GetInt(0xFF);
+ else if (strcmp(name, "FadeOut") == 0 || strcmp(name, "FadeOutAsync") == 0) {
+ stack->CorrectParams(5);
+ uint32 Duration = stack->Pop()->GetInt(500);
+ byte Red = stack->Pop()->GetInt(0);
+ byte Green = stack->Pop()->GetInt(0);
+ byte Blue = stack->Pop()->GetInt(0);
+ byte Alpha = stack->Pop()->GetInt(0xFF);
_fader->fadeOut(DRGBA(Red, Green, Blue, Alpha), Duration);
- if (strcmp(Name, "FadeOutAsync") != 0) Script->WaitFor(_fader);
+ if (strcmp(name, "FadeOutAsync") != 0) script->WaitFor(_fader);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// FadeIn / FadeInAsync
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeIn") == 0 || strcmp(Name, "FadeInAsync") == 0) {
- Stack->CorrectParams(5);
- uint32 Duration = Stack->Pop()->GetInt(500);
- byte Red = Stack->Pop()->GetInt(0);
- byte Green = Stack->Pop()->GetInt(0);
- byte Blue = Stack->Pop()->GetInt(0);
- byte Alpha = Stack->Pop()->GetInt(0xFF);
+ else if (strcmp(name, "FadeIn") == 0 || strcmp(name, "FadeInAsync") == 0) {
+ stack->CorrectParams(5);
+ uint32 Duration = stack->Pop()->GetInt(500);
+ byte Red = stack->Pop()->GetInt(0);
+ byte Green = stack->Pop()->GetInt(0);
+ byte Blue = stack->Pop()->GetInt(0);
+ byte Alpha = stack->Pop()->GetInt(0xFF);
_fader->fadeIn(DRGBA(Red, Green, Blue, Alpha), Duration);
- if (strcmp(Name, "FadeInAsync") != 0) Script->WaitFor(_fader);
+ if (strcmp(name, "FadeInAsync") != 0) script->WaitFor(_fader);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetFadeColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetFadeColor") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_fader->getCurrentColor());
+ else if (strcmp(name, "GetFadeColor") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_fader->getCurrentColor());
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// IsPointInViewport
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsPointInViewport") == 0) {
- Stack->CorrectParams(2);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
- Stack->PushBool(pointInViewport(X, Y));
+ else if (strcmp(name, "IsPointInViewport") == 0) {
+ stack->CorrectParams(2);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
+ stack->PushBool(pointInViewport(X, Y));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetViewport
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetViewport") == 0) {
- Stack->CorrectParams(4);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
- int Width = Stack->Pop()->GetInt();
- int Height = Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetViewport") == 0) {
+ stack->CorrectParams(4);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
+ int Width = stack->Pop()->GetInt();
+ int Height = stack->Pop()->GetInt();
if (Width <= 0) Width = Game->_renderer->_width;
if (Height <= 0) Height = Game->_renderer->_height;
@@ -1581,7 +1581,7 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi if (!_viewport) _viewport = new CBViewport(Game);
if (_viewport) _viewport->setRect(X, Y, X + Width, Y + Height);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -1589,9 +1589,9 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// AddLayer
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddLayer") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "AddLayer") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdLayer *Layer = new CAdLayer(Game);
if (!Val->IsNULL()) Layer->setName(Val->GetString());
@@ -1602,17 +1602,17 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi _layers.Add(Layer);
Game->RegisterObject(Layer);
- Stack->PushNative(Layer, true);
+ stack->PushNative(Layer, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// InsertLayer
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InsertLayer") == 0) {
- Stack->CorrectParams(2);
- int Index = Stack->Pop()->GetInt();
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "InsertLayer") == 0) {
+ stack->CorrectParams(2);
+ int Index = stack->Pop()->GetInt();
+ CScValue *Val = stack->Pop();
CAdLayer *Layer = new CAdLayer(Game);
if (!Val->IsNULL()) Layer->setName(Val->GetString());
@@ -1626,16 +1626,16 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi Game->RegisterObject(Layer);
- Stack->PushNative(Layer, true);
+ stack->PushNative(Layer, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DeleteLayer
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteLayer") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "DeleteLayer") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CAdLayer *ToDelete = NULL;
if (Val->IsNative()) {
@@ -1653,13 +1653,13 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi }
}
if (ToDelete == NULL) {
- Stack->PushBool(false);
+ stack->PushBool(false);
return S_OK;
}
if (ToDelete->_main) {
- Script->RuntimeError("Scene.DeleteLayer - cannot delete main scene layer");
- Stack->PushBool(false);
+ script->RuntimeError("Scene.DeleteLayer - cannot delete main scene layer");
+ stack->PushBool(false);
return S_OK;
}
@@ -1670,22 +1670,22 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi break;
}
}
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
- else return CBObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CAdScene::scGetProperty(const char *Name) {
+CScValue *CAdScene::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("scene");
return _scValue;
}
@@ -1693,7 +1693,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumLayers (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumLayers") == 0) {
+ else if (strcmp(name, "NumLayers") == 0) {
_scValue->SetInt(_layers.GetSize());
return _scValue;
}
@@ -1701,7 +1701,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumWaypointGroups (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumWaypointGroups") == 0) {
+ else if (strcmp(name, "NumWaypointGroups") == 0) {
_scValue->SetInt(_waypointGroups.GetSize());
return _scValue;
}
@@ -1709,7 +1709,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MainLayer (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MainLayer") == 0) {
+ else if (strcmp(name, "MainLayer") == 0) {
if (_mainLayer) _scValue->SetNative(_mainLayer, true);
else _scValue->SetNULL();
@@ -1719,7 +1719,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumFreeNodes (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumFreeNodes") == 0) {
+ else if (strcmp(name, "NumFreeNodes") == 0) {
_scValue->SetInt(_objects.GetSize());
return _scValue;
}
@@ -1727,7 +1727,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MouseX (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MouseX") == 0) {
+ else if (strcmp(name, "MouseX") == 0) {
int ViewportX;
getViewportOffset(&ViewportX);
@@ -1738,7 +1738,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MouseY (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MouseY") == 0) {
+ else if (strcmp(name, "MouseY") == 0) {
int ViewportY;
getViewportOffset(NULL, &ViewportY);
@@ -1749,7 +1749,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AutoScroll
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AutoScroll") == 0) {
+ else if (strcmp(name, "AutoScroll") == 0) {
_scValue->SetBool(_autoScroll);
return _scValue;
}
@@ -1757,7 +1757,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// PersistentState
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PersistentState") == 0) {
+ else if (strcmp(name, "PersistentState") == 0) {
_scValue->SetBool(_persistentState);
return _scValue;
}
@@ -1765,7 +1765,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// PersistentStateSprites
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PersistentStateSprites") == 0) {
+ else if (strcmp(name, "PersistentStateSprites") == 0) {
_scValue->SetBool(_persistentStateSprites);
return _scValue;
}
@@ -1773,7 +1773,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ScrollPixelsX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollPixelsX") == 0) {
+ else if (strcmp(name, "ScrollPixelsX") == 0) {
_scValue->SetInt(_scrollPixelsH);
return _scValue;
}
@@ -1781,7 +1781,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ScrollPixelsY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollPixelsY") == 0) {
+ else if (strcmp(name, "ScrollPixelsY") == 0) {
_scValue->SetInt(_scrollPixelsV);
return _scValue;
}
@@ -1790,7 +1790,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ScrollSpeedX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollSpeedX") == 0) {
+ else if (strcmp(name, "ScrollSpeedX") == 0) {
_scValue->SetInt(_scrollTimeH);
return _scValue;
}
@@ -1798,7 +1798,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ScrollSpeedY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollSpeedY") == 0) {
+ else if (strcmp(name, "ScrollSpeedY") == 0) {
_scValue->SetInt(_scrollTimeV);
return _scValue;
}
@@ -1806,7 +1806,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// OffsetX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "OffsetX") == 0) {
+ else if (strcmp(name, "OffsetX") == 0) {
_scValue->SetInt(_offsetLeft);
return _scValue;
}
@@ -1814,7 +1814,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// OffsetY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "OffsetY") == 0) {
+ else if (strcmp(name, "OffsetY") == 0) {
_scValue->SetInt(_offsetTop);
return _scValue;
}
@@ -1822,7 +1822,7 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Width (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Width") == 0) {
+ else if (strcmp(name, "Width") == 0) {
if (_mainLayer) _scValue->SetInt(_mainLayer->_width);
else _scValue->SetInt(0);
return _scValue;
@@ -1831,22 +1831,22 @@ CScValue *CAdScene::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Height (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Height") == 0) {
+ else if (strcmp(name, "Height") == 0) {
if (_mainLayer) _scValue->SetInt(_mainLayer->_height);
else _scValue->SetInt(0);
return _scValue;
}
- else return CBObject::scGetProperty(Name);
+ else return CBObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CAdScene::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
}
@@ -1854,7 +1854,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AutoScroll
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AutoScroll") == 0) {
+ else if (strcmp(name, "AutoScroll") == 0) {
_autoScroll = Value->GetBool();
return S_OK;
}
@@ -1862,7 +1862,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// PersistentState
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PersistentState") == 0) {
+ else if (strcmp(name, "PersistentState") == 0) {
_persistentState = Value->GetBool();
return S_OK;
}
@@ -1870,7 +1870,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// PersistentStateSprites
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PersistentStateSprites") == 0) {
+ else if (strcmp(name, "PersistentStateSprites") == 0) {
_persistentStateSprites = Value->GetBool();
return S_OK;
}
@@ -1878,7 +1878,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// ScrollPixelsX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollPixelsX") == 0) {
+ else if (strcmp(name, "ScrollPixelsX") == 0) {
_scrollPixelsH = Value->GetInt();
return S_OK;
}
@@ -1886,7 +1886,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// ScrollPixelsY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollPixelsY") == 0) {
+ else if (strcmp(name, "ScrollPixelsY") == 0) {
_scrollPixelsV = Value->GetInt();
return S_OK;
}
@@ -1894,7 +1894,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// ScrollSpeedX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollSpeedX") == 0) {
+ else if (strcmp(name, "ScrollSpeedX") == 0) {
_scrollTimeH = Value->GetInt();
return S_OK;
}
@@ -1902,7 +1902,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// ScrollSpeedY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScrollSpeedY") == 0) {
+ else if (strcmp(name, "ScrollSpeedY") == 0) {
_scrollTimeV = Value->GetInt();
return S_OK;
}
@@ -1910,7 +1910,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// OffsetX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "OffsetX") == 0) {
+ else if (strcmp(name, "OffsetX") == 0) {
_offsetLeft = Value->GetInt();
int ViewportWidth, ViewportHeight;
@@ -1926,7 +1926,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// OffsetY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "OffsetY") == 0) {
+ else if (strcmp(name, "OffsetY") == 0) {
_offsetTop = Value->GetInt();
int ViewportWidth, ViewportHeight;
@@ -1939,7 +1939,7 @@ HRESULT CAdScene::scSetProperty(const char *Name, CScValue *Value) { return S_OK;
}
- else return CBObject::scSetProperty(Name, Value);
+ else return CBObject::scSetProperty(name, Value);
}
@@ -2428,7 +2428,7 @@ void CAdScene::setOffset(int OffsetLeft, int OffsetTop) { //////////////////////////////////////////////////////////////////////////
-CBObject *CAdScene::getNodeByName(const char *Name) {
+CBObject *CAdScene::getNodeByName(const char *name) {
int i;
CBObject *ret = NULL;
@@ -2437,8 +2437,8 @@ CBObject *CAdScene::getNodeByName(const char *Name) { CAdLayer *layer = _layers[i];
for (int j = 0; j < layer->_nodes.GetSize(); j++) {
CAdSceneNode *node = layer->_nodes[j];
- if ((node->_type == OBJECT_ENTITY && !scumm_stricmp(Name, node->_entity->_name)) ||
- (node->_type == OBJECT_REGION && !scumm_stricmp(Name, node->_region->_name))) {
+ if ((node->_type == OBJECT_ENTITY && !scumm_stricmp(name, node->_entity->_name)) ||
+ (node->_type == OBJECT_REGION && !scumm_stricmp(name, node->_region->_name))) {
switch (node->_type) {
case OBJECT_ENTITY:
ret = node->_entity;
@@ -2456,14 +2456,14 @@ CBObject *CAdScene::getNodeByName(const char *Name) { // free entities
for (i = 0; i < _objects.GetSize(); i++) {
- if (_objects[i]->_type == OBJECT_ENTITY && !scumm_stricmp(Name, _objects[i]->_name)) {
+ if (_objects[i]->_type == OBJECT_ENTITY && !scumm_stricmp(name, _objects[i]->_name)) {
return _objects[i];
}
}
// waypoint groups
for (i = 0; i < _waypointGroups.GetSize(); i++) {
- if (!scumm_stricmp(Name, _waypointGroups[i]->_name)) {
+ if (!scumm_stricmp(name, _waypointGroups[i]->_name)) {
return _waypointGroups[i];
}
}
diff --git a/engines/wintermute/Ad/AdScene.h b/engines/wintermute/Ad/AdScene.h index a9659c3849..6c6f16eea0 100644 --- a/engines/wintermute/Ad/AdScene.h +++ b/engines/wintermute/Ad/AdScene.h @@ -62,7 +62,7 @@ public: HRESULT saveState();
bool _persistentState;
bool _persistentStateSprites;
- CBObject *getNodeByName(const char *Name);
+ CBObject *getNodeByName(const char *name);
void setOffset(int OffsetLeft, int OffsetTop);
bool pointInViewport(int X, int Y);
int getOffsetTop();
@@ -156,9 +156,9 @@ public: int getPointsDist(CBPoint p1, CBPoint p2, CBObject *requester = NULL);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
diff --git a/engines/wintermute/Ad/AdWaypointGroup.cpp b/engines/wintermute/Ad/AdWaypointGroup.cpp index 8f7137b9e8..1e60c33b6a 100644 --- a/engines/wintermute/Ad/AdWaypointGroup.cpp +++ b/engines/wintermute/Ad/AdWaypointGroup.cpp @@ -200,13 +200,13 @@ HRESULT CAdWaypointGroup::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
-CScValue *CAdWaypointGroup::scGetProperty(const char *Name) {
+CScValue *CAdWaypointGroup::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("waypoint-group");
return _scValue;
}
@@ -214,26 +214,26 @@ CScValue *CAdWaypointGroup::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Active") == 0) {
+ else if (strcmp(name, "Active") == 0) {
_scValue->SetBool(_active);
return _scValue;
}
- else return CBObject::scGetProperty(Name);
+ else return CBObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdWaypointGroup::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CAdWaypointGroup::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Active") == 0) {
+ if (strcmp(name, "Active") == 0) {
_active = Value->GetBool();
return S_OK;
}
- else return CBObject::scSetProperty(Name, Value);
+ else return CBObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Ad/AdWaypointGroup.h b/engines/wintermute/Ad/AdWaypointGroup.h index e5203cc61d..fda11b88c4 100644 --- a/engines/wintermute/Ad/AdWaypointGroup.h +++ b/engines/wintermute/Ad/AdWaypointGroup.h @@ -49,8 +49,8 @@ public: virtual ~CAdWaypointGroup();
CBArray<CBPoint *, CBPoint *> _points;
int _editorSelectedPoint;
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/Base/BDebugger.cpp b/engines/wintermute/Base/BDebugger.cpp index d55cb189b7..ab73493e69 100644 --- a/engines/wintermute/Base/BDebugger.cpp +++ b/engines/wintermute/Base/BDebugger.cpp @@ -71,23 +71,23 @@ HRESULT CBDebugger::OnLog(unsigned int ErrorCode, const char *Text) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptInit(CScScript *Script) {
+HRESULT CBDebugger::OnScriptInit(CScScript *script) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptEventThreadInit(CScScript *Script, CScScript *ParentScript, const char *Name) {
+HRESULT CBDebugger::OnScriptEventThreadInit(CScScript *Script, CScScript *ParentScript, const char *name) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptMethodThreadInit(CScScript *Script, CScScript *ParentScript, const char *Name) {
+HRESULT CBDebugger::OnScriptMethodThreadInit(CScScript *Script, CScScript *ParentScript, const char *name) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptShutdown(CScScript *Script) {
+HRESULT CBDebugger::OnScriptShutdown(CScScript *script) {
return S_OK;
}
@@ -108,7 +108,7 @@ HRESULT CBDebugger::OnScriptShutdownScope(CScScript *Script, CScValue *Scope) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnVariableInit(EWmeDebuggerVariableType Type, CScScript *Script, CScValue *Scope, CScValue *Var, const char *VariableName) {
+HRESULT CBDebugger::OnVariableInit(EWmeDebuggerVariableType Type, CScScript *script, CScValue *Scope, CScValue *Var, const char *VariableName) {
return S_OK;
}
@@ -118,7 +118,7 @@ HRESULT CBDebugger::OnVariableChangeValue(CScValue *Var, CScValue *Value) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptHitBreakpoint(CScScript *Script) {
+HRESULT CBDebugger::OnScriptHitBreakpoint(CScScript *script) {
return S_OK;
}
diff --git a/engines/wintermute/Base/BDebugger.h b/engines/wintermute/Base/BDebugger.h index 52bfc51c55..de9c8f6b7c 100644 --- a/engines/wintermute/Base/BDebugger.h +++ b/engines/wintermute/Base/BDebugger.h @@ -51,18 +51,18 @@ public: HRESULT OnGameShutdown();
HRESULT OnGameTick();
HRESULT OnLog(unsigned int ErrorCode, const char *Text);
- HRESULT OnScriptInit(CScScript *Script);
- HRESULT OnScriptEventThreadInit(CScScript *Script, CScScript *ParentScript, const char *Name);
- HRESULT OnScriptMethodThreadInit(CScScript *Script, CScScript *ParentScript, const char *Name);
+ HRESULT OnScriptInit(CScScript *script);
+ HRESULT OnScriptEventThreadInit(CScScript *Script, CScScript *ParentScript, const char *name);
+ HRESULT OnScriptMethodThreadInit(CScScript *Script, CScScript *ParentScript, const char *name);
- HRESULT OnScriptShutdown(CScScript *Script);
+ HRESULT OnScriptShutdown(CScScript *script);
HRESULT OnScriptChangeLine(CScScript *Script, int Line);
HRESULT OnScriptChangeScope(CScScript *Script, CScValue *Scope);
HRESULT OnScriptShutdownScope(CScScript *Script, CScValue *Scope);
- HRESULT OnVariableInit(EWmeDebuggerVariableType Type, CScScript *Script, CScValue *Scope, CScValue *Var, const char *VariableName);
+ HRESULT OnVariableInit(EWmeDebuggerVariableType Type, CScScript *script, CScValue *Scope, CScValue *Var, const char *VariableName);
HRESULT OnVariableChangeValue(CScValue *Var, CScValue *Value);
- HRESULT OnScriptHitBreakpoint(CScScript *Script);
+ HRESULT OnScriptHitBreakpoint(CScScript *script);
// IWmeDebugServer interface
virtual bool AttachClient(IWmeDebugClient *Client);
diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp index b346646841..9e98412021 100644 --- a/engines/wintermute/Base/BFileManager.cpp +++ b/engines/wintermute/Base/BFileManager.cpp @@ -448,9 +448,9 @@ HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool Sea pkg->_boundToExe = BoundToExe;
// read package info
- byte NameLength = package->readByte();
- pkg->_name = new char[NameLength];
- package->read(pkg->_name, NameLength);
+ byte nameLength = package->readByte();
+ pkg->_name = new char[nameLength];
+ package->read(pkg->_name, nameLength);
pkg->_cD = package->readByte();
pkg->_priority = hdr.Priority;
@@ -462,26 +462,26 @@ HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool Sea uint32 NumFiles = package->readUint32LE();
for (uint32 j = 0; j < NumFiles; j++) {
- char *Name;
+ char *name;
uint32 Offset, Length, CompLength, Flags, TimeDate1, TimeDate2;
- NameLength = package->readByte();
- Name = new char[NameLength];
- package->read(Name, NameLength);
+ nameLength = package->readByte();
+ name = new char[nameLength];
+ package->read(name, nameLength);
// v2 - xor name
if (hdr.PackageVersion == PACKAGE_VERSION) {
- for (int k = 0; k < NameLength; k++) {
- ((byte *)Name)[k] ^= 'D';
+ for (int k = 0; k < nameLength; k++) {
+ ((byte *)name)[k] ^= 'D';
}
}
// some old version of ProjectMan writes invalid directory entries
// so at least prevent strupr from corrupting memory
- Name[NameLength - 1] = '\0';
+ name[nameLength - 1] = '\0';
- CBPlatform::strupr(Name);
+ CBPlatform::strupr(name);
Offset = package->readUint32LE();
Offset += AbsoluteOffset;
@@ -493,7 +493,7 @@ HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool Sea TimeDate1 = package->readUint32LE();
TimeDate2 = package->readUint32LE();
}
- _filesIter = _files.find(Name);
+ _filesIter = _files.find(name);
if (_filesIter == _files.end()) {
CBFileEntry *file = new CBFileEntry(Game);
file->_package = pkg;
@@ -502,7 +502,7 @@ HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool Sea file->_compressedLength = CompLength;
file->_flags = Flags;
- _files[Name] = file;
+ _files[name] = file;
} else {
// current package has lower CD number or higher priority, than the registered
if (pkg->_cD < _filesIter->_value->_package->_cD || pkg->_priority > _filesIter->_value->_package->_priority) {
@@ -513,7 +513,7 @@ HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool Sea _filesIter->_value->_flags = Flags;
}
}
- delete [] Name;
+ delete [] name;
}
}
@@ -522,12 +522,12 @@ HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool Sea return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBFileManager::registerPackage(const char *Path, const char *Name, bool SearchSignature) {
+HRESULT CBFileManager::registerPackage(const char *Path, const char *name, bool SearchSignature) {
// TODO
error("Implement RegisterPackage, this is the old one");
#if 0
char Filename[MAX_PATH];
- sprintf(Filename, "%s%s", Path, Name);
+ sprintf(Filename, "%s%s", Path, name);
FILE *f = fopen(Filename, "rb");
if (!f) {
@@ -577,10 +577,10 @@ HRESULT CBFileManager::registerPackage(const char *Path, const char *Name, bool pkg->_boundToExe = BoundToExe;
// read package info
- byte NameLength;
- fread(&NameLength, sizeof(byte), 1, f);
- pkg->_name = new char[NameLength];
- fread(pkg->_name, NameLength, 1, f);
+ byte nameLength;
+ fread(&nameLength, sizeof(byte), 1, f);
+ pkg->_name = new char[nameLength];
+ fread(pkg->_name, nameLength, 1, f);
fread(&pkg->_cD, sizeof(byte), 1, f);
pkg->_priority = hdr.Priority;
@@ -593,26 +593,26 @@ HRESULT CBFileManager::registerPackage(const char *Path, const char *Name, bool fread(&NumFiles, sizeof(uint32), 1, f);
for (int j = 0; j < NumFiles; j++) {
- char *Name;
+ char *name;
uint32 Offset, Length, CompLength, Flags, TimeDate1, TimeDate2;
- fread(&NameLength, sizeof(byte), 1, f);
- Name = new char[NameLength];
- fread(Name, NameLength, 1, f);
+ fread(&nameLength, sizeof(byte), 1, f);
+ name = new char[nameLength];
+ fread(name, nameLength, 1, f);
// v2 - xor name
if (hdr.PackageVersion == PACKAGE_VERSION) {
- for (int k = 0; k < NameLength; k++) {
- ((byte *)Name)[k] ^= 'D';
+ for (int k = 0; k < nameLength; k++) {
+ ((byte *)name)[k] ^= 'D';
}
}
// some old version of ProjectMan writes invalid directory entries
// so at least prevent strupr from corrupting memory
- Name[NameLength - 1] = '\0';
+ name[nameLength - 1] = '\0';
- CBPlatform::strupr(Name);
+ CBPlatform::strupr(name);
fread(&Offset, sizeof(uint32), 1, f);
Offset += AbsoluteOffset;
@@ -624,7 +624,7 @@ HRESULT CBFileManager::registerPackage(const char *Path, const char *Name, bool fread(&TimeDate1, sizeof(uint32), 1, f);
fread(&TimeDate2, sizeof(uint32), 1, f);
}
- _filesIter = _files.find(Name);
+ _filesIter = _files.find(name);
if (_filesIter == _files.end()) {
CBFileEntry *file = new CBFileEntry(Game);
file->_package = pkg;
@@ -633,7 +633,7 @@ HRESULT CBFileManager::registerPackage(const char *Path, const char *Name, bool file->_compressedLength = CompLength;
file->_flags = Flags;
- _files[Name] = file;
+ _files[name] = file;
} else {
// current package has lower CD number or higher priority, than the registered
if (pkg->_cD < _filesIter->_value->_package->_cD || pkg->_priority > _filesIter->_value->_package->_priority) {
@@ -644,7 +644,7 @@ HRESULT CBFileManager::registerPackage(const char *Path, const char *Name, bool _filesIter->_value->_flags = Flags;
}
}
- delete [] Name;
+ delete [] name;
}
}
@@ -666,7 +666,7 @@ bool CBFileManager::isValidPackage(const AnsiString &fileName) const { }
//////////////////////////////////////////////////////////////////////////
-Common::File *CBFileManager::openPackage(const Common::String &Name) {
+Common::File *CBFileManager::openPackage(const Common::String &name) {
//TODO: Is it really necessary to do this when we have the ScummVM-system?
//RestoreCurrentDir();
@@ -675,40 +675,40 @@ Common::File *CBFileManager::openPackage(const Common::String &Name) { char Filename[MAX_PATH];
for (int i = 0; i < _packagePaths.GetSize(); i++) {
- sprintf(Filename, "%s%s.%s", _packagePaths[i], Name.c_str(), PACKAGE_EXTENSION);
+ sprintf(Filename, "%s%s.%s", _packagePaths[i], name.c_str(), PACKAGE_EXTENSION);
ret->open(Filename);
if (ret->isOpen()) {
return ret;
}
}
- sprintf(Filename, "%s.%s", Name.c_str(), PACKAGE_EXTENSION);
+ sprintf(Filename, "%s.%s", name.c_str(), PACKAGE_EXTENSION);
ret->open(Filename);
if (ret->isOpen()) {
return ret;
}
- warning("CBFileManager::OpenPackage - Couldn't load file %s", Name.c_str());
+ warning("CBFileManager::OpenPackage - Couldn't load file %s", name.c_str());
delete ret;
return NULL;
}
//////////////////////////////////////////////////////////////////////////
-Common::File *CBFileManager::openSingleFile(const Common::String &Name) {
+Common::File *CBFileManager::openSingleFile(const Common::String &name) {
restoreCurrentDir();
Common::File *ret = NULL;
char Filename[MAX_PATH];
for (int i = 0; i < _singlePaths.GetSize(); i++) {
- sprintf(Filename, "%s%s", _singlePaths[i], Name.c_str());
+ sprintf(Filename, "%s%s", _singlePaths[i], name.c_str());
ret->open(Filename);
if (ret->isOpen())
return ret;
}
// didn't find in search paths, try to open directly
- ret->open(Name);
+ ret->open(name);
if (ret->isOpen()) {
return ret;
} else {
diff --git a/engines/wintermute/Base/BFrame.cpp b/engines/wintermute/Base/BFrame.cpp index 5dd5627e58..75cf1e02c2 100644 --- a/engines/wintermute/Base/BFrame.cpp +++ b/engines/wintermute/Base/BFrame.cpp @@ -401,49 +401,49 @@ HRESULT CBFrame::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CBFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetSound
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "GetSound") == 0) {
- Stack->CorrectParams(0);
+ if (strcmp(name, "GetSound") == 0) {
+ stack->CorrectParams(0);
- if (_sound && _sound->_soundFilename) Stack->PushString(_sound->_soundFilename);
- else Stack->PushNULL();
+ if (_sound && _sound->_soundFilename) stack->PushString(_sound->_soundFilename);
+ else stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetSound
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetSound") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ if (strcmp(name, "SetSound") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
delete _sound;
_sound = NULL;
if (!Val->IsNULL()) {
_sound = new CBSound(Game);
if (!_sound || FAILED(_sound->setSound(Val->GetString(), SOUND_SFX, false))) {
- Stack->PushBool(false);
+ stack->PushBool(false);
delete _sound;
_sound = NULL;
- } else Stack->PushBool(true);
- } else Stack->PushBool(true);
+ } else stack->PushBool(true);
+ } else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetSubframe
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "GetSubframe") == 0) {
- Stack->CorrectParams(1);
- int Index = Stack->Pop()->GetInt(-1);
+ if (strcmp(name, "GetSubframe") == 0) {
+ stack->CorrectParams(1);
+ int Index = stack->Pop()->GetInt(-1);
if (Index < 0 || Index >= _subframes.GetSize()) {
- Script->RuntimeError("Frame.GetSubframe: Subframe index %d is out of range.", Index);
- Stack->PushNULL();
- } else Stack->PushNative(_subframes[Index], true);
+ script->RuntimeError("Frame.GetSubframe: Subframe index %d is out of range.", Index);
+ stack->PushNULL();
+ } else stack->PushNative(_subframes[Index], true);
return S_OK;
}
@@ -451,13 +451,13 @@ HRESULT CBFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// DeleteSubframe
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteSubframe") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "DeleteSubframe") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (Val->IsInt()) {
int Index = Val->GetInt(-1);
if (Index < 0 || Index >= _subframes.GetSize()) {
- Script->RuntimeError("Frame.DeleteSubframe: Subframe index %d is out of range.", Index);
+ script->RuntimeError("Frame.DeleteSubframe: Subframe index %d is out of range.", Index);
}
} else {
CBSubFrame *Sub = (CBSubFrame *)Val->GetNative();
@@ -469,16 +469,16 @@ HRESULT CBFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This }
}
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// AddSubframe
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddSubframe") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "AddSubframe") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
const char *Filename = NULL;
if (!Val->IsNULL()) Filename = Val->GetString();
@@ -489,19 +489,19 @@ HRESULT CBFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This }
_subframes.Add(Sub);
- Stack->PushNative(Sub, true);
+ stack->PushNative(Sub, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// InsertSubframe
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InsertSubframe") == 0) {
- Stack->CorrectParams(2);
- int Index = Stack->Pop()->GetInt();
+ else if (strcmp(name, "InsertSubframe") == 0) {
+ stack->CorrectParams(2);
+ int Index = stack->Pop()->GetInt();
if (Index < 0) Index = 0;
- CScValue *Val = Stack->Pop();
+ CScValue *Val = stack->Pop();
const char *Filename = NULL;
if (!Val->IsNULL()) Filename = Val->GetString();
@@ -513,46 +513,46 @@ HRESULT CBFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This if (Index >= _subframes.GetSize()) _subframes.Add(Sub);
else _subframes.InsertAt(Index, Sub);
- Stack->PushNative(Sub, true);
+ stack->PushNative(Sub, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetSubframe") == 0) {
- Stack->CorrectParams(1);
- int Index = Stack->Pop()->GetInt(-1);
+ else if (strcmp(name, "GetSubframe") == 0) {
+ stack->CorrectParams(1);
+ int Index = stack->Pop()->GetInt(-1);
if (Index < 0 || Index >= _applyEvent.GetSize()) {
- Script->RuntimeError("Frame.GetEvent: Event index %d is out of range.", Index);
- Stack->PushNULL();
- } else Stack->PushString(_applyEvent[Index]);
+ script->RuntimeError("Frame.GetEvent: Event index %d is out of range.", Index);
+ stack->PushNULL();
+ } else stack->PushString(_applyEvent[Index]);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// AddEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddEvent") == 0) {
- Stack->CorrectParams(1);
- const char *Event = Stack->Pop()->GetString();
+ else if (strcmp(name, "AddEvent") == 0) {
+ stack->CorrectParams(1);
+ const char *Event = stack->Pop()->GetString();
for (int i = 0; i < _applyEvent.GetSize(); i++) {
if (scumm_stricmp(_applyEvent[i], Event) == 0) {
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
}
_applyEvent.Add(Event);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DeleteEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteEvent") == 0) {
- Stack->CorrectParams(1);
- const char *Event = Stack->Pop()->GetString();
+ else if (strcmp(name, "DeleteEvent") == 0) {
+ stack->CorrectParams(1);
+ const char *Event = stack->Pop()->GetString();
for (int i = 0; i < _applyEvent.GetSize(); i++) {
if (scumm_stricmp(_applyEvent[i], Event) == 0) {
delete [] _applyEvent[i];
@@ -560,27 +560,27 @@ HRESULT CBFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This break;
}
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
else {
- if (_subframes.GetSize() == 1) return _subframes[0]->scCallMethod(Script, Stack, ThisStack, Name);
- else return CBScriptable::scCallMethod(Script, Stack, ThisStack, Name);
+ if (_subframes.GetSize() == 1) return _subframes[0]->scCallMethod(script, stack, thisStack, name);
+ else return CBScriptable::scCallMethod(script, stack, thisStack, name);
}
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBFrame::scGetProperty(const char *Name) {
+CScValue *CBFrame::scGetProperty(const char *name) {
if (!_scValue) _scValue = new CScValue(Game);
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("frame");
return _scValue;
}
@@ -588,7 +588,7 @@ CScValue *CBFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Delay
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Delay") == 0) {
+ else if (strcmp(name, "Delay") == 0) {
_scValue->SetInt(_delay);
return _scValue;
}
@@ -596,7 +596,7 @@ CScValue *CBFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Keyframe
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Keyframe") == 0) {
+ else if (strcmp(name, "Keyframe") == 0) {
_scValue->SetBool(_keyframe);
return _scValue;
}
@@ -604,7 +604,7 @@ CScValue *CBFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// KillSounds
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "KillSounds") == 0) {
+ else if (strcmp(name, "KillSounds") == 0) {
_scValue->SetBool(_killSound);
return _scValue;
}
@@ -612,7 +612,7 @@ CScValue *CBFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MoveX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MoveX") == 0) {
+ else if (strcmp(name, "MoveX") == 0) {
_scValue->SetInt(_moveX);
return _scValue;
}
@@ -620,7 +620,7 @@ CScValue *CBFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MoveY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MoveY") == 0) {
+ else if (strcmp(name, "MoveY") == 0) {
_scValue->SetInt(_moveY);
return _scValue;
}
@@ -628,7 +628,7 @@ CScValue *CBFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumSubframes (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumSubframes") == 0) {
+ else if (strcmp(name, "NumSubframes") == 0) {
_scValue->SetInt(_subframes.GetSize());
return _scValue;
}
@@ -636,25 +636,25 @@ CScValue *CBFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumEvents (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumEvents") == 0) {
+ else if (strcmp(name, "NumEvents") == 0) {
_scValue->SetInt(_applyEvent.GetSize());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
else {
- if (_subframes.GetSize() == 1) return _subframes[0]->scGetProperty(Name);
- else return CBScriptable::scGetProperty(Name);
+ if (_subframes.GetSize() == 1) return _subframes[0]->scGetProperty(name);
+ else return CBScriptable::scGetProperty(name);
}
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBFrame::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CBFrame::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Delay
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Delay") == 0) {
+ if (strcmp(name, "Delay") == 0) {
_delay = MAX(0, Value->GetInt());
return S_OK;
}
@@ -662,7 +662,7 @@ HRESULT CBFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Keyframe
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Keyframe") == 0) {
+ else if (strcmp(name, "Keyframe") == 0) {
_keyframe = Value->GetBool();
return S_OK;
}
@@ -670,7 +670,7 @@ HRESULT CBFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// KillSounds
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "KillSounds") == 0) {
+ else if (strcmp(name, "KillSounds") == 0) {
_killSound = Value->GetBool();
return S_OK;
}
@@ -678,7 +678,7 @@ HRESULT CBFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MoveX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MoveX") == 0) {
+ else if (strcmp(name, "MoveX") == 0) {
_moveX = Value->GetInt();
return S_OK;
}
@@ -686,15 +686,15 @@ HRESULT CBFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MoveY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MoveY") == 0) {
+ else if (strcmp(name, "MoveY") == 0) {
_moveY = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
else {
- if (_subframes.GetSize() == 1) return _subframes[0]->scSetProperty(Name, Value);
- else return CBScriptable::scSetProperty(Name, Value);
+ if (_subframes.GetSize() == 1) return _subframes[0]->scSetProperty(name, Value);
+ else return CBScriptable::scSetProperty(name, Value);
}
}
diff --git a/engines/wintermute/Base/BFrame.h b/engines/wintermute/Base/BFrame.h index df33303d6d..3c0efae6db 100644 --- a/engines/wintermute/Base/BFrame.h +++ b/engines/wintermute/Base/BFrame.h @@ -61,9 +61,9 @@ public: CBArray<const char *, const char *> _applyEvent;
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index 1321d31c67..30d67a8fe9 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -978,22 +978,22 @@ HRESULT CBGame::loadBuffer(byte *Buffer, bool Complete) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// LOG
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "LOG") == 0) {
- Stack->CorrectParams(1);
- LOG(0, Stack->Pop()->GetString());
- Stack->PushNULL();
+ if (strcmp(name, "LOG") == 0) {
+ stack->CorrectParams(1);
+ LOG(0, stack->Pop()->GetString());
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Caption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Caption") == 0) {
- HRESULT res = CBObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else if (strcmp(name, "Caption") == 0) {
+ HRESULT res = CBObject::scCallMethod(script, stack, thisStack, name);
SetWindowTitle();
return res;
}
@@ -1001,23 +1001,23 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// Msg
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Msg") == 0) {
- Stack->CorrectParams(1);
- QuickMessage(Stack->Pop()->GetString());
- Stack->PushNULL();
+ else if (strcmp(name, "Msg") == 0) {
+ stack->CorrectParams(1);
+ QuickMessage(stack->Pop()->GetString());
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// RunScript
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RunScript") == 0) {
+ else if (strcmp(name, "RunScript") == 0) {
Game->LOG(0, "**Warning** The 'RunScript' method is now obsolete. Use 'AttachScript' instead (same syntax)");
- Stack->CorrectParams(1);
- if (FAILED(addScript(Stack->Pop()->GetString())))
- Stack->PushBool(false);
+ stack->CorrectParams(1);
+ if (FAILED(addScript(stack->Pop()->GetString())))
+ stack->PushBool(false);
else
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -1025,19 +1025,19 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// LoadStringTable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadStringTable") == 0) {
- Stack->CorrectParams(2);
- const char *Filename = Stack->Pop()->GetString();
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "LoadStringTable") == 0) {
+ stack->CorrectParams(2);
+ const char *Filename = stack->Pop()->GetString();
+ CScValue *Val = stack->Pop();
bool ClearOld;
if (Val->IsNULL()) ClearOld = true;
else ClearOld = Val->GetBool();
if (FAILED(_stringTable->loadFile(Filename, ClearOld)))
- Stack->PushBool(false);
+ stack->PushBool(false);
else
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -1045,11 +1045,11 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// ValidObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ValidObject") == 0) {
- Stack->CorrectParams(1);
- CBScriptable *obj = Stack->Pop()->GetNative();
- if (ValidObject((CBObject *) obj)) Stack->PushBool(true);
- else Stack->PushBool(false);
+ else if (strcmp(name, "ValidObject") == 0) {
+ stack->CorrectParams(1);
+ CBScriptable *obj = stack->Pop()->GetNative();
+ if (ValidObject((CBObject *) obj)) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -1057,10 +1057,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// Reset
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Reset") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Reset") == 0) {
+ stack->CorrectParams(0);
ResetContent();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -1069,31 +1069,31 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// UnloadObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "UnloadObject") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ else if (strcmp(name, "UnloadObject") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
CBObject *obj = (CBObject *)val->GetNative();
UnregisterObject(obj);
if (val->GetType() == VAL_VARIABLE_REF) val->SetNULL();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// LoadWindow
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadWindow") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "LoadWindow") == 0) {
+ stack->CorrectParams(1);
CUIWindow *win = new CUIWindow(Game);
- if (win && SUCCEEDED(win->loadFile(Stack->Pop()->GetString()))) {
+ if (win && SUCCEEDED(win->loadFile(stack->Pop()->GetString()))) {
_windows.Add(win);
RegisterObject(win);
- Stack->PushNative(win, true);
+ stack->PushNative(win, true);
} else {
delete win;
win = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
}
return S_OK;
}
@@ -1101,13 +1101,13 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// ExpandString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ExpandString") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ else if (strcmp(name, "ExpandString") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
char *str = new char[strlen(val->GetString()) + 1];
strcpy(str, val->GetString());
_stringTable->Expand(&str);
- Stack->PushString(str);
+ stack->PushString(str);
delete [] str;
return S_OK;
}
@@ -1115,91 +1115,91 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// PlayMusic / PlayMusicChannel
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PlayMusic") == 0 || strcmp(Name, "PlayMusicChannel") == 0) {
+ else if (strcmp(name, "PlayMusic") == 0 || strcmp(name, "PlayMusicChannel") == 0) {
int Channel = 0;
- if (strcmp(Name, "PlayMusic") == 0) Stack->CorrectParams(3);
+ if (strcmp(name, "PlayMusic") == 0) stack->CorrectParams(3);
else {
- Stack->CorrectParams(4);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(4);
+ Channel = stack->Pop()->GetInt();
}
- const char *Filename = Stack->Pop()->GetString();
- CScValue *ValLooping = Stack->Pop();
+ const char *Filename = stack->Pop()->GetString();
+ CScValue *ValLooping = stack->Pop();
bool Looping = ValLooping->IsNULL() ? true : ValLooping->GetBool();
- CScValue *ValLoopStart = Stack->Pop();
+ CScValue *ValLoopStart = stack->Pop();
uint32 LoopStart = (uint32)(ValLoopStart->IsNULL() ? 0 : ValLoopStart->GetInt());
- if (FAILED(PlayMusic(Channel, Filename, Looping, LoopStart))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(PlayMusic(Channel, Filename, Looping, LoopStart))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// StopMusic / StopMusicChannel
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StopMusic") == 0 || strcmp(Name, "StopMusicChannel") == 0) {
+ else if (strcmp(name, "StopMusic") == 0 || strcmp(name, "StopMusicChannel") == 0) {
int Channel = 0;
- if (strcmp(Name, "StopMusic") == 0) Stack->CorrectParams(0);
+ if (strcmp(name, "StopMusic") == 0) stack->CorrectParams(0);
else {
- Stack->CorrectParams(1);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(1);
+ Channel = stack->Pop()->GetInt();
}
- if (FAILED(StopMusic(Channel))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(StopMusic(Channel))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// PauseMusic / PauseMusicChannel
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PauseMusic") == 0 || strcmp(Name, "PauseMusicChannel") == 0) {
+ else if (strcmp(name, "PauseMusic") == 0 || strcmp(name, "PauseMusicChannel") == 0) {
int Channel = 0;
- if (strcmp(Name, "PauseMusic") == 0) Stack->CorrectParams(0);
+ if (strcmp(name, "PauseMusic") == 0) stack->CorrectParams(0);
else {
- Stack->CorrectParams(1);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(1);
+ Channel = stack->Pop()->GetInt();
}
- if (FAILED(PauseMusic(Channel))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(PauseMusic(Channel))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ResumeMusic / ResumeMusicChannel
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ResumeMusic") == 0 || strcmp(Name, "ResumeMusicChannel") == 0) {
+ else if (strcmp(name, "ResumeMusic") == 0 || strcmp(name, "ResumeMusicChannel") == 0) {
int Channel = 0;
- if (strcmp(Name, "ResumeMusic") == 0) Stack->CorrectParams(0);
+ if (strcmp(name, "ResumeMusic") == 0) stack->CorrectParams(0);
else {
- Stack->CorrectParams(1);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(1);
+ Channel = stack->Pop()->GetInt();
}
- if (FAILED(ResumeMusic(Channel))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(ResumeMusic(Channel))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetMusic / GetMusicChannel
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetMusic") == 0 || strcmp(Name, "GetMusicChannel") == 0) {
+ else if (strcmp(name, "GetMusic") == 0 || strcmp(name, "GetMusicChannel") == 0) {
int Channel = 0;
- if (strcmp(Name, "GetMusic") == 0) Stack->CorrectParams(0);
+ if (strcmp(name, "GetMusic") == 0) stack->CorrectParams(0);
else {
- Stack->CorrectParams(1);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(1);
+ Channel = stack->Pop()->GetInt();
}
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS) Stack->PushNULL();
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS) stack->PushNULL();
else {
- if (!_music[Channel] || !_music[Channel]->_soundFilename) Stack->PushNULL();
- else Stack->PushString(_music[Channel]->_soundFilename);
+ if (!_music[Channel] || !_music[Channel]->_soundFilename) stack->PushNULL();
+ else stack->PushString(_music[Channel]->_soundFilename);
}
return S_OK;
}
@@ -1207,18 +1207,18 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// SetMusicPosition / SetMusicChannelPosition
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetMusicPosition") == 0 || strcmp(Name, "SetMusicChannelPosition") == 0 || strcmp(Name, "SetMusicPositionChannel") == 0) {
+ else if (strcmp(name, "SetMusicPosition") == 0 || strcmp(name, "SetMusicChannelPosition") == 0 || strcmp(name, "SetMusicPositionChannel") == 0) {
int Channel = 0;
- if (strcmp(Name, "SetMusicPosition") == 0) Stack->CorrectParams(1);
+ if (strcmp(name, "SetMusicPosition") == 0) stack->CorrectParams(1);
else {
- Stack->CorrectParams(2);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(2);
+ Channel = stack->Pop()->GetInt();
}
- uint32 Time = Stack->Pop()->GetInt();
+ uint32 Time = stack->Pop()->GetInt();
- if (FAILED(SetMusicStartTime(Channel, Time))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(SetMusicStartTime(Channel, Time))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
@@ -1226,51 +1226,51 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// GetMusicPosition / GetMusicChannelPosition
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetMusicPosition") == 0 || strcmp(Name, "GetMusicChannelPosition") == 0) {
+ else if (strcmp(name, "GetMusicPosition") == 0 || strcmp(name, "GetMusicChannelPosition") == 0) {
int Channel = 0;
- if (strcmp(Name, "GetMusicPosition") == 0) Stack->CorrectParams(0);
+ if (strcmp(name, "GetMusicPosition") == 0) stack->CorrectParams(0);
else {
- Stack->CorrectParams(1);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(1);
+ Channel = stack->Pop()->GetInt();
}
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) Stack->PushInt(0);
- else Stack->PushInt(_music[Channel]->getPositionTime());
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) stack->PushInt(0);
+ else stack->PushInt(_music[Channel]->getPositionTime());
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// IsMusicPlaying / IsMusicChannelPlaying
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsMusicPlaying") == 0 || strcmp(Name, "IsMusicChannelPlaying") == 0) {
+ else if (strcmp(name, "IsMusicPlaying") == 0 || strcmp(name, "IsMusicChannelPlaying") == 0) {
int Channel = 0;
- if (strcmp(Name, "IsMusicPlaying") == 0) Stack->CorrectParams(0);
+ if (strcmp(name, "IsMusicPlaying") == 0) stack->CorrectParams(0);
else {
- Stack->CorrectParams(1);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(1);
+ Channel = stack->Pop()->GetInt();
}
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) Stack->PushBool(false);
- else Stack->PushBool(_music[Channel]->isPlaying());
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) stack->PushBool(false);
+ else stack->PushBool(_music[Channel]->isPlaying());
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetMusicVolume / SetMusicChannelVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetMusicVolume") == 0 || strcmp(Name, "SetMusicChannelVolume") == 0) {
+ else if (strcmp(name, "SetMusicVolume") == 0 || strcmp(name, "SetMusicChannelVolume") == 0) {
int Channel = 0;
- if (strcmp(Name, "SetMusicVolume") == 0) Stack->CorrectParams(1);
+ if (strcmp(name, "SetMusicVolume") == 0) stack->CorrectParams(1);
else {
- Stack->CorrectParams(2);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(2);
+ Channel = stack->Pop()->GetInt();
}
- int Volume = Stack->Pop()->GetInt();
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) Stack->PushBool(false);
+ int Volume = stack->Pop()->GetInt();
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) stack->PushBool(false);
else {
- if (FAILED(_music[Channel]->setVolume(Volume))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(_music[Channel]->setVolume(Volume))) stack->PushBool(false);
+ else stack->PushBool(true);
}
return S_OK;
}
@@ -1278,16 +1278,16 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// GetMusicVolume / GetMusicChannelVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetMusicVolume") == 0 || strcmp(Name, "GetMusicChannelVolume") == 0) {
+ else if (strcmp(name, "GetMusicVolume") == 0 || strcmp(name, "GetMusicChannelVolume") == 0) {
int Channel = 0;
- if (strcmp(Name, "GetMusicVolume") == 0) Stack->CorrectParams(0);
+ if (strcmp(name, "GetMusicVolume") == 0) stack->CorrectParams(0);
else {
- Stack->CorrectParams(1);
- Channel = Stack->Pop()->GetInt();
+ stack->CorrectParams(1);
+ Channel = stack->Pop()->GetInt();
}
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) Stack->PushInt(0);
- else Stack->PushInt(_music[Channel]->getVolume());
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) stack->PushInt(0);
+ else stack->PushInt(_music[Channel]->getVolume());
return S_OK;
}
@@ -1295,16 +1295,16 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// MusicCrossfade
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MusicCrossfade") == 0) {
- Stack->CorrectParams(4);
- int Channel1 = Stack->Pop()->GetInt(0);
- int Channel2 = Stack->Pop()->GetInt(0);
- uint32 FadeLength = (uint32)Stack->Pop()->GetInt(0);
- bool Swap = Stack->Pop()->GetBool(true);
+ else if (strcmp(name, "MusicCrossfade") == 0) {
+ stack->CorrectParams(4);
+ int Channel1 = stack->Pop()->GetInt(0);
+ int Channel2 = stack->Pop()->GetInt(0);
+ uint32 FadeLength = (uint32)stack->Pop()->GetInt(0);
+ bool Swap = stack->Pop()->GetBool(true);
if (_musicCrossfadeRunning) {
- Script->RuntimeError("Game.MusicCrossfade: Music crossfade is already in progress.");
- Stack->PushBool(false);
+ script->RuntimeError("Game.MusicCrossfade: Music crossfade is already in progress.");
+ stack->PushBool(false);
return S_OK;
}
@@ -1316,18 +1316,18 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS _musicCrossfadeRunning = true;
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetSoundLength
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetSoundLength") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "GetSoundLength") == 0) {
+ stack->CorrectParams(1);
int Length = 0;
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
CBSound *Sound = new CBSound(Game);
if (Sound && SUCCEEDED(Sound->setSound(Filename, SOUND_MUSIC, true))) {
@@ -1335,17 +1335,17 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS delete Sound;
Sound = NULL;
}
- Stack->PushInt(Length);
+ stack->PushInt(Length);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetMousePos
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetMousePos") == 0) {
- Stack->CorrectParams(2);
- int x = Stack->Pop()->GetInt();
- int y = Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetMousePos") == 0) {
+ stack->CorrectParams(2);
+ int x = stack->Pop()->GetInt();
+ int y = stack->Pop()->GetInt();
x = MAX(x, 0);
x = MIN(x, _renderer->_width);
y = MAX(y, 0);
@@ -1356,35 +1356,35 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS CBPlatform::SetCursorPos(p.x, p.y);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// LockMouseRect
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LockMouseRect") == 0) {
- Stack->CorrectParams(4);
- int left = Stack->Pop()->GetInt();
- int top = Stack->Pop()->GetInt();
- int right = Stack->Pop()->GetInt();
- int bottom = Stack->Pop()->GetInt();
+ else if (strcmp(name, "LockMouseRect") == 0) {
+ stack->CorrectParams(4);
+ int left = stack->Pop()->GetInt();
+ int top = stack->Pop()->GetInt();
+ int right = stack->Pop()->GetInt();
+ int bottom = stack->Pop()->GetInt();
if (right < left) CBUtils::Swap(&left, &right);
if (bottom < top) CBUtils::Swap(&top, &bottom);
CBPlatform::SetRect(&_mouseLockRect, left, top, right, bottom);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// PlayVideo
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PlayVideo") == 0) {
- /* Stack->CorrectParams(0);
- Stack->PushBool(false);
+ else if (strcmp(name, "PlayVideo") == 0) {
+ /* stack->CorrectParams(0);
+ stack->PushBool(false);
return S_OK;
// TODO: ADDVIDEO
@@ -1392,19 +1392,19 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS Game->LOG(0, "Warning: Game.PlayVideo() is now deprecated. Use Game.PlayTheora() instead.");
- Stack->CorrectParams(6);
- const char *Filename = Stack->Pop()->GetString();
+ stack->CorrectParams(6);
+ const char *Filename = stack->Pop()->GetString();
warning("PlayVideo: %s - not implemented yet", Filename);
- CScValue *valType = Stack->Pop();
+ CScValue *valType = stack->Pop();
int Type;
if (valType->IsNULL()) Type = (int)VID_PLAY_STRETCH;
else Type = valType->GetInt();
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
- bool FreezeMusic = Stack->Pop()->GetBool(true);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
+ bool FreezeMusic = stack->Pop()->GetBool(true);
- CScValue *valSub = Stack->Pop();
+ CScValue *valSub = stack->Pop();
const char *SubtitleFile = valSub->IsNULL() ? NULL : valSub->GetString();
if (Type < (int)VID_PLAY_POS || Type > (int)VID_PLAY_CENTER)
@@ -1412,10 +1412,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS if (SUCCEEDED(Game->_videoPlayer->initialize(Filename, SubtitleFile))) {
if (SUCCEEDED(Game->_videoPlayer->play((TVideoPlayback)Type, X, Y, FreezeMusic))) {
- Stack->PushBool(true);
- Script->Sleep(0);
- } else Stack->PushBool(false);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ script->Sleep(0);
+ } else stack->PushBool(false);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -1423,27 +1423,27 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// PlayTheora
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PlayTheora") == 0) {
- /* Stack->CorrectParams(0);
- Stack->PushBool(false);
+ else if (strcmp(name, "PlayTheora") == 0) {
+ /* stack->CorrectParams(0);
+ stack->PushBool(false);
return S_OK;*/
// TODO: ADDVIDEO
- Stack->CorrectParams(7);
- const char *Filename = Stack->Pop()->GetString();
- CScValue *valType = Stack->Pop();
+ stack->CorrectParams(7);
+ const char *Filename = stack->Pop()->GetString();
+ CScValue *valType = stack->Pop();
int Type;
if (valType->IsNULL())
Type = (int)VID_PLAY_STRETCH;
else Type = valType->GetInt();
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
- bool FreezeMusic = Stack->Pop()->GetBool(true);
- bool DropFrames = Stack->Pop()->GetBool(true);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
+ bool FreezeMusic = stack->Pop()->GetBool(true);
+ bool DropFrames = stack->Pop()->GetBool(true);
- CScValue *valSub = Stack->Pop();
+ CScValue *valSub = stack->Pop();
const char *SubtitleFile = valSub->IsNULL() ? NULL : valSub->GetString();
if (Type < (int)VID_PLAY_POS || Type > (int)VID_PLAY_CENTER) Type = (int)VID_PLAY_STRETCH;
@@ -1453,11 +1453,11 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS if (_theoraPlayer && SUCCEEDED(_theoraPlayer->initialize(Filename, SubtitleFile))) {
_theoraPlayer->_dontDropFrames = !DropFrames;
if (SUCCEEDED(_theoraPlayer->play((TVideoPlayback)Type, X, Y, true, FreezeMusic))) {
- Stack->PushBool(true);
- Script->Sleep(0);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ script->Sleep(0);
+ } else stack->PushBool(false);
} else {
- Stack->PushBool(false);
+ stack->PushBool(false);
delete _theoraPlayer;
_theoraPlayer = NULL;
}
@@ -1468,9 +1468,9 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// QuitGame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "QuitGame") == 0) {
- Stack->CorrectParams(0);
- Stack->PushNULL();
+ else if (strcmp(name, "QuitGame") == 0) {
+ stack->CorrectParams(0);
+ stack->PushNULL();
_quitting = true;
return S_OK;
}
@@ -1478,65 +1478,65 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// RegWriteNumber
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RegWriteNumber") == 0) {
- Stack->CorrectParams(2);
- const char *Key = Stack->Pop()->GetString();
- int Val = Stack->Pop()->GetInt();
+ else if (strcmp(name, "RegWriteNumber") == 0) {
+ stack->CorrectParams(2);
+ const char *Key = stack->Pop()->GetString();
+ int Val = stack->Pop()->GetInt();
_registry->WriteInt("PrivateSettings", Key, Val);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// RegReadNumber
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RegReadNumber") == 0) {
- Stack->CorrectParams(2);
- const char *Key = Stack->Pop()->GetString();
- int InitVal = Stack->Pop()->GetInt();
- Stack->PushInt(_registry->ReadInt("PrivateSettings", Key, InitVal));
+ else if (strcmp(name, "RegReadNumber") == 0) {
+ stack->CorrectParams(2);
+ const char *Key = stack->Pop()->GetString();
+ int InitVal = stack->Pop()->GetInt();
+ stack->PushInt(_registry->ReadInt("PrivateSettings", Key, InitVal));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// RegWriteString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RegWriteString") == 0) {
- Stack->CorrectParams(2);
- const char *Key = Stack->Pop()->GetString();
- const char *Val = Stack->Pop()->GetString();
+ else if (strcmp(name, "RegWriteString") == 0) {
+ stack->CorrectParams(2);
+ const char *Key = stack->Pop()->GetString();
+ const char *Val = stack->Pop()->GetString();
_registry->WriteString("PrivateSettings", Key, Val);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// RegReadString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RegReadString") == 0) {
- Stack->CorrectParams(2);
- const char *Key = Stack->Pop()->GetString();
- const char *InitVal = Stack->Pop()->GetString();
+ else if (strcmp(name, "RegReadString") == 0) {
+ stack->CorrectParams(2);
+ const char *Key = stack->Pop()->GetString();
+ const char *InitVal = stack->Pop()->GetString();
AnsiString val = _registry->ReadString("PrivateSettings", Key, InitVal);
- Stack->PushString(val.c_str());
+ stack->PushString(val.c_str());
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SaveGame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SaveGame") == 0) {
- Stack->CorrectParams(3);
- int Slot = Stack->Pop()->GetInt();
- const char *xdesc = Stack->Pop()->GetString();
- bool quick = Stack->Pop()->GetBool(false);
+ else if (strcmp(name, "SaveGame") == 0) {
+ stack->CorrectParams(3);
+ int Slot = stack->Pop()->GetInt();
+ const char *xdesc = stack->Pop()->GetString();
+ bool quick = stack->Pop()->GetBool(false);
char *Desc = new char[strlen(xdesc) + 1];
strcpy(Desc, xdesc);
- Stack->PushBool(true);
+ stack->PushBool(true);
if (FAILED(SaveGame(Slot, Desc, quick))) {
- Stack->Pop();
- Stack->PushBool(false);
+ stack->Pop();
+ stack->PushBool(false);
}
delete [] Desc;
return S_OK;
@@ -1545,132 +1545,132 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// LoadGame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadGame") == 0) {
- Stack->CorrectParams(1);
- _scheduledLoadSlot = Stack->Pop()->GetInt();
+ else if (strcmp(name, "LoadGame") == 0) {
+ stack->CorrectParams(1);
+ _scheduledLoadSlot = stack->Pop()->GetInt();
_loading = true;
- Stack->PushBool(false);
- Script->Sleep(0);
+ stack->PushBool(false);
+ script->Sleep(0);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// IsSaveSlotUsed
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsSaveSlotUsed") == 0) {
- Stack->CorrectParams(1);
- int Slot = Stack->Pop()->GetInt();
- Stack->PushBool(IsSaveSlotUsed(Slot));
+ else if (strcmp(name, "IsSaveSlotUsed") == 0) {
+ stack->CorrectParams(1);
+ int Slot = stack->Pop()->GetInt();
+ stack->PushBool(IsSaveSlotUsed(Slot));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetSaveSlotDescription
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetSaveSlotDescription") == 0) {
- Stack->CorrectParams(1);
- int Slot = Stack->Pop()->GetInt();
+ else if (strcmp(name, "GetSaveSlotDescription") == 0) {
+ stack->CorrectParams(1);
+ int Slot = stack->Pop()->GetInt();
char Desc[512];
Desc[0] = '\0';
GetSaveSlotDescription(Slot, Desc);
- Stack->PushString(Desc);
+ stack->PushString(Desc);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// EmptySaveSlot
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "EmptySaveSlot") == 0) {
- Stack->CorrectParams(1);
- int Slot = Stack->Pop()->GetInt();
+ else if (strcmp(name, "EmptySaveSlot") == 0) {
+ stack->CorrectParams(1);
+ int Slot = stack->Pop()->GetInt();
EmptySaveSlot(Slot);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetGlobalSFXVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetGlobalSFXVolume") == 0) {
- Stack->CorrectParams(1);
- Game->_soundMgr->setVolumePercent(SOUND_SFX, (byte)Stack->Pop()->GetInt());
- Stack->PushNULL();
+ else if (strcmp(name, "SetGlobalSFXVolume") == 0) {
+ stack->CorrectParams(1);
+ Game->_soundMgr->setVolumePercent(SOUND_SFX, (byte)stack->Pop()->GetInt());
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetGlobalSpeechVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetGlobalSpeechVolume") == 0) {
- Stack->CorrectParams(1);
- Game->_soundMgr->setVolumePercent(SOUND_SPEECH, (byte)Stack->Pop()->GetInt());
- Stack->PushNULL();
+ else if (strcmp(name, "SetGlobalSpeechVolume") == 0) {
+ stack->CorrectParams(1);
+ Game->_soundMgr->setVolumePercent(SOUND_SPEECH, (byte)stack->Pop()->GetInt());
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetGlobalMusicVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetGlobalMusicVolume") == 0) {
- Stack->CorrectParams(1);
- Game->_soundMgr->setVolumePercent(SOUND_MUSIC, (byte)Stack->Pop()->GetInt());
- Stack->PushNULL();
+ else if (strcmp(name, "SetGlobalMusicVolume") == 0) {
+ stack->CorrectParams(1);
+ Game->_soundMgr->setVolumePercent(SOUND_MUSIC, (byte)stack->Pop()->GetInt());
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetGlobalMasterVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetGlobalMasterVolume") == 0) {
- Stack->CorrectParams(1);
- Game->_soundMgr->setMasterVolumePercent((byte)Stack->Pop()->GetInt());
- Stack->PushNULL();
+ else if (strcmp(name, "SetGlobalMasterVolume") == 0) {
+ stack->CorrectParams(1);
+ Game->_soundMgr->setMasterVolumePercent((byte)stack->Pop()->GetInt());
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetGlobalSFXVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetGlobalSFXVolume") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_soundMgr->getVolumePercent(SOUND_SFX));
+ else if (strcmp(name, "GetGlobalSFXVolume") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_soundMgr->getVolumePercent(SOUND_SFX));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetGlobalSpeechVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetGlobalSpeechVolume") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_soundMgr->getVolumePercent(SOUND_SPEECH));
+ else if (strcmp(name, "GetGlobalSpeechVolume") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_soundMgr->getVolumePercent(SOUND_SPEECH));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetGlobalMusicVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetGlobalMusicVolume") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_soundMgr->getVolumePercent(SOUND_MUSIC));
+ else if (strcmp(name, "GetGlobalMusicVolume") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_soundMgr->getVolumePercent(SOUND_MUSIC));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetGlobalMasterVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetGlobalMasterVolume") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_soundMgr->getMasterVolumePercent());
+ else if (strcmp(name, "GetGlobalMasterVolume") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_soundMgr->getMasterVolumePercent());
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetActiveCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetActiveCursor") == 0) {
- Stack->CorrectParams(1);
- if (SUCCEEDED(setActiveCursor(Stack->Pop()->GetString()))) Stack->PushBool(true);
- else Stack->PushBool(false);
+ else if (strcmp(name, "SetActiveCursor") == 0) {
+ stack->CorrectParams(1);
+ if (SUCCEEDED(setActiveCursor(stack->Pop()->GetString()))) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -1678,10 +1678,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// GetActiveCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetActiveCursor") == 0) {
- Stack->CorrectParams(0);
- if (!_activeCursor || !_activeCursor->_filename) Stack->PushNULL();
- else Stack->PushString(_activeCursor->_filename);
+ else if (strcmp(name, "GetActiveCursor") == 0) {
+ stack->CorrectParams(0);
+ if (!_activeCursor || !_activeCursor->_filename) stack->PushNULL();
+ else stack->PushString(_activeCursor->_filename);
return S_OK;
}
@@ -1689,10 +1689,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// GetActiveCursorObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetActiveCursorObject") == 0) {
- Stack->CorrectParams(0);
- if (!_activeCursor) Stack->PushNULL();
- else Stack->PushNative(_activeCursor, true);
+ else if (strcmp(name, "GetActiveCursorObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_activeCursor) stack->PushNULL();
+ else stack->PushNative(_activeCursor, true);
return S_OK;
}
@@ -1700,11 +1700,11 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// RemoveActiveCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RemoveActiveCursor") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "RemoveActiveCursor") == 0) {
+ stack->CorrectParams(0);
delete _activeCursor;
_activeCursor = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -1712,11 +1712,11 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// HasActiveCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HasActiveCursor") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "HasActiveCursor") == 0) {
+ stack->CorrectParams(0);
- if (_activeCursor) Stack->PushBool(true);
- else Stack->PushBool(false);
+ if (_activeCursor) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -1724,15 +1724,15 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// FileExists
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FileExists") == 0) {
- Stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ else if (strcmp(name, "FileExists") == 0) {
+ stack->CorrectParams(1);
+ const char *Filename = stack->Pop()->GetString();
Common::SeekableReadStream *File = _fileManager->openFile(Filename, false);
- if (!File) Stack->PushBool(false);
+ if (!File) stack->PushBool(false);
else {
_fileManager->closeFile(File);
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -1740,60 +1740,60 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// FadeOut / FadeOutAsync / SystemFadeOut / SystemFadeOutAsync
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeOut") == 0 || strcmp(Name, "FadeOutAsync") == 0 || strcmp(Name, "SystemFadeOut") == 0 || strcmp(Name, "SystemFadeOutAsync") == 0) {
- Stack->CorrectParams(5);
- uint32 Duration = Stack->Pop()->GetInt(500);
- byte Red = Stack->Pop()->GetInt(0);
- byte Green = Stack->Pop()->GetInt(0);
- byte Blue = Stack->Pop()->GetInt(0);
- byte Alpha = Stack->Pop()->GetInt(0xFF);
+ else if (strcmp(name, "FadeOut") == 0 || strcmp(name, "FadeOutAsync") == 0 || strcmp(name, "SystemFadeOut") == 0 || strcmp(name, "SystemFadeOutAsync") == 0) {
+ stack->CorrectParams(5);
+ uint32 Duration = stack->Pop()->GetInt(500);
+ byte Red = stack->Pop()->GetInt(0);
+ byte Green = stack->Pop()->GetInt(0);
+ byte Blue = stack->Pop()->GetInt(0);
+ byte Alpha = stack->Pop()->GetInt(0xFF);
- bool System = (strcmp(Name, "SystemFadeOut") == 0 || strcmp(Name, "SystemFadeOutAsync") == 0);
+ bool System = (strcmp(name, "SystemFadeOut") == 0 || strcmp(name, "SystemFadeOutAsync") == 0);
_fader->fadeOut(DRGBA(Red, Green, Blue, Alpha), Duration, System);
- if (strcmp(Name, "FadeOutAsync") != 0 && strcmp(Name, "SystemFadeOutAsync") != 0) Script->WaitFor(_fader);
+ if (strcmp(name, "FadeOutAsync") != 0 && strcmp(name, "SystemFadeOutAsync") != 0) script->WaitFor(_fader);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// FadeIn / FadeInAsync / SystemFadeIn / SystemFadeInAsync
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeIn") == 0 || strcmp(Name, "FadeInAsync") == 0 || strcmp(Name, "SystemFadeIn") == 0 || strcmp(Name, "SystemFadeInAsync") == 0) {
- Stack->CorrectParams(5);
- uint32 Duration = Stack->Pop()->GetInt(500);
- byte Red = Stack->Pop()->GetInt(0);
- byte Green = Stack->Pop()->GetInt(0);
- byte Blue = Stack->Pop()->GetInt(0);
- byte Alpha = Stack->Pop()->GetInt(0xFF);
+ else if (strcmp(name, "FadeIn") == 0 || strcmp(name, "FadeInAsync") == 0 || strcmp(name, "SystemFadeIn") == 0 || strcmp(name, "SystemFadeInAsync") == 0) {
+ stack->CorrectParams(5);
+ uint32 Duration = stack->Pop()->GetInt(500);
+ byte Red = stack->Pop()->GetInt(0);
+ byte Green = stack->Pop()->GetInt(0);
+ byte Blue = stack->Pop()->GetInt(0);
+ byte Alpha = stack->Pop()->GetInt(0xFF);
- bool System = (strcmp(Name, "SystemFadeIn") == 0 || strcmp(Name, "SystemFadeInAsync") == 0);
+ bool System = (strcmp(name, "SystemFadeIn") == 0 || strcmp(name, "SystemFadeInAsync") == 0);
_fader->fadeIn(DRGBA(Red, Green, Blue, Alpha), Duration, System);
- if (strcmp(Name, "FadeInAsync") != 0 && strcmp(Name, "SystemFadeInAsync") != 0) Script->WaitFor(_fader);
+ if (strcmp(name, "FadeInAsync") != 0 && strcmp(name, "SystemFadeInAsync") != 0) script->WaitFor(_fader);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetFadeColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetFadeColor") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_fader->getCurrentColor());
+ else if (strcmp(name, "GetFadeColor") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_fader->getCurrentColor());
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Screenshot
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Screenshot") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "Screenshot") == 0) {
+ stack->CorrectParams(1);
char Filename[MAX_PATH];
- CScValue *Val = Stack->Pop();
+ CScValue *Val = stack->Pop();
warning("BGame::ScCallMethod - Screenshot not reimplemented"); //TODO
int FileNum = 0;
@@ -1812,18 +1812,18 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS delete Image;
} else ret = false;
- Stack->PushBool(ret);
+ stack->PushBool(ret);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ScreenshotEx
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScreenshotEx") == 0) {
- Stack->CorrectParams(3);
- const char *Filename = Stack->Pop()->GetString();
- int SizeX = Stack->Pop()->GetInt(_renderer->_width);
- int SizeY = Stack->Pop()->GetInt(_renderer->_height);
+ else if (strcmp(name, "ScreenshotEx") == 0) {
+ stack->CorrectParams(3);
+ const char *Filename = stack->Pop()->GetString();
+ int SizeX = stack->Pop()->GetInt(_renderer->_width);
+ int SizeY = stack->Pop()->GetInt(_renderer->_height);
bool ret = false;
CBImage *Image = Game->_renderer->takeScreenshot();
@@ -1833,69 +1833,69 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS delete Image;
} else ret = false;
- Stack->PushBool(ret);
+ stack->PushBool(ret);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// CreateWindow
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateWindow") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "CreateWindow") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CUIWindow *Win = new CUIWindow(Game);
_windows.Add(Win);
RegisterObject(Win);
if (!Val->IsNULL()) Win->setName(Val->GetString());
- Stack->PushNative(Win, true);
+ stack->PushNative(Win, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DeleteWindow
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteWindow") == 0) {
- Stack->CorrectParams(1);
- CBObject *Obj = (CBObject *)Stack->Pop()->GetNative();
+ else if (strcmp(name, "DeleteWindow") == 0) {
+ stack->CorrectParams(1);
+ CBObject *Obj = (CBObject *)stack->Pop()->GetNative();
for (int i = 0; i < _windows.GetSize(); i++) {
if (_windows[i] == Obj) {
UnregisterObject(_windows[i]);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
}
- Stack->PushBool(false);
+ stack->PushBool(false);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// OpenDocument
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "OpenDocument") == 0) {
- Stack->CorrectParams(0);
- Stack->PushNULL();
+ else if (strcmp(name, "OpenDocument") == 0) {
+ stack->CorrectParams(0);
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DEBUG_DumpClassRegistry
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DEBUG_DumpClassRegistry") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "DEBUG_DumpClassRegistry") == 0) {
+ stack->CorrectParams(0);
DEBUG_DumpClassRegistry();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetLoadingScreen
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetLoadingScreen") == 0) {
- Stack->CorrectParams(3);
- CScValue *Val = Stack->Pop();
- _loadImageX = Stack->Pop()->GetInt();
- _loadImageY = Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetLoadingScreen") == 0) {
+ stack->CorrectParams(3);
+ CScValue *Val = stack->Pop();
+ _loadImageX = stack->Pop()->GetInt();
+ _loadImageY = stack->Pop()->GetInt();
if (Val->IsNULL()) {
delete[] _loadImageName;
@@ -1903,18 +1903,18 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS } else {
CBUtils::SetString(&_loadImageName, Val->GetString());
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetSavingScreen
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetSavingScreen") == 0) {
- Stack->CorrectParams(3);
- CScValue *Val = Stack->Pop();
- _saveImageX = Stack->Pop()->GetInt();
- _saveImageY = Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetSavingScreen") == 0) {
+ stack->CorrectParams(3);
+ CScValue *Val = stack->Pop();
+ _saveImageX = stack->Pop()->GetInt();
+ _saveImageY = stack->Pop()->GetInt();
if (Val->IsNULL()) {
delete[] _saveImageName;
@@ -1922,17 +1922,17 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS } else {
CBUtils::SetString(&_saveImageName, Val->GetString());
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetWaitCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetWaitCursor") == 0) {
- Stack->CorrectParams(1);
- if (SUCCEEDED(SetWaitCursor(Stack->Pop()->GetString()))) Stack->PushBool(true);
- else Stack->PushBool(false);
+ else if (strcmp(name, "SetWaitCursor") == 0) {
+ stack->CorrectParams(1);
+ if (SUCCEEDED(SetWaitCursor(stack->Pop()->GetString()))) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -1940,12 +1940,12 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// RemoveWaitCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RemoveWaitCursor") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "RemoveWaitCursor") == 0) {
+ stack->CorrectParams(0);
delete _cursorNoninteractive;
_cursorNoninteractive = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -1953,10 +1953,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// GetWaitCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetWaitCursor") == 0) {
- Stack->CorrectParams(0);
- if (!_cursorNoninteractive || !_cursorNoninteractive->_filename) Stack->PushNULL();
- else Stack->PushString(_cursorNoninteractive->_filename);
+ else if (strcmp(name, "GetWaitCursor") == 0) {
+ stack->CorrectParams(0);
+ if (!_cursorNoninteractive || !_cursorNoninteractive->_filename) stack->PushNULL();
+ else stack->PushString(_cursorNoninteractive->_filename);
return S_OK;
}
@@ -1964,10 +1964,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// GetWaitCursorObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetWaitCursorObject") == 0) {
- Stack->CorrectParams(0);
- if (!_cursorNoninteractive) Stack->PushNULL();
- else Stack->PushNative(_cursorNoninteractive, true);
+ else if (strcmp(name, "GetWaitCursorObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_cursorNoninteractive) stack->PushNULL();
+ else stack->PushNative(_cursorNoninteractive, true);
return S_OK;
}
@@ -1975,22 +1975,22 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// ClearScriptCache
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ClearScriptCache") == 0) {
- Stack->CorrectParams(0);
- Stack->PushBool(SUCCEEDED(_scEngine->EmptyScriptCache()));
+ else if (strcmp(name, "ClearScriptCache") == 0) {
+ stack->CorrectParams(0);
+ stack->PushBool(SUCCEEDED(_scEngine->EmptyScriptCache()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DisplayLoadingIcon
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DisplayLoadingIcon") == 0) {
- Stack->CorrectParams(4);
+ else if (strcmp(name, "DisplayLoadingIcon") == 0) {
+ stack->CorrectParams(4);
- const char *Filename = Stack->Pop()->GetString();
- _loadingIconX = Stack->Pop()->GetInt();
- _loadingIconY = Stack->Pop()->GetInt();
- _loadingIconPersistent = Stack->Pop()->GetBool();
+ const char *Filename = stack->Pop()->GetString();
+ _loadingIconX = stack->Pop()->GetInt();
+ _loadingIconY = stack->Pop()->GetInt();
+ _loadingIconPersistent = stack->Pop()->GetBool();
delete _loadingIcon;
_loadingIcon = new CBSprite(this);
@@ -2002,7 +2002,7 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS Game->_renderer->flip();
Game->_renderer->initLoop();
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -2010,38 +2010,38 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// HideLoadingIcon
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HideLoadingIcon") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "HideLoadingIcon") == 0) {
+ stack->CorrectParams(0);
delete _loadingIcon;
_loadingIcon = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DumpTextureStats
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DumpTextureStats") == 0) {
- Stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ else if (strcmp(name, "DumpTextureStats") == 0) {
+ stack->CorrectParams(1);
+ const char *Filename = stack->Pop()->GetString();
_renderer->dumpData(Filename);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// AccOutputText
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccOutputText") == 0) {
- Stack->CorrectParams(2);
+ else if (strcmp(name, "AccOutputText") == 0) {
+ stack->CorrectParams(2);
/* const char *Str = */
- Stack->Pop()->GetString();
+ stack->Pop()->GetString();
/* int Type = */
- Stack->Pop()->GetInt();
+ stack->Pop()->GetInt();
// do nothing
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -2049,15 +2049,15 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// StoreSaveThumbnail
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StoreSaveThumbnail") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "StoreSaveThumbnail") == 0) {
+ stack->CorrectParams(0);
delete _cachedThumbnail;
_cachedThumbnail = new CBSaveThumbHelper(this);
if (FAILED(_cachedThumbnail->StoreThumbnail())) {
delete _cachedThumbnail;
_cachedThumbnail = NULL;
- Stack->PushBool(false);
- } else Stack->PushBool(true);
+ stack->PushBool(false);
+ } else stack->PushBool(true);
return S_OK;
}
@@ -2065,11 +2065,11 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// DeleteSaveThumbnail
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteSaveThumbnail") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "DeleteSaveThumbnail") == 0) {
+ stack->CorrectParams(0);
delete _cachedThumbnail;
_cachedThumbnail = NULL;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -2077,10 +2077,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// GetFileChecksum
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetFileChecksum") == 0) {
- Stack->CorrectParams(2);
- const char *Filename = Stack->Pop()->GetString();
- bool AsHex = Stack->Pop()->GetBool(false);
+ else if (strcmp(name, "GetFileChecksum") == 0) {
+ stack->CorrectParams(2);
+ const char *Filename = stack->Pop()->GetString();
+ bool AsHex = stack->Pop()->GetBool(false);
Common::SeekableReadStream *File = _fileManager->openFile(Filename, false);
if (File) {
@@ -2101,13 +2101,13 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS if (AsHex) {
char Hex[100];
sprintf(Hex, "%x", checksum);
- Stack->PushString(Hex);
+ stack->PushString(Hex);
} else
- Stack->PushInt(checksum);
+ stack->PushInt(checksum);
_fileManager->closeFile(File);
File = NULL;
- } else Stack->PushNULL();
+ } else stack->PushNULL();
return S_OK;
}
@@ -2115,10 +2115,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// EnableScriptProfiling
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "EnableScriptProfiling") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "EnableScriptProfiling") == 0) {
+ stack->CorrectParams(0);
_scEngine->EnableProfiling();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -2126,10 +2126,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// DisableScriptProfiling
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DisableScriptProfiling") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "DisableScriptProfiling") == 0) {
+ stack->CorrectParams(0);
_scEngine->DisableProfiling();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -2137,12 +2137,12 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// ShowStatusLine
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ShowStatusLine") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ShowStatusLine") == 0) {
+ stack->CorrectParams(0);
#ifdef __IPHONEOS__
IOS_ShowStatusLine(TRUE);
#endif
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -2150,42 +2150,42 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS //////////////////////////////////////////////////////////////////////////
// HideStatusLine
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HideStatusLine") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "HideStatusLine") == 0) {
+ stack->CorrectParams(0);
#ifdef __IPHONEOS__
IOS_ShowStatusLine(FALSE);
#endif
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
- else return CBObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBGame::scGetProperty(const char *Name) {
+CScValue *CBGame::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("game");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Name") == 0) {
+ else if (strcmp(name, "Name") == 0) {
_scValue->SetString(_name);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Hwnd (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Hwnd") == 0) {
+ else if (strcmp(name, "Hwnd") == 0) {
_scValue->SetInt((int)_renderer->_window);
return _scValue;
}
@@ -2193,7 +2193,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// CurrentTime (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CurrentTime") == 0) {
+ else if (strcmp(name, "CurrentTime") == 0) {
_scValue->SetInt((int)_timer);
return _scValue;
}
@@ -2201,7 +2201,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// WindowsTime (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WindowsTime") == 0) {
+ else if (strcmp(name, "WindowsTime") == 0) {
_scValue->SetInt((int)CBPlatform::GetTime());
return _scValue;
}
@@ -2209,7 +2209,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// WindowedMode (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WindowedMode") == 0) {
+ else if (strcmp(name, "WindowedMode") == 0) {
_scValue->SetBool(_renderer->_windowed);
return _scValue;
}
@@ -2217,7 +2217,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MouseX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MouseX") == 0) {
+ else if (strcmp(name, "MouseX") == 0) {
_scValue->SetInt(_mousePos.x);
return _scValue;
}
@@ -2225,7 +2225,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MouseY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MouseY") == 0) {
+ else if (strcmp(name, "MouseY") == 0) {
_scValue->SetInt(_mousePos.y);
return _scValue;
}
@@ -2233,7 +2233,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MainObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MainObject") == 0) {
+ else if (strcmp(name, "MainObject") == 0) {
_scValue->SetNative(_mainObject, true);
return _scValue;
}
@@ -2241,7 +2241,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ActiveObject (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ActiveObject") == 0) {
+ else if (strcmp(name, "ActiveObject") == 0) {
_scValue->SetNative(_activeObject, true);
return _scValue;
}
@@ -2249,7 +2249,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ScreenWidth (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScreenWidth") == 0) {
+ else if (strcmp(name, "ScreenWidth") == 0) {
_scValue->SetInt(_renderer->_width);
return _scValue;
}
@@ -2257,7 +2257,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ScreenHeight (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScreenHeight") == 0) {
+ else if (strcmp(name, "ScreenHeight") == 0) {
_scValue->SetInt(_renderer->_height);
return _scValue;
}
@@ -2265,7 +2265,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Interactive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Interactive") == 0) {
+ else if (strcmp(name, "Interactive") == 0) {
_scValue->SetBool(_interactive);
return _scValue;
}
@@ -2273,7 +2273,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// DebugMode (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DebugMode") == 0) {
+ else if (strcmp(name, "DebugMode") == 0) {
_scValue->SetBool(_dEBUG_DebugMode);
return _scValue;
}
@@ -2281,7 +2281,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SoundAvailable (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SoundAvailable") == 0) {
+ else if (strcmp(name, "SoundAvailable") == 0) {
_scValue->SetBool(_soundMgr->_soundAvailable);
return _scValue;
}
@@ -2289,7 +2289,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SFXVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SFXVolume") == 0) {
+ else if (strcmp(name, "SFXVolume") == 0) {
Game->LOG(0, "**Warning** The SFXVolume attribute is obsolete");
_scValue->SetInt(_soundMgr->getVolumePercent(SOUND_SFX));
return _scValue;
@@ -2298,7 +2298,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SpeechVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SpeechVolume") == 0) {
+ else if (strcmp(name, "SpeechVolume") == 0) {
Game->LOG(0, "**Warning** The SpeechVolume attribute is obsolete");
_scValue->SetInt(_soundMgr->getVolumePercent(SOUND_SPEECH));
return _scValue;
@@ -2307,7 +2307,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MusicVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MusicVolume") == 0) {
+ else if (strcmp(name, "MusicVolume") == 0) {
Game->LOG(0, "**Warning** The MusicVolume attribute is obsolete");
_scValue->SetInt(_soundMgr->getVolumePercent(SOUND_MUSIC));
return _scValue;
@@ -2316,7 +2316,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MasterVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MasterVolume") == 0) {
+ else if (strcmp(name, "MasterVolume") == 0) {
Game->LOG(0, "**Warning** The MasterVolume attribute is obsolete");
_scValue->SetInt(_soundMgr->getMasterVolumePercent());
return _scValue;
@@ -2325,7 +2325,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Keyboard (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Keyboard") == 0) {
+ else if (strcmp(name, "Keyboard") == 0) {
if (_keyboardState) _scValue->SetNative(_keyboardState, true);
else _scValue->SetNULL();
@@ -2335,7 +2335,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Subtitles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Subtitles") == 0) {
+ else if (strcmp(name, "Subtitles") == 0) {
_scValue->SetBool(_subtitles);
return _scValue;
}
@@ -2343,14 +2343,14 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SubtitlesSpeed
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesSpeed") == 0) {
+ else if (strcmp(name, "SubtitlesSpeed") == 0) {
_scValue->SetInt(_subtitlesSpeed);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// VideoSubtitles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "VideoSubtitles") == 0) {
+ else if (strcmp(name, "VideoSubtitles") == 0) {
_scValue->SetBool(_videoSubtitles);
return _scValue;
}
@@ -2358,7 +2358,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// FPS (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FPS") == 0) {
+ else if (strcmp(name, "FPS") == 0) {
_scValue->SetInt(_fps);
return _scValue;
}
@@ -2366,7 +2366,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AcceleratedMode / Accelerated (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AcceleratedMode") == 0 || strcmp(Name, "Accelerated") == 0) {
+ else if (strcmp(name, "AcceleratedMode") == 0 || strcmp(name, "Accelerated") == 0) {
_scValue->SetBool(_useD3D);
return _scValue;
}
@@ -2374,7 +2374,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// TextEncoding
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TextEncoding") == 0) {
+ else if (strcmp(name, "TextEncoding") == 0) {
_scValue->SetInt(_textEncoding);
return _scValue;
}
@@ -2382,7 +2382,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// TextRTL
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TextRTL") == 0) {
+ else if (strcmp(name, "TextRTL") == 0) {
_scValue->SetBool(_textRTL);
return _scValue;
}
@@ -2390,7 +2390,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SoundBufferSize
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SoundBufferSize") == 0) {
+ else if (strcmp(name, "SoundBufferSize") == 0) {
_scValue->SetInt(_soundBufferSizeSec);
return _scValue;
}
@@ -2398,7 +2398,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SuspendedRendering
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SuspendedRendering") == 0) {
+ else if (strcmp(name, "SuspendedRendering") == 0) {
_scValue->SetBool(_suspendedRendering);
return _scValue;
}
@@ -2406,7 +2406,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SuppressScriptErrors
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SuppressScriptErrors") == 0) {
+ else if (strcmp(name, "SuppressScriptErrors") == 0) {
_scValue->SetBool(_suppressScriptErrors);
return _scValue;
}
@@ -2415,7 +2415,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Frozen
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Frozen") == 0) {
+ else if (strcmp(name, "Frozen") == 0) {
_scValue->SetBool(_state == GAME_FROZEN);
return _scValue;
}
@@ -2423,7 +2423,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccTTSEnabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccTTSEnabled") == 0) {
+ else if (strcmp(name, "AccTTSEnabled") == 0) {
_scValue->SetBool(false);
return _scValue;
}
@@ -2431,7 +2431,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccTTSTalk
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccTTSTalk") == 0) {
+ else if (strcmp(name, "AccTTSTalk") == 0) {
_scValue->SetBool(false);
return _scValue;
}
@@ -2439,7 +2439,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccTTSCaptions
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccTTSCaptions") == 0) {
+ else if (strcmp(name, "AccTTSCaptions") == 0) {
_scValue->SetBool(false);
return _scValue;
}
@@ -2447,7 +2447,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccTTSKeypress
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccTTSKeypress") == 0) {
+ else if (strcmp(name, "AccTTSKeypress") == 0) {
_scValue->SetBool(false);
return _scValue;
}
@@ -2455,7 +2455,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccKeyboardEnabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccKeyboardEnabled") == 0) {
+ else if (strcmp(name, "AccKeyboardEnabled") == 0) {
_scValue->SetBool(false);
return _scValue;
}
@@ -2463,7 +2463,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccKeyboardCursorSkip
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccKeyboardCursorSkip") == 0) {
+ else if (strcmp(name, "AccKeyboardCursorSkip") == 0) {
_scValue->SetBool(false);
return _scValue;
}
@@ -2471,7 +2471,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccKeyboardPause
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccKeyboardPause") == 0) {
+ else if (strcmp(name, "AccKeyboardPause") == 0) {
_scValue->SetBool(false);
return _scValue;
}
@@ -2479,7 +2479,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AutorunDisabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AutorunDisabled") == 0) {
+ else if (strcmp(name, "AutorunDisabled") == 0) {
_scValue->SetBool(_autorunDisabled);
return _scValue;
}
@@ -2487,7 +2487,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SaveDirectory (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SaveDirectory") == 0) {
+ else if (strcmp(name, "SaveDirectory") == 0) {
AnsiString dataDir = GetDataDir();
_scValue->SetString(dataDir.c_str());
return _scValue;
@@ -2496,7 +2496,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AutoSaveOnExit
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AutoSaveOnExit") == 0) {
+ else if (strcmp(name, "AutoSaveOnExit") == 0) {
_scValue->SetBool(_autoSaveOnExit);
return _scValue;
}
@@ -2504,7 +2504,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AutoSaveSlot
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AutoSaveSlot") == 0) {
+ else if (strcmp(name, "AutoSaveSlot") == 0) {
_scValue->SetInt(_autoSaveSlot);
return _scValue;
}
@@ -2512,7 +2512,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// CursorHidden
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CursorHidden") == 0) {
+ else if (strcmp(name, "CursorHidden") == 0) {
_scValue->SetBool(_cursorHidden);
return _scValue;
}
@@ -2520,7 +2520,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Platform (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Platform") == 0) {
+ else if (strcmp(name, "Platform") == 0) {
_scValue->SetString(CBPlatform::GetPlatformName().c_str());
return _scValue;
}
@@ -2528,7 +2528,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// DeviceType (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeviceType") == 0) {
+ else if (strcmp(name, "DeviceType") == 0) {
_scValue->SetString(GetDeviceType().c_str());
return _scValue;
}
@@ -2536,7 +2536,7 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MostRecentSaveSlot (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MostRecentSaveSlot") == 0) {
+ else if (strcmp(name, "MostRecentSaveSlot") == 0) {
_scValue->SetInt(_registry->ReadInt("System", "MostRecentSaveSlot", -1));
return _scValue;
}
@@ -2544,23 +2544,23 @@ CScValue *CBGame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Store (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Store") == 0) {
+ else if (strcmp(name, "Store") == 0) {
if (_store) _scValue->SetNative(_store, true);
else _scValue->SetNULL();
return _scValue;
}
- else return CBObject::scGetProperty(Name);
+ else return CBObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CBGame::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
@@ -2569,7 +2569,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MouseX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MouseX") == 0) {
+ else if (strcmp(name, "MouseX") == 0) {
_mousePos.x = Value->GetInt();
ResetMousePos();
return S_OK;
@@ -2578,7 +2578,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MouseY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MouseY") == 0) {
+ else if (strcmp(name, "MouseY") == 0) {
_mousePos.y = Value->GetInt();
ResetMousePos();
return S_OK;
@@ -2587,8 +2587,8 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Caption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Name") == 0) {
- HRESULT res = CBObject::scSetProperty(Name, Value);
+ else if (strcmp(name, "Name") == 0) {
+ HRESULT res = CBObject::scSetProperty(name, Value);
SetWindowTitle();
return res;
}
@@ -2596,7 +2596,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MainObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MainObject") == 0) {
+ else if (strcmp(name, "MainObject") == 0) {
CBScriptable *obj = Value->GetNative();
if (obj == NULL || ValidObject((CBObject *)obj)) _mainObject = (CBObject *)obj;
return S_OK;
@@ -2605,7 +2605,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Interactive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Interactive") == 0) {
+ else if (strcmp(name, "Interactive") == 0) {
SetInteractive(Value->GetBool());
return S_OK;
}
@@ -2613,7 +2613,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SFXVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SFXVolume") == 0) {
+ else if (strcmp(name, "SFXVolume") == 0) {
Game->LOG(0, "**Warning** The SFXVolume attribute is obsolete");
Game->_soundMgr->setVolumePercent(SOUND_SFX, (byte)Value->GetInt());
return S_OK;
@@ -2622,7 +2622,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SpeechVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SpeechVolume") == 0) {
+ else if (strcmp(name, "SpeechVolume") == 0) {
Game->LOG(0, "**Warning** The SpeechVolume attribute is obsolete");
Game->_soundMgr->setVolumePercent(SOUND_SPEECH, (byte)Value->GetInt());
return S_OK;
@@ -2631,7 +2631,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MusicVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MusicVolume") == 0) {
+ else if (strcmp(name, "MusicVolume") == 0) {
Game->LOG(0, "**Warning** The MusicVolume attribute is obsolete");
Game->_soundMgr->setVolumePercent(SOUND_MUSIC, (byte)Value->GetInt());
return S_OK;
@@ -2640,7 +2640,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MasterVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MasterVolume") == 0) {
+ else if (strcmp(name, "MasterVolume") == 0) {
Game->LOG(0, "**Warning** The MasterVolume attribute is obsolete");
Game->_soundMgr->setMasterVolumePercent((byte)Value->GetInt());
return S_OK;
@@ -2649,7 +2649,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Subtitles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Subtitles") == 0) {
+ else if (strcmp(name, "Subtitles") == 0) {
_subtitles = Value->GetBool();
return S_OK;
}
@@ -2657,7 +2657,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SubtitlesSpeed
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SubtitlesSpeed") == 0) {
+ else if (strcmp(name, "SubtitlesSpeed") == 0) {
_subtitlesSpeed = Value->GetInt();
return S_OK;
}
@@ -2665,7 +2665,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// VideoSubtitles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "VideoSubtitles") == 0) {
+ else if (strcmp(name, "VideoSubtitles") == 0) {
_videoSubtitles = Value->GetBool();
return S_OK;
}
@@ -2673,7 +2673,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// TextEncoding
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TextEncoding") == 0) {
+ else if (strcmp(name, "TextEncoding") == 0) {
int Enc = Value->GetInt();
if (Enc < 0) Enc = 0;
if (Enc >= NUM_TEXT_ENCODINGS) Enc = NUM_TEXT_ENCODINGS - 1;
@@ -2684,7 +2684,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// TextRTL
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TextRTL") == 0) {
+ else if (strcmp(name, "TextRTL") == 0) {
_textRTL = Value->GetBool();
return S_OK;
}
@@ -2692,7 +2692,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SoundBufferSize
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SoundBufferSize") == 0) {
+ else if (strcmp(name, "SoundBufferSize") == 0) {
_soundBufferSizeSec = Value->GetInt();
_soundBufferSizeSec = MAX(3, _soundBufferSizeSec);
return S_OK;
@@ -2701,7 +2701,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SuspendedRendering
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SuspendedRendering") == 0) {
+ else if (strcmp(name, "SuspendedRendering") == 0) {
_suspendedRendering = Value->GetBool();
return S_OK;
}
@@ -2709,7 +2709,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SuppressScriptErrors
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SuppressScriptErrors") == 0) {
+ else if (strcmp(name, "SuppressScriptErrors") == 0) {
_suppressScriptErrors = Value->GetBool();
return S_OK;
}
@@ -2717,7 +2717,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AutorunDisabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AutorunDisabled") == 0) {
+ else if (strcmp(name, "AutorunDisabled") == 0) {
_autorunDisabled = Value->GetBool();
return S_OK;
}
@@ -2725,7 +2725,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AutoSaveOnExit
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AutoSaveOnExit") == 0) {
+ else if (strcmp(name, "AutoSaveOnExit") == 0) {
_autoSaveOnExit = Value->GetBool();
return S_OK;
}
@@ -2733,7 +2733,7 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AutoSaveSlot
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AutoSaveSlot") == 0) {
+ else if (strcmp(name, "AutoSaveSlot") == 0) {
_autoSaveSlot = Value->GetInt();
return S_OK;
}
@@ -2741,12 +2741,12 @@ HRESULT CBGame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// CursorHidden
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CursorHidden") == 0) {
+ else if (strcmp(name, "CursorHidden") == 0) {
_cursorHidden = Value->GetBool();
return S_OK;
}
- else return CBObject::scSetProperty(Name, Value);
+ else return CBObject::scSetProperty(name, Value);
}
@@ -2925,283 +2925,283 @@ void CBGame::PublishNatives() { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::ExternalCall(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name) {
+HRESULT CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStack, char *name) {
CScValue *this_obj;
//////////////////////////////////////////////////////////////////////////
// LOG
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "LOG") == 0) {
- Stack->CorrectParams(1);
- Game->LOG(0, "sc: %s", Stack->Pop()->GetString());
- Stack->PushNULL();
+ if (strcmp(name, "LOG") == 0) {
+ stack->CorrectParams(1);
+ Game->LOG(0, "sc: %s", stack->Pop()->GetString());
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// String
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "String") == 0) {
- this_obj = ThisStack->GetTop();
+ else if (strcmp(name, "String") == 0) {
+ this_obj = thisStack->GetTop();
- this_obj->SetNative(makeSXString(Game, Stack));
- Stack->PushNULL();
+ this_obj->SetNative(makeSXString(Game, stack));
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// MemBuffer
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MemBuffer") == 0) {
- this_obj = ThisStack->GetTop();
+ else if (strcmp(name, "MemBuffer") == 0) {
+ this_obj = thisStack->GetTop();
- this_obj->SetNative(makeSXMemBuffer(Game, Stack));
- Stack->PushNULL();
+ this_obj->SetNative(makeSXMemBuffer(Game, stack));
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// File
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "File") == 0) {
- this_obj = ThisStack->GetTop();
+ else if (strcmp(name, "File") == 0) {
+ this_obj = thisStack->GetTop();
- this_obj->SetNative(makeSXFile(Game, Stack));
- Stack->PushNULL();
+ this_obj->SetNative(makeSXFile(Game, stack));
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// Date
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Date") == 0) {
- this_obj = ThisStack->GetTop();
+ else if (strcmp(name, "Date") == 0) {
+ this_obj = thisStack->GetTop();
- this_obj->SetNative(makeSXDate(Game, Stack));
- Stack->PushNULL();
+ this_obj->SetNative(makeSXDate(Game, stack));
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// Array
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Array") == 0) {
- this_obj = ThisStack->GetTop();
+ else if (strcmp(name, "Array") == 0) {
+ this_obj = thisStack->GetTop();
- this_obj->SetNative(makeSXArray(Game, Stack));
- Stack->PushNULL();
+ this_obj->SetNative(makeSXArray(Game, stack));
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// Object
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Object") == 0) {
- this_obj = ThisStack->GetTop();
+ else if (strcmp(name, "Object") == 0) {
+ this_obj = thisStack->GetTop();
- this_obj->SetNative(makeSXObject(Game, Stack));
- Stack->PushNULL();
+ this_obj->SetNative(makeSXObject(Game, stack));
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// Sleep
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Sleep") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "Sleep") == 0) {
+ stack->CorrectParams(1);
- Script->Sleep((uint32)Stack->Pop()->GetInt());
- Stack->PushNULL();
+ script->Sleep((uint32)stack->Pop()->GetInt());
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// WaitFor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WaitFor") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "WaitFor") == 0) {
+ stack->CorrectParams(1);
- CBScriptable *obj = Stack->Pop()->GetNative();
- if (ValidObject((CBObject *)obj)) Script->WaitForExclusive((CBObject *)obj);
- Stack->PushNULL();
+ CBScriptable *obj = stack->Pop()->GetNative();
+ if (ValidObject((CBObject *)obj)) script->WaitForExclusive((CBObject *)obj);
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// Random
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Random") == 0) {
- Stack->CorrectParams(2);
+ else if (strcmp(name, "Random") == 0) {
+ stack->CorrectParams(2);
- int from = Stack->Pop()->GetInt();
- int to = Stack->Pop()->GetInt();
+ int from = stack->Pop()->GetInt();
+ int to = stack->Pop()->GetInt();
- Stack->PushInt(CBUtils::RandomInt(from, to));
+ stack->PushInt(CBUtils::RandomInt(from, to));
}
//////////////////////////////////////////////////////////////////////////
// SetScriptTimeSlice
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetScriptTimeSlice") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetScriptTimeSlice") == 0) {
+ stack->CorrectParams(1);
- Script->_timeSlice = (uint32)Stack->Pop()->GetInt();
- Stack->PushNULL();
+ script->_timeSlice = (uint32)stack->Pop()->GetInt();
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// MakeRGBA / MakeRGB / RGB
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MakeRGBA") == 0 || strcmp(Name, "MakeRGB") == 0 || strcmp(Name, "RGB") == 0) {
- Stack->CorrectParams(4);
- int r = Stack->Pop()->GetInt();
- int g = Stack->Pop()->GetInt();
- int b = Stack->Pop()->GetInt();
+ else if (strcmp(name, "MakeRGBA") == 0 || strcmp(name, "MakeRGB") == 0 || strcmp(name, "RGB") == 0) {
+ stack->CorrectParams(4);
+ int r = stack->Pop()->GetInt();
+ int g = stack->Pop()->GetInt();
+ int b = stack->Pop()->GetInt();
int a;
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
if (val->IsNULL()) a = 255;
else a = val->GetInt();
- Stack->PushInt(DRGBA(r, g, b, a));
+ stack->PushInt(DRGBA(r, g, b, a));
}
//////////////////////////////////////////////////////////////////////////
// MakeHSL
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MakeHSL") == 0) {
- Stack->CorrectParams(3);
- int h = Stack->Pop()->GetInt();
- int s = Stack->Pop()->GetInt();
- int l = Stack->Pop()->GetInt();
+ else if (strcmp(name, "MakeHSL") == 0) {
+ stack->CorrectParams(3);
+ int h = stack->Pop()->GetInt();
+ int s = stack->Pop()->GetInt();
+ int l = stack->Pop()->GetInt();
- Stack->PushInt(CBUtils::HSLtoRGB(h, s, l));
+ stack->PushInt(CBUtils::HSLtoRGB(h, s, l));
}
//////////////////////////////////////////////////////////////////////////
// GetRValue
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetRValue") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "GetRValue") == 0) {
+ stack->CorrectParams(1);
- uint32 rgba = (uint32)Stack->Pop()->GetInt();
- Stack->PushInt(D3DCOLGetR(rgba));
+ uint32 rgba = (uint32)stack->Pop()->GetInt();
+ stack->PushInt(D3DCOLGetR(rgba));
}
//////////////////////////////////////////////////////////////////////////
// GetGValue
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetGValue") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "GetGValue") == 0) {
+ stack->CorrectParams(1);
- uint32 rgba = (uint32)Stack->Pop()->GetInt();
- Stack->PushInt(D3DCOLGetG(rgba));
+ uint32 rgba = (uint32)stack->Pop()->GetInt();
+ stack->PushInt(D3DCOLGetG(rgba));
}
//////////////////////////////////////////////////////////////////////////
// GetBValue
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetBValue") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "GetBValue") == 0) {
+ stack->CorrectParams(1);
- uint32 rgba = (uint32)Stack->Pop()->GetInt();
- Stack->PushInt(D3DCOLGetB(rgba));
+ uint32 rgba = (uint32)stack->Pop()->GetInt();
+ stack->PushInt(D3DCOLGetB(rgba));
}
//////////////////////////////////////////////////////////////////////////
// GetAValue
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetAValue") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "GetAValue") == 0) {
+ stack->CorrectParams(1);
- uint32 rgba = (uint32)Stack->Pop()->GetInt();
- Stack->PushInt(D3DCOLGetA(rgba));
+ uint32 rgba = (uint32)stack->Pop()->GetInt();
+ stack->PushInt(D3DCOLGetA(rgba));
}
//////////////////////////////////////////////////////////////////////////
// GetHValue
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetHValue") == 0) {
- Stack->CorrectParams(1);
- uint32 rgb = (uint32)Stack->Pop()->GetInt();
+ else if (strcmp(name, "GetHValue") == 0) {
+ stack->CorrectParams(1);
+ uint32 rgb = (uint32)stack->Pop()->GetInt();
byte H, S, L;
CBUtils::RGBtoHSL(rgb, &H, &S, &L);
- Stack->PushInt(H);
+ stack->PushInt(H);
}
//////////////////////////////////////////////////////////////////////////
// GetSValue
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetSValue") == 0) {
- Stack->CorrectParams(1);
- uint32 rgb = (uint32)Stack->Pop()->GetInt();
+ else if (strcmp(name, "GetSValue") == 0) {
+ stack->CorrectParams(1);
+ uint32 rgb = (uint32)stack->Pop()->GetInt();
byte H, S, L;
CBUtils::RGBtoHSL(rgb, &H, &S, &L);
- Stack->PushInt(S);
+ stack->PushInt(S);
}
//////////////////////////////////////////////////////////////////////////
// GetLValue
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetLValue") == 0) {
- Stack->CorrectParams(1);
- uint32 rgb = (uint32)Stack->Pop()->GetInt();
+ else if (strcmp(name, "GetLValue") == 0) {
+ stack->CorrectParams(1);
+ uint32 rgb = (uint32)stack->Pop()->GetInt();
byte H, S, L;
CBUtils::RGBtoHSL(rgb, &H, &S, &L);
- Stack->PushInt(L);
+ stack->PushInt(L);
}
//////////////////////////////////////////////////////////////////////////
// Debug
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Debug") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Debug") == 0) {
+ stack->CorrectParams(0);
if (Game->GetDebugMgr()->_enabled) {
- Game->GetDebugMgr()->OnScriptHitBreakpoint(Script);
- Script->Sleep(0);
+ Game->GetDebugMgr()->OnScriptHitBreakpoint(script);
+ script->Sleep(0);
}
- Stack->PushNULL();
+ stack->PushNULL();
}
//////////////////////////////////////////////////////////////////////////
// ToString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ToString") == 0) {
- Stack->CorrectParams(1);
- const char *Str = Stack->Pop()->GetString();
+ else if (strcmp(name, "ToString") == 0) {
+ stack->CorrectParams(1);
+ const char *Str = stack->Pop()->GetString();
char *Str2 = new char[strlen(Str) + 1];
strcpy(Str2, Str);
- Stack->PushString(Str2);
+ stack->PushString(Str2);
delete [] Str2;
}
//////////////////////////////////////////////////////////////////////////
// ToInt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ToInt") == 0) {
- Stack->CorrectParams(1);
- int Val = Stack->Pop()->GetInt();
- Stack->PushInt(Val);
+ else if (strcmp(name, "ToInt") == 0) {
+ stack->CorrectParams(1);
+ int Val = stack->Pop()->GetInt();
+ stack->PushInt(Val);
}
//////////////////////////////////////////////////////////////////////////
// ToFloat
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ToFloat") == 0) {
- Stack->CorrectParams(1);
- double Val = Stack->Pop()->GetFloat();
- Stack->PushFloat(Val);
+ else if (strcmp(name, "ToFloat") == 0) {
+ stack->CorrectParams(1);
+ double Val = stack->Pop()->GetFloat();
+ stack->PushFloat(Val);
}
//////////////////////////////////////////////////////////////////////////
// ToBool
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ToBool") == 0) {
- Stack->CorrectParams(1);
- bool Val = Stack->Pop()->GetBool();
- Stack->PushBool(Val);
+ else if (strcmp(name, "ToBool") == 0) {
+ stack->CorrectParams(1);
+ bool Val = stack->Pop()->GetBool();
+ stack->PushBool(Val);
}
//////////////////////////////////////////////////////////////////////////
// failure
else {
- Script->RuntimeError("Call to undefined function '%s'. Ignored.", Name);
- Stack->CorrectParams(0);
- Stack->PushNULL();
+ script->RuntimeError("Call to undefined function '%s'. Ignored.", name);
+ stack->CorrectParams(0);
+ stack->PushNULL();
}
return S_OK;
@@ -4045,7 +4045,7 @@ HRESULT CBGame::WindowLoadHook(CUIWindow *Win, char **Buf, char **Params) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScStack *Stack, const char *Name) {
+HRESULT CBGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *script, CScStack *stack, const char *name) {
return E_FAIL;
}
@@ -4500,7 +4500,7 @@ HRESULT CBGame::MiniUpdate() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnScriptShutdown(CScScript *Script) {
+HRESULT CBGame::OnScriptShutdown(CScScript *script) {
return S_OK;
}
diff --git a/engines/wintermute/Base/BGame.h b/engines/wintermute/Base/BGame.h index 6c5776ef2e..0325785ce1 100644 --- a/engines/wintermute/Base/BGame.h +++ b/engines/wintermute/Base/BGame.h @@ -67,7 +67,7 @@ class CBGame: public CBObject { public:
DECLARE_PERSISTENT(CBGame, CBObject)
- virtual HRESULT OnScriptShutdown(CScScript *Script);
+ virtual HRESULT OnScriptShutdown(CScScript *script);
virtual HRESULT OnActivate(bool Activate, bool RefreshMouse);
virtual HRESULT OnMouseLeftDown();
@@ -223,11 +223,11 @@ public: virtual HRESULT restoreDeviceObjects();
virtual void PublishNatives();
- virtual HRESULT ExternalCall(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name);
+ virtual HRESULT ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStack, char *name);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
// compatibility bits
bool _compatKillMethodThreads;
@@ -335,7 +335,7 @@ public: int _subtitlesSpeed;
void SetInteractive(bool State);
virtual HRESULT WindowLoadHook(CUIWindow *Win, char **Buf, char **Params);
- virtual HRESULT WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScStack *Stack, const char *Name);
+ virtual HRESULT WindowScriptMethodHook(CUIWindow *Win, CScScript *script, CScStack *stack, const char *name);
HRESULT GetCurrentViewportOffset(int *OffsetX = NULL, int *OffsetY = NULL);
HRESULT GetCurrentViewportRect(RECT *Rect, bool *Custom = NULL);
HRESULT PopViewport();
diff --git a/engines/wintermute/Base/BKeyboardState.cpp b/engines/wintermute/Base/BKeyboardState.cpp index 09d24453fa..490bf541fe 100644 --- a/engines/wintermute/Base/BKeyboardState.cpp +++ b/engines/wintermute/Base/BKeyboardState.cpp @@ -73,13 +73,13 @@ void CBKeyboardState::handleKeyRelease(Common::Event *event) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CBKeyboardState::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CBKeyboardState::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// IsKeyDown
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "IsKeyDown") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ if (strcmp(name, "IsKeyDown") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
int vKey;
if (val->_type == VAL_STRING && strlen(val->GetString()) > 0) {
@@ -94,22 +94,22 @@ HRESULT CBKeyboardState::scCallMethod(CScScript *Script, CScStack *Stack, CScSta // SDL_Scancode scanCode = SDL_GetScancodeFromKey(VKeyToKeyCode(vKey));
bool isDown = _keyStates[VKeyToKeyCode(vKey)];
- Stack->PushBool(isDown);
+ stack->PushBool(isDown);
return S_OK;
}
- else return CBScriptable::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBScriptable::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBKeyboardState::scGetProperty(const char *Name) {
+CScValue *CBKeyboardState::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("keyboard");
return _scValue;
}
@@ -117,7 +117,7 @@ CScValue *CBKeyboardState::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Key
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Key") == 0) {
+ else if (strcmp(name, "Key") == 0) {
if (_currentPrintable) {
char key[2];
key[0] = (char)_currentCharCode;
@@ -131,7 +131,7 @@ CScValue *CBKeyboardState::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Printable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Printable") == 0) {
+ else if (strcmp(name, "Printable") == 0) {
_scValue->SetBool(_currentPrintable);
return _scValue;
}
@@ -139,7 +139,7 @@ CScValue *CBKeyboardState::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// KeyCode
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "KeyCode") == 0) {
+ else if (strcmp(name, "KeyCode") == 0) {
_scValue->SetInt(_currentCharCode);
return _scValue;
}
@@ -147,7 +147,7 @@ CScValue *CBKeyboardState::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// IsShift
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsShift") == 0) {
+ else if (strcmp(name, "IsShift") == 0) {
_scValue->SetBool(_currentShift);
return _scValue;
}
@@ -155,7 +155,7 @@ CScValue *CBKeyboardState::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// IsAlt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsAlt") == 0) {
+ else if (strcmp(name, "IsAlt") == 0) {
_scValue->SetBool(_currentAlt);
return _scValue;
}
@@ -163,28 +163,28 @@ CScValue *CBKeyboardState::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// IsControl
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsControl") == 0) {
+ else if (strcmp(name, "IsControl") == 0) {
_scValue->SetBool(_currentControl);
return _scValue;
}
- else return CBScriptable::scGetProperty(Name);
+ else return CBScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBKeyboardState::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CBKeyboardState::scSetProperty(const char *name, CScValue *Value) {
/*
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
if (_renderer) SetWindowText(_renderer->_window, _name);
return S_OK;
}
- else*/ return CBScriptable::scSetProperty(Name, Value);
+ else*/ return CBScriptable::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Base/BKeyboardState.h b/engines/wintermute/Base/BKeyboardState.h index d5b61cfb9a..27aeac6ad9 100644 --- a/engines/wintermute/Base/BKeyboardState.h +++ b/engines/wintermute/Base/BKeyboardState.h @@ -59,9 +59,9 @@ public: static bool IsAltDown();
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
private:
diff --git a/engines/wintermute/Base/BObject.cpp b/engines/wintermute/Base/BObject.cpp index 6512a1f163..2665d25c97 100644 --- a/engines/wintermute/Base/BObject.cpp +++ b/engines/wintermute/Base/BObject.cpp @@ -165,17 +165,17 @@ HRESULT CBObject::listen(CBScriptHolder *param1, uint32 param2) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SkipTo
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SkipTo") == 0) {
- Stack->CorrectParams(2);
- _posX = Stack->Pop()->GetInt();
- _posY = Stack->Pop()->GetInt();
+ if (strcmp(name, "SkipTo") == 0) {
+ stack->CorrectParams(2);
+ _posX = stack->Pop()->GetInt();
+ _posY = stack->Pop()->GetInt();
afterMove();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -183,9 +183,9 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// Caption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Caption") == 0) {
- Stack->CorrectParams(1);
- Stack->PushString(getCaption(Stack->Pop()->GetInt()));
+ else if (strcmp(name, "Caption") == 0) {
+ stack->CorrectParams(1);
+ stack->PushString(getCaption(stack->Pop()->GetInt()));
return S_OK;
}
@@ -193,10 +193,10 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// SetCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetCursor") == 0) {
- Stack->CorrectParams(1);
- if (SUCCEEDED(setCursor(Stack->Pop()->GetString()))) Stack->PushBool(true);
- else Stack->PushBool(false);
+ else if (strcmp(name, "SetCursor") == 0) {
+ stack->CorrectParams(1);
+ if (SUCCEEDED(setCursor(stack->Pop()->GetString()))) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -204,8 +204,8 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// RemoveCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RemoveCursor") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "RemoveCursor") == 0) {
+ stack->CorrectParams(0);
if (!_sharedCursors) {
delete _cursor;
_cursor = NULL;
@@ -213,7 +213,7 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi _cursor = NULL;
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -221,10 +221,10 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// GetCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetCursor") == 0) {
- Stack->CorrectParams(0);
- if (!_cursor || !_cursor->_filename) Stack->PushNULL();
- else Stack->PushString(_cursor->_filename);
+ else if (strcmp(name, "GetCursor") == 0) {
+ stack->CorrectParams(0);
+ if (!_cursor || !_cursor->_filename) stack->PushNULL();
+ else stack->PushString(_cursor->_filename);
return S_OK;
}
@@ -232,10 +232,10 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// GetCursorObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetCursorObject") == 0) {
- Stack->CorrectParams(0);
- if (!_cursor) Stack->PushNULL();
- else Stack->PushNative(_cursor, true);
+ else if (strcmp(name, "GetCursorObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_cursor) stack->PushNULL();
+ else stack->PushNative(_cursor, true);
return S_OK;
}
@@ -243,11 +243,11 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// HasCursor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HasCursor") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "HasCursor") == 0) {
+ stack->CorrectParams(0);
- if (_cursor) Stack->PushBool(true);
- else Stack->PushBool(false);
+ if (_cursor) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -255,10 +255,10 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// SetCaption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetCaption") == 0) {
- Stack->CorrectParams(2);
- setCaption(Stack->Pop()->GetString(), Stack->Pop()->GetInt());
- Stack->PushNULL();
+ else if (strcmp(name, "SetCaption") == 0) {
+ stack->CorrectParams(2);
+ setCaption(stack->Pop()->GetString(), stack->Pop()->GetInt());
+ stack->PushNULL();
return S_OK;
}
@@ -266,13 +266,13 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// LoadSound
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadSound") == 0) {
- Stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ else if (strcmp(name, "LoadSound") == 0) {
+ stack->CorrectParams(1);
+ const char *Filename = stack->Pop()->GetString();
if (SUCCEEDED(playSFX(Filename, false, false)))
- Stack->PushBool(true);
+ stack->PushBool(true);
else
- Stack->PushBool(false);
+ stack->PushBool(false);
return S_OK;
}
@@ -280,16 +280,16 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// PlaySound
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PlaySound") == 0) {
- Stack->CorrectParams(3);
+ else if (strcmp(name, "PlaySound") == 0) {
+ stack->CorrectParams(3);
const char *Filename;
bool Looping;
uint32 LoopStart;
- CScValue *val1 = Stack->Pop();
- CScValue *val2 = Stack->Pop();
- CScValue *val3 = Stack->Pop();
+ CScValue *val1 = stack->Pop();
+ CScValue *val2 = stack->Pop();
+ CScValue *val3 = stack->Pop();
if (val1->_type == VAL_BOOL) {
Filename = NULL;
@@ -302,22 +302,22 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi LoopStart = val3->GetInt();
}
- if (FAILED(playSFX(Filename, Looping, true, NULL, LoopStart))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(playSFX(Filename, Looping, true, NULL, LoopStart))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// PlaySoundEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PlaySoundEvent") == 0) {
- Stack->CorrectParams(2);
+ else if (strcmp(name, "PlaySoundEvent") == 0) {
+ stack->CorrectParams(2);
const char *Filename;
const char *EventName;
- CScValue *val1 = Stack->Pop();
- CScValue *val2 = Stack->Pop();
+ CScValue *val1 = stack->Pop();
+ CScValue *val2 = stack->Pop();
if (val2->IsNULL()) {
Filename = NULL;
@@ -327,98 +327,98 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi EventName = val2->GetString();
}
- if (FAILED(playSFX(Filename, false, true, EventName))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(playSFX(Filename, false, true, EventName))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// StopSound
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "StopSound") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "StopSound") == 0) {
+ stack->CorrectParams(0);
- if (FAILED(stopSFX())) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(stopSFX())) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// PauseSound
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PauseSound") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "PauseSound") == 0) {
+ stack->CorrectParams(0);
- if (FAILED(pauseSFX())) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(pauseSFX())) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ResumeSound
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ResumeSound") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ResumeSound") == 0) {
+ stack->CorrectParams(0);
- if (FAILED(resumeSFX())) Stack->PushBool(false);
- else Stack->PushBool(true);
+ if (FAILED(resumeSFX())) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// IsSoundPlaying
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsSoundPlaying") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "IsSoundPlaying") == 0) {
+ stack->CorrectParams(0);
- if (_sFX && _sFX->isPlaying()) Stack->PushBool(true);
- else Stack->PushBool(false);
+ if (_sFX && _sFX->isPlaying()) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetSoundPosition
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetSoundPosition") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetSoundPosition") == 0) {
+ stack->CorrectParams(1);
- uint32 Time = Stack->Pop()->GetInt();
- if (FAILED(setSFXTime(Time))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ uint32 Time = stack->Pop()->GetInt();
+ if (FAILED(setSFXTime(Time))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetSoundPosition
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetSoundPosition") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetSoundPosition") == 0) {
+ stack->CorrectParams(0);
- if (!_sFX) Stack->PushInt(0);
- else Stack->PushInt(_sFX->getPositionTime());
+ if (!_sFX) stack->PushInt(0);
+ else stack->PushInt(_sFX->getPositionTime());
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetSoundVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetSoundVolume") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetSoundVolume") == 0) {
+ stack->CorrectParams(1);
- int Volume = Stack->Pop()->GetInt();
- if (FAILED(setSFXVolume(Volume))) Stack->PushBool(false);
- else Stack->PushBool(true);
+ int Volume = stack->Pop()->GetInt();
+ if (FAILED(setSFXVolume(Volume))) stack->PushBool(false);
+ else stack->PushBool(true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetSoundVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetSoundVolume") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetSoundVolume") == 0) {
+ stack->CorrectParams(0);
- if (!_sFX) Stack->PushInt(_sFXVolume);
- else Stack->PushInt(_sFX->getVolume());
+ if (!_sFX) stack->PushInt(_sFXVolume);
+ else stack->PushInt(_sFX->getVolume());
return S_OK;
}
@@ -426,14 +426,14 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// SoundFXNone
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SoundFXNone") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "SoundFXNone") == 0) {
+ stack->CorrectParams(0);
_sFXType = SFX_NONE;
_sFXParam1 = 0;
_sFXParam2 = 0;
_sFXParam3 = 0;
_sFXParam4 = 0;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -441,14 +441,14 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// SoundFXEcho
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SoundFXEcho") == 0) {
- Stack->CorrectParams(4);
+ else if (strcmp(name, "SoundFXEcho") == 0) {
+ stack->CorrectParams(4);
_sFXType = SFX_ECHO;
- _sFXParam1 = (float)Stack->Pop()->GetFloat(0); // Wet/Dry Mix [%] (0-100)
- _sFXParam2 = (float)Stack->Pop()->GetFloat(0); // Feedback [%] (0-100)
- _sFXParam3 = (float)Stack->Pop()->GetFloat(333.0f); // Left Delay [ms] (1-2000)
- _sFXParam4 = (float)Stack->Pop()->GetFloat(333.0f); // Right Delay [ms] (1-2000)
- Stack->PushNULL();
+ _sFXParam1 = (float)stack->Pop()->GetFloat(0); // Wet/Dry Mix [%] (0-100)
+ _sFXParam2 = (float)stack->Pop()->GetFloat(0); // Feedback [%] (0-100)
+ _sFXParam3 = (float)stack->Pop()->GetFloat(333.0f); // Left Delay [ms] (1-2000)
+ _sFXParam4 = (float)stack->Pop()->GetFloat(333.0f); // Right Delay [ms] (1-2000)
+ stack->PushNULL();
return S_OK;
}
@@ -456,30 +456,30 @@ HRESULT CBObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// SoundFXReverb
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SoundFXReverb") == 0) {
- Stack->CorrectParams(4);
+ else if (strcmp(name, "SoundFXReverb") == 0) {
+ stack->CorrectParams(4);
_sFXType = SFX_REVERB;
- _sFXParam1 = (float)Stack->Pop()->GetFloat(0); // In Gain [dB] (-96 - 0)
- _sFXParam2 = (float)Stack->Pop()->GetFloat(0); // Reverb Mix [dB] (-96 - 0)
- _sFXParam3 = (float)Stack->Pop()->GetFloat(1000.0f); // Reverb Time [ms] (0.001 - 3000)
- _sFXParam4 = (float)Stack->Pop()->GetFloat(0.001f); // HighFreq RT Ratio (0.001 - 0.999)
- Stack->PushNULL();
+ _sFXParam1 = (float)stack->Pop()->GetFloat(0); // In Gain [dB] (-96 - 0)
+ _sFXParam2 = (float)stack->Pop()->GetFloat(0); // Reverb Mix [dB] (-96 - 0)
+ _sFXParam3 = (float)stack->Pop()->GetFloat(1000.0f); // Reverb Time [ms] (0.001 - 3000)
+ _sFXParam4 = (float)stack->Pop()->GetFloat(0.001f); // HighFreq RT Ratio (0.001 - 0.999)
+ stack->PushNULL();
return S_OK;
}
- else return CBScriptHolder::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBScriptHolder::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBObject::scGetProperty(const char *Name) {
+CScValue *CBObject::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("object");
return _scValue;
}
@@ -487,7 +487,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Caption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Caption") == 0) {
+ else if (strcmp(name, "Caption") == 0) {
_scValue->SetString(getCaption(1));
return _scValue;
}
@@ -495,7 +495,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "X") == 0) {
+ else if (strcmp(name, "X") == 0) {
_scValue->SetInt(_posX);
return _scValue;
}
@@ -503,7 +503,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Y") == 0) {
+ else if (strcmp(name, "Y") == 0) {
_scValue->SetInt(_posY);
return _scValue;
}
@@ -511,7 +511,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Height (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Height") == 0) {
+ else if (strcmp(name, "Height") == 0) {
_scValue->SetInt(getHeight());
return _scValue;
}
@@ -519,7 +519,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Ready (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Ready") == 0) {
+ else if (strcmp(name, "Ready") == 0) {
_scValue->SetBool(_ready);
return _scValue;
}
@@ -527,7 +527,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Movable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Movable") == 0) {
+ else if (strcmp(name, "Movable") == 0) {
_scValue->SetBool(_movable);
return _scValue;
}
@@ -535,7 +535,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Registrable/Interactive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Registrable") == 0 || strcmp(Name, "Interactive") == 0) {
+ else if (strcmp(name, "Registrable") == 0 || strcmp(name, "Interactive") == 0) {
_scValue->SetBool(_registrable);
return _scValue;
}
@@ -543,21 +543,21 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Zoomable/Scalable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Zoomable") == 0 || strcmp(Name, "Scalable") == 0) {
+ else if (strcmp(name, "Zoomable") == 0 || strcmp(name, "Scalable") == 0) {
_scValue->SetBool(_zoomable);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Rotatable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Rotatable") == 0) {
+ else if (strcmp(name, "Rotatable") == 0) {
_scValue->SetBool(_rotatable);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AlphaColor") == 0) {
+ else if (strcmp(name, "AlphaColor") == 0) {
_scValue->SetInt((int)_alphaColor);
return _scValue;
}
@@ -565,7 +565,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// BlendMode
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "BlendMode") == 0) {
+ else if (strcmp(name, "BlendMode") == 0) {
_scValue->SetInt((int)_blendMode);
return _scValue;
}
@@ -573,7 +573,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Scale
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scale") == 0) {
+ else if (strcmp(name, "Scale") == 0) {
if (_scale < 0) _scValue->SetNULL();
else _scValue->SetFloat((double)_scale);
return _scValue;
@@ -582,7 +582,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ScaleX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScaleX") == 0) {
+ else if (strcmp(name, "ScaleX") == 0) {
if (_scaleX < 0) _scValue->SetNULL();
else _scValue->SetFloat((double)_scaleX);
return _scValue;
@@ -591,7 +591,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ScaleY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScaleY") == 0) {
+ else if (strcmp(name, "ScaleY") == 0) {
if (_scaleY < 0) _scValue->SetNULL();
else _scValue->SetFloat((double)_scaleY);
return _scValue;
@@ -600,7 +600,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// RelativeScale
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RelativeScale") == 0) {
+ else if (strcmp(name, "RelativeScale") == 0) {
_scValue->SetFloat((double)_relativeScale);
return _scValue;
}
@@ -608,7 +608,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Rotate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Rotate") == 0) {
+ else if (strcmp(name, "Rotate") == 0) {
if (!_rotateValid) _scValue->SetNULL();
else _scValue->SetFloat((double)_rotate);
return _scValue;
@@ -617,7 +617,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// RelativeRotate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RelativeRotate") == 0) {
+ else if (strcmp(name, "RelativeRotate") == 0) {
_scValue->SetFloat((double)_relativeRotate);
return _scValue;
}
@@ -625,14 +625,14 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Colorable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Colorable") == 0) {
+ else if (strcmp(name, "Colorable") == 0) {
_scValue->SetBool(_shadowable);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SoundPanning
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SoundPanning") == 0) {
+ else if (strcmp(name, "SoundPanning") == 0) {
_scValue->SetBool(_autoSoundPanning);
return _scValue;
}
@@ -640,7 +640,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SaveState
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SaveState") == 0) {
+ else if (strcmp(name, "SaveState") == 0) {
_scValue->SetBool(_saveState);
return _scValue;
}
@@ -648,7 +648,7 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NonIntMouseEvents
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NonIntMouseEvents") == 0) {
+ else if (strcmp(name, "NonIntMouseEvents") == 0) {
_scValue->SetBool(_nonIntMouseEvents);
return _scValue;
}
@@ -656,21 +656,21 @@ CScValue *CBObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccCaption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccCaption") == 0) {
+ else if (strcmp(name, "AccCaption") == 0) {
_scValue->SetNULL();
return _scValue;
}
- else return CBScriptHolder::scGetProperty(Name);
+ else return CBScriptHolder::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CBObject::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Caption
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Caption") == 0) {
+ if (strcmp(name, "Caption") == 0) {
setCaption(Value->GetString());
return S_OK;
}
@@ -678,7 +678,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "X") == 0) {
+ else if (strcmp(name, "X") == 0) {
_posX = Value->GetInt();
afterMove();
return S_OK;
@@ -687,7 +687,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Y") == 0) {
+ else if (strcmp(name, "Y") == 0) {
_posY = Value->GetInt();
afterMove();
return S_OK;
@@ -696,7 +696,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Movable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Movable") == 0) {
+ else if (strcmp(name, "Movable") == 0) {
_movable = Value->GetBool();
return S_OK;
}
@@ -704,7 +704,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Registrable/Interactive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Registrable") == 0 || strcmp(Name, "Interactive") == 0) {
+ else if (strcmp(name, "Registrable") == 0 || strcmp(name, "Interactive") == 0) {
_registrable = Value->GetBool();
return S_OK;
}
@@ -712,7 +712,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Zoomable/Scalable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Zoomable") == 0 || strcmp(Name, "Scalable") == 0) {
+ else if (strcmp(name, "Zoomable") == 0 || strcmp(name, "Scalable") == 0) {
_zoomable = Value->GetBool();
return S_OK;
}
@@ -720,7 +720,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Rotatable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Rotatable") == 0) {
+ else if (strcmp(name, "Rotatable") == 0) {
_rotatable = Value->GetBool();
return S_OK;
}
@@ -728,7 +728,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AlphaColor") == 0) {
+ else if (strcmp(name, "AlphaColor") == 0) {
_alphaColor = (uint32)Value->GetInt();
return S_OK;
}
@@ -736,7 +736,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// BlendMode
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "BlendMode") == 0) {
+ else if (strcmp(name, "BlendMode") == 0) {
int i = Value->GetInt();
if (i < BLEND_NORMAL || i >= NUM_BLEND_MODES) i = BLEND_NORMAL;
_blendMode = (TSpriteBlendMode)i;
@@ -746,7 +746,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Scale
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scale") == 0) {
+ else if (strcmp(name, "Scale") == 0) {
if (Value->IsNULL()) _scale = -1;
else _scale = (float)Value->GetFloat();
return S_OK;
@@ -755,7 +755,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// ScaleX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScaleX") == 0) {
+ else if (strcmp(name, "ScaleX") == 0) {
if (Value->IsNULL()) _scaleX = -1;
else _scaleX = (float)Value->GetFloat();
return S_OK;
@@ -764,7 +764,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// ScaleY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScaleY") == 0) {
+ else if (strcmp(name, "ScaleY") == 0) {
if (Value->IsNULL()) _scaleY = -1;
else _scaleY = (float)Value->GetFloat();
return S_OK;
@@ -773,7 +773,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// RelativeScale
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RelativeScale") == 0) {
+ else if (strcmp(name, "RelativeScale") == 0) {
_relativeScale = (float)Value->GetFloat();
return S_OK;
}
@@ -781,7 +781,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Rotate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Rotate") == 0) {
+ else if (strcmp(name, "Rotate") == 0) {
if (Value->IsNULL()) {
_rotate = 0.0f;
_rotateValid = false;
@@ -795,7 +795,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// RelativeRotate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RelativeRotate") == 0) {
+ else if (strcmp(name, "RelativeRotate") == 0) {
_relativeRotate = (float)Value->GetFloat();
return S_OK;
}
@@ -803,7 +803,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Colorable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Colorable") == 0) {
+ else if (strcmp(name, "Colorable") == 0) {
_shadowable = Value->GetBool();
return S_OK;
}
@@ -811,7 +811,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SoundPanning
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SoundPanning") == 0) {
+ else if (strcmp(name, "SoundPanning") == 0) {
_autoSoundPanning = Value->GetBool();
if (!_autoSoundPanning) resetSoundPan();
return S_OK;
@@ -820,7 +820,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SaveState
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SaveState") == 0) {
+ else if (strcmp(name, "SaveState") == 0) {
_saveState = Value->GetBool();
return S_OK;
}
@@ -828,7 +828,7 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// NonIntMouseEvents
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NonIntMouseEvents") == 0) {
+ else if (strcmp(name, "NonIntMouseEvents") == 0) {
_nonIntMouseEvents = Value->GetBool();
return S_OK;
}
@@ -836,11 +836,11 @@ HRESULT CBObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AccCaption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccCaption") == 0) {
+ else if (strcmp(name, "AccCaption") == 0) {
return S_OK;
}
- else return CBScriptHolder::scSetProperty(Name, Value);
+ else return CBScriptHolder::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Base/BObject.h b/engines/wintermute/Base/BObject.h index c289bd1313..44bb8c86ca 100644 --- a/engines/wintermute/Base/BObject.h +++ b/engines/wintermute/Base/BObject.h @@ -133,9 +133,9 @@ public: public:
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Base/BRegion.cpp b/engines/wintermute/Base/BRegion.cpp index 6fc11cb8a8..d85dfaaa2f 100644 --- a/engines/wintermute/Base/BRegion.cpp +++ b/engines/wintermute/Base/BRegion.cpp @@ -210,20 +210,20 @@ HRESULT CBRegion::loadBuffer(byte *Buffer, bool Complete) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CBRegion::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// AddPoint
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "AddPoint") == 0) {
- Stack->CorrectParams(2);
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
+ if (strcmp(name, "AddPoint") == 0) {
+ stack->CorrectParams(2);
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
_points.Add(new CBPoint(X, Y));
CreateRegion();
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -231,18 +231,18 @@ HRESULT CBRegion::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// InsertPoint
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InsertPoint") == 0) {
- Stack->CorrectParams(3);
- int Index = Stack->Pop()->GetInt();
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
+ else if (strcmp(name, "InsertPoint") == 0) {
+ stack->CorrectParams(3);
+ int Index = stack->Pop()->GetInt();
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
if (Index >= 0 && Index < _points.GetSize()) {
_points.InsertAt(Index, new CBPoint(X, Y));
CreateRegion();
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -250,19 +250,19 @@ HRESULT CBRegion::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// SetPoint
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetPoint") == 0) {
- Stack->CorrectParams(3);
- int Index = Stack->Pop()->GetInt();
- int X = Stack->Pop()->GetInt();
- int Y = Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetPoint") == 0) {
+ stack->CorrectParams(3);
+ int Index = stack->Pop()->GetInt();
+ int X = stack->Pop()->GetInt();
+ int Y = stack->Pop()->GetInt();
if (Index >= 0 && Index < _points.GetSize()) {
_points[Index]->x = X;
_points[Index]->y = Y;
CreateRegion();
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -270,9 +270,9 @@ HRESULT CBRegion::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// RemovePoint
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RemovePoint") == 0) {
- Stack->CorrectParams(1);
- int Index = Stack->Pop()->GetInt();
+ else if (strcmp(name, "RemovePoint") == 0) {
+ stack->CorrectParams(1);
+ int Index = stack->Pop()->GetInt();
if (Index >= 0 && Index < _points.GetSize()) {
delete _points[Index];
@@ -281,8 +281,8 @@ HRESULT CBRegion::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi _points.RemoveAt(Index);
CreateRegion();
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -290,33 +290,33 @@ HRESULT CBRegion::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// GetPoint
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetPoint") == 0) {
- Stack->CorrectParams(1);
- int Index = Stack->Pop()->GetInt();
+ else if (strcmp(name, "GetPoint") == 0) {
+ stack->CorrectParams(1);
+ int Index = stack->Pop()->GetInt();
if (Index >= 0 && Index < _points.GetSize()) {
- CScValue *Val = Stack->GetPushValue();
+ CScValue *Val = stack->GetPushValue();
if (Val) {
Val->SetProperty("X", _points[Index]->x);
Val->SetProperty("Y", _points[Index]->y);
}
- } else Stack->PushNULL();
+ } else stack->PushNULL();
return S_OK;
}
- else return CBObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBRegion::scGetProperty(const char *Name) {
+CScValue *CBRegion::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("region");
return _scValue;
}
@@ -324,7 +324,7 @@ CScValue *CBRegion::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Name") == 0) {
+ else if (strcmp(name, "Name") == 0) {
_scValue->SetString(_name);
return _scValue;
}
@@ -332,7 +332,7 @@ CScValue *CBRegion::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Active") == 0) {
+ else if (strcmp(name, "Active") == 0) {
_scValue->SetBool(_active);
return _scValue;
}
@@ -340,21 +340,21 @@ CScValue *CBRegion::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumPoints
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumPoints") == 0) {
+ else if (strcmp(name, "NumPoints") == 0) {
_scValue->SetInt(_points.GetSize());
return _scValue;
}
- else return CBObject::scGetProperty(Name);
+ else return CBObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBRegion::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CBRegion::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
}
@@ -362,12 +362,12 @@ HRESULT CBRegion::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Active") == 0) {
+ else if (strcmp(name, "Active") == 0) {
_active = Value->GetBool();
return S_OK;
}
- else return CBObject::scSetProperty(Name, Value);
+ else return CBObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Base/BRegion.h b/engines/wintermute/Base/BRegion.h index 6e8f8bbbb2..e4050c8ede 100644 --- a/engines/wintermute/Base/BRegion.h +++ b/engines/wintermute/Base/BRegion.h @@ -57,9 +57,9 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent, const char *NameOverride = NULL);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Base/BRegistry.cpp b/engines/wintermute/Base/BRegistry.cpp index 26d62ff3d0..c39e1e69f1 100644 --- a/engines/wintermute/Base/BRegistry.cpp +++ b/engines/wintermute/Base/BRegistry.cpp @@ -117,16 +117,16 @@ bool CBRegistry::WriteBool(const AnsiString &subKey, const AnsiString &key, bool //////////////////////////////////////////////////////////////////////////
-void CBRegistry::SetIniName(const char *Name) {
+void CBRegistry::SetIniName(const char *name) {
delete[] _iniName;
_iniName = NULL;
- if (strchr(Name, '\\') == NULL && strchr(Name, '/') == NULL) {
- _iniName = new char [strlen(Name) + 3];
- sprintf(_iniName, "./%s", Name);
+ if (strchr(name, '\\') == NULL && strchr(name, '/') == NULL) {
+ _iniName = new char [strlen(name) + 3];
+ sprintf(_iniName, "./%s", name);
} else {
- _iniName = new char [strlen(Name) + 1];
- strcpy(_iniName, Name);
+ _iniName = new char [strlen(name) + 1];
+ strcpy(_iniName, name);
}
}
diff --git a/engines/wintermute/Base/BRegistry.h b/engines/wintermute/Base/BRegistry.h index 1b2b5846b1..ac54c7ea81 100644 --- a/engines/wintermute/Base/BRegistry.h +++ b/engines/wintermute/Base/BRegistry.h @@ -35,7 +35,7 @@ namespace WinterMute { class CBRegistry : public CBBase {
public:
- void SetIniName(const char *Name);
+ void SetIniName(const char *name);
char *GetIniName();
bool WriteBool(const AnsiString &subKey, const AnsiString &key, bool Value);
bool ReadBool(const AnsiString &subKey, const AnsiString &key, bool init = false);
diff --git a/engines/wintermute/Base/BScriptHolder.cpp b/engines/wintermute/Base/BScriptHolder.cpp index 0b9bc27958..9d2c39e3cb 100644 --- a/engines/wintermute/Base/BScriptHolder.cpp +++ b/engines/wintermute/Base/BScriptHolder.cpp @@ -109,15 +109,15 @@ HRESULT CBScriptHolder::listen(CBScriptHolder *param1, uint32 param2) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CBScriptHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// DEBUG_CrashMe
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "DEBUG_CrashMe") == 0) {
- Stack->CorrectParams(0);
+ if (strcmp(name, "DEBUG_CrashMe") == 0) {
+ stack->CorrectParams(0);
byte *p = 0;
*p = 10;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -125,14 +125,14 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac //////////////////////////////////////////////////////////////////////////
// ApplyEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ApplyEvent") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ else if (strcmp(name, "ApplyEvent") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
HRESULT ret;
ret = applyEvent(val->GetString());
- if (SUCCEEDED(ret)) Stack->PushBool(true);
- else Stack->PushBool(false);
+ if (SUCCEEDED(ret)) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -140,9 +140,9 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac //////////////////////////////////////////////////////////////////////////
// CanHandleEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CanHandleEvent") == 0) {
- Stack->CorrectParams(1);
- Stack->PushBool(canHandleEvent(Stack->Pop()->GetString()));
+ else if (strcmp(name, "CanHandleEvent") == 0) {
+ stack->CorrectParams(1);
+ stack->PushBool(canHandleEvent(stack->Pop()->GetString()));
return S_OK;
}
@@ -150,9 +150,9 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac //////////////////////////////////////////////////////////////////////////
// CanHandleMethod
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CanHandleMethod") == 0) {
- Stack->CorrectParams(1);
- Stack->PushBool(canHandleMethod(Stack->Pop()->GetString()));
+ else if (strcmp(name, "CanHandleMethod") == 0) {
+ stack->CorrectParams(1);
+ stack->PushBool(canHandleMethod(stack->Pop()->GetString()));
return S_OK;
}
@@ -160,9 +160,9 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac //////////////////////////////////////////////////////////////////////////
// AttachScript
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AttachScript") == 0) {
- Stack->CorrectParams(1);
- Stack->PushBool(SUCCEEDED(addScript(Stack->Pop()->GetString())));
+ else if (strcmp(name, "AttachScript") == 0) {
+ stack->CorrectParams(1);
+ stack->PushBool(SUCCEEDED(addScript(stack->Pop()->GetString())));
return S_OK;
}
@@ -170,10 +170,10 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac //////////////////////////////////////////////////////////////////////////
// DetachScript
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DetachScript") == 0) {
- Stack->CorrectParams(2);
- const char *Filename = Stack->Pop()->GetString();
- bool KillThreads = Stack->Pop()->GetBool(false);
+ else if (strcmp(name, "DetachScript") == 0) {
+ stack->CorrectParams(2);
+ const char *Filename = stack->Pop()->GetString();
+ bool KillThreads = stack->Pop()->GetBool(false);
bool ret = false;
for (int i = 0; i < _scripts.GetSize(); i++) {
if (scumm_stricmp(_scripts[i]->_filename, Filename) == 0) {
@@ -182,7 +182,7 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac break;
}
}
- Stack->PushBool(ret);
+ stack->PushBool(ret);
return S_OK;
}
@@ -190,9 +190,9 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac //////////////////////////////////////////////////////////////////////////
// IsScriptRunning
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IsScriptRunning") == 0) {
- Stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ else if (strcmp(name, "IsScriptRunning") == 0) {
+ stack->CorrectParams(1);
+ const char *Filename = stack->Pop()->GetString();
bool ret = false;
for (int i = 0; i < _scripts.GetSize(); i++) {
if (scumm_stricmp(_scripts[i]->_filename, Filename) == 0 && _scripts[i]->_state != SCRIPT_FINISHED && _scripts[i]->_state != SCRIPT_ERROR) {
@@ -200,21 +200,21 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac break;
}
}
- Stack->PushBool(ret);
+ stack->PushBool(ret);
return S_OK;
- } else return CBScriptable::scCallMethod(Script, Stack, ThisStack, Name);
+ } else return CBScriptable::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBScriptHolder::scGetProperty(const char *Name) {
+CScValue *CBScriptHolder::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("script_holder");
return _scValue;
}
@@ -222,7 +222,7 @@ CScValue *CBScriptHolder::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Name") == 0) {
+ else if (strcmp(name, "Name") == 0) {
_scValue->SetString(_name);
return _scValue;
}
@@ -230,24 +230,24 @@ CScValue *CBScriptHolder::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Filename (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Filename") == 0) {
+ else if (strcmp(name, "Filename") == 0) {
_scValue->SetString(_filename);
return _scValue;
}
- else return CBScriptable::scGetProperty(Name);
+ else return CBScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBScriptHolder::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CBScriptHolder::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
- } else return CBScriptable::scSetProperty(Name, Value);
+ } else return CBScriptable::scSetProperty(name, Value);
}
@@ -311,9 +311,9 @@ HRESULT CBScriptHolder::addScript(const char *Filename) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBScriptHolder::removeScript(CScScript *Script) {
+HRESULT CBScriptHolder::removeScript(CScScript *script) {
for (int i = 0; i < _scripts.GetSize(); i++) {
- if (_scripts[i] == Script) {
+ if (_scripts[i] == script) {
_scripts.RemoveAt(i);
break;
}
diff --git a/engines/wintermute/Base/BScriptable.cpp b/engines/wintermute/Base/BScriptable.cpp index aa2bb7059c..20f64f7fba 100644 --- a/engines/wintermute/Base/BScriptable.cpp +++ b/engines/wintermute/Base/BScriptable.cpp @@ -63,9 +63,9 @@ CBScriptable::~CBScriptable() { //////////////////////////////////////////////////////////////////////////
HRESULT CBScriptable::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
/*
- Stack->CorrectParams(0);
- Stack->PushNULL();
- Script->RuntimeError("Call to undefined method '%s'.", Name);
+ stack->CorrectParams(0);
+ stack->PushNULL();
+ script->RuntimeError("Call to undefined method '%s'.", name);
return S_OK;
*/
diff --git a/engines/wintermute/Base/BScriptable.h b/engines/wintermute/Base/BScriptable.h index 40e7460b92..742ec174a2 100644 --- a/engines/wintermute/Base/BScriptable.h +++ b/engines/wintermute/Base/BScriptable.h @@ -71,7 +71,7 @@ public: public:
// IWmeDebugObject
const char *DbgGetNativeClass();
- IWmeDebugProp *DbgGetProperty(const char *Name);
+ IWmeDebugProp *DbgGetProperty(const char *name);
};
diff --git a/engines/wintermute/Base/BSprite.cpp b/engines/wintermute/Base/BSprite.cpp index 8683fbb496..89acae9b55 100644 --- a/engines/wintermute/Base/BSprite.cpp +++ b/engines/wintermute/Base/BSprite.cpp @@ -507,30 +507,30 @@ HRESULT CBSprite::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CBSprite::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetFrame
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "GetFrame") == 0) {
- Stack->CorrectParams(1);
- int Index = Stack->Pop()->GetInt(-1);
+ if (strcmp(name, "GetFrame") == 0) {
+ stack->CorrectParams(1);
+ int Index = stack->Pop()->GetInt(-1);
if (Index < 0 || Index >= _frames.GetSize()) {
- Script->RuntimeError("Sprite.GetFrame: Frame index %d is out of range.", Index);
- Stack->PushNULL();
- } else Stack->PushNative(_frames[Index], true);
+ script->RuntimeError("Sprite.GetFrame: Frame index %d is out of range.", Index);
+ stack->PushNULL();
+ } else stack->PushNative(_frames[Index], true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DeleteFrame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteFrame") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "DeleteFrame") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (Val->IsInt()) {
int Index = Val->GetInt(-1);
if (Index < 0 || Index >= _frames.GetSize()) {
- Script->RuntimeError("Sprite.DeleteFrame: Frame index %d is out of range.", Index);
+ script->RuntimeError("Sprite.DeleteFrame: Frame index %d is out of range.", Index);
}
} else {
CBFrame *Frame = (CBFrame *)Val->GetNative();
@@ -543,26 +543,26 @@ HRESULT CBSprite::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi }
}
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Reset
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Reset") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Reset") == 0) {
+ stack->CorrectParams(0);
Reset();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// AddFrame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddFrame") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "AddFrame") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
const char *Filename = NULL;
if (!Val->IsNULL()) Filename = Val->GetString();
@@ -576,19 +576,19 @@ HRESULT CBSprite::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi }
_frames.Add(Frame);
- Stack->PushNative(Frame, true);
+ stack->PushNative(Frame, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// InsertFrame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InsertFrame") == 0) {
- Stack->CorrectParams(2);
- int Index = Stack->Pop()->GetInt();
+ else if (strcmp(name, "InsertFrame") == 0) {
+ stack->CorrectParams(2);
+ int Index = stack->Pop()->GetInt();
if (Index < 0) Index = 0;
- CScValue *Val = Stack->Pop();
+ CScValue *Val = stack->Pop();
const char *Filename = NULL;
if (!Val->IsNULL()) Filename = Val->GetString();
@@ -602,42 +602,42 @@ HRESULT CBSprite::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi if (Index >= _frames.GetSize()) _frames.Add(Frame);
else _frames.InsertAt(Index, Frame);
- Stack->PushNative(Frame, true);
+ stack->PushNative(Frame, true);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Pause
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Pause") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Pause") == 0) {
+ stack->CorrectParams(0);
_paused = true;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Play
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Play") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Play") == 0) {
+ stack->CorrectParams(0);
_paused = false;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
- else return CBScriptHolder::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBScriptHolder::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBSprite::scGetProperty(const char *Name) {
+CScValue *CBSprite::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("sprite");
return _scValue;
}
@@ -645,7 +645,7 @@ CScValue *CBSprite::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumFrames (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumFrames") == 0) {
+ else if (strcmp(name, "NumFrames") == 0) {
_scValue->SetInt(_frames.GetSize());
return _scValue;
}
@@ -653,7 +653,7 @@ CScValue *CBSprite::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// CurrentFrame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CurrentFrame") == 0) {
+ else if (strcmp(name, "CurrentFrame") == 0) {
_scValue->SetInt(_currentFrame);
return _scValue;
}
@@ -661,7 +661,7 @@ CScValue *CBSprite::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PixelPerfect") == 0) {
+ else if (strcmp(name, "PixelPerfect") == 0) {
_scValue->SetBool(_precise);
return _scValue;
}
@@ -669,7 +669,7 @@ CScValue *CBSprite::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Looping
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Looping") == 0) {
+ else if (strcmp(name, "Looping") == 0) {
_scValue->SetBool(_looping);
return _scValue;
}
@@ -677,7 +677,7 @@ CScValue *CBSprite::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Owner (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Owner") == 0) {
+ else if (strcmp(name, "Owner") == 0) {
if (_owner == NULL) _scValue->SetNULL();
else _scValue->SetNative(_owner, true);
return _scValue;
@@ -686,7 +686,7 @@ CScValue *CBSprite::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Finished (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Finished") == 0) {
+ else if (strcmp(name, "Finished") == 0) {
_scValue->SetBool(_finished);
return _scValue;
}
@@ -694,21 +694,21 @@ CScValue *CBSprite::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Paused (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Paused") == 0) {
+ else if (strcmp(name, "Paused") == 0) {
_scValue->SetBool(_paused);
return _scValue;
}
- else return CBScriptHolder::scGetProperty(Name);
+ else return CBScriptHolder::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBSprite::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CBSprite::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// CurrentFrame
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "CurrentFrame") == 0) {
+ if (strcmp(name, "CurrentFrame") == 0) {
_currentFrame = Value->GetInt(0);
if (_currentFrame >= _frames.GetSize() || _currentFrame < 0) {
_currentFrame = -1;
@@ -720,7 +720,7 @@ HRESULT CBSprite::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PixelPerfect") == 0) {
+ else if (strcmp(name, "PixelPerfect") == 0) {
_precise = Value->GetBool();
return S_OK;
}
@@ -728,12 +728,12 @@ HRESULT CBSprite::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Looping
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Looping") == 0) {
+ else if (strcmp(name, "Looping") == 0) {
_looping = Value->GetBool();
return S_OK;
}
- else return CBScriptHolder::scSetProperty(Name, Value);
+ else return CBScriptHolder::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Base/BSprite.h b/engines/wintermute/Base/BSprite.h index 1e35a1555f..88bc8dbe2f 100644 --- a/engines/wintermute/Base/BSprite.h +++ b/engines/wintermute/Base/BSprite.h @@ -79,9 +79,9 @@ public: HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Base/BSubFrame.cpp b/engines/wintermute/Base/BSubFrame.cpp index 2e1ddf2a12..89ca0c858b 100644 --- a/engines/wintermute/Base/BSubFrame.cpp +++ b/engines/wintermute/Base/BSubFrame.cpp @@ -342,55 +342,55 @@ HRESULT CBSubFrame::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CBSubFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CBSubFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetImage
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "GetImage") == 0) {
- Stack->CorrectParams(0);
+ if (strcmp(name, "GetImage") == 0) {
+ stack->CorrectParams(0);
- if (!_surfaceFilename) Stack->PushNULL();
- else Stack->PushString(_surfaceFilename);
+ if (!_surfaceFilename) stack->PushNULL();
+ else stack->PushString(_surfaceFilename);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetImage") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "SetImage") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (Val->IsNULL()) {
if (_surface) Game->_surfaceStorage->removeSurface(_surface);
delete[] _surfaceFilename;
_surfaceFilename = NULL;
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
const char *Filename = Val->GetString();
if (SUCCEEDED(setSurface(Filename))) {
setDefaultRect();
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
}
return S_OK;
}
- else return CBScriptable::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBScriptable::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBSubFrame::scGetProperty(const char *Name) {
+CScValue *CBSubFrame::scGetProperty(const char *name) {
if (!_scValue) _scValue = new CScValue(Game);
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("subframe");
return _scValue;
}
@@ -398,7 +398,7 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AlphaColor") == 0) {
+ else if (strcmp(name, "AlphaColor") == 0) {
_scValue->SetInt((int)_alpha);
return _scValue;
@@ -407,7 +407,7 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// TransparentColor (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TransparentColor") == 0) {
+ else if (strcmp(name, "TransparentColor") == 0) {
_scValue->SetInt((int)_transparent);
return _scValue;
}
@@ -415,7 +415,7 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Is2DOnly
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Is2DOnly") == 0) {
+ else if (strcmp(name, "Is2DOnly") == 0) {
_scValue->SetBool(_2DOnly);
return _scValue;
}
@@ -423,7 +423,7 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Is3DOnly
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Is3DOnly") == 0) {
+ else if (strcmp(name, "Is3DOnly") == 0) {
_scValue->SetBool(_3DOnly);
return _scValue;
}
@@ -431,7 +431,7 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MirrorX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MirrorX") == 0) {
+ else if (strcmp(name, "MirrorX") == 0) {
_scValue->SetBool(_mirrorX);
return _scValue;
}
@@ -439,7 +439,7 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MirrorY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MirrorY") == 0) {
+ else if (strcmp(name, "MirrorY") == 0) {
_scValue->SetBool(_mirrorY);
return _scValue;
}
@@ -447,7 +447,7 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Decoration
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Decoration") == 0) {
+ else if (strcmp(name, "Decoration") == 0) {
_scValue->SetBool(_decoration);
return _scValue;
}
@@ -455,7 +455,7 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// HotspotX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HotspotX") == 0) {
+ else if (strcmp(name, "HotspotX") == 0) {
_scValue->SetInt(_hotspotX);
return _scValue;
}
@@ -463,21 +463,21 @@ CScValue *CBSubFrame::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// HotspotY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HotspotY") == 0) {
+ else if (strcmp(name, "HotspotY") == 0) {
_scValue->SetInt(_hotspotY);
return _scValue;
}
- else return CBScriptable::scGetProperty(Name);
+ else return CBScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBSubFrame::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CBSubFrame::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "AlphaColor") == 0) {
+ if (strcmp(name, "AlphaColor") == 0) {
_alpha = (uint32)Value->GetInt();
return S_OK;
}
@@ -485,7 +485,7 @@ HRESULT CBSubFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Is2DOnly
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Is2DOnly") == 0) {
+ else if (strcmp(name, "Is2DOnly") == 0) {
_2DOnly = Value->GetBool();
return S_OK;
}
@@ -493,7 +493,7 @@ HRESULT CBSubFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Is3DOnly
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Is3DOnly") == 0) {
+ else if (strcmp(name, "Is3DOnly") == 0) {
_3DOnly = Value->GetBool();
return S_OK;
}
@@ -501,7 +501,7 @@ HRESULT CBSubFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MirrorX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MirrorX") == 0) {
+ else if (strcmp(name, "MirrorX") == 0) {
_mirrorX = Value->GetBool();
return S_OK;
}
@@ -509,7 +509,7 @@ HRESULT CBSubFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MirrorY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MirrorY") == 0) {
+ else if (strcmp(name, "MirrorY") == 0) {
_mirrorY = Value->GetBool();
return S_OK;
}
@@ -517,7 +517,7 @@ HRESULT CBSubFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Decoration
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Decoration") == 0) {
+ else if (strcmp(name, "Decoration") == 0) {
_decoration = Value->GetBool();
return S_OK;
}
@@ -525,7 +525,7 @@ HRESULT CBSubFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// HotspotX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HotspotX") == 0) {
+ else if (strcmp(name, "HotspotX") == 0) {
_hotspotX = Value->GetInt();
return S_OK;
}
@@ -533,12 +533,12 @@ HRESULT CBSubFrame::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// HotspotY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HotspotY") == 0) {
+ else if (strcmp(name, "HotspotY") == 0) {
_hotspotY = Value->GetInt();
return S_OK;
}
- else return CBScriptable::scSetProperty(Name, Value);
+ else return CBScriptable::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Base/BSubFrame.h b/engines/wintermute/Base/BSubFrame.h index 67f3201fa1..5d4547f722 100644 --- a/engines/wintermute/Base/BSubFrame.h +++ b/engines/wintermute/Base/BSubFrame.h @@ -74,9 +74,9 @@ public: CBSurface *_surface;
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp index 9809e50695..68b919bbe5 100644 --- a/engines/wintermute/Base/PartEmitter.cpp +++ b/engines/wintermute/Base/PartEmitter.cpp @@ -364,11 +364,11 @@ 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++) {
- if (scumm_stricmp(Name, _forces[i]->_name) == 0) {
+ if (scumm_stricmp(name, _forces[i]->_name) == 0) {
Force = _forces[i];
break;
}
@@ -376,7 +376,7 @@ CPartForce *CPartEmitter::addForceByName(const char *Name) { if (!Force) {
Force = new CPartForce(Game);
if (Force) {
- Force->setName(Name);
+ Force->setName(name);
_forces.Add(Force);
}
}
@@ -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,9 +401,9 @@ 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) {
+ if (scumm_stricmp(name, _forces[i]->_name) == 0) {
delete _forces[i];
_forces.RemoveAt(i);
return S_OK;
@@ -416,52 +416,52 @@ HRESULT CPartEmitter::removeForce(const char *Name) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CPartEmitter::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetBorder
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetBorder") == 0) {
- Stack->CorrectParams(4);
- int BorderX = Stack->Pop()->GetInt();
- int BorderY = Stack->Pop()->GetInt();
- int BorderWidth = Stack->Pop()->GetInt();
- int BorderHeight = Stack->Pop()->GetInt();
+ if (strcmp(name, "SetBorder") == 0) {
+ stack->CorrectParams(4);
+ int BorderX = stack->Pop()->GetInt();
+ int BorderY = stack->Pop()->GetInt();
+ 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;
}
//////////////////////////////////////////////////////////////////////////
// SetBorderThickness
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetBorderThickness") == 0) {
- Stack->CorrectParams(4);
- int Left = Stack->Pop()->GetInt();
- int Right = Stack->Pop()->GetInt();
- int Top = Stack->Pop()->GetInt();
- int Bottom = Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetBorderThickness") == 0) {
+ stack->CorrectParams(4);
+ int Left = stack->Pop()->GetInt();
+ int Right = stack->Pop()->GetInt();
+ 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;
}
//////////////////////////////////////////////////////////////////////////
// AddSprite
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddSprite") == 0) {
- Stack->CorrectParams(1);
- const char *SpriteFile = Stack->Pop()->GetString();
- Stack->PushBool(SUCCEEDED(addSprite(SpriteFile)));
+ else if (strcmp(name, "AddSprite") == 0) {
+ stack->CorrectParams(1);
+ const char *SpriteFile = stack->Pop()->GetString();
+ stack->PushBool(SUCCEEDED(addSprite(SpriteFile)));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// RemoveSprite
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RemoveSprite") == 0) {
- Stack->CorrectParams(1);
- const char *SpriteFile = Stack->Pop()->GetString();
- Stack->PushBool(SUCCEEDED(removeSprite(SpriteFile)));
+ else if (strcmp(name, "RemoveSprite") == 0) {
+ stack->CorrectParams(1);
+ const char *SpriteFile = stack->Pop()->GetString();
+ stack->PushBool(SUCCEEDED(removeSprite(SpriteFile)));
return S_OK;
}
@@ -469,10 +469,10 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// Start
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Start") == 0) {
- Stack->CorrectParams(1);
- _overheadTime = Stack->Pop()->GetInt();
- Stack->PushBool(SUCCEEDED(start()));
+ else if (strcmp(name, "Start") == 0) {
+ stack->CorrectParams(1);
+ _overheadTime = stack->Pop()->GetInt();
+ stack->PushBool(SUCCEEDED(start()));
return S_OK;
}
@@ -480,8 +480,8 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// Stop
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Stop") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Stop") == 0) {
+ stack->CorrectParams(0);
for (int i = 0; i < _particles.GetSize(); i++) {
delete _particles[i];
@@ -489,7 +489,7 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack _particles.RemoveAll();
_running = false;
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -497,10 +497,10 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// Pause
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Pause") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Pause") == 0) {
+ stack->CorrectParams(0);
_running = false;
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -508,10 +508,10 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// Resume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Resume") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Resume") == 0) {
+ stack->CorrectParams(0);
_running = true;
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -519,13 +519,13 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// AddGlobalForce
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddGlobalForce") == 0) {
- Stack->CorrectParams(3);
- const char *forceName = Stack->Pop()->GetString();
- float Angle = Stack->Pop()->GetFloat();
- float Strength = Stack->Pop()->GetFloat();
+ else if (strcmp(name, "AddGlobalForce") == 0) {
+ stack->CorrectParams(3);
+ const char *forceName = stack->Pop()->GetString();
+ 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;
}
@@ -533,15 +533,15 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// AddPointForce
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AddPointForce") == 0) {
- Stack->CorrectParams(5);
- const char *forceName = Stack->Pop()->GetString();
- int PosX = Stack->Pop()->GetInt();
- int PosY = Stack->Pop()->GetInt();
- float Angle = Stack->Pop()->GetFloat();
- float Strength = Stack->Pop()->GetFloat();
+ else if (strcmp(name, "AddPointForce") == 0) {
+ stack->CorrectParams(5);
+ const char *forceName = stack->Pop()->GetString();
+ int PosX = stack->Pop()->GetInt();
+ int PosY = stack->Pop()->GetInt();
+ 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;
}
@@ -549,54 +549,54 @@ HRESULT CPartEmitter::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// RemoveForce
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RemoveForce") == 0) {
- Stack->CorrectParams(1);
- const char *forceName = Stack->Pop()->GetString();
+ else if (strcmp(name, "RemoveForce") == 0) {
+ stack->CorrectParams(1);
+ const char *forceName = stack->Pop()->GetString();
- Stack->PushBool(SUCCEEDED(removeForce(forceName)));
+ stack->PushBool(SUCCEEDED(removeForce(forceName)));
return S_OK;
}
- else return CBObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CPartEmitter::scGetProperty(const char *Name) {
+CScValue *CPartEmitter::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("particle-emitter");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "X") == 0) {
+ else if (strcmp(name, "X") == 0) {
_scValue->SetInt(_posX);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Y") == 0) {
+ else if (strcmp(name, "Y") == 0) {
_scValue->SetInt(_posY);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Width") == 0) {
+ else if (strcmp(name, "Width") == 0) {
_scValue->SetInt(_width);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Height") == 0) {
+ else if (strcmp(name, "Height") == 0) {
_scValue->SetInt(_height);
return _scValue;
}
@@ -604,21 +604,21 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Scale1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scale1") == 0) {
+ else if (strcmp(name, "Scale1") == 0) {
_scValue->SetFloat(_scale1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Scale2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scale2") == 0) {
+ else if (strcmp(name, "Scale2") == 0) {
_scValue->SetFloat(_scale2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScaleZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScaleZBased") == 0) {
+ else if (strcmp(name, "ScaleZBased") == 0) {
_scValue->SetBool(_scaleZBased);
return _scValue;
}
@@ -626,21 +626,21 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Velocity1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Velocity1") == 0) {
+ else if (strcmp(name, "Velocity1") == 0) {
_scValue->SetFloat(_velocity1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Velocity2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Velocity2") == 0) {
+ else if (strcmp(name, "Velocity2") == 0) {
_scValue->SetFloat(_velocity2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// VelocityZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "VelocityZBased") == 0) {
+ else if (strcmp(name, "VelocityZBased") == 0) {
_scValue->SetBool(_velocityZBased);
return _scValue;
}
@@ -648,21 +648,21 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// LifeTime1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LifeTime1") == 0) {
+ else if (strcmp(name, "LifeTime1") == 0) {
_scValue->SetInt(_lifeTime1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LifeTime2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LifeTime2") == 0) {
+ else if (strcmp(name, "LifeTime2") == 0) {
_scValue->SetInt(_lifeTime2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LifeTimeZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LifeTimeZBased") == 0) {
+ else if (strcmp(name, "LifeTimeZBased") == 0) {
_scValue->SetBool(_lifeTimeZBased);
return _scValue;
}
@@ -670,14 +670,14 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Angle1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Angle1") == 0) {
+ else if (strcmp(name, "Angle1") == 0) {
_scValue->SetInt(_angle1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Angle2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Angle2") == 0) {
+ else if (strcmp(name, "Angle2") == 0) {
_scValue->SetInt(_angle2);
return _scValue;
}
@@ -685,14 +685,14 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AngVelocity1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AngVelocity1") == 0) {
+ else if (strcmp(name, "AngVelocity1") == 0) {
_scValue->SetFloat(_angVelocity1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AngVelocity2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AngVelocity2") == 0) {
+ else if (strcmp(name, "AngVelocity2") == 0) {
_scValue->SetFloat(_angVelocity2);
return _scValue;
}
@@ -700,14 +700,14 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Rotation1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Rotation1") == 0) {
+ else if (strcmp(name, "Rotation1") == 0) {
_scValue->SetFloat(_rotation1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Rotation2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Rotation2") == 0) {
+ else if (strcmp(name, "Rotation2") == 0) {
_scValue->SetFloat(_rotation2);
return _scValue;
}
@@ -715,21 +715,21 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Alpha1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Alpha1") == 0) {
+ else if (strcmp(name, "Alpha1") == 0) {
_scValue->SetInt(_alpha1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Alpha2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Alpha2") == 0) {
+ else if (strcmp(name, "Alpha2") == 0) {
_scValue->SetInt(_alpha2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AlphaTimeBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AlphaTimeBased") == 0) {
+ else if (strcmp(name, "AlphaTimeBased") == 0) {
_scValue->SetBool(_alphaTimeBased);
return _scValue;
}
@@ -737,14 +737,14 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MaxParticles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MaxParticles") == 0) {
+ else if (strcmp(name, "MaxParticles") == 0) {
_scValue->SetInt(_maxParticles);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumLiveParticles (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumLiveParticles") == 0) {
+ else if (strcmp(name, "NumLiveParticles") == 0) {
int NumAlive = 0;
for (int i = 0; i < _particles.GetSize(); i++) {
if (_particles[i] && !_particles[i]->_isDead) NumAlive++;
@@ -756,21 +756,21 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// GenerationInterval
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GenerationInterval") == 0) {
+ else if (strcmp(name, "GenerationInterval") == 0) {
_scValue->SetInt(_genInterval);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// GenerationAmount
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GenerationAmount") == 0) {
+ else if (strcmp(name, "GenerationAmount") == 0) {
_scValue->SetInt(_genAmount);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MaxBatches
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MaxBatches") == 0) {
+ else if (strcmp(name, "MaxBatches") == 0) {
_scValue->SetInt(_maxBatches);
return _scValue;
}
@@ -778,14 +778,14 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// FadeInTime
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeInTime") == 0) {
+ else if (strcmp(name, "FadeInTime") == 0) {
_scValue->SetInt(_fadeInTime);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// FadeOutTime
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeOutTime") == 0) {
+ else if (strcmp(name, "FadeOutTime") == 0) {
_scValue->SetInt(_fadeOutTime);
return _scValue;
}
@@ -793,21 +793,21 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// GrowthRate1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GrowthRate1") == 0) {
+ else if (strcmp(name, "GrowthRate1") == 0) {
_scValue->SetFloat(_growthRate1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// GrowthRate2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GrowthRate2") == 0) {
+ else if (strcmp(name, "GrowthRate2") == 0) {
_scValue->SetFloat(_growthRate2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ExponentialGrowth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ExponentialGrowth") == 0) {
+ else if (strcmp(name, "ExponentialGrowth") == 0) {
_scValue->SetBool(_exponentialGrowth);
return _scValue;
}
@@ -815,7 +815,7 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// UseRegion
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "UseRegion") == 0) {
+ else if (strcmp(name, "UseRegion") == 0) {
_scValue->SetBool(_useRegion);
return _scValue;
}
@@ -823,43 +823,43 @@ CScValue *CPartEmitter::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// EmitEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "EmitEvent") == 0) {
+ else if (strcmp(name, "EmitEvent") == 0) {
if (!_emitEvent) _scValue->SetNULL();
else _scValue->SetString(_emitEvent);
return _scValue;
}
- else return CBObject::scGetProperty(Name);
+ else return CBObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CPartEmitter::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "X") == 0) {
+ if (strcmp(name, "X") == 0) {
_posX = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Y") == 0) {
+ else if (strcmp(name, "Y") == 0) {
_posY = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Width") == 0) {
+ else if (strcmp(name, "Width") == 0) {
_width = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Height") == 0) {
+ else if (strcmp(name, "Height") == 0) {
_height = Value->GetInt();
return S_OK;
}
@@ -867,21 +867,21 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Scale1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scale1") == 0) {
+ else if (strcmp(name, "Scale1") == 0) {
_scale1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Scale2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Scale2") == 0) {
+ else if (strcmp(name, "Scale2") == 0) {
_scale2 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ScaleZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ScaleZBased") == 0) {
+ else if (strcmp(name, "ScaleZBased") == 0) {
_scaleZBased = Value->GetBool();
return S_OK;
}
@@ -889,21 +889,21 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Velocity1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Velocity1") == 0) {
+ else if (strcmp(name, "Velocity1") == 0) {
_velocity1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Velocity2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Velocity2") == 0) {
+ else if (strcmp(name, "Velocity2") == 0) {
_velocity2 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// VelocityZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "VelocityZBased") == 0) {
+ else if (strcmp(name, "VelocityZBased") == 0) {
_velocityZBased = Value->GetBool();
return S_OK;
}
@@ -911,21 +911,21 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// LifeTime1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LifeTime1") == 0) {
+ else if (strcmp(name, "LifeTime1") == 0) {
_lifeTime1 = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// LifeTime2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LifeTime2") == 0) {
+ else if (strcmp(name, "LifeTime2") == 0) {
_lifeTime2 = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// LifeTimeZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LifeTimeZBased") == 0) {
+ else if (strcmp(name, "LifeTimeZBased") == 0) {
_lifeTimeZBased = Value->GetBool();
return S_OK;
}
@@ -933,14 +933,14 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Angle1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Angle1") == 0) {
+ else if (strcmp(name, "Angle1") == 0) {
_angle1 = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Angle2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Angle2") == 0) {
+ else if (strcmp(name, "Angle2") == 0) {
_angle2 = Value->GetInt();
return S_OK;
}
@@ -948,14 +948,14 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AngVelocity1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AngVelocity1") == 0) {
+ else if (strcmp(name, "AngVelocity1") == 0) {
_angVelocity1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// AngVelocity2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AngVelocity2") == 0) {
+ else if (strcmp(name, "AngVelocity2") == 0) {
_angVelocity2 = Value->GetFloat();
return S_OK;
}
@@ -963,14 +963,14 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Rotation1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Rotation1") == 0) {
+ else if (strcmp(name, "Rotation1") == 0) {
_rotation1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Rotation2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Rotation2") == 0) {
+ else if (strcmp(name, "Rotation2") == 0) {
_rotation2 = Value->GetFloat();
return S_OK;
}
@@ -978,7 +978,7 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Alpha1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Alpha1") == 0) {
+ else if (strcmp(name, "Alpha1") == 0) {
_alpha1 = Value->GetInt();
if (_alpha1 < 0) _alpha1 = 0;
if (_alpha1 > 255) _alpha1 = 255;
@@ -987,7 +987,7 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Alpha2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Alpha2") == 0) {
+ else if (strcmp(name, "Alpha2") == 0) {
_alpha2 = Value->GetInt();
if (_alpha2 < 0) _alpha2 = 0;
if (_alpha2 > 255) _alpha2 = 255;
@@ -996,7 +996,7 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// AlphaTimeBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AlphaTimeBased") == 0) {
+ else if (strcmp(name, "AlphaTimeBased") == 0) {
_alphaTimeBased = Value->GetBool();
return S_OK;
}
@@ -1004,7 +1004,7 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MaxParticles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MaxParticles") == 0) {
+ else if (strcmp(name, "MaxParticles") == 0) {
_maxParticles = Value->GetInt();
return S_OK;
}
@@ -1012,21 +1012,21 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// GenerationInterval
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GenerationInterval") == 0) {
+ else if (strcmp(name, "GenerationInterval") == 0) {
_genInterval = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GenerationAmount
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GenerationAmount") == 0) {
+ else if (strcmp(name, "GenerationAmount") == 0) {
_genAmount = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// MaxBatches
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MaxBatches") == 0) {
+ else if (strcmp(name, "MaxBatches") == 0) {
_maxBatches = Value->GetInt();
return S_OK;
}
@@ -1034,14 +1034,14 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// FadeInTime
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeInTime") == 0) {
+ else if (strcmp(name, "FadeInTime") == 0) {
_fadeInTime = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// FadeOutTime
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeOutTime") == 0) {
+ else if (strcmp(name, "FadeOutTime") == 0) {
_fadeOutTime = Value->GetInt();
return S_OK;
}
@@ -1049,21 +1049,21 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// GrowthRate1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GrowthRate1") == 0) {
+ else if (strcmp(name, "GrowthRate1") == 0) {
_growthRate1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GrowthRate2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GrowthRate2") == 0) {
+ else if (strcmp(name, "GrowthRate2") == 0) {
_growthRate2 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ExponentialGrowth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ExponentialGrowth") == 0) {
+ else if (strcmp(name, "ExponentialGrowth") == 0) {
_exponentialGrowth = Value->GetBool();
return S_OK;
}
@@ -1071,7 +1071,7 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// UseRegion
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "UseRegion") == 0) {
+ else if (strcmp(name, "UseRegion") == 0) {
_useRegion = Value->GetBool();
return S_OK;
}
@@ -1079,14 +1079,14 @@ HRESULT CPartEmitter::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// EmitEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "EmitEvent") == 0) {
+ else if (strcmp(name, "EmitEvent") == 0) {
delete[] _emitEvent;
_emitEvent = NULL;
if (!Value->IsNULL()) CBUtils::SetString(&_emitEvent, Value->GetString());
return S_OK;
}
- else return CBObject::scSetProperty(Name, Value);
+ else return CBObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Base/PartEmitter.h b/engines/wintermute/Base/PartEmitter.h index 1fd061f95b..b4e751be8f 100644 --- a/engines/wintermute/Base/PartEmitter.h +++ b/engines/wintermute/Base/PartEmitter.h @@ -112,20 +112,20 @@ public: 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;
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
private:
- CPartForce *addForceByName(const char *Name);
+ 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);
diff --git a/engines/wintermute/Base/scriptables/SXArray.cpp b/engines/wintermute/Base/scriptables/SXArray.cpp index b7d69bd2f2..5cabe598a5 100644 --- a/engines/wintermute/Base/scriptables/SXArray.cpp +++ b/engines/wintermute/Base/scriptables/SXArray.cpp @@ -41,19 +41,19 @@ CBScriptable *makeSXArray(CBGame *inGame, CScStack *stack) { }
//////////////////////////////////////////////////////////////////////////
-CSXArray::CSXArray(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
+CSXArray::CSXArray(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
_length = 0;
_values = new CScValue(Game);
- int NumParams = Stack->Pop()->GetInt(0);
+ int NumParams = stack->Pop()->GetInt(0);
- if (NumParams == 1) _length = Stack->Pop()->GetInt(0);
+ if (NumParams == 1) _length = stack->Pop()->GetInt(0);
else if (NumParams > 1) {
_length = NumParams;
char ParamName[20];
for (int i = 0; i < NumParams; i++) {
sprintf(ParamName, "%d", i);
- _values->SetProp(ParamName, Stack->Pop());
+ _values->SetProp(ParamName, stack->Pop());
}
}
}
@@ -93,20 +93,20 @@ const char *CSXArray::scToString() { //////////////////////////////////////////////////////////////////////////
-HRESULT CSXArray::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CSXArray::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// Push
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Push") == 0) {
- int NumParams = Stack->Pop()->GetInt(0);
+ if (strcmp(name, "Push") == 0) {
+ int NumParams = stack->Pop()->GetInt(0);
char ParamName[20];
for (int i = 0; i < NumParams; i++) {
_length++;
sprintf(ParamName, "%d", _length - 1);
- _values->SetProp(ParamName, Stack->Pop(), true);
+ _values->SetProp(ParamName, stack->Pop(), true);
}
- Stack->PushInt(_length);
+ stack->PushInt(_length);
return S_OK;
}
@@ -114,17 +114,17 @@ HRESULT CSXArray::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
// Pop
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Pop") == 0) {
+ if (strcmp(name, "Pop") == 0) {
- Stack->CorrectParams(0);
+ stack->CorrectParams(0);
if (_length > 0) {
char ParamName[20];
sprintf(ParamName, "%d", _length - 1);
- Stack->Push(_values->GetProp(ParamName));
+ stack->Push(_values->GetProp(ParamName));
_values->DeleteProp(ParamName);
_length--;
- } else Stack->PushNULL();
+ } else stack->PushNULL();
return S_OK;
}
@@ -134,13 +134,13 @@ HRESULT CSXArray::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi //////////////////////////////////////////////////////////////////////////
-CScValue *CSXArray::scGetProperty(const char *Name) {
+CScValue *CSXArray::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("array");
return _scValue;
}
@@ -148,7 +148,7 @@ CScValue *CSXArray::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Length") == 0) {
+ else if (strcmp(name, "Length") == 0) {
_scValue->SetInt(_length);
return _scValue;
}
@@ -158,7 +158,7 @@ CScValue *CSXArray::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
else {
char ParamName[20];
- if (ValidNumber(Name, ParamName)) {
+ if (ValidNumber(name, ParamName)) {
return _values->GetProp(ParamName);
} else return _scValue;
}
@@ -166,11 +166,11 @@ CScValue *CSXArray::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
-HRESULT CSXArray::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CSXArray::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Length") == 0) {
+ if (strcmp(name, "Length") == 0) {
int OrigLength = _length;
_length = MAX(Value->GetInt(0), 0);
@@ -189,7 +189,7 @@ HRESULT CSXArray::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
else {
char ParamName[20];
- if (ValidNumber(Name, ParamName)) {
+ if (ValidNumber(name, ParamName)) {
int Index = atoi(ParamName);
if (Index >= _length) _length = Index + 1;
return _values->SetProp(ParamName, Value);
diff --git a/engines/wintermute/Base/scriptables/SXArray.h b/engines/wintermute/Base/scriptables/SXArray.h index 938e020d93..51e0a0047c 100644 --- a/engines/wintermute/Base/scriptables/SXArray.h +++ b/engines/wintermute/Base/scriptables/SXArray.h @@ -41,9 +41,9 @@ public: CSXArray(CBGame *inGame, CScStack *Stack);
CSXArray(CBGame *inGame);
virtual ~CSXArray();
- CScValue *scGetProperty(const char *Name);
- HRESULT scSetProperty(const char *Name, CScValue *Value);
- HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ CScValue *scGetProperty(const char *name);
+ HRESULT scSetProperty(const char *name, CScValue *Value);
+ HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
const char *scToString();
int _length;
CScValue *_values;
diff --git a/engines/wintermute/Base/scriptables/SXDate.cpp b/engines/wintermute/Base/scriptables/SXDate.cpp index 4bb2a3b32a..039a9abe0a 100644 --- a/engines/wintermute/Base/scriptables/SXDate.cpp +++ b/engines/wintermute/Base/scriptables/SXDate.cpp @@ -39,18 +39,18 @@ CBScriptable *makeSXDate(CBGame *inGame, CScStack *stack) { }
//////////////////////////////////////////////////////////////////////////
-CSXDate::CSXDate(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
- Stack->CorrectParams(6);
+CSXDate::CSXDate(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
+ stack->CorrectParams(6);
memset(&_tm, 0, sizeof(_tm));
- CScValue *valYear = Stack->Pop();
+ CScValue *valYear = stack->Pop();
_tm.tm_year = valYear->GetInt() - 1900;
- _tm.tm_mon = Stack->Pop()->GetInt() - 1;
- _tm.tm_mday = Stack->Pop()->GetInt();
- _tm.tm_hour = Stack->Pop()->GetInt();
- _tm.tm_min = Stack->Pop()->GetInt();
- _tm.tm_sec = Stack->Pop()->GetInt();
+ _tm.tm_mon = stack->Pop()->GetInt() - 1;
+ _tm.tm_mday = stack->Pop()->GetInt();
+ _tm.tm_hour = stack->Pop()->GetInt();
+ _tm.tm_min = stack->Pop()->GetInt();
+ _tm.tm_sec = stack->Pop()->GetInt();
if (valYear->IsNULL()) {
g_system->getTimeAndDate(_tm);
@@ -75,62 +75,62 @@ const char *CSXDate::scToString() { //////////////////////////////////////////////////////////////////////////
-HRESULT CSXDate::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetYear
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "GetYear") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_tm.tm_year + 1900);
+ if (strcmp(name, "GetYear") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_tm.tm_year + 1900);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetMonth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetMonth") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_tm.tm_mon + 1);
+ else if (strcmp(name, "GetMonth") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_tm.tm_mon + 1);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetDate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetDate") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_tm.tm_mday);
+ else if (strcmp(name, "GetDate") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_tm.tm_mday);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetHours
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetHours") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_tm.tm_hour);
+ else if (strcmp(name, "GetHours") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_tm.tm_hour);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetMinutes
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetMinutes") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_tm.tm_min);
+ else if (strcmp(name, "GetMinutes") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_tm.tm_min);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetSeconds
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetSeconds") == 0) {
- Stack->CorrectParams(0);
- Stack->PushInt(_tm.tm_sec);
+ else if (strcmp(name, "GetSeconds") == 0) {
+ stack->CorrectParams(0);
+ stack->PushInt(_tm.tm_sec);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GetWeekday
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetWeekday") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GetWeekday") == 0) {
+ stack->CorrectParams(0);
warning("GetWeekday returns a wrong value on purpose");
- Stack->PushInt(_tm.tm_mday % 7);
+ stack->PushInt(_tm.tm_mday % 7);
return S_OK;
}
@@ -138,55 +138,55 @@ HRESULT CSXDate::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// SetYear
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetYear") == 0) {
- Stack->CorrectParams(1);
- _tm.tm_year = Stack->Pop()->GetInt() - 1900;
- Stack->PushNULL();
+ else if (strcmp(name, "SetYear") == 0) {
+ stack->CorrectParams(1);
+ _tm.tm_year = stack->Pop()->GetInt() - 1900;
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetMonth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetMonth") == 0) {
- Stack->CorrectParams(1);
- _tm.tm_mon = Stack->Pop()->GetInt() - 1;
- Stack->PushNULL();
+ else if (strcmp(name, "SetMonth") == 0) {
+ stack->CorrectParams(1);
+ _tm.tm_mon = stack->Pop()->GetInt() - 1;
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetDate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetDate") == 0) {
- Stack->CorrectParams(1);
- _tm.tm_mday = Stack->Pop()->GetInt();
- Stack->PushNULL();
+ else if (strcmp(name, "SetDate") == 0) {
+ stack->CorrectParams(1);
+ _tm.tm_mday = stack->Pop()->GetInt();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetHours
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetHours") == 0) {
- Stack->CorrectParams(1);
- _tm.tm_hour = Stack->Pop()->GetInt();
- Stack->PushNULL();
+ else if (strcmp(name, "SetHours") == 0) {
+ stack->CorrectParams(1);
+ _tm.tm_hour = stack->Pop()->GetInt();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetMinutes
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetMinutes") == 0) {
- Stack->CorrectParams(1);
- _tm.tm_min = Stack->Pop()->GetInt();
- Stack->PushNULL();
+ else if (strcmp(name, "SetMinutes") == 0) {
+ stack->CorrectParams(1);
+ _tm.tm_min = stack->Pop()->GetInt();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetSeconds
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetSeconds") == 0) {
- Stack->CorrectParams(1);
- _tm.tm_sec = Stack->Pop()->GetInt();
- Stack->PushNULL();
+ else if (strcmp(name, "SetSeconds") == 0) {
+ stack->CorrectParams(1);
+ _tm.tm_sec = stack->Pop()->GetInt();
+ stack->PushNULL();
return S_OK;
}
@@ -194,10 +194,10 @@ HRESULT CSXDate::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// SetCurrentTime
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetCurrentTime") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "SetCurrentTime") == 0) {
+ stack->CorrectParams(0);
g_system->getTimeAndDate(_tm);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -207,13 +207,13 @@ HRESULT CSXDate::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
-CScValue *CSXDate::scGetProperty(const char *Name) {
+CScValue *CSXDate::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("date");
return _scValue;
}
@@ -223,12 +223,12 @@ CScValue *CSXDate::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
-HRESULT CSXDate::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CSXDate::scSetProperty(const char *name, CScValue *Value) {
/*
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if(strcmp(Name, "Name")==0){
+ if(strcmp(name, "Name")==0){
setName(Value->GetString());
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/SXDate.h b/engines/wintermute/Base/scriptables/SXDate.h index 28d2590c31..7d658ea826 100644 --- a/engines/wintermute/Base/scriptables/SXDate.h +++ b/engines/wintermute/Base/scriptables/SXDate.h @@ -40,9 +40,9 @@ public: DECLARE_PERSISTENT(CSXDate, CBScriptable)
CSXDate(CBGame *inGame, CScStack *Stack);
virtual ~CSXDate();
- CScValue *scGetProperty(const char *Name);
- HRESULT scSetProperty(const char *Name, CScValue *Value);
- HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ CScValue *scGetProperty(const char *name);
+ HRESULT scSetProperty(const char *name, CScValue *Value);
+ HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
const char *scToString();
char *_string;
TimeDate _tm;
diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp index ec115ca50b..b7eb794e81 100644 --- a/engines/wintermute/Base/scriptables/SXFile.cpp +++ b/engines/wintermute/Base/scriptables/SXFile.cpp @@ -55,9 +55,9 @@ CBScriptable *makeSXFile(CBGame *inGame, CScStack *stack) { }
//////////////////////////////////////////////////////////////////////////
-CSXFile::CSXFile(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+CSXFile::CSXFile(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
_filename = NULL;
if (!Val->IsNULL()) CBUtils::SetString(&_filename, Val->GetString());
@@ -105,38 +105,38 @@ const char *CSXFile::scToString() { #define FILE_BUFFER_SIZE 32768
//////////////////////////////////////////////////////////////////////////
-HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetFilename
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetFilename") == 0) {
- Stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ if (strcmp(name, "SetFilename") == 0) {
+ stack->CorrectParams(1);
+ const char *Filename = stack->Pop()->GetString();
cleanup();
CBUtils::SetString(&_filename, Filename);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// OpenAsText / OpenAsBinary
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "OpenAsText") == 0 || strcmp(Name, "OpenAsBinary") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "OpenAsText") == 0 || strcmp(name, "OpenAsBinary") == 0) {
+ stack->CorrectParams(1);
Close();
- _mode = Stack->Pop()->GetInt(1);
+ _mode = stack->Pop()->GetInt(1);
if (_mode < 1 || _mode > 3) {
- Script->RuntimeError("File.%s: invalid access mode. Setting read mode.", Name);
+ script->RuntimeError("File.%s: invalid access mode. Setting read mode.", name);
_mode = 1;
}
if (_mode == 1) {
_readFile = Game->_fileManager->openFile(_filename);
if (!_readFile) {
- //Script->RuntimeError("File.%s: Error opening file '%s' for reading.", Name, _filename);
+ //script->RuntimeError("File.%s: Error opening file '%s' for reading.", Name, _filename);
Close();
- } else _textMode = strcmp(Name, "OpenAsText") == 0;
+ } else _textMode = strcmp(name, "OpenAsText") == 0;
} else {
- if (strcmp(Name, "OpenAsText") == 0) {
+ if (strcmp(name, "OpenAsText") == 0) {
if (_mode == 2) _writeFile = fopen(_filename, "w+");
else _writeFile = fopen(_filename, "a+");
} else {
@@ -145,13 +145,13 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This }
if (!_writeFile) {
- //Script->RuntimeError("File.%s: Error opening file '%s' for writing.", Name, _filename);
+ //script->RuntimeError("File.%s: Error opening file '%s' for writing.", Name, _filename);
Close();
- } else _textMode = strcmp(Name, "OpenAsText") == 0;
+ } else _textMode = strcmp(name, "OpenAsText") == 0;
}
- if (_readFile || _writeFile) Stack->PushBool(true);
- else Stack->PushBool(false);
+ if (_readFile || _writeFile) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -159,24 +159,24 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// Close
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Close") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Close") == 0) {
+ stack->CorrectParams(0);
Close();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// SetPosition
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetPosition") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetPosition") == 0) {
+ stack->CorrectParams(1);
if (_mode == 0) {
- Script->RuntimeError("File.%s: File is not open", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File is not open", name);
+ stack->PushBool(false);
} else {
- int Pos = Stack->Pop()->GetInt();
- Stack->PushBool(SetPos(Pos));
+ int Pos = stack->Pop()->GetInt();
+ stack->PushBool(SetPos(Pos));
}
return S_OK;
}
@@ -184,34 +184,34 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// Delete
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Delete") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Delete") == 0) {
+ stack->CorrectParams(0);
Close();
- Stack->PushBool(CBPlatform::DeleteFile(_filename) != false);
+ stack->PushBool(CBPlatform::DeleteFile(_filename) != false);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Copy
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Copy") == 0) {
- Stack->CorrectParams(2);
- const char *Dest = Stack->Pop()->GetString();
- bool Overwrite = Stack->Pop()->GetBool(true);
+ else if (strcmp(name, "Copy") == 0) {
+ stack->CorrectParams(2);
+ const char *Dest = stack->Pop()->GetString();
+ bool Overwrite = stack->Pop()->GetBool(true);
Close();
- Stack->PushBool(CBPlatform::CopyFile(_filename, Dest, !Overwrite) != false);
+ stack->PushBool(CBPlatform::CopyFile(_filename, Dest, !Overwrite) != false);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ReadLine
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadLine") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ReadLine") == 0) {
+ stack->CorrectParams(0);
if (!_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open in text mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open in text mode.", name);
+ stack->PushNULL();
return S_OK;
}
uint32 BufSize = FILE_BUFFER_SIZE;
@@ -245,8 +245,8 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This }
Buf[Counter] = '\0';
- if (!FoundNewLine && Counter == 0) Stack->PushNULL();
- else Stack->PushString((char *)Buf);
+ if (!FoundNewLine && Counter == 0) stack->PushNULL();
+ else stack->PushString((char *)Buf);
free(Buf);
@@ -256,13 +256,13 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ReadText
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadText") == 0) {
- Stack->CorrectParams(1);
- int TextLen = Stack->Pop()->GetInt();
+ else if (strcmp(name, "ReadText") == 0) {
+ stack->CorrectParams(1);
+ int TextLen = stack->Pop()->GetInt();
if (!_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open in text mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open in text mode.", name);
+ stack->PushNULL();
return S_OK;
}
uint32 BufSize = FILE_BUFFER_SIZE;
@@ -292,8 +292,8 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This }
Buf[Counter] = '\0';
- if (TextLen > 0 && Counter == 0) Stack->PushNULL();
- else Stack->PushString((char *)Buf);
+ if (TextLen > 0 && Counter == 0) stack->PushNULL();
+ else stack->PushString((char *)Buf);
free(Buf);
@@ -303,20 +303,20 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// WriteLine / WriteText
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WriteLine") == 0 || strcmp(Name, "WriteText") == 0) {
- Stack->CorrectParams(1);
- const char *Line = Stack->Pop()->GetString();
+ else if (strcmp(name, "WriteLine") == 0 || strcmp(name, "WriteText") == 0) {
+ stack->CorrectParams(1);
+ const char *Line = stack->Pop()->GetString();
if (!_textMode || !_writeFile) {
- Script->RuntimeError("File.%s: File must be open for writing in text mode.", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File must be open for writing in text mode.", name);
+ stack->PushBool(false);
return S_OK;
}
- if (strcmp(Name, "WriteLine") == 0)
+ if (strcmp(name, "WriteLine") == 0)
fprintf((FILE *)_writeFile, "%s\n", Line);
else
fprintf((FILE *)_writeFile, "%s", Line);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -325,16 +325,16 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ReadBool
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadBool") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ReadBool") == 0) {
+ stack->CorrectParams(0);
if (_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open for reading in binary mode.", name);
+ stack->PushNULL();
return S_OK;
}
bool Val;
- if (_readFile->read(&Val, sizeof(bool)) == sizeof(bool)) Stack->PushBool(Val);
- else Stack->PushNULL();
+ if (_readFile->read(&Val, sizeof(bool)) == sizeof(bool)) stack->PushBool(Val);
+ else stack->PushNULL();
return S_OK;
}
@@ -342,16 +342,16 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ReadByte
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadByte") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ReadByte") == 0) {
+ stack->CorrectParams(0);
if (_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open for reading in binary mode.", name);
+ stack->PushNULL();
return S_OK;
}
byte Val;
- if (_readFile->read(&Val, sizeof(byte)) == sizeof(byte)) Stack->PushInt(Val);
- else Stack->PushNULL();
+ if (_readFile->read(&Val, sizeof(byte)) == sizeof(byte)) stack->PushInt(Val);
+ else stack->PushNULL();
return S_OK;
}
@@ -359,16 +359,16 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ReadShort
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadShort") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ReadShort") == 0) {
+ stack->CorrectParams(0);
if (_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open for reading in binary mode.", name);
+ stack->PushNULL();
return S_OK;
}
short Val;
- if (_readFile->read(&Val, sizeof(short)) == sizeof(short)) Stack->PushInt(65536 + Val);
- else Stack->PushNULL();
+ if (_readFile->read(&Val, sizeof(short)) == sizeof(short)) stack->PushInt(65536 + Val);
+ else stack->PushNULL();
return S_OK;
}
@@ -376,16 +376,16 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ReadInt / ReadLong
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadInt") == 0 || strcmp(Name, "ReadLong") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ReadInt") == 0 || strcmp(name, "ReadLong") == 0) {
+ stack->CorrectParams(0);
if (_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open for reading in binary mode.", name);
+ stack->PushNULL();
return S_OK;
}
int Val;
- if (_readFile->read(&Val, sizeof(int)) == sizeof(int)) Stack->PushInt(Val);
- else Stack->PushNULL();
+ if (_readFile->read(&Val, sizeof(int)) == sizeof(int)) stack->PushInt(Val);
+ else stack->PushNULL();
return S_OK;
}
@@ -393,16 +393,16 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ReadFloat
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadFloat") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ReadFloat") == 0) {
+ stack->CorrectParams(0);
if (_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open for reading in binary mode.", name);
+ stack->PushNULL();
return S_OK;
}
float Val;
- if (_readFile->read(&Val, sizeof(float)) == sizeof(float)) Stack->PushFloat(Val);
- else Stack->PushNULL();
+ if (_readFile->read(&Val, sizeof(float)) == sizeof(float)) stack->PushFloat(Val);
+ else stack->PushNULL();
return S_OK;
}
@@ -410,16 +410,16 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ReadDouble
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadDouble") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ReadDouble") == 0) {
+ stack->CorrectParams(0);
if (_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open for reading in binary mode.", name);
+ stack->PushNULL();
return S_OK;
}
double Val;
- if (_readFile->read(&Val, sizeof(double)) == sizeof(double)) Stack->PushFloat(Val);
- else Stack->PushNULL();
+ if (_readFile->read(&Val, sizeof(double)) == sizeof(double)) stack->PushFloat(Val);
+ else stack->PushNULL();
return S_OK;
}
@@ -427,11 +427,11 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// ReadString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ReadString") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ReadString") == 0) {
+ stack->CorrectParams(0);
if (_textMode || !_readFile) {
- Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
- Stack->PushNULL();
+ script->RuntimeError("File.%s: File must be open for reading in binary mode.", name);
+ stack->PushNULL();
return S_OK;
}
uint32 Size;
@@ -440,11 +440,11 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This if (Str) {
if (_readFile->read(Str, Size) == Size) {
Str[Size] = '\0';
- Stack->PushString((char *)Str);
+ stack->PushString((char *)Str);
}
delete [] Str;
- } else Stack->PushNULL();
- } else Stack->PushNULL();
+ } else stack->PushNULL();
+ } else stack->PushNULL();
return S_OK;
}
@@ -452,17 +452,17 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// WriteBool
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WriteBool") == 0) {
- Stack->CorrectParams(1);
- bool Val = Stack->Pop()->GetBool();
+ else if (strcmp(name, "WriteBool") == 0) {
+ stack->CorrectParams(1);
+ bool Val = stack->Pop()->GetBool();
if (_textMode || !_writeFile) {
- Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
+ stack->PushBool(false);
return S_OK;
}
fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -470,17 +470,17 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// WriteByte
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WriteByte") == 0) {
- Stack->CorrectParams(1);
- byte Val = Stack->Pop()->GetInt();
+ else if (strcmp(name, "WriteByte") == 0) {
+ stack->CorrectParams(1);
+ byte Val = stack->Pop()->GetInt();
if (_textMode || !_writeFile) {
- Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
+ stack->PushBool(false);
return S_OK;
}
fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -488,17 +488,17 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// WriteShort
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WriteShort") == 0) {
- Stack->CorrectParams(1);
- short Val = Stack->Pop()->GetInt();
+ else if (strcmp(name, "WriteShort") == 0) {
+ stack->CorrectParams(1);
+ short Val = stack->Pop()->GetInt();
if (_textMode || !_writeFile) {
- Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
+ stack->PushBool(false);
return S_OK;
}
fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -506,17 +506,17 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// WriteInt / WriteLong
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WriteInt") == 0 || strcmp(Name, "WriteLong") == 0) {
- Stack->CorrectParams(1);
- int Val = Stack->Pop()->GetInt();
+ else if (strcmp(name, "WriteInt") == 0 || strcmp(name, "WriteLong") == 0) {
+ stack->CorrectParams(1);
+ int Val = stack->Pop()->GetInt();
if (_textMode || !_writeFile) {
- Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
+ stack->PushBool(false);
return S_OK;
}
fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -524,17 +524,17 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// WriteFloat
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WriteFloat") == 0) {
- Stack->CorrectParams(1);
- float Val = Stack->Pop()->GetFloat();
+ else if (strcmp(name, "WriteFloat") == 0) {
+ stack->CorrectParams(1);
+ float Val = stack->Pop()->GetFloat();
if (_textMode || !_writeFile) {
- Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
+ stack->PushBool(false);
return S_OK;
}
fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -542,17 +542,17 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// WriteDouble
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WriteDouble") == 0) {
- Stack->CorrectParams(1);
- double Val = Stack->Pop()->GetFloat();
+ else if (strcmp(name, "WriteDouble") == 0) {
+ stack->CorrectParams(1);
+ double Val = stack->Pop()->GetFloat();
if (_textMode || !_writeFile) {
- Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
+ stack->PushBool(false);
return S_OK;
}
fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -560,13 +560,13 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
// WriteString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "WriteString") == 0) {
- Stack->CorrectParams(1);
- const char *Val = Stack->Pop()->GetString();
+ else if (strcmp(name, "WriteString") == 0) {
+ stack->CorrectParams(1);
+ const char *Val = stack->Pop()->GetString();
if (_textMode || !_writeFile) {
- Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
- Stack->PushBool(false);
+ script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
+ stack->PushBool(false);
return S_OK;
}
@@ -574,24 +574,24 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This fwrite(&Size, sizeof(Size), 1, (FILE *)_writeFile);
fwrite(Val, Size, 1, (FILE *)_writeFile);
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
- else return CBScriptable::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBScriptable::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CSXFile::scGetProperty(const char *Name) {
+CScValue *CSXFile::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("file");
return _scValue;
}
@@ -599,7 +599,7 @@ CScValue *CSXFile::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Filename (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Filename") == 0) {
+ if (strcmp(name, "Filename") == 0) {
_scValue->SetString(_filename);
return _scValue;
}
@@ -607,7 +607,7 @@ CScValue *CSXFile::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Position (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Position") == 0) {
+ else if (strcmp(name, "Position") == 0) {
_scValue->SetInt(GetPos());
return _scValue;
}
@@ -615,7 +615,7 @@ CScValue *CSXFile::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Length (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Length") == 0) {
+ else if (strcmp(name, "Length") == 0) {
_scValue->SetInt(GetLength());
return _scValue;
}
@@ -623,7 +623,7 @@ CScValue *CSXFile::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// TextMode (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TextMode") == 0) {
+ else if (strcmp(name, "TextMode") == 0) {
_scValue->SetBool(_textMode);
return _scValue;
}
@@ -631,22 +631,22 @@ CScValue *CSXFile::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// AccessMode (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "AccessMode") == 0) {
+ else if (strcmp(name, "AccessMode") == 0) {
_scValue->SetInt(_mode);
return _scValue;
}
- else return CBScriptable::scGetProperty(Name);
+ else return CBScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CSXFile::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CSXFile::scSetProperty(const char *name, CScValue *Value) {
/*
//////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
- if(strcmp(Name, "Length")==0){
+ if(strcmp(name, "Length")==0){
int OrigLength = _length;
_length = max(Value->GetInt(0), 0);
@@ -659,7 +659,7 @@ HRESULT CSXFile::scSetProperty(const char *Name, CScValue *Value) { }
return S_OK;
}
- else*/ return CBScriptable::scSetProperty(Name, Value);
+ else*/ return CBScriptable::scSetProperty(name, Value);
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/Base/scriptables/SXFile.h b/engines/wintermute/Base/scriptables/SXFile.h index d3076620c2..39c7f7b954 100644 --- a/engines/wintermute/Base/scriptables/SXFile.h +++ b/engines/wintermute/Base/scriptables/SXFile.h @@ -40,9 +40,9 @@ class CBFile; class CSXFile : public CBScriptable {
public:
DECLARE_PERSISTENT(CSXFile, CBScriptable)
- CScValue *scGetProperty(const char *Name);
- HRESULT scSetProperty(const char *Name, CScValue *Value);
- HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ CScValue *scGetProperty(const char *name);
+ HRESULT scSetProperty(const char *name, CScValue *Value);
+ HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
const char *scToString();
CSXFile(CBGame *inGame, CScStack *Stack);
virtual ~CSXFile();
diff --git a/engines/wintermute/Base/scriptables/SXMath.cpp b/engines/wintermute/Base/scriptables/SXMath.cpp index f6ee46e33b..a9337af1a8 100644 --- a/engines/wintermute/Base/scriptables/SXMath.cpp +++ b/engines/wintermute/Base/scriptables/SXMath.cpp @@ -58,189 +58,189 @@ CSXMath::~CSXMath() { //////////////////////////////////////////////////////////////////////////
-HRESULT CSXMath::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// Abs
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Abs") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(fabs(Stack->Pop()->GetFloat()));
+ if (strcmp(name, "Abs") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(fabs(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Acos
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Acos") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(acos(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Acos") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(acos(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Asin
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Asin") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(asin(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Asin") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(asin(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Atan
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Atan") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(atan(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Atan") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(atan(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Atan2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Atan2") == 0) {
- Stack->CorrectParams(2);
- double y = Stack->Pop()->GetFloat();
- double x = Stack->Pop()->GetFloat();
- Stack->PushFloat(atan2(y, x));
+ else if (strcmp(name, "Atan2") == 0) {
+ stack->CorrectParams(2);
+ double y = stack->Pop()->GetFloat();
+ double x = stack->Pop()->GetFloat();
+ stack->PushFloat(atan2(y, x));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Ceil
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Ceil") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(ceil(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Ceil") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(ceil(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Cos
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Cos") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(cos(DegreeToRadian(Stack->Pop()->GetFloat())));
+ else if (strcmp(name, "Cos") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(cos(DegreeToRadian(stack->Pop()->GetFloat())));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Cosh
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Cosh") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(cosh(DegreeToRadian(Stack->Pop()->GetFloat())));
+ else if (strcmp(name, "Cosh") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(cosh(DegreeToRadian(stack->Pop()->GetFloat())));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Exp
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Exp") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(exp(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Exp") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(exp(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Floor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Floor") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(floor(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Floor") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(floor(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Log
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Log") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(log(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Log") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(log(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Log10
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Log10") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(log10(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Log10") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(log10(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Pow
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Pow") == 0) {
- Stack->CorrectParams(2);
- double x = Stack->Pop()->GetFloat();
- double y = Stack->Pop()->GetFloat();
+ else if (strcmp(name, "Pow") == 0) {
+ stack->CorrectParams(2);
+ double x = stack->Pop()->GetFloat();
+ double y = stack->Pop()->GetFloat();
- Stack->PushFloat(pow(x, y));
+ stack->PushFloat(pow(x, y));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Sin
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Sin") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(sin(DegreeToRadian(Stack->Pop()->GetFloat())));
+ else if (strcmp(name, "Sin") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(sin(DegreeToRadian(stack->Pop()->GetFloat())));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Sinh
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Sinh") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(sinh(DegreeToRadian(Stack->Pop()->GetFloat())));
+ else if (strcmp(name, "Sinh") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(sinh(DegreeToRadian(stack->Pop()->GetFloat())));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Tan
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Tan") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(tan(DegreeToRadian(Stack->Pop()->GetFloat())));
+ else if (strcmp(name, "Tan") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(tan(DegreeToRadian(stack->Pop()->GetFloat())));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Tanh
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Tanh") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(tanh(DegreeToRadian(Stack->Pop()->GetFloat())));
+ else if (strcmp(name, "Tanh") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(tanh(DegreeToRadian(stack->Pop()->GetFloat())));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Sqrt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Sqrt") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(sqrt(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "Sqrt") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(sqrt(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// DegToRad
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DegToRad") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(DegreeToRadian(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "DegToRad") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(DegreeToRadian(stack->Pop()->GetFloat()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// RadToDeg
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "RadToDeg") == 0) {
- Stack->CorrectParams(1);
- Stack->PushFloat(RadianToDegree(Stack->Pop()->GetFloat()));
+ else if (strcmp(name, "RadToDeg") == 0) {
+ stack->CorrectParams(1);
+ stack->PushFloat(RadianToDegree(stack->Pop()->GetFloat()));
return S_OK;
}
@@ -249,13 +249,13 @@ HRESULT CSXMath::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
-CScValue *CSXMath::scGetProperty(const char *Name) {
+CScValue *CSXMath::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("math");
return _scValue;
}
@@ -263,7 +263,7 @@ CScValue *CSXMath::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// PI
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PI") == 0) {
+ else if (strcmp(name, "PI") == 0) {
_scValue->SetFloat(PI);
return _scValue;
}
diff --git a/engines/wintermute/Base/scriptables/SXMath.h b/engines/wintermute/Base/scriptables/SXMath.h index 355bb78890..ac3dc45115 100644 --- a/engines/wintermute/Base/scriptables/SXMath.h +++ b/engines/wintermute/Base/scriptables/SXMath.h @@ -39,8 +39,8 @@ public: DECLARE_PERSISTENT(CSXMath, CBScriptable)
CSXMath(CBGame *inGame);
virtual ~CSXMath();
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
private:
double DegreeToRadian(double Value);
diff --git a/engines/wintermute/Base/scriptables/SXMemBuffer.cpp b/engines/wintermute/Base/scriptables/SXMemBuffer.cpp index 7a128d5899..f65f800a4e 100644 --- a/engines/wintermute/Base/scriptables/SXMemBuffer.cpp +++ b/engines/wintermute/Base/scriptables/SXMemBuffer.cpp @@ -42,12 +42,12 @@ CBScriptable *makeSXMemBuffer(CBGame *inGame, CScStack *stack) { }
//////////////////////////////////////////////////////////////////////////
-CSXMemBuffer::CSXMemBuffer(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
- Stack->CorrectParams(1);
+CSXMemBuffer::CSXMemBuffer(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
+ stack->CorrectParams(1);
_buffer = NULL;
_size = 0;
- int NewSize = Stack->Pop()->GetInt();
+ int NewSize = stack->Pop()->GetInt();
Resize(MAX(0, NewSize));
}
@@ -102,15 +102,15 @@ HRESULT CSXMemBuffer::Resize(int NewSize) { }
//////////////////////////////////////////////////////////////////////////
-bool CSXMemBuffer::CheckBounds(CScScript *Script, int Start, int Length) {
+bool CSXMemBuffer::CheckBounds(CScScript *script, int start, int length) {
if (_buffer == NULL) {
- Script->RuntimeError("Cannot use Set/Get methods on an uninitialized memory buffer");
+ script->RuntimeError("Cannot use Set/Get methods on an uninitialized memory buffer");
return false;
}
if (_size == 0) return true;
- if (Start < 0 || Length == 0 || Start + Length > _size) {
- Script->RuntimeError("Set/Get method call is out of bounds");
+ if (start < 0 || length == 0 || start + length > _size) {
+ script->RuntimeError("Set/Get method call is out of bounds");
return false;
} else return true;
}
@@ -122,16 +122,16 @@ const char *CSXMemBuffer::scToString() { //////////////////////////////////////////////////////////////////////////
-HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetSize
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetSize") == 0) {
- Stack->CorrectParams(1);
- int NewSize = Stack->Pop()->GetInt();
+ if (strcmp(name, "SetSize") == 0) {
+ stack->CorrectParams(1);
+ int NewSize = stack->Pop()->GetInt();
NewSize = MAX(0, NewSize);
- if (SUCCEEDED(Resize(NewSize))) Stack->PushBool(true);
- else Stack->PushBool(false);
+ if (SUCCEEDED(Resize(NewSize))) stack->PushBool(true);
+ else stack->PushBool(false);
return S_OK;
}
@@ -139,11 +139,11 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// GetBool
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetBool") == 0) {
- Stack->CorrectParams(1);
- int Start = Stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(bool))) Stack->PushNULL();
- else Stack->PushBool(*(bool *)((byte *)_buffer + Start));
+ else if (strcmp(name, "GetBool") == 0) {
+ stack->CorrectParams(1);
+ int Start = stack->Pop()->GetInt();
+ if (!CheckBounds(script, Start, sizeof(bool))) stack->PushNULL();
+ else stack->PushBool(*(bool *)((byte *)_buffer + Start));
return S_OK;
}
@@ -151,11 +151,11 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// GetByte
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetByte") == 0) {
- Stack->CorrectParams(1);
- int Start = Stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(byte))) Stack->PushNULL();
- else Stack->PushInt(*(byte *)((byte *)_buffer + Start));
+ else if (strcmp(name, "GetByte") == 0) {
+ stack->CorrectParams(1);
+ int Start = stack->Pop()->GetInt();
+ if (!CheckBounds(script, Start, sizeof(byte))) stack->PushNULL();
+ else stack->PushInt(*(byte *)((byte *)_buffer + Start));
return S_OK;
}
@@ -163,11 +163,11 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// GetShort
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetShort") == 0) {
- Stack->CorrectParams(1);
- int Start = Stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(short))) Stack->PushNULL();
- else Stack->PushInt(65536 + * (short *)((byte *)_buffer + Start));
+ else if (strcmp(name, "GetShort") == 0) {
+ stack->CorrectParams(1);
+ int Start = stack->Pop()->GetInt();
+ if (!CheckBounds(script, Start, sizeof(short))) stack->PushNULL();
+ else stack->PushInt(65536 + * (short *)((byte *)_buffer + Start));
return S_OK;
}
@@ -175,11 +175,11 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// GetInt / GetLong
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetInt") == 0 || strcmp(Name, "GetLong") == 0) {
- Stack->CorrectParams(1);
- int Start = Stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(int))) Stack->PushNULL();
- else Stack->PushInt(*(int *)((byte *)_buffer + Start));
+ else if (strcmp(name, "GetInt") == 0 || strcmp(name, "GetLong") == 0) {
+ stack->CorrectParams(1);
+ int Start = stack->Pop()->GetInt();
+ if (!CheckBounds(script, Start, sizeof(int))) stack->PushNULL();
+ else stack->PushInt(*(int *)((byte *)_buffer + Start));
return S_OK;
}
@@ -187,11 +187,11 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// GetFloat
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetFloat") == 0) {
- Stack->CorrectParams(1);
- int Start = Stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(float))) Stack->PushNULL();
- else Stack->PushFloat(*(float *)((byte *)_buffer + Start));
+ else if (strcmp(name, "GetFloat") == 0) {
+ stack->CorrectParams(1);
+ int Start = stack->Pop()->GetInt();
+ if (!CheckBounds(script, Start, sizeof(float))) stack->PushNULL();
+ else stack->PushFloat(*(float *)((byte *)_buffer + Start));
return S_OK;
}
@@ -199,11 +199,11 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// GetDouble
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetDouble") == 0) {
- Stack->CorrectParams(1);
- int Start = Stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(double))) Stack->PushNULL();
- else Stack->PushFloat(*(double *)((byte *)_buffer + Start));
+ else if (strcmp(name, "GetDouble") == 0) {
+ stack->CorrectParams(1);
+ int Start = stack->Pop()->GetInt();
+ if (!CheckBounds(script, Start, sizeof(double))) stack->PushNULL();
+ else stack->PushFloat(*(double *)((byte *)_buffer + Start));
return S_OK;
}
@@ -211,10 +211,10 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// GetString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetString") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- int Length = Stack->Pop()->GetInt();
+ else if (strcmp(name, "GetString") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ int Length = stack->Pop()->GetInt();
// find end of string
if (Length == 0 && Start >= 0 && Start < _size) {
@@ -226,12 +226,12 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack }
}
- if (!CheckBounds(Script, Start, Length)) Stack->PushNULL();
+ if (!CheckBounds(script, Start, Length)) stack->PushNULL();
else {
char *Str = new char[Length + 1];
strncpy(Str, (const char *)_buffer + Start, Length);
Str[Length] = '\0';
- Stack->PushString(Str);
+ stack->PushString(Str);
delete [] Str;
}
return S_OK;
@@ -240,14 +240,14 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// GetPointer
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetPointer") == 0) {
- Stack->CorrectParams(1);
- int Start = Stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(void *))) Stack->PushNULL();
+ else if (strcmp(name, "GetPointer") == 0) {
+ stack->CorrectParams(1);
+ int Start = stack->Pop()->GetInt();
+ if (!CheckBounds(script, Start, sizeof(void *))) stack->PushNULL();
else {
void *Pointer = *(void **)((byte *)_buffer + Start);
CSXMemBuffer *Buf = new CSXMemBuffer(Game, Pointer);
- Stack->PushNative(Buf, false);
+ stack->PushNative(Buf, false);
}
return S_OK;
}
@@ -255,15 +255,15 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// SetBool
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetBool") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- bool Val = Stack->Pop()->GetBool();
+ else if (strcmp(name, "SetBool") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ bool Val = stack->Pop()->GetBool();
- if (!CheckBounds(Script, Start, sizeof(bool))) Stack->PushBool(false);
+ if (!CheckBounds(script, Start, sizeof(bool))) stack->PushBool(false);
else {
*(bool *)((byte *)_buffer + Start) = Val;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -271,15 +271,15 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// SetByte
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetByte") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- byte Val = (byte)Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetByte") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ byte Val = (byte)stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(byte))) Stack->PushBool(false);
+ if (!CheckBounds(script, Start, sizeof(byte))) stack->PushBool(false);
else {
*(byte *)((byte *)_buffer + Start) = Val;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -287,15 +287,15 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// SetShort
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetShort") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- short Val = (short)Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetShort") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ short Val = (short)stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(short))) Stack->PushBool(false);
+ if (!CheckBounds(script, Start, sizeof(short))) stack->PushBool(false);
else {
*(short *)((byte *)_buffer + Start) = Val;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -303,15 +303,15 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// SetInt / SetLong
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetInt") == 0 || strcmp(Name, "SetLong") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- int Val = Stack->Pop()->GetInt();
+ else if (strcmp(name, "SetInt") == 0 || strcmp(name, "SetLong") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ int Val = stack->Pop()->GetInt();
- if (!CheckBounds(Script, Start, sizeof(int))) Stack->PushBool(false);
+ if (!CheckBounds(script, Start, sizeof(int))) stack->PushBool(false);
else {
*(int *)((byte *)_buffer + Start) = Val;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -319,15 +319,15 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// SetFloat
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetFloat") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- float Val = (float)Stack->Pop()->GetFloat();
+ else if (strcmp(name, "SetFloat") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ float Val = (float)stack->Pop()->GetFloat();
- if (!CheckBounds(Script, Start, sizeof(float))) Stack->PushBool(false);
+ if (!CheckBounds(script, Start, sizeof(float))) stack->PushBool(false);
else {
*(float *)((byte *)_buffer + Start) = Val;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -335,15 +335,15 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// SetDouble
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetDouble") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- double Val = Stack->Pop()->GetFloat();
+ else if (strcmp(name, "SetDouble") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ double Val = stack->Pop()->GetFloat();
- if (!CheckBounds(Script, Start, sizeof(double))) Stack->PushBool(false);
+ if (!CheckBounds(script, Start, sizeof(double))) stack->PushBool(false);
else {
*(double *)((byte *)_buffer + Start) = Val;
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -351,15 +351,15 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// SetString
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetString") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- const char *Val = Stack->Pop()->GetString();
+ else if (strcmp(name, "SetString") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ const char *Val = stack->Pop()->GetString();
- if (!CheckBounds(Script, Start, strlen(Val) + 1)) Stack->PushBool(false);
+ if (!CheckBounds(script, Start, strlen(Val) + 1)) stack->PushBool(false);
else {
memcpy((byte *)_buffer + Start, Val, strlen(Val) + 1);
- Stack->PushBool(true);
+ stack->PushBool(true);
}
return S_OK;
}
@@ -367,20 +367,20 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// SetPointer
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetPointer") == 0) {
- Stack->CorrectParams(2);
- int Start = Stack->Pop()->GetInt();
- /* CScValue *Val = */ Stack->Pop();
+ else if (strcmp(name, "SetPointer") == 0) {
+ stack->CorrectParams(2);
+ int Start = stack->Pop()->GetInt();
+ /* CScValue *Val = */ stack->Pop();
- if (!CheckBounds(Script, Start, sizeof(void *))) Stack->PushBool(false);
+ if (!CheckBounds(script, Start, sizeof(void *))) stack->PushBool(false);
else {
/*
int Pointer = (int)Val->GetMemBuffer();
memcpy((byte *)_buffer+Start, &Pointer, sizeof(void*));
- Stack->PushBool(true);
+ stack->PushBool(true);
*/
// TODO fix
- Stack->PushBool(false);
+ stack->PushBool(false);
}
return S_OK;
@@ -389,8 +389,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
// DEBUG_Dump
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DEBUG_Dump") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "DEBUG_Dump") == 0) {
+ stack->CorrectParams(0);
if (_buffer && _size) {
warning("SXMemBuffer::ScCallMethod - DEBUG_Dump");
Common::DumpFile f;
@@ -398,7 +398,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack f.write(_buffer, _size);
f.close();
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -407,13 +407,13 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *Script, CScStack *Stack, CScStack //////////////////////////////////////////////////////////////////////////
-CScValue *CSXMemBuffer::scGetProperty(const char *Name) {
+CScValue *CSXMemBuffer::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("membuffer");
return _scValue;
}
@@ -421,22 +421,22 @@ CScValue *CSXMemBuffer::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Size (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Size") == 0) {
+ if (strcmp(name, "Size") == 0) {
_scValue->SetInt(_size);
return _scValue;
}
- else return CBScriptable::scGetProperty(Name);
+ else return CBScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CSXMemBuffer::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CSXMemBuffer::scSetProperty(const char *name, CScValue *Value) {
/*
//////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
- if(strcmp(Name, "Length")==0){
+ if(strcmp(name, "Length")==0){
int OrigLength = _length;
_length = max(Value->GetInt(0), 0);
@@ -449,7 +449,7 @@ HRESULT CSXMemBuffer::scSetProperty(const char *Name, CScValue *Value) { }
return S_OK;
}
- else*/ return CBScriptable::scSetProperty(Name, Value);
+ else*/ return CBScriptable::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/Base/scriptables/SXMemBuffer.h b/engines/wintermute/Base/scriptables/SXMemBuffer.h index a14f09bfd6..ba62162cc4 100644 --- a/engines/wintermute/Base/scriptables/SXMemBuffer.h +++ b/engines/wintermute/Base/scriptables/SXMemBuffer.h @@ -38,9 +38,9 @@ class CSXMemBuffer : public CBScriptable { public:
virtual int scCompare(CBScriptable *Val);
DECLARE_PERSISTENT(CSXMemBuffer, CBScriptable)
- CScValue *scGetProperty(const char *Name);
- HRESULT scSetProperty(const char *Name, CScValue *Value);
- HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ CScValue *scGetProperty(const char *name);
+ HRESULT scSetProperty(const char *name, CScValue *Value);
+ HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
const char *scToString();
CSXMemBuffer(CBGame *inGame, CScStack *Stack);
CSXMemBuffer(CBGame *inGame, void *Buffer);
diff --git a/engines/wintermute/Base/scriptables/SXStore.h b/engines/wintermute/Base/scriptables/SXStore.h index bb7f0eeb42..3c39b3f266 100644 --- a/engines/wintermute/Base/scriptables/SXStore.h +++ b/engines/wintermute/Base/scriptables/SXStore.h @@ -129,8 +129,8 @@ public: DECLARE_PERSISTENT(CSXStore, CBObject)
CSXStore(CBGame *inGame);
virtual ~CSXStore();
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
void afterLoad();
void OnObjectDestroyed(CBScriptHolder *obj);
diff --git a/engines/wintermute/Base/scriptables/SXString.cpp b/engines/wintermute/Base/scriptables/SXString.cpp index 35343d095a..4db6ad413c 100644 --- a/engines/wintermute/Base/scriptables/SXString.cpp +++ b/engines/wintermute/Base/scriptables/SXString.cpp @@ -44,12 +44,12 @@ CBScriptable *makeSXString(CBGame *inGame, CScStack *stack) { }
//////////////////////////////////////////////////////////////////////////
-CSXString::CSXString(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
+CSXString::CSXString(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
_string = NULL;
_capacity = 0;
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (Val->IsInt()) {
_capacity = MAX(0, Val->GetInt());
@@ -99,14 +99,14 @@ void CSXString::scSetString(const char *Val) { //////////////////////////////////////////////////////////////////////////
-HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// Substring
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Substring") == 0) {
- Stack->CorrectParams(2);
- int start = Stack->Pop()->GetInt();
- int end = Stack->Pop()->GetInt();
+ if (strcmp(name, "Substring") == 0) {
+ stack->CorrectParams(2);
+ int start = stack->Pop()->GetInt();
+ int end = stack->Pop()->GetInt();
if (end < start) CBUtils::Swap(&start, &end);
@@ -121,11 +121,11 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th WideString subStr(str.c_str() + start, end - start + 1);
if (Game->_textEncoding == TEXT_UTF8)
- Stack->PushString(StringUtil::WideToUtf8(subStr).c_str());
+ stack->PushString(StringUtil::WideToUtf8(subStr).c_str());
else
- Stack->PushString(StringUtil::WideToAnsi(subStr).c_str());
+ stack->PushString(StringUtil::WideToAnsi(subStr).c_str());
// } catch (std::exception &) {
- // Stack->PushNULL();
+ // stack->PushNULL();
// }
return S_OK;
@@ -134,15 +134,15 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// Substr
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Substr") == 0) {
- Stack->CorrectParams(2);
- int start = Stack->Pop()->GetInt();
+ else if (strcmp(name, "Substr") == 0) {
+ stack->CorrectParams(2);
+ int start = stack->Pop()->GetInt();
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
int len = val->GetInt();
if (!val->IsNULL() && len <= 0) {
- Stack->PushString("");
+ stack->PushString("");
return S_OK;
}
@@ -159,11 +159,11 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th WideString subStr(str.c_str() + start, len);
if (Game->_textEncoding == TEXT_UTF8)
- Stack->PushString(StringUtil::WideToUtf8(subStr).c_str());
+ stack->PushString(StringUtil::WideToUtf8(subStr).c_str());
else
- Stack->PushString(StringUtil::WideToAnsi(subStr).c_str());
+ stack->PushString(StringUtil::WideToAnsi(subStr).c_str());
// } catch (std::exception &) {
-// Stack->PushNULL();
+// stack->PushNULL();
// }
return S_OK;
@@ -172,8 +172,8 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// ToUpperCase
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ToUpperCase") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ToUpperCase") == 0) {
+ stack->CorrectParams(0);
WideString str;
if (Game->_textEncoding == TEXT_UTF8)
@@ -184,9 +184,9 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th StringUtil::ToUpperCase(str);
if (Game->_textEncoding == TEXT_UTF8)
- Stack->PushString(StringUtil::WideToUtf8(str).c_str());
+ stack->PushString(StringUtil::WideToUtf8(str).c_str());
else
- Stack->PushString(StringUtil::WideToAnsi(str).c_str());
+ stack->PushString(StringUtil::WideToAnsi(str).c_str());
return S_OK;
}
@@ -194,8 +194,8 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// ToLowerCase
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ToLowerCase") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "ToLowerCase") == 0) {
+ stack->CorrectParams(0);
WideString str;
if (Game->_textEncoding == TEXT_UTF8)
@@ -206,9 +206,9 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th StringUtil::ToLowerCase(str);
if (Game->_textEncoding == TEXT_UTF8)
- Stack->PushString(StringUtil::WideToUtf8(str).c_str());
+ stack->PushString(StringUtil::WideToUtf8(str).c_str());
else
- Stack->PushString(StringUtil::WideToAnsi(str).c_str());
+ stack->PushString(StringUtil::WideToAnsi(str).c_str());
return S_OK;
}
@@ -216,11 +216,11 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// IndexOf
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "IndexOf") == 0) {
- Stack->CorrectParams(2);
+ else if (strcmp(name, "IndexOf") == 0) {
+ stack->CorrectParams(2);
- const char *strToFind = Stack->Pop()->GetString();
- int index = Stack->Pop()->GetInt();
+ const char *strToFind = stack->Pop()->GetString();
+ int index = stack->Pop()->GetInt();
WideString str;
if (Game->_textEncoding == TEXT_UTF8)
@@ -235,7 +235,7 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th toFind = StringUtil::AnsiToWide(strToFind);
int indexOf = StringUtil::IndexOf(str, toFind, index);
- Stack->PushInt(indexOf);
+ stack->PushInt(indexOf);
return S_OK;
}
@@ -243,15 +243,15 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// Split
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Split") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "Split") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
char Separators[MAX_PATH] = ",";
if (!Val->IsNULL()) strcpy(Separators, Val->GetString());
CSXArray *Array = new CSXArray(Game);
if (!Array) {
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
@@ -308,7 +308,7 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th Val = NULL;
}
- Stack->PushNative(Array, false);
+ stack->PushNative(Array, false);
return S_OK;
}
@@ -317,20 +317,20 @@ HRESULT CSXString::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
-CScValue *CSXString::scGetProperty(const char *Name) {
+CScValue *CSXString::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("string");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Length (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Length") == 0) {
+ else if (strcmp(name, "Length") == 0) {
if (Game->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::Utf8ToWide(_string);
_scValue->SetInt(wstr.size());
@@ -342,7 +342,7 @@ CScValue *CSXString::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Capacity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Capacity") == 0) {
+ else if (strcmp(name, "Capacity") == 0) {
_scValue->SetInt(_capacity);
return _scValue;
}
@@ -352,11 +352,11 @@ CScValue *CSXString::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
-HRESULT CSXString::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CSXString::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Capacity
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Capacity") == 0) {
+ if (strcmp(name, "Capacity") == 0) {
int NewCap = Value->GetInt();
if (NewCap < strlen(_string) + 1) Game->LOG(0, "Warning: cannot lower string capacity");
else if (NewCap != _capacity) {
diff --git a/engines/wintermute/Base/scriptables/SXString.h b/engines/wintermute/Base/scriptables/SXString.h index 1adc0cad1e..5f662c3289 100644 --- a/engines/wintermute/Base/scriptables/SXString.h +++ b/engines/wintermute/Base/scriptables/SXString.h @@ -38,9 +38,9 @@ class CSXString : public CBScriptable { public:
virtual int scCompare(CBScriptable *Val);
DECLARE_PERSISTENT(CSXString, CBScriptable)
- CScValue *scGetProperty(const char *Name);
- HRESULT scSetProperty(const char *Name, CScValue *Value);
- HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ CScValue *scGetProperty(const char *name);
+ HRESULT scSetProperty(const char *name, CScValue *Value);
+ HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
void scSetString(const char *Val);
const char *scToString();
void SetStringVal(const char *Val);
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp index 6ec70a561a..9c443df509 100644 --- a/engines/wintermute/Base/scriptables/ScEngine.cpp +++ b/engines/wintermute/Base/scriptables/ScEngine.cpp @@ -559,10 +559,10 @@ HRESULT CScEngine::ResetObject(CBObject *Object) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CScEngine::ResetScript(CScScript *Script) {
+HRESULT CScEngine::ResetScript(CScScript *script) {
// terminate all scripts waiting for this script
for (int i = 0; i < _scripts.GetSize(); i++) {
- if (_scripts[i]->_state == SCRIPT_WAITING_SCRIPT && _scripts[i]->_waitScript == Script) {
+ if (_scripts[i]->_state == SCRIPT_WAITING_SCRIPT && _scripts[i]->_waitScript == script) {
_scripts[i]->finish();
}
}
@@ -639,9 +639,9 @@ void CScEngine::SetParseElementCallback(PARSE_ELEMENT_CALLBACK Callback, void *D //////////////////////////////////////////////////////////////////////////
-bool CScEngine::IsValidScript(CScScript *Script) {
+bool CScEngine::IsValidScript(CScScript *script) {
for (int i = 0; i < _scripts.GetSize(); i++) {
- if (_scripts[i] == Script) return true;
+ if (_scripts[i] == script) return true;
}
return false;
}
@@ -735,18 +735,18 @@ HRESULT CScEngine::RefreshScriptBreakpoints() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CScEngine::RefreshScriptBreakpoints(CScScript *Script) {
+HRESULT CScEngine::RefreshScriptBreakpoints(CScScript *script) {
if (!Game->GetDebugMgr()->_enabled) return S_OK;
- if (!Script || !Script->_filename) return E_FAIL;
+ if (!script || !script->_filename) return E_FAIL;
for (int i = 0; i < _breakpoints.GetSize(); i++) {
- if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), Script->_filename) == 0) {
- Script->_breakpoints.Copy(_breakpoints[i]->_lines);
+ if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), script->_filename) == 0) {
+ script->_breakpoints.Copy(_breakpoints[i]->_lines);
return S_OK;
}
}
- if (Script->_breakpoints.GetSize() > 0) Script->_breakpoints.RemoveAll();
+ if (script->_breakpoints.GetSize() > 0) script->_breakpoints.RemoveAll();
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/ScEngine.h b/engines/wintermute/Base/scriptables/ScEngine.h index c7fb8eb3a8..703034964e 100644 --- a/engines/wintermute/Base/scriptables/ScEngine.h +++ b/engines/wintermute/Base/scriptables/ScEngine.h @@ -42,8 +42,8 @@ typedef byte *(*DLL_COMPILE_BUFFER)(byte *Buffer, char *Source, uint32 BufferSi typedef byte *(*DLL_COMPILE_FILE)(char *Filename, uint32 *CompiledSize);
typedef void (*DLL_RELEASE_BUFFER)(unsigned char *Buffer);
typedef void (*DLL_SET_CALLBACKS)(CALLBACKS *callbacks, void *Data);
-typedef int (*DLL_DEFINE_FUNCTION)(const char *Name); /* Was non-const, changed to silence warnings */
-typedef int (*DLL_DEFINE_VARIABLE)(const char *Name); /* Was non-const, changed to silence warnings */
+typedef int (*DLL_DEFINE_FUNCTION)(const char *name); /* Was non-const, changed to silence warnings */
+typedef int (*DLL_DEFINE_VARIABLE)(const char *name); /* Was non-const, changed to silence warnings */
typedef void (*COMPILE_ERROR_CALLBACK)(int Line, char *Text , void *Data);
typedef void (*PARSE_ELEMENT_CALLBACK)(int Line, int Type, void *ElementData, void *Data);
@@ -99,14 +99,14 @@ public: HRESULT AddBreakpoint(const char *ScriptFilename, int Line);
HRESULT RemoveBreakpoint(const char *ScriptFilename, int Line);
HRESULT RefreshScriptBreakpoints();
- HRESULT RefreshScriptBreakpoints(CScScript *Script);
+ HRESULT RefreshScriptBreakpoints(CScScript *script);
HRESULT SaveBreakpoints();
HRESULT LoadBreakpoints();
HRESULT ClearGlobals(bool IncludingNatives = false);
HRESULT TickUnbreakable();
HRESULT RemoveFinishedScripts();
- bool IsValidScript(CScScript *Script);
+ bool IsValidScript(CScScript *script);
void SetCompileErrorCallback(COMPILE_ERROR_CALLBACK Callback, void *Data);
void SetParseElementCallback(PARSE_ELEMENT_CALLBACK Callback, void *Data);
@@ -123,7 +123,7 @@ public: HRESULT PauseAll();
void editorCleanup();
HRESULT ResetObject(CBObject *Object);
- HRESULT ResetScript(CScScript *Script);
+ HRESULT ResetScript(CScScript *script);
HRESULT EmptyScriptCache();
byte *GetCompiledScript(const char *Filename, uint32 *OutSize, bool IgnoreCache = false);
DECLARE_PERSISTENT(CScEngine, CBBase)
diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp index 01827b378e..6e43ac6e0d 100644 --- a/engines/wintermute/Base/scriptables/ScScript.cpp +++ b/engines/wintermute/Base/scriptables/ScScript.cpp @@ -1054,53 +1054,53 @@ HRESULT CScScript::ExecuteInstruction() { //////////////////////////////////////////////////////////////////////////
-uint32 CScScript::GetFuncPos(const char *Name) {
+uint32 CScScript::GetFuncPos(const char *name) {
for (int i = 0; i < _numFunctions; i++) {
- if (strcmp(Name, _functions[i].name) == 0) return _functions[i].pos;
+ if (strcmp(name, _functions[i].name) == 0) return _functions[i].pos;
}
return 0;
}
//////////////////////////////////////////////////////////////////////////
-uint32 CScScript::GetMethodPos(const char *Name) {
+uint32 CScScript::GetMethodPos(const char *name) {
for (int i = 0; i < _numMethods; i++) {
- if (strcmp(Name, _methods[i].name) == 0) return _methods[i].pos;
+ if (strcmp(name, _methods[i].name) == 0) return _methods[i].pos;
}
return 0;
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CScScript::GetVar(char *Name) {
+CScValue *CScScript::GetVar(char *name) {
CScValue *ret = NULL;
// scope locals
if (_scopeStack->_sP >= 0) {
- if (_scopeStack->GetTop()->PropExists(Name)) ret = _scopeStack->GetTop()->GetProp(Name);
+ if (_scopeStack->GetTop()->PropExists(name)) ret = _scopeStack->GetTop()->GetProp(name);
}
// script globals
if (ret == NULL) {
- if (_globals->PropExists(Name)) ret = _globals->GetProp(Name);
+ if (_globals->PropExists(name)) ret = _globals->GetProp(name);
}
// engine globals
if (ret == NULL) {
- if (_engine->_globals->PropExists(Name)) ret = _engine->_globals->GetProp(Name);
+ if (_engine->_globals->PropExists(name)) ret = _engine->_globals->GetProp(name);
}
if (ret == NULL) {
- //RuntimeError("Variable '%s' is inaccessible in the current block. Consider changing the script.", Name);
- Game->LOG(0, "Warning: variable '%s' is inaccessible in the current block. Consider changing the script (script:%s, line:%d)", Name, _filename, _currentLine);
+ //RuntimeError("Variable '%s' is inaccessible in the current block. Consider changing the script.", name);
+ Game->LOG(0, "Warning: variable '%s' is inaccessible in the current block. Consider changing the script (script:%s, line:%d)", name, _filename, _currentLine);
CScValue *Val = new CScValue(Game);
CScValue *Scope = _scopeStack->GetTop();
if (Scope) {
- Scope->SetProp(Name, Val);
- ret = _scopeStack->GetTop()->GetProp(Name);
+ Scope->SetProp(name, Val);
+ ret = _scopeStack->GetTop()->GetProp(name);
} else {
- _globals->SetProp(Name, Val);
- ret = _globals->GetProp(Name);
+ _globals->SetProp(name, Val);
+ ret = _globals->GetProp(name);
}
delete Val;
}
@@ -1271,9 +1271,9 @@ CScScript *CScScript::InvokeEventHandler(const char *EventName, bool Unbreakable //////////////////////////////////////////////////////////////////////////
-uint32 CScScript::GetEventPos(const char *Name) {
+uint32 CScScript::GetEventPos(const char *name) {
for (int i = _numEvents - 1; i >= 0; i--) {
- if (scumm_stricmp(Name, _events[i].name) == 0) return _events[i].pos;
+ if (scumm_stricmp(name, _events[i].name) == 0) return _events[i].pos;
}
return 0;
}
@@ -1317,22 +1317,22 @@ HRESULT CScScript::Resume() { //////////////////////////////////////////////////////////////////////////
-CScScript::TExternalFunction *CScScript::GetExternal(char *Name) {
+CScScript::TExternalFunction *CScScript::GetExternal(char *name) {
for (int i = 0; i < _numExternals; i++) {
- if (strcmp(Name, _externals[i].name) == 0) return &_externals[i];
+ if (strcmp(name, _externals[i].name) == 0) return &_externals[i];
}
return NULL;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CScScript::ExternalCall(CScStack *Stack, CScStack *ThisStack, CScScript::TExternalFunction *Function) {
+HRESULT CScScript::ExternalCall(CScStack *stack, CScStack *thisStack, CScScript::TExternalFunction *Function) {
#ifndef __WIN32__
Game->LOG(0, "External functions are not supported on this platform.");
- Stack->CorrectParams(0);
- Stack->PushNULL();
+ stack->CorrectParams(0);
+ stack->PushNULL();
return E_FAIL;
#else
@@ -1345,11 +1345,11 @@ HRESULT CScScript::ExternalCall(CScStack *Stack, CScStack *ThisStack, CScScript: if (pFunc) {
int i;
Success = true;
- Stack->CorrectParams(Function->nu_params);
+ stack->CorrectParams(Function->nu_params);
CBDynBuffer *Buffer = new CBDynBuffer(Game, 20 * sizeof(uint32));
for (i = 0; i < Function->nu_params; i++) {
- CScValue *Val = Stack->Pop();
+ CScValue *Val = stack->Pop();
switch (Function->params[i]) {
case TYPE_BOOL:
Buffer->PutDWORD((uint32)Val->GetBool());
@@ -1399,34 +1399,34 @@ HRESULT CScScript::ExternalCall(CScStack *Stack, CScStack *ThisStack, CScScript: // return
switch (Function->returns) {
case TYPE_BOOL:
- Stack->PushBool((byte)ret != 0);
+ stack->PushBool((byte)ret != 0);
break;
case TYPE_LONG:
- Stack->PushInt(ret);
+ stack->PushInt(ret);
break;
case TYPE_BYTE:
- Stack->PushInt((byte)ret);
+ stack->PushInt((byte)ret);
break;
break;
case TYPE_STRING:
- Stack->PushString((char *)ret);
+ stack->PushString((char *)ret);
break;
case TYPE_MEMBUFFER: {
CSXMemBuffer *Buf = new CSXMemBuffer(Game, (void *)ret);
- Stack->PushNative(Buf, false);
+ stack->PushNative(Buf, false);
}
break;
case TYPE_FLOAT: {
uint32 dw = GetST0();
- Stack->PushFloat(*((float *)&dw));
+ stack->PushFloat(*((float *)&dw));
break;
}
case TYPE_DOUBLE:
- Stack->PushFloat(GetST0Double());
+ stack->PushFloat(GetST0Double());
break;
default:
- Stack->PushNULL();
+ stack->PushNULL();
}
if (StackCorrupted) RuntimeError("Warning: Stack corrupted after calling '%s' in '%s'\n Check parameters and/or calling convention.", Function->name, Function->dll_name);
@@ -1434,8 +1434,8 @@ HRESULT CScScript::ExternalCall(CScStack *Stack, CScStack *ThisStack, CScScript: } else RuntimeError("Error loading DLL '%s'", Function->dll_name);
if (!Success) {
- Stack->CorrectParams(0);
- Stack->PushNULL();
+ stack->CorrectParams(0);
+ stack->PushNULL();
}
if (hDll) FreeLibrary(hDll);
@@ -1525,15 +1525,15 @@ double CScScript::GetST0Double(void) { //////////////////////////////////////////////////////////////////////////
-HRESULT CScScript::CopyParameters(CScStack *Stack) {
+HRESULT CScScript::CopyParameters(CScStack *stack) {
int i;
- int NumParams = Stack->Pop()->GetInt();
+ int NumParams = stack->Pop()->GetInt();
for (i = NumParams - 1; i >= 0; i--) {
- _stack->Push(Stack->GetAt(i));
+ _stack->Push(stack->GetAt(i));
}
_stack->PushInt(NumParams);
- for (i = 0; i < NumParams; i++) Stack->Pop();
+ for (i = 0; i < NumParams; i++) stack->Pop();
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/ScScript.h b/engines/wintermute/Base/scriptables/ScScript.h index 4f6cc50332..308c6d9a86 100644 --- a/engines/wintermute/Base/scriptables/ScScript.h +++ b/engines/wintermute/Base/scriptables/ScScript.h @@ -52,7 +52,7 @@ public: CScScript *_parentScript;
bool _unbreakable;
HRESULT FinishThreads();
- HRESULT CopyParameters(CScStack *Stack);
+ HRESULT CopyParameters(CScStack *stack);
void afterLoad();
@@ -87,10 +87,10 @@ public: CScScript *_waitScript;
TScriptState _state;
TScriptState _origState;
- CScValue *GetVar(char *Name);
- uint32 GetFuncPos(const char *Name);
- uint32 GetEventPos(const char *Name);
- uint32 GetMethodPos(const char *Name);
+ CScValue *GetVar(char *name);
+ uint32 GetFuncPos(const char *name);
+ uint32 GetEventPos(const char *name);
+ uint32 GetMethodPos(const char *name);
typedef struct {
uint32 magic;
uint32 version;
@@ -166,7 +166,7 @@ public: bool _methodThread;
char *_threadEvent;
CBScriptHolder *_owner;
- CScScript::TExternalFunction *GetExternal(char *Name);
+ CScScript::TExternalFunction *GetExternal(char *name);
HRESULT ExternalCall(CScStack *Stack, CScStack *ThisStack, CScScript::TExternalFunction *Function);
private:
HRESULT InitScript();
diff --git a/engines/wintermute/Base/scriptables/ScValue.cpp b/engines/wintermute/Base/scriptables/ScValue.cpp index eab345f393..8409de7b96 100644 --- a/engines/wintermute/Base/scriptables/ScValue.cpp +++ b/engines/wintermute/Base/scriptables/ScValue.cpp @@ -156,10 +156,10 @@ CScValue::~CScValue() { //////////////////////////////////////////////////////////////////////////
-CScValue *CScValue::GetProp(const char *Name) {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetProp(Name);
+CScValue *CScValue::GetProp(const char *name) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetProp(name);
- if (_type == VAL_STRING && strcmp(Name, "Length") == 0) {
+ if (_type == VAL_STRING && strcmp(name, "Length") == 0) {
Game->_scValue->_type = VAL_INT;
#if 0 // TODO: Remove FreeType-dependency
@@ -178,20 +178,20 @@ CScValue *CScValue::GetProp(const char *Name) { CScValue *ret = NULL;
- if (_type == VAL_NATIVE && _valNative) ret = _valNative->scGetProperty(Name);
+ if (_type == VAL_NATIVE && _valNative) ret = _valNative->scGetProperty(name);
if (ret == NULL) {
- _valIter = _valObject.find(Name);
+ _valIter = _valObject.find(name);
if (_valIter != _valObject.end()) ret = _valIter->_value;
}
return ret;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CScValue::DeleteProp(const char *Name) {
- if (_type == VAL_VARIABLE_REF) return _valRef->DeleteProp(Name);
+HRESULT CScValue::DeleteProp(const char *name) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->DeleteProp(name);
- _valIter = _valObject.find(Name);
+ _valIter = _valObject.find(name);
if (_valIter != _valObject.end()) {
delete _valIter->_value;
_valIter->_value = NULL;
@@ -203,18 +203,18 @@ HRESULT CScValue::DeleteProp(const char *Name) { //////////////////////////////////////////////////////////////////////////
-HRESULT CScValue::SetProp(const char *Name, CScValue *Val, bool CopyWhole, bool SetAsConst) {
- if (_type == VAL_VARIABLE_REF) return _valRef->SetProp(Name, Val);
+HRESULT CScValue::SetProp(const char *name, CScValue *Val, bool CopyWhole, bool SetAsConst) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->SetProp(name, Val);
HRESULT ret = E_FAIL;
if (_type == VAL_NATIVE && _valNative) {
- ret = _valNative->scSetProperty(Name, Val);
+ ret = _valNative->scSetProperty(name, Val);
}
if (FAILED(ret)) {
CScValue *val = NULL;
- _valIter = _valObject.find(Name);
+ _valIter = _valObject.find(name);
if (_valIter != _valObject.end()) {
val = _valIter->_value;
}
@@ -223,7 +223,7 @@ HRESULT CScValue::SetProp(const char *Name, CScValue *Val, bool CopyWhole, bool val->Copy(Val, CopyWhole);
val->_isConstVar = SetAsConst;
- _valObject[Name] = val;
+ _valObject[name] = val;
if (_type != VAL_NATIVE) _type = VAL_OBJECT;
@@ -247,9 +247,9 @@ HRESULT CScValue::SetProp(const char *Name, CScValue *Val, bool CopyWhole, bool //////////////////////////////////////////////////////////////////////////
-bool CScValue::PropExists(const char *Name) {
- if (_type == VAL_VARIABLE_REF) return _valRef->PropExists(Name);
- _valIter = _valObject.find(Name);
+bool CScValue::PropExists(const char *name) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->PropExists(name);
+ _valIter = _valObject.find(name);
return (_valIter != _valObject.end());
}
@@ -861,10 +861,10 @@ int CScValue::CompareStrict(CScValue *Val1, CScValue *Val2) { //////////////////////////////////////////////////////////////////////////
-HRESULT CScValue::DbgSendVariables(IWmeDebugClient *Client, EWmeDebuggerVariableType Type, CScScript *Script, unsigned int ScopeID) {
+HRESULT CScValue::DbgSendVariables(IWmeDebugClient *Client, EWmeDebuggerVariableType Type, CScScript *script, unsigned int ScopeID) {
_valIter = _valObject.begin();
while (_valIter != _valObject.end()) {
- Client->OnVariableInit(Type, Script, ScopeID, _valIter->_value, _valIter->_key.c_str());
+ Client->OnVariableInit(Type, script, ScopeID, _valIter->_value, _valIter->_key.c_str());
_valIter++;
}
return S_OK;
diff --git a/engines/wintermute/Base/scriptables/ScValue.h b/engines/wintermute/Base/scriptables/ScValue.h index 6ee0981020..90c783c9ce 100644 --- a/engines/wintermute/Base/scriptables/ScValue.h +++ b/engines/wintermute/Base/scriptables/ScValue.h @@ -43,7 +43,7 @@ class CBScriptable; class CScValue : public CBBase, public IWmeDebugProp {
public:
- HRESULT DbgSendVariables(IWmeDebugClient *Client, EWmeDebuggerVariableType Type, CScScript *Script, unsigned int ScopeID);
+ HRESULT DbgSendVariables(IWmeDebugClient *Client, EWmeDebuggerVariableType Type, CScScript *script, unsigned int ScopeID);
static int Compare(CScValue *Val1, CScValue *Val2);
static int CompareStrict(CScValue *Val1, CScValue *Val2);
@@ -55,7 +55,7 @@ public: HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
void SetValue(CScValue *Val);
bool _persistent;
- bool PropExists(const char *Name);
+ bool PropExists(const char *name);
void Copy(CScValue *orig, bool CopyWhole = false);
void SetStringVal(const char *Val);
TValType GetType();
@@ -65,7 +65,7 @@ public: const char *GetString();
void *GetMemBuffer();
CBScriptable *GetNative();
- HRESULT DeleteProp(const char *Name);
+ HRESULT DeleteProp(const char *name);
void DeleteProps();
void CleanProps(bool IncludingNatives);
void SetBool(bool Val);
@@ -84,8 +84,8 @@ public: bool IsFloat();
bool IsInt();
bool IsObject();
- HRESULT SetProp(const char *Name, CScValue *Val, bool CopyWhole = false, bool SetAsConst = false);
- CScValue *GetProp(const char *Name);
+ HRESULT SetProp(const char *name, CScValue *Val, bool CopyWhole = false, bool SetAsConst = false);
+ CScValue *GetProp(const char *name);
CBScriptable *_valNative;
CScValue *_valRef;
protected:
diff --git a/engines/wintermute/Base/scriptables/SxObject.cpp b/engines/wintermute/Base/scriptables/SxObject.cpp index d991085792..ff51134321 100644 --- a/engines/wintermute/Base/scriptables/SxObject.cpp +++ b/engines/wintermute/Base/scriptables/SxObject.cpp @@ -43,10 +43,10 @@ CBScriptable *makeSXObject(CBGame *inGame, CScStack *stack) { }
//////////////////////////////////////////////////////////////////////////
-CSXObject::CSXObject(CBGame *inGame, CScStack *Stack): CBObject(inGame) {
- int NumParams = Stack->Pop()->GetInt(0);
+CSXObject::CSXObject(CBGame *inGame, CScStack *stack): CBObject(inGame) {
+ int NumParams = stack->Pop()->GetInt(0);
for (int i = 0; i < NumParams; i++) {
- addScript(Stack->Pop()->GetString());
+ addScript(stack->Pop()->GetString());
}
}
diff --git a/engines/wintermute/UI/UIButton.cpp b/engines/wintermute/UI/UIButton.cpp index 58440d0095..ea20e29490 100644 --- a/engines/wintermute/UI/UIButton.cpp +++ b/engines/wintermute/UI/UIButton.cpp @@ -666,21 +666,21 @@ void CUIButton::press() { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CUIButton::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetDisabledFont
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetDisabledFont") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ if (strcmp(name, "SetDisabledFont") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (_fontDisable) Game->_fontStorage->RemoveFont(_fontDisable);
if (Val->IsNULL()) {
_fontDisable = NULL;
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
_fontDisable = Game->_fontStorage->AddFont(Val->GetString());
- Stack->PushBool(_fontDisable != NULL);
+ stack->PushBool(_fontDisable != NULL);
}
return S_OK;
}
@@ -688,17 +688,17 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetHoverFont
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetHoverFont") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "SetHoverFont") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (_fontHover) Game->_fontStorage->RemoveFont(_fontHover);
if (Val->IsNULL()) {
_fontHover = NULL;
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
_fontHover = Game->_fontStorage->AddFont(Val->GetString());
- Stack->PushBool(_fontHover != NULL);
+ stack->PushBool(_fontHover != NULL);
}
return S_OK;
}
@@ -706,17 +706,17 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetPressedFont
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetPressedFont") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "SetPressedFont") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (_fontPress) Game->_fontStorage->RemoveFont(_fontPress);
if (Val->IsNULL()) {
_fontPress = NULL;
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
_fontPress = Game->_fontStorage->AddFont(Val->GetString());
- Stack->PushBool(_fontPress != NULL);
+ stack->PushBool(_fontPress != NULL);
}
return S_OK;
}
@@ -724,17 +724,17 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetFocusedFont
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetFocusedFont") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "SetFocusedFont") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (_fontFocus) Game->_fontStorage->RemoveFont(_fontFocus);
if (Val->IsNULL()) {
_fontFocus = NULL;
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
_fontFocus = Game->_fontStorage->AddFont(Val->GetString());
- Stack->PushBool(_fontFocus != NULL);
+ stack->PushBool(_fontFocus != NULL);
}
return S_OK;
}
@@ -742,17 +742,17 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetDisabledImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetDisabledImage") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetDisabledImage") == 0) {
+ stack->CorrectParams(1);
delete _imageDisable;
_imageDisable = new CBSprite(Game);
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
if (!_imageDisable || FAILED(_imageDisable->loadFile(Filename))) {
delete _imageDisable;
_imageDisable = NULL;
- Stack->PushBool(false);
- } else Stack->PushBool(true);
+ stack->PushBool(false);
+ } else stack->PushBool(true);
return S_OK;
}
@@ -760,10 +760,10 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetDisabledImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetDisabledImage") == 0) {
- Stack->CorrectParams(0);
- if (!_imageDisable || !_imageDisable->_filename) Stack->PushNULL();
- else Stack->PushString(_imageDisable->_filename);
+ else if (strcmp(name, "GetDisabledImage") == 0) {
+ stack->CorrectParams(0);
+ if (!_imageDisable || !_imageDisable->_filename) stack->PushNULL();
+ else stack->PushString(_imageDisable->_filename);
return S_OK;
}
@@ -771,10 +771,10 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetDisabledImageObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetDisabledImageObject") == 0) {
- Stack->CorrectParams(0);
- if (!_imageDisable) Stack->PushNULL();
- else Stack->PushNative(_imageDisable, true);
+ else if (strcmp(name, "GetDisabledImageObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_imageDisable) stack->PushNULL();
+ else stack->PushNative(_imageDisable, true);
return S_OK;
}
@@ -783,17 +783,17 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetHoverImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetHoverImage") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetHoverImage") == 0) {
+ stack->CorrectParams(1);
delete _imageHover;
_imageHover = new CBSprite(Game);
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
if (!_imageHover || FAILED(_imageHover->loadFile(Filename))) {
delete _imageHover;
_imageHover = NULL;
- Stack->PushBool(false);
- } else Stack->PushBool(true);
+ stack->PushBool(false);
+ } else stack->PushBool(true);
return S_OK;
}
@@ -801,10 +801,10 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetHoverImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetHoverImage") == 0) {
- Stack->CorrectParams(0);
- if (!_imageHover || !_imageHover->_filename) Stack->PushNULL();
- else Stack->PushString(_imageHover->_filename);
+ else if (strcmp(name, "GetHoverImage") == 0) {
+ stack->CorrectParams(0);
+ if (!_imageHover || !_imageHover->_filename) stack->PushNULL();
+ else stack->PushString(_imageHover->_filename);
return S_OK;
}
@@ -812,10 +812,10 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetHoverImageObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetHoverImageObject") == 0) {
- Stack->CorrectParams(0);
- if (!_imageHover) Stack->PushNULL();
- else Stack->PushNative(_imageHover, true);
+ else if (strcmp(name, "GetHoverImageObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_imageHover) stack->PushNULL();
+ else stack->PushNative(_imageHover, true);
return S_OK;
}
@@ -823,17 +823,17 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetPressedImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetPressedImage") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetPressedImage") == 0) {
+ stack->CorrectParams(1);
delete _imagePress;
_imagePress = new CBSprite(Game);
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
if (!_imagePress || FAILED(_imagePress->loadFile(Filename))) {
delete _imagePress;
_imagePress = NULL;
- Stack->PushBool(false);
- } else Stack->PushBool(true);
+ stack->PushBool(false);
+ } else stack->PushBool(true);
return S_OK;
}
@@ -841,10 +841,10 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetPressedImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetPressedImage") == 0) {
- Stack->CorrectParams(0);
- if (!_imagePress || !_imagePress->_filename) Stack->PushNULL();
- else Stack->PushString(_imagePress->_filename);
+ else if (strcmp(name, "GetPressedImage") == 0) {
+ stack->CorrectParams(0);
+ if (!_imagePress || !_imagePress->_filename) stack->PushNULL();
+ else stack->PushString(_imagePress->_filename);
return S_OK;
}
@@ -852,10 +852,10 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetPressedImageObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetPressedImageObject") == 0) {
- Stack->CorrectParams(0);
- if (!_imagePress) Stack->PushNULL();
- else Stack->PushNative(_imagePress, true);
+ else if (strcmp(name, "GetPressedImageObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_imagePress) stack->PushNULL();
+ else stack->PushNative(_imagePress, true);
return S_OK;
}
@@ -863,17 +863,17 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetFocusedImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetFocusedImage") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetFocusedImage") == 0) {
+ stack->CorrectParams(1);
delete _imageFocus;
_imageFocus = new CBSprite(Game);
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
if (!_imageFocus || FAILED(_imageFocus->loadFile(Filename))) {
delete _imageFocus;
_imageFocus = NULL;
- Stack->PushBool(false);
- } else Stack->PushBool(true);
+ stack->PushBool(false);
+ } else stack->PushBool(true);
return S_OK;
}
@@ -881,10 +881,10 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetFocusedImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetFocusedImage") == 0) {
- Stack->CorrectParams(0);
- if (!_imageFocus || !_imageFocus->_filename) Stack->PushNULL();
- else Stack->PushString(_imageFocus->_filename);
+ else if (strcmp(name, "GetFocusedImage") == 0) {
+ stack->CorrectParams(0);
+ if (!_imageFocus || !_imageFocus->_filename) stack->PushNULL();
+ else stack->PushString(_imageFocus->_filename);
return S_OK;
}
@@ -892,10 +892,10 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetFocusedImageObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetFocusedImageObject") == 0) {
- Stack->CorrectParams(0);
- if (!_imageFocus) Stack->PushNULL();
- else Stack->PushNative(_imageFocus, true);
+ else if (strcmp(name, "GetFocusedImageObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_imageFocus) stack->PushNULL();
+ else stack->PushNative(_imageFocus, true);
return S_OK;
}
@@ -903,31 +903,31 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// Press
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Press") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Press") == 0) {
+ stack->CorrectParams(0);
if (_visible && !_disable) {
_oneTimePress = true;
_oneTimePressTime = CBPlatform::GetTime();
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
- else return CUIObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CUIObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CUIButton::scGetProperty(const char *Name) {
+CScValue *CUIButton::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("button");
return _scValue;
}
@@ -935,7 +935,7 @@ CScValue *CUIButton::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// TextAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TextAlign") == 0) {
+ else if (strcmp(name, "TextAlign") == 0) {
_scValue->SetInt(_align);
return _scValue;
}
@@ -943,35 +943,35 @@ CScValue *CUIButton::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Focusable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Focusable") == 0) {
+ else if (strcmp(name, "Focusable") == 0) {
_scValue->SetBool(_canFocus);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Pressed
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Pressed") == 0) {
+ else if (strcmp(name, "Pressed") == 0) {
_scValue->SetBool(_stayPressed);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PixelPerfect") == 0) {
+ else if (strcmp(name, "PixelPerfect") == 0) {
_scValue->SetBool(_pixelPerfect);
return _scValue;
}
- else return CUIObject::scGetProperty(Name);
+ else return CUIObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIButton::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CUIButton::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// TextAlign
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "TextAlign") == 0) {
+ if (strcmp(name, "TextAlign") == 0) {
int i = Value->GetInt();
if (i < 0 || i >= NUM_TEXT_ALIGN) i = 0;
_align = (TTextAlign)i;
@@ -981,26 +981,26 @@ HRESULT CUIButton::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Focusable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Focusable") == 0) {
+ else if (strcmp(name, "Focusable") == 0) {
_canFocus = Value->GetBool();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Pressed
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Pressed") == 0) {
+ else if (strcmp(name, "Pressed") == 0) {
_stayPressed = Value->GetBool();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PixelPerfect") == 0) {
+ else if (strcmp(name, "PixelPerfect") == 0) {
_pixelPerfect = Value->GetBool();
return S_OK;
}
- else return CUIObject::scSetProperty(Name, Value);
+ else return CUIObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/UI/UIButton.h b/engines/wintermute/UI/UIButton.h index bc3ba87257..07bc18bc65 100644 --- a/engines/wintermute/UI/UIButton.h +++ b/engines/wintermute/UI/UIButton.h @@ -68,9 +68,9 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp index cc98830898..4678f81d9a 100644 --- a/engines/wintermute/UI/UIEdit.cpp +++ b/engines/wintermute/UI/UIEdit.cpp @@ -361,32 +361,32 @@ HRESULT CUIEdit::saveAsText(CBDynBuffer *Buffer, int Indent) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEdit::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CUIEdit::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetSelectedFont
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetSelectedFont") == 0) {
- Stack->CorrectParams(1);
+ if (strcmp(name, "SetSelectedFont") == 0) {
+ stack->CorrectParams(1);
if (_fontSelected) Game->_fontStorage->RemoveFont(_fontSelected);
- _fontSelected = Game->_fontStorage->AddFont(Stack->Pop()->GetString());
- Stack->PushBool(_fontSelected != NULL);
+ _fontSelected = Game->_fontStorage->AddFont(stack->Pop()->GetString());
+ stack->PushBool(_fontSelected != NULL);
return S_OK;
}
- else return CUIObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CUIObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CUIEdit::scGetProperty(const char *Name) {
+CScValue *CUIEdit::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("editor");
return _scValue;
}
@@ -394,7 +394,7 @@ CScValue *CUIEdit::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SelStart
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SelStart") == 0) {
+ else if (strcmp(name, "SelStart") == 0) {
_scValue->SetInt(_selStart);
return _scValue;
}
@@ -402,7 +402,7 @@ CScValue *CUIEdit::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SelEnd
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SelEnd") == 0) {
+ else if (strcmp(name, "SelEnd") == 0) {
_scValue->SetInt(_selEnd);
return _scValue;
}
@@ -410,7 +410,7 @@ CScValue *CUIEdit::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// CursorBlinkRate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CursorBlinkRate") == 0) {
+ else if (strcmp(name, "CursorBlinkRate") == 0) {
_scValue->SetInt(_cursorBlinkRate);
return _scValue;
}
@@ -418,7 +418,7 @@ CScValue *CUIEdit::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// CursorChar
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CursorChar") == 0) {
+ else if (strcmp(name, "CursorChar") == 0) {
_scValue->SetString(_cursorChar);
return _scValue;
}
@@ -426,7 +426,7 @@ CScValue *CUIEdit::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// FrameWidth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FrameWidth") == 0) {
+ else if (strcmp(name, "FrameWidth") == 0) {
_scValue->SetInt(_frameWidth);
return _scValue;
}
@@ -434,7 +434,7 @@ CScValue *CUIEdit::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// MaxLength
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MaxLength") == 0) {
+ else if (strcmp(name, "MaxLength") == 0) {
_scValue->SetInt(_maxLength);
return _scValue;
}
@@ -442,7 +442,7 @@ CScValue *CUIEdit::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Text
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Text") == 0) {
+ else if (strcmp(name, "Text") == 0) {
if (Game->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::AnsiToWide(_text);
_scValue->SetString(StringUtil::WideToUtf8(wstr).c_str());
@@ -452,16 +452,16 @@ CScValue *CUIEdit::scGetProperty(const char *Name) { return _scValue;
}
- else return CUIObject::scGetProperty(Name);
+ else return CUIObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEdit::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CUIEdit::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// SelStart
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SelStart") == 0) {
+ if (strcmp(name, "SelStart") == 0) {
_selStart = Value->GetInt();
_selStart = MAX(_selStart, 0);
_selStart = MIN((size_t)_selStart, strlen(_text));
@@ -471,7 +471,7 @@ HRESULT CUIEdit::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SelEnd
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SelEnd") == 0) {
+ else if (strcmp(name, "SelEnd") == 0) {
_selEnd = Value->GetInt();
_selEnd = MAX(_selEnd, 0);
_selEnd = MIN((size_t)_selEnd, strlen(_text));
@@ -481,7 +481,7 @@ HRESULT CUIEdit::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// CursorBlinkRate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CursorBlinkRate") == 0) {
+ else if (strcmp(name, "CursorBlinkRate") == 0) {
_cursorBlinkRate = Value->GetInt();
return S_OK;
}
@@ -489,7 +489,7 @@ HRESULT CUIEdit::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// CursorChar
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CursorChar") == 0) {
+ else if (strcmp(name, "CursorChar") == 0) {
setCursorChar(Value->GetString());
return S_OK;
}
@@ -497,7 +497,7 @@ HRESULT CUIEdit::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// FrameWidth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FrameWidth") == 0) {
+ else if (strcmp(name, "FrameWidth") == 0) {
_frameWidth = Value->GetInt();
return S_OK;
}
@@ -505,7 +505,7 @@ HRESULT CUIEdit::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// MaxLength
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MaxLength") == 0) {
+ else if (strcmp(name, "MaxLength") == 0) {
_maxLength = Value->GetInt();
return S_OK;
}
@@ -513,7 +513,7 @@ HRESULT CUIEdit::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Text
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Text") == 0) {
+ else if (strcmp(name, "Text") == 0) {
if (Game->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::Utf8ToWide(Value->GetString());
setText(StringUtil::WideToAnsi(wstr).c_str());
@@ -523,7 +523,7 @@ HRESULT CUIEdit::scSetProperty(const char *Name, CScValue *Value) { return S_OK;
}
- else return CUIObject::scSetProperty(Name, Value);
+ else return CUIObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/UI/UIEdit.h b/engines/wintermute/UI/UIEdit.h index 34f849f9fa..8477e6f9d5 100644 --- a/engines/wintermute/UI/UIEdit.h +++ b/engines/wintermute/UI/UIEdit.h @@ -61,9 +61,9 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/UI/UIEntity.cpp b/engines/wintermute/UI/UIEntity.cpp index deefe965e3..afba22cc49 100644 --- a/engines/wintermute/UI/UIEntity.cpp +++ b/engines/wintermute/UI/UIEntity.cpp @@ -251,15 +251,15 @@ HRESULT CUIEntity::display(int OffsetX, int OffsetY) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CUIEntity::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetEntity
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "GetEntity") == 0) {
- Stack->CorrectParams(0);
+ if (strcmp(name, "GetEntity") == 0) {
+ stack->CorrectParams(0);
- if (_entity) Stack->PushNative(_entity, true);
- else Stack->PushNULL();
+ if (_entity) stack->PushNative(_entity, true);
+ else stack->PushNULL();
return S_OK;
}
@@ -267,31 +267,31 @@ HRESULT CUIEntity::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetEntity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetEntity") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetEntity") == 0) {
+ stack->CorrectParams(1);
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
if (SUCCEEDED(setEntity(Filename)))
- Stack->PushBool(true);
+ stack->PushBool(true);
else
- Stack->PushBool(false);
+ stack->PushBool(false);
return S_OK;
}
- else return CUIObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CUIObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CUIEntity::scGetProperty(const char *Name) {
+CScValue *CUIEntity::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("entity container");
return _scValue;
}
@@ -299,25 +299,25 @@ CScValue *CUIEntity::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Freezable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Freezable") == 0) {
+ else if (strcmp(name, "Freezable") == 0) {
if (_entity) _scValue->SetBool(_entity->_freezable);
else _scValue->SetBool(false);
return _scValue;
}
- else return CUIObject::scGetProperty(Name);
+ else return CUIObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEntity::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CUIEntity::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Freezable
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Freezable") == 0) {
+ if (strcmp(name, "Freezable") == 0) {
if (_entity) _entity->makeFreezable(Value->GetBool());
return S_OK;
- } else return CUIObject::scSetProperty(Name, Value);
+ } else return CUIObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/UI/UIEntity.h b/engines/wintermute/UI/UIEntity.h index bd588f7d37..55c5790ef5 100644 --- a/engines/wintermute/UI/UIEntity.h +++ b/engines/wintermute/UI/UIEntity.h @@ -47,9 +47,9 @@ public: HRESULT setEntity(const char *Filename);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/UI/UIObject.cpp b/engines/wintermute/UI/UIObject.cpp index 46bfe399f2..c23415287c 100644 --- a/engines/wintermute/UI/UIObject.cpp +++ b/engines/wintermute/UI/UIObject.cpp @@ -137,21 +137,21 @@ void CUIObject::correctSize() { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CUIObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetFont
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SetFont") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ if (strcmp(name, "SetFont") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
if (_font) Game->_fontStorage->RemoveFont(_font);
if (Val->IsNULL()) {
_font = NULL;
- Stack->PushBool(true);
+ stack->PushBool(true);
} else {
_font = Game->_fontStorage->AddFont(Val->GetString());
- Stack->PushBool(_font != NULL);
+ stack->PushBool(_font != NULL);
}
return S_OK;
}
@@ -159,16 +159,16 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetImage") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "SetImage") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
/* const char *Filename = */ Val->GetString();
delete _image;
_image = NULL;
if (Val->IsNULL()) {
- Stack->PushBool(true);
+ stack->PushBool(true);
return S_OK;
}
@@ -176,8 +176,8 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th if (!_image || FAILED(_image->loadFile(Val->GetString()))) {
delete _image;
_image = NULL;
- Stack->PushBool(false);
- } else Stack->PushBool(true);
+ stack->PushBool(false);
+ } else stack->PushBool(true);
return S_OK;
}
@@ -185,10 +185,10 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetImage") == 0) {
- Stack->CorrectParams(0);
- if (!_image || !_image->_filename) Stack->PushNULL();
- else Stack->PushString(_image->_filename);
+ else if (strcmp(name, "GetImage") == 0) {
+ stack->CorrectParams(0);
+ if (!_image || !_image->_filename) stack->PushNULL();
+ else stack->PushString(_image->_filename);
return S_OK;
}
@@ -196,10 +196,10 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetImageObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetImageObject") == 0) {
- Stack->CorrectParams(0);
- if (!_image) Stack->PushNULL();
- else Stack->PushNative(_image, true);
+ else if (strcmp(name, "GetImageObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_image) stack->PushNULL();
+ else stack->PushNative(_image, true);
return S_OK;
}
@@ -207,25 +207,25 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// Focus
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Focus") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Focus") == 0) {
+ stack->CorrectParams(0);
focus();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// MoveAfter / MoveBefore
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MoveAfter") == 0 || strcmp(Name, "MoveBefore") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "MoveAfter") == 0 || strcmp(name, "MoveBefore") == 0) {
+ stack->CorrectParams(1);
if (_parent && _parent->_type == UI_WINDOW) {
CUIWindow *win = (CUIWindow *)_parent;
int i;
bool found = false;
- CScValue *val = Stack->Pop();
+ CScValue *val = stack->Pop();
// find directly
if (val->IsNative()) {
CUIObject *widget = (CUIObject *)val->GetNative();
@@ -251,21 +251,21 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th bool done = false;
for (int j = 0; j < win->_widgets.GetSize(); j++) {
if (win->_widgets[j] == this) {
- if (strcmp(Name, "MoveAfter") == 0) i++;
+ if (strcmp(name, "MoveAfter") == 0) i++;
if (j >= i) j++;
win->_widgets.InsertAt(i, this);
win->_widgets.RemoveAt(j);
done = true;
- Stack->PushBool(true);
+ stack->PushBool(true);
break;
}
}
- if (!done) Stack->PushBool(false);
- } else Stack->PushBool(false);
+ if (!done) stack->PushBool(false);
+ } else stack->PushBool(false);
- } else Stack->PushBool(false);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -273,8 +273,8 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// MoveToBottom
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MoveToBottom") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "MoveToBottom") == 0) {
+ stack->CorrectParams(0);
if (_parent && _parent->_type == UI_WINDOW) {
CUIWindow *win = (CUIWindow *)_parent;
@@ -285,8 +285,8 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th break;
}
}
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
@@ -294,8 +294,8 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// MoveToTop
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "MoveToTop") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "MoveToTop") == 0) {
+ stack->CorrectParams(0);
if (_parent && _parent->_type == UI_WINDOW) {
CUIWindow *win = (CUIWindow *)_parent;
@@ -306,24 +306,24 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th break;
}
}
- Stack->PushBool(true);
- } else Stack->PushBool(false);
+ stack->PushBool(true);
+ } else stack->PushBool(false);
return S_OK;
}
- else return CBObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CBObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CUIObject::scGetProperty(const char *Name) {
+CScValue *CUIObject::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("ui_object");
return _scValue;
}
@@ -331,7 +331,7 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Name") == 0) {
+ else if (strcmp(name, "Name") == 0) {
_scValue->SetString(_name);
return _scValue;
}
@@ -339,7 +339,7 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Parent (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Parent") == 0) {
+ else if (strcmp(name, "Parent") == 0) {
_scValue->SetNative(_parent, true);
return _scValue;
}
@@ -347,7 +347,7 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ParentNotify
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ParentNotify") == 0) {
+ else if (strcmp(name, "ParentNotify") == 0) {
_scValue->SetBool(_parentNotify);
return _scValue;
}
@@ -355,7 +355,7 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Width") == 0) {
+ else if (strcmp(name, "Width") == 0) {
_scValue->SetInt(_width);
return _scValue;
}
@@ -363,7 +363,7 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Height") == 0) {
+ else if (strcmp(name, "Height") == 0) {
_scValue->SetInt(_height);
return _scValue;
}
@@ -371,7 +371,7 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Visible
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Visible") == 0) {
+ else if (strcmp(name, "Visible") == 0) {
_scValue->SetBool(_visible);
return _scValue;
}
@@ -379,7 +379,7 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Disabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Disabled") == 0) {
+ else if (strcmp(name, "Disabled") == 0) {
_scValue->SetBool(_disable);
return _scValue;
}
@@ -387,7 +387,7 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Text
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Text") == 0) {
+ else if (strcmp(name, "Text") == 0) {
_scValue->SetString(_text);
return _scValue;
}
@@ -395,13 +395,13 @@ CScValue *CUIObject::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NextSibling (RO) / PrevSibling (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NextSibling") == 0 || strcmp(Name, "PrevSibling") == 0) {
+ else if (strcmp(name, "NextSibling") == 0 || strcmp(name, "PrevSibling") == 0) {
_scValue->SetNULL();
if (_parent && _parent->_type == UI_WINDOW) {
CUIWindow *win = (CUIWindow *)_parent;
for (int i = 0; i < win->_widgets.GetSize(); i++) {
if (win->_widgets[i] == this) {
- if (strcmp(Name, "NextSibling") == 0) {
+ if (strcmp(name, "NextSibling") == 0) {
if (i < win->_widgets.GetSize() - 1) _scValue->SetNative(win->_widgets[i + 1], true);
} else {
if (i > 0) _scValue->SetNative(win->_widgets[i - 1], true);
@@ -413,16 +413,16 @@ CScValue *CUIObject::scGetProperty(const char *Name) { return _scValue;
}
- else return CBObject::scGetProperty(Name);
+ else return CBObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIObject::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CUIObject::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
}
@@ -430,7 +430,7 @@ HRESULT CUIObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// ParentNotify
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ParentNotify") == 0) {
+ else if (strcmp(name, "ParentNotify") == 0) {
_parentNotify = Value->GetBool();
return S_OK;
}
@@ -438,7 +438,7 @@ HRESULT CUIObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Width") == 0) {
+ else if (strcmp(name, "Width") == 0) {
_width = Value->GetInt();
return S_OK;
}
@@ -446,7 +446,7 @@ HRESULT CUIObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Height") == 0) {
+ else if (strcmp(name, "Height") == 0) {
_height = Value->GetInt();
return S_OK;
}
@@ -454,7 +454,7 @@ HRESULT CUIObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Visible
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Visible") == 0) {
+ else if (strcmp(name, "Visible") == 0) {
_visible = Value->GetBool();
return S_OK;
}
@@ -462,7 +462,7 @@ HRESULT CUIObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Disabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Disabled") == 0) {
+ else if (strcmp(name, "Disabled") == 0) {
_disable = Value->GetBool();
return S_OK;
}
@@ -470,12 +470,12 @@ HRESULT CUIObject::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Text
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Text") == 0) {
+ else if (strcmp(name, "Text") == 0) {
setText(Value->GetString());
return S_OK;
}
- else return CBObject::scSetProperty(Name, Value);
+ else return CBObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/UI/UIObject.h b/engines/wintermute/UI/UIObject.h index 7e16041bbe..bc49c01a2f 100644 --- a/engines/wintermute/UI/UIObject.h +++ b/engines/wintermute/UI/UIObject.h @@ -72,9 +72,9 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/UI/UIText.cpp b/engines/wintermute/UI/UIText.cpp index 4eaa114a83..e5b89e15df 100644 --- a/engines/wintermute/UI/UIText.cpp +++ b/engines/wintermute/UI/UIText.cpp @@ -376,39 +376,39 @@ HRESULT CUIText::saveAsText(CBDynBuffer *Buffer, int Indent) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIText::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CUIText::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SizeToFit
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "SizeToFit") == 0) {
- Stack->CorrectParams(0);
+ if (strcmp(name, "SizeToFit") == 0) {
+ stack->CorrectParams(0);
SizeToFit();
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// HeightToFit
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "HeightToFit") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "HeightToFit") == 0) {
+ stack->CorrectParams(0);
if (_font && _text) _height = _font->getTextHeight((byte *)_text, _width);
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
- else return CUIObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CUIObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CUIText::scGetProperty(const char *Name) {
+CScValue *CUIText::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("static");
return _scValue;
}
@@ -416,7 +416,7 @@ CScValue *CUIText::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// TextAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "TextAlign") == 0) {
+ else if (strcmp(name, "TextAlign") == 0) {
_scValue->SetInt(_textAlign);
return _scValue;
}
@@ -424,21 +424,21 @@ CScValue *CUIText::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// VerticalAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "VerticalAlign") == 0) {
+ else if (strcmp(name, "VerticalAlign") == 0) {
_scValue->SetInt(_verticalAlign);
return _scValue;
}
- else return CUIObject::scGetProperty(Name);
+ else return CUIObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIText::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CUIText::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// TextAlign
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "TextAlign") == 0) {
+ if (strcmp(name, "TextAlign") == 0) {
int i = Value->GetInt();
if (i < 0 || i >= NUM_TEXT_ALIGN) i = 0;
_textAlign = (TTextAlign)i;
@@ -448,14 +448,14 @@ HRESULT CUIText::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// VerticalAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "VerticalAlign") == 0) {
+ else if (strcmp(name, "VerticalAlign") == 0) {
int i = Value->GetInt();
if (i < 0 || i >= NUM_VERTICAL_ALIGN) i = 0;
_verticalAlign = (TVerticalAlign)i;
return S_OK;
}
- else return CUIObject::scSetProperty(Name, Value);
+ else return CUIObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/UI/UIText.h b/engines/wintermute/UI/UIText.h index aac9caf896..bb0b6a4d84 100644 --- a/engines/wintermute/UI/UIText.h +++ b/engines/wintermute/UI/UIText.h @@ -48,9 +48,9 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp index 38fefc4cc7..4e0590ab15 100644 --- a/engines/wintermute/UI/UIWindow.cpp +++ b/engines/wintermute/UI/UIWindow.cpp @@ -670,18 +670,18 @@ HRESULT CUIWindow::saveAsText(CBDynBuffer *Buffer, int Indent) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIWindow::enableWidget(const char *Name, bool Enable) {
+HRESULT CUIWindow::enableWidget(const char *name, bool Enable) {
for (int i = 0; i < _widgets.GetSize(); i++) {
- if (scumm_stricmp(_widgets[i]->_name, Name) == 0) _widgets[i]->_disable = !Enable;
+ if (scumm_stricmp(_widgets[i]->_name, name) == 0) _widgets[i]->_disable = !Enable;
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIWindow::showWidget(const char *Name, bool Visible) {
+HRESULT CUIWindow::showWidget(const char *name, bool Visible) {
for (int i = 0; i < _widgets.GetSize(); i++) {
- if (scumm_stricmp(_widgets[i]->_name, Name) == 0) _widgets[i]->_visible = Visible;
+ if (scumm_stricmp(_widgets[i]->_name, name) == 0) _widgets[i]->_visible = Visible;
}
return S_OK;
}
@@ -690,25 +690,25 @@ HRESULT CUIWindow::showWidget(const char *Name, bool Visible) { //////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
+HRESULT CUIWindow::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetWidget / GetControl
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "GetWidget") == 0 || strcmp(Name, "GetControl") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ if (strcmp(name, "GetWidget") == 0 || strcmp(name, "GetControl") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
if (val->GetType() == VAL_INT) {
int widget = val->GetInt();
- if (widget < 0 || widget >= _widgets.GetSize()) Stack->PushNULL();
- else Stack->PushNative(_widgets[widget], true);
+ if (widget < 0 || widget >= _widgets.GetSize()) stack->PushNULL();
+ else stack->PushNative(_widgets[widget], true);
} else {
for (int i = 0; i < _widgets.GetSize(); i++) {
if (scumm_stricmp(_widgets[i]->_name, val->GetString()) == 0) {
- Stack->PushNative(_widgets[i], true);
+ stack->PushNative(_widgets[i], true);
return S_OK;
}
}
- Stack->PushNULL();
+ stack->PushNULL();
}
return S_OK;
@@ -717,12 +717,12 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetInactiveFont
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetInactiveFont") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetInactiveFont") == 0) {
+ stack->CorrectParams(1);
if (_fontInactive) Game->_fontStorage->RemoveFont(_fontInactive);
- _fontInactive = Game->_fontStorage->AddFont(Stack->Pop()->GetString());
- Stack->PushBool(_fontInactive != NULL);
+ _fontInactive = Game->_fontStorage->AddFont(stack->Pop()->GetString());
+ stack->PushBool(_fontInactive != NULL);
return S_OK;
}
@@ -730,17 +730,17 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// SetInactiveImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SetInactiveImage") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "SetInactiveImage") == 0) {
+ stack->CorrectParams(1);
delete _imageInactive;
_imageInactive = new CBSprite(Game);
- const char *Filename = Stack->Pop()->GetString();
+ const char *Filename = stack->Pop()->GetString();
if (!_imageInactive || FAILED(_imageInactive->loadFile(Filename))) {
delete _imageInactive;
_imageInactive = NULL;
- Stack->PushBool(false);
- } else Stack->PushBool(true);
+ stack->PushBool(false);
+ } else stack->PushBool(true);
return S_OK;
}
@@ -748,10 +748,10 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetInactiveImage
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetInactiveImage") == 0) {
- Stack->CorrectParams(0);
- if (!_imageInactive || !_imageInactive->_filename) Stack->PushNULL();
- else Stack->PushString(_imageInactive->_filename);
+ else if (strcmp(name, "GetInactiveImage") == 0) {
+ stack->CorrectParams(0);
+ if (!_imageInactive || !_imageInactive->_filename) stack->PushNULL();
+ else stack->PushString(_imageInactive->_filename);
return S_OK;
}
@@ -759,10 +759,10 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// GetInactiveImageObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GetInactiveImageObject") == 0) {
- Stack->CorrectParams(0);
- if (!_imageInactive) Stack->PushNULL();
- else Stack->PushNative(_imageInactive, true);
+ else if (strcmp(name, "GetInactiveImageObject") == 0) {
+ stack->CorrectParams(0);
+ if (!_imageInactive) stack->PushNULL();
+ else stack->PushNative(_imageInactive, true);
return S_OK;
}
@@ -771,56 +771,56 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// Close
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Close") == 0) {
- Stack->CorrectParams(0);
- Stack->PushBool(SUCCEEDED(close()));
+ else if (strcmp(name, "Close") == 0) {
+ stack->CorrectParams(0);
+ stack->PushBool(SUCCEEDED(close()));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GoExclusive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GoExclusive") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GoExclusive") == 0) {
+ stack->CorrectParams(0);
goExclusive();
- Script->WaitFor(this);
- Stack->PushNULL();
+ script->WaitFor(this);
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GoSystemExclusive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "GoSystemExclusive") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "GoSystemExclusive") == 0) {
+ stack->CorrectParams(0);
goSystemExclusive();
- Script->WaitFor(this);
- Stack->PushNULL();
+ script->WaitFor(this);
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Center
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Center") == 0) {
- Stack->CorrectParams(0);
+ else if (strcmp(name, "Center") == 0) {
+ stack->CorrectParams(0);
_posX = (Game->_renderer->_width - _width) / 2;
_posY = (Game->_renderer->_height - _height) / 2;
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// LoadFromFile
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "LoadFromFile") == 0) {
- Stack->CorrectParams(1);
+ else if (strcmp(name, "LoadFromFile") == 0) {
+ stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ CScValue *Val = stack->Pop();
cleanup();
if (!Val->IsNULL()) {
- Stack->PushBool(SUCCEEDED(loadFile(Val->GetString())));
- } else Stack->PushBool(true);
+ stack->PushBool(SUCCEEDED(loadFile(Val->GetString())));
+ } else stack->PushBool(true);
return S_OK;
}
@@ -828,13 +828,13 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// CreateButton
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateButton") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "CreateButton") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CUIButton *Btn = new CUIButton(Game);
if (!Val->IsNULL()) Btn->setName(Val->GetString());
- Stack->PushNative(Btn, true);
+ stack->PushNative(Btn, true);
Btn->_parent = this;
_widgets.Add(Btn);
@@ -845,13 +845,13 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// CreateStatic
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateStatic") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "CreateStatic") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CUIText *Sta = new CUIText(Game);
if (!Val->IsNULL()) Sta->setName(Val->GetString());
- Stack->PushNative(Sta, true);
+ stack->PushNative(Sta, true);
Sta->_parent = this;
_widgets.Add(Sta);
@@ -862,13 +862,13 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// CreateEditor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateEditor") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "CreateEditor") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CUIEdit *Edi = new CUIEdit(Game);
if (!Val->IsNULL()) Edi->setName(Val->GetString());
- Stack->PushNative(Edi, true);
+ stack->PushNative(Edi, true);
Edi->_parent = this;
_widgets.Add(Edi);
@@ -879,13 +879,13 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// CreateWindow
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "CreateWindow") == 0) {
- Stack->CorrectParams(1);
- CScValue *Val = Stack->Pop();
+ else if (strcmp(name, "CreateWindow") == 0) {
+ stack->CorrectParams(1);
+ CScValue *Val = stack->Pop();
CUIWindow *Win = new CUIWindow(Game);
if (!Val->IsNULL()) Win->setName(Val->GetString());
- Stack->PushNative(Win, true);
+ stack->PushNative(Win, true);
Win->_parent = this;
_widgets.Add(Win);
@@ -896,9 +896,9 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th //////////////////////////////////////////////////////////////////////////
// DeleteControl / DeleteButton / DeleteStatic / DeleteEditor / DeleteWindow
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "DeleteControl") == 0 || strcmp(Name, "DeleteButton") == 0 || strcmp(Name, "DeleteStatic") == 0 || strcmp(Name, "DeleteEditor") == 0 || strcmp(Name, "DeleteWindow") == 0) {
- Stack->CorrectParams(1);
- CScValue *val = Stack->Pop();
+ else if (strcmp(name, "DeleteControl") == 0 || strcmp(name, "DeleteButton") == 0 || strcmp(name, "DeleteStatic") == 0 || strcmp(name, "DeleteEditor") == 0 || strcmp(name, "DeleteWindow") == 0) {
+ stack->CorrectParams(1);
+ CScValue *val = stack->Pop();
CUIObject *obj = (CUIObject *)val->GetNative();
for (int i = 0; i < _widgets.GetSize(); i++) {
@@ -908,22 +908,22 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th if (val->GetType() == VAL_VARIABLE_REF) val->SetNULL();
}
}
- Stack->PushNULL();
+ stack->PushNULL();
return S_OK;
- } else if SUCCEEDED(Game->WindowScriptMethodHook(this, Script, Stack, Name)) return S_OK;
+ } else if SUCCEEDED(Game->WindowScriptMethodHook(this, script, stack, name)) return S_OK;
- else return CUIObject::scCallMethod(Script, Stack, ThisStack, Name);
+ else return CUIObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CUIWindow::scGetProperty(const char *Name) {
+CScValue *CUIWindow::scGetProperty(const char *name) {
_scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Type") == 0) {
+ if (strcmp(name, "Type") == 0) {
_scValue->SetString("window");
return _scValue;
}
@@ -931,7 +931,7 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// NumWidgets / NumControls (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "NumWidgets") == 0 || strcmp(Name, "NumControls") == 0) {
+ else if (strcmp(name, "NumWidgets") == 0 || strcmp(name, "NumControls") == 0) {
_scValue->SetInt(_widgets.GetSize());
return _scValue;
}
@@ -939,7 +939,7 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Exclusive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Exclusive") == 0) {
+ else if (strcmp(name, "Exclusive") == 0) {
_scValue->SetBool(_mode == WINDOW_EXCLUSIVE);
return _scValue;
}
@@ -947,7 +947,7 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// SystemExclusive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SystemExclusive") == 0) {
+ else if (strcmp(name, "SystemExclusive") == 0) {
_scValue->SetBool(_mode == WINDOW_SYSTEM_EXCLUSIVE);
return _scValue;
}
@@ -955,7 +955,7 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Menu
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Menu") == 0) {
+ else if (strcmp(name, "Menu") == 0) {
_scValue->SetBool(_isMenu);
return _scValue;
}
@@ -963,7 +963,7 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// InGame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InGame") == 0) {
+ else if (strcmp(name, "InGame") == 0) {
_scValue->SetBool(_inGame);
return _scValue;
}
@@ -971,7 +971,7 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// PauseMusic
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PauseMusic") == 0) {
+ else if (strcmp(name, "PauseMusic") == 0) {
_scValue->SetBool(_pauseMusic);
return _scValue;
}
@@ -979,7 +979,7 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// ClipContents
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ClipContents") == 0) {
+ else if (strcmp(name, "ClipContents") == 0) {
_scValue->SetBool(_clipContents);
return _scValue;
}
@@ -987,7 +987,7 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// Transparent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Transparent") == 0) {
+ else if (strcmp(name, "Transparent") == 0) {
_scValue->SetBool(_transparent);
return _scValue;
}
@@ -995,21 +995,21 @@ CScValue *CUIWindow::scGetProperty(const char *Name) { //////////////////////////////////////////////////////////////////////////
// FadeColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeColor") == 0) {
+ else if (strcmp(name, "FadeColor") == 0) {
_scValue->SetInt((int)_fadeColor);
return _scValue;
}
- else return CUIObject::scGetProperty(Name);
+ else return CUIObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) {
+HRESULT CUIWindow::scSetProperty(const char *name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "Name") == 0) {
+ if (strcmp(name, "Name") == 0) {
setName(Value->GetString());
return S_OK;
}
@@ -1017,7 +1017,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Menu
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Menu") == 0) {
+ else if (strcmp(name, "Menu") == 0) {
_isMenu = Value->GetBool();
return S_OK;
}
@@ -1025,7 +1025,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// InGame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "InGame") == 0) {
+ else if (strcmp(name, "InGame") == 0) {
_inGame = Value->GetBool();
return S_OK;
}
@@ -1033,7 +1033,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// PauseMusic
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "PauseMusic") == 0) {
+ else if (strcmp(name, "PauseMusic") == 0) {
_pauseMusic = Value->GetBool();
return S_OK;
}
@@ -1041,7 +1041,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// ClipContents
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "ClipContents") == 0) {
+ else if (strcmp(name, "ClipContents") == 0) {
_clipContents = Value->GetBool();
return S_OK;
}
@@ -1049,7 +1049,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Transparent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Transparent") == 0) {
+ else if (strcmp(name, "Transparent") == 0) {
_transparent = Value->GetBool();
return S_OK;
}
@@ -1057,7 +1057,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// FadeColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "FadeColor") == 0) {
+ else if (strcmp(name, "FadeColor") == 0) {
_fadeColor = (uint32)Value->GetInt();
_fadeBackground = (_fadeColor != 0);
return S_OK;
@@ -1066,7 +1066,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// Exclusive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "Exclusive") == 0) {
+ else if (strcmp(name, "Exclusive") == 0) {
if (Value->GetBool())
goExclusive();
else {
@@ -1079,7 +1079,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
// SystemExclusive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(Name, "SystemExclusive") == 0) {
+ else if (strcmp(name, "SystemExclusive") == 0) {
if (Value->GetBool())
goSystemExclusive();
else {
@@ -1089,7 +1089,7 @@ HRESULT CUIWindow::scSetProperty(const char *Name, CScValue *Value) { return S_OK;
}
- else return CUIObject::scSetProperty(Name, Value);
+ else return CUIObject::scSetProperty(name, Value);
}
diff --git a/engines/wintermute/UI/UIWindow.h b/engines/wintermute/UI/UIWindow.h index e86409e43c..e22a09027d 100644 --- a/engines/wintermute/UI/UIWindow.h +++ b/engines/wintermute/UI/UIWindow.h @@ -63,8 +63,8 @@ public: bool _dragging;
DECLARE_PERSISTENT(CUIWindow, CUIObject)
bool _transparent;
- HRESULT showWidget(const char *Name, bool Visible = true);
- HRESULT enableWidget(const char *Name, bool Enable = true);
+ HRESULT showWidget(const char *name, bool Visible = true);
+ HRESULT enableWidget(const char *name, bool Enable = true);
RECT _titleRect;
RECT _dragRect;
virtual HRESULT display(int OffsetX = 0, int OffsetY = 0);
@@ -82,9 +82,9 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *Name);
- virtual HRESULT scSetProperty(const char *Name, CScValue *Value);
- virtual HRESULT scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name);
+ virtual CScValue *scGetProperty(const char *name);
+ virtual HRESULT scSetProperty(const char *name, CScValue *Value);
+ virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/wme_debugger.h b/engines/wintermute/wme_debugger.h index e89f9e55a2..e6cc39a73b 100644 --- a/engines/wintermute/wme_debugger.h +++ b/engines/wintermute/wme_debugger.h @@ -108,7 +108,7 @@ class IWmeDebugObject { public:
virtual ~IWmeDebugObject() {}
virtual const char *DbgGetNativeClass() = 0;
- virtual IWmeDebugProp *DbgGetProperty(const char *Name) = 0;
+ virtual IWmeDebugProp *DbgGetProperty(const char *name) = 0;
};
//////////////////////////////////////////////////////////////////////////
|