mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-22 01:39:57 +00:00
WINTERMUTE: Rename FuncName->funcName in AdTalkNode, AdTalkHolder, AdTalkDef, AdSpriteSet, AdSentence and AdSceneState
This commit is contained in:
parent
831560d03b
commit
86513195d1
@ -123,7 +123,7 @@ CAdActor::~CAdActor() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdActor::LoadFile(const char *Filename) {
|
||||
HRESULT CAdActor::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdActor::LoadFile failed for file '%s'", Filename);
|
||||
@ -135,7 +135,7 @@ HRESULT CAdActor::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ACTOR file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ACTOR file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -183,7 +183,7 @@ TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF(ANIMATION)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdActor::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(ACTOR)
|
||||
TOKEN_TABLE(X)
|
||||
@ -241,7 +241,7 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_X:
|
||||
@ -291,19 +291,19 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
delete _walkSprite;
|
||||
_walkSprite = NULL;
|
||||
spr = new CAdSpriteSet(Game, this);
|
||||
if (!spr || FAILED(spr->LoadBuffer(params, true, AdGame->_texWalkLifeTime, CACHE_HALF))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadBuffer(params, true, AdGame->_texWalkLifeTime, CACHE_HALF))) cmd = PARSERR_GENERIC;
|
||||
else _walkSprite = spr;
|
||||
break;
|
||||
|
||||
case TOKEN_TALK:
|
||||
spr = new CAdSpriteSet(Game, this);
|
||||
if (!spr || FAILED(spr->LoadBuffer(params, true, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadBuffer(params, true, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
else _talkSprites.Add(spr);
|
||||
break;
|
||||
|
||||
case TOKEN_TALK_SPECIAL:
|
||||
spr = new CAdSpriteSet(Game, this);
|
||||
if (!spr || FAILED(spr->LoadBuffer(params, true, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadBuffer(params, true, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
else _talkSpritesEx.Add(spr);
|
||||
break;
|
||||
|
||||
@ -311,7 +311,7 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
delete _standSprite;
|
||||
_standSprite = NULL;
|
||||
spr = new CAdSpriteSet(Game, this);
|
||||
if (!spr || FAILED(spr->LoadBuffer(params, true, AdGame->_texStandLifeTime))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadBuffer(params, true, AdGame->_texStandLifeTime))) cmd = PARSERR_GENERIC;
|
||||
else _standSprite = spr;
|
||||
break;
|
||||
|
||||
@ -319,7 +319,7 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
delete _turnLeftSprite;
|
||||
_turnLeftSprite = NULL;
|
||||
spr = new CAdSpriteSet(Game, this);
|
||||
if (!spr || FAILED(spr->LoadBuffer(params, true))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadBuffer(params, true))) cmd = PARSERR_GENERIC;
|
||||
else _turnLeftSprite = spr;
|
||||
break;
|
||||
|
||||
@ -327,7 +327,7 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
delete _turnRightSprite;
|
||||
_turnRightSprite = NULL;
|
||||
spr = new CAdSpriteSet(Game, this);
|
||||
if (!spr || FAILED(spr->LoadBuffer(params, true))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadBuffer(params, true))) cmd = PARSERR_GENERIC;
|
||||
else _turnRightSprite = spr;
|
||||
break;
|
||||
|
||||
@ -338,7 +338,7 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -380,7 +380,7 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
_currentBlockRegion = NULL;
|
||||
CBRegion *rgn = new CBRegion(Game);
|
||||
CBRegion *crgn = new CBRegion(Game);
|
||||
if (!rgn || !crgn || FAILED(rgn->LoadBuffer(params, false))) {
|
||||
if (!rgn || !crgn || FAILED(rgn->loadBuffer(params, false))) {
|
||||
delete _blockRegion;
|
||||
delete _currentBlockRegion;
|
||||
_blockRegion = NULL;
|
||||
@ -401,7 +401,7 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
_currentWptGroup = NULL;
|
||||
CAdWaypointGroup *wpt = new CAdWaypointGroup(Game);
|
||||
CAdWaypointGroup *cwpt = new CAdWaypointGroup(Game);
|
||||
if (!wpt || !cwpt || FAILED(wpt->LoadBuffer(params, false))) {
|
||||
if (!wpt || !cwpt || FAILED(wpt->loadBuffer(params, false))) {
|
||||
delete _wptGroup;
|
||||
delete _currentWptGroup;
|
||||
_wptGroup = NULL;
|
||||
@ -433,7 +433,7 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_ANIMATION: {
|
||||
CAdSpriteSet *Anim = new CAdSpriteSet(Game, this);
|
||||
if (!Anim || FAILED(Anim->LoadBuffer(params, false))) cmd = PARSERR_GENERIC;
|
||||
if (!Anim || FAILED(Anim->loadBuffer(params, false))) cmd = PARSERR_GENERIC;
|
||||
else _anims.Add(Anim);
|
||||
}
|
||||
break;
|
||||
@ -573,17 +573,17 @@ HRESULT CAdActor::update() {
|
||||
_currentSprite = _animSprite2;
|
||||
}
|
||||
|
||||
if (_sentence && _state != STATE_TALKING) _sentence->Finish();
|
||||
if (_sentence && _state != STATE_TALKING) _sentence->finish();
|
||||
|
||||
// default: stand animation
|
||||
if (!_currentSprite) {
|
||||
if (_sprite) _currentSprite = _sprite;
|
||||
else {
|
||||
if (_standSprite) {
|
||||
_currentSprite = _standSprite->GetSprite(_dir);
|
||||
_currentSprite = _standSprite->getSprite(_dir);
|
||||
} else {
|
||||
CAdSpriteSet *Anim = GetAnimByName(_idleAnimName);
|
||||
if (Anim) _currentSprite = Anim->GetSprite(_dir);
|
||||
if (Anim) _currentSprite = Anim->getSprite(_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -613,10 +613,10 @@ HRESULT CAdActor::update() {
|
||||
_nextState = STATE_READY;
|
||||
} else {
|
||||
if (_turnLeftSprite) {
|
||||
_tempSprite2 = _turnLeftSprite->GetSprite(_dir);
|
||||
_tempSprite2 = _turnLeftSprite->getSprite(_dir);
|
||||
} else {
|
||||
CAdSpriteSet *Anim = GetAnimByName(_turnLeftAnimName);
|
||||
if (Anim) _tempSprite2 = Anim->GetSprite(_dir);
|
||||
if (Anim) _tempSprite2 = Anim->getSprite(_dir);
|
||||
}
|
||||
|
||||
if (_tempSprite2) {
|
||||
@ -642,10 +642,10 @@ HRESULT CAdActor::update() {
|
||||
_nextState = STATE_READY;
|
||||
} else {
|
||||
if (_turnRightSprite) {
|
||||
_tempSprite2 = _turnRightSprite->GetSprite(_dir);
|
||||
_tempSprite2 = _turnRightSprite->getSprite(_dir);
|
||||
} else {
|
||||
CAdSpriteSet *Anim = GetAnimByName(_turnRightAnimName);
|
||||
if (Anim) _tempSprite2 = Anim->GetSprite(_dir);
|
||||
if (Anim) _tempSprite2 = Anim->getSprite(_dir);
|
||||
}
|
||||
|
||||
if (_tempSprite2) {
|
||||
@ -687,12 +687,12 @@ HRESULT CAdActor::update() {
|
||||
bool TimeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= Game->_timer - _sentence->_startTime);
|
||||
if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ TimeIsUp)) {
|
||||
if (TimeIsUp) {
|
||||
_sentence->Finish();
|
||||
_sentence->finish();
|
||||
_tempSprite2 = NULL;
|
||||
_state = _nextState;
|
||||
_nextState = STATE_READY;
|
||||
} else {
|
||||
_tempSprite2 = GetTalkStance(_sentence->GetNextStance());
|
||||
_tempSprite2 = getTalkStance(_sentence->getNextStance());
|
||||
if (_tempSprite2) {
|
||||
_tempSprite2->Reset();
|
||||
_currentSprite = _tempSprite2;
|
||||
@ -712,10 +712,10 @@ HRESULT CAdActor::update() {
|
||||
if (_sprite) _currentSprite = _sprite;
|
||||
else {
|
||||
if (_standSprite) {
|
||||
_currentSprite = _standSprite->GetSprite(_dir);
|
||||
_currentSprite = _standSprite->getSprite(_dir);
|
||||
} else {
|
||||
CAdSpriteSet *Anim = GetAnimByName(_idleAnimName);
|
||||
if (Anim) _currentSprite = Anim->GetSprite(_dir);
|
||||
if (Anim) _currentSprite = Anim->getSprite(_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -769,10 +769,10 @@ void CAdActor::FollowPath() {
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CAdActor::GetNextStep() {
|
||||
if (_walkSprite) {
|
||||
_currentSprite = _walkSprite->GetSprite(_dir);
|
||||
_currentSprite = _walkSprite->getSprite(_dir);
|
||||
} else {
|
||||
CAdSpriteSet *Anim = GetAnimByName(_walkAnimName);
|
||||
if (Anim) _currentSprite = Anim->GetSprite(_dir);
|
||||
if (Anim) _currentSprite = Anim->getSprite(_dir);
|
||||
}
|
||||
|
||||
if (!_currentSprite) return;
|
||||
@ -943,9 +943,9 @@ HRESULT CAdActor::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
|
||||
for (int i = 0; i < _anims.GetSize(); i++) {
|
||||
if (scumm_stricmp(_anims[i]->_name, AnimName) == 0) {
|
||||
// invalidate sprites in use
|
||||
if (_anims[i]->ContainsSprite(_tempSprite2)) _tempSprite2 = NULL;
|
||||
if (_anims[i]->ContainsSprite(_currentSprite)) _currentSprite = NULL;
|
||||
if (_anims[i]->ContainsSprite(_animSprite2)) _animSprite2 = NULL;
|
||||
if (_anims[i]->containsSprite(_tempSprite2)) _tempSprite2 = NULL;
|
||||
if (_anims[i]->containsSprite(_currentSprite)) _currentSprite = NULL;
|
||||
if (_anims[i]->containsSprite(_animSprite2)) _animSprite2 = NULL;
|
||||
|
||||
delete _anims[i];
|
||||
_anims[i] = NULL;
|
||||
@ -1101,14 +1101,14 @@ const char *CAdActor::scToString() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CBSprite *CAdActor::GetTalkStance(const char *Stance) {
|
||||
CBSprite *CAdActor::getTalkStance(const char *Stance) {
|
||||
// forced stance?
|
||||
if (_forcedTalkAnimName && !_forcedTalkAnimUsed) {
|
||||
_forcedTalkAnimUsed = true;
|
||||
delete _animSprite;
|
||||
_animSprite = new CBSprite(Game, this);
|
||||
if (_animSprite) {
|
||||
HRESULT res = _animSprite->LoadFile(_forcedTalkAnimName);
|
||||
HRESULT res = _animSprite->loadFile(_forcedTalkAnimName);
|
||||
if (FAILED(res)) {
|
||||
Game->LOG(res, "CAdActor::GetTalkStance: error loading talk sprite (object:\"%s\" sprite:\"%s\")", _name, _forcedTalkAnimName);
|
||||
delete _animSprite;
|
||||
@ -1126,7 +1126,7 @@ CBSprite *CAdActor::GetTalkStance(const char *Stance) {
|
||||
|
||||
// do we have an animation with this name?
|
||||
CAdSpriteSet *Anim = GetAnimByName(Stance);
|
||||
if (Anim) Ret = Anim->GetSprite(_dir);
|
||||
if (Anim) Ret = Anim->getSprite(_dir);
|
||||
|
||||
// not - get a random talk
|
||||
if (!Ret) {
|
||||
@ -1138,12 +1138,12 @@ CBSprite *CAdActor::GetTalkStance(const char *Stance) {
|
||||
|
||||
if (TalkAnims.GetSize() > 0) {
|
||||
int rnd = g_wintermute->randInt(0, TalkAnims.GetSize() - 1);
|
||||
Ret = TalkAnims[rnd]->GetSprite(_dir);
|
||||
Ret = TalkAnims[rnd]->getSprite(_dir);
|
||||
} else {
|
||||
if (_standSprite) Ret = _standSprite->GetSprite(_dir);
|
||||
if (_standSprite) Ret = _standSprite->getSprite(_dir);
|
||||
else {
|
||||
Anim = GetAnimByName(_idleAnimName);
|
||||
if (Anim) Ret = Anim->GetSprite(_dir);
|
||||
if (Anim) Ret = Anim->getSprite(_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1158,7 +1158,7 @@ CBSprite *CAdActor::GetTalkStanceOld(const char *Stance) {
|
||||
// search special stances
|
||||
for (int i = 0; i < _talkSpritesEx.GetSize(); i++) {
|
||||
if (scumm_stricmp(_talkSpritesEx[i]->_name, Stance) == 0) {
|
||||
ret = _talkSpritesEx[i]->GetSprite(_dir);
|
||||
ret = _talkSpritesEx[i]->getSprite(_dir);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1166,7 +1166,7 @@ CBSprite *CAdActor::GetTalkStanceOld(const char *Stance) {
|
||||
// search generic stances
|
||||
for (int i = 0; i < _talkSprites.GetSize(); i++) {
|
||||
if (scumm_stricmp(_talkSprites[i]->_name, Stance) == 0) {
|
||||
ret = _talkSprites[i]->GetSprite(_dir);
|
||||
ret = _talkSprites[i]->getSprite(_dir);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1175,11 +1175,11 @@ CBSprite *CAdActor::GetTalkStanceOld(const char *Stance) {
|
||||
|
||||
// not a valid stance? get a random one
|
||||
if (ret == NULL) {
|
||||
if (_talkSprites.GetSize() < 1) ret = _standSprite->GetSprite(_dir);
|
||||
if (_talkSprites.GetSize() < 1) ret = _standSprite->getSprite(_dir);
|
||||
else {
|
||||
// TODO: remember last
|
||||
int rnd = g_wintermute->randInt(0, _talkSprites.GetSize() - 1);
|
||||
ret = _talkSprites[rnd]->GetSprite(_dir);
|
||||
ret = _talkSprites[rnd]->getSprite(_dir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1241,10 +1241,10 @@ TDirection CAdActor::AngleToDirection(int Angle) {
|
||||
int CAdActor::getHeight() {
|
||||
// if no current sprite is set, set some
|
||||
if (_currentSprite == NULL) {
|
||||
if (_standSprite) _currentSprite = _standSprite->GetSprite(_dir);
|
||||
if (_standSprite) _currentSprite = _standSprite->getSprite(_dir);
|
||||
else {
|
||||
CAdSpriteSet *Anim = GetAnimByName(_idleAnimName);
|
||||
if (Anim) _currentSprite = Anim->GetSprite(_dir);
|
||||
if (Anim) _currentSprite = Anim->getSprite(_dir);
|
||||
}
|
||||
}
|
||||
// and get height
|
||||
@ -1285,7 +1285,7 @@ HRESULT CAdActor::MergeAnims(const char *AnimsFilename) {
|
||||
switch (cmd) {
|
||||
case TOKEN_ANIMATION: {
|
||||
CAdSpriteSet *Anim = new CAdSpriteSet(Game, this);
|
||||
if (!Anim || FAILED(Anim->LoadBuffer(params, false))) {
|
||||
if (!Anim || FAILED(Anim->loadBuffer(params, false))) {
|
||||
cmd = PARSERR_GENERIC;
|
||||
Ret = E_FAIL;
|
||||
} else _anims.Add(Anim);
|
||||
@ -1302,7 +1302,7 @@ HRESULT CAdActor::PlayAnim(const char *Filename) {
|
||||
// if we have an anim with this name, use it
|
||||
CAdSpriteSet *Anim = GetAnimByName(Filename);
|
||||
if (Anim) {
|
||||
_animSprite2 = Anim->GetSprite(_dir);
|
||||
_animSprite2 = Anim->getSprite(_dir);
|
||||
if (_animSprite2) {
|
||||
_animSprite2->Reset();
|
||||
_state = STATE_PLAYING_ANIM_SET;
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
TDirection AngleToDirection(int Angle);
|
||||
DECLARE_PERSISTENT(CAdActor, CAdTalkHolder)
|
||||
virtual int getHeight();
|
||||
CBSprite *GetTalkStance(const char *Stance);
|
||||
CBSprite *getTalkStance(const char *Stance);
|
||||
virtual void GoTo(int X, int Y, TDirection AfterWalkDir = DI_NONE);
|
||||
CBPoint *_targetPoint;
|
||||
virtual HRESULT update();
|
||||
@ -67,8 +67,8 @@ public:
|
||||
TDirection _dir;
|
||||
CAdActor(CBGame *inGame/*=NULL*/);
|
||||
virtual ~CAdActor();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
|
||||
// new anim system
|
||||
Common::String _talkAnimName;
|
||||
|
@ -84,7 +84,7 @@ CAdEntity::~CAdEntity() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdEntity::LoadFile(const char *Filename) {
|
||||
HRESULT CAdEntity::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdEntity::LoadFile failed for file '%s'", Filename);
|
||||
@ -96,7 +96,7 @@ HRESULT CAdEntity::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ENTITY file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ENTITY file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -150,7 +150,7 @@ TOKEN_DEF(WALK_TO_DIR)
|
||||
TOKEN_DEF(SAVE_STATE)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdEntity::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(ENTITY)
|
||||
TOKEN_TABLE(SPRITE)
|
||||
@ -214,7 +214,7 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_X:
|
||||
@ -229,21 +229,21 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
delete _sprite;
|
||||
_sprite = NULL;
|
||||
spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
else _sprite = spr;
|
||||
}
|
||||
break;
|
||||
|
||||
case TOKEN_TALK: {
|
||||
spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
else _talkSprites.Add(spr);
|
||||
}
|
||||
break;
|
||||
|
||||
case TOKEN_TALK_SPECIAL: {
|
||||
spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
else _talkSpritesEx.Add(spr);
|
||||
}
|
||||
break;
|
||||
@ -306,7 +306,7 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -321,7 +321,7 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
if (_region) Game->UnregisterObject(_region);
|
||||
_region = NULL;
|
||||
CBRegion *rgn = new CBRegion(Game);
|
||||
if (!rgn || FAILED(rgn->LoadBuffer(params, false))) cmd = PARSERR_GENERIC;
|
||||
if (!rgn || FAILED(rgn->loadBuffer(params, false))) cmd = PARSERR_GENERIC;
|
||||
else {
|
||||
_region = rgn;
|
||||
Game->RegisterObject(_region);
|
||||
@ -336,7 +336,7 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
_currentBlockRegion = NULL;
|
||||
CBRegion *rgn = new CBRegion(Game);
|
||||
CBRegion *crgn = new CBRegion(Game);
|
||||
if (!rgn || !crgn || FAILED(rgn->LoadBuffer(params, false))) {
|
||||
if (!rgn || !crgn || FAILED(rgn->loadBuffer(params, false))) {
|
||||
delete _blockRegion;
|
||||
_blockRegion = NULL;
|
||||
delete _currentBlockRegion;
|
||||
@ -357,7 +357,7 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
_currentWptGroup = NULL;
|
||||
CAdWaypointGroup *wpt = new CAdWaypointGroup(Game);
|
||||
CAdWaypointGroup *cwpt = new CAdWaypointGroup(Game);
|
||||
if (!wpt || !cwpt || FAILED(wpt->LoadBuffer(params, false))) {
|
||||
if (!wpt || !cwpt || FAILED(wpt->loadBuffer(params, false))) {
|
||||
delete _wptGroup;
|
||||
_wptGroup = NULL;
|
||||
delete _currentWptGroup;
|
||||
@ -381,7 +381,7 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
_sprite = NULL;
|
||||
if (Game->_editorMode) {
|
||||
spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile("entity_sound.sprite"))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile("entity_sound.sprite"))) cmd = PARSERR_GENERIC;
|
||||
else _sprite = spr;
|
||||
}
|
||||
if (Game->_editorMode) _editorOnly = true;
|
||||
@ -543,7 +543,7 @@ HRESULT CAdEntity::update() {
|
||||
_currentSprite = _animSprite;
|
||||
}
|
||||
|
||||
if (_sentence && _state != STATE_TALKING) _sentence->Finish();
|
||||
if (_sentence && _state != STATE_TALKING) _sentence->finish();
|
||||
|
||||
// default: stand animation
|
||||
if (!_currentSprite) _currentSprite = _sprite;
|
||||
@ -568,11 +568,11 @@ HRESULT CAdEntity::update() {
|
||||
bool TimeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= Game->_timer - _sentence->_startTime);
|
||||
if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ TimeIsUp)) {
|
||||
if (TimeIsUp) {
|
||||
_sentence->Finish();
|
||||
_sentence->finish();
|
||||
_tempSprite2 = NULL;
|
||||
_state = STATE_READY;
|
||||
} else {
|
||||
_tempSprite2 = GetTalkStance(_sentence->GetNextStance());
|
||||
_tempSprite2 = getTalkStance(_sentence->getNextStance());
|
||||
if (_tempSprite2) {
|
||||
_tempSprite2->Reset();
|
||||
_currentSprite = _tempSprite2;
|
||||
@ -1013,7 +1013,7 @@ HRESULT CAdEntity::SetSprite(const char *Filename) {
|
||||
delete _sprite;
|
||||
_sprite = NULL;
|
||||
CBSprite *spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile(Filename))) {
|
||||
if (!spr || FAILED(spr->loadFile(Filename))) {
|
||||
delete _sprite;
|
||||
_sprite = NULL;
|
||||
return E_FAIL;
|
||||
|
@ -51,8 +51,8 @@ public:
|
||||
virtual HRESULT display();
|
||||
CAdEntity(CBGame *inGame);
|
||||
virtual ~CAdEntity();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
TEntityType _subtype;
|
||||
|
||||
// scripting interface
|
||||
|
@ -268,8 +268,8 @@ HRESULT CAdGame::ChangeScene(const char *Filename, bool FadeIn) {
|
||||
HRESULT ret;
|
||||
if (_initialScene && _dEBUG_DebugMode && _debugStartupScene) {
|
||||
_initialScene = false;
|
||||
ret = _scene->LoadFile(_debugStartupScene);
|
||||
} else ret = _scene->LoadFile(Filename);
|
||||
ret = _scene->loadFile(_debugStartupScene);
|
||||
} else ret = _scene->loadFile(Filename);
|
||||
|
||||
if (SUCCEEDED(ret)) {
|
||||
// invalidate references to the original scene
|
||||
@ -347,7 +347,7 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
|
||||
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);
|
||||
} else {
|
||||
@ -364,7 +364,7 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
|
||||
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);
|
||||
} else {
|
||||
@ -704,7 +704,7 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
|
||||
|
||||
Game->UnregisterObject(_responseBox);
|
||||
_responseBox = new CAdResponseBox(Game);
|
||||
if (_responseBox && !FAILED(_responseBox->LoadFile(Filename))) {
|
||||
if (_responseBox && !FAILED(_responseBox->loadFile(Filename))) {
|
||||
RegisterObject(_responseBox);
|
||||
Stack->PushBool(true);
|
||||
} else {
|
||||
@ -724,7 +724,7 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
|
||||
|
||||
Game->UnregisterObject(_inventoryBox);
|
||||
_inventoryBox = new CAdInventoryBox(Game);
|
||||
if (_inventoryBox && !FAILED(_inventoryBox->LoadFile(Filename))) {
|
||||
if (_inventoryBox && !FAILED(_inventoryBox->loadFile(Filename))) {
|
||||
RegisterObject(_inventoryBox);
|
||||
Stack->PushBool(true);
|
||||
} else {
|
||||
@ -1114,7 +1114,7 @@ HRESULT CAdGame::showCursor() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdGame::LoadFile(const char *Filename) {
|
||||
HRESULT CAdGame::loadFile(const char *Filename) {
|
||||
byte *Buffer = _fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdGame::LoadFile failed for file '%s'", Filename);
|
||||
@ -1126,7 +1126,7 @@ HRESULT CAdGame::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing GAME file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing GAME file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -1150,7 +1150,7 @@ TOKEN_DEF(STARTUP_SCENE)
|
||||
TOKEN_DEF(DEBUG_STARTUP_SCENE)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(GAME)
|
||||
TOKEN_TABLE(AD_GAME)
|
||||
@ -1174,7 +1174,7 @@ HRESULT CAdGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_GAME:
|
||||
if (FAILED(CBGame::LoadBuffer(params, false))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(CBGame::loadBuffer(params, false))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_AD_GAME:
|
||||
@ -1183,7 +1183,7 @@ HRESULT CAdGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_RESPONSE_BOX:
|
||||
delete _responseBox;
|
||||
_responseBox = new CAdResponseBox(Game);
|
||||
if (_responseBox && !FAILED(_responseBox->LoadFile((char *)params2)))
|
||||
if (_responseBox && !FAILED(_responseBox->loadFile((char *)params2)))
|
||||
RegisterObject(_responseBox);
|
||||
else {
|
||||
delete _responseBox;
|
||||
@ -1195,7 +1195,7 @@ HRESULT CAdGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_INVENTORY_BOX:
|
||||
delete _inventoryBox;
|
||||
_inventoryBox = new CAdInventoryBox(Game);
|
||||
if (_inventoryBox && !FAILED(_inventoryBox->LoadFile((char *)params2)))
|
||||
if (_inventoryBox && !FAILED(_inventoryBox->loadFile((char *)params2)))
|
||||
RegisterObject(_inventoryBox);
|
||||
else {
|
||||
delete _inventoryBox;
|
||||
@ -1423,7 +1423,7 @@ HRESULT CAdGame::LoadItemsBuffer(byte *Buffer, bool Merge) {
|
||||
switch (cmd) {
|
||||
case TOKEN_ITEM: {
|
||||
CAdItem *item = new CAdItem(Game);
|
||||
if (item && !FAILED(item->LoadBuffer(params, false))) {
|
||||
if (item && !FAILED(item->loadBuffer(params, false))) {
|
||||
// delete item with the same name, if exists
|
||||
if (Merge) {
|
||||
CAdItem *PrevItem = GetItemByName(item->_name);
|
||||
@ -1496,7 +1496,7 @@ HRESULT CAdGame::WindowLoadHook(CUIWindow *Win, char **Buffer, char **params) {
|
||||
switch (cmd) {
|
||||
case TOKEN_ENTITY_CONTAINER: {
|
||||
CUIEntity *ent = new CUIEntity(Game);
|
||||
if (!ent || FAILED(ent->LoadBuffer((byte *)*params, false))) {
|
||||
if (!ent || FAILED(ent->loadBuffer((byte *)*params, false))) {
|
||||
delete ent;
|
||||
ent = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
|
@ -140,8 +140,8 @@ public:
|
||||
CBArray<CAdResponseContext *, CAdResponseContext *> _responsesBranch;
|
||||
CBArray<CAdResponseContext *, CAdResponseContext *> _responsesGame;
|
||||
|
||||
virtual HRESULT LoadFile(const char *Filename);
|
||||
virtual HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT loadFile(const char *Filename);
|
||||
virtual HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
|
||||
HRESULT LoadItemsFile(const char *Filename, bool Merge = false);
|
||||
HRESULT LoadItemsBuffer(byte *Buffer, bool Merge = false);
|
||||
|
@ -154,7 +154,7 @@ HRESULT CAdInventoryBox::display() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdInventoryBox::LoadFile(const char *Filename) {
|
||||
HRESULT CAdInventoryBox::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdInventoryBox::LoadFile failed for file '%s'", Filename);
|
||||
@ -166,7 +166,7 @@ HRESULT CAdInventoryBox::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing INVENTORY_BOX file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing INVENTORY_BOX file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -192,7 +192,7 @@ TOKEN_DEF(HIDE_SELECTED)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdInventoryBox::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(INVENTORY_BOX)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -227,7 +227,7 @@ HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -241,7 +241,7 @@ HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_WINDOW:
|
||||
delete _window;
|
||||
_window = new CUIWindow(Game);
|
||||
if (!_window || FAILED(_window->LoadBuffer(params, false))) {
|
||||
if (!_window || FAILED(_window->loadBuffer(params, false))) {
|
||||
delete _window;
|
||||
_window = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
|
@ -53,8 +53,8 @@ public:
|
||||
CUIWindow *_window;
|
||||
CAdInventoryBox(CBGame *inGame);
|
||||
virtual ~CAdInventoryBox();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
};
|
||||
|
||||
|
@ -84,7 +84,7 @@ CAdItem::~CAdItem() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdItem::LoadFile(const char *Filename) {
|
||||
HRESULT CAdItem::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdItem::LoadFile failed for file '%s'", Filename);
|
||||
@ -96,7 +96,7 @@ HRESULT CAdItem::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ITEM file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ITEM file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -134,7 +134,7 @@ TOKEN_DEF(AMOUNT_STRING)
|
||||
TOKEN_DEF(AMOUNT)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdItem::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(ITEM)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -180,7 +180,7 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -199,7 +199,7 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_SPRITE:
|
||||
delete _sprite;
|
||||
_sprite = new CBSprite(Game, this);
|
||||
if (!_sprite || FAILED(_sprite->LoadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
|
||||
if (!_sprite || FAILED(_sprite->loadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
|
||||
delete _sprite;
|
||||
cmd = PARSERR_GENERIC;
|
||||
}
|
||||
@ -209,7 +209,7 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_SPRITE_HOVER:
|
||||
delete _spriteHover;
|
||||
_spriteHover = new CBSprite(Game, this);
|
||||
if (!_spriteHover || FAILED(_spriteHover->LoadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
|
||||
if (!_spriteHover || FAILED(_spriteHover->loadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
|
||||
delete _spriteHover;
|
||||
cmd = PARSERR_GENERIC;
|
||||
}
|
||||
@ -243,14 +243,14 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_TALK: {
|
||||
CBSprite *spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, ((CAdGame *)Game)->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, ((CAdGame *)Game)->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
else _talkSprites.Add(spr);
|
||||
}
|
||||
break;
|
||||
|
||||
case TOKEN_TALK_SPECIAL: {
|
||||
CBSprite *spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, ((CAdGame *)Game)->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, ((CAdGame *)Game)->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
|
||||
else _talkSpritesEx.Add(spr);
|
||||
}
|
||||
break;
|
||||
@ -258,7 +258,7 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursorNormal;
|
||||
_cursorNormal = new CBSprite(Game);
|
||||
if (!_cursorNormal || FAILED(_cursorNormal->LoadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
|
||||
if (!_cursorNormal || FAILED(_cursorNormal->loadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
|
||||
delete _cursorNormal;
|
||||
_cursorNormal = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -268,7 +268,7 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR_HOVER:
|
||||
delete _cursorHover;
|
||||
_cursorHover = new CBSprite(Game);
|
||||
if (!_cursorHover || FAILED(_cursorHover->LoadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
|
||||
if (!_cursorHover || FAILED(_cursorHover->loadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
|
||||
delete _cursorHover;
|
||||
_cursorHover = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -333,7 +333,7 @@ HRESULT CAdItem::update() {
|
||||
_currentSprite = _animSprite;
|
||||
}
|
||||
|
||||
if (_sentence && _state != STATE_TALKING) _sentence->Finish();
|
||||
if (_sentence && _state != STATE_TALKING) _sentence->finish();
|
||||
|
||||
// default: stand animation
|
||||
if (!_currentSprite) _currentSprite = _sprite;
|
||||
@ -360,11 +360,11 @@ HRESULT CAdItem::update() {
|
||||
bool TimeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= Game->_timer - _sentence->_startTime);
|
||||
if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ TimeIsUp)) {
|
||||
if (TimeIsUp) {
|
||||
_sentence->Finish();
|
||||
_sentence->finish();
|
||||
_tempSprite2 = NULL;
|
||||
_state = STATE_READY;
|
||||
} else {
|
||||
_tempSprite2 = GetTalkStance(_sentence->GetNextStance());
|
||||
_tempSprite2 = getTalkStance(_sentence->getNextStance());
|
||||
if (_tempSprite2) {
|
||||
_tempSprite2->Reset();
|
||||
_currentSprite = _tempSprite2;
|
||||
@ -444,7 +444,7 @@ HRESULT CAdItem::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
|
||||
delete _spriteHover;
|
||||
_spriteHover = NULL;
|
||||
CBSprite *spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile(Filename))) {
|
||||
if (!spr || FAILED(spr->loadFile(Filename))) {
|
||||
Stack->PushBool(false);
|
||||
Script->RuntimeError("Item.SetHoverSprite failed for file '%s'", Filename);
|
||||
} else {
|
||||
@ -487,7 +487,7 @@ HRESULT CAdItem::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
|
||||
delete _cursorNormal;
|
||||
_cursorNormal = NULL;
|
||||
CBSprite *spr = new CBSprite(Game);
|
||||
if (!spr || FAILED(spr->LoadFile(Filename))) {
|
||||
if (!spr || FAILED(spr->loadFile(Filename))) {
|
||||
Stack->PushBool(false);
|
||||
Script->RuntimeError("Item.SetNormalCursor failed for file '%s'", Filename);
|
||||
} else {
|
||||
@ -530,7 +530,7 @@ HRESULT CAdItem::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
|
||||
delete _cursorHover;
|
||||
_cursorHover = NULL;
|
||||
CBSprite *spr = new CBSprite(Game);
|
||||
if (!spr || FAILED(spr->LoadFile(Filename))) {
|
||||
if (!spr || FAILED(spr->loadFile(Filename))) {
|
||||
Stack->PushBool(false);
|
||||
Script->RuntimeError("Item.SetHoverCursor failed for file '%s'", Filename);
|
||||
} else {
|
||||
|
@ -55,8 +55,8 @@ public:
|
||||
CBSprite *_cursorHover;
|
||||
CAdItem(CBGame *inGame);
|
||||
virtual ~CAdItem();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
|
||||
// scripting interface
|
||||
virtual CScValue *scGetProperty(const char *Name);
|
||||
|
@ -61,7 +61,7 @@ CAdLayer::~CAdLayer() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdLayer::LoadFile(const char *Filename) {
|
||||
HRESULT CAdLayer::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdLayer::LoadFile failed for file '%s'", Filename);
|
||||
@ -73,7 +73,7 @@ HRESULT CAdLayer::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing LAYER file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing LAYER file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -100,7 +100,7 @@ TOKEN_DEF(CLOSE_UP)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdLayer::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdLayer::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(LAYER)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -134,7 +134,7 @@ HRESULT CAdLayer::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -168,7 +168,7 @@ HRESULT CAdLayer::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_REGION: {
|
||||
CAdRegion *region = new CAdRegion(Game);
|
||||
CAdSceneNode *node = new CAdSceneNode(Game);
|
||||
if (!region || !node || FAILED(region->LoadBuffer(params, false))) {
|
||||
if (!region || !node || FAILED(region->loadBuffer(params, false))) {
|
||||
cmd = PARSERR_GENERIC;
|
||||
delete region;
|
||||
delete node;
|
||||
@ -185,7 +185,7 @@ HRESULT CAdLayer::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
CAdEntity *entity = new CAdEntity(Game);
|
||||
CAdSceneNode *node = new CAdSceneNode(Game);
|
||||
if (entity) entity->_zoomable = false; // scene entites default to NOT zoom
|
||||
if (!entity || !node || FAILED(entity->LoadBuffer(params, false))) {
|
||||
if (!entity || !node || FAILED(entity->loadBuffer(params, false))) {
|
||||
cmd = PARSERR_GENERIC;
|
||||
delete entity;
|
||||
delete node;
|
||||
|
@ -42,8 +42,8 @@ public:
|
||||
CAdLayer(CBGame *inGame);
|
||||
virtual ~CAdLayer();
|
||||
CBArray<CAdSceneNode *, CAdSceneNode *> _nodes;
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
|
||||
// scripting interface
|
||||
|
@ -159,7 +159,7 @@ HRESULT CAdObject::playAnim(const char *Filename) {
|
||||
Game->LOG(0, "CAdObject::PlayAnim: error creating temp sprite (object:\"%s\" sprite:\"%s\")", _name, Filename);
|
||||
return E_FAIL;
|
||||
}
|
||||
HRESULT res = _animSprite->LoadFile(Filename);
|
||||
HRESULT res = _animSprite->loadFile(Filename);
|
||||
if (FAILED(res)) {
|
||||
Game->LOG(res, "CAdObject::PlayAnim: error loading temp sprite (object:\"%s\" sprite:\"%s\")", _name, Filename);
|
||||
delete _animSprite;
|
||||
@ -226,7 +226,7 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(Name, "StopTalk") == 0 || strcmp(Name, "StopTalking") == 0) {
|
||||
Stack->CorrectParams(0);
|
||||
if (_sentence) _sentence->Finish();
|
||||
if (_sentence) _sentence->finish();
|
||||
if (_state == STATE_TALKING) {
|
||||
_state = _nextState;
|
||||
_nextState = STATE_READY;
|
||||
@ -490,7 +490,7 @@ HRESULT CAdObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
|
||||
HRESULT res;
|
||||
CAdEntity *Ent = new CAdEntity(Game);
|
||||
if (FAILED(res = Ent->LoadFile(Filename))) {
|
||||
if (FAILED(res = Ent->loadFile(Filename))) {
|
||||
delete Ent;
|
||||
Ent = NULL;
|
||||
Script->RuntimeError("AddAttachment() failed loading entity '%s'", Filename);
|
||||
@ -837,9 +837,9 @@ void CAdObject::talk(const char *Text, const char *Sound, uint32 Duration, const
|
||||
delete(_sentence->_sound);
|
||||
_sentence->_sound = NULL;
|
||||
|
||||
_sentence->SetText(Text);
|
||||
_sentence->setText(Text);
|
||||
Game->_stringTable->Expand(&_sentence->_text);
|
||||
_sentence->SetStances(Stances);
|
||||
_sentence->setStances(Stances);
|
||||
_sentence->_duration = Duration;
|
||||
_sentence->_align = Align;
|
||||
_sentence->_startTime = Game->_timer;
|
||||
@ -863,7 +863,7 @@ void CAdObject::talk(const char *Text, const char *Sound, uint32 Duration, const
|
||||
if (Sound) {
|
||||
CBSound *snd = new CBSound(Game);
|
||||
if (snd && SUCCEEDED(snd->setSound(Sound, SOUND_SPEECH, true))) {
|
||||
_sentence->SetSound(snd);
|
||||
_sentence->setSound(snd);
|
||||
if (_sentence->_duration <= 0) {
|
||||
uint32 Length = snd->getLength();
|
||||
if (Length != 0) _sentence->_duration = Length;
|
||||
@ -927,7 +927,7 @@ void CAdObject::talk(const char *Text, const char *Sound, uint32 Duration, const
|
||||
_sentence->_fixedPos = !_subtitlesModRelative;
|
||||
|
||||
|
||||
_sentence->SetupTalkFile(Sound);
|
||||
_sentence->setupTalkFile(Sound);
|
||||
|
||||
_state = STATE_TALKING;
|
||||
|
||||
@ -941,7 +941,7 @@ HRESULT CAdObject::reset() {
|
||||
delete _animSprite;
|
||||
_animSprite = NULL;
|
||||
} else if (_state == STATE_TALKING && _sentence) {
|
||||
_sentence->Finish();
|
||||
_sentence->finish();
|
||||
}
|
||||
|
||||
_state = _nextState = STATE_READY;
|
||||
|
@ -54,7 +54,7 @@ CAdRegion::~CAdRegion() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdRegion::LoadFile(const char *Filename) {
|
||||
HRESULT CAdRegion::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdRegion::LoadFile failed for file '%s'", Filename);
|
||||
@ -66,7 +66,7 @@ HRESULT CAdRegion::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -95,7 +95,7 @@ TOKEN_DEF(PROPERTY)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdRegion::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdRegion::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(REGION)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -136,7 +136,7 @@ HRESULT CAdRegion::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
|
@ -42,8 +42,8 @@ public:
|
||||
bool _decoration;
|
||||
CAdRegion(CBGame *inGame);
|
||||
virtual ~CAdRegion();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
|
||||
// scripting interface
|
||||
|
@ -75,7 +75,7 @@ void CAdResponse::SetText(const char *Text) {
|
||||
HRESULT CAdResponse::SetIcon(const char *Filename) {
|
||||
delete _icon;
|
||||
_icon = new CBSprite(Game);
|
||||
if (!_icon || FAILED(_icon->LoadFile(Filename))) {
|
||||
if (!_icon || FAILED(_icon->loadFile(Filename))) {
|
||||
Game->LOG(0, "CAdResponse::SetIcon failed for file '%s'", Filename);
|
||||
delete _icon;
|
||||
_icon = NULL;
|
||||
@ -99,7 +99,7 @@ HRESULT CAdResponse::SetFont(const char *Filename) {
|
||||
HRESULT CAdResponse::SetIconHover(const char *Filename) {
|
||||
delete _iconHover;
|
||||
_iconHover = new CBSprite(Game);
|
||||
if (!_iconHover || FAILED(_iconHover->LoadFile(Filename))) {
|
||||
if (!_iconHover || FAILED(_iconHover->loadFile(Filename))) {
|
||||
Game->LOG(0, "CAdResponse::SetIconHover failed for file '%s'", Filename);
|
||||
delete _iconHover;
|
||||
_iconHover = NULL;
|
||||
@ -113,7 +113,7 @@ HRESULT CAdResponse::SetIconHover(const char *Filename) {
|
||||
HRESULT CAdResponse::SetIconPressed(const char *Filename) {
|
||||
delete _iconPressed;
|
||||
_iconPressed = new CBSprite(Game);
|
||||
if (!_iconPressed || FAILED(_iconPressed->LoadFile(Filename))) {
|
||||
if (!_iconPressed || FAILED(_iconPressed->loadFile(Filename))) {
|
||||
Game->LOG(0, "CAdResponse::SetIconPressed failed for file '%s'", Filename);
|
||||
delete _iconPressed;
|
||||
_iconPressed = NULL;
|
||||
|
@ -187,7 +187,7 @@ HRESULT CAdResponseBox::CreateButtons() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdResponseBox::LoadFile(const char *Filename) {
|
||||
HRESULT CAdResponseBox::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdResponseBox::LoadFile failed for file '%s'", Filename);
|
||||
@ -199,7 +199,7 @@ HRESULT CAdResponseBox::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing RESPONSE_BOX file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing RESPONSE_BOX file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -223,7 +223,7 @@ TOKEN_DEF(VERTICAL_ALIGN)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdResponseBox::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdResponseBox::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(RESPONSE_BOX)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -255,13 +255,13 @@ HRESULT CAdResponseBox::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_WINDOW:
|
||||
delete _window;
|
||||
_window = new CUIWindow(Game);
|
||||
if (!_window || FAILED(_window->LoadBuffer(params, false))) {
|
||||
if (!_window || FAILED(_window->loadBuffer(params, false))) {
|
||||
delete _window;
|
||||
_window = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -311,7 +311,7 @@ HRESULT CAdResponseBox::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
|
@ -75,8 +75,8 @@ public:
|
||||
RECT _responseArea;
|
||||
int _verticalAlign;
|
||||
TTextAlign _align;
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
};
|
||||
|
||||
|
@ -53,7 +53,7 @@ CAdRotLevel::~CAdRotLevel() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdRotLevel::LoadFile(const char *Filename) {
|
||||
HRESULT CAdRotLevel::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdRotLevel::LoadFile failed for file '%s'", Filename);
|
||||
@ -65,7 +65,7 @@ HRESULT CAdRotLevel::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ROTATION_LEVEL file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ROTATION_LEVEL file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -82,7 +82,7 @@ TOKEN_DEF(ROTATION)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdRotLevel::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdRotLevel::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(ROTATION_LEVEL)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -106,7 +106,7 @@ HRESULT CAdRotLevel::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_X:
|
||||
|
@ -40,8 +40,8 @@ public:
|
||||
virtual ~CAdRotLevel();
|
||||
float _rotation;
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
};
|
||||
|
||||
} // end of namespace WinterMute
|
||||
|
@ -51,7 +51,7 @@ CAdScaleLevel::~CAdScaleLevel() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdScaleLevel::LoadFile(const char *Filename) {
|
||||
HRESULT CAdScaleLevel::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdScaleLevel::LoadFile failed for file '%s'", Filename);
|
||||
@ -63,7 +63,7 @@ HRESULT CAdScaleLevel::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCALE_LEVEL file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCALE_LEVEL file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -80,7 +80,7 @@ TOKEN_DEF(SCALE)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdScaleLevel::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdScaleLevel::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(SCALE_LEVEL)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -104,7 +104,7 @@ HRESULT CAdScaleLevel::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_Y:
|
||||
|
@ -41,8 +41,8 @@ public:
|
||||
CAdScaleLevel(CBGame *inGame);
|
||||
virtual ~CAdScaleLevel();
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
};
|
||||
|
||||
} // end of namespace WinterMute
|
||||
|
@ -503,7 +503,7 @@ HRESULT CAdScene::InitLoop() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdScene::LoadFile(const char *Filename) {
|
||||
HRESULT CAdScene::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdScene::LoadFile failed for file '%s'", Filename);
|
||||
@ -516,7 +516,7 @@ HRESULT CAdScene::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCENE file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCENE file '%s'", Filename);
|
||||
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
@ -568,7 +568,7 @@ TOKEN_DEF(PERSISTENT_STATE)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdScene::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(SCENE)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -630,7 +630,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -643,7 +643,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_LAYER: {
|
||||
CAdLayer *layer = new CAdLayer(Game);
|
||||
if (!layer || FAILED(layer->LoadBuffer(params, false))) {
|
||||
if (!layer || FAILED(layer->loadBuffer(params, false))) {
|
||||
cmd = PARSERR_GENERIC;
|
||||
delete layer;
|
||||
layer = NULL;
|
||||
@ -661,7 +661,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_WAYPOINTS: {
|
||||
CAdWaypointGroup *wpt = new CAdWaypointGroup(Game);
|
||||
if (!wpt || FAILED(wpt->LoadBuffer(params, false))) {
|
||||
if (!wpt || FAILED(wpt->loadBuffer(params, false))) {
|
||||
cmd = PARSERR_GENERIC;
|
||||
delete wpt;
|
||||
wpt = NULL;
|
||||
@ -674,7 +674,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_SCALE_LEVEL: {
|
||||
CAdScaleLevel *sl = new CAdScaleLevel(Game);
|
||||
if (!sl || FAILED(sl->LoadBuffer(params, false))) {
|
||||
if (!sl || FAILED(sl->loadBuffer(params, false))) {
|
||||
cmd = PARSERR_GENERIC;
|
||||
delete sl;
|
||||
sl = NULL;
|
||||
@ -687,7 +687,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_ROTATION_LEVEL: {
|
||||
CAdRotLevel *rl = new CAdRotLevel(Game);
|
||||
if (!rl || FAILED(rl->LoadBuffer(params, false))) {
|
||||
if (!rl || FAILED(rl->loadBuffer(params, false))) {
|
||||
cmd = PARSERR_GENERIC;
|
||||
delete rl;
|
||||
rl = NULL;
|
||||
@ -700,7 +700,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_ENTITY: {
|
||||
CAdEntity *entity = new CAdEntity(Game);
|
||||
if (!entity || FAILED(entity->LoadBuffer(params, false))) {
|
||||
if (!entity || FAILED(entity->loadBuffer(params, false))) {
|
||||
cmd = PARSERR_GENERIC;
|
||||
delete entity;
|
||||
entity = NULL;
|
||||
@ -713,7 +713,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -1255,7 +1255,7 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
|
||||
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);
|
||||
} else {
|
||||
@ -1272,7 +1272,7 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
|
||||
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);
|
||||
} else {
|
||||
@ -2504,7 +2504,7 @@ HRESULT CAdScene::PersistState(bool Saving) {
|
||||
switch (node->_type) {
|
||||
case OBJECT_ENTITY:
|
||||
if (!node->_entity->_saveState) continue;
|
||||
NodeState = State->GetNodeState(node->_entity->_name, Saving);
|
||||
NodeState = State->getNodeState(node->_entity->_name, Saving);
|
||||
if (NodeState) {
|
||||
NodeState->TransferEntity(node->_entity, _persistentStateSprites, Saving);
|
||||
//if(Saving) NodeState->_active = node->_entity->_active;
|
||||
@ -2513,7 +2513,7 @@ HRESULT CAdScene::PersistState(bool Saving) {
|
||||
break;
|
||||
case OBJECT_REGION:
|
||||
if (!node->_region->_saveState) continue;
|
||||
NodeState = State->GetNodeState(node->_region->_name, Saving);
|
||||
NodeState = State->getNodeState(node->_region->_name, Saving);
|
||||
if (NodeState) {
|
||||
if (Saving) NodeState->_active = node->_region->_active;
|
||||
else node->_region->_active = NodeState->_active;
|
||||
@ -2530,7 +2530,7 @@ HRESULT CAdScene::PersistState(bool Saving) {
|
||||
for (i = 0; i < _objects.GetSize(); i++) {
|
||||
if (!_objects[i]->_saveState) continue;
|
||||
if (_objects[i]->_type == OBJECT_ENTITY) {
|
||||
NodeState = State->GetNodeState(_objects[i]->_name, Saving);
|
||||
NodeState = State->getNodeState(_objects[i]->_name, Saving);
|
||||
if (NodeState) {
|
||||
NodeState->TransferEntity((CAdEntity *)_objects[i], _persistentStateSprites, Saving);
|
||||
//if(Saving) NodeState->_active = _objects[i]->_active;
|
||||
@ -2541,7 +2541,7 @@ HRESULT CAdScene::PersistState(bool Saving) {
|
||||
|
||||
// waypoint groups
|
||||
for (i = 0; i < _waypointGroups.GetSize(); i++) {
|
||||
NodeState = State->GetNodeState(_waypointGroups[i]->_name, Saving);
|
||||
NodeState = State->getNodeState(_waypointGroups[i]->_name, Saving);
|
||||
if (NodeState) {
|
||||
if (Saving) NodeState->_active = _waypointGroups[i]->_active;
|
||||
else _waypointGroups[i]->_active = NodeState->_active;
|
||||
|
@ -123,8 +123,8 @@ public:
|
||||
CBArray<CAdLayer *, CAdLayer *> _layers;
|
||||
CBArray<CAdObject *, CAdObject *> _objects;
|
||||
CBArray<CAdWaypointGroup *, CAdWaypointGroup *> _waypointGroups;
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
int _width;
|
||||
int _height;
|
||||
HRESULT AddObject(CAdObject *Object);
|
||||
|
@ -63,22 +63,22 @@ HRESULT CAdSceneState::persist(CBPersistMgr *persistMgr) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CAdSceneState::setFilename(const char *Filename) {
|
||||
void CAdSceneState::setFilename(const char *filename) {
|
||||
delete[] _filename;
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
if (_filename) strcpy(_filename, Filename);
|
||||
_filename = new char [strlen(filename) + 1];
|
||||
if (_filename) strcpy(_filename, filename);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CAdNodeState *CAdSceneState::GetNodeState(char *Name, bool Saving) {
|
||||
CAdNodeState *CAdSceneState::getNodeState(char *name, bool saving) {
|
||||
for (int i = 0; i < _nodeStates.GetSize(); i++) {
|
||||
if (scumm_stricmp(_nodeStates[i]->_name, Name) == 0) return _nodeStates[i];
|
||||
if (scumm_stricmp(_nodeStates[i]->_name, name) == 0) return _nodeStates[i];
|
||||
}
|
||||
|
||||
if (Saving) {
|
||||
if (saving) {
|
||||
CAdNodeState *ret = new CAdNodeState(Game);
|
||||
ret->setName(Name);
|
||||
ret->setName(name);
|
||||
_nodeStates.Add(ret);
|
||||
|
||||
return ret;
|
||||
|
@ -37,8 +37,8 @@ namespace WinterMute {
|
||||
class CAdNodeState;
|
||||
class CAdSceneState : public CBBase {
|
||||
public:
|
||||
CAdNodeState *GetNodeState(char *Name, bool Saving);
|
||||
void setFilename(const char *Filename);
|
||||
CAdNodeState *getNodeState(char *name, bool saving);
|
||||
void setFilename(const char *filename);
|
||||
DECLARE_PERSISTENT(CAdSceneState, CBBase)
|
||||
CAdSceneState(CBGame *inGame);
|
||||
virtual ~CAdSceneState();
|
||||
|
@ -91,38 +91,38 @@ CAdSentence::~CAdSentence() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CAdSentence::SetText(const char *Text) {
|
||||
void CAdSentence::setText(const char *text) {
|
||||
if (_text) delete [] _text;
|
||||
_text = new char[strlen(Text) + 1];
|
||||
if (_text) strcpy(_text, Text);
|
||||
_text = new char[strlen(text) + 1];
|
||||
if (_text) strcpy(_text, text);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CAdSentence::SetStances(const char *Stances) {
|
||||
void CAdSentence::setStances(const char *stances) {
|
||||
if (_stances) delete [] _stances;
|
||||
if (Stances) {
|
||||
_stances = new char[strlen(Stances) + 1];
|
||||
if (_stances) strcpy(_stances, Stances);
|
||||
if (stances) {
|
||||
_stances = new char[strlen(stances) + 1];
|
||||
if (_stances) strcpy(_stances, stances);
|
||||
} else _stances = NULL;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
char *CAdSentence::GetCurrentStance() {
|
||||
return GetStance(_currentStance);
|
||||
char *CAdSentence::getCurrentStance() {
|
||||
return getStance(_currentStance);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
char *CAdSentence::GetNextStance() {
|
||||
char *CAdSentence::getNextStance() {
|
||||
_currentStance++;
|
||||
return GetStance(_currentStance);
|
||||
return getStance(_currentStance);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
char *CAdSentence::GetStance(int Stance) {
|
||||
char *CAdSentence::getStance(int Stance) {
|
||||
if (_stances == NULL) return NULL;
|
||||
|
||||
if (_tempStance) delete [] _tempStance;
|
||||
@ -195,16 +195,16 @@ HRESULT CAdSentence::display() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CAdSentence::SetSound(CBSound *Sound) {
|
||||
if (!Sound) return;
|
||||
void CAdSentence::setSound(CBSound *sound) {
|
||||
if (!sound) return;
|
||||
delete _sound;
|
||||
_sound = Sound;
|
||||
_sound = sound;
|
||||
_soundStarted = false;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdSentence::Finish() {
|
||||
HRESULT CAdSentence::finish() {
|
||||
if (_sound) _sound->stop();
|
||||
return S_OK;
|
||||
}
|
||||
@ -238,16 +238,16 @@ HRESULT CAdSentence::persist(CBPersistMgr *persistMgr) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdSentence::SetupTalkFile(const char *SoundFilename) {
|
||||
HRESULT CAdSentence::setupTalkFile(const char *soundFilename) {
|
||||
delete _talkDef;
|
||||
_talkDef = NULL;
|
||||
_currentSprite = NULL;
|
||||
|
||||
if (!SoundFilename) return S_OK;
|
||||
if (!soundFilename) return S_OK;
|
||||
|
||||
|
||||
AnsiString path = PathUtil::GetDirectoryName(SoundFilename);
|
||||
AnsiString name = PathUtil::GetFileNameWithoutExtension(SoundFilename);
|
||||
AnsiString path = PathUtil::GetDirectoryName(soundFilename);
|
||||
AnsiString name = PathUtil::GetFileNameWithoutExtension(soundFilename);
|
||||
|
||||
AnsiString talkDefFileName = PathUtil::Combine(path, name + ".talk");
|
||||
|
||||
@ -258,7 +258,7 @@ HRESULT CAdSentence::SetupTalkFile(const char *SoundFilename) {
|
||||
|
||||
|
||||
_talkDef = new CAdTalkDef(Game);
|
||||
if (!_talkDef || FAILED(_talkDef->LoadFile(talkDefFileName.c_str()))) {
|
||||
if (!_talkDef || FAILED(_talkDef->loadFile(talkDefFileName.c_str()))) {
|
||||
delete _talkDef;
|
||||
_talkDef = NULL;
|
||||
return E_FAIL;
|
||||
@ -270,7 +270,7 @@ HRESULT CAdSentence::SetupTalkFile(const char *SoundFilename) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdSentence::update(TDirection Dir) {
|
||||
HRESULT CAdSentence::update(TDirection dir) {
|
||||
if (!_talkDef) return S_OK;
|
||||
|
||||
uint32 CurrentTime;
|
||||
@ -284,10 +284,10 @@ HRESULT CAdSentence::update(TDirection Dir) {
|
||||
|
||||
bool TalkNodeFound = false;
|
||||
for (int i = 0; i < _talkDef->_nodes.GetSize(); i++) {
|
||||
if (_talkDef->_nodes[i]->IsInTimeInterval(CurrentTime, Dir)) {
|
||||
if (_talkDef->_nodes[i]->isInTimeInterval(CurrentTime, dir)) {
|
||||
TalkNodeFound = true;
|
||||
|
||||
CBSprite *NewSprite = _talkDef->_nodes[i]->GetSprite(Dir);
|
||||
CBSprite *NewSprite = _talkDef->_nodes[i]->getSprite(dir);
|
||||
if (NewSprite != _currentSprite) NewSprite->Reset();
|
||||
_currentSprite = NewSprite;
|
||||
|
||||
@ -298,7 +298,7 @@ HRESULT CAdSentence::update(TDirection Dir) {
|
||||
|
||||
// no talk node, try to use default sprite instead (if any)
|
||||
if (!TalkNodeFound) {
|
||||
CBSprite *NewSprite = _talkDef->GetDefaultSprite(Dir);
|
||||
CBSprite *NewSprite = _talkDef->getDefaultSprite(dir);
|
||||
if (NewSprite) {
|
||||
if (NewSprite != _currentSprite) NewSprite->Reset();
|
||||
_currentSprite = NewSprite;
|
||||
|
@ -45,11 +45,11 @@ public:
|
||||
bool _fixedPos;
|
||||
CBSprite *_currentSprite;
|
||||
char *_currentSkelAnim;
|
||||
HRESULT update(TDirection Dir = DI_DOWN);
|
||||
HRESULT SetupTalkFile(const char *SoundFilename);
|
||||
HRESULT update(TDirection dir = DI_DOWN);
|
||||
HRESULT setupTalkFile(const char *soundFilename);
|
||||
DECLARE_PERSISTENT(CAdSentence, CBBase)
|
||||
HRESULT Finish();
|
||||
void SetSound(CBSound *Sound);
|
||||
HRESULT finish();
|
||||
void setSound(CBSound *Sound);
|
||||
bool _soundStarted;
|
||||
CBSound *_sound;
|
||||
TTextAlign _align;
|
||||
@ -57,10 +57,10 @@ public:
|
||||
int _width;
|
||||
POINT _pos;
|
||||
CBFont *_font;
|
||||
char *GetNextStance();
|
||||
char *GetCurrentStance();
|
||||
void SetStances(const char *Stances);
|
||||
void SetText(const char *Text);
|
||||
char *getNextStance();
|
||||
char *getCurrentStance();
|
||||
void setStances(const char *stances);
|
||||
void setText(const char *text);
|
||||
int _currentStance;
|
||||
uint32 _startTime;
|
||||
char *_stances;
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
private:
|
||||
char *_tempStance;
|
||||
char *GetStance(int Stance);
|
||||
char *getStance(int Stance);
|
||||
|
||||
};
|
||||
|
||||
|
@ -58,16 +58,16 @@ CAdSpriteSet::~CAdSpriteSet() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdSpriteSet::LoadFile(const char *Filename, int LifeTime, TSpriteCacheType CacheType) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
HRESULT CAdSpriteSet::loadFile(const char *filename, int lifeTime, TSpriteCacheType cacheType) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdSpriteSet::LoadFile failed for file '%s'", Filename);
|
||||
Game->LOG(0, "CAdSpriteSet::LoadFile failed for file '%s'", filename);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT ret;
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SPRITESET file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SPRITESET file '%s'", filename);
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
@ -90,7 +90,7 @@ TOKEN_DEF(TEMPLATE)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSpriteCacheType CacheType) {
|
||||
HRESULT CAdSpriteSet::loadBuffer(byte *buffer, bool complete, int LifeTime, TSpriteCacheType CacheType) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(SPRITESET)
|
||||
TOKEN_TABLE(NAME)
|
||||
@ -110,19 +110,19 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
int cmd;
|
||||
CBParser parser(Game);
|
||||
|
||||
if (Complete) {
|
||||
if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_SPRITESET) {
|
||||
if (complete) {
|
||||
if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_SPRITESET) {
|
||||
Game->LOG(0, "'SPRITESET' keyword expected.");
|
||||
return E_FAIL;
|
||||
}
|
||||
Buffer = params;
|
||||
buffer = params;
|
||||
}
|
||||
|
||||
CBSprite *spr = NULL;
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -133,7 +133,7 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
delete _sprites[DI_LEFT];
|
||||
_sprites[DI_LEFT] = NULL;
|
||||
spr = new CBSprite(Game, _owner);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
else _sprites[DI_LEFT] = spr;
|
||||
break;
|
||||
|
||||
@ -141,7 +141,7 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
delete _sprites[DI_RIGHT];
|
||||
_sprites[DI_RIGHT] = NULL;
|
||||
spr = new CBSprite(Game, _owner);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
else _sprites[DI_RIGHT] = spr;
|
||||
break;
|
||||
|
||||
@ -149,7 +149,7 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
delete _sprites[DI_UP];
|
||||
_sprites[DI_UP] = NULL;
|
||||
spr = new CBSprite(Game, _owner);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
else _sprites[DI_UP] = spr;
|
||||
break;
|
||||
|
||||
@ -157,7 +157,7 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
delete _sprites[DI_DOWN];
|
||||
_sprites[DI_DOWN] = NULL;
|
||||
spr = new CBSprite(Game, _owner);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
else _sprites[DI_DOWN] = spr;
|
||||
break;
|
||||
|
||||
@ -165,7 +165,7 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
delete _sprites[DI_UPLEFT];
|
||||
_sprites[DI_UPLEFT] = NULL;
|
||||
spr = new CBSprite(Game, _owner);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
else _sprites[DI_UPLEFT] = spr;
|
||||
break;
|
||||
|
||||
@ -173,7 +173,7 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
delete _sprites[DI_UPRIGHT];
|
||||
_sprites[DI_UPRIGHT] = NULL;
|
||||
spr = new CBSprite(Game, _owner);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
else _sprites[DI_UPRIGHT] = spr;
|
||||
break;
|
||||
|
||||
@ -181,7 +181,7 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
delete _sprites[DI_DOWNLEFT];
|
||||
_sprites[DI_DOWNLEFT] = NULL;
|
||||
spr = new CBSprite(Game, _owner);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
else _sprites[DI_DOWNLEFT] = spr;
|
||||
break;
|
||||
|
||||
@ -189,7 +189,7 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
|
||||
delete _sprites[DI_DOWNRIGHT];
|
||||
_sprites[DI_DOWNRIGHT] = NULL;
|
||||
spr = new CBSprite(Game, _owner);
|
||||
if (!spr || FAILED(spr->LoadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
if (!spr || FAILED(spr->loadFile((char *)params, LifeTime, CacheType))) cmd = PARSERR_GENERIC;
|
||||
else _sprites[DI_DOWNRIGHT] = spr;
|
||||
break;
|
||||
|
||||
@ -228,8 +228,8 @@ HRESULT CAdSpriteSet::persist(CBPersistMgr *persistMgr) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CBSprite *CAdSpriteSet::GetSprite(TDirection Direction) {
|
||||
int Dir = (int)Direction;
|
||||
CBSprite *CAdSpriteSet::getSprite(TDirection direction) {
|
||||
int Dir = (int)direction;
|
||||
if (Dir < 0) Dir = 0;
|
||||
if (Dir >= NUM_DIRECTIONS) Dir = NUM_DIRECTIONS - 1;
|
||||
|
||||
@ -259,49 +259,49 @@ CBSprite *CAdSpriteSet::GetSprite(TDirection Direction) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdSpriteSet::saveAsText(CBDynBuffer *Buffer, int Indent) {
|
||||
Buffer->putTextIndent(Indent, "SPRITESET {\n");
|
||||
if (_name) Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
|
||||
HRESULT CAdSpriteSet::saveAsText(CBDynBuffer *buffer, int indent) {
|
||||
buffer->putTextIndent(indent, "SPRITESET {\n");
|
||||
if (_name) buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
|
||||
for (int i = 0; i < NUM_DIRECTIONS; i++) {
|
||||
if (_sprites[i]) {
|
||||
switch (i) {
|
||||
case DI_UP:
|
||||
Buffer->putTextIndent(Indent + 2, "UP=\"%s\"\n", _sprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "UP=\"%s\"\n", _sprites[i]->_filename);
|
||||
break;
|
||||
case DI_UPRIGHT:
|
||||
Buffer->putTextIndent(Indent + 2, "UP_RIGHT=\"%s\"\n", _sprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "UP_RIGHT=\"%s\"\n", _sprites[i]->_filename);
|
||||
break;
|
||||
case DI_RIGHT:
|
||||
Buffer->putTextIndent(Indent + 2, "RIGHT=\"%s\"\n", _sprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "RIGHT=\"%s\"\n", _sprites[i]->_filename);
|
||||
break;
|
||||
case DI_DOWNRIGHT:
|
||||
Buffer->putTextIndent(Indent + 2, "DOWN_RIGHT=\"%s\"\n", _sprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "DOWN_RIGHT=\"%s\"\n", _sprites[i]->_filename);
|
||||
break;
|
||||
case DI_DOWN:
|
||||
Buffer->putTextIndent(Indent + 2, "DOWN=\"%s\"\n", _sprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "DOWN=\"%s\"\n", _sprites[i]->_filename);
|
||||
break;
|
||||
case DI_DOWNLEFT:
|
||||
Buffer->putTextIndent(Indent + 2, "DOWN_LEFT=\"%s\"\n", _sprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "DOWN_LEFT=\"%s\"\n", _sprites[i]->_filename);
|
||||
break;
|
||||
case DI_LEFT:
|
||||
Buffer->putTextIndent(Indent + 2, "LEFT=\"%s\"\n", _sprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "LEFT=\"%s\"\n", _sprites[i]->_filename);
|
||||
break;
|
||||
case DI_UPLEFT:
|
||||
Buffer->putTextIndent(Indent + 2, "UP_LEFT=\"%s\"\n", _sprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "UP_LEFT=\"%s\"\n", _sprites[i]->_filename);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CBBase::saveAsText(Buffer, Indent + 2);
|
||||
CBBase::saveAsText(buffer, indent + 2);
|
||||
|
||||
Buffer->putTextIndent(Indent, "}\n");
|
||||
buffer->putTextIndent(indent, "}\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CAdSpriteSet::ContainsSprite(CBSprite *Sprite) {
|
||||
bool CAdSpriteSet::containsSprite(CBSprite *Sprite) {
|
||||
if (!Sprite) return false;
|
||||
|
||||
for (int i = 0; i < NUM_DIRECTIONS; i++) {
|
||||
|
@ -37,15 +37,15 @@ namespace WinterMute {
|
||||
|
||||
class CAdSpriteSet : public CBObject {
|
||||
public:
|
||||
bool ContainsSprite(CBSprite *Sprite);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent = 0);
|
||||
CBSprite *GetSprite(TDirection Direction);
|
||||
bool containsSprite(CBSprite *sprite);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent = 0);
|
||||
CBSprite *getSprite(TDirection direction);
|
||||
DECLARE_PERSISTENT(CAdSpriteSet, CBObject)
|
||||
CBObject *_owner;
|
||||
CAdSpriteSet(CBGame *inGame, CBObject *Owner = NULL);
|
||||
CAdSpriteSet(CBGame *inGame, CBObject *owner = NULL);
|
||||
virtual ~CAdSpriteSet();
|
||||
HRESULT LoadFile(const char *Filename, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
|
||||
HRESULT loadFile(const char *filename, int lifeTime = -1, TSpriteCacheType cacheType = CACHE_ALL);
|
||||
HRESULT loadBuffer(byte *buffer, bool complete = true, int lifeTime = -1, TSpriteCacheType cacheType = CACHE_ALL);
|
||||
CBSprite *_sprites[NUM_DIRECTIONS];
|
||||
};
|
||||
|
||||
|
@ -69,7 +69,7 @@ CAdTalkDef::~CAdTalkDef() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkDef::LoadFile(const char *Filename) {
|
||||
HRESULT CAdTalkDef::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdTalkDef::LoadFile failed for file '%s'", Filename);
|
||||
@ -80,7 +80,7 @@ HRESULT CAdTalkDef::LoadFile(const char *Filename) {
|
||||
|
||||
CBUtils::SetString(&_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TALK file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TALK file '%s'", Filename);
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
@ -98,7 +98,7 @@ TOKEN_DEF(DEFAULT_SPRITE)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkDef::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdTalkDef::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(TALK)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -124,12 +124,12 @@ HRESULT CAdTalkDef::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_ACTION: {
|
||||
CAdTalkNode *Node = new CAdTalkNode(Game);
|
||||
if (Node && SUCCEEDED(Node->LoadBuffer(params, false))) _nodes.Add(Node);
|
||||
if (Node && SUCCEEDED(Node->loadBuffer(params, false))) _nodes.Add(Node);
|
||||
else {
|
||||
delete Node;
|
||||
Node = NULL;
|
||||
@ -149,7 +149,7 @@ HRESULT CAdTalkDef::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_DEFAULT_SPRITESET: {
|
||||
delete _defaultSpriteSet;
|
||||
_defaultSpriteSet = new CAdSpriteSet(Game);
|
||||
if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->LoadBuffer(params, false))) {
|
||||
if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->loadBuffer(params, false))) {
|
||||
delete _defaultSpriteSet;
|
||||
_defaultSpriteSet = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -180,12 +180,12 @@ HRESULT CAdTalkDef::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
if (_defaultSpriteFilename) {
|
||||
_defaultSprite = new CBSprite(Game);
|
||||
if (!_defaultSprite || FAILED(_defaultSprite->LoadFile(_defaultSpriteFilename))) return E_FAIL;
|
||||
if (!_defaultSprite || FAILED(_defaultSprite->loadFile(_defaultSpriteFilename))) return E_FAIL;
|
||||
}
|
||||
|
||||
if (_defaultSpriteSetFilename) {
|
||||
_defaultSpriteSet = new CAdSpriteSet(Game);
|
||||
if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->LoadFile(_defaultSpriteSetFilename))) return E_FAIL;
|
||||
if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->loadFile(_defaultSpriteSetFilename))) return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@ -210,37 +210,37 @@ HRESULT CAdTalkDef::persist(CBPersistMgr *persistMgr) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkDef::saveAsText(CBDynBuffer *Buffer, int Indent) {
|
||||
Buffer->putTextIndent(Indent, "TALK {\n");
|
||||
if (_defaultSpriteFilename) Buffer->putTextIndent(Indent + 2, "DEFAULT_SPRITE=\"%s\"\n", _defaultSpriteFilename);
|
||||
HRESULT CAdTalkDef::saveAsText(CBDynBuffer *buffer, int indent) {
|
||||
buffer->putTextIndent(indent, "TALK {\n");
|
||||
if (_defaultSpriteFilename) buffer->putTextIndent(indent + 2, "DEFAULT_SPRITE=\"%s\"\n", _defaultSpriteFilename);
|
||||
|
||||
if (_defaultSpriteSetFilename) Buffer->putTextIndent(Indent + 2, "DEFAULT_SPRITESET_FILE=\"%s\"\n", _defaultSpriteSetFilename);
|
||||
else if (_defaultSpriteSet) _defaultSpriteSet->saveAsText(Buffer, Indent + 2);
|
||||
if (_defaultSpriteSetFilename) buffer->putTextIndent(indent + 2, "DEFAULT_SPRITESET_FILE=\"%s\"\n", _defaultSpriteSetFilename);
|
||||
else if (_defaultSpriteSet) _defaultSpriteSet->saveAsText(buffer, indent + 2);
|
||||
|
||||
for (int i = 0; i < _nodes.GetSize(); i++) {
|
||||
_nodes[i]->saveAsText(Buffer, Indent + 2);
|
||||
Buffer->putTextIndent(Indent, "\n");
|
||||
_nodes[i]->saveAsText(buffer, indent + 2);
|
||||
buffer->putTextIndent(indent, "\n");
|
||||
}
|
||||
CBBase::saveAsText(Buffer, Indent + 2);
|
||||
CBBase::saveAsText(buffer, indent + 2);
|
||||
|
||||
Buffer->putTextIndent(Indent, "}\n");
|
||||
buffer->putTextIndent(indent, "}\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkDef::LoadDefaultSprite() {
|
||||
HRESULT CAdTalkDef::loadDefaultSprite() {
|
||||
if (_defaultSpriteFilename && !_defaultSprite) {
|
||||
_defaultSprite = new CBSprite(Game);
|
||||
if (!_defaultSprite || FAILED(_defaultSprite->LoadFile(_defaultSpriteFilename))) {
|
||||
if (!_defaultSprite || FAILED(_defaultSprite->loadFile(_defaultSpriteFilename))) {
|
||||
delete _defaultSprite;
|
||||
_defaultSprite = NULL;
|
||||
return E_FAIL;
|
||||
} else return S_OK;
|
||||
} else if (_defaultSpriteSetFilename && !_defaultSpriteSet) {
|
||||
_defaultSpriteSet = new CAdSpriteSet(Game);
|
||||
if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->LoadFile(_defaultSpriteSetFilename))) {
|
||||
if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->loadFile(_defaultSpriteSetFilename))) {
|
||||
delete _defaultSpriteSet;
|
||||
_defaultSpriteSet = NULL;
|
||||
return E_FAIL;
|
||||
@ -250,10 +250,10 @@ HRESULT CAdTalkDef::LoadDefaultSprite() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CBSprite *CAdTalkDef::GetDefaultSprite(TDirection Dir) {
|
||||
LoadDefaultSprite();
|
||||
CBSprite *CAdTalkDef::getDefaultSprite(TDirection dir) {
|
||||
loadDefaultSprite();
|
||||
if (_defaultSprite) return _defaultSprite;
|
||||
else if (_defaultSpriteSet) return _defaultSpriteSet->GetSprite(Dir);
|
||||
else if (_defaultSpriteSet) return _defaultSpriteSet->getSprite(dir);
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
|
@ -39,18 +39,18 @@ class CAdTalkDef : public CBObject {
|
||||
public:
|
||||
char *_defaultSpriteSetFilename;
|
||||
CAdSpriteSet *_defaultSpriteSet;
|
||||
CBSprite *GetDefaultSprite(TDirection Dir);
|
||||
HRESULT LoadDefaultSprite();
|
||||
CBSprite *getDefaultSprite(TDirection Dir);
|
||||
HRESULT loadDefaultSprite();
|
||||
DECLARE_PERSISTENT(CAdTalkDef, CBObject)
|
||||
|
||||
CAdTalkDef(CBGame *inGame);
|
||||
virtual ~CAdTalkDef();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *filename);
|
||||
HRESULT loadBuffer(byte *buffer, bool complete = true);
|
||||
CBArray<CAdTalkNode *, CAdTalkNode *> _nodes;
|
||||
char *_defaultSpriteFilename;
|
||||
CBSprite *_defaultSprite;
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent = 0);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent = 0);
|
||||
};
|
||||
|
||||
} // end of namespace WinterMute
|
||||
|
@ -62,7 +62,7 @@ CAdTalkHolder::~CAdTalkHolder() {
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CBSprite *CAdTalkHolder::GetTalkStance(const char *Stance) {
|
||||
CBSprite *CAdTalkHolder::getTalkStance(const char *stance) {
|
||||
CBSprite *ret = NULL;
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ CBSprite *CAdTalkHolder::GetTalkStance(const char *Stance) {
|
||||
delete _animSprite;
|
||||
_animSprite = new CBSprite(Game, this);
|
||||
if (_animSprite) {
|
||||
HRESULT res = _animSprite->LoadFile(_forcedTalkAnimName);
|
||||
HRESULT res = _animSprite->loadFile(_forcedTalkAnimName);
|
||||
if (FAILED(res)) {
|
||||
Game->LOG(res, "CAdTalkHolder::GetTalkStance: error loading talk sprite (object:\"%s\" sprite:\"%s\")", _name, _forcedTalkAnimName);
|
||||
delete _animSprite;
|
||||
@ -82,10 +82,10 @@ CBSprite *CAdTalkHolder::GetTalkStance(const char *Stance) {
|
||||
}
|
||||
|
||||
|
||||
if (Stance != NULL) {
|
||||
if (stance != NULL) {
|
||||
// search special talk stances
|
||||
for (int i = 0; i < _talkSpritesEx.GetSize(); i++) {
|
||||
if (scumm_stricmp(_talkSpritesEx[i]->_name, Stance) == 0) {
|
||||
if (scumm_stricmp(_talkSpritesEx[i]->_name, stance) == 0) {
|
||||
ret = _talkSpritesEx[i];
|
||||
break;
|
||||
}
|
||||
@ -93,7 +93,7 @@ CBSprite *CAdTalkHolder::GetTalkStance(const char *Stance) {
|
||||
if (ret == NULL) {
|
||||
// serach generic talk stances
|
||||
for (int i = 0; i < _talkSprites.GetSize(); i++) {
|
||||
if (scumm_stricmp(_talkSprites[i]->_name, Stance) == 0) {
|
||||
if (scumm_stricmp(_talkSprites[i]->_name, stance) == 0) {
|
||||
ret = _talkSprites[i];
|
||||
break;
|
||||
}
|
||||
@ -118,14 +118,14 @@ CBSprite *CAdTalkHolder::GetTalkStance(const char *Stance) {
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// high level scripting interface
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, const char *Name) {
|
||||
HRESULT CAdTalkHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// SetSprite
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
if (strcmp(Name, "SetSprite") == 0) {
|
||||
Stack->CorrectParams(1);
|
||||
if (strcmp(name, "SetSprite") == 0) {
|
||||
stack->CorrectParams(1);
|
||||
|
||||
CScValue *Val = Stack->Pop();
|
||||
CScValue *Val = stack->Pop();
|
||||
|
||||
bool SetCurrent = false;
|
||||
if (_currentSprite && _currentSprite == _sprite) SetCurrent = true;
|
||||
@ -136,17 +136,17 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack
|
||||
if (Val->IsNULL()) {
|
||||
_sprite = NULL;
|
||||
if (SetCurrent) _currentSprite = NULL;
|
||||
Stack->PushBool(true);
|
||||
stack->PushBool(true);
|
||||
} else {
|
||||
const char *Filename = Val->GetString();
|
||||
CBSprite *spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile(Filename))) {
|
||||
Script->RuntimeError("SetSprite method failed for file '%s'", Filename);
|
||||
Stack->PushBool(false);
|
||||
if (!spr || FAILED(spr->loadFile(Filename))) {
|
||||
script->RuntimeError("SetSprite method failed for file '%s'", Filename);
|
||||
stack->PushBool(false);
|
||||
} else {
|
||||
_sprite = spr;
|
||||
if (SetCurrent) _currentSprite = _sprite;
|
||||
Stack->PushBool(true);
|
||||
stack->PushBool(true);
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
@ -155,42 +155,42 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GetSprite
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(Name, "GetSprite") == 0) {
|
||||
Stack->CorrectParams(0);
|
||||
else if (strcmp(name, "GetSprite") == 0) {
|
||||
stack->CorrectParams(0);
|
||||
|
||||
if (!_sprite || !_sprite->_filename) Stack->PushNULL();
|
||||
else Stack->PushString(_sprite->_filename);
|
||||
if (!_sprite || !_sprite->_filename) stack->PushNULL();
|
||||
else stack->PushString(_sprite->_filename);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GetSpriteObject
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(Name, "GetSpriteObject") == 0) {
|
||||
Stack->CorrectParams(0);
|
||||
else if (strcmp(name, "GetSpriteObject") == 0) {
|
||||
stack->CorrectParams(0);
|
||||
|
||||
if (!_sprite) Stack->PushNULL();
|
||||
else Stack->PushNative(_sprite, true);
|
||||
if (!_sprite) stack->PushNULL();
|
||||
else stack->PushNative(_sprite, true);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AddTalkSprite
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(Name, "AddTalkSprite") == 0) {
|
||||
Stack->CorrectParams(2);
|
||||
else if (strcmp(name, "AddTalkSprite") == 0) {
|
||||
stack->CorrectParams(2);
|
||||
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
bool Ex = Stack->Pop()->GetBool();
|
||||
const char *Filename = stack->Pop()->GetString();
|
||||
bool Ex = stack->Pop()->GetBool();
|
||||
|
||||
CBSprite *spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile(Filename))) {
|
||||
Stack->PushBool(false);
|
||||
Script->RuntimeError("AddTalkSprite method failed for file '%s'", Filename);
|
||||
if (!spr || FAILED(spr->loadFile(Filename))) {
|
||||
stack->PushBool(false);
|
||||
script->RuntimeError("AddTalkSprite method failed for file '%s'", Filename);
|
||||
} else {
|
||||
if (Ex) _talkSpritesEx.Add(spr);
|
||||
else _talkSprites.Add(spr);
|
||||
Stack->PushBool(true);
|
||||
stack->PushBool(true);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
@ -198,11 +198,11 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// RemoveTalkSprite
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(Name, "RemoveTalkSprite") == 0) {
|
||||
Stack->CorrectParams(2);
|
||||
else if (strcmp(name, "RemoveTalkSprite") == 0) {
|
||||
stack->CorrectParams(2);
|
||||
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
bool Ex = Stack->Pop()->GetBool();
|
||||
const char *Filename = stack->Pop()->GetString();
|
||||
bool Ex = stack->Pop()->GetBool();
|
||||
int i;
|
||||
|
||||
bool SetCurrent = false;
|
||||
@ -231,7 +231,7 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack
|
||||
|
||||
}
|
||||
|
||||
Stack->PushBool(true);
|
||||
stack->PushBool(true);
|
||||
if (SetCurrent) _currentSprite = _sprite;
|
||||
if (SetTemp2) _tempSprite2 = _sprite;
|
||||
|
||||
@ -241,18 +241,18 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// SetTalkSprite
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(Name, "SetTalkSprite") == 0) {
|
||||
Stack->CorrectParams(2);
|
||||
else if (strcmp(name, "SetTalkSprite") == 0) {
|
||||
stack->CorrectParams(2);
|
||||
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
bool Ex = Stack->Pop()->GetBool();
|
||||
const char *Filename = stack->Pop()->GetString();
|
||||
bool Ex = stack->Pop()->GetBool();
|
||||
bool SetCurrent = false;
|
||||
bool SetTemp2 = false;
|
||||
|
||||
CBSprite *spr = new CBSprite(Game, this);
|
||||
if (!spr || FAILED(spr->LoadFile(Filename))) {
|
||||
Stack->PushBool(false);
|
||||
Script->RuntimeError("SetTalkSprite method failed for file '%s'", Filename);
|
||||
if (!spr || FAILED(spr->loadFile(Filename))) {
|
||||
stack->PushBool(false);
|
||||
script->RuntimeError("SetTalkSprite method failed for file '%s'", Filename);
|
||||
} else {
|
||||
|
||||
// delete current
|
||||
@ -276,7 +276,7 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack
|
||||
// set new
|
||||
if (Ex) _talkSpritesEx.Add(spr);
|
||||
else _talkSprites.Add(spr);
|
||||
Stack->PushBool(true);
|
||||
stack->PushBool(true);
|
||||
|
||||
if (SetCurrent) _currentSprite = spr;
|
||||
if (SetTemp2) _tempSprite2 = spr;
|
||||
@ -284,38 +284,38 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStack
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
else return CAdObject::scCallMethod(Script, Stack, ThisStack, Name);
|
||||
else return CAdObject::scCallMethod(script, stack, thisStack, name);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CScValue *CAdTalkHolder::scGetProperty(const char *Name) {
|
||||
CScValue *CAdTalkHolder::scGetProperty(const char *name) {
|
||||
_scValue->SetNULL();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Type (RO)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
if (strcmp(Name, "Type") == 0) {
|
||||
if (strcmp(name, "Type") == 0) {
|
||||
_scValue->SetString("talk-holder");
|
||||
return _scValue;
|
||||
}
|
||||
|
||||
else return CAdObject::scGetProperty(Name);
|
||||
else return CAdObject::scGetProperty(name);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkHolder::scSetProperty(const char *Name, CScValue *Value) {
|
||||
HRESULT CAdTalkHolder::scSetProperty(const char *name, CScValue *value) {
|
||||
/*
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Item
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
if(strcmp(Name, "Item")==0){
|
||||
if(strcmp(name, "Item")==0){
|
||||
SetItem(Value->GetString());
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
else*/ return CAdObject::scSetProperty(Name, Value);
|
||||
else*/ return CAdObject::scSetProperty(name, value);
|
||||
}
|
||||
|
||||
|
||||
@ -326,16 +326,15 @@ const char *CAdTalkHolder::scToString() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkHolder::saveAsText(CBDynBuffer *Buffer, int Indent) {
|
||||
int i;
|
||||
for (i = 0; i < _talkSprites.GetSize(); i++) {
|
||||
HRESULT CAdTalkHolder::saveAsText(CBDynBuffer *buffer, int indent) {
|
||||
for (int i = 0; i < _talkSprites.GetSize(); i++) {
|
||||
if (_talkSprites[i]->_filename)
|
||||
Buffer->putTextIndent(Indent + 2, "TALK=\"%s\"\n", _talkSprites[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "TALK=\"%s\"\n", _talkSprites[i]->_filename);
|
||||
}
|
||||
|
||||
for (i = 0; i < _talkSpritesEx.GetSize(); i++) {
|
||||
for (int i = 0; i < _talkSpritesEx.GetSize(); i++) {
|
||||
if (_talkSpritesEx[i]->_filename)
|
||||
Buffer->putTextIndent(Indent + 2, "TALK_SPECIAL=\"%s\"\n", _talkSpritesEx[i]->_filename);
|
||||
buffer->putTextIndent(indent + 2, "TALK_SPECIAL=\"%s\"\n", _talkSpritesEx[i]->_filename);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
@ -36,8 +36,8 @@ namespace WinterMute {
|
||||
class CAdTalkHolder : public CAdObject {
|
||||
public:
|
||||
DECLARE_PERSISTENT(CAdTalkHolder, CAdObject)
|
||||
virtual CBSprite *GetTalkStance(const char *Stance);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
virtual CBSprite *getTalkStance(const char *stance);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
|
||||
CBSprite *_sprite;
|
||||
CBArray<CBSprite *, CBSprite *> _talkSprites;
|
||||
CBArray<CBSprite *, CBSprite *> _talkSpritesEx;
|
||||
@ -45,9 +45,9 @@ public:
|
||||
virtual ~CAdTalkHolder();
|
||||
|
||||
// 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();
|
||||
|
||||
};
|
||||
|
@ -80,7 +80,7 @@ TOKEN_DEF(PRECACHE)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkNode::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdTalkNode::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(ACTION)
|
||||
TOKEN_TABLE(SPRITESET_FILE)
|
||||
@ -122,7 +122,7 @@ HRESULT CAdTalkNode::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_SPRITESET: {
|
||||
delete _spriteSet;
|
||||
_spriteSet = new CAdSpriteSet(Game);
|
||||
if (!_spriteSet || FAILED(_spriteSet->LoadBuffer(params, false))) {
|
||||
if (!_spriteSet || FAILED(_spriteSet->loadBuffer(params, false))) {
|
||||
delete _spriteSet;
|
||||
_spriteSet = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -167,13 +167,13 @@ HRESULT CAdTalkNode::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
if (_preCache && _spriteFilename) {
|
||||
delete _sprite;
|
||||
_sprite = new CBSprite(Game);
|
||||
if (!_sprite || FAILED(_sprite->LoadFile(_spriteFilename))) return E_FAIL;
|
||||
if (!_sprite || FAILED(_sprite->loadFile(_spriteFilename))) return E_FAIL;
|
||||
}
|
||||
|
||||
if (_preCache && _spriteSetFilename) {
|
||||
delete _spriteSet;
|
||||
_spriteSet = new CAdSpriteSet(Game);
|
||||
if (!_spriteSet || FAILED(_spriteSet->LoadFile(_spriteSetFilename))) return E_FAIL;
|
||||
if (!_spriteSet || FAILED(_spriteSet->loadFile(_spriteSetFilename))) return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@ -217,10 +217,10 @@ HRESULT CAdTalkNode::saveAsText(CBDynBuffer *Buffer, int Indent) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkNode::LoadSprite() {
|
||||
HRESULT CAdTalkNode::loadSprite() {
|
||||
if (_spriteFilename && !_sprite) {
|
||||
_sprite = new CBSprite(Game);
|
||||
if (!_sprite || FAILED(_sprite->LoadFile(_spriteFilename))) {
|
||||
if (!_sprite || FAILED(_sprite->loadFile(_spriteFilename))) {
|
||||
delete _sprite;
|
||||
_sprite = NULL;
|
||||
return E_FAIL;
|
||||
@ -229,7 +229,7 @@ HRESULT CAdTalkNode::LoadSprite() {
|
||||
|
||||
else if (_spriteSetFilename && !_spriteSet) {
|
||||
_spriteSet = new CAdSpriteSet(Game);
|
||||
if (!_spriteSet || FAILED(_spriteSet->LoadFile(_spriteSetFilename))) {
|
||||
if (!_spriteSet || FAILED(_spriteSet->loadFile(_spriteSetFilename))) {
|
||||
delete _spriteSet;
|
||||
_spriteSet = NULL;
|
||||
return E_FAIL;
|
||||
@ -241,11 +241,11 @@ HRESULT CAdTalkNode::LoadSprite() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CAdTalkNode::IsInTimeInterval(uint32 Time, TDirection Dir) {
|
||||
bool CAdTalkNode::isInTimeInterval(uint32 Time, TDirection Dir) {
|
||||
if (Time >= _startTime) {
|
||||
if (_playToEnd) {
|
||||
if ((_spriteFilename && _sprite == NULL) || (_sprite && _sprite->_finished == false)) return true;
|
||||
else if ((_spriteSetFilename && _spriteSet == NULL) || (_spriteSet && _spriteSet->GetSprite(Dir) && _spriteSet->GetSprite(Dir)->_finished == false)) return true;
|
||||
else if ((_spriteSetFilename && _spriteSet == NULL) || (_spriteSet && _spriteSet->getSprite(Dir) && _spriteSet->getSprite(Dir)->_finished == false)) return true;
|
||||
else return false;
|
||||
} else return _endTime >= Time;
|
||||
} else return false;
|
||||
@ -253,10 +253,10 @@ bool CAdTalkNode::IsInTimeInterval(uint32 Time, TDirection Dir) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CBSprite *CAdTalkNode::GetSprite(TDirection Dir) {
|
||||
LoadSprite();
|
||||
CBSprite *CAdTalkNode::getSprite(TDirection Dir) {
|
||||
loadSprite();
|
||||
if (_sprite) return _sprite;
|
||||
else if (_spriteSet) return _spriteSet->GetSprite(Dir);
|
||||
else if (_spriteSet) return _spriteSet->getSprite(Dir);
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
|
@ -39,15 +39,15 @@ class CAdTalkNode : public CBBase {
|
||||
public:
|
||||
char *_spriteSetFilename;
|
||||
CAdSpriteSet *_spriteSet;
|
||||
CBSprite *GetSprite(TDirection Dir);
|
||||
bool IsInTimeInterval(uint32 Time, TDirection Dir);
|
||||
HRESULT LoadSprite();
|
||||
CBSprite *getSprite(TDirection dir);
|
||||
bool isInTimeInterval(uint32 time, TDirection dir);
|
||||
HRESULT loadSprite();
|
||||
DECLARE_PERSISTENT(CAdTalkNode, CBBase)
|
||||
|
||||
CAdTalkNode(CBGame *inGame);
|
||||
virtual ~CAdTalkNode();
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent = 0);
|
||||
HRESULT loadBuffer(byte *buffer, bool complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent = 0);
|
||||
char *_spriteFilename;
|
||||
CBSprite *_sprite;
|
||||
uint32 _startTime;
|
||||
|
@ -64,7 +64,7 @@ void CAdWaypointGroup::cleanup() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdWaypointGroup::LoadFile(const char *Filename) {
|
||||
HRESULT CAdWaypointGroup::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdWaypointGroup::LoadFile failed for file '%s'", Filename);
|
||||
@ -76,7 +76,7 @@ HRESULT CAdWaypointGroup::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WAYPOINTS file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WAYPOINTS file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -96,7 +96,7 @@ TOKEN_DEF(PROPERTY)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdWaypointGroup::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CAdWaypointGroup::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(WAYPOINTS)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -123,7 +123,7 @@ HRESULT CAdWaypointGroup::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
|
@ -44,8 +44,8 @@ public:
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
bool _active;
|
||||
CAdWaypointGroup(CBGame *inGame);
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual ~CAdWaypointGroup();
|
||||
CBArray<CBPoint *, CBPoint *> _points;
|
||||
int _editorSelectedPoint;
|
||||
|
@ -71,7 +71,7 @@ int CBFont::GetTextWidth(byte *text, int MaxLenght) {
|
||||
|
||||
/*
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFont::LoadFile(const char * Filename)
|
||||
HRESULT CBFont::loadFile(const char * Filename)
|
||||
{
|
||||
BYTE* Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if(Buffer==NULL){
|
||||
@ -84,7 +84,7 @@ HRESULT CBFont::LoadFile(const char * Filename)
|
||||
_filename = new char [strlen(Filename)+1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if(FAILED(ret = LoadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", Filename);
|
||||
if(FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", Filename);
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
@ -96,7 +96,7 @@ TOKEN_DEF_START
|
||||
TOKEN_DEF (FONT)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFont::LoadBuffer(byte * Buffer)
|
||||
HRESULT CBFont::loadBuffer(byte * Buffer)
|
||||
{
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE (FONT)
|
||||
@ -156,7 +156,7 @@ CBFont *CBFont::CreateFromFile(CBGame *Game, const char *Filename) {
|
||||
if (IsTrueType(Game, Filename)) {
|
||||
CBFontTT *Font = new CBFontTT(Game);
|
||||
if (Font) {
|
||||
if (FAILED(Font->LoadFile(Filename))) {
|
||||
if (FAILED(Font->loadFile(Filename))) {
|
||||
delete Font;
|
||||
return NULL;
|
||||
}
|
||||
@ -165,7 +165,7 @@ CBFont *CBFont::CreateFromFile(CBGame *Game, const char *Filename) {
|
||||
} else {
|
||||
CBFontBitmap *Font = new CBFontBitmap(Game);
|
||||
if (Font) {
|
||||
if (FAILED(Font->LoadFile(Filename))) {
|
||||
if (FAILED(Font->loadFile(Filename))) {
|
||||
delete Font;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -51,8 +51,8 @@ public:
|
||||
static CBFont *CreateFromFile(CBGame *Game, const char *Filename);
|
||||
|
||||
private:
|
||||
//HRESULT LoadBuffer(byte * Buffer);
|
||||
//HRESULT LoadFile(const char* Filename);
|
||||
//HRESULT loadBuffer(byte * Buffer);
|
||||
//HRESULT loadFile(const char* Filename);
|
||||
static bool IsTrueType(CBGame *Game, const char *Filename);
|
||||
};
|
||||
|
||||
|
@ -245,7 +245,7 @@ void CBFontBitmap::DrawChar(byte c, int x, int y) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFontBitmap::LoadFile(const char *Filename) {
|
||||
HRESULT CBFontBitmap::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBFontBitmap::LoadFile failed for file '%s'", Filename);
|
||||
@ -257,7 +257,7 @@ HRESULT CBFontBitmap::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", Filename);
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
@ -284,7 +284,7 @@ TOKEN_DEF(WIDTHS_FRAME)
|
||||
TOKEN_DEF(PAINT_WHOLE_CELL)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
|
||||
HRESULT CBFontBitmap::loadBuffer(byte *Buffer) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(FONTEXT_FIX)
|
||||
TOKEN_TABLE(FONT)
|
||||
@ -404,7 +404,7 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
|
||||
if (sprite_file != NULL) {
|
||||
delete _sprite;
|
||||
_sprite = new CBSprite(Game, this);
|
||||
if (!_sprite || FAILED(_sprite->LoadFile(sprite_file))) {
|
||||
if (!_sprite || FAILED(_sprite->loadFile(sprite_file))) {
|
||||
delete _sprite;
|
||||
_sprite = NULL;
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ class CBSubFrame;
|
||||
class CBFontBitmap : public CBFont {
|
||||
public:
|
||||
DECLARE_PERSISTENT(CBFontBitmap, CBFont)
|
||||
HRESULT LoadBuffer(byte *Buffer);
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
virtual int GetTextWidth(byte *text, int MaxLength = -1);
|
||||
virtual int GetTextHeight(byte *text, int width);
|
||||
virtual void DrawText(byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int MaxLenght = -1);
|
||||
|
@ -104,7 +104,7 @@ CBFont *CBFontStorage::AddFont(const char *Filename) {
|
||||
CBFont* font = new CBFont(Game);
|
||||
if (!font) return NULL;
|
||||
|
||||
if (FAILED(font->LoadFile(Filename))) {
|
||||
if (FAILED(font->loadFile(Filename))) {
|
||||
delete font;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ int CBFontTT::GetLetterHeight() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFontTT::LoadFile(const char *Filename) {
|
||||
HRESULT CBFontTT::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBFontTT::LoadFile failed for file '%s'", Filename);
|
||||
@ -416,7 +416,7 @@ HRESULT CBFontTT::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer))) Game->LOG(0, "Error parsing TTFONT file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing TTFONT file '%s'", Filename);
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
@ -441,7 +441,7 @@ TOKEN_DEF(OFFSET_X)
|
||||
TOKEN_DEF(OFFSET_Y)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFontTT::LoadBuffer(byte *Buffer) {
|
||||
HRESULT CBFontTT::loadBuffer(byte *Buffer) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(TTFONT)
|
||||
TOKEN_TABLE(SIZE)
|
||||
|
@ -123,8 +123,8 @@ public:
|
||||
virtual void DrawText(byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int maxLenght = -1);
|
||||
virtual int GetLetterHeight();
|
||||
|
||||
HRESULT LoadBuffer(byte *buffer);
|
||||
HRESULT LoadFile(const char *filename);
|
||||
HRESULT loadBuffer(byte *buffer);
|
||||
HRESULT loadFile(const char *filename);
|
||||
|
||||
float GetLineHeight() const {
|
||||
return _lineHeight;
|
||||
|
@ -132,7 +132,7 @@ TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF(KILL_SOUND)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
|
||||
HRESULT CBFrame::loadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(DELAY)
|
||||
TOKEN_TABLE(IMAGE)
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
uint32 _delay;
|
||||
CBArray<CBSubFrame *, CBSubFrame *> _subframes;
|
||||
HRESULT Draw(int X, int Y, CBObject *Register = NULL, float ZoomX = 100, float ZoomY = 100, bool Precise = true, uint32 Alpha = 0xFFFFFFFF, bool AllFrames = false, float Rotate = 0.0f, TSpriteBlendMode BlendMode = BLEND_NORMAL);
|
||||
HRESULT LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded);
|
||||
HRESULT loadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded);
|
||||
|
||||
CBFrame(CBGame *inGame);
|
||||
virtual ~CBFrame();
|
||||
|
@ -390,7 +390,7 @@ HRESULT CBGame::cleanup() {
|
||||
|
||||
for (int i = 0; i < _scripts.GetSize(); i++) {
|
||||
_scripts[i]->_owner = NULL;
|
||||
_scripts[i]->Finish();
|
||||
_scripts[i]->finish();
|
||||
}
|
||||
_scripts.RemoveAll();
|
||||
|
||||
@ -687,7 +687,7 @@ void CBGame::GetOffset(int *OffsetX, int *OffsetY) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBGame::LoadFile(const char *Filename) {
|
||||
HRESULT CBGame::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBGame::LoadFile failed for file '%s'", Filename);
|
||||
@ -699,7 +699,7 @@ HRESULT CBGame::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing GAME file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing GAME file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -758,7 +758,7 @@ TOKEN_DEF(GUID)
|
||||
TOKEN_DEF(COMPAT_KILL_METHOD_THREADS)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CBGame::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(GAME)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -809,7 +809,7 @@ HRESULT CBGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -838,7 +838,7 @@ HRESULT CBGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -849,7 +849,7 @@ HRESULT CBGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
delete _activeCursor;
|
||||
_activeCursor = NULL;
|
||||
_activeCursor = new CBSprite(Game);
|
||||
if (!_activeCursor || FAILED(_activeCursor->LoadFile((char *)params))) {
|
||||
if (!_activeCursor || FAILED(_activeCursor->loadFile((char *)params))) {
|
||||
delete _activeCursor;
|
||||
_activeCursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -859,7 +859,7 @@ HRESULT CBGame::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_NONINTERACTIVE_CURSOR:
|
||||
delete _cursorNoninteractive;
|
||||
_cursorNoninteractive = new CBSprite(Game);
|
||||
if (!_cursorNoninteractive || FAILED(_cursorNoninteractive->LoadFile((char *)params))) {
|
||||
if (!_cursorNoninteractive || FAILED(_cursorNoninteractive->loadFile((char *)params))) {
|
||||
delete _cursorNoninteractive;
|
||||
_cursorNoninteractive = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -1034,7 +1034,7 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
|
||||
if (Val->IsNULL()) ClearOld = true;
|
||||
else ClearOld = Val->GetBool();
|
||||
|
||||
if (FAILED(_stringTable->LoadFile(Filename, ClearOld)))
|
||||
if (FAILED(_stringTable->loadFile(Filename, ClearOld)))
|
||||
Stack->PushBool(false);
|
||||
else
|
||||
Stack->PushBool(true);
|
||||
@ -1086,7 +1086,7 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
|
||||
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);
|
||||
@ -1994,7 +1994,7 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
|
||||
|
||||
delete _loadingIcon;
|
||||
_loadingIcon = new CBSprite(this);
|
||||
if (!_loadingIcon || FAILED(_loadingIcon->LoadFile(Filename))) {
|
||||
if (!_loadingIcon || FAILED(_loadingIcon->loadFile(Filename))) {
|
||||
delete _loadingIcon;
|
||||
_loadingIcon = NULL;
|
||||
} else {
|
||||
@ -3542,7 +3542,7 @@ HRESULT CBGame::LoadSettings(const char *Filename) {
|
||||
break;
|
||||
|
||||
case TOKEN_STRING_TABLE:
|
||||
if (FAILED(_stringTable->LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(_stringTable->loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_RESOLUTION:
|
||||
@ -4208,7 +4208,7 @@ HRESULT CBGame::SetWaitCursor(const char *Filename) {
|
||||
_cursorNoninteractive = NULL;
|
||||
|
||||
_cursorNoninteractive = new CBSprite(Game);
|
||||
if (!_cursorNoninteractive || FAILED(_cursorNoninteractive->LoadFile(Filename))) {
|
||||
if (!_cursorNoninteractive || FAILED(_cursorNoninteractive->loadFile(Filename))) {
|
||||
delete _cursorNoninteractive;
|
||||
_cursorNoninteractive = NULL;
|
||||
return E_FAIL;
|
||||
|
@ -193,8 +193,8 @@ public:
|
||||
|
||||
void *_dEBUG_LogFile;
|
||||
int _sequence;
|
||||
virtual HRESULT LoadFile(const char *Filename);
|
||||
virtual HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT loadFile(const char *Filename);
|
||||
virtual HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
CBArray<CBQuickMsg *, CBQuickMsg *> _quickMessages;
|
||||
CBArray<CUIWindow *, CUIWindow *> _windows;
|
||||
CBArray<CBViewport *, CBViewport *> _viewportStack;
|
||||
|
@ -927,7 +927,7 @@ HRESULT CBObject::setCursor(const char *filename) {
|
||||
|
||||
_sharedCursors = false;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile(filename))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile(filename))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
return E_FAIL;
|
||||
@ -939,7 +939,7 @@ HRESULT CBObject::setCursor(const char *filename) {
|
||||
HRESULT CBObject::setActiveCursor(const char *filename) {
|
||||
delete _activeCursor;
|
||||
_activeCursor = new CBSprite(Game);
|
||||
if (!_activeCursor || FAILED(_activeCursor->LoadFile(filename))) {
|
||||
if (!_activeCursor || FAILED(_activeCursor->loadFile(filename))) {
|
||||
delete _activeCursor;
|
||||
_activeCursor = NULL;
|
||||
return E_FAIL;
|
||||
|
@ -95,7 +95,7 @@ bool CBRegion::PointInRegion(int X, int Y) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBRegion::LoadFile(const char *Filename) {
|
||||
HRESULT CBRegion::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBRegion::LoadFile failed for file '%s'", Filename);
|
||||
@ -107,7 +107,7 @@ HRESULT CBRegion::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -128,7 +128,7 @@ TOKEN_DEF(EDITOR_SELECTED_POINT)
|
||||
TOKEN_DEF(PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBRegion::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CBRegion::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(REGION)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -161,7 +161,7 @@ HRESULT CBRegion::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
|
@ -50,8 +50,8 @@ public:
|
||||
virtual ~CBRegion();
|
||||
bool PointInRegion(int X, int Y);
|
||||
bool CreateRegion();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
RECT _rect;
|
||||
CBArray<CBPoint *, CBPoint *> _points;
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent, const char *NameOverride = NULL);
|
||||
|
@ -62,7 +62,7 @@ HRESULT CBScriptHolder::cleanup() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < _scripts.GetSize(); i++) {
|
||||
_scripts[i]->Finish(true);
|
||||
_scripts[i]->finish(true);
|
||||
_scripts[i]->_owner = NULL;
|
||||
}
|
||||
_scripts.RemoveAll();
|
||||
@ -177,7 +177,7 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *Script, CScStack *Stack, CScStac
|
||||
bool ret = false;
|
||||
for (int i = 0; i < _scripts.GetSize(); i++) {
|
||||
if (scumm_stricmp(_scripts[i]->_filename, Filename) == 0) {
|
||||
_scripts[i]->Finish(KillThreads);
|
||||
_scripts[i]->finish(KillThreads);
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
|
@ -122,12 +122,12 @@ HRESULT CBSprite::Draw(int X, int Y, CBObject *Register, float ZoomX, float Zoom
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBSprite::LoadFile(const char *Filename, int LifeTime, TSpriteCacheType CacheType) {
|
||||
HRESULT CBSprite::loadFile(const char *Filename, int LifeTime, TSpriteCacheType CacheType) {
|
||||
Common::SeekableReadStream *File = Game->_fileManager->openFile(Filename);
|
||||
if (!File) {
|
||||
Game->LOG(0, "CBSprite::LoadFile failed for file '%s'", Filename);
|
||||
if (Game->_dEBUG_DebugMode) return LoadFile("invalid_debug.bmp", LifeTime, CacheType);
|
||||
else return LoadFile("invalid.bmp", LifeTime, CacheType);
|
||||
if (Game->_dEBUG_DebugMode) return loadFile("invalid_debug.bmp", LifeTime, CacheType);
|
||||
else return loadFile("invalid.bmp", LifeTime, CacheType);
|
||||
} else {
|
||||
Game->_fileManager->closeFile(File);
|
||||
File = NULL;
|
||||
@ -155,7 +155,7 @@ HRESULT CBSprite::LoadFile(const char *Filename, int LifeTime, TSpriteCacheType
|
||||
} else {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer) {
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true, LifeTime, CacheType))) Game->LOG(0, "Error parsing SPRITE file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true, LifeTime, CacheType))) Game->LOG(0, "Error parsing SPRITE file '%s'", Filename);
|
||||
delete [] Buffer;
|
||||
}
|
||||
}
|
||||
@ -187,7 +187,7 @@ TOKEN_DEF(EDITOR_BG_ALPHA)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSpriteCacheType CacheType) {
|
||||
HRESULT CBSprite::loadBuffer(byte *Buffer, bool Complete, int LifeTime, TSpriteCacheType CacheType) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(CONTINUOUS)
|
||||
TOKEN_TABLE(SPRITE)
|
||||
@ -289,7 +289,7 @@ HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSprite
|
||||
|
||||
frame = new CBFrame(Game);
|
||||
|
||||
if (FAILED(frame->LoadBuffer(params, FrameLifeTime, _streamedKeepLoaded))) {
|
||||
if (FAILED(frame->loadBuffer(params, FrameLifeTime, _streamedKeepLoaded))) {
|
||||
delete frame;
|
||||
Game->LOG(0, "Error parsing frame %d", frame_count);
|
||||
return E_FAIL;
|
||||
|
@ -66,8 +66,8 @@ public:
|
||||
bool _changed;
|
||||
bool _paused;
|
||||
bool _finished;
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Compete = true, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
|
||||
HRESULT LoadFile(const char *Filename, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Compete = true, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
|
||||
HRESULT loadFile(const char *Filename, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
|
||||
uint32 _lastFrameTime;
|
||||
HRESULT Draw(int X, int Y, CBObject *Register = NULL, float ZoomX = 100, float ZoomY = 100, uint32 Alpha = 0xFFFFFFFF);
|
||||
bool _looping;
|
||||
|
@ -169,7 +169,7 @@ const char *CBStringTable::ExpandStatic(const char *String, bool ForceExpand) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBStringTable::LoadFile(const char *Filename, bool ClearOld) {
|
||||
HRESULT CBStringTable::loadFile(const char *Filename, bool ClearOld) {
|
||||
Game->LOG(0, "Loading string table...");
|
||||
|
||||
if (ClearOld) _strings.clear();
|
||||
|
@ -38,7 +38,7 @@ namespace WinterMute {
|
||||
class CBStringTable : public CBBase {
|
||||
public:
|
||||
const char *ExpandStatic(const char *String, bool ForceExpand = false);
|
||||
HRESULT LoadFile(const char *Filename, bool DeleteAll = true);
|
||||
HRESULT loadFile(const char *Filename, bool DeleteAll = true);
|
||||
void Expand(char **Str, bool ForceExpand = false);
|
||||
HRESULT AddString(const char *Key, const char *Val, bool ReportDuplicities = true);
|
||||
CBStringTable(CBGame *inGame);
|
||||
|
@ -83,7 +83,7 @@ HRESULT CPartParticle::setSprite(const char *Filename) {
|
||||
|
||||
CSysClassRegistry::GetInstance()->_disabled = true;
|
||||
_sprite = new CBSprite(Game, Game);
|
||||
if (_sprite && SUCCEEDED(_sprite->LoadFile(Filename))) {
|
||||
if (_sprite && SUCCEEDED(_sprite->loadFile(Filename))) {
|
||||
CSysClassRegistry::GetInstance()->_disabled = false;
|
||||
return S_OK;
|
||||
} else {
|
||||
|
@ -189,7 +189,7 @@ HRESULT CScEngine::cleanup() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
byte *WINAPI CScEngine::LoadFile(void *Data, char *Filename, uint32 *Size) {
|
||||
byte *WINAPI CScEngine::loadFile(void *Data, char *Filename, uint32 *Size) {
|
||||
CBGame *Game = (CBGame *)Data;
|
||||
return Game->_fileManager->readWholeFile(Filename, Size);
|
||||
}
|
||||
@ -309,7 +309,7 @@ byte *CScEngine::GetCompiledScript(const char *Filename, uint32 *OutSize, bool I
|
||||
CALLBACKS c;
|
||||
c.Dll_AddError = AddError;
|
||||
c.Dll_CloseFile = CloseFile;
|
||||
c.Dll_LoadFile = LoadFile;
|
||||
c.Dll_LoadFile = loadFile;
|
||||
c.Dll_ParseElement = ParseElement;
|
||||
ExtSetCallbacks(&c, Game);
|
||||
|
||||
@ -387,11 +387,11 @@ HRESULT CScEngine::Tick() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!obj_found) _scripts[i]->Finish(); // _waitObject no longer exists
|
||||
if(!obj_found) _scripts[i]->finish(); // _waitObject no longer exists
|
||||
*/
|
||||
if (Game->ValidObject(_scripts[i]->_waitObject)) {
|
||||
if (_scripts[i]->_waitObject->isReady()) _scripts[i]->Run();
|
||||
} else _scripts[i]->Finish();
|
||||
} else _scripts[i]->finish();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -415,7 +415,7 @@ HRESULT CScEngine::Tick() {
|
||||
// copy return value
|
||||
_scripts[i]->_stack->Push(_scripts[i]->_waitScript->_stack->Pop());
|
||||
_scripts[i]->Run();
|
||||
_scripts[i]->_waitScript->Finish();
|
||||
_scripts[i]->_waitScript->finish();
|
||||
_scripts[i]->_waitScript = NULL;
|
||||
}
|
||||
}
|
||||
@ -475,7 +475,7 @@ HRESULT CScEngine::TickUnbreakable() {
|
||||
_currentScript = _scripts[i];
|
||||
_scripts[i]->ExecuteInstruction();
|
||||
}
|
||||
_scripts[i]->Finish();
|
||||
_scripts[i]->finish();
|
||||
_currentScript = NULL;
|
||||
}
|
||||
RemoveFinishedScripts();
|
||||
@ -552,7 +552,7 @@ HRESULT CScEngine::ResetObject(CBObject *Object) {
|
||||
if (!Game->_compatKillMethodThreads) ResetScript(_scripts[i]);
|
||||
|
||||
bool IsThread = _scripts[i]->_methodThread || _scripts[i]->_thread;
|
||||
_scripts[i]->Finish(!IsThread); // 1.9b1 - top-level script kills its threads as well
|
||||
_scripts[i]->finish(!IsThread); // 1.9b1 - top-level script kills its threads as well
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
@ -563,7 +563,7 @@ 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) {
|
||||
_scripts[i]->Finish();
|
||||
_scripts[i]->finish();
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
|
@ -137,7 +137,7 @@ public:
|
||||
CScEngine(CBGame *inGame);
|
||||
virtual ~CScEngine();
|
||||
static void WINAPI AddError(void *Data, int Line, char *Text);
|
||||
static byte *WINAPI LoadFile(void *Data, char *Filename, uint32 *Size);
|
||||
static byte *WINAPI loadFile(void *Data, char *Filename, uint32 *Size);
|
||||
static void WINAPI CloseFile(void *Data, byte *Buffer);
|
||||
static void WINAPI ParseElement(void *Data, int Line, int Type, void *ElementData);
|
||||
DLL_COMPILE_BUFFER ExtCompileBuffer;
|
||||
|
@ -1117,7 +1117,7 @@ HRESULT CScScript::Sleep(uint32 Duration) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CScScript::Finish(bool IncludingThreads) {
|
||||
HRESULT CScScript::finish(bool IncludingThreads) {
|
||||
if (_state != SCRIPT_FINISHED && IncludingThreads) {
|
||||
_state = SCRIPT_FINISHED;
|
||||
FinishThreads();
|
||||
@ -1508,7 +1508,7 @@ HRESULT CScScript::FinishThreads() {
|
||||
for (int i = 0; i < _engine->_scripts.GetSize(); i++) {
|
||||
CScScript *Scr = _engine->_scripts[i];
|
||||
if (Scr->_thread && Scr->_state != SCRIPT_FINISHED && Scr->_owner == _owner && scumm_stricmp(Scr->_filename, _filename) == 0)
|
||||
Scr->Finish(true);
|
||||
Scr->finish(true);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
DECLARE_PERSISTENT(CScScript, CBBase)
|
||||
void RuntimeError(LPCSTR fmt, ...);
|
||||
HRESULT Run();
|
||||
HRESULT Finish(bool IncludingThreads = false);
|
||||
HRESULT finish(bool IncludingThreads = false);
|
||||
HRESULT Sleep(uint32 Duration);
|
||||
HRESULT WaitForExclusive(CBObject *Object);
|
||||
HRESULT WaitFor(CBObject *Object);
|
||||
|
@ -95,7 +95,7 @@ CUIButton::~CUIButton() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIButton::LoadFile(const char *Filename) {
|
||||
HRESULT CUIButton::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIButton::LoadFile failed for file '%s'", Filename);
|
||||
@ -107,7 +107,7 @@ HRESULT CUIButton::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing BUTTON file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing BUTTON file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -155,7 +155,7 @@ TOKEN_DEF(PIXEL_PERFECT)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CUIButton::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(BUTTON)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -210,7 +210,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -224,7 +224,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK:
|
||||
delete _back;
|
||||
_back = new CUITiledImage(Game);
|
||||
if (!_back || FAILED(_back->LoadFile((char *)params))) {
|
||||
if (!_back || FAILED(_back->loadFile((char *)params))) {
|
||||
delete _back;
|
||||
_back = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -234,7 +234,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK_HOVER:
|
||||
delete _backHover;
|
||||
_backHover = new CUITiledImage(Game);
|
||||
if (!_backHover || FAILED(_backHover->LoadFile((char *)params))) {
|
||||
if (!_backHover || FAILED(_backHover->loadFile((char *)params))) {
|
||||
delete _backHover;
|
||||
_backHover = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -244,7 +244,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK_PRESS:
|
||||
delete _backPress;
|
||||
_backPress = new CUITiledImage(Game);
|
||||
if (!_backPress || FAILED(_backPress->LoadFile((char *)params))) {
|
||||
if (!_backPress || FAILED(_backPress->loadFile((char *)params))) {
|
||||
delete _backPress;
|
||||
_backPress = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -254,7 +254,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK_DISABLE:
|
||||
delete _backDisable;
|
||||
_backDisable = new CUITiledImage(Game);
|
||||
if (!_backDisable || FAILED(_backDisable->LoadFile((char *)params))) {
|
||||
if (!_backDisable || FAILED(_backDisable->loadFile((char *)params))) {
|
||||
delete _backDisable;
|
||||
_backDisable = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -264,7 +264,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK_FOCUS:
|
||||
delete _backFocus;
|
||||
_backFocus = new CUITiledImage(Game);
|
||||
if (!_backFocus || FAILED(_backFocus->LoadFile((char *)params))) {
|
||||
if (!_backFocus || FAILED(_backFocus->loadFile((char *)params))) {
|
||||
delete _backFocus;
|
||||
_backFocus = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -274,7 +274,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE:
|
||||
delete _image;
|
||||
_image = new CBSprite(Game);
|
||||
if (!_image || FAILED(_image->LoadFile((char *)params))) {
|
||||
if (!_image || FAILED(_image->loadFile((char *)params))) {
|
||||
delete _image;
|
||||
_image = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -284,7 +284,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE_HOVER:
|
||||
delete _imageHover;
|
||||
_imageHover = new CBSprite(Game);
|
||||
if (!_imageHover || FAILED(_imageHover->LoadFile((char *)params))) {
|
||||
if (!_imageHover || FAILED(_imageHover->loadFile((char *)params))) {
|
||||
delete _imageHover;
|
||||
_imageHover = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -294,7 +294,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE_PRESS:
|
||||
delete _imagePress;
|
||||
_imagePress = new CBSprite(Game);
|
||||
if (!_imagePress || FAILED(_imagePress->LoadFile((char *)params))) {
|
||||
if (!_imagePress || FAILED(_imagePress->loadFile((char *)params))) {
|
||||
delete _imagePress;
|
||||
_imagePress = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -304,7 +304,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE_DISABLE:
|
||||
delete _imageDisable;
|
||||
_imageDisable = new CBSprite(Game);
|
||||
if (!_imageDisable || FAILED(_imageDisable->LoadFile((char *)params))) {
|
||||
if (!_imageDisable || FAILED(_imageDisable->loadFile((char *)params))) {
|
||||
delete _imageDisable;
|
||||
_imageDisable = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -314,7 +314,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE_FOCUS:
|
||||
delete _imageFocus;
|
||||
_imageFocus = new CBSprite(Game);
|
||||
if (!_imageFocus || FAILED(_imageFocus->LoadFile((char *)params))) {
|
||||
if (!_imageFocus || FAILED(_imageFocus->loadFile((char *)params))) {
|
||||
delete _imageFocus;
|
||||
_imageFocus = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -381,7 +381,7 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -748,7 +748,7 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
delete _imageDisable;
|
||||
_imageDisable = new CBSprite(Game);
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
if (!_imageDisable || FAILED(_imageDisable->LoadFile(Filename))) {
|
||||
if (!_imageDisable || FAILED(_imageDisable->loadFile(Filename))) {
|
||||
delete _imageDisable;
|
||||
_imageDisable = NULL;
|
||||
Stack->PushBool(false);
|
||||
@ -789,7 +789,7 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
delete _imageHover;
|
||||
_imageHover = new CBSprite(Game);
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
if (!_imageHover || FAILED(_imageHover->LoadFile(Filename))) {
|
||||
if (!_imageHover || FAILED(_imageHover->loadFile(Filename))) {
|
||||
delete _imageHover;
|
||||
_imageHover = NULL;
|
||||
Stack->PushBool(false);
|
||||
@ -829,7 +829,7 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
delete _imagePress;
|
||||
_imagePress = new CBSprite(Game);
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
if (!_imagePress || FAILED(_imagePress->LoadFile(Filename))) {
|
||||
if (!_imagePress || FAILED(_imagePress->loadFile(Filename))) {
|
||||
delete _imagePress;
|
||||
_imagePress = NULL;
|
||||
Stack->PushBool(false);
|
||||
@ -869,7 +869,7 @@ HRESULT CUIButton::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
delete _imageFocus;
|
||||
_imageFocus = new CBSprite(Game);
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
if (!_imageFocus || FAILED(_imageFocus->LoadFile(Filename))) {
|
||||
if (!_imageFocus || FAILED(_imageFocus->loadFile(Filename))) {
|
||||
delete _imageFocus;
|
||||
_imageFocus = NULL;
|
||||
Stack->PushBool(false);
|
||||
|
@ -63,8 +63,8 @@ public:
|
||||
CUITiledImage *_backFocus;
|
||||
CUIButton(CBGame *inGame = NULL);
|
||||
virtual ~CUIButton();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
|
||||
// scripting interface
|
||||
|
@ -94,7 +94,7 @@ CUIEdit::~CUIEdit() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIEdit::LoadFile(const char *Filename) {
|
||||
HRESULT CUIEdit::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIEdit::LoadFile failed for file '%s'", Filename);
|
||||
@ -106,7 +106,7 @@ HRESULT CUIEdit::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing EDIT file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing EDIT file '%s'", Filename);
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
@ -139,7 +139,7 @@ TOKEN_DEF(EDIT)
|
||||
TOKEN_DEF(CAPTION)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIEdit::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CUIEdit::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
TOKEN_TABLE(DISABLED)
|
||||
@ -180,7 +180,7 @@ HRESULT CUIEdit::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -190,7 +190,7 @@ HRESULT CUIEdit::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK:
|
||||
delete _back;
|
||||
_back = new CUITiledImage(Game);
|
||||
if (!_back || FAILED(_back->LoadFile((char *)params))) {
|
||||
if (!_back || FAILED(_back->loadFile((char *)params))) {
|
||||
delete _back;
|
||||
_back = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -200,7 +200,7 @@ HRESULT CUIEdit::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE:
|
||||
delete _image;
|
||||
_image = new CBSprite(Game);
|
||||
if (!_image || FAILED(_image->LoadFile((char *)params))) {
|
||||
if (!_image || FAILED(_image->loadFile((char *)params))) {
|
||||
delete _image;
|
||||
_image = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -251,7 +251,7 @@ HRESULT CUIEdit::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
|
@ -56,8 +56,8 @@ public:
|
||||
CUIEdit(CBGame *inGame);
|
||||
virtual ~CUIEdit();
|
||||
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
|
||||
// scripting interface
|
||||
|
@ -55,7 +55,7 @@ CUIEntity::~CUIEntity() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIEntity::LoadFile(const char *Filename) {
|
||||
HRESULT CUIEntity::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIEntity::LoadFile failed for file '%s'", Filename);
|
||||
@ -67,7 +67,7 @@ HRESULT CUIEntity::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ENTITY container file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ENTITY container file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -89,7 +89,7 @@ TOKEN_DEF(SCRIPT)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CUIEntity::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(ENTITY_CONTAINER)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -118,7 +118,7 @@ HRESULT CUIEntity::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -211,7 +211,7 @@ HRESULT CUIEntity::saveAsText(CBDynBuffer *Buffer, int Indent) {
|
||||
HRESULT CUIEntity::SetEntity(const char *Filename) {
|
||||
if (_entity) Game->UnregisterObject(_entity);
|
||||
_entity = new CAdEntity(Game);
|
||||
if (!_entity || FAILED(_entity->LoadFile(Filename))) {
|
||||
if (!_entity || FAILED(_entity->loadFile(Filename))) {
|
||||
delete _entity;
|
||||
_entity = NULL;
|
||||
return E_FAIL;
|
||||
|
@ -38,8 +38,8 @@ public:
|
||||
DECLARE_PERSISTENT(CUIEntity, CUIObject)
|
||||
CUIEntity(CBGame *inGame);
|
||||
virtual ~CUIEntity();
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
|
||||
virtual HRESULT display(int OffsetX = 0, int OffsetY = 0);
|
||||
|
@ -173,7 +173,7 @@ HRESULT CUIObject::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
}
|
||||
|
||||
_image = new CBSprite(Game);
|
||||
if (!_image || FAILED(_image->LoadFile(Val->GetString()))) {
|
||||
if (!_image || FAILED(_image->loadFile(Val->GetString()))) {
|
||||
delete _image;
|
||||
_image = NULL;
|
||||
Stack->PushBool(false);
|
||||
|
@ -95,7 +95,7 @@ HRESULT CUIText::display(int OffsetX, int OffsetY) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIText::LoadFile(const char *Filename) {
|
||||
HRESULT CUIText::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIText::LoadFile failed for file '%s'", Filename);
|
||||
@ -107,7 +107,7 @@ HRESULT CUIText::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing STATIC file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing STATIC file '%s'", Filename);
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
@ -138,7 +138,7 @@ TOKEN_DEF(PARENT_NOTIFY)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIText::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CUIText::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(STATIC)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -177,7 +177,7 @@ HRESULT CUIText::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -191,7 +191,7 @@ HRESULT CUIText::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK:
|
||||
delete _back;
|
||||
_back = new CUITiledImage(Game);
|
||||
if (!_back || FAILED(_back->LoadFile((char *)params))) {
|
||||
if (!_back || FAILED(_back->loadFile((char *)params))) {
|
||||
delete _back;
|
||||
_back = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -201,7 +201,7 @@ HRESULT CUIText::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE:
|
||||
delete _image;
|
||||
_image = new CBSprite(Game);
|
||||
if (!_image || FAILED(_image->LoadFile((char *)params))) {
|
||||
if (!_image || FAILED(_image->loadFile((char *)params))) {
|
||||
delete _image;
|
||||
_image = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -250,7 +250,7 @@ HRESULT CUIText::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
|
@ -43,8 +43,8 @@ public:
|
||||
virtual ~CUIText();
|
||||
TTextAlign _textAlign;
|
||||
TVerticalAlign _verticalAlign;
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
|
||||
// scripting interface
|
||||
|
@ -119,7 +119,7 @@ HRESULT CUITiledImage::display(int X, int Y, int Width, int Height) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUITiledImage::LoadFile(const char *Filename) {
|
||||
HRESULT CUITiledImage::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUITiledImage::LoadFile failed for file '%s'", Filename);
|
||||
@ -131,7 +131,7 @@ HRESULT CUITiledImage::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TILED_IMAGE file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TILED_IMAGE file '%s'", Filename);
|
||||
|
||||
|
||||
delete [] Buffer;
|
||||
@ -158,7 +158,7 @@ TOKEN_DEF(HORIZONTAL_TILES)
|
||||
TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUITiledImage::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CUITiledImage::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(TILED_IMAGE)
|
||||
TOKEN_TABLE(TEMPLATE)
|
||||
@ -195,7 +195,7 @@ HRESULT CUITiledImage::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_IMAGE:
|
||||
|
@ -38,8 +38,8 @@ class CUITiledImage : public CBObject {
|
||||
public:
|
||||
DECLARE_PERSISTENT(CUITiledImage, CBObject)
|
||||
void CorrectSize(int *Width, int *Height);
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
|
||||
|
||||
HRESULT display(int X, int Y, int Width, int Height);
|
||||
|
@ -200,7 +200,7 @@ HRESULT CUIWindow::display(int OffsetX, int OffsetY) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIWindow::LoadFile(const char *Filename) {
|
||||
HRESULT CUIWindow::loadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIWindow::LoadFile failed for file '%s'", Filename);
|
||||
@ -212,7 +212,7 @@ HRESULT CUIWindow::LoadFile(const char *Filename) {
|
||||
_filename = new char [strlen(Filename) + 1];
|
||||
strcpy(_filename, Filename);
|
||||
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WINDOW file '%s'", Filename);
|
||||
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WINDOW file '%s'", Filename);
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
@ -259,7 +259,7 @@ TOKEN_DEF(EDITOR_PROPERTY)
|
||||
TOKEN_DEF(EDIT)
|
||||
TOKEN_DEF_END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
HRESULT CUIWindow::loadBuffer(byte *Buffer, bool Complete) {
|
||||
TOKEN_TABLE_START(commands)
|
||||
TOKEN_TABLE(WINDOW)
|
||||
TOKEN_TABLE(ALPHA_COLOR)
|
||||
@ -317,7 +317,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
while (cmd >= PARSERR_TOKENNOTFOUND && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) >= PARSERR_TOKENNOTFOUND) {
|
||||
switch (cmd) {
|
||||
case TOKEN_TEMPLATE:
|
||||
if (FAILED(LoadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
|
||||
break;
|
||||
|
||||
case TOKEN_NAME:
|
||||
@ -331,7 +331,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK:
|
||||
delete _back;
|
||||
_back = new CUITiledImage(Game);
|
||||
if (!_back || FAILED(_back->LoadFile((char *)params))) {
|
||||
if (!_back || FAILED(_back->loadFile((char *)params))) {
|
||||
delete _back;
|
||||
_back = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -341,7 +341,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_BACK_INACTIVE:
|
||||
delete _backInactive;
|
||||
_backInactive = new CUITiledImage(Game);
|
||||
if (!_backInactive || FAILED(_backInactive->LoadFile((char *)params))) {
|
||||
if (!_backInactive || FAILED(_backInactive->loadFile((char *)params))) {
|
||||
delete _backInactive;
|
||||
_backInactive = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -351,7 +351,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE:
|
||||
delete _image;
|
||||
_image = new CBSprite(Game);
|
||||
if (!_image || FAILED(_image->LoadFile((char *)params))) {
|
||||
if (!_image || FAILED(_image->loadFile((char *)params))) {
|
||||
delete _image;
|
||||
_image = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -361,7 +361,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_IMAGE_INACTIVE:
|
||||
delete _imageInactive,
|
||||
_imageInactive = new CBSprite(Game);
|
||||
if (!_imageInactive || FAILED(_imageInactive->LoadFile((char *)params))) {
|
||||
if (!_imageInactive || FAILED(_imageInactive->loadFile((char *)params))) {
|
||||
delete _imageInactive;
|
||||
_imageInactive = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -418,7 +418,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
case TOKEN_CURSOR:
|
||||
delete _cursor;
|
||||
_cursor = new CBSprite(Game);
|
||||
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
|
||||
if (!_cursor || FAILED(_cursor->loadFile((char *)params))) {
|
||||
delete _cursor;
|
||||
_cursor = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -427,7 +427,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_BUTTON: {
|
||||
CUIButton *btn = new CUIButton(Game);
|
||||
if (!btn || FAILED(btn->LoadBuffer(params, false))) {
|
||||
if (!btn || FAILED(btn->loadBuffer(params, false))) {
|
||||
delete btn;
|
||||
btn = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -440,7 +440,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_STATIC: {
|
||||
CUIText *text = new CUIText(Game);
|
||||
if (!text || FAILED(text->LoadBuffer(params, false))) {
|
||||
if (!text || FAILED(text->loadBuffer(params, false))) {
|
||||
delete text;
|
||||
text = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -453,7 +453,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_EDIT: {
|
||||
CUIEdit *edit = new CUIEdit(Game);
|
||||
if (!edit || FAILED(edit->LoadBuffer(params, false))) {
|
||||
if (!edit || FAILED(edit->loadBuffer(params, false))) {
|
||||
delete edit;
|
||||
edit = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -466,7 +466,7 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
|
||||
|
||||
case TOKEN_WINDOW: {
|
||||
CUIWindow *win = new CUIWindow(Game);
|
||||
if (!win || FAILED(win->LoadBuffer(params, false))) {
|
||||
if (!win || FAILED(win->loadBuffer(params, false))) {
|
||||
delete win;
|
||||
win = NULL;
|
||||
cmd = PARSERR_GENERIC;
|
||||
@ -736,7 +736,7 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
delete _imageInactive;
|
||||
_imageInactive = new CBSprite(Game);
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
if (!_imageInactive || FAILED(_imageInactive->LoadFile(Filename))) {
|
||||
if (!_imageInactive || FAILED(_imageInactive->loadFile(Filename))) {
|
||||
delete _imageInactive;
|
||||
_imageInactive = NULL;
|
||||
Stack->PushBool(false);
|
||||
@ -819,7 +819,7 @@ HRESULT CUIWindow::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
|
||||
CScValue *Val = Stack->Pop();
|
||||
cleanup();
|
||||
if (!Val->IsNULL()) {
|
||||
Stack->PushBool(SUCCEEDED(LoadFile(Val->GetString())));
|
||||
Stack->PushBool(SUCCEEDED(loadFile(Val->GetString())));
|
||||
} else Stack->PushBool(true);
|
||||
|
||||
return S_OK;
|
||||
|
@ -73,8 +73,8 @@ public:
|
||||
virtual bool handleKeypress(Common::Event *event, bool printable = false);
|
||||
CBArray<CUIObject *, CUIObject *> _widgets;
|
||||
TTextAlign _titleAlign;
|
||||
HRESULT LoadFile(const char *Filename);
|
||||
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
|
||||
HRESULT loadFile(const char *Filename);
|
||||
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
|
||||
CUITiledImage *_backInactive;
|
||||
CBFont *_fontInactive;
|
||||
CBSprite *_imageInactive;
|
||||
|
@ -681,7 +681,7 @@ HRESULT CVidTheoraPlayer::setAlphaImage(const Common::String &filename) {
|
||||
#if 0
|
||||
SAFE_DELETE(m_AlphaImage);
|
||||
m_AlphaImage = new CBImage(Game);
|
||||
if (!m_AlphaImage || FAILED(m_AlphaImage->LoadFile(Filename))) {
|
||||
if (!m_AlphaImage || FAILED(m_AlphaImage->loadFile(Filename))) {
|
||||
SAFE_DELETE(m_AlphaImage);
|
||||
SAFE_DELETE_ARRAY(m_AlphaFilename);
|
||||
return E_FAIL;
|
||||
|
@ -233,7 +233,7 @@ int WinterMuteEngine::init() {
|
||||
// load game
|
||||
uint32 DataInitStart = CBPlatform::GetTime();
|
||||
|
||||
if (FAILED(_game->LoadFile(_game->_settingsGameFile ? _game->_settingsGameFile : "default.game"))) {
|
||||
if (FAILED(_game->loadFile(_game->_settingsGameFile ? _game->_settingsGameFile : "default.game"))) {
|
||||
_game->LOG(ret, "Error loading game file. Exiting.");
|
||||
delete _game;
|
||||
_game = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user