aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2012-04-28 01:00:14 +0300
committerEinar Johan Trøan Sømåen2012-06-02 12:42:08 +0200
commit28c78b956dac6ee59d066f7ff2499569fe9877c7 (patch)
tree07e37e79e5610d3f21d22a8243083b78e09f8542
parent84fd9d0daca1846829b077aa18a7634df5e5ef9e (diff)
downloadscummvm-rg350-28c78b956dac6ee59d066f7ff2499569fe9877c7.tar.gz
scummvm-rg350-28c78b956dac6ee59d066f7ff2499569fe9877c7.tar.bz2
scummvm-rg350-28c78b956dac6ee59d066f7ff2499569fe9877c7.zip
WINTERMUTE: Mass rename m_FooBar -> _fooBar
-rw-r--r--engines/wintermute/AdActor.cpp784
-rw-r--r--engines/wintermute/AdActor.h46
-rw-r--r--engines/wintermute/AdEntity.cpp440
-rw-r--r--engines/wintermute/AdEntity.h12
-rw-r--r--engines/wintermute/AdGame.cpp968
-rw-r--r--engines/wintermute/AdGame.h64
-rw-r--r--engines/wintermute/AdInventory.cpp36
-rw-r--r--engines/wintermute/AdInventory.h4
-rw-r--r--engines/wintermute/AdInventoryBox.cpp186
-rw-r--r--engines/wintermute/AdInventoryBox.h22
-rw-r--r--engines/wintermute/AdItem.cpp324
-rw-r--r--engines/wintermute/AdItem.h26
-rw-r--r--engines/wintermute/AdLayer.cpp166
-rw-r--r--engines/wintermute/AdLayer.h12
-rw-r--r--engines/wintermute/AdNodeState.cpp102
-rw-r--r--engines/wintermute/AdNodeState.h12
-rw-r--r--engines/wintermute/AdObject.cpp674
-rw-r--r--engines/wintermute/AdObject.h66
-rw-r--r--engines/wintermute/AdPath.cpp38
-rw-r--r--engines/wintermute/AdPath.h6
-rw-r--r--engines/wintermute/AdPathPoint.cpp20
-rw-r--r--engines/wintermute/AdPathPoint.h6
-rw-r--r--engines/wintermute/AdRegion.cpp106
-rw-r--r--engines/wintermute/AdRegion.h8
-rw-r--r--engines/wintermute/AdResponse.cpp90
-rw-r--r--engines/wintermute/AdResponse.h16
-rw-r--r--engines/wintermute/AdResponseBox.cpp362
-rw-r--r--engines/wintermute/AdResponseBox.h30
-rw-r--r--engines/wintermute/AdResponseContext.cpp20
-rw-r--r--engines/wintermute/AdResponseContext.h4
-rw-r--r--engines/wintermute/AdRotLevel.cpp20
-rw-r--r--engines/wintermute/AdRotLevel.h2
-rw-r--r--engines/wintermute/AdScaleLevel.cpp20
-rw-r--r--engines/wintermute/AdScaleLevel.h2
-rw-r--r--engines/wintermute/AdScene.cpp1308
-rw-r--r--engines/wintermute/AdScene.h108
-rw-r--r--engines/wintermute/AdSceneNode.cpp28
-rw-r--r--engines/wintermute/AdSceneNode.h6
-rw-r--r--engines/wintermute/AdSceneState.cpp24
-rw-r--r--engines/wintermute/AdSceneState.h4
-rw-r--r--engines/wintermute/AdSentence.cpp216
-rw-r--r--engines/wintermute/AdSentence.h34
-rw-r--r--engines/wintermute/AdSpriteSet.cpp110
-rw-r--r--engines/wintermute/AdSpriteSet.h4
-rw-r--r--engines/wintermute/AdTalkDef.cpp116
-rw-r--r--engines/wintermute/AdTalkDef.h10
-rw-r--r--engines/wintermute/AdTalkHolder.cpp158
-rw-r--r--engines/wintermute/AdTalkHolder.h6
-rw-r--r--engines/wintermute/AdTalkNode.cpp150
-rw-r--r--engines/wintermute/AdTalkNode.h18
-rw-r--r--engines/wintermute/AdWaypointGroup.cpp80
-rw-r--r--engines/wintermute/AdWaypointGroup.h12
-rw-r--r--engines/wintermute/BActiveRect.cpp72
-rw-r--r--engines/wintermute/BActiveRect.h18
-rw-r--r--engines/wintermute/BBase.cpp34
-rw-r--r--engines/wintermute/BBase.h10
-rw-r--r--engines/wintermute/BDebugger.cpp2
-rw-r--r--engines/wintermute/BDebugger.h2
-rw-r--r--engines/wintermute/BDiskFile.cpp116
-rw-r--r--engines/wintermute/BDiskFile.h8
-rw-r--r--engines/wintermute/BDynBuffer.cpp68
-rw-r--r--engines/wintermute/BDynBuffer.h14
-rw-r--r--engines/wintermute/BEvent.cpp42
-rw-r--r--engines/wintermute/BEvent.h6
-rw-r--r--engines/wintermute/BFader.cpp114
-rw-r--r--engines/wintermute/BFader.h20
-rw-r--r--engines/wintermute/BFile.cpp6
-rw-r--r--engines/wintermute/BFile.h8
-rw-r--r--engines/wintermute/BFileEntry.cpp12
-rw-r--r--engines/wintermute/BFileEntry.h18
-rw-r--r--engines/wintermute/BFileManager.cpp198
-rw-r--r--engines/wintermute/BFileManager.h14
-rw-r--r--engines/wintermute/BFont.cpp10
-rw-r--r--engines/wintermute/BFontBitmap.cpp178
-rw-r--r--engines/wintermute/BFontBitmap.h18
-rw-r--r--engines/wintermute/BFontStorage.cpp52
-rw-r--r--engines/wintermute/BFontStorage.h6
-rw-r--r--engines/wintermute/BFontTT.cpp300
-rw-r--r--engines/wintermute/BFontTT.h110
-rw-r--r--engines/wintermute/BFrame.cpp262
-rw-r--r--engines/wintermute/BFrame.h18
-rw-r--r--engines/wintermute/BGame.cpp2082
-rw-r--r--engines/wintermute/BGame.h286
-rw-r--r--engines/wintermute/BImage.cpp30
-rw-r--r--engines/wintermute/BImage.h4
-rw-r--r--engines/wintermute/BKeyboardState.cpp78
-rw-r--r--engines/wintermute/BKeyboardState.h12
-rw-r--r--engines/wintermute/BNamedObject.cpp16
-rw-r--r--engines/wintermute/BNamedObject.h2
-rw-r--r--engines/wintermute/BObject.cpp538
-rw-r--r--engines/wintermute/BObject.h80
-rw-r--r--engines/wintermute/BPackage.cpp30
-rw-r--r--engines/wintermute/BPackage.h10
-rw-r--r--engines/wintermute/BParser.cpp26
-rw-r--r--engines/wintermute/BParser.h6
-rw-r--r--engines/wintermute/BPersistMgr.cpp200
-rw-r--r--engines/wintermute/BPersistMgr.h30
-rw-r--r--engines/wintermute/BPkgFile.cpp118
-rw-r--r--engines/wintermute/BPkgFile.h12
-rw-r--r--engines/wintermute/BQuickMsg.cpp10
-rw-r--r--engines/wintermute/BQuickMsg.h4
-rw-r--r--engines/wintermute/BRegion.cpp154
-rw-r--r--engines/wintermute/BRegion.h14
-rw-r--r--engines/wintermute/BRegistry.cpp40
-rw-r--r--engines/wintermute/BRegistry.h10
-rw-r--r--engines/wintermute/BRenderSDL.cpp186
-rw-r--r--engines/wintermute/BRenderSDL.h26
-rw-r--r--engines/wintermute/BRenderer.cpp92
-rw-r--r--engines/wintermute/BRenderer.h40
-rw-r--r--engines/wintermute/BResourceFile.cpp28
-rw-r--r--engines/wintermute/BResourceFile.h2
-rw-r--r--engines/wintermute/BResources.cpp2
-rw-r--r--engines/wintermute/BSaveThumbFile.cpp40
-rw-r--r--engines/wintermute/BSaveThumbFile.h2
-rw-r--r--engines/wintermute/BSaveThumbHelper.cpp24
-rw-r--r--engines/wintermute/BSaveThumbHelper.h4
-rw-r--r--engines/wintermute/BScriptHolder.cpp134
-rw-r--r--engines/wintermute/BScriptHolder.h8
-rw-r--r--engines/wintermute/BScriptable.cpp34
-rw-r--r--engines/wintermute/BScriptable.h6
-rw-r--r--engines/wintermute/BSound.cpp196
-rw-r--r--engines/wintermute/BSound.h32
-rw-r--r--engines/wintermute/BSoundBuffer.cpp156
-rw-r--r--engines/wintermute/BSoundBuffer.h24
-rw-r--r--engines/wintermute/BSoundMgr.cpp102
-rw-r--r--engines/wintermute/BSoundMgr.h14
-rw-r--r--engines/wintermute/BSprite.cpp374
-rw-r--r--engines/wintermute/BSprite.h42
-rw-r--r--engines/wintermute/BStringTable.cpp50
-rw-r--r--engines/wintermute/BStringTable.h4
-rw-r--r--engines/wintermute/BSubFrame.cpp296
-rw-r--r--engines/wintermute/BSubFrame.h38
-rw-r--r--engines/wintermute/BSurface.cpp44
-rw-r--r--engines/wintermute/BSurface.h34
-rw-r--r--engines/wintermute/BSurfaceSDL.cpp122
-rw-r--r--engines/wintermute/BSurfaceSDL.h8
-rw-r--r--engines/wintermute/BSurfaceStorage.cpp76
-rw-r--r--engines/wintermute/BSurfaceStorage.h4
-rw-r--r--engines/wintermute/BTransitionMgr.cpp56
-rw-r--r--engines/wintermute/BTransitionMgr.h12
-rw-r--r--engines/wintermute/BViewport.cpp30
-rw-r--r--engines/wintermute/BViewport.h8
-rw-r--r--engines/wintermute/FontGlyphCache.cpp28
-rw-r--r--engines/wintermute/FontGlyphCache.h54
-rw-r--r--engines/wintermute/PartEmitter.cpp636
-rw-r--r--engines/wintermute/PartEmitter.h88
-rw-r--r--engines/wintermute/PartForce.cpp14
-rw-r--r--engines/wintermute/PartForce.h6
-rw-r--r--engines/wintermute/PartParticle.cpp224
-rw-r--r--engines/wintermute/PartParticle.h46
-rw-r--r--engines/wintermute/PlatformSDL.cpp62
-rw-r--r--engines/wintermute/SysClass.cpp88
-rw-r--r--engines/wintermute/SysClass.h30
-rw-r--r--engines/wintermute/SysClassRegistry.cpp100
-rw-r--r--engines/wintermute/SysClassRegistry.h14
-rw-r--r--engines/wintermute/SysInstance.cpp10
-rw-r--r--engines/wintermute/SysInstance.h20
-rw-r--r--engines/wintermute/UIButton.cpp652
-rw-r--r--engines/wintermute/UIButton.h40
-rw-r--r--engines/wintermute/UIEdit.cpp464
-rw-r--r--engines/wintermute/UIEdit.h20
-rw-r--r--engines/wintermute/UIEntity.cpp104
-rw-r--r--engines/wintermute/UIEntity.h2
-rw-r--r--engines/wintermute/UIObject.cpp284
-rw-r--r--engines/wintermute/UIObject.h36
-rw-r--r--engines/wintermute/UIText.cpp174
-rw-r--r--engines/wintermute/UIText.h4
-rw-r--r--engines/wintermute/UITiledImage.cpp198
-rw-r--r--engines/wintermute/UITiledImage.h20
-rw-r--r--engines/wintermute/UIWindow.cpp642
-rw-r--r--engines/wintermute/UIWindow.h40
-rw-r--r--engines/wintermute/coll_templ.h138
-rw-r--r--engines/wintermute/persistent.h6
-rw-r--r--engines/wintermute/scriptables/SXArray.cpp80
-rw-r--r--engines/wintermute/scriptables/SXArray.h4
-rw-r--r--engines/wintermute/scriptables/SXDate.cpp80
-rw-r--r--engines/wintermute/scriptables/SXDate.h4
-rw-r--r--engines/wintermute/scriptables/SXFile.cpp236
-rw-r--r--engines/wintermute/scriptables/SXFile.h10
-rw-r--r--engines/wintermute/scriptables/SXMath.cpp12
-rw-r--r--engines/wintermute/scriptables/SXMemBuffer.cpp122
-rw-r--r--engines/wintermute/scriptables/SXMemBuffer.h4
-rw-r--r--engines/wintermute/scriptables/SXStore.cpp162
-rw-r--r--engines/wintermute/scriptables/SXStore.h88
-rw-r--r--engines/wintermute/scriptables/SXString.cpp48
-rw-r--r--engines/wintermute/scriptables/ScEngine.cpp428
-rw-r--r--engines/wintermute/scriptables/ScEngine.h68
-rw-r--r--engines/wintermute/scriptables/ScScript.cpp1006
-rw-r--r--engines/wintermute/scriptables/ScScript.h80
-rw-r--r--engines/wintermute/scriptables/ScStack.cpp78
-rw-r--r--engines/wintermute/scriptables/ScStack.h4
-rw-r--r--engines/wintermute/scriptables/ScValue.cpp560
-rw-r--r--engines/wintermute/scriptables/ScValue.h22
-rw-r--r--engines/wintermute/utils.cpp2
194 files changed, 11153 insertions, 11153 deletions
diff --git a/engines/wintermute/AdActor.cpp b/engines/wintermute/AdActor.cpp
index 12aa363df1..2c945573ec 100644
--- a/engines/wintermute/AdActor.cpp
+++ b/engines/wintermute/AdActor.cpp
@@ -57,96 +57,96 @@ IMPLEMENT_PERSISTENT(CAdActor, false)
//////////////////////////////////////////////////////////////////////////
CAdActor::CAdActor(CBGame *inGame): CAdTalkHolder(inGame) {
- m_Path = new CAdPath(Game);
+ _path = new CAdPath(Game);
- m_Type = OBJECT_ACTOR;
- m_Dir = DI_LEFT;
+ _type = OBJECT_ACTOR;
+ _dir = DI_LEFT;
- m_WalkSprite = NULL;
- m_StandSprite = NULL;
- m_TurnLeftSprite = NULL;
- m_TurnRightSprite = NULL;
+ _walkSprite = NULL;
+ _standSprite = NULL;
+ _turnLeftSprite = NULL;
+ _turnRightSprite = NULL;
- m_TargetPoint = new CBPoint;
- m_AfterWalkDir = DI_NONE;
+ _targetPoint = new CBPoint;
+ _afterWalkDir = DI_NONE;
- m_AnimSprite2 = NULL;
+ _animSprite2 = NULL;
SetDefaultAnimNames();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdActor::SetDefaultAnimNames() {
- m_TalkAnimName = NULL;
- CBUtils::SetString(&m_TalkAnimName, "talk");
+ _talkAnimName = NULL;
+ CBUtils::SetString(&_talkAnimName, "talk");
- m_IdleAnimName = NULL;
- CBUtils::SetString(&m_IdleAnimName, "idle");
+ _idleAnimName = NULL;
+ CBUtils::SetString(&_idleAnimName, "idle");
- m_WalkAnimName = NULL;
- CBUtils::SetString(&m_WalkAnimName, "walk");
+ _walkAnimName = NULL;
+ CBUtils::SetString(&_walkAnimName, "walk");
- m_TurnLeftAnimName = NULL;
- CBUtils::SetString(&m_TurnLeftAnimName, "turnleft");
+ _turnLeftAnimName = NULL;
+ CBUtils::SetString(&_turnLeftAnimName, "turnleft");
- m_TurnRightAnimName = NULL;
- CBUtils::SetString(&m_TurnRightAnimName, "turnright");
+ _turnRightAnimName = NULL;
+ CBUtils::SetString(&_turnRightAnimName, "turnright");
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
CAdActor::~CAdActor() {
- delete m_Path;
- delete m_TargetPoint;
- m_Path = NULL;
- m_TargetPoint = NULL;
-
- delete m_WalkSprite;
- delete m_StandSprite;
- delete m_TurnLeftSprite;
- delete m_TurnRightSprite;
- m_WalkSprite = NULL;
- m_StandSprite = NULL;
- m_TurnLeftSprite = NULL;
- m_TurnRightSprite = NULL;
-
- m_AnimSprite2 = NULL; // ref only
-
- for (int i = 0; i < m_TalkSprites.GetSize(); i++) {
- delete m_TalkSprites[i];
+ delete _path;
+ delete _targetPoint;
+ _path = NULL;
+ _targetPoint = NULL;
+
+ delete _walkSprite;
+ delete _standSprite;
+ delete _turnLeftSprite;
+ delete _turnRightSprite;
+ _walkSprite = NULL;
+ _standSprite = NULL;
+ _turnLeftSprite = NULL;
+ _turnRightSprite = NULL;
+
+ _animSprite2 = NULL; // ref only
+
+ for (int i = 0; i < _talkSprites.GetSize(); i++) {
+ delete _talkSprites[i];
}
- m_TalkSprites.RemoveAll();
+ _talkSprites.RemoveAll();
- for (int i = 0; i < m_TalkSpritesEx.GetSize(); i++) {
- delete m_TalkSpritesEx[i];
+ for (int i = 0; i < _talkSpritesEx.GetSize(); i++) {
+ delete _talkSpritesEx[i];
}
- m_TalkSpritesEx.RemoveAll();
-
-
- delete[] m_TalkAnimName;
- delete[] m_IdleAnimName;
- delete[] m_WalkAnimName;
- delete[] m_TurnLeftAnimName;
- delete[] m_TurnRightAnimName;
- m_TalkAnimName = NULL;
- m_IdleAnimName = NULL;
- m_WalkAnimName = NULL;
- m_TurnLeftAnimName = NULL;
- m_TurnRightAnimName = NULL;
-
- for (int i = 0; i < m_Anims.GetSize(); i++) {
- delete m_Anims[i];
- m_Anims[i] = NULL;
+ _talkSpritesEx.RemoveAll();
+
+
+ delete[] _talkAnimName;
+ delete[] _idleAnimName;
+ delete[] _walkAnimName;
+ delete[] _turnLeftAnimName;
+ delete[] _turnRightAnimName;
+ _talkAnimName = NULL;
+ _idleAnimName = NULL;
+ _walkAnimName = NULL;
+ _turnLeftAnimName = NULL;
+ _turnRightAnimName = NULL;
+
+ for (int i = 0; i < _anims.GetSize(); i++) {
+ delete _anims[i];
+ _anims[i] = NULL;
}
- m_Anims.RemoveAll();
+ _anims.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdActor::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdActor::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -154,8 +154,8 @@ HRESULT CAdActor::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -267,11 +267,11 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_X:
- parser.ScanStr((char *)params, "%d", &m_PosX);
+ parser.ScanStr((char *)params, "%d", &_posX);
break;
case TOKEN_Y:
- parser.ScanStr((char *)params, "%d", &m_PosY);
+ parser.ScanStr((char *)params, "%d", &_posY);
break;
case TOKEN_NAME:
@@ -287,70 +287,70 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_SCALABLE:
- parser.ScanStr((char *)params, "%b", &m_Zoomable);
+ parser.ScanStr((char *)params, "%b", &_zoomable);
break;
case TOKEN_ROTABLE:
case TOKEN_ROTATABLE:
- parser.ScanStr((char *)params, "%b", &m_Rotatable);
+ parser.ScanStr((char *)params, "%b", &_rotatable);
break;
case TOKEN_REGISTRABLE:
case TOKEN_INTERACTIVE:
- parser.ScanStr((char *)params, "%b", &m_Registrable);
+ parser.ScanStr((char *)params, "%b", &_registrable);
break;
case TOKEN_SHADOWABLE:
case TOKEN_COLORABLE:
- parser.ScanStr((char *)params, "%b", &m_Shadowable);
+ parser.ScanStr((char *)params, "%b", &_shadowable);
break;
case TOKEN_ACTIVE:
- parser.ScanStr((char *)params, "%b", &m_Active);
+ parser.ScanStr((char *)params, "%b", &_active);
break;
case TOKEN_WALK:
- delete m_WalkSprite;
- m_WalkSprite = NULL;
+ delete _walkSprite;
+ _walkSprite = NULL;
spr = new CAdSpriteSet(Game, this);
- if (!spr || FAILED(spr->LoadBuffer(params, true, AdGame->m_TexWalkLifeTime, CACHE_HALF))) cmd = PARSERR_GENERIC;
- else m_WalkSprite = spr;
+ 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->m_TexTalkLifeTime))) cmd = PARSERR_GENERIC;
- else m_TalkSprites.Add(spr);
+ 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->m_TexTalkLifeTime))) cmd = PARSERR_GENERIC;
- else m_TalkSpritesEx.Add(spr);
+ if (!spr || FAILED(spr->LoadBuffer(params, true, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
+ else _talkSpritesEx.Add(spr);
break;
case TOKEN_STAND:
- delete m_StandSprite;
- m_StandSprite = NULL;
+ delete _standSprite;
+ _standSprite = NULL;
spr = new CAdSpriteSet(Game, this);
- if (!spr || FAILED(spr->LoadBuffer(params, true, AdGame->m_TexStandLifeTime))) cmd = PARSERR_GENERIC;
- else m_StandSprite = spr;
+ if (!spr || FAILED(spr->LoadBuffer(params, true, AdGame->_texStandLifeTime))) cmd = PARSERR_GENERIC;
+ else _standSprite = spr;
break;
case TOKEN_TURN_LEFT:
- delete m_TurnLeftSprite;
- m_TurnLeftSprite = NULL;
+ delete _turnLeftSprite;
+ _turnLeftSprite = NULL;
spr = new CAdSpriteSet(Game, this);
if (!spr || FAILED(spr->LoadBuffer(params, true))) cmd = PARSERR_GENERIC;
- else m_TurnLeftSprite = spr;
+ else _turnLeftSprite = spr;
break;
case TOKEN_TURN_RIGHT:
- delete m_TurnRightSprite;
- m_TurnRightSprite = NULL;
+ delete _turnRightSprite;
+ _turnRightSprite = NULL;
spr = new CAdSpriteSet(Game, this);
if (!spr || FAILED(spr->LoadBuffer(params, true))) cmd = PARSERR_GENERIC;
- else m_TurnRightSprite = spr;
+ else _turnRightSprite = spr;
break;
case TOKEN_SCRIPT:
@@ -358,23 +358,23 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_CURSOR:
- delete m_Cursor;
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- delete m_Cursor;
- m_Cursor = NULL;
+ delete _cursor;
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_SOUND_VOLUME:
- parser.ScanStr((char *)params, "%d", &m_SFXVolume);
+ parser.ScanStr((char *)params, "%d", &_sFXVolume);
break;
case TOKEN_SCALE: {
int s;
parser.ScanStr((char *)params, "%d", &s);
- m_Scale = (float)s;
+ _scale = (float)s;
}
break;
@@ -382,13 +382,13 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_RELATIVE_SCALE: {
int s;
parser.ScanStr((char *)params, "%d", &s);
- m_RelativeScale = (float)s;
+ _relativeScale = (float)s;
}
break;
case TOKEN_SOUND_PANNING:
- parser.ScanStr((char *)params, "%b", &m_AutoSoundPanning);
+ parser.ScanStr((char *)params, "%b", &_autoSoundPanning);
break;
case TOKEN_PROPERTY:
@@ -396,49 +396,49 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_BLOCKED_REGION: {
- delete m_BlockRegion;
- delete m_CurrentBlockRegion;
- m_BlockRegion = NULL;
- m_CurrentBlockRegion = NULL;
+ delete _blockRegion;
+ delete _currentBlockRegion;
+ _blockRegion = NULL;
+ _currentBlockRegion = NULL;
CBRegion *rgn = new CBRegion(Game);
CBRegion *crgn = new CBRegion(Game);
if (!rgn || !crgn || FAILED(rgn->LoadBuffer(params, false))) {
- delete m_BlockRegion;
- delete m_CurrentBlockRegion;
- m_BlockRegion = NULL;
- m_CurrentBlockRegion = NULL;
+ delete _blockRegion;
+ delete _currentBlockRegion;
+ _blockRegion = NULL;
+ _currentBlockRegion = NULL;
cmd = PARSERR_GENERIC;
} else {
- m_BlockRegion = rgn;
- m_CurrentBlockRegion = crgn;
- m_CurrentBlockRegion->Mimic(m_BlockRegion);
+ _blockRegion = rgn;
+ _currentBlockRegion = crgn;
+ _currentBlockRegion->Mimic(_blockRegion);
}
}
break;
case TOKEN_WAYPOINTS: {
- delete m_WptGroup;
- delete m_CurrentWptGroup;
- m_WptGroup = NULL;
- m_CurrentWptGroup = NULL;
+ delete _wptGroup;
+ delete _currentWptGroup;
+ _wptGroup = NULL;
+ _currentWptGroup = NULL;
CAdWaypointGroup *wpt = new CAdWaypointGroup(Game);
CAdWaypointGroup *cwpt = new CAdWaypointGroup(Game);
if (!wpt || !cwpt || FAILED(wpt->LoadBuffer(params, false))) {
- delete m_WptGroup;
- delete m_CurrentWptGroup;
- m_WptGroup = NULL;
- m_CurrentWptGroup = NULL;
+ delete _wptGroup;
+ delete _currentWptGroup;
+ _wptGroup = NULL;
+ _currentWptGroup = NULL;
cmd = PARSERR_GENERIC;
} else {
- m_WptGroup = wpt;
- m_CurrentWptGroup = cwpt;
- m_CurrentWptGroup->Mimic(m_WptGroup);
+ _wptGroup = wpt;
+ _currentWptGroup = cwpt;
+ _currentWptGroup->Mimic(_wptGroup);
}
}
break;
case TOKEN_IGNORE_ITEMS:
- parser.ScanStr((char *)params, "%b", &m_IgnoreItems);
+ parser.ScanStr((char *)params, "%b", &_ignoreItems);
break;
case TOKEN_ALPHA_COLOR:
@@ -456,7 +456,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;
- else m_Anims.Add(Anim);
+ else _anims.Add(Anim);
}
break;
}
@@ -474,8 +474,8 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
if (alpha != 0 && ar == 0 && ag == 0 && ab == 0) {
ar = ag = ab = 255;
}
- m_AlphaColor = DRGBA(ar, ag, ab, alpha);
- m_State = m_NextState = STATE_READY;
+ _alphaColor = DRGBA(ar, ag, ab, alpha);
+ _state = _nextState = STATE_READY;
return S_OK;
}
@@ -485,83 +485,83 @@ HRESULT CAdActor::LoadBuffer(byte *Buffer, bool Complete) {
void CAdActor::TurnTo(TDirection dir) {
int delta1, delta2, delta3, delta;
- delta1 = dir - m_Dir;
- delta2 = dir + NUM_DIRECTIONS - m_Dir;
- delta3 = dir - NUM_DIRECTIONS - m_Dir;
+ delta1 = dir - _dir;
+ delta2 = dir + NUM_DIRECTIONS - _dir;
+ delta3 = dir - NUM_DIRECTIONS - _dir;
delta1 = (abs(delta1) <= abs(delta2)) ? delta1 : delta2;
delta = (abs(delta1) <= abs(delta3)) ? delta1 : delta3;
// already there?
if (abs(delta) < 2) {
- m_Dir = dir;
- m_State = m_NextState;
- m_NextState = STATE_READY;
+ _dir = dir;
+ _state = _nextState;
+ _nextState = STATE_READY;
return;
}
- m_TargetDir = dir;
- m_State = delta < 0 ? STATE_TURNING_LEFT : STATE_TURNING_RIGHT;
+ _targetDir = dir;
+ _state = delta < 0 ? STATE_TURNING_LEFT : STATE_TURNING_RIGHT;
- m_TempSprite2 = NULL;
+ _tempSprite2 = NULL;
}
//////////////////////////////////////////////////////////////////////////
void CAdActor::GoTo(int X, int Y, TDirection AfterWalkDir) {
- m_AfterWalkDir = AfterWalkDir;
- if (X == m_TargetPoint->x && Y == m_TargetPoint->y && m_State == STATE_FOLLOWING_PATH) return;
+ _afterWalkDir = AfterWalkDir;
+ if (X == _targetPoint->x && Y == _targetPoint->y && _state == STATE_FOLLOWING_PATH) return;
- m_Path->Reset();
- m_Path->SetReady(false);
+ _path->Reset();
+ _path->SetReady(false);
- m_TargetPoint->x = X;
- m_TargetPoint->y = Y;
+ _targetPoint->x = X;
+ _targetPoint->y = Y;
- ((CAdGame *)Game)->m_Scene->CorrectTargetPoint(m_PosX, m_PosY, &m_TargetPoint->x, &m_TargetPoint->y, true, this);
+ ((CAdGame *)Game)->_scene->CorrectTargetPoint(_posX, _posY, &_targetPoint->x, &_targetPoint->y, true, this);
- m_State = STATE_SEARCHING_PATH;
+ _state = STATE_SEARCHING_PATH;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdActor::Display() {
- if (m_Active) UpdateSounds();
+ if (_active) UpdateSounds();
uint32 Alpha;
- if (m_AlphaColor != 0) Alpha = m_AlphaColor;
- else Alpha = m_Shadowable ? ((CAdGame *)Game)->m_Scene->GetAlphaAt(m_PosX, m_PosY, true) : 0xFFFFFFFF;
+ if (_alphaColor != 0) Alpha = _alphaColor;
+ else Alpha = _shadowable ? ((CAdGame *)Game)->_scene->GetAlphaAt(_posX, _posY, true) : 0xFFFFFFFF;
float ScaleX, ScaleY;
GetScale(&ScaleX, &ScaleY);
float Rotate;
- if (m_Rotatable) {
- if (m_RotateValid) Rotate = m_Rotate;
- else Rotate = ((CAdGame *)Game)->m_Scene->GetRotationAt(m_PosX, m_PosY) + m_RelativeRotate;
+ if (_rotatable) {
+ if (_rotateValid) Rotate = _rotate;
+ else Rotate = ((CAdGame *)Game)->_scene->GetRotationAt(_posX, _posY) + _relativeRotate;
} else Rotate = 0.0f;
- if (m_Active) DisplaySpriteAttachments(true);
+ if (_active) DisplaySpriteAttachments(true);
- if (m_CurrentSprite && m_Active) {
- bool Reg = m_Registrable;
- if (m_IgnoreItems && ((CAdGame *)Game)->m_SelectedItem) Reg = false;
+ if (_currentSprite && _active) {
+ bool Reg = _registrable;
+ if (_ignoreItems && ((CAdGame *)Game)->_selectedItem) Reg = false;
- m_CurrentSprite->Display(m_PosX,
- m_PosY,
- Reg ? m_RegisterAlias : NULL,
+ _currentSprite->Display(_posX,
+ _posY,
+ Reg ? _registerAlias : NULL,
ScaleX,
ScaleY,
Alpha,
Rotate,
- m_BlendMode);
+ _blendMode);
}
- if (m_Active) DisplaySpriteAttachments(false);
- if (m_Active && m_PartEmitter) m_PartEmitter->Display();
+ if (_active) DisplaySpriteAttachments(false);
+ if (_active && _partEmitter) _partEmitter->Display();
return S_OK;
@@ -570,128 +570,128 @@ HRESULT CAdActor::Display() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdActor::Update() {
- m_CurrentSprite = NULL;
+ _currentSprite = NULL;
- if (m_State == STATE_READY) {
- if (m_AnimSprite) {
- delete m_AnimSprite;
- m_AnimSprite = NULL;
+ if (_state == STATE_READY) {
+ if (_animSprite) {
+ delete _animSprite;
+ _animSprite = NULL;
}
- if (m_AnimSprite2) {
- m_AnimSprite2 = NULL;
+ if (_animSprite2) {
+ _animSprite2 = NULL;
}
}
// finished playing animation?
- if (m_State == STATE_PLAYING_ANIM && m_AnimSprite != NULL && m_AnimSprite->m_Finished) {
- m_State = m_NextState;
- m_NextState = STATE_READY;
- m_CurrentSprite = m_AnimSprite;
+ if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) {
+ _state = _nextState;
+ _nextState = STATE_READY;
+ _currentSprite = _animSprite;
}
- if (m_State == STATE_PLAYING_ANIM_SET && m_AnimSprite2 != NULL && m_AnimSprite2->m_Finished) {
- m_State = m_NextState;
- m_NextState = STATE_READY;
- m_CurrentSprite = m_AnimSprite2;
+ if (_state == STATE_PLAYING_ANIM_SET && _animSprite2 != NULL && _animSprite2->_finished) {
+ _state = _nextState;
+ _nextState = STATE_READY;
+ _currentSprite = _animSprite2;
}
- if (m_Sentence && m_State != STATE_TALKING) m_Sentence->Finish();
+ if (_sentence && _state != STATE_TALKING) _sentence->Finish();
// default: stand animation
- if (!m_CurrentSprite) {
- if (m_Sprite) m_CurrentSprite = m_Sprite;
+ if (!_currentSprite) {
+ if (_sprite) _currentSprite = _sprite;
else {
- if (m_StandSprite) {
- m_CurrentSprite = m_StandSprite->GetSprite(m_Dir);
+ if (_standSprite) {
+ _currentSprite = _standSprite->GetSprite(_dir);
} else {
- CAdSpriteSet *Anim = GetAnimByName(m_IdleAnimName);
- if (Anim) m_CurrentSprite = Anim->GetSprite(m_Dir);
+ CAdSpriteSet *Anim = GetAnimByName(_idleAnimName);
+ if (Anim) _currentSprite = Anim->GetSprite(_dir);
}
}
}
bool already_moved = false;
- switch (m_State) {
+ switch (_state) {
//////////////////////////////////////////////////////////////////////////
case STATE_PLAYING_ANIM:
- m_CurrentSprite = m_AnimSprite;
+ _currentSprite = _animSprite;
break;
//////////////////////////////////////////////////////////////////////////
case STATE_PLAYING_ANIM_SET:
- m_CurrentSprite = m_AnimSprite2;
+ _currentSprite = _animSprite2;
break;
//////////////////////////////////////////////////////////////////////////
case STATE_TURNING_LEFT:
- if (m_TempSprite2 == NULL || m_TempSprite2->m_Finished) {
- if (m_Dir > 0) m_Dir = (TDirection)(m_Dir - 1);
- else m_Dir = (TDirection)(NUM_DIRECTIONS - 1);
-
- if (m_Dir == m_TargetDir) {
- m_TempSprite2 = NULL;
- m_State = m_NextState;
- m_NextState = STATE_READY;
+ if (_tempSprite2 == NULL || _tempSprite2->_finished) {
+ if (_dir > 0) _dir = (TDirection)(_dir - 1);
+ else _dir = (TDirection)(NUM_DIRECTIONS - 1);
+
+ if (_dir == _targetDir) {
+ _tempSprite2 = NULL;
+ _state = _nextState;
+ _nextState = STATE_READY;
} else {
- if (m_TurnLeftSprite) {
- m_TempSprite2 = m_TurnLeftSprite->GetSprite(m_Dir);
+ if (_turnLeftSprite) {
+ _tempSprite2 = _turnLeftSprite->GetSprite(_dir);
} else {
- CAdSpriteSet *Anim = GetAnimByName(m_TurnLeftAnimName);
- if (Anim) m_TempSprite2 = Anim->GetSprite(m_Dir);
+ CAdSpriteSet *Anim = GetAnimByName(_turnLeftAnimName);
+ if (Anim) _tempSprite2 = Anim->GetSprite(_dir);
}
- if (m_TempSprite2) {
- m_TempSprite2->Reset();
- if (m_TempSprite2->m_Looping) m_TempSprite2->m_Looping = false;
+ if (_tempSprite2) {
+ _tempSprite2->Reset();
+ if (_tempSprite2->_looping) _tempSprite2->_looping = false;
}
- m_CurrentSprite = m_TempSprite2;
+ _currentSprite = _tempSprite2;
}
- } else m_CurrentSprite = m_TempSprite2;
+ } else _currentSprite = _tempSprite2;
break;
//////////////////////////////////////////////////////////////////////////
case STATE_TURNING_RIGHT:
- if (m_TempSprite2 == NULL || m_TempSprite2->m_Finished) {
- m_Dir = (TDirection)(m_Dir + 1);
+ if (_tempSprite2 == NULL || _tempSprite2->_finished) {
+ _dir = (TDirection)(_dir + 1);
- if ((int)m_Dir >= (int)NUM_DIRECTIONS) m_Dir = (TDirection)(0);
+ if ((int)_dir >= (int)NUM_DIRECTIONS) _dir = (TDirection)(0);
- if (m_Dir == m_TargetDir) {
- m_TempSprite2 = NULL;
- m_State = m_NextState;
- m_NextState = STATE_READY;
+ if (_dir == _targetDir) {
+ _tempSprite2 = NULL;
+ _state = _nextState;
+ _nextState = STATE_READY;
} else {
- if (m_TurnRightSprite) {
- m_TempSprite2 = m_TurnRightSprite->GetSprite(m_Dir);
+ if (_turnRightSprite) {
+ _tempSprite2 = _turnRightSprite->GetSprite(_dir);
} else {
- CAdSpriteSet *Anim = GetAnimByName(m_TurnRightAnimName);
- if (Anim) m_TempSprite2 = Anim->GetSprite(m_Dir);
+ CAdSpriteSet *Anim = GetAnimByName(_turnRightAnimName);
+ if (Anim) _tempSprite2 = Anim->GetSprite(_dir);
}
- if (m_TempSprite2) {
- m_TempSprite2->Reset();
- if (m_TempSprite2->m_Looping) m_TempSprite2->m_Looping = false;
+ if (_tempSprite2) {
+ _tempSprite2->Reset();
+ if (_tempSprite2->_looping) _tempSprite2->_looping = false;
}
- m_CurrentSprite = m_TempSprite2;
+ _currentSprite = _tempSprite2;
}
- } else m_CurrentSprite = m_TempSprite2;
+ } else _currentSprite = _tempSprite2;
break;
//////////////////////////////////////////////////////////////////////////
case STATE_SEARCHING_PATH:
// keep asking scene for the path
- if (((CAdGame *)Game)->m_Scene->GetPath(CBPoint(m_PosX, m_PosY), *m_TargetPoint, m_Path, this))
- m_State = STATE_WAITING_PATH;
+ if (((CAdGame *)Game)->_scene->GetPath(CBPoint(_posX, _posY), *_targetPoint, _path, this))
+ _state = STATE_WAITING_PATH;
break;
//////////////////////////////////////////////////////////////////////////
case STATE_WAITING_PATH:
// wait until the scene finished the path
- if (m_Path->m_Ready) FollowPath();
+ if (_path->_ready) FollowPath();
break;
@@ -703,41 +703,41 @@ HRESULT CAdActor::Update() {
//////////////////////////////////////////////////////////////////////////
case STATE_TALKING: {
- m_Sentence->Update(m_Dir);
- if (m_Sentence->m_CurrentSprite) m_TempSprite2 = m_Sentence->m_CurrentSprite;
+ _sentence->Update(_dir);
+ if (_sentence->_currentSprite) _tempSprite2 = _sentence->_currentSprite;
- bool TimeIsUp = (m_Sentence->m_Sound && m_Sentence->m_SoundStarted && (!m_Sentence->m_Sound->IsPlaying() && !m_Sentence->m_Sound->IsPaused())) || (!m_Sentence->m_Sound && m_Sentence->m_Duration <= Game->m_Timer - m_Sentence->m_StartTime);
- if (m_TempSprite2 == NULL || m_TempSprite2->m_Finished || (/*m_TempSprite2->m_Looping &&*/ TimeIsUp)) {
+ 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) {
- m_Sentence->Finish();
- m_TempSprite2 = NULL;
- m_State = m_NextState;
- m_NextState = STATE_READY;
+ _sentence->Finish();
+ _tempSprite2 = NULL;
+ _state = _nextState;
+ _nextState = STATE_READY;
} else {
- m_TempSprite2 = GetTalkStance(m_Sentence->GetNextStance());
- if (m_TempSprite2) {
- m_TempSprite2->Reset();
- m_CurrentSprite = m_TempSprite2;
- ((CAdGame *)Game)->AddSentence(m_Sentence);
+ _tempSprite2 = GetTalkStance(_sentence->GetNextStance());
+ if (_tempSprite2) {
+ _tempSprite2->Reset();
+ _currentSprite = _tempSprite2;
+ ((CAdGame *)Game)->AddSentence(_sentence);
}
}
} else {
- m_CurrentSprite = m_TempSprite2;
- ((CAdGame *)Game)->AddSentence(m_Sentence);
+ _currentSprite = _tempSprite2;
+ ((CAdGame *)Game)->AddSentence(_sentence);
}
}
break;
//////////////////////////////////////////////////////////////////////////
case STATE_READY:
- if (!m_AnimSprite && !m_AnimSprite2) {
- if (m_Sprite) m_CurrentSprite = m_Sprite;
+ if (!_animSprite && !_animSprite2) {
+ if (_sprite) _currentSprite = _sprite;
else {
- if (m_StandSprite) {
- m_CurrentSprite = m_StandSprite->GetSprite(m_Dir);
+ if (_standSprite) {
+ _currentSprite = _standSprite->GetSprite(_dir);
} else {
- CAdSpriteSet *Anim = GetAnimByName(m_IdleAnimName);
- if (Anim) m_CurrentSprite = Anim->GetSprite(m_Dir);
+ CAdSpriteSet *Anim = GetAnimByName(_idleAnimName);
+ if (Anim) _currentSprite = Anim->GetSprite(_dir);
}
}
}
@@ -745,19 +745,19 @@ HRESULT CAdActor::Update() {
}
- if (m_CurrentSprite && !already_moved) {
- m_CurrentSprite->GetCurrentFrame(m_Zoomable ? ((CAdGame *)Game)->m_Scene->GetZoomAt(m_PosX, m_PosY) : 100, m_Zoomable ? ((CAdGame *)Game)->m_Scene->GetZoomAt(m_PosX, m_PosY) : 100);
- if (m_CurrentSprite->m_Changed) {
- m_PosX += m_CurrentSprite->m_MoveX;
- m_PosY += m_CurrentSprite->m_MoveY;
+ if (_currentSprite && !already_moved) {
+ _currentSprite->GetCurrentFrame(_zoomable ? ((CAdGame *)Game)->_scene->GetZoomAt(_posX, _posY) : 100, _zoomable ? ((CAdGame *)Game)->_scene->GetZoomAt(_posX, _posY) : 100);
+ if (_currentSprite->_changed) {
+ _posX += _currentSprite->_moveX;
+ _posY += _currentSprite->_moveY;
AfterMove();
}
}
- //Game->QuickMessageForm("%s", m_CurrentSprite->m_Filename);
+ //Game->QuickMessageForm("%s", _currentSprite->_filename);
UpdateBlockRegion();
- m_Ready = (m_State == STATE_READY);
+ _ready = (_state == STATE_READY);
UpdatePartEmitter();
UpdateSpriteAttachments();
@@ -769,99 +769,99 @@ HRESULT CAdActor::Update() {
//////////////////////////////////////////////////////////////////////////
void CAdActor::FollowPath() {
// skip current position
- m_Path->GetFirst();
- while (m_Path->GetCurrent() != NULL) {
- if (m_Path->GetCurrent()->x != m_PosX || m_Path->GetCurrent()->y != m_PosY) break;
- m_Path->GetNext();
+ _path->GetFirst();
+ while (_path->GetCurrent() != NULL) {
+ if (_path->GetCurrent()->x != _posX || _path->GetCurrent()->y != _posY) break;
+ _path->GetNext();
}
// are there points to follow?
- if (m_Path->GetCurrent() != NULL) {
- m_State = STATE_FOLLOWING_PATH;;
- InitLine(CBPoint(m_PosX, m_PosY), *m_Path->GetCurrent());
+ if (_path->GetCurrent() != NULL) {
+ _state = STATE_FOLLOWING_PATH;;
+ InitLine(CBPoint(_posX, _posY), *_path->GetCurrent());
} else {
- if (m_AfterWalkDir != DI_NONE) TurnTo(m_AfterWalkDir);
- else m_State = STATE_READY;
+ if (_afterWalkDir != DI_NONE) TurnTo(_afterWalkDir);
+ else _state = STATE_READY;
}
}
//////////////////////////////////////////////////////////////////////////
void CAdActor::GetNextStep() {
- if (m_WalkSprite) {
- m_CurrentSprite = m_WalkSprite->GetSprite(m_Dir);
+ if (_walkSprite) {
+ _currentSprite = _walkSprite->GetSprite(_dir);
} else {
- CAdSpriteSet *Anim = GetAnimByName(m_WalkAnimName);
- if (Anim) m_CurrentSprite = Anim->GetSprite(m_Dir);
+ CAdSpriteSet *Anim = GetAnimByName(_walkAnimName);
+ if (Anim) _currentSprite = Anim->GetSprite(_dir);
}
- if (!m_CurrentSprite) return;
+ if (!_currentSprite) return;
- m_CurrentSprite->GetCurrentFrame(m_Zoomable ? ((CAdGame *)Game)->m_Scene->GetZoomAt(m_PosX, m_PosY) : 100, m_Zoomable ? ((CAdGame *)Game)->m_Scene->GetZoomAt(m_PosX, m_PosY) : 100);
- if (!m_CurrentSprite->m_Changed) return;
+ _currentSprite->GetCurrentFrame(_zoomable ? ((CAdGame *)Game)->_scene->GetZoomAt(_posX, _posY) : 100, _zoomable ? ((CAdGame *)Game)->_scene->GetZoomAt(_posX, _posY) : 100);
+ if (!_currentSprite->_changed) return;
int MaxStepX, MaxStepY;
- MaxStepX = abs(m_CurrentSprite->m_MoveX);
- MaxStepY = abs(m_CurrentSprite->m_MoveY);
+ MaxStepX = abs(_currentSprite->_moveX);
+ MaxStepY = abs(_currentSprite->_moveY);
MaxStepX = std::max(MaxStepX, MaxStepY);
MaxStepX = std::max(MaxStepX, 1);
- while (m_PFCount > 0 && MaxStepX >= 0) {
- m_PFX += m_PFStepX;
- m_PFY += m_PFStepY;
+ while (_pFCount > 0 && MaxStepX >= 0) {
+ _pFX += _pFStepX;
+ _pFY += _pFStepY;
- m_PFCount--;
+ _pFCount--;
MaxStepX--;
}
- if (((CAdGame *)Game)->m_Scene->IsBlockedAt(m_PFX, m_PFY, true, this)) {
- if (m_PFCount == 0) {
- m_State = m_NextState;
- m_NextState = STATE_READY;
+ if (((CAdGame *)Game)->_scene->IsBlockedAt(_pFX, _pFY, true, this)) {
+ if (_pFCount == 0) {
+ _state = _nextState;
+ _nextState = STATE_READY;
return;
}
- GoTo(m_TargetPoint->x, m_TargetPoint->y);
+ GoTo(_targetPoint->x, _targetPoint->y);
return;
}
- m_PosX = (int)m_PFX;
- m_PosY = (int)m_PFY;
+ _posX = (int)_pFX;
+ _posY = (int)_pFY;
AfterMove();
- if (m_PFCount == 0) {
- if (m_Path->GetNext() == NULL) {
- m_PosX = m_TargetPoint->x;
- m_PosY = m_TargetPoint->y;
+ if (_pFCount == 0) {
+ if (_path->GetNext() == NULL) {
+ _posX = _targetPoint->x;
+ _posY = _targetPoint->y;
- m_Path->Reset();
- if (m_AfterWalkDir != DI_NONE) TurnTo(m_AfterWalkDir);
+ _path->Reset();
+ if (_afterWalkDir != DI_NONE) TurnTo(_afterWalkDir);
else {
- m_State = m_NextState;
- m_NextState = STATE_READY;
+ _state = _nextState;
+ _nextState = STATE_READY;
}
- } else InitLine(CBPoint(m_PosX, m_PosY), *m_Path->GetCurrent());
+ } else InitLine(CBPoint(_posX, _posY), *_path->GetCurrent());
}
}
//////////////////////////////////////////////////////////////////////////
void CAdActor::InitLine(CBPoint StartPt, CBPoint EndPt) {
- m_PFCount = std::max((abs(EndPt.x - StartPt.x)) , (abs(EndPt.y - StartPt.y)));
+ _pFCount = std::max((abs(EndPt.x - StartPt.x)) , (abs(EndPt.y - StartPt.y)));
- m_PFStepX = (double)(EndPt.x - StartPt.x) / m_PFCount;
- m_PFStepY = (double)(EndPt.y - StartPt.y) / m_PFCount;
+ _pFStepX = (double)(EndPt.x - StartPt.x) / _pFCount;
+ _pFStepY = (double)(EndPt.y - StartPt.y) / _pFCount;
- m_PFX = StartPt.x;
- m_PFY = StartPt.y;
+ _pFX = StartPt.x;
+ _pFY = StartPt.y;
int angle = (int)(atan2((double)(EndPt.y - StartPt.y), (double)(EndPt.x - StartPt.x)) * (180 / 3.14));
- m_NextState = STATE_FOLLOWING_PATH;
+ _nextState = STATE_FOLLOWING_PATH;
TurnTo(AngleToDirection(angle));
}
@@ -896,14 +896,14 @@ HRESULT CAdActor::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
return S_OK;
}
CAdObject *Obj = (CAdObject *)Val->GetNative();
- if (!Obj || Obj->m_Type != OBJECT_ENTITY) {
+ if (!Obj || Obj->_type != OBJECT_ENTITY) {
Script->RuntimeError("actor.%s method accepts an entity refrence only", Name);
Stack->PushNULL();
return S_OK;
}
CAdEntity *Ent = (CAdEntity *)Obj;
- if (Ent->m_WalkToX == 0 && Ent->m_WalkToY == 0) GoTo(Ent->m_PosX, Ent->m_PosY);
- else GoTo(Ent->m_WalkToX, Ent->m_WalkToY, Ent->m_WalkToDir);
+ if (Ent->_walkToX == 0 && Ent->_walkToY == 0) GoTo(Ent->_posX, Ent->_posY);
+ else GoTo(Ent->_walkToX, Ent->_walkToY, Ent->_walkToDir);
if (strcmp(Name, "GoToObjectAsync") != 0) Script->WaitForExclusive(this);
Stack->PushNULL();
return S_OK;
@@ -920,7 +920,7 @@ HRESULT CAdActor::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
// turn to object?
if (val->IsNative() && Game->ValidObject((CBObject *)val->GetNative())) {
CBObject *obj = (CBObject *)val->GetNative();
- int angle = (int)(atan2((double)(obj->m_PosY - m_PosY), (double)(obj->m_PosX - m_PosX)) * (180 / 3.14));
+ int angle = (int)(atan2((double)(obj->_posY - _posY), (double)(obj->_posX - _posX)) * (180 / 3.14));
dir = (int)AngleToDirection(angle);
}
// otherwise turn to direction
@@ -939,7 +939,7 @@ HRESULT CAdActor::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IsWalking") == 0) {
Stack->CorrectParams(0);
- Stack->PushBool(m_State == STATE_FOLLOWING_PATH);
+ Stack->PushBool(_state == STATE_FOLLOWING_PATH);
return S_OK;
}
@@ -960,16 +960,16 @@ HRESULT CAdActor::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
char *AnimName = Stack->Pop()->GetString();
bool Found = false;
- for (int i = 0; i < m_Anims.GetSize(); i++) {
- if (scumm_stricmp(m_Anims[i]->m_Name, AnimName) == 0) {
+ for (int i = 0; i < _anims.GetSize(); i++) {
+ if (scumm_stricmp(_anims[i]->_name, AnimName) == 0) {
// invalidate sprites in use
- if (m_Anims[i]->ContainsSprite(m_TempSprite2)) m_TempSprite2 = NULL;
- if (m_Anims[i]->ContainsSprite(m_CurrentSprite)) m_CurrentSprite = NULL;
- if (m_Anims[i]->ContainsSprite(m_AnimSprite2)) m_AnimSprite2 = NULL;
+ if (_anims[i]->ContainsSprite(_tempSprite2)) _tempSprite2 = NULL;
+ if (_anims[i]->ContainsSprite(_currentSprite)) _currentSprite = NULL;
+ if (_anims[i]->ContainsSprite(_animSprite2)) _animSprite2 = NULL;
- delete m_Anims[i];
- m_Anims[i] = NULL;
- m_Anims.RemoveAt(i);
+ delete _anims[i];
+ _anims[i] = NULL;
+ _anims.RemoveAt(i);
i--;
Found = true;
}
@@ -994,60 +994,60 @@ HRESULT CAdActor::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
CScValue *CAdActor::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Direction
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Direction") == 0) {
- m_ScValue->SetInt(m_Dir);
- return m_ScValue;
+ _scValue->SetInt(_dir);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("actor");
- return m_ScValue;
+ _scValue->SetString("actor");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TalkAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TalkAnimName") == 0) {
- m_ScValue->SetString(m_TalkAnimName);
- return m_ScValue;
+ _scValue->SetString(_talkAnimName);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// WalkAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WalkAnimName") == 0) {
- m_ScValue->SetString(m_WalkAnimName);
- return m_ScValue;
+ _scValue->SetString(_walkAnimName);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// IdleAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IdleAnimName") == 0) {
- m_ScValue->SetString(m_IdleAnimName);
- return m_ScValue;
+ _scValue->SetString(_idleAnimName);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TurnLeftAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TurnLeftAnimName") == 0) {
- m_ScValue->SetString(m_TurnLeftAnimName);
- return m_ScValue;
+ _scValue->SetString(_turnLeftAnimName);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TurnRightAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TurnRightAnimName") == 0) {
- m_ScValue->SetString(m_TurnRightAnimName);
- return m_ScValue;
+ _scValue->SetString(_turnRightAnimName);
+ return _scValue;
}
else return CAdTalkHolder::ScGetProperty(Name);
@@ -1061,7 +1061,7 @@ HRESULT CAdActor::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Direction") == 0) {
int dir = Value->GetInt();
- if (dir >= 0 && dir < NUM_DIRECTIONS) m_Dir = (TDirection)dir;
+ if (dir >= 0 && dir < NUM_DIRECTIONS) _dir = (TDirection)dir;
return S_OK;
}
@@ -1069,8 +1069,8 @@ HRESULT CAdActor::ScSetProperty(char *Name, CScValue *Value) {
// TalkAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TalkAnimName") == 0) {
- if (Value->IsNULL()) CBUtils::SetString(&m_TalkAnimName, "talk");
- else CBUtils::SetString(&m_TalkAnimName, Value->GetString());
+ if (Value->IsNULL()) CBUtils::SetString(&_talkAnimName, "talk");
+ else CBUtils::SetString(&_talkAnimName, Value->GetString());
return S_OK;
}
@@ -1078,8 +1078,8 @@ HRESULT CAdActor::ScSetProperty(char *Name, CScValue *Value) {
// WalkAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WalkAnimName") == 0) {
- if (Value->IsNULL()) CBUtils::SetString(&m_WalkAnimName, "walk");
- else CBUtils::SetString(&m_WalkAnimName, Value->GetString());
+ if (Value->IsNULL()) CBUtils::SetString(&_walkAnimName, "walk");
+ else CBUtils::SetString(&_walkAnimName, Value->GetString());
return S_OK;
}
@@ -1087,8 +1087,8 @@ HRESULT CAdActor::ScSetProperty(char *Name, CScValue *Value) {
// IdleAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IdleAnimName") == 0) {
- if (Value->IsNULL()) CBUtils::SetString(&m_IdleAnimName, "idle");
- else CBUtils::SetString(&m_IdleAnimName, Value->GetString());
+ if (Value->IsNULL()) CBUtils::SetString(&_idleAnimName, "idle");
+ else CBUtils::SetString(&_idleAnimName, Value->GetString());
return S_OK;
}
@@ -1096,8 +1096,8 @@ HRESULT CAdActor::ScSetProperty(char *Name, CScValue *Value) {
// TurnLeftAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TurnLeftAnimName") == 0) {
- if (Value->IsNULL()) CBUtils::SetString(&m_TurnLeftAnimName, "turnleft");
- else CBUtils::SetString(&m_TurnLeftAnimName, Value->GetString());
+ if (Value->IsNULL()) CBUtils::SetString(&_turnLeftAnimName, "turnleft");
+ else CBUtils::SetString(&_turnLeftAnimName, Value->GetString());
return S_OK;
}
@@ -1105,8 +1105,8 @@ HRESULT CAdActor::ScSetProperty(char *Name, CScValue *Value) {
// TurnRightAnimName
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TurnRightAnimName") == 0) {
- if (Value->IsNULL()) CBUtils::SetString(&m_TurnRightAnimName, "turnright");
- else CBUtils::SetString(&m_TurnRightAnimName, Value->GetString());
+ if (Value->IsNULL()) CBUtils::SetString(&_turnRightAnimName, "turnright");
+ else CBUtils::SetString(&_turnRightAnimName, Value->GetString());
return S_OK;
}
@@ -1123,22 +1123,22 @@ char *CAdActor::ScToString() {
//////////////////////////////////////////////////////////////////////////
CBSprite *CAdActor::GetTalkStance(char *Stance) {
// forced stance?
- if (m_ForcedTalkAnimName && !m_ForcedTalkAnimUsed) {
- m_ForcedTalkAnimUsed = true;
- delete m_AnimSprite;
- m_AnimSprite = new CBSprite(Game, this);
- if (m_AnimSprite) {
- HRESULT res = m_AnimSprite->LoadFile(m_ForcedTalkAnimName);
+ if (_forcedTalkAnimName && !_forcedTalkAnimUsed) {
+ _forcedTalkAnimUsed = true;
+ delete _animSprite;
+ _animSprite = new CBSprite(Game, this);
+ if (_animSprite) {
+ HRESULT res = _animSprite->LoadFile(_forcedTalkAnimName);
if (FAILED(res)) {
- Game->LOG(res, "CAdActor::GetTalkStance: error loading talk sprite (object:\"%s\" sprite:\"%s\")", m_Name, m_ForcedTalkAnimName);
- delete m_AnimSprite;
- m_AnimSprite = NULL;
- } else return m_AnimSprite;
+ Game->LOG(res, "CAdActor::GetTalkStance: error loading talk sprite (object:\"%s\" sprite:\"%s\")", _name, _forcedTalkAnimName);
+ delete _animSprite;
+ _animSprite = NULL;
+ } else return _animSprite;
}
}
// old way
- if (m_TalkSprites.GetSize() > 0 || m_TalkSpritesEx.GetSize() > 0)
+ if (_talkSprites.GetSize() > 0 || _talkSpritesEx.GetSize() > 0)
return GetTalkStanceOld(Stance);
// new way
@@ -1146,24 +1146,24 @@ CBSprite *CAdActor::GetTalkStance(char *Stance) {
// do we have an animation with this name?
CAdSpriteSet *Anim = GetAnimByName(Stance);
- if (Anim) Ret = Anim->GetSprite(m_Dir);
+ if (Anim) Ret = Anim->GetSprite(_dir);
// not - get a random talk
if (!Ret) {
CBArray<CAdSpriteSet *, CAdSpriteSet *> TalkAnims;
- for (int i = 0; i < m_Anims.GetSize(); i++) {
- if (scumm_stricmp(m_Anims[i]->m_Name, m_TalkAnimName) == 0)
- TalkAnims.Add(m_Anims[i]);
+ for (int i = 0; i < _anims.GetSize(); i++) {
+ if (scumm_stricmp(_anims[i]->_name, _talkAnimName) == 0)
+ TalkAnims.Add(_anims[i]);
}
if (TalkAnims.GetSize() > 0) {
int rnd = rand() % TalkAnims.GetSize();
- Ret = TalkAnims[rnd]->GetSprite(m_Dir);
+ Ret = TalkAnims[rnd]->GetSprite(_dir);
} else {
- if (m_StandSprite) Ret = m_StandSprite->GetSprite(m_Dir);
+ if (_standSprite) Ret = _standSprite->GetSprite(_dir);
else {
- Anim = GetAnimByName(m_IdleAnimName);
- if (Anim) Ret = Anim->GetSprite(m_Dir);
+ Anim = GetAnimByName(_idleAnimName);
+ if (Anim) Ret = Anim->GetSprite(_dir);
}
}
}
@@ -1176,17 +1176,17 @@ CBSprite *CAdActor::GetTalkStanceOld(char *Stance) {
if (Stance != NULL) {
// search special stances
- for (int i = 0; i < m_TalkSpritesEx.GetSize(); i++) {
- if (scumm_stricmp(m_TalkSpritesEx[i]->m_Name, Stance) == 0) {
- ret = m_TalkSpritesEx[i]->GetSprite(m_Dir);
+ for (int i = 0; i < _talkSpritesEx.GetSize(); i++) {
+ if (scumm_stricmp(_talkSpritesEx[i]->_name, Stance) == 0) {
+ ret = _talkSpritesEx[i]->GetSprite(_dir);
break;
}
}
if (ret == NULL) {
// search generic stances
- for (int i = 0; i < m_TalkSprites.GetSize(); i++) {
- if (scumm_stricmp(m_TalkSprites[i]->m_Name, Stance) == 0) {
- ret = m_TalkSprites[i]->GetSprite(m_Dir);
+ for (int i = 0; i < _talkSprites.GetSize(); i++) {
+ if (scumm_stricmp(_talkSprites[i]->_name, Stance) == 0) {
+ ret = _talkSprites[i]->GetSprite(_dir);
break;
}
}
@@ -1195,11 +1195,11 @@ CBSprite *CAdActor::GetTalkStanceOld(char *Stance) {
// not a valid stance? get a random one
if (ret == NULL) {
- if (m_TalkSprites.GetSize() < 1) ret = m_StandSprite->GetSprite(m_Dir);
+ if (_talkSprites.GetSize() < 1) ret = _standSprite->GetSprite(_dir);
else {
// TODO: remember last
- int rnd = rand() % m_TalkSprites.GetSize();
- ret = m_TalkSprites[rnd]->GetSprite(m_Dir);
+ int rnd = rand() % _talkSprites.GetSize();
+ ret = _talkSprites[rnd]->GetSprite(_dir);
}
}
@@ -1210,31 +1210,31 @@ CBSprite *CAdActor::GetTalkStanceOld(char *Stance) {
HRESULT CAdActor::Persist(CBPersistMgr *PersistMgr) {
CAdTalkHolder::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER_INT(m_Dir));
- PersistMgr->Transfer(TMEMBER(m_Path));
- PersistMgr->Transfer(TMEMBER(m_PFCount));
- PersistMgr->Transfer(TMEMBER(m_PFStepX));
- PersistMgr->Transfer(TMEMBER(m_PFStepY));
- PersistMgr->Transfer(TMEMBER(m_PFX));
- PersistMgr->Transfer(TMEMBER(m_PFY));
- PersistMgr->Transfer(TMEMBER(m_StandSprite));
- m_TalkSprites.Persist(PersistMgr);
- m_TalkSpritesEx.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER_INT(m_TargetDir));
- PersistMgr->Transfer(TMEMBER_INT(m_AfterWalkDir));
- PersistMgr->Transfer(TMEMBER(m_TargetPoint));
- PersistMgr->Transfer(TMEMBER(m_TurnLeftSprite));
- PersistMgr->Transfer(TMEMBER(m_TurnRightSprite));
- PersistMgr->Transfer(TMEMBER(m_WalkSprite));
-
- PersistMgr->Transfer(TMEMBER(m_AnimSprite2));
- PersistMgr->Transfer(TMEMBER(m_TalkAnimName));
- PersistMgr->Transfer(TMEMBER(m_IdleAnimName));
- PersistMgr->Transfer(TMEMBER(m_WalkAnimName));
- PersistMgr->Transfer(TMEMBER(m_TurnLeftAnimName));
- PersistMgr->Transfer(TMEMBER(m_TurnRightAnimName));
-
- m_Anims.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER_INT(_dir));
+ PersistMgr->Transfer(TMEMBER(_path));
+ PersistMgr->Transfer(TMEMBER(_pFCount));
+ PersistMgr->Transfer(TMEMBER(_pFStepX));
+ PersistMgr->Transfer(TMEMBER(_pFStepY));
+ PersistMgr->Transfer(TMEMBER(_pFX));
+ PersistMgr->Transfer(TMEMBER(_pFY));
+ PersistMgr->Transfer(TMEMBER(_standSprite));
+ _talkSprites.Persist(PersistMgr);
+ _talkSpritesEx.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER_INT(_targetDir));
+ PersistMgr->Transfer(TMEMBER_INT(_afterWalkDir));
+ PersistMgr->Transfer(TMEMBER(_targetPoint));
+ PersistMgr->Transfer(TMEMBER(_turnLeftSprite));
+ PersistMgr->Transfer(TMEMBER(_turnRightSprite));
+ PersistMgr->Transfer(TMEMBER(_walkSprite));
+
+ PersistMgr->Transfer(TMEMBER(_animSprite2));
+ PersistMgr->Transfer(TMEMBER(_talkAnimName));
+ PersistMgr->Transfer(TMEMBER(_idleAnimName));
+ PersistMgr->Transfer(TMEMBER(_walkAnimName));
+ PersistMgr->Transfer(TMEMBER(_turnLeftAnimName));
+ PersistMgr->Transfer(TMEMBER(_turnRightAnimName));
+
+ _anims.Persist(PersistMgr);
return S_OK;
}
@@ -1260,11 +1260,11 @@ TDirection CAdActor::AngleToDirection(int Angle) {
//////////////////////////////////////////////////////////////////////////
int CAdActor::GetHeight() {
// if no current sprite is set, set some
- if (m_CurrentSprite == NULL) {
- if (m_StandSprite) m_CurrentSprite = m_StandSprite->GetSprite(m_Dir);
+ if (_currentSprite == NULL) {
+ if (_standSprite) _currentSprite = _standSprite->GetSprite(_dir);
else {
- CAdSpriteSet *Anim = GetAnimByName(m_IdleAnimName);
- if (Anim) m_CurrentSprite = Anim->GetSprite(m_Dir);
+ CAdSpriteSet *Anim = GetAnimByName(_idleAnimName);
+ if (Anim) _currentSprite = Anim->GetSprite(_dir);
}
}
// and get height
@@ -1276,8 +1276,8 @@ int CAdActor::GetHeight() {
CAdSpriteSet *CAdActor::GetAnimByName(char *AnimName) {
if (!AnimName) return NULL;
- for (int i = 0; i < m_Anims.GetSize(); i++) {
- if (scumm_stricmp(m_Anims[i]->m_Name, AnimName) == 0) return m_Anims[i];
+ for (int i = 0; i < _anims.GetSize(); i++) {
+ if (scumm_stricmp(_anims[i]->_name, AnimName) == 0) return _anims[i];
}
return NULL;
}
@@ -1289,7 +1289,7 @@ HRESULT CAdActor::MergeAnims(char *AnimsFilename) {
TOKEN_TABLE_END
- byte *FileBuffer = Game->m_FileManager->ReadWholeFile(AnimsFilename);
+ byte *FileBuffer = Game->_fileManager->ReadWholeFile(AnimsFilename);
if (FileBuffer == NULL) {
Game->LOG(0, "CAdActor::MergeAnims failed for file '%s'", AnimsFilename);
return E_FAIL;
@@ -1309,7 +1309,7 @@ HRESULT CAdActor::MergeAnims(char *AnimsFilename) {
if (!Anim || FAILED(Anim->LoadBuffer(params, false))) {
cmd = PARSERR_GENERIC;
Ret = E_FAIL;
- } else m_Anims.Add(Anim);
+ } else _anims.Add(Anim);
}
break;
}
@@ -1323,10 +1323,10 @@ HRESULT CAdActor::PlayAnim(char *Filename) {
// if we have an anim with this name, use it
CAdSpriteSet *Anim = GetAnimByName(Filename);
if (Anim) {
- m_AnimSprite2 = Anim->GetSprite(m_Dir);
- if (m_AnimSprite2) {
- m_AnimSprite2->Reset();
- m_State = STATE_PLAYING_ANIM_SET;
+ _animSprite2 = Anim->GetSprite(_dir);
+ if (_animSprite2) {
+ _animSprite2->Reset();
+ _state = STATE_PLAYING_ANIM_SET;
return S_OK;
}
}
diff --git a/engines/wintermute/AdActor.h b/engines/wintermute/AdActor.h
index fa6f771a35..1e6b21884d 100644
--- a/engines/wintermute/AdActor.h
+++ b/engines/wintermute/AdActor.h
@@ -51,32 +51,32 @@ public:
virtual int GetHeight();
CBSprite *GetTalkStance(char *Stance);
virtual void GoTo(int X, int Y, TDirection AfterWalkDir = DI_NONE);
- CBPoint *m_TargetPoint;
+ CBPoint *_targetPoint;
virtual HRESULT Update();
virtual HRESULT Display();
- TDirection m_TargetDir;
- TDirection m_AfterWalkDir;
+ TDirection _targetDir;
+ TDirection _afterWalkDir;
virtual void TurnTo(TDirection dir);
- CAdPath *m_Path;
- CAdSpriteSet *m_WalkSprite;
- CAdSpriteSet *m_StandSprite;
- CAdSpriteSet *m_TurnLeftSprite;
- CAdSpriteSet *m_TurnRightSprite;
- CBArray<CAdSpriteSet *, CAdSpriteSet *> m_TalkSprites;
- CBArray<CAdSpriteSet *, CAdSpriteSet *> m_TalkSpritesEx;
- TDirection m_Dir;
+ CAdPath *_path;
+ CAdSpriteSet *_walkSprite;
+ CAdSpriteSet *_standSprite;
+ CAdSpriteSet *_turnLeftSprite;
+ CAdSpriteSet *_turnRightSprite;
+ CBArray<CAdSpriteSet *, CAdSpriteSet *> _talkSprites;
+ CBArray<CAdSpriteSet *, CAdSpriteSet *> _talkSpritesEx;
+ TDirection _dir;
CAdActor(CBGame *inGame/*=NULL*/);
virtual ~CAdActor();
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
// new anim system
- char *m_TalkAnimName;
- char *m_IdleAnimName;
- char *m_WalkAnimName;
- char *m_TurnLeftAnimName;
- char *m_TurnRightAnimName;
- CBArray<CAdSpriteSet *, CAdSpriteSet *> m_Anims;
+ char *_talkAnimName;
+ char *_idleAnimName;
+ char *_walkAnimName;
+ char *_turnLeftAnimName;
+ char *_turnRightAnimName;
+ CBArray<CAdSpriteSet *, CAdSpriteSet *> _anims;
virtual HRESULT PlayAnim(char *Filename);
CAdSpriteSet *GetAnimByName(char *AnimName);
@@ -90,16 +90,16 @@ private:
HRESULT SetDefaultAnimNames();
CBSprite *GetTalkStanceOld(char *Stance);
HRESULT MergeAnims(char *AnimsFilename);
- CBSprite *m_AnimSprite2;
+ CBSprite *_animSprite2;
void InitLine(CBPoint StartPt, CBPoint EndPt);
void GetNextStep();
void FollowPath();
- double m_PFStepX;
- double m_PFStepY;
- double m_PFX;
- double m_PFY;
- int m_PFCount;
+ double _pFStepX;
+ double _pFStepY;
+ double _pFX;
+ double _pFY;
+ int _pFCount;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/AdEntity.cpp b/engines/wintermute/AdEntity.cpp
index c0e07b958d..a67cc2109a 100644
--- a/engines/wintermute/AdEntity.cpp
+++ b/engines/wintermute/AdEntity.cpp
@@ -58,28 +58,28 @@ IMPLEMENT_PERSISTENT(CAdEntity, false)
//////////////////////////////////////////////////////////////////////////
CAdEntity::CAdEntity(CBGame *inGame): CAdTalkHolder(inGame) {
- m_Type = OBJECT_ENTITY;
- m_Subtype = ENTITY_NORMAL;
- m_Region = NULL;
- m_Item = NULL;
+ _type = OBJECT_ENTITY;
+ _subtype = ENTITY_NORMAL;
+ _region = NULL;
+ _item = NULL;
- m_WalkToX = m_WalkToY = 0;
- m_WalkToDir = DI_NONE;
+ _walkToX = _walkToY = 0;
+ _walkToDir = DI_NONE;
}
//////////////////////////////////////////////////////////////////////////
CAdEntity::~CAdEntity() {
- Game->UnregisterObject(m_Region);
+ Game->UnregisterObject(_region);
- delete[] m_Item;
- m_Item = NULL;
+ delete[] _item;
+ _item = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdEntity::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdEntity::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -87,8 +87,8 @@ HRESULT CAdEntity::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -212,32 +212,32 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_X:
- parser.ScanStr((char *)params, "%d", &m_PosX);
+ parser.ScanStr((char *)params, "%d", &_posX);
break;
case TOKEN_Y:
- parser.ScanStr((char *)params, "%d", &m_PosY);
+ parser.ScanStr((char *)params, "%d", &_posY);
break;
case TOKEN_SPRITE: {
- SAFE_DELETE(m_Sprite);
+ SAFE_DELETE(_sprite);
spr = new CBSprite(Game, this);
if (!spr || FAILED(spr->LoadFile((char *)params))) cmd = PARSERR_GENERIC;
- else m_Sprite = spr;
+ else _sprite = spr;
}
break;
case TOKEN_TALK: {
spr = new CBSprite(Game, this);
- if (!spr || FAILED(spr->LoadFile((char *)params, AdGame->m_TexTalkLifeTime))) cmd = PARSERR_GENERIC;
- else m_TalkSprites.Add(spr);
+ 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->m_TexTalkLifeTime))) cmd = PARSERR_GENERIC;
- else m_TalkSpritesEx.Add(spr);
+ if (!spr || FAILED(spr->LoadFile((char *)params, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
+ else _talkSpritesEx.Add(spr);
}
break;
@@ -258,13 +258,13 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_SCALABLE:
- parser.ScanStr((char *)params, "%b", &m_Zoomable);
+ parser.ScanStr((char *)params, "%b", &_zoomable);
break;
case TOKEN_SCALE: {
int s;
parser.ScanStr((char *)params, "%d", &s);
- m_Scale = (float)s;
+ _scale = (float)s;
}
break;
@@ -272,85 +272,85 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_RELATIVE_SCALE: {
int s;
parser.ScanStr((char *)params, "%d", &s);
- m_RelativeScale = (float)s;
+ _relativeScale = (float)s;
}
break;
case TOKEN_ROTABLE:
case TOKEN_ROTATABLE:
- parser.ScanStr((char *)params, "%b", &m_Rotatable);
+ parser.ScanStr((char *)params, "%b", &_rotatable);
break;
case TOKEN_REGISTRABLE:
case TOKEN_INTERACTIVE:
- parser.ScanStr((char *)params, "%b", &m_Registrable);
+ parser.ScanStr((char *)params, "%b", &_registrable);
break;
case TOKEN_SHADOWABLE:
case TOKEN_COLORABLE:
- parser.ScanStr((char *)params, "%b", &m_Shadowable);
+ parser.ScanStr((char *)params, "%b", &_shadowable);
break;
case TOKEN_ACTIVE:
- parser.ScanStr((char *)params, "%b", &m_Active);
+ parser.ScanStr((char *)params, "%b", &_active);
break;
case TOKEN_CURSOR:
- SAFE_DELETE(m_Cursor);
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- SAFE_DELETE(m_Cursor);
+ SAFE_DELETE(_cursor);
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ SAFE_DELETE(_cursor);
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_EDITOR_SELECTED:
- parser.ScanStr((char *)params, "%b", &m_EditorSelected);
+ parser.ScanStr((char *)params, "%b", &_editorSelected);
break;
case TOKEN_REGION: {
- if (m_Region) Game->UnregisterObject(m_Region);
- m_Region = NULL;
+ if (_region) Game->UnregisterObject(_region);
+ _region = NULL;
CBRegion *rgn = new CBRegion(Game);
if (!rgn || FAILED(rgn->LoadBuffer(params, false))) cmd = PARSERR_GENERIC;
else {
- m_Region = rgn;
- Game->RegisterObject(m_Region);
+ _region = rgn;
+ Game->RegisterObject(_region);
}
}
break;
case TOKEN_BLOCKED_REGION: {
- SAFE_DELETE(m_BlockRegion);
- SAFE_DELETE(m_CurrentBlockRegion);
+ SAFE_DELETE(_blockRegion);
+ SAFE_DELETE(_currentBlockRegion);
CBRegion *rgn = new CBRegion(Game);
CBRegion *crgn = new CBRegion(Game);
if (!rgn || !crgn || FAILED(rgn->LoadBuffer(params, false))) {
- SAFE_DELETE(m_BlockRegion);
- SAFE_DELETE(m_CurrentBlockRegion);
+ SAFE_DELETE(_blockRegion);
+ SAFE_DELETE(_currentBlockRegion);
cmd = PARSERR_GENERIC;
} else {
- m_BlockRegion = rgn;
- m_CurrentBlockRegion = crgn;
- m_CurrentBlockRegion->Mimic(m_BlockRegion);
+ _blockRegion = rgn;
+ _currentBlockRegion = crgn;
+ _currentBlockRegion->Mimic(_blockRegion);
}
}
break;
case TOKEN_WAYPOINTS: {
- SAFE_DELETE(m_WptGroup);
- SAFE_DELETE(m_CurrentWptGroup);
+ SAFE_DELETE(_wptGroup);
+ SAFE_DELETE(_currentWptGroup);
CAdWaypointGroup *wpt = new CAdWaypointGroup(Game);
CAdWaypointGroup *cwpt = new CAdWaypointGroup(Game);
if (!wpt || !cwpt || FAILED(wpt->LoadBuffer(params, false))) {
- SAFE_DELETE(m_WptGroup);
- SAFE_DELETE(m_CurrentWptGroup);
+ SAFE_DELETE(_wptGroup);
+ SAFE_DELETE(_currentWptGroup);
cmd = PARSERR_GENERIC;
} else {
- m_WptGroup = wpt;
- m_CurrentWptGroup = cwpt;
- m_CurrentWptGroup->Mimic(m_WptGroup);
+ _wptGroup = wpt;
+ _currentWptGroup = cwpt;
+ _currentWptGroup->Mimic(_wptGroup);
}
}
break;
@@ -361,18 +361,18 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_SUBTYPE: {
if (scumm_stricmp((char *)params, "sound") == 0) {
- SAFE_DELETE(m_Sprite);
- if (Game->m_EditorMode) {
+ SAFE_DELETE(_sprite);
+ if (Game->_editorMode) {
spr = new CBSprite(Game, this);
if (!spr || FAILED(spr->LoadFile("entity_sound.sprite"))) cmd = PARSERR_GENERIC;
- else m_Sprite = spr;
+ else _sprite = spr;
}
- if (Game->m_EditorMode) m_EditorOnly = true;
- m_Zoomable = false;
- m_Rotatable = false;
- m_Registrable = Game->m_EditorMode;
- m_Shadowable = false;
- m_Subtype = ENTITY_SOUND;
+ if (Game->_editorMode) _editorOnly = true;
+ _zoomable = false;
+ _rotatable = false;
+ _registrable = Game->_editorMode;
+ _shadowable = false;
+ _subtype = ENTITY_SOUND;
}
}
break;
@@ -382,19 +382,19 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_SOUND_START_TIME:
- parser.ScanStr((char *)params, "%d", &m_SFXStart);
+ parser.ScanStr((char *)params, "%d", &_sFXStart);
break;
case TOKEN_SOUND_VOLUME:
- parser.ScanStr((char *)params, "%d", &m_SFXVolume);
+ parser.ScanStr((char *)params, "%d", &_sFXVolume);
break;
case TOKEN_SOUND_PANNING:
- parser.ScanStr((char *)params, "%b", &m_AutoSoundPanning);
+ parser.ScanStr((char *)params, "%b", &_autoSoundPanning);
break;
case TOKEN_SAVE_STATE:
- parser.ScanStr((char *)params, "%b", &m_SaveState);
+ parser.ScanStr((char *)params, "%b", &_saveState);
break;
case TOKEN_PROPERTY:
@@ -402,7 +402,7 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_IGNORE_ITEMS:
- parser.ScanStr((char *)params, "%b", &m_IgnoreItems);
+ parser.ScanStr((char *)params, "%b", &_ignoreItems);
break;
case TOKEN_ALPHA_COLOR:
@@ -418,11 +418,11 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_WALK_TO_X:
- parser.ScanStr((char *)params, "%d", &m_WalkToX);
+ parser.ScanStr((char *)params, "%d", &_walkToX);
break;
case TOKEN_WALK_TO_Y:
- parser.ScanStr((char *)params, "%d", &m_WalkToY);
+ parser.ScanStr((char *)params, "%d", &_walkToY);
break;
case TOKEN_WALK_TO_DIR: {
@@ -430,7 +430,7 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
parser.ScanStr((char *)params, "%d", &i);
if (i < 0) i = 0;
if (i >= NUM_DIRECTIONS) i = DI_NONE;
- m_WalkToDir = (TDirection)i;
+ _walkToDir = (TDirection)i;
}
break;
}
@@ -445,8 +445,8 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
return E_FAIL;
}
- if (m_Region && m_Sprite) {
- Game->LOG(0, "Warning: Entity '%s' has both sprite and region.", m_Name);
+ if (_region && _sprite) {
+ Game->LOG(0, "Warning: Entity '%s' has both sprite and region.", _name);
}
UpdatePosition();
@@ -454,10 +454,10 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
if (alpha != 0 && ar == 0 && ag == 0 && ab == 0) {
ar = ag = ab = 255;
}
- m_AlphaColor = DRGBA(ar, ag, ab, alpha);
- m_State = STATE_READY;
+ _alphaColor = DRGBA(ar, ag, ab, alpha);
+ _state = STATE_READY;
- if (m_Item && ((CAdGame *)Game)->IsItemTaken(m_Item)) m_Active = false;
+ if (_item && ((CAdGame *)Game)->IsItemTaken(_item)) _active = false;
return S_OK;
}
@@ -465,44 +465,44 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdEntity::Display() {
- if (m_Active) {
+ if (_active) {
UpdateSounds();
uint32 Alpha;
- if (m_AlphaColor != 0) Alpha = m_AlphaColor;
- else Alpha = m_Shadowable ? ((CAdGame *)Game)->m_Scene->GetAlphaAt(m_PosX, m_PosY) : 0xFFFFFFFF;
+ if (_alphaColor != 0) Alpha = _alphaColor;
+ else Alpha = _shadowable ? ((CAdGame *)Game)->_scene->GetAlphaAt(_posX, _posY) : 0xFFFFFFFF;
float ScaleX, ScaleY;
GetScale(&ScaleX, &ScaleY);
float Rotate;
- if (m_Rotatable) {
- if (m_RotateValid) Rotate = m_Rotate;
- else Rotate = ((CAdGame *)Game)->m_Scene->GetRotationAt(m_PosX, m_PosY) + m_RelativeRotate;
+ if (_rotatable) {
+ if (_rotateValid) Rotate = _rotate;
+ else Rotate = ((CAdGame *)Game)->_scene->GetRotationAt(_posX, _posY) + _relativeRotate;
} else Rotate = 0.0f;
- bool Reg = m_Registrable;
- if (m_IgnoreItems && ((CAdGame *)Game)->m_SelectedItem) Reg = false;
+ bool Reg = _registrable;
+ if (_ignoreItems && ((CAdGame *)Game)->_selectedItem) Reg = false;
- if (m_Region && (Reg || m_EditorAlwaysRegister)) {
- Game->m_Renderer->m_RectList.Add(new CBActiveRect(Game, m_RegisterAlias, m_Region, Game->m_OffsetX, Game->m_OffsetY));
+ if (_region && (Reg || _editorAlwaysRegister)) {
+ Game->_renderer->_rectList.Add(new CBActiveRect(Game, _registerAlias, _region, Game->_offsetX, Game->_offsetY));
}
DisplaySpriteAttachments(true);
- if (m_CurrentSprite) {
- m_CurrentSprite->Display(m_PosX,
- m_PosY,
- (Reg || m_EditorAlwaysRegister) ? m_RegisterAlias : NULL,
+ if (_currentSprite) {
+ _currentSprite->Display(_posX,
+ _posY,
+ (Reg || _editorAlwaysRegister) ? _registerAlias : NULL,
ScaleX,
ScaleY,
Alpha,
Rotate,
- m_BlendMode);
+ _blendMode);
}
DisplaySpriteAttachments(false);
- if (m_PartEmitter) m_PartEmitter->Display(m_Region);
+ if (_partEmitter) _partEmitter->Display(_region);
}
return S_OK;
@@ -511,73 +511,73 @@ HRESULT CAdEntity::Display() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdEntity::Update() {
- m_CurrentSprite = NULL;
+ _currentSprite = NULL;
- if (m_State == STATE_READY && m_AnimSprite) {
- SAFE_DELETE(m_AnimSprite);
+ if (_state == STATE_READY && _animSprite) {
+ SAFE_DELETE(_animSprite);
}
// finished playing animation?
- if (m_State == STATE_PLAYING_ANIM && m_AnimSprite != NULL && m_AnimSprite->m_Finished) {
- m_State = STATE_READY;
- m_CurrentSprite = m_AnimSprite;
+ if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) {
+ _state = STATE_READY;
+ _currentSprite = _animSprite;
}
- if (m_Sentence && m_State != STATE_TALKING) m_Sentence->Finish();
+ if (_sentence && _state != STATE_TALKING) _sentence->Finish();
// default: stand animation
- if (!m_CurrentSprite) m_CurrentSprite = m_Sprite;
+ if (!_currentSprite) _currentSprite = _sprite;
- switch (m_State) {
+ switch (_state) {
//////////////////////////////////////////////////////////////////////////
case STATE_PLAYING_ANIM:
- m_CurrentSprite = m_AnimSprite;
+ _currentSprite = _animSprite;
break;
//////////////////////////////////////////////////////////////////////////
case STATE_READY:
- if (!m_AnimSprite)
- m_CurrentSprite = m_Sprite;
+ if (!_animSprite)
+ _currentSprite = _sprite;
break;
//////////////////////////////////////////////////////////////////////////
case STATE_TALKING: {
- m_Sentence->Update();
- if (m_Sentence->m_CurrentSprite) m_TempSprite2 = m_Sentence->m_CurrentSprite;
+ _sentence->Update();
+ if (_sentence->_currentSprite) _tempSprite2 = _sentence->_currentSprite;
- bool TimeIsUp = (m_Sentence->m_Sound && m_Sentence->m_SoundStarted && (!m_Sentence->m_Sound->IsPlaying() && !m_Sentence->m_Sound->IsPaused())) || (!m_Sentence->m_Sound && m_Sentence->m_Duration <= Game->m_Timer - m_Sentence->m_StartTime);
- if (m_TempSprite2 == NULL || m_TempSprite2->m_Finished || (/*m_TempSprite2->m_Looping &&*/ TimeIsUp)) {
+ 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) {
- m_Sentence->Finish();
- m_TempSprite2 = NULL;
- m_State = STATE_READY;
+ _sentence->Finish();
+ _tempSprite2 = NULL;
+ _state = STATE_READY;
} else {
- m_TempSprite2 = GetTalkStance(m_Sentence->GetNextStance());
- if (m_TempSprite2) {
- m_TempSprite2->Reset();
- m_CurrentSprite = m_TempSprite2;
+ _tempSprite2 = GetTalkStance(_sentence->GetNextStance());
+ if (_tempSprite2) {
+ _tempSprite2->Reset();
+ _currentSprite = _tempSprite2;
}
- ((CAdGame *)Game)->AddSentence(m_Sentence);
+ ((CAdGame *)Game)->AddSentence(_sentence);
}
} else {
- m_CurrentSprite = m_TempSprite2;
- ((CAdGame *)Game)->AddSentence(m_Sentence);
+ _currentSprite = _tempSprite2;
+ ((CAdGame *)Game)->AddSentence(_sentence);
}
}
break;
}
- if (m_CurrentSprite) {
- m_CurrentSprite->GetCurrentFrame(m_Zoomable ? ((CAdGame *)Game)->m_Scene->GetZoomAt(m_PosX, m_PosY) : 100);
- if (m_CurrentSprite->m_Changed) {
- m_PosX += m_CurrentSprite->m_MoveX;
- m_PosY += m_CurrentSprite->m_MoveY;
+ if (_currentSprite) {
+ _currentSprite->GetCurrentFrame(_zoomable ? ((CAdGame *)Game)->_scene->GetZoomAt(_posX, _posY) : 100);
+ if (_currentSprite->_changed) {
+ _posX += _currentSprite->_moveX;
+ _posY += _currentSprite->_moveY;
}
}
UpdateBlockRegion();
- m_Ready = (m_State == STATE_READY);
+ _ready = (_state == STATE_READY);
UpdatePartEmitter();
@@ -594,7 +594,7 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
// StopSound
//////////////////////////////////////////////////////////////////////////
- if (strcmp(Name, "StopSound") == 0 && m_Subtype == ENTITY_SOUND) {
+ if (strcmp(Name, "StopSound") == 0 && _subtype == ENTITY_SOUND) {
Stack->CorrectParams(0);
if (FAILED(StopSFX(false))) Stack->PushBool(false);
@@ -668,11 +668,11 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CreateRegion") == 0) {
Stack->CorrectParams(0);
- if (!m_Region) {
- m_Region = new CBRegion(Game);
- Game->RegisterObject(m_Region);
+ if (!_region) {
+ _region = new CBRegion(Game);
+ Game->RegisterObject(_region);
}
- if (m_Region) Stack->PushNative(m_Region, true);
+ if (_region) Stack->PushNative(_region, true);
else Stack->PushNULL();
return S_OK;
@@ -683,9 +683,9 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DeleteRegion") == 0) {
Stack->CorrectParams(0);
- if (m_Region) {
- Game->UnregisterObject(m_Region);
- m_Region = NULL;
+ if (_region) {
+ Game->UnregisterObject(_region);
+ _region = NULL;
Stack->PushBool(true);
} else Stack->PushBool(false);
@@ -698,69 +698,69 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
CScValue *CAdEntity::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("entity");
- return m_ScValue;
+ _scValue->SetString("entity");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Item
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Item") == 0) {
- if (m_Item) m_ScValue->SetString(m_Item);
- else m_ScValue->SetNULL();
+ if (_item) _scValue->SetString(_item);
+ else _scValue->SetNULL();
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Subtype (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Subtype") == 0) {
- if (m_Subtype == ENTITY_SOUND)
- m_ScValue->SetString("sound");
+ if (_subtype == ENTITY_SOUND)
+ _scValue->SetString("sound");
else
- m_ScValue->SetString("normal");
+ _scValue->SetString("normal");
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// WalkToX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WalkToX") == 0) {
- m_ScValue->SetInt(m_WalkToX);
- return m_ScValue;
+ _scValue->SetInt(_walkToX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// WalkToY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WalkToY") == 0) {
- m_ScValue->SetInt(m_WalkToY);
- return m_ScValue;
+ _scValue->SetInt(_walkToY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// WalkToDirection
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WalkToDirection") == 0) {
- m_ScValue->SetInt((int)m_WalkToDir);
- return m_ScValue;
+ _scValue->SetInt((int)_walkToDir);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Region (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Region") == 0) {
- if (m_Region) m_ScValue->SetNative(m_Region, true);
- else m_ScValue->SetNULL();
- return m_ScValue;
+ if (_region) _scValue->SetNative(_region, true);
+ else _scValue->SetNULL();
+ return _scValue;
}
else return CAdTalkHolder::ScGetProperty(Name);
@@ -782,7 +782,7 @@ HRESULT CAdEntity::ScSetProperty(char *Name, CScValue *Value) {
// WalkToX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WalkToX") == 0) {
- m_WalkToX = Value->GetInt();
+ _walkToX = Value->GetInt();
return S_OK;
}
@@ -790,7 +790,7 @@ HRESULT CAdEntity::ScSetProperty(char *Name, CScValue *Value) {
// WalkToY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WalkToY") == 0) {
- m_WalkToY = Value->GetInt();
+ _walkToY = Value->GetInt();
return S_OK;
}
@@ -799,7 +799,7 @@ HRESULT CAdEntity::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WalkToDirection") == 0) {
int Dir = Value->GetInt();
- if (Dir >= 0 && Dir < NUM_DIRECTIONS) m_WalkToDir = (TDirection)Dir;
+ if (Dir >= 0 && Dir < NUM_DIRECTIONS) _walkToDir = (TDirection)Dir;
return S_OK;
}
@@ -817,74 +817,74 @@ char *CAdEntity::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdEntity::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "ENTITY {\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
- if (m_Subtype == ENTITY_SOUND)
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
+ if (_subtype == ENTITY_SOUND)
Buffer->PutTextIndent(Indent + 2, "SUBTYPE=\"SOUND\"\n");
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
- Buffer->PutTextIndent(Indent + 2, "ACTIVE=%s\n", m_Active ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "X=%d\n", m_PosX);
- Buffer->PutTextIndent(Indent + 2, "Y=%d\n", m_PosY);
- Buffer->PutTextIndent(Indent + 2, "SCALABLE=%s\n", m_Zoomable ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "INTERACTIVE=%s\n", m_Registrable ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "COLORABLE=%s\n", m_Shadowable ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", m_EditorSelected ? "TRUE" : "FALSE");
- if (m_IgnoreItems)
- Buffer->PutTextIndent(Indent + 2, "IGNORE_ITEMS=%s\n", m_IgnoreItems ? "TRUE" : "FALSE");
- if (m_Rotatable)
- Buffer->PutTextIndent(Indent + 2, "ROTATABLE=%s\n", m_Rotatable ? "TRUE" : "FALSE");
-
- if (!m_AutoSoundPanning)
- Buffer->PutTextIndent(Indent + 2, "SOUND_PANNING=%s\n", m_AutoSoundPanning ? "TRUE" : "FALSE");
-
- if (!m_SaveState)
- Buffer->PutTextIndent(Indent + 2, "SAVE_STATE=%s\n", m_SaveState ? "TRUE" : "FALSE");
-
- if (m_Item && m_Item[0] != '\0') Buffer->PutTextIndent(Indent + 2, "ITEM=\"%s\"\n", m_Item);
-
- Buffer->PutTextIndent(Indent + 2, "WALK_TO_X=%d\n", m_WalkToX);
- Buffer->PutTextIndent(Indent + 2, "WALK_TO_Y=%d\n", m_WalkToY);
- if (m_WalkToDir != DI_NONE)
- Buffer->PutTextIndent(Indent + 2, "WALK_TO_DIR=%d\n", (int)m_WalkToDir);
+ Buffer->PutTextIndent(Indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "X=%d\n", _posX);
+ Buffer->PutTextIndent(Indent + 2, "Y=%d\n", _posY);
+ Buffer->PutTextIndent(Indent + 2, "SCALABLE=%s\n", _zoomable ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "INTERACTIVE=%s\n", _registrable ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "COLORABLE=%s\n", _shadowable ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
+ if (_ignoreItems)
+ Buffer->PutTextIndent(Indent + 2, "IGNORE_ITEMS=%s\n", _ignoreItems ? "TRUE" : "FALSE");
+ if (_rotatable)
+ Buffer->PutTextIndent(Indent + 2, "ROTATABLE=%s\n", _rotatable ? "TRUE" : "FALSE");
+
+ if (!_autoSoundPanning)
+ Buffer->PutTextIndent(Indent + 2, "SOUND_PANNING=%s\n", _autoSoundPanning ? "TRUE" : "FALSE");
+
+ if (!_saveState)
+ Buffer->PutTextIndent(Indent + 2, "SAVE_STATE=%s\n", _saveState ? "TRUE" : "FALSE");
+
+ if (_item && _item[0] != '\0') Buffer->PutTextIndent(Indent + 2, "ITEM=\"%s\"\n", _item);
+
+ Buffer->PutTextIndent(Indent + 2, "WALK_TO_X=%d\n", _walkToX);
+ Buffer->PutTextIndent(Indent + 2, "WALK_TO_Y=%d\n", _walkToY);
+ if (_walkToDir != DI_NONE)
+ Buffer->PutTextIndent(Indent + 2, "WALK_TO_DIR=%d\n", (int)_walkToDir);
int i;
- for (i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- if (m_Subtype == ENTITY_NORMAL && m_Sprite && m_Sprite->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "SPRITE=\"%s\"\n", m_Sprite->m_Filename);
+ if (_subtype == ENTITY_NORMAL && _sprite && _sprite->_filename)
+ Buffer->PutTextIndent(Indent + 2, "SPRITE=\"%s\"\n", _sprite->_filename);
- if (m_Subtype == ENTITY_SOUND && m_SFX && m_SFX->m_SoundFilename) {
- Buffer->PutTextIndent(Indent + 2, "SOUND=\"%s\"\n", m_SFX->m_SoundFilename);
- Buffer->PutTextIndent(Indent + 2, "SOUND_START_TIME=%d\n", m_SFXStart);
- Buffer->PutTextIndent(Indent + 2, "SOUND_VOLUME=%d\n", m_SFXVolume);
+ if (_subtype == ENTITY_SOUND && _sFX && _sFX->_soundFilename) {
+ Buffer->PutTextIndent(Indent + 2, "SOUND=\"%s\"\n", _sFX->_soundFilename);
+ Buffer->PutTextIndent(Indent + 2, "SOUND_START_TIME=%d\n", _sFXStart);
+ Buffer->PutTextIndent(Indent + 2, "SOUND_VOLUME=%d\n", _sFXVolume);
}
- if (D3DCOLGetR(m_AlphaColor) != 0 || D3DCOLGetG(m_AlphaColor) != 0 || D3DCOLGetB(m_AlphaColor) != 0)
- Buffer->PutTextIndent(Indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(m_AlphaColor), D3DCOLGetG(m_AlphaColor), D3DCOLGetB(m_AlphaColor));
+ if (D3DCOLGetR(_alphaColor) != 0 || D3DCOLGetG(_alphaColor) != 0 || D3DCOLGetB(_alphaColor) != 0)
+ Buffer->PutTextIndent(Indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(_alphaColor), D3DCOLGetG(_alphaColor), D3DCOLGetB(_alphaColor));
- if (D3DCOLGetA(m_AlphaColor) != 0)
- Buffer->PutTextIndent(Indent + 2, "ALPHA = %d\n", D3DCOLGetA(m_AlphaColor));
+ if (D3DCOLGetA(_alphaColor) != 0)
+ Buffer->PutTextIndent(Indent + 2, "ALPHA = %d\n", D3DCOLGetA(_alphaColor));
- if (m_Scale >= 0)
- Buffer->PutTextIndent(Indent + 2, "SCALE = %d\n", (int)m_Scale);
+ if (_scale >= 0)
+ Buffer->PutTextIndent(Indent + 2, "SCALE = %d\n", (int)_scale);
- if (m_RelativeScale != 0)
- Buffer->PutTextIndent(Indent + 2, "RELATIVE_SCALE = %d\n", (int)m_RelativeScale);
+ if (_relativeScale != 0)
+ Buffer->PutTextIndent(Indent + 2, "RELATIVE_SCALE = %d\n", (int)_relativeScale);
- if (m_Font && m_Font->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", m_Font->m_Filename);
+ if (_font && _font->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
- if (m_Cursor && m_Cursor->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", m_Cursor->m_Filename);
+ if (_cursor && _cursor->_filename)
+ Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
CAdTalkHolder::SaveAsText(Buffer, Indent + 2);
- if (m_Region) m_Region->SaveAsText(Buffer, Indent + 2);
+ if (_region) _region->SaveAsText(Buffer, Indent + 2);
- if (m_ScProp) m_ScProp->SaveAsText(Buffer, Indent + 2);
+ if (_scProp) _scProp->SaveAsText(Buffer, Indent + 2);
CAdObject::SaveAsText(Buffer, Indent + 2);
@@ -896,10 +896,10 @@ HRESULT CAdEntity::SaveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
int CAdEntity::GetHeight() {
- if (m_Region && !m_Sprite) {
- return m_Region->m_Rect.bottom - m_Region->m_Rect.top;
+ if (_region && !_sprite) {
+ return _region->_rect.bottom - _region->_rect.top;
} else {
- if (m_CurrentSprite == NULL) m_CurrentSprite = m_Sprite;
+ if (_currentSprite == NULL) _currentSprite = _sprite;
return CAdObject::GetHeight();
}
}
@@ -907,9 +907,9 @@ int CAdEntity::GetHeight() {
//////////////////////////////////////////////////////////////////////////
void CAdEntity::UpdatePosition() {
- if (m_Region && !m_Sprite) {
- m_PosX = m_Region->m_Rect.left + (m_Region->m_Rect.right - m_Region->m_Rect.left) / 2;
- m_PosY = m_Region->m_Rect.bottom;
+ if (_region && !_sprite) {
+ _posX = _region->_rect.left + (_region->_rect.right - _region->_rect.left) / 2;
+ _posY = _region->_rect.bottom;
}
}
@@ -918,16 +918,16 @@ void CAdEntity::UpdatePosition() {
HRESULT CAdEntity::Persist(CBPersistMgr *PersistMgr) {
CAdTalkHolder::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Item));
- PersistMgr->Transfer(TMEMBER(m_Region));
- //PersistMgr->Transfer(TMEMBER(m_Sprite));
- PersistMgr->Transfer(TMEMBER_INT(m_Subtype));
- m_TalkSprites.Persist(PersistMgr);
- m_TalkSpritesEx.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_item));
+ PersistMgr->Transfer(TMEMBER(_region));
+ //PersistMgr->Transfer(TMEMBER(_sprite));
+ PersistMgr->Transfer(TMEMBER_INT(_subtype));
+ _talkSprites.Persist(PersistMgr);
+ _talkSpritesEx.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_WalkToX));
- PersistMgr->Transfer(TMEMBER(m_WalkToY));
- PersistMgr->Transfer(TMEMBER_INT(m_WalkToDir));
+ PersistMgr->Transfer(TMEMBER(_walkToX));
+ PersistMgr->Transfer(TMEMBER(_walkToY));
+ PersistMgr->Transfer(TMEMBER_INT(_walkToDir));
return S_OK;
}
@@ -935,25 +935,25 @@ HRESULT CAdEntity::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
void CAdEntity::SetItem(char *ItemName) {
- CBUtils::SetString(&m_Item, ItemName);
+ CBUtils::SetString(&_item, ItemName);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdEntity::SetSprite(char *Filename) {
bool SetCurrent = false;
- if (m_CurrentSprite == m_Sprite) {
- m_CurrentSprite = NULL;
+ if (_currentSprite == _sprite) {
+ _currentSprite = NULL;
SetCurrent = true;
}
- SAFE_DELETE(m_Sprite);
+ SAFE_DELETE(_sprite);
CBSprite *spr = new CBSprite(Game, this);
if (!spr || FAILED(spr->LoadFile(Filename))) {
- SAFE_DELETE(m_Sprite);
+ SAFE_DELETE(_sprite);
return E_FAIL;
} else {
- m_Sprite = spr;
- m_CurrentSprite = m_Sprite;
+ _sprite = spr;
+ _currentSprite = _sprite;
return S_OK;
}
}
diff --git a/engines/wintermute/AdEntity.h b/engines/wintermute/AdEntity.h
index b85cc123c6..1677d3e097 100644
--- a/engines/wintermute/AdEntity.h
+++ b/engines/wintermute/AdEntity.h
@@ -36,15 +36,15 @@ namespace WinterMute {
class CAdEntity : public CAdTalkHolder {
public:
HRESULT SetSprite(char *Filename);
- int m_WalkToX;
- int m_WalkToY;
- TDirection m_WalkToDir;
+ int _walkToX;
+ int _walkToY;
+ TDirection _walkToDir;
void SetItem(char *ItemName);
- char *m_Item;
+ char *_item;
DECLARE_PERSISTENT(CAdEntity, CAdTalkHolder)
void UpdatePosition();
virtual int GetHeight();
- CBRegion *m_Region;
+ CBRegion *_region;
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
virtual HRESULT Update();
virtual HRESULT Display();
@@ -52,7 +52,7 @@ public:
virtual ~CAdEntity();
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
- TEntityType m_Subtype;
+ TEntityType _subtype;
// scripting interface
virtual CScValue *ScGetProperty(char *Name);
diff --git a/engines/wintermute/AdGame.cpp b/engines/wintermute/AdGame.cpp
index cfcfd20085..e736ddc0e0 100644
--- a/engines/wintermute/AdGame.cpp
+++ b/engines/wintermute/AdGame.cpp
@@ -65,44 +65,44 @@ IMPLEMENT_PERSISTENT(CAdGame, true)
//////////////////////////////////////////////////////////////////////////
CAdGame::CAdGame(): CBGame() {
- m_ResponseBox = NULL;
- m_InventoryBox = NULL;
+ _responseBox = NULL;
+ _inventoryBox = NULL;
- m_Scene = new CAdScene(Game);
- m_Scene->SetName("");
- RegisterObject(m_Scene);
+ _scene = new CAdScene(Game);
+ _scene->SetName("");
+ RegisterObject(_scene);
- m_PrevSceneName = NULL;
- m_PrevSceneFilename = NULL;
- m_ScheduledScene = NULL;
- m_ScheduledFadeIn = false;
+ _prevSceneName = NULL;
+ _prevSceneFilename = NULL;
+ _scheduledScene = NULL;
+ _scheduledFadeIn = false;
- m_StateEx = GAME_NORMAL;
+ _stateEx = GAME_NORMAL;
- m_SelectedItem = NULL;
+ _selectedItem = NULL;
- m_TexItemLifeTime = 10000;
- m_TexWalkLifeTime = 10000;
- m_TexStandLifeTime = 10000;
- m_TexTalkLifeTime = 10000;
+ _texItemLifeTime = 10000;
+ _texWalkLifeTime = 10000;
+ _texStandLifeTime = 10000;
+ _texTalkLifeTime = 10000;
- m_TalkSkipButton = TALK_SKIP_LEFT;
+ _talkSkipButton = TALK_SKIP_LEFT;
- m_SceneViewport = NULL;
+ _sceneViewport = NULL;
- m_InitialScene = true;
- m_DebugStartupScene = NULL;
- m_StartupScene = NULL;
+ _initialScene = true;
+ _debugStartupScene = NULL;
+ _startupScene = NULL;
- m_InvObject = new CAdObject(this);
- m_InventoryOwner = m_InvObject;
+ _invObject = new CAdObject(this);
+ _inventoryOwner = _invObject;
- m_TempDisableSaveState = false;
- m_ItemsFile = NULL;
+ _tempDisableSaveState = false;
+ _itemsFile = NULL;
- m_SmartItemCursor = false;
+ _smartItemCursor = false;
AddSpeechDir("speech");
}
@@ -118,75 +118,75 @@ CAdGame::~CAdGame() {
HRESULT CAdGame::Cleanup() {
int i;
- for (i = 0; i < m_Objects.GetSize(); i++) {
- UnregisterObject(m_Objects[i]);
- m_Objects[i] = NULL;
+ for (i = 0; i < _objects.GetSize(); i++) {
+ UnregisterObject(_objects[i]);
+ _objects[i] = NULL;
}
- m_Objects.RemoveAll();
+ _objects.RemoveAll();
- for (i = 0; i < m_DlgPendingBranches.GetSize(); i++) {
- delete [] m_DlgPendingBranches[i];
+ for (i = 0; i < _dlgPendingBranches.GetSize(); i++) {
+ delete [] _dlgPendingBranches[i];
}
- m_DlgPendingBranches.RemoveAll();
+ _dlgPendingBranches.RemoveAll();
- for (i = 0; i < m_SpeechDirs.GetSize(); i++) {
- delete [] m_SpeechDirs[i];
+ for (i = 0; i < _speechDirs.GetSize(); i++) {
+ delete [] _speechDirs[i];
}
- m_SpeechDirs.RemoveAll();
+ _speechDirs.RemoveAll();
- UnregisterObject(m_Scene);
- m_Scene = NULL;
+ UnregisterObject(_scene);
+ _scene = NULL;
// remove items
- for (i = 0; i < m_Items.GetSize(); i++) Game->UnregisterObject(m_Items[i]);
- m_Items.RemoveAll();
+ for (i = 0; i < _items.GetSize(); i++) Game->UnregisterObject(_items[i]);
+ _items.RemoveAll();
// clear remaining inventories
- delete m_InvObject;
- m_InvObject = NULL;
+ delete _invObject;
+ _invObject = NULL;
- for (i = 0; i < m_Inventories.GetSize(); i++) {
- delete m_Inventories[i];
+ for (i = 0; i < _inventories.GetSize(); i++) {
+ delete _inventories[i];
}
- m_Inventories.RemoveAll();
+ _inventories.RemoveAll();
- if (m_ResponseBox) {
- Game->UnregisterObject(m_ResponseBox);
- m_ResponseBox = NULL;
+ if (_responseBox) {
+ Game->UnregisterObject(_responseBox);
+ _responseBox = NULL;
}
- if (m_InventoryBox) {
- Game->UnregisterObject(m_InventoryBox);
- m_InventoryBox = NULL;
+ if (_inventoryBox) {
+ Game->UnregisterObject(_inventoryBox);
+ _inventoryBox = NULL;
}
- delete[] m_PrevSceneName;
- delete[] m_PrevSceneFilename;
- delete[] m_ScheduledScene;
- delete[] m_DebugStartupScene;
- delete[] m_ItemsFile;
- m_PrevSceneName = NULL;
- m_PrevSceneFilename = NULL;
- m_ScheduledScene = NULL;
- m_DebugStartupScene = NULL;
- m_StartupScene = NULL;
- m_ItemsFile = NULL;
+ delete[] _prevSceneName;
+ delete[] _prevSceneFilename;
+ delete[] _scheduledScene;
+ delete[] _debugStartupScene;
+ delete[] _itemsFile;
+ _prevSceneName = NULL;
+ _prevSceneFilename = NULL;
+ _scheduledScene = NULL;
+ _debugStartupScene = NULL;
+ _startupScene = NULL;
+ _itemsFile = NULL;
- delete m_SceneViewport;
- m_SceneViewport = NULL;
+ delete _sceneViewport;
+ _sceneViewport = NULL;
- for (i = 0; i < m_SceneStates.GetSize(); i++) delete m_SceneStates[i];
- m_SceneStates.RemoveAll();
+ for (i = 0; i < _sceneStates.GetSize(); i++) delete _sceneStates[i];
+ _sceneStates.RemoveAll();
- for (i = 0; i < m_ResponsesBranch.GetSize(); i++) delete m_ResponsesBranch[i];
- m_ResponsesBranch.RemoveAll();
+ for (i = 0; i < _responsesBranch.GetSize(); i++) delete _responsesBranch[i];
+ _responsesBranch.RemoveAll();
- for (i = 0; i < m_ResponsesGame.GetSize(); i++) delete m_ResponsesGame[i];
- m_ResponsesGame.RemoveAll();
+ for (i = 0; i < _responsesGame.GetSize(); i++) delete _responsesGame[i];
+ _responsesGame.RemoveAll();
return CBGame::Cleanup();
}
@@ -194,11 +194,11 @@ HRESULT CAdGame::Cleanup() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::InitLoop() {
- if (m_ScheduledScene && m_TransMgr->IsReady()) {
- ChangeScene(m_ScheduledScene, m_ScheduledFadeIn);
- SAFE_DELETE_ARRAY(m_ScheduledScene);
+ if (_scheduledScene && _transMgr->IsReady()) {
+ ChangeScene(_scheduledScene, _scheduledFadeIn);
+ SAFE_DELETE_ARRAY(_scheduledScene);
- Game->m_ActiveObject = NULL;
+ Game->_activeObject = NULL;
}
@@ -206,9 +206,9 @@ HRESULT CAdGame::InitLoop() {
res = CBGame::InitLoop();
if (FAILED(res)) return res;
- if (m_Scene) res = m_Scene->InitLoop();
+ if (_scene) res = _scene->InitLoop();
- m_Sentences.RemoveAll();
+ _sentences.RemoveAll();
return res;
}
@@ -216,7 +216,7 @@ HRESULT CAdGame::InitLoop() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::AddObject(CAdObject *Object) {
- m_Objects.Add(Object);
+ _objects.Add(Object);
return RegisterObject(Object);
}
@@ -224,14 +224,14 @@ HRESULT CAdGame::AddObject(CAdObject *Object) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::RemoveObject(CAdObject *Object) {
// in case the user called Scene.CreateXXX() and Game.DeleteXXX()
- if (m_Scene) {
- HRESULT Res = m_Scene->RemoveObject(Object);
+ if (_scene) {
+ HRESULT Res = _scene->RemoveObject(Object);
if (SUCCEEDED(Res)) return Res;
}
- for (int i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i] == Object) {
- m_Objects.RemoveAt(i);
+ for (int i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i] == Object) {
+ _objects.RemoveAt(i);
break;
}
}
@@ -241,43 +241,43 @@ HRESULT CAdGame::RemoveObject(CAdObject *Object) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::ChangeScene(char *Filename, bool FadeIn) {
- if (m_Scene == NULL) {
- m_Scene = new CAdScene(Game);
- RegisterObject(m_Scene);
+ if (_scene == NULL) {
+ _scene = new CAdScene(Game);
+ RegisterObject(_scene);
} else {
- m_Scene->ApplyEvent("SceneShutdown", true);
+ _scene->ApplyEvent("SceneShutdown", true);
- SetPrevSceneName(m_Scene->m_Name);
- SetPrevSceneFilename(m_Scene->m_Filename);
+ SetPrevSceneName(_scene->_name);
+ SetPrevSceneFilename(_scene->_filename);
- if (!m_TempDisableSaveState) m_Scene->SaveState();
- m_TempDisableSaveState = false;
+ if (!_tempDisableSaveState) _scene->SaveState();
+ _tempDisableSaveState = false;
}
- if (m_Scene) {
+ if (_scene) {
// reset objects
- for (int i = 0; i < m_Objects.GetSize(); i++) m_Objects[i]->Reset();
+ for (int i = 0; i < _objects.GetSize(); i++) _objects[i]->Reset();
// reset scene properties
- m_Scene->m_SFXVolume = 100;
- if (m_Scene->m_ScProp) m_Scene->m_ScProp->Cleanup();
+ _scene->_sFXVolume = 100;
+ if (_scene->_scProp) _scene->_scProp->Cleanup();
HRESULT ret;
- if (m_InitialScene && m_DEBUG_DebugMode && m_DebugStartupScene) {
- m_InitialScene = false;
- ret = m_Scene->LoadFile(m_DebugStartupScene);
- } else ret = m_Scene->LoadFile(Filename);
+ if (_initialScene && _dEBUG_DebugMode && _debugStartupScene) {
+ _initialScene = false;
+ ret = _scene->LoadFile(_debugStartupScene);
+ } else ret = _scene->LoadFile(Filename);
if (SUCCEEDED(ret)) {
// invalidate references to the original scene
- for (int i = 0; i < m_Objects.GetSize(); i++) {
- m_Objects[i]->InvalidateCurrRegions();
- m_Objects[i]->m_StickRegion = NULL;
+ for (int i = 0; i < _objects.GetSize(); i++) {
+ _objects[i]->InvalidateCurrRegions();
+ _objects[i]->_stickRegion = NULL;
}
- m_Scene->LoadState();
+ _scene->LoadState();
}
- if (FadeIn) Game->m_TransMgr->Start(TRANSITION_FADE_IN);
+ if (FadeIn) Game->_transMgr->Start(TRANSITION_FADE_IN);
return ret;
} else return E_FAIL;
}
@@ -285,15 +285,15 @@ HRESULT CAdGame::ChangeScene(char *Filename, bool FadeIn) {
//////////////////////////////////////////////////////////////////////////
void CAdGame::AddSentence(CAdSentence *Sentence) {
- m_Sentences.Add(Sentence);
+ _sentences.Add(Sentence);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::DisplaySentences(bool Frozen) {
- for (int i = 0; i < m_Sentences.GetSize(); i++) {
- if (Frozen && m_Sentences[i]->m_Freezable) continue;
- else m_Sentences[i]->Display();
+ for (int i = 0; i < _sentences.GetSize(); i++) {
+ if (Frozen && _sentences[i]->_freezable) continue;
+ else _sentences[i]->Display();
}
return S_OK;
}
@@ -301,10 +301,10 @@ HRESULT CAdGame::DisplaySentences(bool Frozen) {
//////////////////////////////////////////////////////////////////////////
void CAdGame::FinishSentences() {
- for (int i = 0; i < m_Sentences.GetSize(); i++) {
- if (m_Sentences[i]->CanSkip()) {
- m_Sentences[i]->m_Duration = 0;
- if (m_Sentences[i]->m_Sound) m_Sentences[i]->m_Sound->Stop();
+ for (int i = 0; i < _sentences.GetSize(); i++) {
+ if (_sentences[i]->CanSkip()) {
+ _sentences[i]->_duration = 0;
+ if (_sentences[i]->_sound) _sentences[i]->_sound->Stop();
}
}
}
@@ -327,7 +327,7 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
bool TransIn = valFadeIn->IsNULL() ? true : valFadeIn->GetBool();
ScheduleChangeScene(Filename, TransIn);
- if (TransOut) m_TransMgr->Start(TRANSITION_FADE_OUT, true);
+ if (TransOut) _transMgr->Start(TRANSITION_FADE_OUT, true);
Stack->PushNULL();
@@ -443,7 +443,7 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
CAdItem *Item = NULL;
if (Val->IsInt()) {
int Index = Val->GetInt();
- if (Index >= 0 && Index < m_Items.GetSize()) Item = m_Items[Index];
+ if (Index >= 0 && Index < _items.GetSize()) Item = _items[Index];
} else {
Item = GetItemByName(Val->GetString());
}
@@ -467,21 +467,21 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
CScValue *val3 = Stack->Pop();
CScValue *val4 = Stack->Pop();
- if (m_ResponseBox) {
+ if (_responseBox) {
CAdResponse *res = new CAdResponse(Game);
if (res) {
- res->m_ID = id;
+ res->_iD = id;
res->SetText(text);
- m_StringTable->Expand(&res->m_Text);
+ _stringTable->Expand(&res->_text);
if (!val1->IsNULL()) res->SetIcon(val1->GetString());
if (!val2->IsNULL()) res->SetIconHover(val2->GetString());
if (!val3->IsNULL()) res->SetIconPressed(val3->GetString());
if (!val4->IsNULL()) res->SetFont(val4->GetString());
- if (strcmp(Name, "AddResponseOnce") == 0) res->m_ResponseType = RESPONSE_ONCE;
- else if (strcmp(Name, "AddResponseOnceGame") == 0) res->m_ResponseType = RESPONSE_ONCE_GAME;
+ if (strcmp(Name, "AddResponseOnce") == 0) res->_responseType = RESPONSE_ONCE;
+ else if (strcmp(Name, "AddResponseOnceGame") == 0) res->_responseType = RESPONSE_ONCE_GAME;
- m_ResponseBox->m_Responses.Add(res);
+ _responseBox->_responses.Add(res);
}
} else {
Script->RuntimeError("Game.AddResponse: response box is not defined");
@@ -507,8 +507,8 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ClearResponses") == 0) {
Stack->CorrectParams(0);
- m_ResponseBox->ClearResponses();
- m_ResponseBox->ClearButtons();
+ _responseBox->ClearResponses();
+ _responseBox->ClearButtons();
Stack->PushNULL();
return S_OK;
}
@@ -520,27 +520,27 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
bool AutoSelectLast = Stack->Pop()->GetBool();
- if (m_ResponseBox) {
- m_ResponseBox->WeedResponses();
+ if (_responseBox) {
+ _responseBox->WeedResponses();
- if (m_ResponseBox->m_Responses.GetSize() == 0) {
+ if (_responseBox->_responses.GetSize() == 0) {
Stack->PushNULL();
return S_OK;
}
- if (m_ResponseBox->m_Responses.GetSize() == 1 && AutoSelectLast) {
- Stack->PushInt(m_ResponseBox->m_Responses[0]->m_ID);
- m_ResponseBox->HandleResponse(m_ResponseBox->m_Responses[0]);
- m_ResponseBox->ClearResponses();
+ if (_responseBox->_responses.GetSize() == 1 && AutoSelectLast) {
+ Stack->PushInt(_responseBox->_responses[0]->_iD);
+ _responseBox->HandleResponse(_responseBox->_responses[0]);
+ _responseBox->ClearResponses();
return S_OK;
}
- m_ResponseBox->CreateButtons();
- m_ResponseBox->m_WaitingScript = Script;
- Script->WaitForExclusive(m_ResponseBox);
- m_State = GAME_SEMI_FROZEN;
- m_StateEx = GAME_WAITING_RESPONSE;
+ _responseBox->CreateButtons();
+ _responseBox->_waitingScript = Script;
+ Script->WaitForExclusive(_responseBox);
+ _state = GAME_SEMI_FROZEN;
+ _stateEx = GAME_WAITING_RESPONSE;
} else {
Script->RuntimeError("Game.GetResponse: response box is not defined");
Stack->PushNULL();
@@ -554,9 +554,9 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetNumResponses") == 0) {
Stack->CorrectParams(0);
- if (m_ResponseBox) {
- m_ResponseBox->WeedResponses();
- Stack->PushInt(m_ResponseBox->m_Responses.GetSize());
+ if (_responseBox) {
+ _responseBox->WeedResponses();
+ Stack->PushInt(_responseBox->_responses.GetSize());
} else {
Script->RuntimeError("Game.GetNumResponses: response box is not defined");
Stack->PushNULL();
@@ -575,11 +575,11 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
bool DeleteName = false;
if (Val->IsNULL()) {
BranchName = new char[20];
- sprintf(BranchName, "line%d", Script->m_CurrentLine);
+ sprintf(BranchName, "line%d", Script->_currentLine);
DeleteName = true;
} else BranchName = Val->GetString();
- StartDlgBranch(BranchName, Script->m_Filename == NULL ? "" : Script->m_Filename, Script->m_ThreadEvent == NULL ? "" : Script->m_ThreadEvent);
+ StartDlgBranch(BranchName, Script->_filename == NULL ? "" : Script->_filename, Script->_threadEvent == NULL ? "" : Script->_threadEvent);
Stack->PushNULL();
if (DeleteName) delete[] BranchName;
@@ -595,7 +595,7 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
char *BranchName = NULL;
CScValue *Val = Stack->Pop();
if (!Val->IsNULL()) BranchName = Val->GetString();
- EndDlgBranch(BranchName, Script->m_Filename == NULL ? "" : Script->m_Filename, Script->m_ThreadEvent == NULL ? "" : Script->m_ThreadEvent);
+ EndDlgBranch(BranchName, Script->_filename == NULL ? "" : Script->_filename, Script->_threadEvent == NULL ? "" : Script->_threadEvent);
Stack->PushNULL();
@@ -608,8 +608,8 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "GetCurrentDlgBranch") == 0) {
Stack->CorrectParams(0);
- if (m_DlgPendingBranches.GetSize() > 0) {
- Stack->PushString(m_DlgPendingBranches[m_DlgPendingBranches.GetSize() - 1]);
+ if (_dlgPendingBranches.GetSize() > 0) {
+ Stack->PushString(_dlgPendingBranches[_dlgPendingBranches.GetSize() - 1]);
} else Stack->PushNULL();
return S_OK;
@@ -619,28 +619,28 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
// TakeItem
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TakeItem") == 0) {
- return m_InvObject->ScCallMethod(Script, Stack, ThisStack, Name);
+ return _invObject->ScCallMethod(Script, Stack, ThisStack, Name);
}
//////////////////////////////////////////////////////////////////////////
// DropItem
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DropItem") == 0) {
- return m_InvObject->ScCallMethod(Script, Stack, ThisStack, Name);
+ return _invObject->ScCallMethod(Script, Stack, ThisStack, Name);
}
//////////////////////////////////////////////////////////////////////////
// GetItem
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetItem") == 0) {
- return m_InvObject->ScCallMethod(Script, Stack, ThisStack, Name);
+ return _invObject->ScCallMethod(Script, Stack, ThisStack, Name);
}
//////////////////////////////////////////////////////////////////////////
// HasItem
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "HasItem") == 0) {
- return m_InvObject->ScCallMethod(Script, Stack, ThisStack, Name);
+ return _invObject->ScCallMethod(Script, Stack, ThisStack, Name);
}
//////////////////////////////////////////////////////////////////////////
@@ -651,14 +651,14 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
CScValue *val = Stack->Pop();
if (!val->IsNULL()) {
- for (int i = 0; i < m_Inventories.GetSize(); i++) {
- CAdInventory *Inv = m_Inventories[i];
+ for (int i = 0; i < _inventories.GetSize(); i++) {
+ CAdInventory *Inv = _inventories[i];
- for (int j = 0; j < Inv->m_TakenItems.GetSize(); j++) {
- if (val->GetNative() == Inv->m_TakenItems[j]) {
+ for (int j = 0; j < Inv->_takenItems.GetSize(); j++) {
+ if (val->GetNative() == Inv->_takenItems[j]) {
Stack->PushBool(true);
return S_OK;
- } else if (scumm_stricmp(val->GetString(), Inv->m_TakenItems[j]->m_Name) == 0) {
+ } else if (scumm_stricmp(val->GetString(), Inv->_takenItems[j]->_name) == 0) {
Stack->PushBool(true);
return S_OK;
}
@@ -675,8 +675,8 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetInventoryWindow") == 0) {
Stack->CorrectParams(0);
- if (m_InventoryBox && m_InventoryBox->m_Window)
- Stack->PushNative(m_InventoryBox->m_Window, true);
+ if (_inventoryBox && _inventoryBox->_window)
+ Stack->PushNative(_inventoryBox->_window, true);
else
Stack->PushNULL();
@@ -688,8 +688,8 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetResponsesWindow") == 0 || strcmp(Name, "GetResponseWindow") == 0) {
Stack->CorrectParams(0);
- if (m_ResponseBox && m_ResponseBox->m_Window)
- Stack->PushNative(m_ResponseBox->m_Window, true);
+ if (_responseBox && _responseBox->_window)
+ Stack->PushNative(_responseBox->_window, true);
else
Stack->PushNULL();
@@ -703,13 +703,13 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
char *Filename = Stack->Pop()->GetString();
- Game->UnregisterObject(m_ResponseBox);
- m_ResponseBox = new CAdResponseBox(Game);
- if (m_ResponseBox && !FAILED(m_ResponseBox->LoadFile(Filename))) {
- RegisterObject(m_ResponseBox);
+ Game->UnregisterObject(_responseBox);
+ _responseBox = new CAdResponseBox(Game);
+ if (_responseBox && !FAILED(_responseBox->LoadFile(Filename))) {
+ RegisterObject(_responseBox);
Stack->PushBool(true);
} else {
- SAFE_DELETE(m_ResponseBox);
+ SAFE_DELETE(_responseBox);
Stack->PushBool(false);
}
return S_OK;
@@ -722,14 +722,14 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
char *Filename = Stack->Pop()->GetString();
- Game->UnregisterObject(m_InventoryBox);
- m_InventoryBox = new CAdInventoryBox(Game);
- if (m_InventoryBox && !FAILED(m_InventoryBox->LoadFile(Filename))) {
- RegisterObject(m_InventoryBox);
+ Game->UnregisterObject(_inventoryBox);
+ _inventoryBox = new CAdInventoryBox(Game);
+ if (_inventoryBox && !FAILED(_inventoryBox->LoadFile(Filename))) {
+ RegisterObject(_inventoryBox);
Stack->PushBool(true);
} else {
- delete m_InventoryBox;
- m_InventoryBox = NULL;
+ delete _inventoryBox;
+ _inventoryBox = NULL;
Stack->PushBool(false);
}
return S_OK;
@@ -781,11 +781,11 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
int Width = Stack->Pop()->GetInt();
int Height = Stack->Pop()->GetInt();
- if (Width <= 0) Width = m_Renderer->m_Width;
- if (Height <= 0) Height = m_Renderer->m_Height;
+ if (Width <= 0) Width = _renderer->_width;
+ if (Height <= 0) Height = _renderer->_height;
- if (!m_SceneViewport) m_SceneViewport = new CBViewport(Game);
- if (m_SceneViewport) m_SceneViewport->SetRect(X, Y, X + Width, Y + Height);
+ if (!_sceneViewport) _sceneViewport = new CBViewport(Game);
+ if (_sceneViewport) _sceneViewport->SetRect(X, Y, X + Width, Y + Height);
Stack->PushBool(true);
@@ -799,152 +799,152 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
CScValue *CAdGame::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("game");
- return m_ScValue;
+ _scValue->SetString("game");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Scene
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scene") == 0) {
- if (m_Scene) m_ScValue->SetNative(m_Scene, true);
- else m_ScValue->SetNULL();
+ if (_scene) _scValue->SetNative(_scene, true);
+ else _scValue->SetNULL();
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SelectedItem
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SelectedItem") == 0) {
- //if(m_SelectedItem) m_ScValue->SetString(m_SelectedItem->m_Name);
- if (m_SelectedItem) m_ScValue->SetNative(m_SelectedItem, true);
- else m_ScValue->SetNULL();
+ //if(_selectedItem) _scValue->SetString(_selectedItem->_name);
+ if (_selectedItem) _scValue->SetNative(_selectedItem, true);
+ else _scValue->SetNULL();
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumItems
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumItems") == 0) {
- return m_InvObject->ScGetProperty(Name);
+ return _invObject->ScGetProperty(Name);
}
//////////////////////////////////////////////////////////////////////////
// SmartItemCursor
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SmartItemCursor") == 0) {
- m_ScValue->SetBool(m_SmartItemCursor);
- return m_ScValue;
+ _scValue->SetBool(_smartItemCursor);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// InventoryVisible
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "InventoryVisible") == 0) {
- m_ScValue->SetBool(m_InventoryBox && m_InventoryBox->m_Visible);
- return m_ScValue;
+ _scValue->SetBool(_inventoryBox && _inventoryBox->_visible);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// InventoryScrollOffset
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "InventoryScrollOffset") == 0) {
- if (m_InventoryBox) m_ScValue->SetInt(m_InventoryBox->m_ScrollOffset);
- else m_ScValue->SetInt(0);
+ if (_inventoryBox) _scValue->SetInt(_inventoryBox->_scrollOffset);
+ else _scValue->SetInt(0);
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ResponsesVisible (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ResponsesVisible") == 0) {
- m_ScValue->SetBool(m_StateEx == GAME_WAITING_RESPONSE);
- return m_ScValue;
+ _scValue->SetBool(_stateEx == GAME_WAITING_RESPONSE);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PrevScene / PreviousScene (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PrevScene") == 0 || strcmp(Name, "PreviousScene") == 0) {
- if (!m_PrevSceneName) m_ScValue->SetString("");
- else m_ScValue->SetString(m_PrevSceneName);
- return m_ScValue;
+ if (!_prevSceneName) _scValue->SetString("");
+ else _scValue->SetString(_prevSceneName);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PrevSceneFilename / PreviousSceneFilename (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PrevSceneFilename") == 0 || strcmp(Name, "PreviousSceneFilename") == 0) {
- if (!m_PrevSceneFilename) m_ScValue->SetString("");
- else m_ScValue->SetString(m_PrevSceneFilename);
- return m_ScValue;
+ if (!_prevSceneFilename) _scValue->SetString("");
+ else _scValue->SetString(_prevSceneFilename);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LastResponse (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LastResponse") == 0) {
- if (!m_ResponseBox || !m_ResponseBox->m_LastResponseText) m_ScValue->SetString("");
- else m_ScValue->SetString(m_ResponseBox->m_LastResponseText);
- return m_ScValue;
+ if (!_responseBox || !_responseBox->_lastResponseText) _scValue->SetString("");
+ else _scValue->SetString(_responseBox->_lastResponseText);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LastResponseOrig (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LastResponseOrig") == 0) {
- if (!m_ResponseBox || !m_ResponseBox->m_LastResponseTextOrig) m_ScValue->SetString("");
- else m_ScValue->SetString(m_ResponseBox->m_LastResponseTextOrig);
- return m_ScValue;
+ if (!_responseBox || !_responseBox->_lastResponseTextOrig) _scValue->SetString("");
+ else _scValue->SetString(_responseBox->_lastResponseTextOrig);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// InventoryObject
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "InventoryObject") == 0) {
- if (m_InventoryOwner == m_InvObject) m_ScValue->SetNative(this, true);
- else m_ScValue->SetNative(m_InventoryOwner, true);
+ if (_inventoryOwner == _invObject) _scValue->SetNative(this, true);
+ else _scValue->SetNative(_inventoryOwner, true);
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TotalNumItems
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TotalNumItems") == 0) {
- m_ScValue->SetInt(m_Items.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_items.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TalkSkipButton
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TalkSkipButton") == 0) {
- m_ScValue->SetInt(m_TalkSkipButton);
- return m_ScValue;
+ _scValue->SetInt(_talkSkipButton);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ChangingScene
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ChangingScene") == 0) {
- m_ScValue->SetBool(m_ScheduledScene != NULL);
- return m_ScValue;
+ _scValue->SetBool(_scheduledScene != NULL);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// StartupScene
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "StartupScene") == 0) {
- if (!m_StartupScene) m_ScValue->SetNULL();
- else m_ScValue->SetString(m_StartupScene);
- return m_ScValue;
+ if (!_startupScene) _scValue->SetNULL();
+ else _scValue->SetString(_startupScene);
+ return _scValue;
}
else return CBGame::ScGetProperty(Name);
@@ -958,19 +958,19 @@ HRESULT CAdGame::ScSetProperty(char *Name, CScValue *Value) {
// SelectedItem
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "SelectedItem") == 0) {
- if (Value->IsNULL()) m_SelectedItem = NULL;
+ if (Value->IsNULL()) _selectedItem = NULL;
else {
if (Value->IsNative()) {
- m_SelectedItem = NULL;
- for (int i = 0; i < m_Items.GetSize(); i++) {
- if (m_Items[i] == Value->GetNative()) {
- m_SelectedItem = (CAdItem *)Value->GetNative();
+ _selectedItem = NULL;
+ for (int i = 0; i < _items.GetSize(); i++) {
+ if (_items[i] == Value->GetNative()) {
+ _selectedItem = (CAdItem *)Value->GetNative();
break;
}
}
} else {
// try to get by name
- m_SelectedItem = GetItemByName(Value->GetString());
+ _selectedItem = GetItemByName(Value->GetString());
}
}
@@ -981,7 +981,7 @@ HRESULT CAdGame::ScSetProperty(char *Name, CScValue *Value) {
// SmartItemCursor
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SmartItemCursor") == 0) {
- m_SmartItemCursor = Value->GetBool();
+ _smartItemCursor = Value->GetBool();
return S_OK;
}
@@ -989,7 +989,7 @@ HRESULT CAdGame::ScSetProperty(char *Name, CScValue *Value) {
// InventoryVisible
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "InventoryVisible") == 0) {
- if (m_InventoryBox) m_InventoryBox->m_Visible = Value->GetBool();
+ if (_inventoryBox) _inventoryBox->_visible = Value->GetBool();
return S_OK;
}
@@ -997,16 +997,16 @@ HRESULT CAdGame::ScSetProperty(char *Name, CScValue *Value) {
// InventoryObject
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "InventoryObject") == 0) {
- if (m_InventoryOwner && m_InventoryBox) m_InventoryOwner->GetInventory()->m_ScrollOffset = m_InventoryBox->m_ScrollOffset;
+ if (_inventoryOwner && _inventoryBox) _inventoryOwner->GetInventory()->_scrollOffset = _inventoryBox->_scrollOffset;
- if (Value->IsNULL()) m_InventoryOwner = m_InvObject;
+ if (Value->IsNULL()) _inventoryOwner = _invObject;
else {
CBObject *Obj = (CBObject *)Value->GetNative();
- if (Obj == this) m_InventoryOwner = m_InvObject;
- else if (Game->ValidObject(Obj)) m_InventoryOwner = (CAdObject *)Obj;
+ if (Obj == this) _inventoryOwner = _invObject;
+ else if (Game->ValidObject(Obj)) _inventoryOwner = (CAdObject *)Obj;
}
- if (m_InventoryOwner && m_InventoryBox) m_InventoryBox->m_ScrollOffset = m_InventoryOwner->GetInventory()->m_ScrollOffset;
+ if (_inventoryOwner && _inventoryBox) _inventoryBox->_scrollOffset = _inventoryOwner->GetInventory()->_scrollOffset;
return S_OK;
}
@@ -1015,7 +1015,7 @@ HRESULT CAdGame::ScSetProperty(char *Name, CScValue *Value) {
// InventoryScrollOffset
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "InventoryScrollOffset") == 0) {
- if (m_InventoryBox) m_InventoryBox->m_ScrollOffset = Value->GetInt();
+ if (_inventoryBox) _inventoryBox->_scrollOffset = Value->GetInt();
return S_OK;
}
@@ -1026,7 +1026,7 @@ HRESULT CAdGame::ScSetProperty(char *Name, CScValue *Value) {
int Val = Value->GetInt();
if (Val < 0) Val = 0;
if (Val > TALK_SKIP_NONE) Val = TALK_SKIP_NONE;
- m_TalkSkipButton = (TTalkSkipButton)Val;
+ _talkSkipButton = (TTalkSkipButton)Val;
return S_OK;
}
@@ -1035,9 +1035,9 @@ HRESULT CAdGame::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "StartupScene") == 0) {
if (Value == NULL) {
- delete[] m_StartupScene;
- m_StartupScene = NULL;
- } else CBUtils::SetString(&m_StartupScene, Value->GetString());
+ delete[] _startupScene;
+ _startupScene = NULL;
+ } else CBUtils::SetString(&_startupScene, Value->GetString());
return S_OK;
}
@@ -1048,12 +1048,12 @@ HRESULT CAdGame::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
void CAdGame::PublishNatives() {
- if (!m_ScEngine || !m_ScEngine->m_CompilerAvailable) return;
+ if (!_scEngine || !_scEngine->_compilerAvailable) return;
CBGame::PublishNatives();
- m_ScEngine->ExtDefineFunction("Actor");
- m_ScEngine->ExtDefineFunction("Entity");
+ _scEngine->ExtDefineFunction("Actor");
+ _scEngine->ExtDefineFunction("Entity");
}
@@ -1095,27 +1095,27 @@ HRESULT CAdGame::ExternalCall(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::ShowCursor() {
- if (m_CursorHidden) return S_OK;
+ if (_cursorHidden) return S_OK;
- if (m_SelectedItem && Game->m_State == GAME_RUNNING && m_StateEx == GAME_NORMAL && m_Interactive) {
- if (m_SelectedItem->m_CursorCombined) {
- CBSprite *OrigLastCursor = m_LastCursor;
+ if (_selectedItem && Game->_state == GAME_RUNNING && _stateEx == GAME_NORMAL && _interactive) {
+ if (_selectedItem->_cursorCombined) {
+ CBSprite *OrigLastCursor = _lastCursor;
CBGame::ShowCursor();
- m_LastCursor = OrigLastCursor;
+ _lastCursor = OrigLastCursor;
}
- if (m_ActiveObject && m_SelectedItem->m_CursorHover && m_ActiveObject->GetExtendedFlag("usable")) {
- if (!m_SmartItemCursor || m_ActiveObject->CanHandleEvent(m_SelectedItem->m_Name))
- return DrawCursor(m_SelectedItem->m_CursorHover);
+ if (_activeObject && _selectedItem->_cursorHover && _activeObject->GetExtendedFlag("usable")) {
+ if (!_smartItemCursor || _activeObject->CanHandleEvent(_selectedItem->_name))
+ return DrawCursor(_selectedItem->_cursorHover);
else
- return DrawCursor(m_SelectedItem->m_CursorNormal);
- } else return DrawCursor(m_SelectedItem->m_CursorNormal);
+ return DrawCursor(_selectedItem->_cursorNormal);
+ } else return DrawCursor(_selectedItem->_cursorNormal);
} else return CBGame::ShowCursor();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::LoadFile(const char *Filename) {
- byte *Buffer = m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = _fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdGame::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -1123,8 +1123,8 @@ HRESULT CAdGame::LoadFile(const char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -1181,50 +1181,50 @@ HRESULT CAdGame::LoadBuffer(byte *Buffer, bool Complete) {
while (cmd > 0 && (cmd = parser.GetCommand((char **)&params, commands, (char **)&params2)) > 0) {
switch (cmd) {
case TOKEN_RESPONSE_BOX:
- delete m_ResponseBox;
- m_ResponseBox = new CAdResponseBox(Game);
- if (m_ResponseBox && !FAILED(m_ResponseBox->LoadFile((char *)params2)))
- RegisterObject(m_ResponseBox);
+ delete _responseBox;
+ _responseBox = new CAdResponseBox(Game);
+ if (_responseBox && !FAILED(_responseBox->LoadFile((char *)params2)))
+ RegisterObject(_responseBox);
else {
- delete m_ResponseBox;
- m_ResponseBox = NULL;
+ delete _responseBox;
+ _responseBox = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_INVENTORY_BOX:
- delete m_InventoryBox;
- m_InventoryBox = new CAdInventoryBox(Game);
- if (m_InventoryBox && !FAILED(m_InventoryBox->LoadFile((char *)params2)))
- RegisterObject(m_InventoryBox);
+ delete _inventoryBox;
+ _inventoryBox = new CAdInventoryBox(Game);
+ if (_inventoryBox && !FAILED(_inventoryBox->LoadFile((char *)params2)))
+ RegisterObject(_inventoryBox);
else {
- delete m_InventoryBox;
- m_InventoryBox = NULL;
+ delete _inventoryBox;
+ _inventoryBox = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_ITEMS:
ItemsFound = true;
- CBUtils::SetString(&m_ItemsFile, (char *)params2);
- if (FAILED(LoadItemsFile(m_ItemsFile))) {
- delete[] m_ItemsFile;
- m_ItemsFile = NULL;
+ CBUtils::SetString(&_itemsFile, (char *)params2);
+ if (FAILED(LoadItemsFile(_itemsFile))) {
+ delete[] _itemsFile;
+ _itemsFile = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_TALK_SKIP_BUTTON:
- if (scumm_stricmp((char *)params2, "right") == 0) m_TalkSkipButton = TALK_SKIP_RIGHT;
- else if (scumm_stricmp((char *)params2, "both") == 0) m_TalkSkipButton = TALK_SKIP_BOTH;
- else m_TalkSkipButton = TALK_SKIP_LEFT;
+ if (scumm_stricmp((char *)params2, "right") == 0) _talkSkipButton = TALK_SKIP_RIGHT;
+ else if (scumm_stricmp((char *)params2, "both") == 0) _talkSkipButton = TALK_SKIP_BOTH;
+ else _talkSkipButton = TALK_SKIP_LEFT;
break;
case TOKEN_SCENE_VIEWPORT: {
RECT rc;
parser.ScanStr((char *)params2, "%d,%d,%d,%d", &rc.left, &rc.top, &rc.right, &rc.bottom);
- if (!m_SceneViewport) m_SceneViewport = new CBViewport(Game);
- if (m_SceneViewport) m_SceneViewport->SetRect(rc.left, rc.top, rc.right, rc.bottom);
+ if (!_sceneViewport) _sceneViewport = new CBViewport(Game);
+ if (_sceneViewport) _sceneViewport->SetRect(rc.left, rc.top, rc.right, rc.bottom);
}
break;
@@ -1233,11 +1233,11 @@ HRESULT CAdGame::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_STARTUP_SCENE:
- CBUtils::SetString(&m_StartupScene, (char *)params2);
+ CBUtils::SetString(&_startupScene, (char *)params2);
break;
case TOKEN_DEBUG_STARTUP_SCENE:
- CBUtils::SetString(&m_DebugStartupScene, (char *)params2);
+ CBUtils::SetString(&_debugStartupScene, (char *)params2);
break;
}
}
@@ -1264,49 +1264,49 @@ HRESULT CAdGame::LoadBuffer(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::Persist(CBPersistMgr *PersistMgr) {
- if (!PersistMgr->m_Saving) Cleanup();
+ if (!PersistMgr->_saving) Cleanup();
CBGame::Persist(PersistMgr);
- m_DlgPendingBranches.Persist(PersistMgr);
+ _dlgPendingBranches.Persist(PersistMgr);
- m_Inventories.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_InventoryBox));
+ _inventories.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_inventoryBox));
- m_Objects.Persist(PersistMgr);
+ _objects.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_PrevSceneName));
- PersistMgr->Transfer(TMEMBER(m_PrevSceneFilename));
+ PersistMgr->Transfer(TMEMBER(_prevSceneName));
+ PersistMgr->Transfer(TMEMBER(_prevSceneFilename));
- PersistMgr->Transfer(TMEMBER(m_ResponseBox));
- m_ResponsesBranch.Persist(PersistMgr);
- m_ResponsesGame.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Scene));
- m_SceneStates.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_ScheduledFadeIn));
- PersistMgr->Transfer(TMEMBER(m_ScheduledScene));
- PersistMgr->Transfer(TMEMBER(m_SelectedItem));
- PersistMgr->Transfer(TMEMBER_INT(m_TalkSkipButton));
+ PersistMgr->Transfer(TMEMBER(_responseBox));
+ _responsesBranch.Persist(PersistMgr);
+ _responsesGame.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_scene));
+ _sceneStates.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_scheduledFadeIn));
+ PersistMgr->Transfer(TMEMBER(_scheduledScene));
+ PersistMgr->Transfer(TMEMBER(_selectedItem));
+ PersistMgr->Transfer(TMEMBER_INT(_talkSkipButton));
- m_Sentences.Persist(PersistMgr);
+ _sentences.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_SceneViewport));
- PersistMgr->Transfer(TMEMBER_INT(m_StateEx));
- PersistMgr->Transfer(TMEMBER(m_InitialScene));
- PersistMgr->Transfer(TMEMBER(m_DebugStartupScene));
+ PersistMgr->Transfer(TMEMBER(_sceneViewport));
+ PersistMgr->Transfer(TMEMBER_INT(_stateEx));
+ PersistMgr->Transfer(TMEMBER(_initialScene));
+ PersistMgr->Transfer(TMEMBER(_debugStartupScene));
- PersistMgr->Transfer(TMEMBER(m_InvObject));
- PersistMgr->Transfer(TMEMBER(m_InventoryOwner));
- PersistMgr->Transfer(TMEMBER(m_TempDisableSaveState));
- m_Items.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_invObject));
+ PersistMgr->Transfer(TMEMBER(_inventoryOwner));
+ PersistMgr->Transfer(TMEMBER(_tempDisableSaveState));
+ _items.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_ItemsFile));
+ PersistMgr->Transfer(TMEMBER(_itemsFile));
- m_SpeechDirs.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_SmartItemCursor));
+ _speechDirs.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_smartItemCursor));
- if (!PersistMgr->m_Saving) m_InitialScene = false;
+ if (!PersistMgr->_saving) _initialScene = false;
- PersistMgr->Transfer(TMEMBER(m_StartupScene));
+ PersistMgr->Transfer(TMEMBER(_startupScene));
return S_OK;
@@ -1335,37 +1335,37 @@ void CAdGame::AfterLoadScene(void *Scene, void *Data) {
//////////////////////////////////////////////////////////////////////////
void CAdGame::SetPrevSceneName(char *Name) {
- delete[] m_PrevSceneName;
- m_PrevSceneName = NULL;
+ delete[] _prevSceneName;
+ _prevSceneName = NULL;
if (Name) {
- m_PrevSceneName = new char[strlen(Name) + 1];
- if (m_PrevSceneName) strcpy(m_PrevSceneName, Name);
+ _prevSceneName = new char[strlen(Name) + 1];
+ if (_prevSceneName) strcpy(_prevSceneName, Name);
}
}
//////////////////////////////////////////////////////////////////////////
void CAdGame::SetPrevSceneFilename(char *Name) {
- delete[] m_PrevSceneFilename;
- m_PrevSceneFilename = NULL;
+ delete[] _prevSceneFilename;
+ _prevSceneFilename = NULL;
if (Name) {
- m_PrevSceneFilename = new char[strlen(Name) + 1];
- if (m_PrevSceneFilename) strcpy(m_PrevSceneFilename, Name);
+ _prevSceneFilename = new char[strlen(Name) + 1];
+ if (_prevSceneFilename) strcpy(_prevSceneFilename, Name);
}
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::ScheduleChangeScene(char *Filename, bool FadeIn) {
- delete[] m_ScheduledScene;
- m_ScheduledScene = NULL;
+ delete[] _scheduledScene;
+ _scheduledScene = NULL;
- if (m_Scene && !m_Scene->m_Initialized) return ChangeScene(Filename, FadeIn);
+ if (_scene && !_scene->_initialized) return ChangeScene(Filename, FadeIn);
else {
- m_ScheduledScene = new char [strlen(Filename) + 1];
- strcpy(m_ScheduledScene, Filename);
+ _scheduledScene = new char [strlen(Filename) + 1];
+ strcpy(_scheduledScene, Filename);
- m_ScheduledFadeIn = FadeIn;
+ _scheduledFadeIn = FadeIn;
return S_OK;
}
@@ -1385,7 +1385,7 @@ HRESULT CAdGame::GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byt
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::LoadItemsFile(char *Filename, bool Merge) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdGame::LoadItemsFile failed for file '%s'", Filename);
return E_FAIL;
@@ -1393,8 +1393,8 @@ HRESULT CAdGame::LoadItemsFile(char *Filename, bool Merge) {
HRESULT ret;
- //m_Filename = new char [strlen(Filename)+1];
- //strcpy(m_Filename, Filename);
+ //_filename = new char [strlen(Filename)+1];
+ //strcpy(_filename, Filename);
if (FAILED(ret = LoadItemsBuffer(Buffer, Merge))) Game->LOG(0, "Error parsing ITEMS file '%s'", Filename);
@@ -1416,7 +1416,7 @@ HRESULT CAdGame::LoadItemsBuffer(byte *Buffer, bool Merge) {
CBParser parser(Game);
if (!Merge) {
- while (m_Items.GetSize() > 0) DeleteItem(m_Items[0]);
+ while (_items.GetSize() > 0) DeleteItem(_items[0]);
}
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)&params)) > 0) {
@@ -1426,7 +1426,7 @@ HRESULT CAdGame::LoadItemsBuffer(byte *Buffer, bool Merge) {
if (item && !FAILED(item->LoadBuffer(params, false))) {
// delete item with the same name, if exists
if (Merge) {
- CAdItem *PrevItem = GetItemByName(item->m_Name);
+ CAdItem *PrevItem = GetItemByName(item->_name);
if (PrevItem) DeleteItem(PrevItem);
}
AddItem(item);
@@ -1461,10 +1461,10 @@ CAdSceneState *CAdGame::GetSceneState(char *Filename, bool Saving) {
if (FilenameCor[i] == '/') FilenameCor[i] = '\\';
}
- for (int i = 0; i < m_SceneStates.GetSize(); i++) {
- if (scumm_stricmp(m_SceneStates[i]->m_Filename, FilenameCor) == 0) {
+ for (int i = 0; i < _sceneStates.GetSize(); i++) {
+ if (scumm_stricmp(_sceneStates[i]->_filename, FilenameCor) == 0) {
delete [] FilenameCor;
- return m_SceneStates[i];
+ return _sceneStates[i];
}
}
@@ -1472,7 +1472,7 @@ CAdSceneState *CAdGame::GetSceneState(char *Filename, bool Saving) {
CAdSceneState *ret = new CAdSceneState(Game);
ret->SetFilename(FilenameCor);
- m_SceneStates.Add(ret);
+ _sceneStates.Add(ret);
delete [] FilenameCor;
return ret;
@@ -1501,8 +1501,8 @@ HRESULT CAdGame::WindowLoadHook(CUIWindow *Win, char **Buffer, char **params) {
ent = NULL;
cmd = PARSERR_GENERIC;
} else {
- ent->m_Parent = Win;
- Win->m_Widgets.Add(ent);
+ ent->_parent = Win;
+ Win->_widgets.Add(ent);
}
}
break;
@@ -1527,8 +1527,8 @@ HRESULT CAdGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScSt
if (!Val->IsNULL()) Ent->SetName(Val->GetString());
Stack->PushNative(Ent, true);
- Ent->m_Parent = Win;
- Win->m_Widgets.Add(Ent);
+ Ent->_parent = Win;
+ Win->_widgets.Add(Ent);
return S_OK;
} else return E_FAIL;
@@ -1540,7 +1540,7 @@ HRESULT CAdGame::StartDlgBranch(const char *BranchName, const char *ScriptName,
char *Name = new char[strlen(BranchName) + 1 + strlen(ScriptName) + 1 + strlen(EventName) + 1];
if (Name) {
sprintf(Name, "%s.%s.%s", BranchName, ScriptName, EventName);
- m_DlgPendingBranches.Add(Name);
+ _dlgPendingBranches.Add(Name);
}
return S_OK;
}
@@ -1550,8 +1550,8 @@ HRESULT CAdGame::StartDlgBranch(const char *BranchName, const char *ScriptName,
HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName) {
char *Name = NULL;
bool DeleteName = false;
- if (BranchName == NULL && m_DlgPendingBranches.GetSize() > 0) {
- Name = m_DlgPendingBranches[m_DlgPendingBranches.GetSize() - 1];
+ if (BranchName == NULL && _dlgPendingBranches.GetSize() > 0) {
+ Name = _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1];
} else {
if (BranchName != NULL) {
Name = new char[strlen(BranchName) + 1 + strlen(ScriptName) + 1 + strlen(EventName) + 1];
@@ -1567,25 +1567,25 @@ HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, co
int StartIndex = -1;
int i;
- for (i = m_DlgPendingBranches.GetSize() - 1; i >= 0; i--) {
- if (scumm_stricmp(Name, m_DlgPendingBranches[i]) == 0) {
+ for (i = _dlgPendingBranches.GetSize() - 1; i >= 0; i--) {
+ if (scumm_stricmp(Name, _dlgPendingBranches[i]) == 0) {
StartIndex = i;
break;
}
}
if (StartIndex >= 0) {
- for (i = StartIndex; i < m_DlgPendingBranches.GetSize(); i++) {
- //ClearBranchResponses(m_DlgPendingBranches[i]);
- delete [] m_DlgPendingBranches[i];
- m_DlgPendingBranches[i] = NULL;
+ for (i = StartIndex; i < _dlgPendingBranches.GetSize(); i++) {
+ //ClearBranchResponses(_dlgPendingBranches[i]);
+ delete [] _dlgPendingBranches[i];
+ _dlgPendingBranches[i] = NULL;
}
- m_DlgPendingBranches.RemoveAt(StartIndex, m_DlgPendingBranches.GetSize() - StartIndex);
+ _dlgPendingBranches.RemoveAt(StartIndex, _dlgPendingBranches.GetSize() - StartIndex);
}
// dialogue is over, forget selected responses
- if (m_DlgPendingBranches.GetSize() == 0) {
- for (int i = 0; i < m_ResponsesBranch.GetSize(); i++) delete m_ResponsesBranch[i];
- m_ResponsesBranch.RemoveAll();
+ if (_dlgPendingBranches.GetSize() == 0) {
+ for (int i = 0; i < _responsesBranch.GetSize(); i++) delete _responsesBranch[i];
+ _responsesBranch.RemoveAll();
}
if (DeleteName) delete [] Name;
@@ -1596,10 +1596,10 @@ HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, co
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::ClearBranchResponses(char *Name) {
- for (int i = 0; i < m_ResponsesBranch.GetSize(); i++) {
- if (scumm_stricmp(Name, m_ResponsesBranch[i]->m_Context) == 0) {
- delete m_ResponsesBranch[i];
- m_ResponsesBranch.RemoveAt(i);
+ for (int i = 0; i < _responsesBranch.GetSize(); i++) {
+ if (scumm_stricmp(Name, _responsesBranch[i]->_context) == 0) {
+ delete _responsesBranch[i];
+ _responsesBranch.RemoveAt(i);
i--;
}
}
@@ -1611,19 +1611,19 @@ HRESULT CAdGame::ClearBranchResponses(char *Name) {
HRESULT CAdGame::AddBranchResponse(int ID) {
if (BranchResponseUsed(ID)) return S_OK;
CAdResponseContext *r = new CAdResponseContext(Game);
- r->m_ID = ID;
- r->SetContext(m_DlgPendingBranches.GetSize() > 0 ? m_DlgPendingBranches[m_DlgPendingBranches.GetSize() - 1] : NULL);
- m_ResponsesBranch.Add(r);
+ r->_iD = ID;
+ r->SetContext(_dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL);
+ _responsesBranch.Add(r);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
bool CAdGame::BranchResponseUsed(int ID) {
- char *Context = m_DlgPendingBranches.GetSize() > 0 ? m_DlgPendingBranches[m_DlgPendingBranches.GetSize() - 1] : NULL;
- for (int i = 0; i < m_ResponsesBranch.GetSize(); i++) {
- if (m_ResponsesBranch[i]->m_ID == ID) {
- if ((Context == NULL && m_ResponsesBranch[i]->m_Context == NULL) || scumm_stricmp(Context, m_ResponsesBranch[i]->m_Context) == 0) return true;
+ char *Context = _dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL;
+ for (int i = 0; i < _responsesBranch.GetSize(); i++) {
+ if (_responsesBranch[i]->_iD == ID) {
+ if ((Context == NULL && _responsesBranch[i]->_context == NULL) || scumm_stricmp(Context, _responsesBranch[i]->_context) == 0) return true;
}
}
return false;
@@ -1634,20 +1634,20 @@ bool CAdGame::BranchResponseUsed(int ID) {
HRESULT CAdGame::AddGameResponse(int ID) {
if (GameResponseUsed(ID)) return S_OK;
CAdResponseContext *r = new CAdResponseContext(Game);
- r->m_ID = ID;
- r->SetContext(m_DlgPendingBranches.GetSize() > 0 ? m_DlgPendingBranches[m_DlgPendingBranches.GetSize() - 1] : NULL);
- m_ResponsesGame.Add(r);
+ r->_iD = ID;
+ r->SetContext(_dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL);
+ _responsesGame.Add(r);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
bool CAdGame::GameResponseUsed(int ID) {
- char *Context = m_DlgPendingBranches.GetSize() > 0 ? m_DlgPendingBranches[m_DlgPendingBranches.GetSize() - 1] : NULL;
- for (int i = 0; i < m_ResponsesGame.GetSize(); i++) {
- CAdResponseContext *RespContext = m_ResponsesGame[i];
- if (RespContext->m_ID == ID) {
- if ((Context == NULL && RespContext->m_Context == NULL) || ((Context != NULL && RespContext->m_Context != NULL) && scumm_stricmp(Context, RespContext->m_Context) == 0)) return true;
+ char *Context = _dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL;
+ for (int i = 0; i < _responsesGame.GetSize(); i++) {
+ CAdResponseContext *RespContext = _responsesGame[i];
+ if (RespContext->_iD == ID) {
+ if ((Context == NULL && RespContext->_context == NULL) || ((Context != NULL && RespContext->_context != NULL) && scumm_stricmp(Context, RespContext->_context) == 0)) return true;
}
}
return false;
@@ -1656,25 +1656,25 @@ bool CAdGame::GameResponseUsed(int ID) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::ResetResponse(int ID) {
- char *Context = m_DlgPendingBranches.GetSize() > 0 ? m_DlgPendingBranches[m_DlgPendingBranches.GetSize() - 1] : NULL;
+ char *Context = _dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL;
int i;
- for (i = 0; i < m_ResponsesGame.GetSize(); i++) {
- if (m_ResponsesGame[i]->m_ID == ID) {
- if ((Context == NULL && m_ResponsesGame[i]->m_Context == NULL) || scumm_stricmp(Context, m_ResponsesGame[i]->m_Context) == 0) {
- delete m_ResponsesGame[i];
- m_ResponsesGame.RemoveAt(i);
+ for (i = 0; i < _responsesGame.GetSize(); i++) {
+ if (_responsesGame[i]->_iD == ID) {
+ if ((Context == NULL && _responsesGame[i]->_context == NULL) || scumm_stricmp(Context, _responsesGame[i]->_context) == 0) {
+ delete _responsesGame[i];
+ _responsesGame.RemoveAt(i);
break;
}
}
}
- for (i = 0; i < m_ResponsesBranch.GetSize(); i++) {
- if (m_ResponsesBranch[i]->m_ID == ID) {
- if ((Context == NULL && m_ResponsesBranch[i]->m_Context == NULL) || scumm_stricmp(Context, m_ResponsesBranch[i]->m_Context) == 0) {
- delete m_ResponsesBranch[i];
- m_ResponsesBranch.RemoveAt(i);
+ for (i = 0; i < _responsesBranch.GetSize(); i++) {
+ if (_responsesBranch[i]->_iD == ID) {
+ if ((Context == NULL && _responsesBranch[i]->_context == NULL) || scumm_stricmp(Context, _responsesBranch[i]->_context) == 0) {
+ delete _responsesBranch[i];
+ _responsesBranch.RemoveAt(i);
break;
}
}
@@ -1689,47 +1689,47 @@ HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) {
if (Update) InitLoop();
// fill black
- m_Renderer->Fill(0, 0, 0);
- if (!m_EditorMode) m_Renderer->SetScreenViewport();
+ _renderer->Fill(0, 0, 0);
+ if (!_editorMode) _renderer->SetScreenViewport();
// process scripts
- if (Update) m_ScEngine->Tick();
+ if (Update) _scEngine->Tick();
POINT p;
GetMousePos(&p);
- m_Scene->Update();
- m_Scene->Display();
+ _scene->Update();
+ _scene->Display();
// display in-game windows
DisplayWindows(true);
- if (m_InventoryBox) m_InventoryBox->Display();
- if (m_StateEx == GAME_WAITING_RESPONSE) m_ResponseBox->Display();
- if (m_IndicatorDisplay) DisplayIndicator();
+ if (_inventoryBox) _inventoryBox->Display();
+ if (_stateEx == GAME_WAITING_RESPONSE) _responseBox->Display();
+ if (_indicatorDisplay) DisplayIndicator();
if (Update || DisplayAll) {
// display normal windows
DisplayWindows(false);
- SetActiveObject(Game->m_Renderer->GetObjectAt(p.x, p.y));
+ SetActiveObject(Game->_renderer->GetObjectAt(p.x, p.y));
// textual info
- DisplaySentences(m_State == GAME_FROZEN);
+ DisplaySentences(_state == GAME_FROZEN);
ShowCursor();
- if (m_Fader) m_Fader->Display();
- m_TransMgr->Update();
+ if (_fader) _fader->Display();
+ _transMgr->Update();
}
- if (m_LoadingIcon) {
- m_LoadingIcon->Display(m_LoadingIconX, m_LoadingIconY);
- if (!m_LoadingIconPersistent) {
- delete m_LoadingIcon;
- m_LoadingIcon = NULL;
+ if (_loadingIcon) {
+ _loadingIcon->Display(_loadingIconX, _loadingIconY);
+ if (!_loadingIconPersistent) {
+ delete _loadingIcon;
+ _loadingIcon = NULL;
}
}
@@ -1738,21 +1738,21 @@ HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::RegisterInventory(CAdInventory *Inv) {
- for (int i = 0; i < m_Inventories.GetSize(); i++) {
- if (m_Inventories[i] == Inv) return S_OK;
+ for (int i = 0; i < _inventories.GetSize(); i++) {
+ if (_inventories[i] == Inv) return S_OK;
}
RegisterObject(Inv);
- m_Inventories.Add(Inv);
+ _inventories.Add(Inv);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::UnregisterInventory(CAdInventory *Inv) {
- for (int i = 0; i < m_Inventories.GetSize(); i++) {
- if (m_Inventories[i] == Inv) {
- UnregisterObject(m_Inventories[i]);
- m_Inventories.RemoveAt(i);
+ for (int i = 0; i < _inventories.GetSize(); i++) {
+ if (_inventories[i] == Inv) {
+ UnregisterObject(_inventories[i]);
+ _inventories.RemoveAt(i);
return S_OK;
}
}
@@ -1763,11 +1763,11 @@ HRESULT CAdGame::UnregisterInventory(CAdInventory *Inv) {
bool CAdGame::IsItemTaken(char *ItemName) {
int i;
- for (i = 0; i < m_Inventories.GetSize(); i++) {
- CAdInventory *Inv = m_Inventories[i];
+ for (i = 0; i < _inventories.GetSize(); i++) {
+ CAdInventory *Inv = _inventories[i];
- for (int j = 0; j < Inv->m_TakenItems.GetSize(); j++) {
- if (scumm_stricmp(ItemName, Inv->m_TakenItems[j]->m_Name) == 0) {
+ for (int j = 0; j < Inv->_takenItems.GetSize(); j++) {
+ if (scumm_stricmp(ItemName, Inv->_takenItems[j]->_name) == 0) {
return true;
}
}
@@ -1777,8 +1777,8 @@ bool CAdGame::IsItemTaken(char *ItemName) {
//////////////////////////////////////////////////////////////////////////
CAdItem *CAdGame::GetItemByName(char *Name) {
- for (int i = 0; i < m_Items.GetSize(); i++) {
- if (scumm_stricmp(m_Items[i]->m_Name, Name) == 0) return m_Items[i];
+ for (int i = 0; i < _items.GetSize(); i++) {
+ if (scumm_stricmp(_items[i]->_name, Name) == 0) return _items[i];
}
return NULL;
}
@@ -1786,7 +1786,7 @@ CAdItem *CAdGame::GetItemByName(char *Name) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::AddItem(CAdItem *Item) {
- m_Items.Add(Item);
+ _items.Add(Item);
return Game->RegisterObject(Item);
}
@@ -1796,33 +1796,33 @@ HRESULT CAdGame::ResetContent() {
int i;
// clear pending dialogs
- for (i = 0; i < m_DlgPendingBranches.GetSize(); i++) {
- delete [] m_DlgPendingBranches[i];
+ for (i = 0; i < _dlgPendingBranches.GetSize(); i++) {
+ delete [] _dlgPendingBranches[i];
}
- m_DlgPendingBranches.RemoveAll();
+ _dlgPendingBranches.RemoveAll();
// clear inventories
- for (i = 0; i < m_Inventories.GetSize(); i++) {
- m_Inventories[i]->m_TakenItems.RemoveAll();
+ for (i = 0; i < _inventories.GetSize(); i++) {
+ _inventories[i]->_takenItems.RemoveAll();
}
// clear scene states
- for (i = 0; i < m_SceneStates.GetSize(); i++) delete m_SceneStates[i];
- m_SceneStates.RemoveAll();
+ for (i = 0; i < _sceneStates.GetSize(); i++) delete _sceneStates[i];
+ _sceneStates.RemoveAll();
// clear once responses
- for (i = 0; i < m_ResponsesBranch.GetSize(); i++) delete m_ResponsesBranch[i];
- m_ResponsesBranch.RemoveAll();
+ for (i = 0; i < _responsesBranch.GetSize(); i++) delete _responsesBranch[i];
+ _responsesBranch.RemoveAll();
// clear once game responses
- for (i = 0; i < m_ResponsesGame.GetSize(); i++) delete m_ResponsesGame[i];
- m_ResponsesGame.RemoveAll();
+ for (i = 0; i < _responsesGame.GetSize(); i++) delete _responsesGame[i];
+ _responsesGame.RemoveAll();
// reload inventory items
- if (m_ItemsFile) LoadItemsFile(m_ItemsFile);
+ if (_itemsFile) LoadItemsFile(_itemsFile);
- m_TempDisableSaveState = true;
+ _tempDisableSaveState = true;
return CBGame::ResetContent();
}
@@ -1832,19 +1832,19 @@ HRESULT CAdGame::ResetContent() {
HRESULT CAdGame::DeleteItem(CAdItem *Item) {
if (!Item) return E_FAIL;
- if (m_SelectedItem == Item) m_SelectedItem = NULL;
- m_Scene->HandleItemAssociations(Item->m_Name, false);
+ if (_selectedItem == Item) _selectedItem = NULL;
+ _scene->HandleItemAssociations(Item->_name, false);
// remove from all inventories
- for (int i = 0; i < m_Inventories.GetSize(); i++) {
- m_Inventories[i]->RemoveItem(Item);
+ for (int i = 0; i < _inventories.GetSize(); i++) {
+ _inventories[i]->RemoveItem(Item);
}
// remove object
- for (int i = 0; i < m_Items.GetSize(); i++) {
- if (m_Items[i] == Item) {
- UnregisterObject(m_Items[i]);
- m_Items.RemoveAt(i);
+ for (int i = 0; i < _items.GetSize(); i++) {
+ if (_items[i] == Item) {
+ UnregisterObject(_items[i]);
+ _items.RemoveAt(i);
break;
}
}
@@ -1862,13 +1862,13 @@ HRESULT CAdGame::AddSpeechDir(const char *Dir) {
if (Temp[strlen(Temp) - 1] != '\\' && Temp[strlen(Temp) - 1] != '/')
strcat(Temp, "\\");
- for (int i = 0; i < m_SpeechDirs.GetSize(); i++) {
- if (scumm_stricmp(m_SpeechDirs[i], Temp) == 0) {
+ for (int i = 0; i < _speechDirs.GetSize(); i++) {
+ if (scumm_stricmp(_speechDirs[i], Temp) == 0) {
delete [] Temp;
return S_OK;
}
}
- m_SpeechDirs.Add(Temp);
+ _speechDirs.Add(Temp);
return S_OK;
}
@@ -1884,10 +1884,10 @@ HRESULT CAdGame::RemoveSpeechDir(char *Dir) {
strcat(Temp, "\\");
bool Found = false;
- for (int i = 0; i < m_SpeechDirs.GetSize(); i++) {
- if (scumm_stricmp(m_SpeechDirs[i], Temp) == 0) {
- delete [] m_SpeechDirs[i];
- m_SpeechDirs.RemoveAt(i);
+ for (int i = 0; i < _speechDirs.GetSize(); i++) {
+ if (scumm_stricmp(_speechDirs[i], Temp) == 0) {
+ delete [] _speechDirs[i];
+ _speechDirs.RemoveAt(i);
Found = true;
break;
}
@@ -1903,18 +1903,18 @@ HRESULT CAdGame::RemoveSpeechDir(char *Dir) {
char *CAdGame::FindSpeechFile(char *StringID) {
char *Ret = new char[MAX_PATH];
- for (int i = 0; i < m_SpeechDirs.GetSize(); i++) {
- sprintf(Ret, "%s%s.ogg", m_SpeechDirs[i], StringID);
- CBFile *File = m_FileManager->OpenFile(Ret);
+ for (int i = 0; i < _speechDirs.GetSize(); i++) {
+ sprintf(Ret, "%s%s.ogg", _speechDirs[i], StringID);
+ CBFile *File = _fileManager->OpenFile(Ret);
if (File) {
- m_FileManager->CloseFile(File);
+ _fileManager->CloseFile(File);
return Ret;
}
- sprintf(Ret, "%s%s.wav", m_SpeechDirs[i], StringID);
- File = m_FileManager->OpenFile(Ret);
+ sprintf(Ret, "%s%s.wav", _speechDirs[i], StringID);
+ File = _fileManager->OpenFile(Ret);
if (File) {
- m_FileManager->CloseFile(File);
+ _fileManager->CloseFile(File);
return Ret;
}
}
@@ -1928,51 +1928,51 @@ bool CAdGame::ValidMouse() {
POINT Pos;
CBPlatform::GetCursorPos(&Pos);
- return m_Renderer->PointInViewport(&Pos);
+ return _renderer->PointInViewport(&Pos);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::OnMouseLeftDown() {
if (!ValidMouse()) return S_OK;
- if (m_State == GAME_RUNNING && !m_Interactive) {
- if (m_TalkSkipButton == TALK_SKIP_LEFT || m_TalkSkipButton == TALK_SKIP_BOTH) {
+ if (_state == GAME_RUNNING && !_interactive) {
+ if (_talkSkipButton == TALK_SKIP_LEFT || _talkSkipButton == TALK_SKIP_BOTH) {
FinishSentences();
}
return S_OK;
}
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_LEFT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_LEFT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftClick"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftClick"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("LeftClick");
- } else if (m_State == GAME_RUNNING && m_Scene && m_Scene->PointInViewport(m_MousePos.x, m_MousePos.y)) {
- m_Scene->ApplyEvent("LeftClick");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("LeftClick");
+ } else if (_state == GAME_RUNNING && _scene && _scene->PointInViewport(_mousePos.x, _mousePos.y)) {
+ _scene->ApplyEvent("LeftClick");
}
}
- if (m_ActiveObject != NULL) Game->m_CapturedObject = Game->m_ActiveObject;
- m_MouseLeftDown = true;
- CBPlatform::SetCapture(m_Renderer->m_Window);
+ if (_activeObject != NULL) Game->_capturedObject = Game->_activeObject;
+ _mouseLeftDown = true;
+ CBPlatform::SetCapture(_renderer->_window);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::OnMouseLeftUp() {
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
CBPlatform::ReleaseCapture();
- m_CapturedObject = NULL;
- m_MouseLeftDown = false;
+ _capturedObject = NULL;
+ _mouseLeftDown = false;
- bool Handled = /*m_State==GAME_RUNNING &&*/ SUCCEEDED(ApplyEvent("LeftRelease"));
+ bool Handled = /*_state==GAME_RUNNING &&*/ SUCCEEDED(ApplyEvent("LeftRelease"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("LeftRelease");
- } else if (m_State == GAME_RUNNING && m_Scene && m_Scene->PointInViewport(m_MousePos.x, m_MousePos.y)) {
- m_Scene->ApplyEvent("LeftRelease");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("LeftRelease");
+ } else if (_state == GAME_RUNNING && _scene && _scene->PointInViewport(_mousePos.x, _mousePos.y)) {
+ _scene->ApplyEvent("LeftRelease");
}
}
return S_OK;
@@ -1982,16 +1982,16 @@ HRESULT CAdGame::OnMouseLeftUp() {
HRESULT CAdGame::OnMouseLeftDblClick() {
if (!ValidMouse()) return S_OK;
- if (m_State == GAME_RUNNING && !m_Interactive) return S_OK;
+ if (_state == GAME_RUNNING && !_interactive) return S_OK;
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_LEFT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_LEFT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftDoubleClick"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftDoubleClick"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("LeftDoubleClick");
- } else if (m_State == GAME_RUNNING && m_Scene && m_Scene->PointInViewport(m_MousePos.x, m_MousePos.y)) {
- m_Scene->ApplyEvent("LeftDoubleClick");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("LeftDoubleClick");
+ } else if (_state == GAME_RUNNING && _scene && _scene->PointInViewport(_mousePos.x, _mousePos.y)) {
+ _scene->ApplyEvent("LeftDoubleClick");
}
}
return S_OK;
@@ -2000,23 +2000,23 @@ HRESULT CAdGame::OnMouseLeftDblClick() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::OnMouseRightDown() {
if (!ValidMouse()) return S_OK;
- if (m_State == GAME_RUNNING && !m_Interactive) {
- if (m_TalkSkipButton == TALK_SKIP_RIGHT || m_TalkSkipButton == TALK_SKIP_BOTH) {
+ if (_state == GAME_RUNNING && !_interactive) {
+ if (_talkSkipButton == TALK_SKIP_RIGHT || _talkSkipButton == TALK_SKIP_BOTH) {
FinishSentences();
}
return S_OK;
}
- if ((m_State == GAME_RUNNING && !m_Interactive) || m_StateEx == GAME_WAITING_RESPONSE) return S_OK;
+ if ((_state == GAME_RUNNING && !_interactive) || _stateEx == GAME_WAITING_RESPONSE) return S_OK;
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_RIGHT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_RIGHT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightClick"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightClick"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("RightClick");
- } else if (m_State == GAME_RUNNING && m_Scene && m_Scene->PointInViewport(m_MousePos.x, m_MousePos.y)) {
- m_Scene->ApplyEvent("RightClick");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("RightClick");
+ } else if (_state == GAME_RUNNING && _scene && _scene->PointInViewport(_mousePos.x, _mousePos.y)) {
+ _scene->ApplyEvent("RightClick");
}
}
return S_OK;
@@ -2024,14 +2024,14 @@ HRESULT CAdGame::OnMouseRightDown() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::OnMouseRightUp() {
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_RIGHT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_RIGHT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightRelease"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightRelease"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("RightRelease");
- } else if (m_State == GAME_RUNNING && m_Scene && m_Scene->PointInViewport(m_MousePos.x, m_MousePos.y)) {
- m_Scene->ApplyEvent("RightRelease");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("RightRelease");
+ } else if (_state == GAME_RUNNING && _scene && _scene->PointInViewport(_mousePos.x, _mousePos.y)) {
+ _scene->ApplyEvent("RightRelease");
}
}
return S_OK;
@@ -2040,12 +2040,12 @@ HRESULT CAdGame::OnMouseRightUp() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::DisplayDebugInfo() {
char str[100];
- if (Game->m_DEBUG_DebugMode) {
- sprintf(str, "Mouse: %d, %d (scene: %d, %d)", m_MousePos.x, m_MousePos.y, m_MousePos.x + m_Scene->GetOffsetLeft(), m_MousePos.y + m_Scene->GetOffsetTop());
- m_SystemFont->DrawText((byte *)str, 0, 90, m_Renderer->m_Width, TAL_RIGHT);
+ if (Game->_dEBUG_DebugMode) {
+ sprintf(str, "Mouse: %d, %d (scene: %d, %d)", _mousePos.x, _mousePos.y, _mousePos.x + _scene->GetOffsetLeft(), _mousePos.y + _scene->GetOffsetTop());
+ _systemFont->DrawText((byte *)str, 0, 90, _renderer->_width, TAL_RIGHT);
- sprintf(str, "Scene: %s (prev: %s)", (m_Scene && m_Scene->m_Name) ? m_Scene->m_Name : "???", m_PrevSceneName ? m_PrevSceneName : "???");
- m_SystemFont->DrawText((byte *)str, 0, 110, m_Renderer->m_Width, TAL_RIGHT);
+ sprintf(str, "Scene: %s (prev: %s)", (_scene && _scene->_name) ? _scene->_name : "???", _prevSceneName ? _prevSceneName : "???");
+ _systemFont->DrawText((byte *)str, 0, 110, _renderer->_width, TAL_RIGHT);
}
return CBGame::DisplayDebugInfo();
}
@@ -2053,8 +2053,8 @@ HRESULT CAdGame::DisplayDebugInfo() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::OnScriptShutdown(CScScript *Script) {
- if (m_ResponseBox && m_ResponseBox->m_WaitingScript == Script)
- m_ResponseBox->m_WaitingScript = NULL;
+ if (_responseBox && _responseBox->_waitingScript == Script)
+ _responseBox->_waitingScript = NULL;
return S_OK;
}
diff --git a/engines/wintermute/AdGame.h b/engines/wintermute/AdGame.h
index d879d9e045..fd943f6fcf 100644
--- a/engines/wintermute/AdGame.h
+++ b/engines/wintermute/AdGame.h
@@ -58,31 +58,31 @@ public:
virtual HRESULT InitAfterLoad();
static void AfterLoadScene(void *Scene, void *Data);
- bool m_SmartItemCursor;
+ bool _smartItemCursor;
- CBArray<char *, char *> m_SpeechDirs;
+ CBArray<char *, char *> _speechDirs;
HRESULT AddSpeechDir(const char *Dir);
HRESULT RemoveSpeechDir(char *Dir);
char *FindSpeechFile(char *StringID);
HRESULT DeleteItem(CAdItem *Item);
- char *m_ItemsFile;
- bool m_TempDisableSaveState;
+ char *_itemsFile;
+ bool _tempDisableSaveState;
virtual HRESULT ResetContent();
HRESULT AddItem(CAdItem *Item);
CAdItem *GetItemByName(char *Name);
- CBArray<CAdItem *, CAdItem *> m_Items;
- CAdObject *m_InventoryOwner;
+ CBArray<CAdItem *, CAdItem *> _items;
+ CAdObject *_inventoryOwner;
bool IsItemTaken(char *ItemName);
HRESULT RegisterInventory(CAdInventory *Inv);
HRESULT UnregisterInventory(CAdInventory *Inv);
- CAdObject *m_InvObject;
- CBArray<CAdInventory *, CAdInventory *> m_Inventories;
+ CAdObject *_invObject;
+ CBArray<CAdInventory *, CAdInventory *> _inventories;
virtual HRESULT DisplayContent(bool Update = true, bool DisplayAll = false);
- char *m_DebugStartupScene;
- char *m_StartupScene;
- bool m_InitialScene;
+ char *_debugStartupScene;
+ char *_startupScene;
+ bool _initialScene;
bool GameResponseUsed(int ID);
HRESULT AddGameResponse(int ID);
HRESULT ResetResponse(int ID);
@@ -96,49 +96,49 @@ public:
virtual HRESULT WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScStack *Stack, char *Name);
CAdSceneState *GetSceneState(char *Filename, bool Saving);
- CBViewport *m_SceneViewport;
- int m_TexItemLifeTime;
- int m_TexWalkLifeTime;
- int m_TexStandLifeTime;
- int m_TexTalkLifeTime;
+ CBViewport *_sceneViewport;
+ int _texItemLifeTime;
+ int _texWalkLifeTime;
+ int _texStandLifeTime;
+ int _texTalkLifeTime;
- TTalkSkipButton m_TalkSkipButton;
+ TTalkSkipButton _talkSkipButton;
virtual HRESULT GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byte *ExtMinor);
HRESULT ScheduleChangeScene(char *Filename, bool FadeIn);
- char *m_ScheduledScene;
- bool m_ScheduledFadeIn;
+ char *_scheduledScene;
+ bool _scheduledFadeIn;
void SetPrevSceneName(char *Name);
void SetPrevSceneFilename(char *Name);
- char *m_PrevSceneName;
- char *m_PrevSceneFilename;
+ char *_prevSceneName;
+ char *_prevSceneFilename;
virtual HRESULT LoadGame(char *Filename);
- CAdItem *m_SelectedItem;
+ CAdItem *_selectedItem;
HRESULT Cleanup();
DECLARE_PERSISTENT(CAdGame, CBGame)
void FinishSentences();
HRESULT ShowCursor();
- TGameStateEx m_StateEx;
- CAdResponseBox *m_ResponseBox;
- CAdInventoryBox *m_InventoryBox;
+ TGameStateEx _stateEx;
+ CAdResponseBox *_responseBox;
+ CAdInventoryBox *_inventoryBox;
HRESULT DisplaySentences(bool Frozen);
void AddSentence(CAdSentence *Sentence);
HRESULT ChangeScene(char *Filename, bool FadeIn);
HRESULT RemoveObject(CAdObject *Object);
HRESULT AddObject(CAdObject *Object);
- CAdScene *m_Scene;
+ CAdScene *_scene;
HRESULT InitLoop();
CAdGame();
virtual ~CAdGame();
- CBArray<CAdObject *, CAdObject *> m_Objects;
- CBArray<CAdSentence *, CAdSentence *> m_Sentences;
+ CBArray<CAdObject *, CAdObject *> _objects;
+ CBArray<CAdSentence *, CAdSentence *> _sentences;
- CBArray<CAdSceneState *, CAdSceneState *> m_SceneStates;
- CBArray<char *, char *> m_DlgPendingBranches;
+ CBArray<CAdSceneState *, CAdSceneState *> _sceneStates;
+ CBArray<char *, char *> _dlgPendingBranches;
- CBArray<CAdResponseContext *, CAdResponseContext *> m_ResponsesBranch;
- CBArray<CAdResponseContext *, CAdResponseContext *> m_ResponsesGame;
+ CBArray<CAdResponseContext *, CAdResponseContext *> _responsesBranch;
+ CBArray<CAdResponseContext *, CAdResponseContext *> _responsesGame;
virtual HRESULT LoadFile(const char *Filename);
virtual HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
diff --git a/engines/wintermute/AdInventory.cpp b/engines/wintermute/AdInventory.cpp
index 6723c6fe70..a7024523a8 100644
--- a/engines/wintermute/AdInventory.cpp
+++ b/engines/wintermute/AdInventory.cpp
@@ -38,13 +38,13 @@ IMPLEMENT_PERSISTENT(CAdInventory, false)
//////////////////////////////////////////////////////////////////////////
CAdInventory::CAdInventory(CBGame *inGame): CBObject(inGame) {
- m_ScrollOffset = 0;
+ _scrollOffset = 0;
}
//////////////////////////////////////////////////////////////////////////
CAdInventory::~CAdInventory() {
- m_TakenItems.RemoveAll(); // ref only
+ _takenItems.RemoveAll(); // ref only
}
@@ -56,18 +56,18 @@ HRESULT CAdInventory::InsertItem(char *Name, char *InsertAfter) {
if (item == NULL) return E_FAIL;
int InsertIndex = -1;
- for (int i = 0; i < m_TakenItems.GetSize(); i++) {
- if (scumm_stricmp(m_TakenItems[i]->m_Name, Name) == 0) {
- m_TakenItems.RemoveAt(i);
+ for (int i = 0; i < _takenItems.GetSize(); i++) {
+ if (scumm_stricmp(_takenItems[i]->_name, Name) == 0) {
+ _takenItems.RemoveAt(i);
i--;
continue;
}
- if (InsertAfter && scumm_stricmp(m_TakenItems[i]->m_Name, InsertAfter) == 0) InsertIndex = i + 1;
+ if (InsertAfter && scumm_stricmp(_takenItems[i]->_name, InsertAfter) == 0) InsertIndex = i + 1;
}
- if (InsertIndex == -1) m_TakenItems.Add(item);
- else m_TakenItems.InsertAt(InsertIndex, item);
+ if (InsertIndex == -1) _takenItems.Add(item);
+ else _takenItems.InsertAt(InsertIndex, item);
return S_OK;
}
@@ -77,10 +77,10 @@ HRESULT CAdInventory::InsertItem(char *Name, char *InsertAfter) {
HRESULT CAdInventory::RemoveItem(char *Name) {
if (Name == NULL) return E_FAIL;
- for (int i = 0; i < m_TakenItems.GetSize(); i++) {
- if (scumm_stricmp(m_TakenItems[i]->m_Name, Name) == 0) {
- if (((CAdGame *)Game)->m_SelectedItem == m_TakenItems[i])((CAdGame *)Game)->m_SelectedItem = NULL;
- m_TakenItems.RemoveAt(i);
+ for (int i = 0; i < _takenItems.GetSize(); i++) {
+ if (scumm_stricmp(_takenItems[i]->_name, Name) == 0) {
+ if (((CAdGame *)Game)->_selectedItem == _takenItems[i])((CAdGame *)Game)->_selectedItem = NULL;
+ _takenItems.RemoveAt(i);
return S_OK;
}
}
@@ -94,10 +94,10 @@ HRESULT CAdInventory::RemoveItem(char *Name) {
HRESULT CAdInventory::RemoveItem(CAdItem *Item) {
if (Item == NULL) return E_FAIL;
- for (int i = 0; i < m_TakenItems.GetSize(); i++) {
- if (m_TakenItems[i] == Item) {
- if (((CAdGame *)Game)->m_SelectedItem == m_TakenItems[i])((CAdGame *)Game)->m_SelectedItem = NULL;
- m_TakenItems.RemoveAt(i);
+ for (int i = 0; i < _takenItems.GetSize(); i++) {
+ if (_takenItems[i] == Item) {
+ if (((CAdGame *)Game)->_selectedItem == _takenItems[i])((CAdGame *)Game)->_selectedItem = NULL;
+ _takenItems.RemoveAt(i);
return S_OK;
}
}
@@ -110,8 +110,8 @@ HRESULT CAdInventory::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- m_TakenItems.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_ScrollOffset));
+ _takenItems.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_scrollOffset));
return S_OK;
}
diff --git a/engines/wintermute/AdInventory.h b/engines/wintermute/AdInventory.h
index 828c37e964..159886aa2f 100644
--- a/engines/wintermute/AdInventory.h
+++ b/engines/wintermute/AdInventory.h
@@ -43,8 +43,8 @@ public:
HRESULT InsertItem(char *Name, char *InsertAfter = NULL);
CAdInventory(CBGame *inGame);
virtual ~CAdInventory();
- CBArray<CAdItem *, CAdItem *> m_TakenItems;
- int m_ScrollOffset;
+ CBArray<CAdItem *, CAdItem *> _takenItems;
+ int _scrollOffset;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/AdInventoryBox.cpp b/engines/wintermute/AdInventoryBox.cpp
index 5af10d5f86..5ab011c5dc 100644
--- a/engines/wintermute/AdInventoryBox.cpp
+++ b/engines/wintermute/AdInventoryBox.cpp
@@ -48,28 +48,28 @@ IMPLEMENT_PERSISTENT(CAdInventoryBox, false)
//////////////////////////////////////////////////////////////////////////
CAdInventoryBox::CAdInventoryBox(CBGame *inGame): CBObject(inGame) {
- CBPlatform::SetRectEmpty(&m_ItemsArea);
- m_ScrollOffset = 0;
- m_Spacing = 0;
- m_ItemWidth = m_ItemHeight = 50;
- m_ScrollBy = 1;
+ CBPlatform::SetRectEmpty(&_itemsArea);
+ _scrollOffset = 0;
+ _spacing = 0;
+ _itemWidth = _itemHeight = 50;
+ _scrollBy = 1;
- m_Window = NULL;
- m_CloseButton = NULL;
+ _window = NULL;
+ _closeButton = NULL;
- m_HideSelected = false;
+ _hideSelected = false;
- m_Visible = false;
- m_Exclusive = false;
+ _visible = false;
+ _exclusive = false;
}
//////////////////////////////////////////////////////////////////////////
CAdInventoryBox::~CAdInventoryBox() {
- Game->UnregisterObject(m_Window);
- m_Window = NULL;
+ Game->UnregisterObject(_window);
+ _window = NULL;
- SAFE_DELETE(m_CloseButton);
+ SAFE_DELETE(_closeButton);
}
@@ -77,15 +77,15 @@ CAdInventoryBox::~CAdInventoryBox() {
HRESULT CAdInventoryBox::Listen(CBScriptHolder *param1, uint32 param2) {
CUIObject *obj = (CUIObject *)param1;
- switch (obj->m_Type) {
+ switch (obj->_type) {
case UI_BUTTON:
- if (scumm_stricmp(obj->m_Name, "close") == 0) {
- m_Visible = false;
- } else if (scumm_stricmp(obj->m_Name, "prev") == 0) {
- m_ScrollOffset -= m_ScrollBy;
- m_ScrollOffset = std::max(m_ScrollOffset, 0);
- } else if (scumm_stricmp(obj->m_Name, "next") == 0) {
- m_ScrollOffset += m_ScrollBy;
+ if (scumm_stricmp(obj->_name, "close") == 0) {
+ _visible = false;
+ } else if (scumm_stricmp(obj->_name, "prev") == 0) {
+ _scrollOffset -= _scrollBy;
+ _scrollOffset = std::max(_scrollOffset, 0);
+ } else if (scumm_stricmp(obj->_name, "next") == 0) {
+ _scrollOffset += _scrollBy;
} else return CBObject::Listen(param1, param2);
break;
}
@@ -98,54 +98,54 @@ HRESULT CAdInventoryBox::Listen(CBScriptHolder *param1, uint32 param2) {
HRESULT CAdInventoryBox::Display() {
CAdGame *AdGame = (CAdGame *)Game;
- if (!m_Visible) return S_OK;
+ if (!_visible) return S_OK;
int ItemsX, ItemsY;
- ItemsX = floor((float)((m_ItemsArea.right - m_ItemsArea.left + m_Spacing) / (m_ItemWidth + m_Spacing)));
- ItemsY = floor((float)((m_ItemsArea.bottom - m_ItemsArea.top + m_Spacing) / (m_ItemHeight + m_Spacing)));
+ ItemsX = floor((float)((_itemsArea.right - _itemsArea.left + _spacing) / (_itemWidth + _spacing)));
+ ItemsY = floor((float)((_itemsArea.bottom - _itemsArea.top + _spacing) / (_itemHeight + _spacing)));
- if (m_Window) {
- m_Window->EnableWidget("prev", m_ScrollOffset > 0);
- m_Window->EnableWidget("next", m_ScrollOffset + ItemsX * ItemsY < AdGame->m_InventoryOwner->GetInventory()->m_TakenItems.GetSize());
+ if (_window) {
+ _window->EnableWidget("prev", _scrollOffset > 0);
+ _window->EnableWidget("next", _scrollOffset + ItemsX * ItemsY < AdGame->_inventoryOwner->GetInventory()->_takenItems.GetSize());
}
- if (m_CloseButton) {
- m_CloseButton->m_PosX = m_CloseButton->m_PosY = 0;
- m_CloseButton->m_Width = Game->m_Renderer->m_Width;
- m_CloseButton->m_Height = Game->m_Renderer->m_Height;
+ if (_closeButton) {
+ _closeButton->_posX = _closeButton->_posY = 0;
+ _closeButton->_width = Game->_renderer->_width;
+ _closeButton->_height = Game->_renderer->_height;
- m_CloseButton->Display();
+ _closeButton->Display();
}
// display window
- RECT rect = m_ItemsArea;
- if (m_Window) {
- CBPlatform::OffsetRect(&rect, m_Window->m_PosX, m_Window->m_PosY);
- m_Window->Display();
+ RECT rect = _itemsArea;
+ if (_window) {
+ CBPlatform::OffsetRect(&rect, _window->_posX, _window->_posY);
+ _window->Display();
}
// display items
- if (m_Window && m_Window->m_AlphaColor != 0) Game->m_Renderer->m_ForceAlphaColor = m_Window->m_AlphaColor;
+ if (_window && _window->_alphaColor != 0) Game->_renderer->_forceAlphaColor = _window->_alphaColor;
int yyy = rect.top;
for (int j = 0; j < ItemsY; j++) {
int xxx = rect.left;
for (int i = 0; i < ItemsX; i++) {
- int ItemIndex = m_ScrollOffset + j * ItemsX + i;
- if (ItemIndex >= 0 && ItemIndex < AdGame->m_InventoryOwner->GetInventory()->m_TakenItems.GetSize()) {
- CAdItem *item = AdGame->m_InventoryOwner->GetInventory()->m_TakenItems[ItemIndex];
- if (item != ((CAdGame *)Game)->m_SelectedItem || !m_HideSelected) {
+ int ItemIndex = _scrollOffset + j * ItemsX + i;
+ if (ItemIndex >= 0 && ItemIndex < AdGame->_inventoryOwner->GetInventory()->_takenItems.GetSize()) {
+ CAdItem *item = AdGame->_inventoryOwner->GetInventory()->_takenItems[ItemIndex];
+ if (item != ((CAdGame *)Game)->_selectedItem || !_hideSelected) {
item->Update();
item->Display(xxx, yyy);
}
}
- xxx += (m_ItemWidth + m_Spacing);
+ xxx += (_itemWidth + _spacing);
}
- yyy += (m_ItemHeight + m_Spacing);
+ yyy += (_itemHeight + _spacing);
}
- if (m_Window && m_Window->m_AlphaColor != 0) Game->m_Renderer->m_ForceAlphaColor = 0;
+ if (_window && _window->_alphaColor != 0) Game->_renderer->_forceAlphaColor = 0;
return S_OK;
}
@@ -153,7 +153,7 @@ HRESULT CAdInventoryBox::Display() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdInventoryBox::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdInventoryBox::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -161,8 +161,8 @@ HRESULT CAdInventoryBox::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -213,7 +213,7 @@ HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) {
CBParser parser(Game);
bool always_visible = false;
- m_Exclusive = false;
+ _exclusive = false;
if (Complete) {
if (parser.GetCommand((char **)&Buffer, commands, (char **)&params) != TOKEN_INVENTORY_BOX) {
Game->LOG(0, "'INVENTORY_BOX' keyword expected.");
@@ -237,24 +237,24 @@ HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_WINDOW:
- SAFE_DELETE(m_Window);
- m_Window = new CUIWindow(Game);
- if (!m_Window || FAILED(m_Window->LoadBuffer(params, false))) {
- SAFE_DELETE(m_Window);
+ SAFE_DELETE(_window);
+ _window = new CUIWindow(Game);
+ if (!_window || FAILED(_window->LoadBuffer(params, false))) {
+ SAFE_DELETE(_window);
cmd = PARSERR_GENERIC;
- } else Game->RegisterObject(m_Window);
+ } else Game->RegisterObject(_window);
break;
case TOKEN_AREA:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_ItemsArea.left, &m_ItemsArea.top, &m_ItemsArea.right, &m_ItemsArea.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_itemsArea.left, &_itemsArea.top, &_itemsArea.right, &_itemsArea.bottom);
break;
case TOKEN_EXCLUSIVE:
- parser.ScanStr((char *)params, "%b", &m_Exclusive);
+ parser.ScanStr((char *)params, "%b", &_exclusive);
break;
case TOKEN_HIDE_SELECTED:
- parser.ScanStr((char *)params, "%b", &m_HideSelected);
+ parser.ScanStr((char *)params, "%b", &_hideSelected);
break;
case TOKEN_ALWAYS_VISIBLE:
@@ -262,19 +262,19 @@ HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_SPACING:
- parser.ScanStr((char *)params, "%d", &m_Spacing);
+ parser.ScanStr((char *)params, "%d", &_spacing);
break;
case TOKEN_ITEM_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_ItemWidth);
+ parser.ScanStr((char *)params, "%d", &_itemWidth);
break;
case TOKEN_ITEM_HEIGHT:
- parser.ScanStr((char *)params, "%d", &m_ItemHeight);
+ parser.ScanStr((char *)params, "%d", &_itemHeight);
break;
case TOKEN_SCROLL_BY:
- parser.ScanStr((char *)params, "%d", &m_ScrollBy);
+ parser.ScanStr((char *)params, "%d", &_scrollBy);
break;
case TOKEN_EDITOR_PROPERTY:
@@ -291,22 +291,22 @@ HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) {
return E_FAIL;
}
- if (m_Exclusive) {
- SAFE_DELETE(m_CloseButton);
- m_CloseButton = new CUIButton(Game);
- if (m_CloseButton) {
- m_CloseButton->SetName("close");
- m_CloseButton->SetListener(this, m_CloseButton, 0);
- m_CloseButton->m_Parent = m_Window;
+ if (_exclusive) {
+ SAFE_DELETE(_closeButton);
+ _closeButton = new CUIButton(Game);
+ if (_closeButton) {
+ _closeButton->SetName("close");
+ _closeButton->SetListener(this, _closeButton, 0);
+ _closeButton->_parent = _window;
}
}
- m_Visible = always_visible;
+ _visible = always_visible;
- if (m_Window) {
- for (int i = 0; i < m_Window->m_Widgets.GetSize(); i++) {
- if (!m_Window->m_Widgets[i]->m_ListenerObject)
- m_Window->m_Widgets[i]->SetListener(this, m_Window->m_Widgets[i], 0);
+ if (_window) {
+ for (int i = 0; i < _window->_widgets.GetSize(); i++) {
+ if (!_window->_widgets[i]->_listenerObject)
+ _window->_widgets[i]->SetListener(this, _window->_widgets[i], 0);
}
}
@@ -318,23 +318,23 @@ HRESULT CAdInventoryBox::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "INVENTORY_BOX\n");
Buffer->PutTextIndent(Indent, "{\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
- Buffer->PutTextIndent(Indent + 2, "AREA { %d, %d, %d, %d }\n", m_ItemsArea.left, m_ItemsArea.top, m_ItemsArea.right, m_ItemsArea.bottom);
+ Buffer->PutTextIndent(Indent + 2, "AREA { %d, %d, %d, %d }\n", _itemsArea.left, _itemsArea.top, _itemsArea.right, _itemsArea.bottom);
- Buffer->PutTextIndent(Indent + 2, "EXCLUSIVE=%s\n", m_Exclusive ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "HIDE_SELECTED=%s\n", m_HideSelected ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "ALWAYS_VISIBLE=%s\n", m_Visible ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "SPACING=%d\n", m_Spacing);
- Buffer->PutTextIndent(Indent + 2, "ITEM_WIDTH=%d\n", m_ItemWidth);
- Buffer->PutTextIndent(Indent + 2, "ITEM_HEIGHT=%d\n", m_ItemHeight);
- Buffer->PutTextIndent(Indent + 2, "SCROLL_BY=%d\n", m_ScrollBy);
+ Buffer->PutTextIndent(Indent + 2, "EXCLUSIVE=%s\n", _exclusive ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "HIDE_SELECTED=%s\n", _hideSelected ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "ALWAYS_VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "SPACING=%d\n", _spacing);
+ Buffer->PutTextIndent(Indent + 2, "ITEM_WIDTH=%d\n", _itemWidth);
+ Buffer->PutTextIndent(Indent + 2, "ITEM_HEIGHT=%d\n", _itemHeight);
+ Buffer->PutTextIndent(Indent + 2, "SCROLL_BY=%d\n", _scrollBy);
Buffer->PutTextIndent(Indent + 2, "\n");
// window
- if (m_Window) m_Window->SaveAsText(Buffer, Indent + 2);
+ if (_window) _window->SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent + 2, "\n");
@@ -350,17 +350,17 @@ HRESULT CAdInventoryBox::SaveAsText(CBDynBuffer *Buffer, int Indent) {
HRESULT CAdInventoryBox::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_CloseButton));
- PersistMgr->Transfer(TMEMBER(m_HideSelected));
- PersistMgr->Transfer(TMEMBER(m_ItemHeight));
- PersistMgr->Transfer(TMEMBER(m_ItemsArea));
- PersistMgr->Transfer(TMEMBER(m_ItemWidth));
- PersistMgr->Transfer(TMEMBER(m_ScrollBy));
- PersistMgr->Transfer(TMEMBER(m_ScrollOffset));
- PersistMgr->Transfer(TMEMBER(m_Spacing));
- PersistMgr->Transfer(TMEMBER(m_Visible));
- PersistMgr->Transfer(TMEMBER(m_Window));
- PersistMgr->Transfer(TMEMBER(m_Exclusive));
+ PersistMgr->Transfer(TMEMBER(_closeButton));
+ PersistMgr->Transfer(TMEMBER(_hideSelected));
+ PersistMgr->Transfer(TMEMBER(_itemHeight));
+ PersistMgr->Transfer(TMEMBER(_itemsArea));
+ PersistMgr->Transfer(TMEMBER(_itemWidth));
+ PersistMgr->Transfer(TMEMBER(_scrollBy));
+ PersistMgr->Transfer(TMEMBER(_scrollOffset));
+ PersistMgr->Transfer(TMEMBER(_spacing));
+ PersistMgr->Transfer(TMEMBER(_visible));
+ PersistMgr->Transfer(TMEMBER(_window));
+ PersistMgr->Transfer(TMEMBER(_exclusive));
return S_OK;
}
diff --git a/engines/wintermute/AdInventoryBox.h b/engines/wintermute/AdInventoryBox.h
index 94cb40dbf6..724a6298f4 100644
--- a/engines/wintermute/AdInventoryBox.h
+++ b/engines/wintermute/AdInventoryBox.h
@@ -37,20 +37,20 @@ class CUIWindow;
class CAdInventoryBox : public CBObject {
public:
- bool m_HideSelected;
+ bool _hideSelected;
DECLARE_PERSISTENT(CAdInventoryBox, CBObject)
- bool m_Exclusive;
- int m_ScrollBy;
- int m_ItemHeight;
- int m_ItemWidth;
- bool m_Visible;
+ bool _exclusive;
+ int _scrollBy;
+ int _itemHeight;
+ int _itemWidth;
+ bool _visible;
virtual HRESULT Display();
- CUIButton *m_CloseButton;
- int m_Spacing;
- int m_ScrollOffset;
- RECT m_ItemsArea;
+ CUIButton *_closeButton;
+ int _spacing;
+ int _scrollOffset;
+ RECT _itemsArea;
HRESULT Listen(CBScriptHolder *param1, uint32 param2);
- CUIWindow *m_Window;
+ CUIWindow *_window;
CAdInventoryBox(CBGame *inGame);
virtual ~CAdInventoryBox();
HRESULT LoadFile(char *Filename);
diff --git a/engines/wintermute/AdItem.cpp b/engines/wintermute/AdItem.cpp
index a1cf0d5b01..d4746015d8 100644
--- a/engines/wintermute/AdItem.cpp
+++ b/engines/wintermute/AdItem.cpp
@@ -50,42 +50,42 @@ IMPLEMENT_PERSISTENT(CAdItem, false)
//////////////////////////////////////////////////////////////////////////
CAdItem::CAdItem(CBGame *inGame): CAdTalkHolder(inGame) {
- m_SpriteHover = NULL;
- m_CursorNormal = m_CursorHover = NULL;
+ _spriteHover = NULL;
+ _cursorNormal = _cursorHover = NULL;
- m_CursorCombined = true;
- m_InInventory = false;
+ _cursorCombined = true;
+ _inInventory = false;
- m_DisplayAmount = false;
- m_Amount = 0;
- m_AmountOffsetX = 0;
- m_AmountOffsetY = 0;
- m_AmountAlign = TAL_RIGHT;
- m_AmountString = NULL;
+ _displayAmount = false;
+ _amount = 0;
+ _amountOffsetX = 0;
+ _amountOffsetY = 0;
+ _amountAlign = TAL_RIGHT;
+ _amountString = NULL;
- m_State = STATE_READY;
+ _state = STATE_READY;
- m_Movable = false;
+ _movable = false;
}
//////////////////////////////////////////////////////////////////////////
CAdItem::~CAdItem() {
- delete m_SpriteHover;
- delete m_CursorNormal;
- delete m_CursorHover;
- m_SpriteHover = NULL;
- m_CursorNormal = NULL;
- m_CursorHover = NULL;
-
- delete[] m_AmountString;
- m_AmountString = NULL;
+ delete _spriteHover;
+ delete _cursorNormal;
+ delete _cursorHover;
+ _spriteHover = NULL;
+ _cursorNormal = NULL;
+ _cursorHover = NULL;
+
+ delete[] _amountString;
+ _amountString = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdItem::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdItem::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -93,8 +93,8 @@ HRESULT CAdItem::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -197,86 +197,86 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_IMAGE:
case TOKEN_SPRITE:
- delete m_Sprite;
- m_Sprite = new CBSprite(Game, this);
- if (!m_Sprite || FAILED(m_Sprite->LoadFile((char *)params, ((CAdGame *)Game)->m_TexItemLifeTime))) {
- delete m_Sprite;
+ delete _sprite;
+ _sprite = new CBSprite(Game, this);
+ if (!_sprite || FAILED(_sprite->LoadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
+ delete _sprite;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE_HOVER:
case TOKEN_SPRITE_HOVER:
- delete m_SpriteHover;
- m_SpriteHover = new CBSprite(Game, this);
- if (!m_SpriteHover || FAILED(m_SpriteHover->LoadFile((char *)params, ((CAdGame *)Game)->m_TexItemLifeTime))) {
- delete m_SpriteHover;
+ delete _spriteHover;
+ _spriteHover = new CBSprite(Game, this);
+ if (!_spriteHover || FAILED(_spriteHover->LoadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
+ delete _spriteHover;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_AMOUNT:
- parser.ScanStr((char *)params, "%d", &m_Amount);
+ parser.ScanStr((char *)params, "%d", &_amount);
break;
case TOKEN_DISPLAY_AMOUNT:
- parser.ScanStr((char *)params, "%b", &m_DisplayAmount);
+ parser.ScanStr((char *)params, "%b", &_displayAmount);
break;
case TOKEN_AMOUNT_OFFSET_X:
- parser.ScanStr((char *)params, "%d", &m_AmountOffsetX);
+ parser.ScanStr((char *)params, "%d", &_amountOffsetX);
break;
case TOKEN_AMOUNT_OFFSET_Y:
- parser.ScanStr((char *)params, "%d", &m_AmountOffsetY);
+ parser.ScanStr((char *)params, "%d", &_amountOffsetY);
break;
case TOKEN_AMOUNT_ALIGN:
- if (scumm_stricmp((char *)params, "left") == 0) m_AmountAlign = TAL_LEFT;
- else if (scumm_stricmp((char *)params, "right") == 0) m_AmountAlign = TAL_RIGHT;
- else m_AmountAlign = TAL_CENTER;
+ if (scumm_stricmp((char *)params, "left") == 0) _amountAlign = TAL_LEFT;
+ else if (scumm_stricmp((char *)params, "right") == 0) _amountAlign = TAL_RIGHT;
+ else _amountAlign = TAL_CENTER;
break;
case TOKEN_AMOUNT_STRING:
- CBUtils::SetString(&m_AmountString, (char *)params);
+ CBUtils::SetString(&_amountString, (char *)params);
break;
case TOKEN_TALK: {
CBSprite *spr = new CBSprite(Game, this);
- if (!spr || FAILED(spr->LoadFile((char *)params, ((CAdGame *)Game)->m_TexTalkLifeTime))) cmd = PARSERR_GENERIC;
- else m_TalkSprites.Add(spr);
+ 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)->m_TexTalkLifeTime))) cmd = PARSERR_GENERIC;
- else m_TalkSpritesEx.Add(spr);
+ if (!spr || FAILED(spr->LoadFile((char *)params, ((CAdGame *)Game)->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
+ else _talkSpritesEx.Add(spr);
}
break;
case TOKEN_CURSOR:
- delete m_CursorNormal;
- m_CursorNormal = new CBSprite(Game);
- if (!m_CursorNormal || FAILED(m_CursorNormal->LoadFile((char *)params, ((CAdGame *)Game)->m_TexItemLifeTime))) {
- delete m_CursorNormal;
- m_CursorNormal = NULL;
+ delete _cursorNormal;
+ _cursorNormal = new CBSprite(Game);
+ if (!_cursorNormal || FAILED(_cursorNormal->LoadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
+ delete _cursorNormal;
+ _cursorNormal = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_CURSOR_HOVER:
- delete m_CursorHover;
- m_CursorHover = new CBSprite(Game);
- if (!m_CursorHover || FAILED(m_CursorHover->LoadFile((char *)params, ((CAdGame *)Game)->m_TexItemLifeTime))) {
- delete m_CursorHover;
- m_CursorHover = NULL;
+ delete _cursorHover;
+ _cursorHover = new CBSprite(Game);
+ if (!_cursorHover || FAILED(_cursorHover->LoadFile((char *)params, ((CAdGame *)Game)->_texItemLifeTime))) {
+ delete _cursorHover;
+ _cursorHover = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_CURSOR_COMBINED:
- parser.ScanStr((char *)params, "%b", &m_CursorCombined);
+ parser.ScanStr((char *)params, "%b", &_cursorCombined);
break;
case TOKEN_SCRIPT:
@@ -312,7 +312,7 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
if (alpha != 0 && ar == 0 && ag == 0 && ab == 0) {
ar = ag = ab = 255;
}
- m_AlphaColor = DRGBA(ar, ag, ab, alpha);
+ _alphaColor = DRGBA(ar, ag, ab, alpha);
return S_OK;
}
@@ -320,65 +320,65 @@ HRESULT CAdItem::LoadBuffer(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdItem::Update() {
- m_CurrentSprite = NULL;
+ _currentSprite = NULL;
- if (m_State == STATE_READY && m_AnimSprite) {
- delete m_AnimSprite;
- m_AnimSprite = NULL;
+ if (_state == STATE_READY && _animSprite) {
+ delete _animSprite;
+ _animSprite = NULL;
}
// finished playing animation?
- if (m_State == STATE_PLAYING_ANIM && m_AnimSprite != NULL && m_AnimSprite->m_Finished) {
- m_State = STATE_READY;
- m_CurrentSprite = m_AnimSprite;
+ if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) {
+ _state = STATE_READY;
+ _currentSprite = _animSprite;
}
- if (m_Sentence && m_State != STATE_TALKING) m_Sentence->Finish();
+ if (_sentence && _state != STATE_TALKING) _sentence->Finish();
// default: stand animation
- if (!m_CurrentSprite) m_CurrentSprite = m_Sprite;
+ if (!_currentSprite) _currentSprite = _sprite;
- switch (m_State) {
+ switch (_state) {
//////////////////////////////////////////////////////////////////////////
case STATE_PLAYING_ANIM:
- m_CurrentSprite = m_AnimSprite;
+ _currentSprite = _animSprite;
break;
//////////////////////////////////////////////////////////////////////////
case STATE_READY:
- if (!m_AnimSprite) {
- if (Game->m_ActiveObject == this && m_SpriteHover) m_CurrentSprite = m_SpriteHover;
- else m_CurrentSprite = m_Sprite;
+ if (!_animSprite) {
+ if (Game->_activeObject == this && _spriteHover) _currentSprite = _spriteHover;
+ else _currentSprite = _sprite;
}
break;
//////////////////////////////////////////////////////////////////////////
case STATE_TALKING: {
- m_Sentence->Update();
- if (m_Sentence->m_CurrentSprite) m_TempSprite2 = m_Sentence->m_CurrentSprite;
+ _sentence->Update();
+ if (_sentence->_currentSprite) _tempSprite2 = _sentence->_currentSprite;
- bool TimeIsUp = (m_Sentence->m_Sound && m_Sentence->m_SoundStarted && (!m_Sentence->m_Sound->IsPlaying() && !m_Sentence->m_Sound->IsPaused())) || (!m_Sentence->m_Sound && m_Sentence->m_Duration <= Game->m_Timer - m_Sentence->m_StartTime);
- if (m_TempSprite2 == NULL || m_TempSprite2->m_Finished || (/*m_TempSprite2->m_Looping &&*/ TimeIsUp)) {
+ 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) {
- m_Sentence->Finish();
- m_TempSprite2 = NULL;
- m_State = STATE_READY;
+ _sentence->Finish();
+ _tempSprite2 = NULL;
+ _state = STATE_READY;
} else {
- m_TempSprite2 = GetTalkStance(m_Sentence->GetNextStance());
- if (m_TempSprite2) {
- m_TempSprite2->Reset();
- m_CurrentSprite = m_TempSprite2;
+ _tempSprite2 = GetTalkStance(_sentence->GetNextStance());
+ if (_tempSprite2) {
+ _tempSprite2->Reset();
+ _currentSprite = _tempSprite2;
}
- ((CAdGame *)Game)->AddSentence(m_Sentence);
+ ((CAdGame *)Game)->AddSentence(_sentence);
}
} else {
- m_CurrentSprite = m_TempSprite2;
- ((CAdGame *)Game)->AddSentence(m_Sentence);
+ _currentSprite = _tempSprite2;
+ ((CAdGame *)Game)->AddSentence(_sentence);
}
}
break;
}
- m_Ready = (m_State == STATE_READY);
+ _ready = (_state == STATE_READY);
return S_OK;
}
@@ -387,36 +387,36 @@ HRESULT CAdItem::Update() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdItem::Display(int X, int Y) {
int Width = 0;
- if (m_CurrentSprite) {
+ if (_currentSprite) {
RECT rc;
- m_CurrentSprite->GetBoundingRect(&rc, 0, 0);
+ _currentSprite->GetBoundingRect(&rc, 0, 0);
Width = rc.right - rc.left;
}
- m_PosX = X + Width / 2;
- m_PosY = Y;
+ _posX = X + Width / 2;
+ _posY = Y;
HRESULT ret;
- if (m_CurrentSprite) ret = m_CurrentSprite->Draw(X, Y, this, 100, 100, m_AlphaColor);
+ if (_currentSprite) ret = _currentSprite->Draw(X, Y, this, 100, 100, _alphaColor);
else ret = S_OK;
- if (m_DisplayAmount) {
+ if (_displayAmount) {
int AmountX = X;
- int AmountY = Y + m_AmountOffsetY;
+ int AmountY = Y + _amountOffsetY;
- if (m_AmountAlign == TAL_RIGHT) {
- Width -= m_AmountOffsetX;
- AmountX -= m_AmountOffsetX;
+ if (_amountAlign == TAL_RIGHT) {
+ Width -= _amountOffsetX;
+ AmountX -= _amountOffsetX;
}
- AmountX += m_AmountOffsetX;
+ AmountX += _amountOffsetX;
- CBFont *Font = m_Font ? m_Font : Game->m_SystemFont;
+ CBFont *Font = _font ? _font : Game->_systemFont;
if (Font) {
- if (m_AmountString) Font->DrawText((byte *)m_AmountString, AmountX, AmountY, Width, m_AmountAlign);
+ if (_amountString) Font->DrawText((byte *)_amountString, AmountX, AmountY, Width, _amountAlign);
else {
char Str[256];
- sprintf(Str, "%d", m_Amount);
- Font->DrawText((byte *)Str, AmountX, AmountY, Width, m_AmountAlign);
+ sprintf(Str, "%d", _amount);
+ Font->DrawText((byte *)Str, AmountX, AmountY, Width, _amountAlign);
}
}
}
@@ -436,19 +436,19 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
bool SetCurrent = false;
- if (m_CurrentSprite && m_CurrentSprite == m_SpriteHover) SetCurrent = true;
+ if (_currentSprite && _currentSprite == _spriteHover) SetCurrent = true;
char *Filename = Stack->Pop()->GetString();
- delete m_SpriteHover;
- m_SpriteHover = NULL;
+ delete _spriteHover;
+ _spriteHover = NULL;
CBSprite *spr = new CBSprite(Game, this);
if (!spr || FAILED(spr->LoadFile(Filename))) {
Stack->PushBool(false);
Script->RuntimeError("Item.SetHoverSprite failed for file '%s'", Filename);
} else {
- m_SpriteHover = spr;
- if (SetCurrent) m_CurrentSprite = m_SpriteHover;
+ _spriteHover = spr;
+ if (SetCurrent) _currentSprite = _spriteHover;
Stack->PushBool(true);
}
return S_OK;
@@ -460,8 +460,8 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "GetHoverSprite") == 0) {
Stack->CorrectParams(0);
- if (!m_SpriteHover || !m_SpriteHover->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_SpriteHover->m_Filename);
+ if (!_spriteHover || !_spriteHover->_filename) Stack->PushNULL();
+ else Stack->PushString(_spriteHover->_filename);
return S_OK;
}
@@ -470,8 +470,8 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetHoverSpriteObject") == 0) {
Stack->CorrectParams(0);
- if (!m_SpriteHover) Stack->PushNULL();
- else Stack->PushNative(m_SpriteHover, true);
+ if (!_spriteHover) Stack->PushNULL();
+ else Stack->PushNative(_spriteHover, true);
return S_OK;
}
@@ -483,14 +483,14 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
char *Filename = Stack->Pop()->GetString();
- delete m_CursorNormal;
- m_CursorNormal = NULL;
+ delete _cursorNormal;
+ _cursorNormal = NULL;
CBSprite *spr = new CBSprite(Game);
if (!spr || FAILED(spr->LoadFile(Filename))) {
Stack->PushBool(false);
Script->RuntimeError("Item.SetNormalCursor failed for file '%s'", Filename);
} else {
- m_CursorNormal = spr;
+ _cursorNormal = spr;
Stack->PushBool(true);
}
return S_OK;
@@ -502,8 +502,8 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "GetNormalCursor") == 0) {
Stack->CorrectParams(0);
- if (!m_CursorNormal || !m_CursorNormal->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_CursorNormal->m_Filename);
+ if (!_cursorNormal || !_cursorNormal->_filename) Stack->PushNULL();
+ else Stack->PushString(_cursorNormal->_filename);
return S_OK;
}
@@ -513,8 +513,8 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "GetNormalCursorObject") == 0) {
Stack->CorrectParams(0);
- if (!m_CursorNormal) Stack->PushNULL();
- else Stack->PushNative(m_CursorNormal, true);
+ if (!_cursorNormal) Stack->PushNULL();
+ else Stack->PushNative(_cursorNormal, true);
return S_OK;
}
@@ -526,14 +526,14 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
char *Filename = Stack->Pop()->GetString();
- delete m_CursorHover;
- m_CursorHover = NULL;
+ delete _cursorHover;
+ _cursorHover = NULL;
CBSprite *spr = new CBSprite(Game);
if (!spr || FAILED(spr->LoadFile(Filename))) {
Stack->PushBool(false);
Script->RuntimeError("Item.SetHoverCursor failed for file '%s'", Filename);
} else {
- m_CursorHover = spr;
+ _cursorHover = spr;
Stack->PushBool(true);
}
return S_OK;
@@ -545,8 +545,8 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "GetHoverCursor") == 0) {
Stack->CorrectParams(0);
- if (!m_CursorHover || !m_CursorHover->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_CursorHover->m_Filename);
+ if (!_cursorHover || !_cursorHover->_filename) Stack->PushNULL();
+ else Stack->PushString(_cursorHover->_filename);
return S_OK;
}
@@ -556,8 +556,8 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "GetHoverCursorObject") == 0) {
Stack->CorrectParams(0);
- if (!m_CursorHover) Stack->PushNULL();
- else Stack->PushNative(m_CursorHover, true);
+ if (!_cursorHover) Stack->PushNULL();
+ else Stack->PushNative(_cursorHover, true);
return S_OK;
}
@@ -567,79 +567,79 @@ HRESULT CAdItem::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
CScValue *CAdItem::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("item");
- return m_ScValue;
+ _scValue->SetString("item");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Name") == 0) {
- m_ScValue->SetString(m_Name);
- return m_ScValue;
+ _scValue->SetString(_name);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// DisplayAmount
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DisplayAmount") == 0) {
- m_ScValue->SetBool(m_DisplayAmount);
- return m_ScValue;
+ _scValue->SetBool(_displayAmount);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Amount
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Amount") == 0) {
- m_ScValue->SetInt(m_Amount);
- return m_ScValue;
+ _scValue->SetInt(_amount);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AmountOffsetX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountOffsetX") == 0) {
- m_ScValue->SetInt(m_AmountOffsetX);
- return m_ScValue;
+ _scValue->SetInt(_amountOffsetX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AmountOffsetY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountOffsetY") == 0) {
- m_ScValue->SetInt(m_AmountOffsetY);
- return m_ScValue;
+ _scValue->SetInt(_amountOffsetY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AmountAlign
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountAlign") == 0) {
- m_ScValue->SetInt(m_AmountAlign);
- return m_ScValue;
+ _scValue->SetInt(_amountAlign);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AmountString
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountString") == 0) {
- if (!m_AmountString) m_ScValue->SetNULL();
- else m_ScValue->SetString(m_AmountString);
- return m_ScValue;
+ if (!_amountString) _scValue->SetNULL();
+ else _scValue->SetString(_amountString);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// CursorCombined
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CursorCombined") == 0) {
- m_ScValue->SetBool(m_CursorCombined);
- return m_ScValue;
+ _scValue->SetBool(_cursorCombined);
+ return _scValue;
}
else return CAdTalkHolder::ScGetProperty(Name);
@@ -660,7 +660,7 @@ HRESULT CAdItem::ScSetProperty(char *Name, CScValue *Value) {
// DisplayAmount
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DisplayAmount") == 0) {
- m_DisplayAmount = Value->GetBool();
+ _displayAmount = Value->GetBool();
return S_OK;
}
@@ -668,7 +668,7 @@ HRESULT CAdItem::ScSetProperty(char *Name, CScValue *Value) {
// Amount
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Amount") == 0) {
- m_Amount = Value->GetInt();
+ _amount = Value->GetInt();
return S_OK;
}
@@ -676,7 +676,7 @@ HRESULT CAdItem::ScSetProperty(char *Name, CScValue *Value) {
// AmountOffsetX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountOffsetX") == 0) {
- m_AmountOffsetX = Value->GetInt();
+ _amountOffsetX = Value->GetInt();
return S_OK;
}
@@ -684,7 +684,7 @@ HRESULT CAdItem::ScSetProperty(char *Name, CScValue *Value) {
// AmountOffsetY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountOffsetY") == 0) {
- m_AmountOffsetY = Value->GetInt();
+ _amountOffsetY = Value->GetInt();
return S_OK;
}
@@ -692,7 +692,7 @@ HRESULT CAdItem::ScSetProperty(char *Name, CScValue *Value) {
// AmountAlign
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountAlign") == 0) {
- m_AmountAlign = (TTextAlign)Value->GetInt();
+ _amountAlign = (TTextAlign)Value->GetInt();
return S_OK;
}
@@ -700,8 +700,8 @@ HRESULT CAdItem::ScSetProperty(char *Name, CScValue *Value) {
// AmountString
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountString") == 0) {
- if (Value->IsNULL()) SAFE_DELETE_ARRAY(m_AmountString);
- else CBUtils::SetString(&m_AmountString, Value->GetString());
+ if (Value->IsNULL()) SAFE_DELETE_ARRAY(_amountString);
+ else CBUtils::SetString(&_amountString, Value->GetString());
return S_OK;
}
@@ -709,7 +709,7 @@ HRESULT CAdItem::ScSetProperty(char *Name, CScValue *Value) {
// CursorCombined
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CursorCombined") == 0) {
- m_CursorCombined = Value->GetBool();
+ _cursorCombined = Value->GetBool();
return S_OK;
}
@@ -728,17 +728,17 @@ HRESULT CAdItem::Persist(CBPersistMgr *PersistMgr) {
CAdTalkHolder::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_CursorCombined));
- PersistMgr->Transfer(TMEMBER(m_CursorHover));
- PersistMgr->Transfer(TMEMBER(m_CursorNormal));
- PersistMgr->Transfer(TMEMBER(m_SpriteHover));
- PersistMgr->Transfer(TMEMBER(m_InInventory));
- PersistMgr->Transfer(TMEMBER(m_DisplayAmount));
- PersistMgr->Transfer(TMEMBER(m_Amount));
- PersistMgr->Transfer(TMEMBER(m_AmountOffsetX));
- PersistMgr->Transfer(TMEMBER(m_AmountOffsetY));
- PersistMgr->Transfer(TMEMBER_INT(m_AmountAlign));
- PersistMgr->Transfer(TMEMBER(m_AmountString));
+ PersistMgr->Transfer(TMEMBER(_cursorCombined));
+ PersistMgr->Transfer(TMEMBER(_cursorHover));
+ PersistMgr->Transfer(TMEMBER(_cursorNormal));
+ PersistMgr->Transfer(TMEMBER(_spriteHover));
+ PersistMgr->Transfer(TMEMBER(_inInventory));
+ PersistMgr->Transfer(TMEMBER(_displayAmount));
+ PersistMgr->Transfer(TMEMBER(_amount));
+ PersistMgr->Transfer(TMEMBER(_amountOffsetX));
+ PersistMgr->Transfer(TMEMBER(_amountOffsetY));
+ PersistMgr->Transfer(TMEMBER_INT(_amountAlign));
+ PersistMgr->Transfer(TMEMBER(_amountString));
return S_OK;
}
diff --git a/engines/wintermute/AdItem.h b/engines/wintermute/AdItem.h
index 8bb9cd46a0..c5144eff12 100644
--- a/engines/wintermute/AdItem.h
+++ b/engines/wintermute/AdItem.h
@@ -26,8 +26,8 @@
* Copyright (c) 2011 Jan Nedoma
*/
-#ifndef __WmeAdItem_H__
-#define __WmeAdItem_H__
+#ifndef __WmeAdIte_h__
+#define __WmeAdIte_h__
#include "AdTalkHolder.h"
@@ -36,23 +36,23 @@ namespace WinterMute {
class CAdItem : public CAdTalkHolder {
public:
- bool m_DisplayAmount;
- int m_Amount;
- int m_AmountOffsetX;
- int m_AmountOffsetY;
- TTextAlign m_AmountAlign;
- char *m_AmountString;
+ bool _displayAmount;
+ int _amount;
+ int _amountOffsetX;
+ int _amountOffsetY;
+ TTextAlign _amountAlign;
+ char *_amountString;
HRESULT Update();
DECLARE_PERSISTENT(CAdItem, CAdTalkHolder)
HRESULT Display(int X, int Y);
bool GetExtendedFlag(char *FlagName);
- bool m_InInventory;
- bool m_CursorCombined;
- CBSprite *m_SpriteHover;
- CBSprite *m_CursorNormal;
- CBSprite *m_CursorHover;
+ bool _inInventory;
+ bool _cursorCombined;
+ CBSprite *_spriteHover;
+ CBSprite *_cursorNormal;
+ CBSprite *_cursorHover;
CAdItem(CBGame *inGame);
virtual ~CAdItem();
HRESULT LoadFile(char *Filename);
diff --git a/engines/wintermute/AdLayer.cpp b/engines/wintermute/AdLayer.cpp
index 6e55a24161..ea87cd3727 100644
--- a/engines/wintermute/AdLayer.cpp
+++ b/engines/wintermute/AdLayer.cpp
@@ -45,24 +45,24 @@ IMPLEMENT_PERSISTENT(CAdLayer, false)
//////////////////////////////////////////////////////////////////////////
CAdLayer::CAdLayer(CBGame *inGame): CBObject(inGame) {
- m_Main = false;
- m_Width = m_Height = 0;
- m_Active = true;
- m_CloseUp = false;
+ _main = false;
+ _width = _height = 0;
+ _active = true;
+ _closeUp = false;
}
//////////////////////////////////////////////////////////////////////////
CAdLayer::~CAdLayer() {
- for (int i = 0; i < m_Nodes.GetSize(); i++)
- delete m_Nodes[i];
- m_Nodes.RemoveAll();
+ for (int i = 0; i < _nodes.GetSize(); i++)
+ delete _nodes[i];
+ _nodes.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdLayer::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdLayer::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -70,8 +70,8 @@ HRESULT CAdLayer::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -146,23 +146,23 @@ HRESULT CAdLayer::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_MAIN:
- parser.ScanStr((char *)params, "%b", &m_Main);
+ parser.ScanStr((char *)params, "%b", &_main);
break;
case TOKEN_CLOSE_UP:
- parser.ScanStr((char *)params, "%b", &m_CloseUp);
+ parser.ScanStr((char *)params, "%b", &_closeUp);
break;
case TOKEN_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_Width);
+ parser.ScanStr((char *)params, "%d", &_width);
break;
case TOKEN_HEIGHT:
- parser.ScanStr((char *)params, "%d", &m_Height);
+ parser.ScanStr((char *)params, "%d", &_height);
break;
case TOKEN_ACTIVE:
- parser.ScanStr((char *)params, "%b", &m_Active);
+ parser.ScanStr((char *)params, "%b", &_active);
break;
case TOKEN_REGION: {
@@ -176,7 +176,7 @@ HRESULT CAdLayer::LoadBuffer(byte *Buffer, bool Complete) {
node = NULL;
} else {
node->SetRegion(region);
- m_Nodes.Add(node);
+ _nodes.Add(node);
}
}
break;
@@ -184,7 +184,7 @@ HRESULT CAdLayer::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_ENTITY: {
CAdEntity *entity = new CAdEntity(Game);
CAdSceneNode *node = new CAdSceneNode(Game);
- if (entity) entity->m_Zoomable = false; // scene entites default to NOT zoom
+ if (entity) entity->_zoomable = false; // scene entites default to NOT zoom
if (!entity || !node || FAILED(entity->LoadBuffer(params, false))) {
cmd = PARSERR_GENERIC;
delete entity;
@@ -193,13 +193,13 @@ HRESULT CAdLayer::LoadBuffer(byte *Buffer, bool Complete) {
node = NULL;
} else {
node->SetEntity(entity);
- m_Nodes.Add(node);
+ _nodes.Add(node);
}
}
break;
case TOKEN_EDITOR_SELECTED:
- parser.ScanStr((char *)params, "%b", &m_EditorSelected);
+ parser.ScanStr((char *)params, "%b", &_editorSelected);
break;
case TOKEN_SCRIPT:
@@ -236,25 +236,25 @@ HRESULT CAdLayer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CScValue *val = Stack->Pop();
int node = -1;
- if (val->m_Type == VAL_INT) node = val->GetInt();
+ if (val->_type == VAL_INT) node = val->GetInt();
else { // get by name
- for (int i = 0; i < m_Nodes.GetSize(); i++) {
- if ((m_Nodes[i]->m_Type == OBJECT_ENTITY && scumm_stricmp(m_Nodes[i]->m_Entity->m_Name, val->GetString()) == 0) ||
- (m_Nodes[i]->m_Type == OBJECT_REGION && scumm_stricmp(m_Nodes[i]->m_Region->m_Name, val->GetString()) == 0)) {
+ for (int i = 0; i < _nodes.GetSize(); i++) {
+ if ((_nodes[i]->_type == OBJECT_ENTITY && scumm_stricmp(_nodes[i]->_entity->_name, val->GetString()) == 0) ||
+ (_nodes[i]->_type == OBJECT_REGION && scumm_stricmp(_nodes[i]->_region->_name, val->GetString()) == 0)) {
node = i;
break;
}
}
}
- if (node < 0 || node >= m_Nodes.GetSize()) Stack->PushNULL();
+ if (node < 0 || node >= _nodes.GetSize()) Stack->PushNULL();
else {
- switch (m_Nodes[node]->m_Type) {
+ switch (_nodes[node]->_type) {
case OBJECT_ENTITY:
- Stack->PushNative(m_Nodes[node]->m_Entity, true);
+ Stack->PushNative(_nodes[node]->_entity, true);
break;
case OBJECT_REGION:
- Stack->PushNative(m_Nodes[node]->m_Region, true);
+ Stack->PushNative(_nodes[node]->_region, true);
break;
default:
Stack->PushNULL();
@@ -282,7 +282,7 @@ HRESULT CAdLayer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
Node->SetEntity(Entity);
Stack->PushNative(Entity, true);
}
- m_Nodes.Add(Node);
+ _nodes.Add(Node);
return S_OK;
}
@@ -307,8 +307,8 @@ HRESULT CAdLayer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
Stack->PushNative(Entity, true);
}
if (Index < 0) Index = 0;
- if (Index <= m_Nodes.GetSize() - 1) m_Nodes.InsertAt(Index, Node);
- else m_Nodes.Add(Node);
+ if (Index <= _nodes.GetSize() - 1) _nodes.InsertAt(Index, Node);
+ else _nodes.Add(Node);
return S_OK;
}
@@ -323,16 +323,16 @@ HRESULT CAdLayer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CAdSceneNode *ToDelete = NULL;
if (Val->IsNative()) {
CBScriptable *Temp = Val->GetNative();
- for (int i = 0; i < m_Nodes.GetSize(); i++) {
- if (m_Nodes[i]->m_Region == Temp || m_Nodes[i]->m_Entity == Temp) {
- ToDelete = m_Nodes[i];
+ for (int i = 0; i < _nodes.GetSize(); i++) {
+ if (_nodes[i]->_region == Temp || _nodes[i]->_entity == Temp) {
+ ToDelete = _nodes[i];
break;
}
}
} else {
int Index = Val->GetInt();
- if (Index >= 0 && Index < m_Nodes.GetSize()) {
- ToDelete = m_Nodes[Index];
+ if (Index >= 0 && Index < _nodes.GetSize()) {
+ ToDelete = _nodes[Index];
}
}
if (ToDelete == NULL) {
@@ -340,11 +340,11 @@ HRESULT CAdLayer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
return S_OK;
}
- for (int i = 0; i < m_Nodes.GetSize(); i++) {
- if (m_Nodes[i] == ToDelete) {
- delete m_Nodes[i];
- m_Nodes[i] = NULL;
- m_Nodes.RemoveAt(i);
+ for (int i = 0; i < _nodes.GetSize(); i++) {
+ if (_nodes[i] == ToDelete) {
+ delete _nodes[i];
+ _nodes[i] = NULL;
+ _nodes.RemoveAt(i);
break;
}
}
@@ -358,62 +358,62 @@ HRESULT CAdLayer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
CScValue *CAdLayer::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("layer");
- return m_ScValue;
+ _scValue->SetString("layer");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumNodes (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumNodes") == 0) {
- m_ScValue->SetInt(m_Nodes.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_nodes.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Width") == 0) {
- m_ScValue->SetInt(m_Width);
- return m_ScValue;
+ _scValue->SetInt(_width);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Height") == 0) {
- m_ScValue->SetInt(m_Height);
- return m_ScValue;
+ _scValue->SetInt(_height);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Main (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Main") == 0) {
- m_ScValue->SetBool(m_Main);
- return m_ScValue;
+ _scValue->SetBool(_main);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// CloseUp
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CloseUp") == 0) {
- m_ScValue->SetBool(m_CloseUp);
- return m_ScValue;
+ _scValue->SetBool(_closeUp);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Active") == 0) {
- m_ScValue->SetBool(m_Active);
- return m_ScValue;
+ _scValue->SetBool(_active);
+ return _scValue;
}
else return CBObject::ScGetProperty(Name);
@@ -434,7 +434,7 @@ HRESULT CAdLayer::ScSetProperty(char *Name, CScValue *Value) {
// CloseUp
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CloseUp") == 0) {
- m_CloseUp = Value->GetBool();
+ _closeUp = Value->GetBool();
return S_OK;
}
@@ -442,8 +442,8 @@ HRESULT CAdLayer::ScSetProperty(char *Name, CScValue *Value) {
// Width
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Width") == 0) {
- m_Width = Value->GetInt();
- if (m_Width < 0) m_Width = 0;
+ _width = Value->GetInt();
+ if (_width < 0) _width = 0;
return S_OK;
}
@@ -451,8 +451,8 @@ HRESULT CAdLayer::ScSetProperty(char *Name, CScValue *Value) {
// Height
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Height") == 0) {
- m_Height = Value->GetInt();
- if (m_Height < 0) m_Height = 0;
+ _height = Value->GetInt();
+ if (_height < 0) _height = 0;
return S_OK;
}
@@ -461,9 +461,9 @@ HRESULT CAdLayer::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Active") == 0) {
bool b = Value->GetBool();
- if (b == false && m_Main) {
+ if (b == false && _main) {
Game->LOG(0, "Warning: cannot deactivate scene's main layer");
- } else m_Active = b;
+ } else _active = b;
return S_OK;
}
@@ -480,31 +480,31 @@ char *CAdLayer::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdLayer::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "LAYER {\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
- Buffer->PutTextIndent(Indent + 2, "MAIN=%s\n", m_Main ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", m_Width);
- Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", m_Height);
- Buffer->PutTextIndent(Indent + 2, "ACTIVE=%s\n", m_Active ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", m_EditorSelected ? "TRUE" : "FALSE");
- if (m_CloseUp)
- Buffer->PutTextIndent(Indent + 2, "CLOSE_UP=%s\n", m_CloseUp ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "MAIN=%s\n", _main ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", _width);
+ Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
+ Buffer->PutTextIndent(Indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
+ if (_closeUp)
+ Buffer->PutTextIndent(Indent + 2, "CLOSE_UP=%s\n", _closeUp ? "TRUE" : "FALSE");
int i;
- for (i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- if (m_ScProp) m_ScProp->SaveAsText(Buffer, Indent + 2);
+ if (_scProp) _scProp->SaveAsText(Buffer, Indent + 2);
- for (i = 0; i < m_Nodes.GetSize(); i++) {
- switch (m_Nodes[i]->m_Type) {
+ for (i = 0; i < _nodes.GetSize(); i++) {
+ switch (_nodes[i]->_type) {
case OBJECT_ENTITY:
- m_Nodes[i]->m_Entity->SaveAsText(Buffer, Indent + 2);
+ _nodes[i]->_entity->SaveAsText(Buffer, Indent + 2);
break;
case OBJECT_REGION:
- m_Nodes[i]->m_Region->SaveAsText(Buffer, Indent + 2);
+ _nodes[i]->_region->SaveAsText(Buffer, Indent + 2);
break;
}
}
@@ -522,12 +522,12 @@ HRESULT CAdLayer::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Active));
- PersistMgr->Transfer(TMEMBER(m_CloseUp));
- PersistMgr->Transfer(TMEMBER(m_Height));
- PersistMgr->Transfer(TMEMBER(m_Main));
- m_Nodes.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Width));
+ PersistMgr->Transfer(TMEMBER(_active));
+ PersistMgr->Transfer(TMEMBER(_closeUp));
+ PersistMgr->Transfer(TMEMBER(_height));
+ PersistMgr->Transfer(TMEMBER(_main));
+ _nodes.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_width));
return S_OK;
}
diff --git a/engines/wintermute/AdLayer.h b/engines/wintermute/AdLayer.h
index eda3e6f272..ad24759fa9 100644
--- a/engines/wintermute/AdLayer.h
+++ b/engines/wintermute/AdLayer.h
@@ -33,15 +33,15 @@ namespace WinterMute {
class CAdSceneNode;
class CAdLayer : public CBObject {
public:
- bool m_CloseUp;
+ bool _closeUp;
DECLARE_PERSISTENT(CAdLayer, CBObject)
- bool m_Active;
- int m_Height;
- int m_Width;
- bool m_Main;
+ bool _active;
+ int _height;
+ int _width;
+ bool _main;
CAdLayer(CBGame *inGame);
virtual ~CAdLayer();
- CBArray<CAdSceneNode *, CAdSceneNode *> m_Nodes;
+ CBArray<CAdSceneNode *, CAdSceneNode *> _nodes;
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/AdNodeState.cpp b/engines/wintermute/AdNodeState.cpp
index da2f4a39b9..5df3aa8b17 100644
--- a/engines/wintermute/AdNodeState.cpp
+++ b/engines/wintermute/AdNodeState.cpp
@@ -43,51 +43,51 @@ IMPLEMENT_PERSISTENT(CAdNodeState, false)
//////////////////////////////////////////////////////////////////////////
CAdNodeState::CAdNodeState(CBGame *inGame): CBBase(inGame) {
- m_Name = NULL;
- m_Active = false;
- for (int i = 0; i < 7; i++) m_Caption[i] = NULL;
- m_AlphaColor = 0;
- m_Filename = NULL;
- m_Cursor = NULL;
+ _name = NULL;
+ _active = false;
+ for (int i = 0; i < 7; i++) _caption[i] = NULL;
+ _alphaColor = 0;
+ _filename = NULL;
+ _cursor = NULL;
}
//////////////////////////////////////////////////////////////////////////
CAdNodeState::~CAdNodeState() {
- delete[] m_Name;
- delete[] m_Filename;
- delete[] m_Cursor;
- m_Name = NULL;
- m_Filename = NULL;
- m_Cursor = NULL;
+ delete[] _name;
+ delete[] _filename;
+ delete[] _cursor;
+ _name = NULL;
+ _filename = NULL;
+ _cursor = NULL;
for (int i = 0; i < 7; i++) {
- delete[] m_Caption[i];
- m_Caption[i] = NULL;
+ delete[] _caption[i];
+ _caption[i] = NULL;
}
}
//////////////////////////////////////////////////////////////////////////
void CAdNodeState::SetName(char *Name) {
- delete[] m_Name;
- m_Name = NULL;
- CBUtils::SetString(&m_Name, Name);
+ delete[] _name;
+ _name = NULL;
+ CBUtils::SetString(&_name, Name);
}
//////////////////////////////////////////////////////////////////////////
void CAdNodeState::SetFilename(char *Filename) {
- delete[] m_Filename;
- m_Filename = NULL;
- CBUtils::SetString(&m_Filename, Filename);
+ delete[] _filename;
+ _filename = NULL;
+ CBUtils::SetString(&_filename, Filename);
}
//////////////////////////////////////////////////////////////////////////
void CAdNodeState::SetCursor(char *Filename) {
- delete[] m_Cursor;
- m_Cursor = NULL;
- CBUtils::SetString(&m_Cursor, Filename);
+ delete[] _cursor;
+ _cursor = NULL;
+ CBUtils::SetString(&_cursor, Filename);
}
@@ -95,12 +95,12 @@ void CAdNodeState::SetCursor(char *Filename) {
HRESULT CAdNodeState::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_Active));
- PersistMgr->Transfer(TMEMBER(m_Name));
- PersistMgr->Transfer(TMEMBER(m_Filename));
- PersistMgr->Transfer(TMEMBER(m_Cursor));
- PersistMgr->Transfer(TMEMBER(m_AlphaColor));
- for (int i = 0; i < 7; i++) PersistMgr->Transfer(TMEMBER(m_Caption[i]));
+ PersistMgr->Transfer(TMEMBER(_active));
+ PersistMgr->Transfer(TMEMBER(_name));
+ PersistMgr->Transfer(TMEMBER(_filename));
+ PersistMgr->Transfer(TMEMBER(_cursor));
+ PersistMgr->Transfer(TMEMBER(_alphaColor));
+ for (int i = 0; i < 7; i++) PersistMgr->Transfer(TMEMBER(_caption[i]));
return S_OK;
}
@@ -111,11 +111,11 @@ void CAdNodeState::SetCaption(char *Caption, int Case) {
if (Case == 0) Case = 1;
if (Case < 1 || Case > 7) return;
- delete[] m_Caption[Case - 1];
- m_Caption[Case - 1] = new char[strlen(Caption) + 1];
- if (m_Caption[Case - 1]) {
- strcpy(m_Caption[Case - 1], Caption);
- Game->m_StringTable->Expand(&m_Caption[Case - 1]);
+ delete[] _caption[Case - 1];
+ _caption[Case - 1] = new char[strlen(Caption) + 1];
+ if (_caption[Case - 1]) {
+ strcpy(_caption[Case - 1], Caption);
+ Game->_stringTable->Expand(&_caption[Case - 1]);
}
}
@@ -123,8 +123,8 @@ void CAdNodeState::SetCaption(char *Caption, int Case) {
//////////////////////////////////////////////////////////////////////////
char *CAdNodeState::GetCaption(int Case) {
if (Case == 0) Case = 1;
- if (Case < 1 || Case > 7 || m_Caption[Case - 1] == NULL) return "";
- else return m_Caption[Case - 1];
+ if (Case < 1 || Case > 7 || _caption[Case - 1] == NULL) return "";
+ else return _caption[Case - 1];
}
@@ -137,30 +137,30 @@ HRESULT CAdNodeState::TransferEntity(CAdEntity *Entity, bool IncludingSprites, b
if (Saving) {
for (int i = 0; i < 7; i++) {
- if (Entity->m_Caption[i]) SetCaption(Entity->m_Caption[i], i);
+ if (Entity->_caption[i]) SetCaption(Entity->_caption[i], i);
}
- if (!Entity->m_Region && Entity->m_Sprite && Entity->m_Sprite->m_Filename) {
- if (IncludingSprites) SetFilename(Entity->m_Sprite->m_Filename);
+ if (!Entity->_region && Entity->_sprite && Entity->_sprite->_filename) {
+ if (IncludingSprites) SetFilename(Entity->_sprite->_filename);
else SetFilename("");
}
- if (Entity->m_Cursor && Entity->m_Cursor->m_Filename) SetCursor(Entity->m_Cursor->m_Filename);
- m_AlphaColor = Entity->m_AlphaColor;
- m_Active = Entity->m_Active;
+ if (Entity->_cursor && Entity->_cursor->_filename) SetCursor(Entity->_cursor->_filename);
+ _alphaColor = Entity->_alphaColor;
+ _active = Entity->_active;
} else {
for (int i = 0; i < 7; i++) {
- if (m_Caption[i]) Entity->SetCaption(m_Caption[i], i);
+ if (_caption[i]) Entity->SetCaption(_caption[i], i);
}
- if (m_Filename && !Entity->m_Region && IncludingSprites && strcmp(m_Filename, "") != 0) {
- if (!Entity->m_Sprite || !Entity->m_Sprite->m_Filename || scumm_stricmp(Entity->m_Sprite->m_Filename, m_Filename) != 0)
- Entity->SetSprite(m_Filename);
+ if (_filename && !Entity->_region && IncludingSprites && strcmp(_filename, "") != 0) {
+ if (!Entity->_sprite || !Entity->_sprite->_filename || scumm_stricmp(Entity->_sprite->_filename, _filename) != 0)
+ Entity->SetSprite(_filename);
}
- if (m_Cursor) {
- if (!Entity->m_Cursor || !Entity->m_Cursor->m_Filename || scumm_stricmp(Entity->m_Cursor->m_Filename, m_Cursor) != 0)
- Entity->SetCursor(m_Cursor);
+ if (_cursor) {
+ if (!Entity->_cursor || !Entity->_cursor->_filename || scumm_stricmp(Entity->_cursor->_filename, _cursor) != 0)
+ Entity->SetCursor(_cursor);
}
- Entity->m_Active = m_Active;
- Entity->m_AlphaColor = m_AlphaColor;
+ Entity->_active = _active;
+ Entity->_alphaColor = _alphaColor;
}
return S_OK;
diff --git a/engines/wintermute/AdNodeState.h b/engines/wintermute/AdNodeState.h
index 722d880c33..4c5b87fb89 100644
--- a/engines/wintermute/AdNodeState.h
+++ b/engines/wintermute/AdNodeState.h
@@ -42,14 +42,14 @@ public:
DECLARE_PERSISTENT(CAdNodeState, CBBase)
CAdNodeState(CBGame *inGame);
virtual ~CAdNodeState();
- char *m_Name;
- bool m_Active;
- char *m_Caption[7];
+ char *_name;
+ bool _active;
+ char *_caption[7];
void SetCaption(char *Caption, int Case);
char *GetCaption(int Case);
- uint32 m_AlphaColor;
- char *m_Filename;
- char *m_Cursor;
+ uint32 _alphaColor;
+ char *_filename;
+ char *_cursor;
};
diff --git a/engines/wintermute/AdObject.cpp b/engines/wintermute/AdObject.cpp
index 6e59b9b45c..95b48b8401 100644
--- a/engines/wintermute/AdObject.cpp
+++ b/engines/wintermute/AdObject.cpp
@@ -58,107 +58,107 @@ IMPLEMENT_PERSISTENT(CAdObject, false)
//////////////////////////////////////////////////////////////////////////
CAdObject::CAdObject(CBGame *inGame): CBObject(inGame) {
- m_Type = OBJECT_NONE;
- m_State = m_NextState = STATE_NONE;
+ _type = OBJECT_NONE;
+ _state = _nextState = STATE_NONE;
- m_Active = true;
- m_Drawn = false;
+ _active = true;
+ _drawn = false;
- m_CurrentSprite = NULL;
- m_AnimSprite = NULL;
- m_TempSprite2 = NULL;
+ _currentSprite = NULL;
+ _animSprite = NULL;
+ _tempSprite2 = NULL;
- m_Font = NULL;
+ _font = NULL;
- m_Sentence = NULL;
+ _sentence = NULL;
- m_ForcedTalkAnimName = NULL;
- m_ForcedTalkAnimUsed = false;
+ _forcedTalkAnimName = NULL;
+ _forcedTalkAnimUsed = false;
- m_BlockRegion = NULL;
- m_WptGroup = NULL;
+ _blockRegion = NULL;
+ _wptGroup = NULL;
- m_CurrentBlockRegion = NULL;
- m_CurrentWptGroup = NULL;
+ _currentBlockRegion = NULL;
+ _currentWptGroup = NULL;
- m_IgnoreItems = false;
- m_SceneIndependent = false;
+ _ignoreItems = false;
+ _sceneIndependent = false;
- m_StickRegion = NULL;
+ _stickRegion = NULL;
- m_SubtitlesModRelative = true;
- m_SubtitlesModX = 0;
- m_SubtitlesModY = 0;
- m_SubtitlesWidth = 0;
- m_SubtitlesModXCenter = true;
+ _subtitlesModRelative = true;
+ _subtitlesModX = 0;
+ _subtitlesModY = 0;
+ _subtitlesWidth = 0;
+ _subtitlesModXCenter = true;
- m_Inventory = NULL;
+ _inventory = NULL;
- for (int i = 0; i < MAX_NUM_REGIONS; i++) m_CurrentRegions[i] = NULL;
+ for (int i = 0; i < MAX_NUM_REGIONS; i++) _currentRegions[i] = NULL;
- m_PartEmitter = NULL;
- m_PartFollowParent = false;
- m_PartOffsetX = m_PartOffsetY = 0;
+ _partEmitter = NULL;
+ _partFollowParent = false;
+ _partOffsetX = _partOffsetY = 0;
- m_RegisterAlias = this;
+ _registerAlias = this;
}
//////////////////////////////////////////////////////////////////////////
CAdObject::~CAdObject() {
- m_CurrentSprite = NULL; // reference only, don't delete
- SAFE_DELETE(m_AnimSprite);
- SAFE_DELETE(m_Sentence);
- SAFE_DELETE_ARRAY(m_ForcedTalkAnimName);
+ _currentSprite = NULL; // reference only, don't delete
+ SAFE_DELETE(_animSprite);
+ SAFE_DELETE(_sentence);
+ SAFE_DELETE_ARRAY(_forcedTalkAnimName);
- SAFE_DELETE(m_BlockRegion);
- SAFE_DELETE(m_WptGroup);
+ SAFE_DELETE(_blockRegion);
+ SAFE_DELETE(_wptGroup);
- SAFE_DELETE(m_CurrentBlockRegion);
- SAFE_DELETE(m_CurrentWptGroup);
+ SAFE_DELETE(_currentBlockRegion);
+ SAFE_DELETE(_currentWptGroup);
- m_TempSprite2 = NULL; // reference only
- m_StickRegion = NULL;
+ _tempSprite2 = NULL; // reference only
+ _stickRegion = NULL;
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
+ if (_font) Game->_fontStorage->RemoveFont(_font);
- if (m_Inventory) {
- ((CAdGame *)Game)->UnregisterInventory(m_Inventory);
- m_Inventory = NULL;
+ if (_inventory) {
+ ((CAdGame *)Game)->UnregisterInventory(_inventory);
+ _inventory = NULL;
}
- if (m_PartEmitter)
- Game->UnregisterObject(m_PartEmitter);
+ if (_partEmitter)
+ Game->UnregisterObject(_partEmitter);
- for (int i = 0; i < m_AttachmentsPre.GetSize(); i++) {
- Game->UnregisterObject(m_AttachmentsPre[i]);
+ for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
+ Game->UnregisterObject(_attachmentsPre[i]);
}
- m_AttachmentsPre.RemoveAll();
+ _attachmentsPre.RemoveAll();
- for (int i = 0; i < m_AttachmentsPost.GetSize(); i++) {
- Game->UnregisterObject(m_AttachmentsPost[i]);
+ for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
+ Game->UnregisterObject(_attachmentsPost[i]);
}
- m_AttachmentsPost.RemoveAll();
+ _attachmentsPost.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::PlayAnim(char *Filename) {
- SAFE_DELETE(m_AnimSprite);
- m_AnimSprite = new CBSprite(Game, this);
- if (!m_AnimSprite) {
- Game->LOG(0, "CAdObject::PlayAnim: error creating temp sprite (object:\"%s\" sprite:\"%s\")", m_Name, Filename);
+ SAFE_DELETE(_animSprite);
+ _animSprite = new CBSprite(Game, this);
+ if (!_animSprite) {
+ Game->LOG(0, "CAdObject::PlayAnim: error creating temp sprite (object:\"%s\" sprite:\"%s\")", _name, Filename);
return E_FAIL;
}
- HRESULT res = m_AnimSprite->LoadFile(Filename);
+ HRESULT res = _animSprite->LoadFile(Filename);
if (FAILED(res)) {
- Game->LOG(res, "CAdObject::PlayAnim: error loading temp sprite (object:\"%s\" sprite:\"%s\")", m_Name, Filename);
- SAFE_DELETE(m_AnimSprite);
+ Game->LOG(res, "CAdObject::PlayAnim: error loading temp sprite (object:\"%s\" sprite:\"%s\")", _name, Filename);
+ SAFE_DELETE(_animSprite);
return res;
}
- m_State = STATE_PLAYING_ANIM;
+ _state = STATE_PLAYING_ANIM;
return S_OK;
}
@@ -209,7 +209,7 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IsTalking") == 0) {
Stack->CorrectParams(0);
- Stack->PushBool(m_State == STATE_TALKING);
+ Stack->PushBool(_state == STATE_TALKING);
return S_OK;
}
@@ -218,10 +218,10 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "StopTalk") == 0 || strcmp(Name, "StopTalking") == 0) {
Stack->CorrectParams(0);
- if (m_Sentence) m_Sentence->Finish();
- if (m_State == STATE_TALKING) {
- m_State = m_NextState;
- m_NextState = STATE_READY;
+ if (_sentence) _sentence->Finish();
+ if (_state == STATE_TALKING) {
+ _state = _nextState;
+ _nextState = STATE_READY;
Stack->PushBool(true);
} else Stack->PushBool(false);
return S_OK;
@@ -233,10 +233,10 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "ForceTalkAnim") == 0) {
Stack->CorrectParams(1);
char *AnimName = Stack->Pop()->GetString();
- SAFE_DELETE_ARRAY(m_ForcedTalkAnimName);
- m_ForcedTalkAnimName = new char[strlen(AnimName) + 1];
- strcpy(m_ForcedTalkAnimName, AnimName);
- m_ForcedTalkAnimUsed = false;
+ SAFE_DELETE_ARRAY(_forcedTalkAnimName);
+ _forcedTalkAnimName = new char[strlen(AnimName) + 1];
+ strcpy(_forcedTalkAnimName, AnimName);
+ _forcedTalkAnimUsed = false;
Stack->PushBool(true);
return S_OK;
}
@@ -277,19 +277,19 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "StickToRegion") == 0) {
Stack->CorrectParams(1);
- CAdLayer *Main = ((CAdGame *)Game)->m_Scene->m_MainLayer;
+ CAdLayer *Main = ((CAdGame *)Game)->_scene->_mainLayer;
bool RegFound = false;
int i;
CScValue *Val = Stack->Pop();
if (Val->IsNULL() || !Main) {
- m_StickRegion = NULL;
+ _stickRegion = NULL;
RegFound = true;
} else if (Val->IsString()) {
char *RegionName = Val->GetString();
- for (i = 0; i < Main->m_Nodes.GetSize(); i++) {
- if (Main->m_Nodes[i]->m_Type == OBJECT_REGION && Main->m_Nodes[i]->m_Region->m_Name && scumm_stricmp(Main->m_Nodes[i]->m_Region->m_Name, RegionName) == 0) {
- m_StickRegion = Main->m_Nodes[i]->m_Region;
+ for (i = 0; i < Main->_nodes.GetSize(); i++) {
+ if (Main->_nodes[i]->_type == OBJECT_REGION && Main->_nodes[i]->_region->_name && scumm_stricmp(Main->_nodes[i]->_region->_name, RegionName) == 0) {
+ _stickRegion = Main->_nodes[i]->_region;
RegFound = true;
break;
}
@@ -297,9 +297,9 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
} else if (Val->IsNative()) {
CBScriptable *Obj = Val->GetNative();
- for (i = 0; i < Main->m_Nodes.GetSize(); i++) {
- if (Main->m_Nodes[i]->m_Type == OBJECT_REGION && Main->m_Nodes[i]->m_Region == Obj) {
- m_StickRegion = Main->m_Nodes[i]->m_Region;
+ for (i = 0; i < Main->_nodes.GetSize(); i++) {
+ if (Main->_nodes[i]->_type == OBJECT_REGION && Main->_nodes[i]->_region == Obj) {
+ _stickRegion = Main->_nodes[i]->_region;
RegFound = true;
break;
}
@@ -307,7 +307,7 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
}
- if (!RegFound) m_StickRegion = NULL;
+ if (!RegFound) _stickRegion = NULL;
Stack->PushBool(RegFound);
return S_OK;
}
@@ -331,7 +331,7 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetFont") == 0) {
Stack->CorrectParams(0);
- if (m_Font && m_Font->m_Filename) Stack->PushString(m_Font->m_Filename);
+ if (_font && _font->_filename) Stack->PushString(_font->_filename);
else Stack->PushNULL();
return S_OK;
}
@@ -342,9 +342,9 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "TakeItem") == 0) {
Stack->CorrectParams(2);
- if (!m_Inventory) {
- m_Inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(m_Inventory);
+ if (!_inventory) {
+ _inventory = new CAdInventory(Game);
+ ((CAdGame *)Game)->RegisterInventory(_inventory);
}
CScValue *val = Stack->Pop();
@@ -352,10 +352,10 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
char *ItemName = val->GetString();
val = Stack->Pop();
char *InsertAfter = val->IsNULL() ? NULL : val->GetString();
- if (FAILED(m_Inventory->InsertItem(ItemName, InsertAfter))) Script->RuntimeError("Cannot add item '%s' to inventory", ItemName);
+ if (FAILED(_inventory->InsertItem(ItemName, InsertAfter))) Script->RuntimeError("Cannot add item '%s' to inventory", ItemName);
else {
// hide associated entities
- ((CAdGame *)Game)->m_Scene->HandleItemAssociations(ItemName, false);
+ ((CAdGame *)Game)->_scene->HandleItemAssociations(ItemName, false);
}
} else Script->RuntimeError("TakeItem: item name expected");
@@ -370,17 +370,17 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "DropItem") == 0) {
Stack->CorrectParams(1);
- if (!m_Inventory) {
- m_Inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(m_Inventory);
+ if (!_inventory) {
+ _inventory = new CAdInventory(Game);
+ ((CAdGame *)Game)->RegisterInventory(_inventory);
}
CScValue *val = Stack->Pop();
if (!val->IsNULL()) {
- if (FAILED(m_Inventory->RemoveItem(val->GetString()))) Script->RuntimeError("Cannot remove item '%s' from inventory", val->GetString());
+ if (FAILED(_inventory->RemoveItem(val->GetString()))) Script->RuntimeError("Cannot remove item '%s' from inventory", val->GetString());
else {
// show associated entities
- ((CAdGame *)Game)->m_Scene->HandleItemAssociations(val->GetString(), true);
+ ((CAdGame *)Game)->_scene->HandleItemAssociations(val->GetString(), true);
}
} else Script->RuntimeError("DropItem: item name expected");
@@ -394,20 +394,20 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "GetItem") == 0) {
Stack->CorrectParams(1);
- if (!m_Inventory) {
- m_Inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(m_Inventory);
+ if (!_inventory) {
+ _inventory = new CAdInventory(Game);
+ ((CAdGame *)Game)->RegisterInventory(_inventory);
}
CScValue *val = Stack->Pop();
- if (val->m_Type == VAL_STRING) {
+ if (val->_type == VAL_STRING) {
CAdItem *item = ((CAdGame *)Game)->GetItemByName(val->GetString());
if (item) Stack->PushNative(item, true);
else Stack->PushNULL();
- } else if (val->IsNULL() || val->GetInt() < 0 || val->GetInt() >= m_Inventory->m_TakenItems.GetSize())
+ } else if (val->IsNULL() || val->GetInt() < 0 || val->GetInt() >= _inventory->_takenItems.GetSize())
Stack->PushNULL();
else
- Stack->PushNative(m_Inventory->m_TakenItems[val->GetInt()], true);
+ Stack->PushNative(_inventory->_takenItems[val->GetInt()], true);
return S_OK;
}
@@ -418,18 +418,18 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "HasItem") == 0) {
Stack->CorrectParams(1);
- if (!m_Inventory) {
- m_Inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(m_Inventory);
+ if (!_inventory) {
+ _inventory = new CAdInventory(Game);
+ ((CAdGame *)Game)->RegisterInventory(_inventory);
}
CScValue *val = Stack->Pop();
if (!val->IsNULL()) {
- for (int i = 0; i < m_Inventory->m_TakenItems.GetSize(); i++) {
- if (val->GetNative() == m_Inventory->m_TakenItems[i]) {
+ for (int i = 0; i < _inventory->_takenItems.GetSize(); i++) {
+ if (val->GetNative() == _inventory->_takenItems[i]) {
Stack->PushBool(true);
return S_OK;
- } else if (scumm_stricmp(val->GetString(), m_Inventory->m_TakenItems[i]->m_Name) == 0) {
+ } else if (scumm_stricmp(val->GetString(), _inventory->_takenItems[i]->_name) == 0) {
Stack->PushBool(true);
return S_OK;
}
@@ -450,7 +450,7 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
int OffsetY = Stack->Pop()->GetInt();
CPartEmitter *Emitter = CreateParticleEmitter(FollowParent, OffsetX, OffsetY);
- if (Emitter) Stack->PushNative(m_PartEmitter, true);
+ if (Emitter) Stack->PushNative(_partEmitter, true);
else Stack->PushNULL();
return S_OK;
@@ -461,9 +461,9 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DeleteParticleEmitter") == 0) {
Stack->CorrectParams(0);
- if (m_PartEmitter) {
- Game->UnregisterObject(m_PartEmitter);
- m_PartEmitter = NULL;
+ if (_partEmitter) {
+ Game->UnregisterObject(_partEmitter);
+ _partEmitter = NULL;
}
Stack->PushNULL();
@@ -489,12 +489,12 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
} else {
Game->RegisterObject(Ent);
- Ent->m_PosX = OffsetX;
- Ent->m_PosY = OffsetY;
- Ent->m_Active = true;
+ Ent->_posX = OffsetX;
+ Ent->_posY = OffsetY;
+ Ent->_active = true;
- if (PreDisplay) m_AttachmentsPre.Add(Ent);
- else m_AttachmentsPost.Add(Ent);
+ if (PreDisplay) _attachmentsPre.Add(Ent);
+ else _attachmentsPost.Add(Ent);
Stack->PushBool(true);
}
@@ -511,37 +511,37 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
bool Found = false;
if (Val->IsNative()) {
CBScriptable *Obj = Val->GetNative();
- for (int i = 0; i < m_AttachmentsPre.GetSize(); i++) {
- if (m_AttachmentsPre[i] == Obj) {
+ for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
+ if (_attachmentsPre[i] == Obj) {
Found = true;
- Game->UnregisterObject(m_AttachmentsPre[i]);
- m_AttachmentsPre.RemoveAt(i);
+ Game->UnregisterObject(_attachmentsPre[i]);
+ _attachmentsPre.RemoveAt(i);
i--;
}
}
- for (int i = 0; i < m_AttachmentsPost.GetSize(); i++) {
- if (m_AttachmentsPost[i] == Obj) {
+ for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
+ if (_attachmentsPost[i] == Obj) {
Found = true;
- Game->UnregisterObject(m_AttachmentsPost[i]);
- m_AttachmentsPost.RemoveAt(i);
+ Game->UnregisterObject(_attachmentsPost[i]);
+ _attachmentsPost.RemoveAt(i);
i--;
}
}
} else {
char *Name = Val->GetString();
- for (int i = 0; i < m_AttachmentsPre.GetSize(); i++) {
- if (m_AttachmentsPre[i]->m_Name && scumm_stricmp(m_AttachmentsPre[i]->m_Name, Name) == 0) {
+ for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
+ if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, Name) == 0) {
Found = true;
- Game->UnregisterObject(m_AttachmentsPre[i]);
- m_AttachmentsPre.RemoveAt(i);
+ Game->UnregisterObject(_attachmentsPre[i]);
+ _attachmentsPre.RemoveAt(i);
i--;
}
}
- for (int i = 0; i < m_AttachmentsPost.GetSize(); i++) {
- if (m_AttachmentsPost[i]->m_Name && scumm_stricmp(m_AttachmentsPost[i]->m_Name, Name) == 0) {
+ for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
+ if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, Name) == 0) {
Found = true;
- Game->UnregisterObject(m_AttachmentsPost[i]);
- m_AttachmentsPost.RemoveAt(i);
+ Game->UnregisterObject(_attachmentsPost[i]);
+ _attachmentsPost.RemoveAt(i);
i--;
}
}
@@ -562,26 +562,26 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
if (Val->IsInt()) {
int Index = Val->GetInt();
int CurrIndex = 0;
- for (int i = 0; i < m_AttachmentsPre.GetSize(); i++) {
- if (CurrIndex == Index) Ret = m_AttachmentsPre[i];
+ for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
+ if (CurrIndex == Index) Ret = _attachmentsPre[i];
CurrIndex++;
}
- for (int i = 0; i < m_AttachmentsPost.GetSize(); i++) {
- if (CurrIndex == Index) Ret = m_AttachmentsPost[i];
+ for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
+ if (CurrIndex == Index) Ret = _attachmentsPost[i];
CurrIndex++;
}
} else {
char *Name = Val->GetString();
- for (int i = 0; i < m_AttachmentsPre.GetSize(); i++) {
- if (m_AttachmentsPre[i]->m_Name && scumm_stricmp(m_AttachmentsPre[i]->m_Name, Name) == 0) {
- Ret = m_AttachmentsPre[i];
+ for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
+ if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, Name) == 0) {
+ Ret = _attachmentsPre[i];
break;
}
}
if (!Ret) {
- for (int i = 0; i < m_AttachmentsPost.GetSize(); i++) {
- if (m_AttachmentsPost[i]->m_Name && scumm_stricmp(m_AttachmentsPost[i]->m_Name, Name) == 0) {
- Ret = m_AttachmentsPre[i];
+ for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
+ if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, Name) == 0) {
+ Ret = _attachmentsPre[i];
break;
}
}
@@ -600,104 +600,104 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
CScValue *CAdObject::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("object");
- return m_ScValue;
+ _scValue->SetString("object");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Active") == 0) {
- m_ScValue->SetBool(m_Active);
- return m_ScValue;
+ _scValue->SetBool(_active);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// IgnoreItems
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IgnoreItems") == 0) {
- m_ScValue->SetBool(m_IgnoreItems);
- return m_ScValue;
+ _scValue->SetBool(_ignoreItems);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SceneIndependent
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SceneIndependent") == 0) {
- m_ScValue->SetBool(m_SceneIndependent);
- return m_ScValue;
+ _scValue->SetBool(_sceneIndependent);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SubtitlesWidth
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesWidth") == 0) {
- m_ScValue->SetInt(m_SubtitlesWidth);
- return m_ScValue;
+ _scValue->SetInt(_subtitlesWidth);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SubtitlesPosRelative
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesPosRelative") == 0) {
- m_ScValue->SetBool(m_SubtitlesModRelative);
- return m_ScValue;
+ _scValue->SetBool(_subtitlesModRelative);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SubtitlesPosX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesPosX") == 0) {
- m_ScValue->SetInt(m_SubtitlesModX);
- return m_ScValue;
+ _scValue->SetInt(_subtitlesModX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SubtitlesPosY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesPosY") == 0) {
- m_ScValue->SetInt(m_SubtitlesModY);
- return m_ScValue;
+ _scValue->SetInt(_subtitlesModY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SubtitlesPosXCenter
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesPosXCenter") == 0) {
- m_ScValue->SetBool(m_SubtitlesModXCenter);
- return m_ScValue;
+ _scValue->SetBool(_subtitlesModXCenter);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumItems (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumItems") == 0) {
- m_ScValue->SetInt(GetInventory()->m_TakenItems.GetSize());
- return m_ScValue;
+ _scValue->SetInt(GetInventory()->_takenItems.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ParticleEmitter (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ParticleEmitter") == 0) {
- if (m_PartEmitter) m_ScValue->SetNative(m_PartEmitter, true);
- else m_ScValue->SetNULL();
+ if (_partEmitter) _scValue->SetNative(_partEmitter, true);
+ else _scValue->SetNULL();
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumAttachments (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumAttachments") == 0) {
- m_ScValue->SetInt(m_AttachmentsPre.GetSize() + m_AttachmentsPost.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_attachmentsPre.GetSize() + _attachmentsPost.GetSize());
+ return _scValue;
}
@@ -712,7 +712,7 @@ HRESULT CAdObject::ScSetProperty(char *Name, CScValue *Value) {
// Active
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Active") == 0) {
- m_Active = Value->GetBool();
+ _active = Value->GetBool();
return S_OK;
}
@@ -720,7 +720,7 @@ HRESULT CAdObject::ScSetProperty(char *Name, CScValue *Value) {
// IgnoreItems
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IgnoreItems") == 0) {
- m_IgnoreItems = Value->GetBool();
+ _ignoreItems = Value->GetBool();
return S_OK;
}
@@ -728,7 +728,7 @@ HRESULT CAdObject::ScSetProperty(char *Name, CScValue *Value) {
// SceneIndependent
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SceneIndependent") == 0) {
- m_SceneIndependent = Value->GetBool();
+ _sceneIndependent = Value->GetBool();
return S_OK;
}
@@ -736,7 +736,7 @@ HRESULT CAdObject::ScSetProperty(char *Name, CScValue *Value) {
// SubtitlesWidth
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesWidth") == 0) {
- m_SubtitlesWidth = Value->GetInt();
+ _subtitlesWidth = Value->GetInt();
return S_OK;
}
@@ -744,7 +744,7 @@ HRESULT CAdObject::ScSetProperty(char *Name, CScValue *Value) {
// SubtitlesPosRelative
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesPosRelative") == 0) {
- m_SubtitlesModRelative = Value->GetBool();
+ _subtitlesModRelative = Value->GetBool();
return S_OK;
}
@@ -752,7 +752,7 @@ HRESULT CAdObject::ScSetProperty(char *Name, CScValue *Value) {
// SubtitlesPosX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesPosX") == 0) {
- m_SubtitlesModX = Value->GetInt();
+ _subtitlesModX = Value->GetInt();
return S_OK;
}
@@ -760,7 +760,7 @@ HRESULT CAdObject::ScSetProperty(char *Name, CScValue *Value) {
// SubtitlesPosY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesPosY") == 0) {
- m_SubtitlesModY = Value->GetInt();
+ _subtitlesModY = Value->GetInt();
return S_OK;
}
@@ -768,7 +768,7 @@ HRESULT CAdObject::ScSetProperty(char *Name, CScValue *Value) {
// SubtitlesPosXCenter
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesPosXCenter") == 0) {
- m_SubtitlesModXCenter = Value->GetBool();
+ _subtitlesModXCenter = Value->GetBool();
return S_OK;
}
@@ -784,12 +784,12 @@ char *CAdObject::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::SetFont(char *Filename) {
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
+ if (_font) Game->_fontStorage->RemoveFont(_font);
if (Filename) {
- m_Font = Game->m_FontStorage->AddFont(Filename);
- return m_Font == NULL ? E_FAIL : S_OK;
+ _font = Game->_fontStorage->AddFont(Filename);
+ return _font == NULL ? E_FAIL : S_OK;
} else {
- m_Font = NULL;
+ _font = NULL;
return S_OK;
}
}
@@ -797,16 +797,16 @@ HRESULT CAdObject::SetFont(char *Filename) {
//////////////////////////////////////////////////////////////////////////
int CAdObject::GetHeight() {
- if (!m_CurrentSprite) return 0;
+ if (!_currentSprite) return 0;
else {
- CBFrame *frame = m_CurrentSprite->m_Frames[m_CurrentSprite->m_CurrentFrame];
+ CBFrame *frame = _currentSprite->_frames[_currentSprite->_currentFrame];
int ret = 0;
- for (int i = 0; i < frame->m_Subframes.GetSize(); i++) {
- ret = MAX(ret, frame->m_Subframes[i]->m_HotspotY);
+ for (int i = 0; i < frame->_subframes.GetSize(); i++) {
+ ret = MAX(ret, frame->_subframes[i]->_hotspotY);
}
- if (m_Zoomable) {
- float zoom = ((CAdGame *)Game)->m_Scene->GetZoomAt(m_PosX, m_PosY);
+ if (_zoomable) {
+ float zoom = ((CAdGame *)Game)->_scene->GetZoomAt(_posX, _posY);
ret = ret * zoom / 100;
}
return ret;
@@ -816,30 +816,30 @@ int CAdObject::GetHeight() {
//////////////////////////////////////////////////////////////////////////
void CAdObject::Talk(char *Text, char *Sound, uint32 Duration, char *Stances, TTextAlign Align) {
- if (!m_Sentence) m_Sentence = new CAdSentence(Game);
- if (!m_Sentence) return;
+ if (!_sentence) _sentence = new CAdSentence(Game);
+ if (!_sentence) return;
- if (m_ForcedTalkAnimName && m_ForcedTalkAnimUsed) {
- SAFE_DELETE_ARRAY(m_ForcedTalkAnimName);
- m_ForcedTalkAnimUsed = false;
+ if (_forcedTalkAnimName && _forcedTalkAnimUsed) {
+ SAFE_DELETE_ARRAY(_forcedTalkAnimName);
+ _forcedTalkAnimUsed = false;
}
- SAFE_DELETE(m_Sentence->m_Sound);
+ SAFE_DELETE(_sentence->_sound);
- m_Sentence->SetText(Text);
- Game->m_StringTable->Expand(&m_Sentence->m_Text);
- m_Sentence->SetStances(Stances);
- m_Sentence->m_Duration = Duration;
- m_Sentence->m_Align = Align;
- m_Sentence->m_StartTime = Game->m_Timer;
- m_Sentence->m_CurrentStance = -1;
- m_Sentence->m_Font = m_Font == NULL ? Game->m_SystemFont : m_Font;
- m_Sentence->m_Freezable = m_Freezable;
+ _sentence->SetText(Text);
+ Game->_stringTable->Expand(&_sentence->_text);
+ _sentence->SetStances(Stances);
+ _sentence->_duration = Duration;
+ _sentence->_align = Align;
+ _sentence->_startTime = Game->_timer;
+ _sentence->_currentStance = -1;
+ _sentence->_font = _font == NULL ? Game->_systemFont : _font;
+ _sentence->_freezable = _freezable;
// try to locate speech file automatically
bool DeleteSound = false;
if (!Sound) {
- char *Key = Game->m_StringTable->GetKey(Text);
+ char *Key = Game->_stringTable->GetKey(Text);
if (Key) {
Sound = ((CAdGame *)Game)->FindSpeechFile(Key);
delete [] Key;
@@ -852,73 +852,73 @@ void CAdObject::Talk(char *Text, char *Sound, uint32 Duration, char *Stances, TT
if (Sound) {
CBSound *snd = new CBSound(Game);
if (snd && SUCCEEDED(snd->SetSound(Sound, SOUND_SPEECH, true))) {
- m_Sentence->SetSound(snd);
- if (m_Sentence->m_Duration <= 0) {
+ _sentence->SetSound(snd);
+ if (_sentence->_duration <= 0) {
uint32 Length = snd->GetLength();
- if (Length != 0) m_Sentence->m_Duration = Length;
+ if (Length != 0) _sentence->_duration = Length;
}
} else delete snd;
}
// set duration by text length
- if (m_Sentence->m_Duration <= 0) {// TODO: Avoid longs.
- m_Sentence->m_Duration = MAX((unsigned long)1000, Game->m_SubtitlesSpeed * strlen(m_Sentence->m_Text));
+ if (_sentence->_duration <= 0) {// TODO: Avoid longs.
+ _sentence->_duration = MAX((unsigned long)1000, Game->_subtitlesSpeed * strlen(_sentence->_text));
}
int x, y, width, height;
- x = m_PosX;
- y = m_PosY;
+ x = _posX;
+ y = _posY;
- if (!m_SceneIndependent && m_SubtitlesModRelative) {
- x -= ((CAdGame *)Game)->m_Scene->GetOffsetLeft();
- y -= ((CAdGame *)Game)->m_Scene->GetOffsetTop();
+ if (!_sceneIndependent && _subtitlesModRelative) {
+ x -= ((CAdGame *)Game)->_scene->GetOffsetLeft();
+ y -= ((CAdGame *)Game)->_scene->GetOffsetTop();
}
- if (m_SubtitlesWidth > 0) width = m_SubtitlesWidth;
+ if (_subtitlesWidth > 0) width = _subtitlesWidth;
else {
- if ((x < Game->m_Renderer->m_Width / 4 || x > Game->m_Renderer->m_Width * 0.75) && !Game->m_TouchInterface) {
- width = MAX(Game->m_Renderer->m_Width / 4, MIN(x * 2, (Game->m_Renderer->m_Width - x) * 2));
- } else width = Game->m_Renderer->m_Width / 2;
+ if ((x < Game->_renderer->_width / 4 || x > Game->_renderer->_width * 0.75) && !Game->_touchInterface) {
+ width = MAX(Game->_renderer->_width / 4, MIN(x * 2, (Game->_renderer->_width - x) * 2));
+ } else width = Game->_renderer->_width / 2;
}
- height = m_Sentence->m_Font->GetTextHeight((byte *)m_Sentence->m_Text, width);
+ height = _sentence->_font->GetTextHeight((byte *)_sentence->_text, width);
y = y - height - GetHeight() - 5;
- if (m_SubtitlesModRelative) {
- x += m_SubtitlesModX;
- y += m_SubtitlesModY;
+ if (_subtitlesModRelative) {
+ x += _subtitlesModX;
+ y += _subtitlesModY;
} else {
- x = m_SubtitlesModX;
- y = m_SubtitlesModY;
+ x = _subtitlesModX;
+ y = _subtitlesModY;
}
- if (m_SubtitlesModXCenter)
+ if (_subtitlesModXCenter)
x = x - width / 2;
- x = MIN(MAX(0, x), Game->m_Renderer->m_Width - width);
- y = MIN(MAX(0, y), Game->m_Renderer->m_Height - height);
+ x = MIN(MAX(0, x), Game->_renderer->_width - width);
+ y = MIN(MAX(0, y), Game->_renderer->_height - height);
- m_Sentence->m_Width = width;
+ _sentence->_width = width;
- m_Sentence->m_Pos.x = x;
- m_Sentence->m_Pos.y = y;
+ _sentence->_pos.x = x;
+ _sentence->_pos.y = y;
- if (m_SubtitlesModRelative) {
- m_Sentence->m_Pos.x += ((CAdGame *)Game)->m_Scene->GetOffsetLeft();
- m_Sentence->m_Pos.y += ((CAdGame *)Game)->m_Scene->GetOffsetTop();
+ if (_subtitlesModRelative) {
+ _sentence->_pos.x += ((CAdGame *)Game)->_scene->GetOffsetLeft();
+ _sentence->_pos.y += ((CAdGame *)Game)->_scene->GetOffsetTop();
}
- m_Sentence->m_FixedPos = !m_SubtitlesModRelative;
+ _sentence->_fixedPos = !_subtitlesModRelative;
- m_Sentence->SetupTalkFile(Sound);
+ _sentence->SetupTalkFile(Sound);
- m_State = STATE_TALKING;
+ _state = STATE_TALKING;
if (DeleteSound) delete [] Sound;
}
@@ -926,15 +926,15 @@ void CAdObject::Talk(char *Text, char *Sound, uint32 Duration, char *Stances, TT
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::Reset() {
- if (m_State == STATE_PLAYING_ANIM && m_AnimSprite != NULL) {
- SAFE_DELETE(m_AnimSprite);
- } else if (m_State == STATE_TALKING && m_Sentence) {
- m_Sentence->Finish();
+ if (_state == STATE_PLAYING_ANIM && _animSprite != NULL) {
+ SAFE_DELETE(_animSprite);
+ } else if (_state == STATE_TALKING && _sentence) {
+ _sentence->Finish();
}
- m_State = m_NextState = STATE_READY;
+ _state = _nextState = STATE_READY;
- Game->m_ScEngine->ResetObject(this);
+ Game->_scEngine->ResetObject(this);
return S_OK;
}
@@ -944,42 +944,42 @@ HRESULT CAdObject::Reset() {
HRESULT CAdObject::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Active));
- PersistMgr->Transfer(TMEMBER(m_BlockRegion));
- PersistMgr->Transfer(TMEMBER(m_CurrentBlockRegion));
- PersistMgr->Transfer(TMEMBER(m_CurrentWptGroup));
- PersistMgr->Transfer(TMEMBER(m_CurrentSprite));
- PersistMgr->Transfer(TMEMBER(m_Drawn));
- PersistMgr->Transfer(TMEMBER(m_Font));
- PersistMgr->Transfer(TMEMBER(m_IgnoreItems));
- PersistMgr->Transfer(TMEMBER_INT(m_NextState));
- PersistMgr->Transfer(TMEMBER(m_Sentence));
- PersistMgr->Transfer(TMEMBER_INT(m_State));
- PersistMgr->Transfer(TMEMBER(m_AnimSprite));
- PersistMgr->Transfer(TMEMBER(m_SceneIndependent));
- PersistMgr->Transfer(TMEMBER(m_ForcedTalkAnimName));
- PersistMgr->Transfer(TMEMBER(m_ForcedTalkAnimUsed));
- PersistMgr->Transfer(TMEMBER(m_TempSprite2));
- PersistMgr->Transfer(TMEMBER_INT(m_Type));
- PersistMgr->Transfer(TMEMBER(m_WptGroup));
- PersistMgr->Transfer(TMEMBER(m_StickRegion));
- PersistMgr->Transfer(TMEMBER(m_SubtitlesModRelative));
- PersistMgr->Transfer(TMEMBER(m_SubtitlesModX));
- PersistMgr->Transfer(TMEMBER(m_SubtitlesModY));
- PersistMgr->Transfer(TMEMBER(m_SubtitlesModXCenter));
- PersistMgr->Transfer(TMEMBER(m_SubtitlesWidth));
- PersistMgr->Transfer(TMEMBER(m_Inventory));
- PersistMgr->Transfer(TMEMBER(m_PartEmitter));
-
- for (int i = 0; i < MAX_NUM_REGIONS; i++) PersistMgr->Transfer(TMEMBER(m_CurrentRegions[i]));
-
- m_AttachmentsPre.Persist(PersistMgr);
- m_AttachmentsPost.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_RegisterAlias));
-
- PersistMgr->Transfer(TMEMBER(m_PartFollowParent));
- PersistMgr->Transfer(TMEMBER(m_PartOffsetX));
- PersistMgr->Transfer(TMEMBER(m_PartOffsetY));
+ PersistMgr->Transfer(TMEMBER(_active));
+ PersistMgr->Transfer(TMEMBER(_blockRegion));
+ PersistMgr->Transfer(TMEMBER(_currentBlockRegion));
+ PersistMgr->Transfer(TMEMBER(_currentWptGroup));
+ PersistMgr->Transfer(TMEMBER(_currentSprite));
+ PersistMgr->Transfer(TMEMBER(_drawn));
+ PersistMgr->Transfer(TMEMBER(_font));
+ PersistMgr->Transfer(TMEMBER(_ignoreItems));
+ PersistMgr->Transfer(TMEMBER_INT(_nextState));
+ PersistMgr->Transfer(TMEMBER(_sentence));
+ PersistMgr->Transfer(TMEMBER_INT(_state));
+ PersistMgr->Transfer(TMEMBER(_animSprite));
+ PersistMgr->Transfer(TMEMBER(_sceneIndependent));
+ PersistMgr->Transfer(TMEMBER(_forcedTalkAnimName));
+ PersistMgr->Transfer(TMEMBER(_forcedTalkAnimUsed));
+ PersistMgr->Transfer(TMEMBER(_tempSprite2));
+ PersistMgr->Transfer(TMEMBER_INT(_type));
+ PersistMgr->Transfer(TMEMBER(_wptGroup));
+ PersistMgr->Transfer(TMEMBER(_stickRegion));
+ PersistMgr->Transfer(TMEMBER(_subtitlesModRelative));
+ PersistMgr->Transfer(TMEMBER(_subtitlesModX));
+ PersistMgr->Transfer(TMEMBER(_subtitlesModY));
+ PersistMgr->Transfer(TMEMBER(_subtitlesModXCenter));
+ PersistMgr->Transfer(TMEMBER(_subtitlesWidth));
+ PersistMgr->Transfer(TMEMBER(_inventory));
+ PersistMgr->Transfer(TMEMBER(_partEmitter));
+
+ for (int i = 0; i < MAX_NUM_REGIONS; i++) PersistMgr->Transfer(TMEMBER(_currentRegions[i]));
+
+ _attachmentsPre.Persist(PersistMgr);
+ _attachmentsPost.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_registerAlias));
+
+ PersistMgr->Transfer(TMEMBER(_partFollowParent));
+ PersistMgr->Transfer(TMEMBER(_partOffsetX));
+ PersistMgr->Transfer(TMEMBER(_partOffsetY));
return S_OK;
}
@@ -987,8 +987,8 @@ HRESULT CAdObject::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::UpdateSounds() {
- if (m_Sentence && m_Sentence->m_Sound)
- UpdateOneSound(m_Sentence->m_Sound);
+ if (_sentence && _sentence->_sound)
+ UpdateOneSound(_sentence->_sound);
return CBObject::UpdateSounds();
}
@@ -996,8 +996,8 @@ HRESULT CAdObject::UpdateSounds() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::ResetSoundPan() {
- if (m_Sentence && m_Sentence->m_Sound) {
- m_Sentence->m_Sound->SetPan(0.0f);
+ if (_sentence && _sentence->_sound) {
+ _sentence->_sound->SetPan(0.0f);
}
return CBObject::ResetSoundPan();
}
@@ -1014,8 +1014,8 @@ bool CAdObject::GetExtendedFlag(char *FlagName) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::SaveAsText(CBDynBuffer *Buffer, int Indent) {
- if (m_BlockRegion) m_BlockRegion->SaveAsText(Buffer, Indent + 2, "BLOCKED_REGION");
- if (m_WptGroup) m_WptGroup->SaveAsText(Buffer, Indent + 2);
+ if (_blockRegion) _blockRegion->SaveAsText(Buffer, Indent + 2, "BLOCKED_REGION");
+ if (_wptGroup) _wptGroup->SaveAsText(Buffer, Indent + 2);
CBBase::SaveAsText(Buffer, Indent + 2);
@@ -1026,23 +1026,23 @@ HRESULT CAdObject::SaveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::UpdateBlockRegion() {
CAdGame *AdGame = (CAdGame *)Game;
- if (AdGame->m_Scene) {
- if (m_BlockRegion && m_CurrentBlockRegion)
- m_CurrentBlockRegion->Mimic(m_BlockRegion, m_Zoomable ? AdGame->m_Scene->GetScaleAt(m_PosY) : 100.0f, m_PosX, m_PosY);
+ if (AdGame->_scene) {
+ if (_blockRegion && _currentBlockRegion)
+ _currentBlockRegion->Mimic(_blockRegion, _zoomable ? AdGame->_scene->GetScaleAt(_posY) : 100.0f, _posX, _posY);
- if (m_WptGroup && m_CurrentWptGroup)
- m_CurrentWptGroup->Mimic(m_WptGroup, m_Zoomable ? AdGame->m_Scene->GetScaleAt(m_PosY) : 100.0f, m_PosX, m_PosY);
+ if (_wptGroup && _currentWptGroup)
+ _currentWptGroup->Mimic(_wptGroup, _zoomable ? AdGame->_scene->GetScaleAt(_posY) : 100.0f, _posX, _posY);
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
CAdInventory *CAdObject::GetInventory() {
- if (!m_Inventory) {
- m_Inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(m_Inventory);
+ if (!_inventory) {
+ _inventory = new CAdInventory(Game);
+ ((CAdGame *)Game)->RegisterInventory(_inventory);
}
- return m_Inventory;
+ return _inventory;
}
@@ -1050,13 +1050,13 @@ CAdInventory *CAdObject::GetInventory() {
HRESULT CAdObject::AfterMove() {
CAdRegion *NewRegions[MAX_NUM_REGIONS];
- ((CAdGame *)Game)->m_Scene->GetRegionsAt(m_PosX, m_PosY, NewRegions, MAX_NUM_REGIONS);
+ ((CAdGame *)Game)->_scene->GetRegionsAt(_posX, _posY, NewRegions, MAX_NUM_REGIONS);
for (int i = 0; i < MAX_NUM_REGIONS; i++) {
if (!NewRegions[i]) break;
bool RegFound = false;
for (int j = 0; j < MAX_NUM_REGIONS; j++) {
- if (m_CurrentRegions[j] == NewRegions[i]) {
- m_CurrentRegions[j] = NULL;
+ if (_currentRegions[j] == NewRegions[i]) {
+ _currentRegions[j] = NULL;
RegFound = true;
break;
}
@@ -1065,10 +1065,10 @@ HRESULT CAdObject::AfterMove() {
}
for (int i = 0; i < MAX_NUM_REGIONS; i++) {
- if (m_CurrentRegions[i] && Game->ValidObject(m_CurrentRegions[i])) {
- m_CurrentRegions[i]->ApplyEvent("ActorLeave");
+ if (_currentRegions[i] && Game->ValidObject(_currentRegions[i])) {
+ _currentRegions[i]->ApplyEvent("ActorLeave");
}
- m_CurrentRegions[i] = NewRegions[i];
+ _currentRegions[i] = NewRegions[i];
}
return S_OK;
@@ -1076,19 +1076,19 @@ HRESULT CAdObject::AfterMove() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::InvalidateCurrRegions() {
- for (int i = 0; i < MAX_NUM_REGIONS; i++) m_CurrentRegions[i] = NULL;
+ for (int i = 0; i < MAX_NUM_REGIONS; i++) _currentRegions[i] = NULL;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::GetScale(float *ScaleX, float *ScaleY) {
- if (m_Zoomable) {
- if (m_ScaleX >= 0 || m_ScaleY >= 0) {
- *ScaleX = m_ScaleX < 0 ? 100 : m_ScaleX;
- *ScaleY = m_ScaleY < 0 ? 100 : m_ScaleY;
- } else if (m_Scale >= 0) *ScaleX = *ScaleY = m_Scale;
- else *ScaleX = *ScaleY = ((CAdGame *)Game)->m_Scene->GetZoomAt(m_PosX, m_PosY) + m_RelativeScale;
+ if (_zoomable) {
+ if (_scaleX >= 0 || _scaleY >= 0) {
+ *ScaleX = _scaleX < 0 ? 100 : _scaleX;
+ *ScaleY = _scaleY < 0 ? 100 : _scaleY;
+ } else if (_scale >= 0) *ScaleX = *ScaleY = _scale;
+ else *ScaleX = *ScaleY = ((CAdGame *)Game)->_scene->GetZoomAt(_posX, _posY) + _relativeScale;
} else {
*ScaleX = *ScaleY = 100;
}
@@ -1097,11 +1097,11 @@ HRESULT CAdObject::GetScale(float *ScaleX, float *ScaleY) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::UpdateSpriteAttachments() {
- for (int i = 0; i < m_AttachmentsPre.GetSize(); i++) {
- m_AttachmentsPre[i]->Update();
+ for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
+ _attachmentsPre[i]->Update();
}
- for (int i = 0; i < m_AttachmentsPost.GetSize(); i++) {
- m_AttachmentsPost[i]->Update();
+ for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
+ _attachmentsPost[i]->Update();
}
return S_OK;
}
@@ -1109,12 +1109,12 @@ HRESULT CAdObject::UpdateSpriteAttachments() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::DisplaySpriteAttachments(bool PreDisplay) {
if (PreDisplay) {
- for (int i = 0; i < m_AttachmentsPre.GetSize(); i++) {
- DisplaySpriteAttachment(m_AttachmentsPre[i]);
+ for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
+ DisplaySpriteAttachment(_attachmentsPre[i]);
}
} else {
- for (int i = 0; i < m_AttachmentsPost.GetSize(); i++) {
- DisplaySpriteAttachment(m_AttachmentsPost[i]);
+ for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
+ DisplaySpriteAttachment(_attachmentsPost[i]);
}
}
return S_OK;
@@ -1122,70 +1122,70 @@ HRESULT CAdObject::DisplaySpriteAttachments(bool PreDisplay) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::DisplaySpriteAttachment(CAdObject *Attachment) {
- if (!Attachment->m_Active) return S_OK;
+ if (!Attachment->_active) return S_OK;
float ScaleX, ScaleY;
GetScale(&ScaleX, &ScaleY);
- int OrigX = Attachment->m_PosX;
- int OrigY = Attachment->m_PosY;
+ int OrigX = Attachment->_posX;
+ int OrigY = Attachment->_posY;
// inherit position from owner
- Attachment->m_PosX = this->m_PosX + Attachment->m_PosX * ScaleX / 100.0f;
- Attachment->m_PosY = this->m_PosY + Attachment->m_PosY * ScaleY / 100.0f;
+ Attachment->_posX = this->_posX + Attachment->_posX * ScaleX / 100.0f;
+ Attachment->_posY = this->_posY + Attachment->_posY * ScaleY / 100.0f;
// inherit other props
- Attachment->m_AlphaColor = this->m_AlphaColor;
- Attachment->m_BlendMode = this->m_BlendMode;
+ Attachment->_alphaColor = this->_alphaColor;
+ Attachment->_blendMode = this->_blendMode;
- Attachment->m_Scale = this->m_Scale;
- Attachment->m_RelativeScale = this->m_RelativeScale;
- Attachment->m_ScaleX = this->m_ScaleX;
- Attachment->m_ScaleY = this->m_ScaleY;
+ Attachment->_scale = this->_scale;
+ Attachment->_relativeScale = this->_relativeScale;
+ Attachment->_scaleX = this->_scaleX;
+ Attachment->_scaleY = this->_scaleY;
- Attachment->m_Rotate = this->m_Rotate;
- Attachment->m_RelativeRotate = this->m_RelativeRotate;
- Attachment->m_RotateValid = this->m_RotateValid;
+ Attachment->_rotate = this->_rotate;
+ Attachment->_relativeRotate = this->_relativeRotate;
+ Attachment->_rotateValid = this->_rotateValid;
- Attachment->m_RegisterAlias = this;
- Attachment->m_Registrable = this->m_Registrable;
+ Attachment->_registerAlias = this;
+ Attachment->_registrable = this->_registrable;
HRESULT ret = Attachment->Display();
- Attachment->m_PosX = OrigX;
- Attachment->m_PosY = OrigY;
+ Attachment->_posX = OrigX;
+ Attachment->_posY = OrigY;
return ret;
}
//////////////////////////////////////////////////////////////////////////
CPartEmitter *CAdObject::CreateParticleEmitter(bool FollowParent, int OffsetX, int OffsetY) {
- m_PartFollowParent = FollowParent;
- m_PartOffsetX = OffsetX;
- m_PartOffsetY = OffsetY;
-
- if (!m_PartEmitter) {
- m_PartEmitter = new CPartEmitter(Game, this);
- if (m_PartEmitter) {
- Game->RegisterObject(m_PartEmitter);
+ _partFollowParent = FollowParent;
+ _partOffsetX = OffsetX;
+ _partOffsetY = OffsetY;
+
+ if (!_partEmitter) {
+ _partEmitter = new CPartEmitter(Game, this);
+ if (_partEmitter) {
+ Game->RegisterObject(_partEmitter);
}
}
UpdatePartEmitter();
- return m_PartEmitter;
+ return _partEmitter;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::UpdatePartEmitter() {
- if (!m_PartEmitter) return E_FAIL;
+ if (!_partEmitter) return E_FAIL;
- if (m_PartFollowParent) {
+ if (_partFollowParent) {
float ScaleX, ScaleY;
GetScale(&ScaleX, &ScaleY);
- m_PartEmitter->m_PosX = m_PosX + (ScaleX / 100.0f) * m_PartOffsetX;
- m_PartEmitter->m_PosY = m_PosY + (ScaleY / 100.0f) * m_PartOffsetY;
+ _partEmitter->_posX = _posX + (ScaleX / 100.0f) * _partOffsetX;
+ _partEmitter->_posY = _posY + (ScaleY / 100.0f) * _partOffsetY;
}
- return m_PartEmitter->Update();
+ return _partEmitter->Update();
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/AdObject.h b/engines/wintermute/AdObject.h
index e5cb39e6b4..7e0e277edb 100644
--- a/engines/wintermute/AdObject.h
+++ b/engines/wintermute/AdObject.h
@@ -45,25 +45,25 @@ class CAdInventory;
class CAdObject : public CBObject {
public:
- CPartEmitter *m_PartEmitter;
+ CPartEmitter *_partEmitter;
virtual CPartEmitter *CreateParticleEmitter(bool FollowParent = false, int OffsetX = 0, int OffsetY = 0);
virtual HRESULT UpdatePartEmitter();
- bool m_PartFollowParent;
- int m_PartOffsetX;
- int m_PartOffsetY;
+ bool _partFollowParent;
+ int _partOffsetX;
+ int _partOffsetY;
HRESULT InvalidateCurrRegions();
- bool m_SubtitlesModRelative;
- bool m_SubtitlesModXCenter;
- int m_SubtitlesModX;
- int m_SubtitlesModY;
- int m_SubtitlesWidth;
- CAdRegion *m_StickRegion;
- bool m_SceneIndependent;
- bool m_IgnoreItems;
+ bool _subtitlesModRelative;
+ bool _subtitlesModXCenter;
+ int _subtitlesModX;
+ int _subtitlesModY;
+ int _subtitlesWidth;
+ CAdRegion *_stickRegion;
+ bool _sceneIndependent;
+ bool _ignoreItems;
HRESULT UpdateBlockRegion();
- bool m_ForcedTalkAnimUsed;
- char *m_ForcedTalkAnimName;
+ bool _forcedTalkAnimUsed;
+ char *_forcedTalkAnimName;
virtual bool GetExtendedFlag(char *FlagName);
virtual HRESULT ResetSoundPan();
virtual HRESULT UpdateSounds();
@@ -71,32 +71,32 @@ public:
DECLARE_PERSISTENT(CAdObject, CBObject)
virtual void Talk(char *Text, char *Sound = NULL, uint32 Duration = 0, char *Stances = NULL, TTextAlign Align = TAL_CENTER);
virtual int GetHeight();
- CAdSentence *m_Sentence;
+ CAdSentence *_sentence;
HRESULT SetFont(char *Filename);
virtual HRESULT Update();
virtual HRESULT Display();
- bool m_Drawn;
- bool m_Active;
+ bool _drawn;
+ bool _active;
virtual HRESULT PlayAnim(char *Filename);
- CBSprite *m_AnimSprite;
- CBSprite *m_CurrentSprite;
- TObjectState m_State;
- TObjectState m_NextState;
- TObjectType m_Type;
+ CBSprite *_animSprite;
+ CBSprite *_currentSprite;
+ TObjectState _state;
+ TObjectState _nextState;
+ TObjectType _type;
CAdObject(CBGame *inGame);
virtual ~CAdObject();
- CBFont *m_Font;
- CBSprite *m_TempSprite2;
- CBRegion *m_BlockRegion;
- CAdWaypointGroup *m_WptGroup;
- CBRegion *m_CurrentBlockRegion;
- CAdWaypointGroup *m_CurrentWptGroup;
+ CBFont *_font;
+ CBSprite *_tempSprite2;
+ CBRegion *_blockRegion;
+ CAdWaypointGroup *_wptGroup;
+ CBRegion *_currentBlockRegion;
+ CAdWaypointGroup *_currentWptGroup;
CAdInventory *GetInventory();
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
virtual HRESULT AfterMove();
- CAdRegion *m_CurrentRegions[MAX_NUM_REGIONS];
+ CAdRegion *_currentRegions[MAX_NUM_REGIONS];
// scripting interface
virtual CScValue *ScGetProperty(char *Name);
@@ -104,15 +104,15 @@ public:
virtual HRESULT ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name);
virtual char *ScToString();
- CBArray<CAdObject *, CAdObject *> m_AttachmentsPre;
- CBArray<CAdObject *, CAdObject *> m_AttachmentsPost;
+ CBArray<CAdObject *, CAdObject *> _attachmentsPre;
+ CBArray<CAdObject *, CAdObject *> _attachmentsPost;
HRESULT UpdateSpriteAttachments();
HRESULT DisplaySpriteAttachments(bool PreDisplay);
- CAdObject *m_RegisterAlias;
+ CAdObject *_registerAlias;
private:
HRESULT DisplaySpriteAttachment(CAdObject *Attachment);
- CAdInventory *m_Inventory;
+ CAdInventory *_inventory;
protected:
HRESULT GetScale(float *ScaleX, float *ScaleY);
diff --git a/engines/wintermute/AdPath.cpp b/engines/wintermute/AdPath.cpp
index fb95f28450..f5e3d8ecc7 100644
--- a/engines/wintermute/AdPath.cpp
+++ b/engines/wintermute/AdPath.cpp
@@ -36,8 +36,8 @@ IMPLEMENT_PERSISTENT(CAdPath, false)
//////////////////////////////////////////////////////////////////////////
CAdPath::CAdPath(CBGame *inGame): CBBase(inGame) {
- m_CurrIndex = -1;
- m_Ready = false;
+ _currIndex = -1;
+ _ready = false;
}
@@ -49,49 +49,49 @@ CAdPath::~CAdPath() {
//////////////////////////////////////////////////////////////////////////
void CAdPath::Reset() {
- for (int i = 0; i < m_Points.GetSize(); i++)
- delete m_Points[i];
+ for (int i = 0; i < _points.GetSize(); i++)
+ delete _points[i];
- m_Points.RemoveAll();
- m_CurrIndex = -1;
- m_Ready = false;
+ _points.RemoveAll();
+ _currIndex = -1;
+ _ready = false;
}
//////////////////////////////////////////////////////////////////////////
CBPoint *CAdPath::GetFirst() {
- if (m_Points.GetSize() > 0) {
- m_CurrIndex = 0;
- return m_Points[m_CurrIndex];
+ if (_points.GetSize() > 0) {
+ _currIndex = 0;
+ return _points[_currIndex];
} else return NULL;
}
//////////////////////////////////////////////////////////////////////////
CBPoint *CAdPath::GetNext() {
- m_CurrIndex++;
- if (m_CurrIndex < m_Points.GetSize()) return m_Points[m_CurrIndex];
+ _currIndex++;
+ if (_currIndex < _points.GetSize()) return _points[_currIndex];
else return NULL;
}
//////////////////////////////////////////////////////////////////////////
CBPoint *CAdPath::GetCurrent() {
- if (m_CurrIndex >= 0 && m_CurrIndex < m_Points.GetSize()) return m_Points[m_CurrIndex];
+ if (_currIndex >= 0 && _currIndex < _points.GetSize()) return _points[_currIndex];
else return NULL;
}
//////////////////////////////////////////////////////////////////////////
void CAdPath::AddPoint(CBPoint *point) {
- m_Points.Add(point);
+ _points.Add(point);
}
//////////////////////////////////////////////////////////////////////////
bool CAdPath::SetReady(bool ready) {
- bool orig = m_Ready;
- m_Ready = ready;
+ bool orig = _ready;
+ _ready = ready;
return orig;
}
@@ -102,9 +102,9 @@ HRESULT CAdPath::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_CurrIndex));
- m_Points.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Ready));
+ PersistMgr->Transfer(TMEMBER(_currIndex));
+ _points.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_ready));
return S_OK;
}
diff --git a/engines/wintermute/AdPath.h b/engines/wintermute/AdPath.h
index a5424fcd70..372b5e1cd4 100644
--- a/engines/wintermute/AdPath.h
+++ b/engines/wintermute/AdPath.h
@@ -46,9 +46,9 @@ public:
void Reset();
CAdPath(CBGame *inGame);
virtual ~CAdPath();
- CBArray <CBPoint *, CBPoint *> m_Points;
- int m_CurrIndex;
- bool m_Ready;
+ CBArray <CBPoint *, CBPoint *> _points;
+ int _currIndex;
+ bool _ready;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/AdPathPoint.cpp b/engines/wintermute/AdPathPoint.cpp
index 3bffcd4c73..6ebb5b9090 100644
--- a/engines/wintermute/AdPathPoint.cpp
+++ b/engines/wintermute/AdPathPoint.cpp
@@ -36,10 +36,10 @@ IMPLEMENT_PERSISTENT(CAdPathPoint, false)
//////////////////////////////////////////////////////////////////////////
CAdPathPoint::CAdPathPoint() {
x = y = 0;
- m_Distance = 0;
+ _distance = 0;
- m_Marked = false;
- m_Origin = NULL;
+ _marked = false;
+ _origin = NULL;
}
@@ -47,16 +47,16 @@ CAdPathPoint::CAdPathPoint() {
CAdPathPoint::CAdPathPoint(int initX, int initY, int initDistance) {
x = initX;
y = initY;
- m_Distance = initDistance;
+ _distance = initDistance;
- m_Marked = false;
- m_Origin = NULL;
+ _marked = false;
+ _origin = NULL;
}
//////////////////////////////////////////////////////////////////////////
CAdPathPoint::~CAdPathPoint() {
- m_Origin = NULL;
+ _origin = NULL;
}
@@ -65,9 +65,9 @@ HRESULT CAdPathPoint::Persist(CBPersistMgr *PersistMgr) {
CBPoint::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Distance));
- PersistMgr->Transfer(TMEMBER(m_Marked));
- PersistMgr->Transfer(TMEMBER(m_Origin));
+ PersistMgr->Transfer(TMEMBER(_distance));
+ PersistMgr->Transfer(TMEMBER(_marked));
+ PersistMgr->Transfer(TMEMBER(_origin));
return S_OK;
}
diff --git a/engines/wintermute/AdPathPoint.h b/engines/wintermute/AdPathPoint.h
index 0196f42701..56dee7405c 100644
--- a/engines/wintermute/AdPathPoint.h
+++ b/engines/wintermute/AdPathPoint.h
@@ -40,9 +40,9 @@ public:
CAdPathPoint(int initX, int initY, int initDistance);
CAdPathPoint();
virtual ~CAdPathPoint();
- CAdPathPoint *m_Origin;
- bool m_Marked;
- int m_Distance;
+ CAdPathPoint *_origin;
+ bool _marked;
+ int _distance;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/AdRegion.cpp b/engines/wintermute/AdRegion.cpp
index 51b4070f28..cd8ab049f9 100644
--- a/engines/wintermute/AdRegion.cpp
+++ b/engines/wintermute/AdRegion.cpp
@@ -41,10 +41,10 @@ IMPLEMENT_PERSISTENT(CAdRegion, false)
//////////////////////////////////////////////////////////////////////////
CAdRegion::CAdRegion(CBGame *inGame): CBRegion(inGame) {
- m_Blocked = false;
- m_Decoration = false;
- m_Zoom = 0;
- m_Alpha = 0xFFFFFFFF;
+ _blocked = false;
+ _decoration = false;
+ _zoom = 0;
+ _alpha = 0xFFFFFFFF;
}
@@ -55,7 +55,7 @@ CAdRegion::~CAdRegion() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdRegion::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdRegion::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -63,8 +63,8 @@ HRESULT CAdRegion::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -130,8 +130,8 @@ HRESULT CAdRegion::LoadBuffer(byte *Buffer, bool Complete) {
int i;
- for (i = 0; i < m_Points.GetSize(); i++) delete m_Points[i];
- m_Points.RemoveAll();
+ for (i = 0; i < _points.GetSize(); i++) delete _points[i];
+ _points.RemoveAll();
int ar = 255, ag = 255, ab = 255, alpha = 255;
@@ -150,29 +150,29 @@ HRESULT CAdRegion::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_ACTIVE:
- parser.ScanStr((char *)params, "%b", &m_Active);
+ parser.ScanStr((char *)params, "%b", &_active);
break;
case TOKEN_BLOCKED:
- parser.ScanStr((char *)params, "%b", &m_Blocked);
+ parser.ScanStr((char *)params, "%b", &_blocked);
break;
case TOKEN_DECORATION:
- parser.ScanStr((char *)params, "%b", &m_Decoration);
+ parser.ScanStr((char *)params, "%b", &_decoration);
break;
case TOKEN_ZOOM:
case TOKEN_SCALE: {
int i;
parser.ScanStr((char *)params, "%d", &i);
- m_Zoom = (float)i;
+ _zoom = (float)i;
}
break;
case TOKEN_POINT: {
int x, y;
parser.ScanStr((char *)params, "%d,%d", &x, &y);
- m_Points.Add(new CBPoint(x, y));
+ _points.Add(new CBPoint(x, y));
}
break;
@@ -185,11 +185,11 @@ HRESULT CAdRegion::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_EDITOR_SELECTED:
- parser.ScanStr((char *)params, "%b", &m_EditorSelected);
+ parser.ScanStr((char *)params, "%b", &_editorSelected);
break;
case TOKEN_EDITOR_SELECTED_POINT:
- parser.ScanStr((char *)params, "%d", &m_EditorSelectedPoint);
+ parser.ScanStr((char *)params, "%d", &_editorSelectedPoint);
break;
case TOKEN_SCRIPT:
@@ -212,7 +212,7 @@ HRESULT CAdRegion::LoadBuffer(byte *Buffer, bool Complete) {
CreateRegion();
- m_Alpha = DRGBA(ar, ag, ab, alpha);
+ _alpha = DRGBA(ar, ag, ab, alpha);
return S_OK;
}
@@ -228,8 +228,8 @@ HRESULT CAdRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
if(strcmp(Name, "SkipTo")==0){
Stack->CorrectParams(2);
- m_PosX = Stack->Pop()->GetInt();
- m_PosY = Stack->Pop()->GetInt();
+ _posX = Stack->Pop()->GetInt();
+ _posY = Stack->Pop()->GetInt();
Stack->PushNULL();
return S_OK;
@@ -241,54 +241,54 @@ HRESULT CAdRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
CScValue *CAdRegion::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("ad region");
- return m_ScValue;
+ _scValue->SetString("ad region");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Name") == 0) {
- m_ScValue->SetString(m_Name);
- return m_ScValue;
+ _scValue->SetString(_name);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Blocked
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Blocked") == 0) {
- m_ScValue->SetBool(m_Blocked);
- return m_ScValue;
+ _scValue->SetBool(_blocked);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Decoration
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Decoration") == 0) {
- m_ScValue->SetBool(m_Decoration);
- return m_ScValue;
+ _scValue->SetBool(_decoration);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Scale
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scale") == 0) {
- m_ScValue->SetFloat(m_Zoom);
- return m_ScValue;
+ _scValue->SetFloat(_zoom);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AlphaColor") == 0) {
- m_ScValue->SetInt((int)m_Alpha);
- return m_ScValue;
+ _scValue->SetInt((int)_alpha);
+ return _scValue;
}
else return CBRegion::ScGetProperty(Name);
@@ -309,7 +309,7 @@ HRESULT CAdRegion::ScSetProperty(char *Name, CScValue *Value) {
// Blocked
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Blocked") == 0) {
- m_Blocked = Value->GetBool();
+ _blocked = Value->GetBool();
return S_OK;
}
@@ -317,7 +317,7 @@ HRESULT CAdRegion::ScSetProperty(char *Name, CScValue *Value) {
// Decoration
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Decoration") == 0) {
- m_Decoration = Value->GetBool();
+ _decoration = Value->GetBool();
return S_OK;
}
@@ -325,7 +325,7 @@ HRESULT CAdRegion::ScSetProperty(char *Name, CScValue *Value) {
// Scale
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scale") == 0) {
- m_Zoom = Value->GetFloat();
+ _zoom = Value->GetFloat();
return S_OK;
}
@@ -333,7 +333,7 @@ HRESULT CAdRegion::ScSetProperty(char *Name, CScValue *Value) {
// AlphaColor
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AlphaColor") == 0) {
- m_Alpha = (uint32)Value->GetInt();
+ _alpha = (uint32)Value->GetInt();
return S_OK;
}
@@ -350,25 +350,25 @@ char *CAdRegion::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdRegion::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "REGION {\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
- Buffer->PutTextIndent(Indent + 2, "BLOCKED=%s\n", m_Blocked ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "DECORATION=%s\n", m_Decoration ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "ACTIVE=%s\n", m_Active ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "SCALE=%d\n", (int)m_Zoom);
- Buffer->PutTextIndent(Indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(m_Alpha), D3DCOLGetG(m_Alpha), D3DCOLGetB(m_Alpha));
- Buffer->PutTextIndent(Indent + 2, "ALPHA = %d\n", D3DCOLGetA(m_Alpha));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", m_EditorSelected ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "BLOCKED=%s\n", _blocked ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "DECORATION=%s\n", _decoration ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "SCALE=%d\n", (int)_zoom);
+ Buffer->PutTextIndent(Indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(_alpha), D3DCOLGetG(_alpha), D3DCOLGetB(_alpha));
+ Buffer->PutTextIndent(Indent + 2, "ALPHA = %d\n", D3DCOLGetA(_alpha));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
int i;
- for (i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- if (m_ScProp) m_ScProp->SaveAsText(Buffer, Indent + 2);
+ if (_scProp) _scProp->SaveAsText(Buffer, Indent + 2);
- for (i = 0; i < m_Points.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "POINT {%d,%d}\n", m_Points[i]->x, m_Points[i]->y);
+ for (i = 0; i < _points.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
}
CBBase::SaveAsText(Buffer, Indent + 2);
@@ -383,10 +383,10 @@ HRESULT CAdRegion::SaveAsText(CBDynBuffer *Buffer, int Indent) {
HRESULT CAdRegion::Persist(CBPersistMgr *PersistMgr) {
CBRegion::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Alpha));
- PersistMgr->Transfer(TMEMBER(m_Blocked));
- PersistMgr->Transfer(TMEMBER(m_Decoration));
- PersistMgr->Transfer(TMEMBER(m_Zoom));
+ PersistMgr->Transfer(TMEMBER(_alpha));
+ PersistMgr->Transfer(TMEMBER(_blocked));
+ PersistMgr->Transfer(TMEMBER(_decoration));
+ PersistMgr->Transfer(TMEMBER(_zoom));
return S_OK;
}
diff --git a/engines/wintermute/AdRegion.h b/engines/wintermute/AdRegion.h
index 61bb4d2a58..b1e977155b 100644
--- a/engines/wintermute/AdRegion.h
+++ b/engines/wintermute/AdRegion.h
@@ -36,10 +36,10 @@ namespace WinterMute {
class CAdRegion : public CBRegion {
public:
DECLARE_PERSISTENT(CAdRegion, CBRegion)
- uint32 m_Alpha;
- float m_Zoom;
- bool m_Blocked;
- bool m_Decoration;
+ uint32 _alpha;
+ float _zoom;
+ bool _blocked;
+ bool _decoration;
CAdRegion(CBGame *inGame);
virtual ~CAdRegion();
HRESULT LoadFile(char *Filename);
diff --git a/engines/wintermute/AdResponse.cpp b/engines/wintermute/AdResponse.cpp
index e9a84b4bd4..c02b2832b5 100644
--- a/engines/wintermute/AdResponse.cpp
+++ b/engines/wintermute/AdResponse.cpp
@@ -39,46 +39,46 @@ IMPLEMENT_PERSISTENT(CAdResponse, false)
//////////////////////////////////////////////////////////////////////////
CAdResponse::CAdResponse(CBGame *inGame): CBObject(inGame) {
- m_Text = NULL;
- m_TextOrig = NULL;
- m_Icon = m_IconHover = m_IconPressed = NULL;
- m_Font = NULL;
- m_ID = 0;
- m_ResponseType = RESPONSE_ALWAYS;
+ _text = NULL;
+ _textOrig = NULL;
+ _icon = _iconHover = _iconPressed = NULL;
+ _font = NULL;
+ _iD = 0;
+ _responseType = RESPONSE_ALWAYS;
}
//////////////////////////////////////////////////////////////////////////
CAdResponse::~CAdResponse() {
- delete[] m_Text;
- delete[] m_TextOrig;
- delete m_Icon;
- delete m_IconHover;
- delete m_IconPressed;
- m_Text = NULL;
- m_TextOrig = NULL;
- m_Icon = NULL;
- m_IconHover = NULL;
- m_IconPressed = NULL;
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
+ delete[] _text;
+ delete[] _textOrig;
+ delete _icon;
+ delete _iconHover;
+ delete _iconPressed;
+ _text = NULL;
+ _textOrig = NULL;
+ _icon = NULL;
+ _iconHover = NULL;
+ _iconPressed = NULL;
+ if (_font) Game->_fontStorage->RemoveFont(_font);
}
//////////////////////////////////////////////////////////////////////////
void CAdResponse::SetText(char *Text) {
- CBUtils::SetString(&m_Text, Text);
- CBUtils::SetString(&m_TextOrig, Text);
+ CBUtils::SetString(&_text, Text);
+ CBUtils::SetString(&_textOrig, Text);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponse::SetIcon(char *Filename) {
- delete m_Icon;
- m_Icon = new CBSprite(Game);
- if (!m_Icon || FAILED(m_Icon->LoadFile(Filename))) {
+ delete _icon;
+ _icon = new CBSprite(Game);
+ if (!_icon || FAILED(_icon->LoadFile(Filename))) {
Game->LOG(0, "CAdResponse::SetIcon failed for file '%s'", Filename);
- delete m_Icon;
- m_Icon = NULL;
+ delete _icon;
+ _icon = NULL;
return E_FAIL;
}
return S_OK;
@@ -86,9 +86,9 @@ HRESULT CAdResponse::SetIcon(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponse::SetFont(char *Filename) {
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
- m_Font = Game->m_FontStorage->AddFont(Filename);
- if (!m_Font) {
+ if (_font) Game->_fontStorage->RemoveFont(_font);
+ _font = Game->_fontStorage->AddFont(Filename);
+ if (!_font) {
Game->LOG(0, "CAdResponse::SetFont failed for file '%s'", Filename);
return E_FAIL;
}
@@ -97,12 +97,12 @@ HRESULT CAdResponse::SetFont(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponse::SetIconHover(char *Filename) {
- delete m_IconHover;
- m_IconHover = new CBSprite(Game);
- if (!m_IconHover || FAILED(m_IconHover->LoadFile(Filename))) {
+ delete _iconHover;
+ _iconHover = new CBSprite(Game);
+ if (!_iconHover || FAILED(_iconHover->LoadFile(Filename))) {
Game->LOG(0, "CAdResponse::SetIconHover failed for file '%s'", Filename);
- delete m_IconHover;
- m_IconHover = NULL;
+ delete _iconHover;
+ _iconHover = NULL;
return E_FAIL;
}
return S_OK;
@@ -111,12 +111,12 @@ HRESULT CAdResponse::SetIconHover(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponse::SetIconPressed(char *Filename) {
- delete m_IconPressed;
- m_IconPressed = new CBSprite(Game);
- if (!m_IconPressed || FAILED(m_IconPressed->LoadFile(Filename))) {
+ delete _iconPressed;
+ _iconPressed = new CBSprite(Game);
+ if (!_iconPressed || FAILED(_iconPressed->LoadFile(Filename))) {
Game->LOG(0, "CAdResponse::SetIconPressed failed for file '%s'", Filename);
- delete m_IconPressed;
- m_IconPressed = NULL;
+ delete _iconPressed;
+ _iconPressed = NULL;
return E_FAIL;
}
return S_OK;
@@ -128,14 +128,14 @@ HRESULT CAdResponse::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Icon));
- PersistMgr->Transfer(TMEMBER(m_IconHover));
- PersistMgr->Transfer(TMEMBER(m_IconPressed));
- PersistMgr->Transfer(TMEMBER(m_ID));
- PersistMgr->Transfer(TMEMBER(m_Text));
- PersistMgr->Transfer(TMEMBER(m_TextOrig));
- PersistMgr->Transfer(TMEMBER_INT(m_ResponseType));
- PersistMgr->Transfer(TMEMBER(m_Font));
+ PersistMgr->Transfer(TMEMBER(_icon));
+ PersistMgr->Transfer(TMEMBER(_iconHover));
+ PersistMgr->Transfer(TMEMBER(_iconPressed));
+ PersistMgr->Transfer(TMEMBER(_iD));
+ PersistMgr->Transfer(TMEMBER(_text));
+ PersistMgr->Transfer(TMEMBER(_textOrig));
+ PersistMgr->Transfer(TMEMBER_INT(_responseType));
+ PersistMgr->Transfer(TMEMBER(_font));
return S_OK;
}
diff --git a/engines/wintermute/AdResponse.h b/engines/wintermute/AdResponse.h
index 5c529f4b81..97fe5bccb0 100644
--- a/engines/wintermute/AdResponse.h
+++ b/engines/wintermute/AdResponse.h
@@ -43,16 +43,16 @@ public:
HRESULT SetIconHover(char *Filename);
HRESULT SetIconPressed(char *Filename);
void SetText(char *Text);
- int m_ID;
- CBSprite *m_Icon;
- CBSprite *m_IconHover;
- CBSprite *m_IconPressed;
- CBFont *m_Font;
- char *m_Text;
- char *m_TextOrig;
+ int _iD;
+ CBSprite *_icon;
+ CBSprite *_iconHover;
+ CBSprite *_iconPressed;
+ CBFont *_font;
+ char *_text;
+ char *_textOrig;
CAdResponse(CBGame *inGame);
virtual ~CAdResponse();
- TResponseType m_ResponseType;
+ TResponseType _responseType;
};
diff --git a/engines/wintermute/AdResponseBox.cpp b/engines/wintermute/AdResponseBox.cpp
index d2ff7db96f..45b73ae148 100644
--- a/engines/wintermute/AdResponseBox.cpp
+++ b/engines/wintermute/AdResponseBox.cpp
@@ -51,70 +51,70 @@ IMPLEMENT_PERSISTENT(CAdResponseBox, false)
//////////////////////////////////////////////////////////////////////////
CAdResponseBox::CAdResponseBox(CBGame *inGame): CBObject(inGame) {
- m_Font = m_FontHover = NULL;
+ _font = _fontHover = NULL;
- m_Window = NULL;
- m_ShieldWindow = new CUIWindow(Game);
+ _window = NULL;
+ _shieldWindow = new CUIWindow(Game);
- m_Horizontal = false;
- CBPlatform::SetRectEmpty(&m_ResponseArea);
- m_ScrollOffset = 0;
- m_Spacing = 0;
+ _horizontal = false;
+ CBPlatform::SetRectEmpty(&_responseArea);
+ _scrollOffset = 0;
+ _spacing = 0;
- m_WaitingScript = NULL;
- m_LastResponseText = NULL;
- m_LastResponseTextOrig = NULL;
+ _waitingScript = NULL;
+ _lastResponseText = NULL;
+ _lastResponseTextOrig = NULL;
- m_VerticalAlign = VAL_BOTTOM;
- m_Align = TAL_LEFT;
+ _verticalAlign = VAL_BOTTOM;
+ _align = TAL_LEFT;
}
//////////////////////////////////////////////////////////////////////////
CAdResponseBox::~CAdResponseBox() {
- SAFE_DELETE(m_Window);
- SAFE_DELETE(m_ShieldWindow);
- SAFE_DELETE_ARRAY(m_LastResponseText);
- SAFE_DELETE_ARRAY(m_LastResponseTextOrig);
+ SAFE_DELETE(_window);
+ SAFE_DELETE(_shieldWindow);
+ SAFE_DELETE_ARRAY(_lastResponseText);
+ SAFE_DELETE_ARRAY(_lastResponseTextOrig);
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
- if (m_FontHover) Game->m_FontStorage->RemoveFont(m_FontHover);
+ if (_font) Game->_fontStorage->RemoveFont(_font);
+ if (_fontHover) Game->_fontStorage->RemoveFont(_fontHover);
ClearResponses();
ClearButtons();
- m_WaitingScript = NULL;
+ _waitingScript = NULL;
}
//////////////////////////////////////////////////////////////////////////
void CAdResponseBox::ClearResponses() {
- for (int i = 0; i < m_Responses.GetSize(); i++) {
- delete m_Responses[i];
+ for (int i = 0; i < _responses.GetSize(); i++) {
+ delete _responses[i];
}
- m_Responses.RemoveAll();
+ _responses.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
void CAdResponseBox::ClearButtons() {
- for (int i = 0; i < m_RespButtons.GetSize(); i++) {
- delete m_RespButtons[i];
+ for (int i = 0; i < _respButtons.GetSize(); i++) {
+ delete _respButtons[i];
}
- m_RespButtons.RemoveAll();
+ _respButtons.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponseBox::InvalidateButtons() {
- for (int i = 0; i < m_RespButtons.GetSize(); i++) {
- m_RespButtons[i]->m_Image = NULL;
- m_RespButtons[i]->m_Cursor = NULL;
- m_RespButtons[i]->m_Font = NULL;
- m_RespButtons[i]->m_FontHover = NULL;
- m_RespButtons[i]->m_FontPress = NULL;
- m_RespButtons[i]->SetText("");
+ for (int i = 0; i < _respButtons.GetSize(); i++) {
+ _respButtons[i]->_image = NULL;
+ _respButtons[i]->_cursor = NULL;
+ _respButtons[i]->_font = NULL;
+ _respButtons[i]->_fontHover = NULL;
+ _respButtons[i]->_fontPress = NULL;
+ _respButtons[i]->SetText("");
}
return S_OK;
}
@@ -124,59 +124,59 @@ HRESULT CAdResponseBox::InvalidateButtons() {
HRESULT CAdResponseBox::CreateButtons() {
ClearButtons();
- m_ScrollOffset = 0;
- for (int i = 0; i < m_Responses.GetSize(); i++) {
+ _scrollOffset = 0;
+ for (int i = 0; i < _responses.GetSize(); i++) {
CUIButton *btn = new CUIButton(Game);
if (btn) {
- btn->m_Parent = m_Window;
- btn->m_SharedFonts = btn->m_SharedImages = true;
- btn->m_SharedCursors = true;
+ btn->_parent = _window;
+ btn->_sharedFonts = btn->_sharedImages = true;
+ btn->_sharedCursors = true;
// iconic
- if (m_Responses[i]->m_Icon) {
- btn->m_Image = m_Responses[i]->m_Icon;
- if (m_Responses[i]->m_IconHover) btn->m_ImageHover = m_Responses[i]->m_IconHover;
- if (m_Responses[i]->m_IconPressed) btn->m_ImagePress = m_Responses[i]->m_IconPressed;
-
- btn->SetCaption(m_Responses[i]->m_Text);
- if (m_Cursor) btn->m_Cursor = m_Cursor;
- else if (Game->m_ActiveCursor) btn->m_Cursor = Game->m_ActiveCursor;
+ if (_responses[i]->_icon) {
+ btn->_image = _responses[i]->_icon;
+ if (_responses[i]->_iconHover) btn->_imageHover = _responses[i]->_iconHover;
+ if (_responses[i]->_iconPressed) btn->_imagePress = _responses[i]->_iconPressed;
+
+ btn->SetCaption(_responses[i]->_text);
+ if (_cursor) btn->_cursor = _cursor;
+ else if (Game->_activeCursor) btn->_cursor = Game->_activeCursor;
}
// textual
else {
- btn->SetText(m_Responses[i]->m_Text);
- btn->m_Font = (m_Font == NULL) ? Game->m_SystemFont : m_Font;
- btn->m_FontHover = (m_FontHover == NULL) ? Game->m_SystemFont : m_FontHover;
- btn->m_FontPress = btn->m_FontHover;
- btn->m_Align = m_Align;
+ btn->SetText(_responses[i]->_text);
+ btn->_font = (_font == NULL) ? Game->_systemFont : _font;
+ btn->_fontHover = (_fontHover == NULL) ? Game->_systemFont : _fontHover;
+ btn->_fontPress = btn->_fontHover;
+ btn->_align = _align;
- if (Game->m_TouchInterface)
- btn->m_FontHover = btn->m_Font;
+ if (Game->_touchInterface)
+ btn->_fontHover = btn->_font;
- if (m_Responses[i]->m_Font) btn->m_Font = m_Responses[i]->m_Font;
+ if (_responses[i]->_font) btn->_font = _responses[i]->_font;
- btn->m_Width = m_ResponseArea.right - m_ResponseArea.left;
- if (btn->m_Width <= 0) btn->m_Width = Game->m_Renderer->m_Width;
+ btn->_width = _responseArea.right - _responseArea.left;
+ if (btn->_width <= 0) btn->_width = Game->_renderer->_width;
}
btn->SetName("response");
btn->CorrectSize();
// make the responses touchable
- if (Game->m_TouchInterface)
- btn->m_Height = std::max(btn->m_Height, 50);
+ if (Game->_touchInterface)
+ btn->_height = std::max(btn->_height, 50);
- //btn->SetListener(this, btn, m_Responses[i]->m_ID);
+ //btn->SetListener(this, btn, _responses[i]->_iD);
btn->SetListener(this, btn, i);
- btn->m_Visible = false;
- m_RespButtons.Add(btn);
+ btn->_visible = false;
+ _respButtons.Add(btn);
- if (m_ResponseArea.bottom - m_ResponseArea.top < btn->m_Height) {
- Game->LOG(0, "Warning: Response '%s' is too high to be displayed within response box. Correcting.", m_Responses[i]->m_Text);
- m_ResponseArea.bottom += (btn->m_Height - (m_ResponseArea.bottom - m_ResponseArea.top));
+ if (_responseArea.bottom - _responseArea.top < btn->_height) {
+ Game->LOG(0, "Warning: Response '%s' is too high to be displayed within response box. Correcting.", _responses[i]->_text);
+ _responseArea.bottom += (btn->_height - (_responseArea.bottom - _responseArea.top));
}
}
}
- m_Ready = false;
+ _ready = false;
return S_OK;
}
@@ -184,7 +184,7 @@ HRESULT CAdResponseBox::CreateButtons() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponseBox::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdResponseBox::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -192,8 +192,8 @@ HRESULT CAdResponseBox::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -255,48 +255,48 @@ HRESULT CAdResponseBox::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_WINDOW:
- SAFE_DELETE(m_Window);
- m_Window = new CUIWindow(Game);
- if (!m_Window || FAILED(m_Window->LoadBuffer(params, false))) {
- SAFE_DELETE(m_Window);
+ SAFE_DELETE(_window);
+ _window = new CUIWindow(Game);
+ if (!_window || FAILED(_window->LoadBuffer(params, false))) {
+ SAFE_DELETE(_window);
cmd = PARSERR_GENERIC;
- } else if (m_ShieldWindow) m_ShieldWindow->m_Parent = m_Window;
+ } else if (_shieldWindow) _shieldWindow->_parent = _window;
break;
case TOKEN_FONT:
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
- m_Font = Game->m_FontStorage->AddFont((char *)params);
- if (!m_Font) cmd = PARSERR_GENERIC;
+ if (_font) Game->_fontStorage->RemoveFont(_font);
+ _font = Game->_fontStorage->AddFont((char *)params);
+ if (!_font) cmd = PARSERR_GENERIC;
break;
case TOKEN_FONT_HOVER:
- if (m_FontHover) Game->m_FontStorage->RemoveFont(m_FontHover);
- m_FontHover = Game->m_FontStorage->AddFont((char *)params);
- if (!m_FontHover) cmd = PARSERR_GENERIC;
+ if (_fontHover) Game->_fontStorage->RemoveFont(_fontHover);
+ _fontHover = Game->_fontStorage->AddFont((char *)params);
+ if (!_fontHover) cmd = PARSERR_GENERIC;
break;
case TOKEN_AREA:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_ResponseArea.left, &m_ResponseArea.top, &m_ResponseArea.right, &m_ResponseArea.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_responseArea.left, &_responseArea.top, &_responseArea.right, &_responseArea.bottom);
break;
case TOKEN_HORIZONTAL:
- parser.ScanStr((char *)params, "%b", &m_Horizontal);
+ parser.ScanStr((char *)params, "%b", &_horizontal);
break;
case TOKEN_TEXT_ALIGN:
- if (scumm_stricmp((char *)params, "center") == 0) m_Align = TAL_CENTER;
- else if (scumm_stricmp((char *)params, "right") == 0) m_Align = TAL_RIGHT;
- else m_Align = TAL_LEFT;
+ if (scumm_stricmp((char *)params, "center") == 0) _align = TAL_CENTER;
+ else if (scumm_stricmp((char *)params, "right") == 0) _align = TAL_RIGHT;
+ else _align = TAL_LEFT;
break;
case TOKEN_VERTICAL_ALIGN:
- if (scumm_stricmp((char *)params, "top") == 0) m_VerticalAlign = VAL_TOP;
- else if (scumm_stricmp((char *)params, "center") == 0) m_VerticalAlign = VAL_CENTER;
- else m_VerticalAlign = VAL_BOTTOM;
+ if (scumm_stricmp((char *)params, "top") == 0) _verticalAlign = VAL_TOP;
+ else if (scumm_stricmp((char *)params, "center") == 0) _verticalAlign = VAL_CENTER;
+ else _verticalAlign = VAL_BOTTOM;
break;
case TOKEN_SPACING:
- parser.ScanStr((char *)params, "%d", &m_Spacing);
+ parser.ScanStr((char *)params, "%d", &_spacing);
break;
case TOKEN_EDITOR_PROPERTY:
@@ -304,10 +304,10 @@ HRESULT CAdResponseBox::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_CURSOR:
- SAFE_DELETE(m_Cursor);
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- SAFE_DELETE(m_Cursor);
+ SAFE_DELETE(_cursor);
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ SAFE_DELETE(_cursor);
cmd = PARSERR_GENERIC;
}
break;
@@ -318,10 +318,10 @@ HRESULT CAdResponseBox::LoadBuffer(byte *Buffer, bool Complete) {
return E_FAIL;
}
- if (m_Window) {
- for (int i = 0; i < m_Window->m_Widgets.GetSize(); i++) {
- if (!m_Window->m_Widgets[i]->m_ListenerObject)
- m_Window->m_Widgets[i]->SetListener(this, m_Window->m_Widgets[i], 0);
+ if (_window) {
+ for (int i = 0; i < _window->_widgets.GetSize(); i++) {
+ if (!_window->_widgets[i]->_listenerObject)
+ _window->_widgets[i]->SetListener(this, _window->_widgets[i], 0);
}
}
@@ -333,19 +333,19 @@ HRESULT CAdResponseBox::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "RESPONSE_BOX\n");
Buffer->PutTextIndent(Indent, "{\n");
- Buffer->PutTextIndent(Indent + 2, "AREA { %d, %d, %d, %d }\n", m_ResponseArea.left, m_ResponseArea.top, m_ResponseArea.right, m_ResponseArea.bottom);
+ Buffer->PutTextIndent(Indent + 2, "AREA { %d, %d, %d, %d }\n", _responseArea.left, _responseArea.top, _responseArea.right, _responseArea.bottom);
- if (m_Font && m_Font->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", m_Font->m_Filename);
- if (m_FontHover && m_FontHover->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT_HOVER=\"%s\"\n", m_FontHover->m_Filename);
+ if (_font && _font->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
+ if (_fontHover && _fontHover->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT_HOVER=\"%s\"\n", _fontHover->_filename);
- if (m_Cursor && m_Cursor->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", m_Cursor->m_Filename);
+ if (_cursor && _cursor->_filename)
+ Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
- Buffer->PutTextIndent(Indent + 2, "HORIZONTAL=%s\n", m_Horizontal ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "HORIZONTAL=%s\n", _horizontal ? "TRUE" : "FALSE");
- switch (m_Align) {
+ switch (_align) {
case TAL_LEFT:
Buffer->PutTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
break;
@@ -357,7 +357,7 @@ HRESULT CAdResponseBox::SaveAsText(CBDynBuffer *Buffer, int Indent) {
break;
}
- switch (m_VerticalAlign) {
+ switch (_verticalAlign) {
case VAL_TOP:
Buffer->PutTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "top");
break;
@@ -369,12 +369,12 @@ HRESULT CAdResponseBox::SaveAsText(CBDynBuffer *Buffer, int Indent) {
break;
}
- Buffer->PutTextIndent(Indent + 2, "SPACING=%d\n", m_Spacing);
+ Buffer->PutTextIndent(Indent + 2, "SPACING=%d\n", _spacing);
Buffer->PutTextIndent(Indent + 2, "\n");
// window
- if (m_Window) m_Window->SaveAsText(Buffer, Indent + 2);
+ if (_window) _window->SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent + 2, "\n");
@@ -388,10 +388,10 @@ HRESULT CAdResponseBox::SaveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponseBox::Display() {
- RECT rect = m_ResponseArea;
- if (m_Window) {
- CBPlatform::OffsetRect(&rect, m_Window->m_PosX, m_Window->m_PosY);
- //m_Window->Display();
+ RECT rect = _responseArea;
+ if (_window) {
+ CBPlatform::OffsetRect(&rect, _window->_posX, _window->_posY);
+ //_window->Display();
}
int xxx, yyy, i;
@@ -400,12 +400,12 @@ HRESULT CAdResponseBox::Display() {
yyy = rect.top;
// shift down if needed
- if (!m_Horizontal) {
+ if (!_horizontal) {
int total_height = 0;
- for (i = 0; i < m_RespButtons.GetSize(); i++) total_height += (m_RespButtons[i]->m_Height + m_Spacing);
- total_height -= m_Spacing;
+ for (i = 0; i < _respButtons.GetSize(); i++) total_height += (_respButtons[i]->_height + _spacing);
+ total_height -= _spacing;
- switch (m_VerticalAlign) {
+ switch (_verticalAlign) {
case VAL_BOTTOM:
if (yyy + total_height < rect.bottom)
yyy = rect.bottom - total_height;
@@ -424,48 +424,48 @@ HRESULT CAdResponseBox::Display() {
// prepare response buttons
bool scroll_needed = false;
- for (i = m_ScrollOffset; i < m_RespButtons.GetSize(); i++) {
- if ((m_Horizontal && xxx + m_RespButtons[i]->m_Width > rect.right)
- || (!m_Horizontal && yyy + m_RespButtons[i]->m_Height > rect.bottom)) {
+ for (i = _scrollOffset; i < _respButtons.GetSize(); i++) {
+ if ((_horizontal && xxx + _respButtons[i]->_width > rect.right)
+ || (!_horizontal && yyy + _respButtons[i]->_height > rect.bottom)) {
scroll_needed = true;
- m_RespButtons[i]->m_Visible = false;
+ _respButtons[i]->_visible = false;
break;
}
- m_RespButtons[i]->m_Visible = true;
- m_RespButtons[i]->m_PosX = xxx;
- m_RespButtons[i]->m_PosY = yyy;
+ _respButtons[i]->_visible = true;
+ _respButtons[i]->_posX = xxx;
+ _respButtons[i]->_posY = yyy;
- if (m_Horizontal) {
- xxx += (m_RespButtons[i]->m_Width + m_Spacing);
+ if (_horizontal) {
+ xxx += (_respButtons[i]->_width + _spacing);
} else {
- yyy += (m_RespButtons[i]->m_Height + m_Spacing);
+ yyy += (_respButtons[i]->_height + _spacing);
}
}
// show appropriate scroll buttons
- if (m_Window) {
- m_Window->ShowWidget("prev", m_ScrollOffset > 0);
- m_Window->ShowWidget("next", scroll_needed);
+ if (_window) {
+ _window->ShowWidget("prev", _scrollOffset > 0);
+ _window->ShowWidget("next", scroll_needed);
}
// go exclusive
- if (m_ShieldWindow) {
- m_ShieldWindow->m_PosX = m_ShieldWindow->m_PosY = 0;
- m_ShieldWindow->m_Width = Game->m_Renderer->m_Width;
- m_ShieldWindow->m_Height = Game->m_Renderer->m_Height;
+ if (_shieldWindow) {
+ _shieldWindow->_posX = _shieldWindow->_posY = 0;
+ _shieldWindow->_width = Game->_renderer->_width;
+ _shieldWindow->_height = Game->_renderer->_height;
- m_ShieldWindow->Display();
+ _shieldWindow->Display();
}
// display window
- if (m_Window) m_Window->Display();
+ if (_window) _window->Display();
// display response buttons
- for (i = m_ScrollOffset; i < m_RespButtons.GetSize(); i++) {
- m_RespButtons[i]->Display();
+ for (i = _scrollOffset; i < _respButtons.GetSize(); i++) {
+ _respButtons[i]->Display();
}
return S_OK;
@@ -476,19 +476,19 @@ HRESULT CAdResponseBox::Display() {
HRESULT CAdResponseBox::Listen(CBScriptHolder *param1, uint32 param2) {
CUIObject *obj = (CUIObject *)param1;
- switch (obj->m_Type) {
+ switch (obj->_type) {
case UI_BUTTON:
- if (scumm_stricmp(obj->m_Name, "prev") == 0) {
- m_ScrollOffset--;
- } else if (scumm_stricmp(obj->m_Name, "next") == 0) {
- m_ScrollOffset++;
- } else if (scumm_stricmp(obj->m_Name, "response") == 0) {
- if (m_WaitingScript) m_WaitingScript->m_Stack->PushInt(m_Responses[param2]->m_ID);
- HandleResponse(m_Responses[param2]);
- m_WaitingScript = NULL;
- Game->m_State = GAME_RUNNING;
- ((CAdGame *)Game)->m_StateEx = GAME_NORMAL;
- m_Ready = true;
+ if (scumm_stricmp(obj->_name, "prev") == 0) {
+ _scrollOffset--;
+ } else if (scumm_stricmp(obj->_name, "next") == 0) {
+ _scrollOffset++;
+ } else if (scumm_stricmp(obj->_name, "response") == 0) {
+ if (_waitingScript) _waitingScript->_stack->PushInt(_responses[param2]->_iD);
+ HandleResponse(_responses[param2]);
+ _waitingScript = NULL;
+ Game->_state = GAME_RUNNING;
+ ((CAdGame *)Game)->_stateEx = GAME_NORMAL;
+ _ready = true;
InvalidateButtons();
ClearResponses();
} else return CBObject::Listen(param1, param2);
@@ -503,22 +503,22 @@ HRESULT CAdResponseBox::Listen(CBScriptHolder *param1, uint32 param2) {
HRESULT CAdResponseBox::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Font));
- PersistMgr->Transfer(TMEMBER(m_FontHover));
- PersistMgr->Transfer(TMEMBER(m_Horizontal));
- PersistMgr->Transfer(TMEMBER(m_LastResponseText));
- PersistMgr->Transfer(TMEMBER(m_LastResponseTextOrig));
- m_RespButtons.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_ResponseArea));
- m_Responses.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_ScrollOffset));
- PersistMgr->Transfer(TMEMBER(m_ShieldWindow));
- PersistMgr->Transfer(TMEMBER(m_Spacing));
- PersistMgr->Transfer(TMEMBER(m_WaitingScript));
- PersistMgr->Transfer(TMEMBER(m_Window));
-
- PersistMgr->Transfer(TMEMBER_INT(m_VerticalAlign));
- PersistMgr->Transfer(TMEMBER_INT(m_Align));
+ PersistMgr->Transfer(TMEMBER(_font));
+ PersistMgr->Transfer(TMEMBER(_fontHover));
+ PersistMgr->Transfer(TMEMBER(_horizontal));
+ PersistMgr->Transfer(TMEMBER(_lastResponseText));
+ PersistMgr->Transfer(TMEMBER(_lastResponseTextOrig));
+ _respButtons.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_responseArea));
+ _responses.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_scrollOffset));
+ PersistMgr->Transfer(TMEMBER(_shieldWindow));
+ PersistMgr->Transfer(TMEMBER(_spacing));
+ PersistMgr->Transfer(TMEMBER(_waitingScript));
+ PersistMgr->Transfer(TMEMBER(_window));
+
+ PersistMgr->Transfer(TMEMBER_INT(_verticalAlign));
+ PersistMgr->Transfer(TMEMBER_INT(_align));
return S_OK;
}
@@ -528,20 +528,20 @@ HRESULT CAdResponseBox::Persist(CBPersistMgr *PersistMgr) {
HRESULT CAdResponseBox::WeedResponses() {
CAdGame *AdGame = (CAdGame *)Game;
- for (int i = 0; i < m_Responses.GetSize(); i++) {
- switch (m_Responses[i]->m_ResponseType) {
+ for (int i = 0; i < _responses.GetSize(); i++) {
+ switch (_responses[i]->_responseType) {
case RESPONSE_ONCE:
- if (AdGame->BranchResponseUsed(m_Responses[i]->m_ID)) {
- delete m_Responses[i];
- m_Responses.RemoveAt(i);
+ if (AdGame->BranchResponseUsed(_responses[i]->_iD)) {
+ delete _responses[i];
+ _responses.RemoveAt(i);
i--;
}
break;
case RESPONSE_ONCE_GAME:
- if (AdGame->GameResponseUsed(m_Responses[i]->m_ID)) {
- delete m_Responses[i];
- m_Responses.RemoveAt(i);
+ if (AdGame->GameResponseUsed(_responses[i]->_iD)) {
+ delete _responses[i];
+ _responses.RemoveAt(i);
i--;
}
break;
@@ -553,24 +553,24 @@ HRESULT CAdResponseBox::WeedResponses() {
//////////////////////////////////////////////////////////////////////////
void CAdResponseBox::SetLastResponseText(char *Text, char *TextOrig) {
- CBUtils::SetString(&m_LastResponseText, Text);
- CBUtils::SetString(&m_LastResponseTextOrig, TextOrig);
+ CBUtils::SetString(&_lastResponseText, Text);
+ CBUtils::SetString(&_lastResponseTextOrig, TextOrig);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponseBox::HandleResponse(CAdResponse *Response) {
- SetLastResponseText(Response->m_Text, Response->m_TextOrig);
+ SetLastResponseText(Response->_text, Response->_textOrig);
CAdGame *AdGame = (CAdGame *)Game;
- switch (Response->m_ResponseType) {
+ switch (Response->_responseType) {
case RESPONSE_ONCE:
- AdGame->AddBranchResponse(Response->m_ID);
+ AdGame->AddBranchResponse(Response->_iD);
break;
case RESPONSE_ONCE_GAME:
- AdGame->AddGameResponse(Response->m_ID);
+ AdGame->AddGameResponse(Response->_iD);
break;
}
@@ -620,10 +620,10 @@ CBObject *CAdResponseBox::GetPrevAccessObject(CBObject *CurrObject) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponseBox::GetObjects(CBArray<CUIObject *, CUIObject *>& Objects, bool InteractiveOnly) {
- for (int i = 0; i < m_RespButtons.GetSize(); i++) {
- Objects.Add(m_RespButtons[i]);
+ for (int i = 0; i < _respButtons.GetSize(); i++) {
+ Objects.Add(_respButtons[i]);
}
- if (m_Window) m_Window->GetWindowObjects(Objects, InteractiveOnly);
+ if (_window) _window->GetWindowObjects(Objects, InteractiveOnly);
return S_OK;
}
diff --git a/engines/wintermute/AdResponseBox.h b/engines/wintermute/AdResponseBox.h
index 6abe9dc1a1..be14a6f248 100644
--- a/engines/wintermute/AdResponseBox.h
+++ b/engines/wintermute/AdResponseBox.h
@@ -46,10 +46,10 @@ public:
HRESULT HandleResponse(CAdResponse *Response);
void SetLastResponseText(char *Text, char *TextOrig);
- char *m_LastResponseText;
- char *m_LastResponseTextOrig;
+ char *_lastResponseText;
+ char *_lastResponseTextOrig;
DECLARE_PERSISTENT(CAdResponseBox, CBObject)
- CScScript *m_WaitingScript;
+ CScScript *_waitingScript;
virtual HRESULT Listen(CBScriptHolder *param1, uint32 param2);
typedef enum {
EVENT_PREV, EVENT_NEXT, EVENT_RESPONSE
@@ -57,24 +57,24 @@ public:
HRESULT WeedResponses();
HRESULT Display();
- int m_Spacing;
- int m_ScrollOffset;
- CBFont *m_FontHover;
- CBFont *m_Font;
+ int _spacing;
+ int _scrollOffset;
+ CBFont *_fontHover;
+ CBFont *_font;
HRESULT CreateButtons();
HRESULT InvalidateButtons();
void ClearButtons();
void ClearResponses();
CAdResponseBox(CBGame *inGame);
virtual ~CAdResponseBox();
- CBArray<CAdResponse *, CAdResponse *> m_Responses;
- CBArray<CUIButton *, CUIButton *> m_RespButtons;
- CUIWindow *m_Window;
- CUIWindow *m_ShieldWindow;
- bool m_Horizontal;
- RECT m_ResponseArea;
- int m_VerticalAlign;
- TTextAlign m_Align;
+ CBArray<CAdResponse *, CAdResponse *> _responses;
+ CBArray<CUIButton *, CUIButton *> _respButtons;
+ CUIWindow *_window;
+ CUIWindow *_shieldWindow;
+ bool _horizontal;
+ RECT _responseArea;
+ int _verticalAlign;
+ TTextAlign _align;
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/AdResponseContext.cpp b/engines/wintermute/AdResponseContext.cpp
index 1e6fad4967..c984ad079c 100644
--- a/engines/wintermute/AdResponseContext.cpp
+++ b/engines/wintermute/AdResponseContext.cpp
@@ -36,34 +36,34 @@ IMPLEMENT_PERSISTENT(CAdResponseContext, false)
//////////////////////////////////////////////////////////////////////////
CAdResponseContext::CAdResponseContext(CBGame *inGame): CBBase(inGame) {
- m_ID = 0;
- m_Context = NULL;
+ _iD = 0;
+ _context = NULL;
}
//////////////////////////////////////////////////////////////////////////
CAdResponseContext::~CAdResponseContext() {
- delete[] m_Context;
- m_Context = NULL;
+ delete[] _context;
+ _context = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdResponseContext::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_Context));
- PersistMgr->Transfer(TMEMBER(m_ID));
+ PersistMgr->Transfer(TMEMBER(_context));
+ PersistMgr->Transfer(TMEMBER(_iD));
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
void CAdResponseContext::SetContext(char *Context) {
- delete[] m_Context;
- m_Context = NULL;
+ delete[] _context;
+ _context = NULL;
if (Context) {
- m_Context = new char [strlen(Context) + 1];
- if (m_Context) strcpy(m_Context, Context);
+ _context = new char [strlen(Context) + 1];
+ if (_context) strcpy(_context, Context);
}
}
diff --git a/engines/wintermute/AdResponseContext.h b/engines/wintermute/AdResponseContext.h
index de3e8c95fa..c4927a79e9 100644
--- a/engines/wintermute/AdResponseContext.h
+++ b/engines/wintermute/AdResponseContext.h
@@ -37,8 +37,8 @@ namespace WinterMute {
class CAdResponseContext : public CBBase {
public:
void SetContext(char *Context);
- int m_ID;
- char *m_Context;
+ int _iD;
+ char *_context;
DECLARE_PERSISTENT(CAdResponseContext, CBBase)
CAdResponseContext(CBGame *inGame);
virtual ~CAdResponseContext();
diff --git a/engines/wintermute/AdRotLevel.cpp b/engines/wintermute/AdRotLevel.cpp
index 11bdb4dba0..1c2ba3ed65 100644
--- a/engines/wintermute/AdRotLevel.cpp
+++ b/engines/wintermute/AdRotLevel.cpp
@@ -41,8 +41,8 @@ IMPLEMENT_PERSISTENT(CAdRotLevel, false)
//////////////////////////////////////////////////////////////////////////
CAdRotLevel::CAdRotLevel(CBGame *inGame): CBObject(inGame) {
- m_PosX = 0;
- m_Rotation = 0.0f;
+ _posX = 0;
+ _rotation = 0.0f;
}
@@ -54,7 +54,7 @@ CAdRotLevel::~CAdRotLevel() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdRotLevel::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdRotLevel::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -62,8 +62,8 @@ HRESULT CAdRotLevel::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -110,13 +110,13 @@ HRESULT CAdRotLevel::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_X:
- parser.ScanStr((char *)params, "%d", &m_PosX);
+ parser.ScanStr((char *)params, "%d", &_posX);
break;
case TOKEN_ROTATION: {
int i;
parser.ScanStr((char *)params, "%d", &i);
- m_Rotation = (float)i;
+ _rotation = (float)i;
}
break;
@@ -137,8 +137,8 @@ HRESULT CAdRotLevel::LoadBuffer(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdRotLevel::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "ROTATION_LEVEL {\n");
- Buffer->PutTextIndent(Indent + 2, "X=%d\n", m_PosX);
- Buffer->PutTextIndent(Indent + 2, "ROTATION=%d\n", (int)m_Rotation);
+ Buffer->PutTextIndent(Indent + 2, "X=%d\n", _posX);
+ Buffer->PutTextIndent(Indent + 2, "ROTATION=%d\n", (int)_rotation);
CBBase::SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent, "}\n");
@@ -151,7 +151,7 @@ HRESULT CAdRotLevel::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Rotation));
+ PersistMgr->Transfer(TMEMBER(_rotation));
return S_OK;
}
diff --git a/engines/wintermute/AdRotLevel.h b/engines/wintermute/AdRotLevel.h
index 91ddbef641..6033935349 100644
--- a/engines/wintermute/AdRotLevel.h
+++ b/engines/wintermute/AdRotLevel.h
@@ -38,7 +38,7 @@ public:
DECLARE_PERSISTENT(CAdRotLevel, CBObject)
CAdRotLevel(CBGame *inGame);
virtual ~CAdRotLevel();
- float m_Rotation;
+ float _rotation;
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
diff --git a/engines/wintermute/AdScaleLevel.cpp b/engines/wintermute/AdScaleLevel.cpp
index 09c4a78062..4edb24eca1 100644
--- a/engines/wintermute/AdScaleLevel.cpp
+++ b/engines/wintermute/AdScaleLevel.cpp
@@ -39,8 +39,8 @@ IMPLEMENT_PERSISTENT(CAdScaleLevel, false)
//////////////////////////////////////////////////////////////////////////
CAdScaleLevel::CAdScaleLevel(CBGame *inGame): CBObject(inGame) {
- m_PosY = 0;
- m_Scale = 100;
+ _posY = 0;
+ _scale = 100;
}
@@ -52,7 +52,7 @@ CAdScaleLevel::~CAdScaleLevel() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScaleLevel::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdScaleLevel::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -60,8 +60,8 @@ HRESULT CAdScaleLevel::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -108,13 +108,13 @@ HRESULT CAdScaleLevel::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_Y:
- parser.ScanStr((char *)params, "%d", &m_PosY);
+ parser.ScanStr((char *)params, "%d", &_posY);
break;
case TOKEN_SCALE: {
int i;
parser.ScanStr((char *)params, "%d", &i);
- m_Scale = (float)i;
+ _scale = (float)i;
}
break;
@@ -135,8 +135,8 @@ HRESULT CAdScaleLevel::LoadBuffer(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScaleLevel::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "SCALE_LEVEL {\n");
- Buffer->PutTextIndent(Indent + 2, "Y=%d\n", m_PosY);
- Buffer->PutTextIndent(Indent + 2, "SCALE=%d\n", (int)m_Scale);
+ Buffer->PutTextIndent(Indent + 2, "Y=%d\n", _posY);
+ Buffer->PutTextIndent(Indent + 2, "SCALE=%d\n", (int)_scale);
CBBase::SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent, "}\n");
@@ -149,7 +149,7 @@ HRESULT CAdScaleLevel::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Scale));
+ PersistMgr->Transfer(TMEMBER(_scale));
return S_OK;
}
diff --git a/engines/wintermute/AdScaleLevel.h b/engines/wintermute/AdScaleLevel.h
index 5fe1cafa6b..fb0cd38264 100644
--- a/engines/wintermute/AdScaleLevel.h
+++ b/engines/wintermute/AdScaleLevel.h
@@ -37,7 +37,7 @@ namespace WinterMute {
class CAdScaleLevel : public CBObject {
public:
DECLARE_PERSISTENT(CAdScaleLevel, CBObject)
- float m_Scale;
+ float _scale;
CAdScaleLevel(CBGame *inGame);
virtual ~CAdScaleLevel();
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/AdScene.cpp b/engines/wintermute/AdScene.cpp
index 37d9fdeaa5..a35f2550a1 100644
--- a/engines/wintermute/AdScene.cpp
+++ b/engines/wintermute/AdScene.cpp
@@ -67,7 +67,7 @@ IMPLEMENT_PERSISTENT(CAdScene, false)
//////////////////////////////////////////////////////////////////////////
CAdScene::CAdScene(CBGame *inGame): CBObject(inGame) {
- m_PFTarget = new CBPoint;
+ _pFTarget = new CBPoint;
SetDefaults();
}
@@ -75,64 +75,64 @@ CAdScene::CAdScene(CBGame *inGame): CBObject(inGame) {
//////////////////////////////////////////////////////////////////////////
CAdScene::~CAdScene() {
Cleanup();
- Game->UnregisterObject(m_Fader);
- delete m_PFTarget;
- m_PFTarget = NULL;
+ Game->UnregisterObject(_fader);
+ delete _pFTarget;
+ _pFTarget = NULL;
}
//////////////////////////////////////////////////////////////////////////
void CAdScene::SetDefaults() {
- m_Initialized = false;
- m_PFReady = true;
- m_PFTargetPath = NULL;
- m_PFRequester = NULL;
- m_MainLayer = NULL;
+ _initialized = false;
+ _pFReady = true;
+ _pFTargetPath = NULL;
+ _pFRequester = NULL;
+ _mainLayer = NULL;
- m_PFPointsNum = 0;
- m_PersistentState = false;
- m_PersistentStateSprites = true;
+ _pFPointsNum = 0;
+ _persistentState = false;
+ _persistentStateSprites = true;
- m_AutoScroll = true;
- m_OffsetLeft = m_OffsetTop = 0;
- m_TargetOffsetLeft = m_TargetOffsetTop = 0;
+ _autoScroll = true;
+ _offsetLeft = _offsetTop = 0;
+ _targetOffsetLeft = _targetOffsetTop = 0;
- m_LastTimeH = m_LastTimeV = 0;
- m_ScrollTimeH = m_ScrollTimeV = 10;
- m_ScrollPixelsH = m_ScrollPixelsV = 1;
+ _lastTimeH = _lastTimeV = 0;
+ _scrollTimeH = _scrollTimeV = 10;
+ _scrollPixelsH = _scrollPixelsV = 1;
- m_PFMaxTime = 15;
+ _pFMaxTime = 15;
- m_ParalaxScrolling = true;
+ _paralaxScrolling = true;
// editor settings
- m_EditorMarginH = m_EditorMarginV = 100;
-
- m_EditorColFrame = 0xE0888888;
- m_EditorColEntity = 0xFF008000;
- m_EditorColRegion = 0xFF0000FF;
- m_EditorColBlocked = 0xFF800080;
- m_EditorColWaypoints = 0xFF0000FF;
- m_EditorColEntitySel = 0xFFFF0000;
- m_EditorColRegionSel = 0xFFFF0000;
- m_EditorColBlockedSel = 0xFFFF0000;
- m_EditorColWaypointsSel = 0xFFFF0000;
- m_EditorColScale = 0xFF00FF00;
- m_EditorColDecor = 0xFF00FFFF;
- m_EditorColDecorSel = 0xFFFF0000;
-
- m_EditorShowRegions = true;
- m_EditorShowBlocked = true;
- m_EditorShowDecor = true;
- m_EditorShowEntities = true;
- m_EditorShowScale = true;
-
- m_ShieldWindow = NULL;
-
- m_Fader = new CBFader(Game);
- Game->RegisterObject(m_Fader);
-
- m_Viewport = NULL;
+ _editorMarginH = _editorMarginV = 100;
+
+ _editorColFrame = 0xE0888888;
+ _editorColEntity = 0xFF008000;
+ _editorColRegion = 0xFF0000FF;
+ _editorColBlocked = 0xFF800080;
+ _editorColWaypoints = 0xFF0000FF;
+ _editorColEntitySel = 0xFFFF0000;
+ _editorColRegionSel = 0xFFFF0000;
+ _editorColBlockedSel = 0xFFFF0000;
+ _editorColWaypointsSel = 0xFFFF0000;
+ _editorColScale = 0xFF00FF00;
+ _editorColDecor = 0xFF00FFFF;
+ _editorColDecorSel = 0xFFFF0000;
+
+ _editorShowRegions = true;
+ _editorShowBlocked = true;
+ _editorShowDecor = true;
+ _editorShowEntities = true;
+ _editorShowScale = true;
+
+ _shieldWindow = NULL;
+
+ _fader = new CBFader(Game);
+ Game->RegisterObject(_fader);
+
+ _viewport = NULL;
}
@@ -140,45 +140,45 @@ void CAdScene::SetDefaults() {
void CAdScene::Cleanup() {
CBObject::Cleanup();
- m_MainLayer = NULL; // reference only
+ _mainLayer = NULL; // reference only
int i;
- delete m_ShieldWindow;
- m_ShieldWindow = NULL;
+ delete _shieldWindow;
+ _shieldWindow = NULL;
- Game->UnregisterObject(m_Fader);
- m_Fader = NULL;
+ Game->UnregisterObject(_fader);
+ _fader = NULL;
- for (i = 0; i < m_Layers.GetSize(); i++)
- Game->UnregisterObject(m_Layers[i]);
- m_Layers.RemoveAll();
+ for (i = 0; i < _layers.GetSize(); i++)
+ Game->UnregisterObject(_layers[i]);
+ _layers.RemoveAll();
- for (i = 0; i < m_WaypointGroups.GetSize(); i++)
- Game->UnregisterObject(m_WaypointGroups[i]);
- m_WaypointGroups.RemoveAll();
+ for (i = 0; i < _waypointGroups.GetSize(); i++)
+ Game->UnregisterObject(_waypointGroups[i]);
+ _waypointGroups.RemoveAll();
- for (i = 0; i < m_ScaleLevels.GetSize(); i++)
- Game->UnregisterObject(m_ScaleLevels[i]);
- m_ScaleLevels.RemoveAll();
+ for (i = 0; i < _scaleLevels.GetSize(); i++)
+ Game->UnregisterObject(_scaleLevels[i]);
+ _scaleLevels.RemoveAll();
- for (i = 0; i < m_RotLevels.GetSize(); i++)
- Game->UnregisterObject(m_RotLevels[i]);
- m_RotLevels.RemoveAll();
+ for (i = 0; i < _rotLevels.GetSize(); i++)
+ Game->UnregisterObject(_rotLevels[i]);
+ _rotLevels.RemoveAll();
- for (i = 0; i < m_PFPath.GetSize(); i++)
- delete m_PFPath[i];
- m_PFPath.RemoveAll();
- m_PFPointsNum = 0;
+ for (i = 0; i < _pFPath.GetSize(); i++)
+ delete _pFPath[i];
+ _pFPath.RemoveAll();
+ _pFPointsNum = 0;
- for (i = 0; i < m_Objects.GetSize(); i++)
- Game->UnregisterObject(m_Objects[i]);
- m_Objects.RemoveAll();
+ for (i = 0; i < _objects.GetSize(); i++)
+ Game->UnregisterObject(_objects[i]);
+ _objects.RemoveAll();
- delete m_Viewport;
- m_Viewport = NULL;
+ delete _viewport;
+ _viewport = NULL;
SetDefaults();
}
@@ -186,22 +186,22 @@ void CAdScene::Cleanup() {
//////////////////////////////////////////////////////////////////////////
bool CAdScene::GetPath(CBPoint source, CBPoint target, CAdPath *path, CBObject *requester) {
- if (!m_PFReady) return false;
+ if (!_pFReady) return false;
else {
- m_PFReady = false;
- *m_PFTarget = target;
- m_PFTargetPath = path;
- m_PFRequester = requester;
+ _pFReady = false;
+ *_pFTarget = target;
+ _pFTargetPath = path;
+ _pFRequester = requester;
- m_PFTargetPath->Reset();
- m_PFTargetPath->SetReady(false);
+ _pFTargetPath->Reset();
+ _pFTargetPath->SetReady(false);
// prepare working path
int i;
PFPointsStart();
// first point
- //m_PFPath.Add(new CAdPathPoint(source.x, source.y, 0));
+ //_pFPath.Add(new CAdPathPoint(source.x, source.y, 0));
// if we're one pixel stuck, get unstuck
int StartX = source.x;
@@ -229,27 +229,27 @@ bool CAdScene::GetPath(CBPoint source, CBPoint target, CAdPath *path, CBObject *
//CorrectTargetPoint(&target.x, &target.y);
// last point
- //m_PFPath.Add(new CAdPathPoint(target.x, target.y, INT_MAX));
+ //_pFPath.Add(new CAdPathPoint(target.x, target.y, INT_MAX));
PFPointsAdd(target.x, target.y, INT_MAX);
// active waypoints
- for (i = 0; i < m_WaypointGroups.GetSize(); i++) {
- if (m_WaypointGroups[i]->m_Active) {
- PFAddWaypointGroup(m_WaypointGroups[i], requester);
+ for (i = 0; i < _waypointGroups.GetSize(); i++) {
+ if (_waypointGroups[i]->_active) {
+ PFAddWaypointGroup(_waypointGroups[i], requester);
}
}
// free waypoints
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Active && m_Objects[i] != requester && m_Objects[i]->m_CurrentWptGroup) {
- PFAddWaypointGroup(m_Objects[i]->m_CurrentWptGroup, requester);
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_active && _objects[i] != requester && _objects[i]->_currentWptGroup) {
+ PFAddWaypointGroup(_objects[i]->_currentWptGroup, requester);
}
}
CAdGame *AdGame = (CAdGame *)Game;
- for (i = 0; i < AdGame->m_Objects.GetSize(); i++) {
- if (AdGame->m_Objects[i]->m_Active && AdGame->m_Objects[i] != requester && AdGame->m_Objects[i]->m_CurrentWptGroup) {
- PFAddWaypointGroup(AdGame->m_Objects[i]->m_CurrentWptGroup, requester);
+ for (i = 0; i < AdGame->_objects.GetSize(); i++) {
+ if (AdGame->_objects[i]->_active && AdGame->_objects[i] != requester && AdGame->_objects[i]->_currentWptGroup) {
+ PFAddWaypointGroup(AdGame->_objects[i]->_currentWptGroup, requester);
}
}
@@ -260,13 +260,13 @@ bool CAdScene::GetPath(CBPoint source, CBPoint target, CAdPath *path, CBObject *
//////////////////////////////////////////////////////////////////////////
void CAdScene::PFAddWaypointGroup(CAdWaypointGroup *Wpt, CBObject *Requester) {
- if (!Wpt->m_Active) return;
+ if (!Wpt->_active) return;
- for (int i = 0; i < Wpt->m_Points.GetSize(); i++) {
- if (IsBlockedAt(Wpt->m_Points[i]->x, Wpt->m_Points[i]->y, true, Requester)) continue;
+ for (int i = 0; i < Wpt->_points.GetSize(); i++) {
+ if (IsBlockedAt(Wpt->_points[i]->x, Wpt->_points[i]->y, true, Requester)) continue;
- //m_PFPath.Add(new CAdPathPoint(Wpt->m_Points[i]->x, Wpt->m_Points[i]->y, INT_MAX));
- PFPointsAdd(Wpt->m_Points[i]->x, Wpt->m_Points[i]->y, INT_MAX);
+ //_pFPath.Add(new CAdPathPoint(Wpt->_points[i]->x, Wpt->_points[i]->y, INT_MAX));
+ PFPointsAdd(Wpt->_points[i]->x, Wpt->_points[i]->y, INT_MAX);
}
}
@@ -276,12 +276,12 @@ float CAdScene::GetZoomAt(int X, int Y) {
float ret = 100;
bool found = false;
- if (m_MainLayer) {
- for (int i = m_MainLayer->m_Nodes.GetSize() - 1; i >= 0; i--) {
- CAdSceneNode *Node = m_MainLayer->m_Nodes[i];
- if (Node->m_Type == OBJECT_REGION && Node->m_Region->m_Active && !Node->m_Region->m_Blocked && Node->m_Region->PointInRegion(X, Y)) {
- if (Node->m_Region->m_Zoom != 0) {
- ret = Node->m_Region->m_Zoom;
+ if (_mainLayer) {
+ for (int i = _mainLayer->_nodes.GetSize() - 1; i >= 0; i--) {
+ CAdSceneNode *Node = _mainLayer->_nodes[i];
+ if (Node->_type == OBJECT_REGION && Node->_region->_active && !Node->_region->_blocked && Node->_region->PointInRegion(X, Y)) {
+ if (Node->_region->_zoom != 0) {
+ ret = Node->_region->_zoom;
found = true;
break;
}
@@ -296,17 +296,17 @@ float CAdScene::GetZoomAt(int X, int Y) {
//////////////////////////////////////////////////////////////////////////
uint32 CAdScene::GetAlphaAt(int X, int Y, bool ColorCheck) {
- if (!Game->m_DEBUG_DebugMode) ColorCheck = false;
+ if (!Game->_dEBUG_DebugMode) ColorCheck = false;
uint32 ret;
if (ColorCheck) ret = 0xFFFF0000;
else ret = 0xFFFFFFFF;
- if (m_MainLayer) {
- for (int i = m_MainLayer->m_Nodes.GetSize() - 1; i >= 0; i--) {
- CAdSceneNode *Node = m_MainLayer->m_Nodes[i];
- if (Node->m_Type == OBJECT_REGION && Node->m_Region->m_Active && (ColorCheck || !Node->m_Region->m_Blocked) && Node->m_Region->PointInRegion(X, Y)) {
- if (!Node->m_Region->m_Blocked) ret = Node->m_Region->m_Alpha;
+ if (_mainLayer) {
+ for (int i = _mainLayer->_nodes.GetSize() - 1; i >= 0; i--) {
+ CAdSceneNode *Node = _mainLayer->_nodes[i];
+ if (Node->_type == OBJECT_REGION && Node->_region->_active && (ColorCheck || !Node->_region->_blocked) && Node->_region->PointInRegion(X, Y)) {
+ if (!Node->_region->_blocked) ret = Node->_region->_alpha;
break;
}
}
@@ -322,32 +322,32 @@ bool CAdScene::IsBlockedAt(int X, int Y, bool CheckFreeObjects, CBObject *Reques
if (CheckFreeObjects) {
int i;
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Active && m_Objects[i] != Requester && m_Objects[i]->m_CurrentBlockRegion) {
- if (m_Objects[i]->m_CurrentBlockRegion->PointInRegion(X, Y)) return true;
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_active && _objects[i] != Requester && _objects[i]->_currentBlockRegion) {
+ if (_objects[i]->_currentBlockRegion->PointInRegion(X, Y)) return true;
}
}
CAdGame *AdGame = (CAdGame *)Game;
- for (i = 0; i < AdGame->m_Objects.GetSize(); i++) {
- if (AdGame->m_Objects[i]->m_Active && AdGame->m_Objects[i] != Requester && AdGame->m_Objects[i]->m_CurrentBlockRegion) {
- if (AdGame->m_Objects[i]->m_CurrentBlockRegion->PointInRegion(X, Y)) return true;
+ for (i = 0; i < AdGame->_objects.GetSize(); i++) {
+ if (AdGame->_objects[i]->_active && AdGame->_objects[i] != Requester && AdGame->_objects[i]->_currentBlockRegion) {
+ if (AdGame->_objects[i]->_currentBlockRegion->PointInRegion(X, Y)) return true;
}
}
}
- if (m_MainLayer) {
- for (int i = 0; i < m_MainLayer->m_Nodes.GetSize(); i++) {
- CAdSceneNode *Node = m_MainLayer->m_Nodes[i];
+ if (_mainLayer) {
+ for (int i = 0; i < _mainLayer->_nodes.GetSize(); i++) {
+ CAdSceneNode *Node = _mainLayer->_nodes[i];
/*
- if(Node->m_Type == OBJECT_REGION && Node->m_Region->m_Active && Node->m_Region->m_Blocked && Node->m_Region->PointInRegion(X, Y))
+ if(Node->_type == OBJECT_REGION && Node->_region->_active && Node->_region->_blocked && Node->_region->PointInRegion(X, Y))
{
ret = true;
break;
}
*/
- if (Node->m_Type == OBJECT_REGION && Node->m_Region->m_Active && !Node->m_Region->m_Decoration && Node->m_Region->PointInRegion(X, Y)) {
- if (Node->m_Region->m_Blocked) {
+ if (Node->_type == OBJECT_REGION && Node->_region->_active && !Node->_region->_decoration && Node->_region->PointInRegion(X, Y)) {
+ if (Node->_region->_blocked) {
ret = true;
break;
} else ret = false;
@@ -365,25 +365,25 @@ bool CAdScene::IsWalkableAt(int X, int Y, bool CheckFreeObjects, CBObject *Reque
if (CheckFreeObjects) {
int i;
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Active && m_Objects[i] != Requester && m_Objects[i]->m_CurrentBlockRegion) {
- if (m_Objects[i]->m_CurrentBlockRegion->PointInRegion(X, Y)) return false;
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_active && _objects[i] != Requester && _objects[i]->_currentBlockRegion) {
+ if (_objects[i]->_currentBlockRegion->PointInRegion(X, Y)) return false;
}
}
CAdGame *AdGame = (CAdGame *)Game;
- for (i = 0; i < AdGame->m_Objects.GetSize(); i++) {
- if (AdGame->m_Objects[i]->m_Active && AdGame->m_Objects[i] != Requester && AdGame->m_Objects[i]->m_CurrentBlockRegion) {
- if (AdGame->m_Objects[i]->m_CurrentBlockRegion->PointInRegion(X, Y)) return false;
+ for (i = 0; i < AdGame->_objects.GetSize(); i++) {
+ if (AdGame->_objects[i]->_active && AdGame->_objects[i] != Requester && AdGame->_objects[i]->_currentBlockRegion) {
+ if (AdGame->_objects[i]->_currentBlockRegion->PointInRegion(X, Y)) return false;
}
}
}
- if (m_MainLayer) {
- for (int i = 0; i < m_MainLayer->m_Nodes.GetSize(); i++) {
- CAdSceneNode *Node = m_MainLayer->m_Nodes[i];
- if (Node->m_Type == OBJECT_REGION && Node->m_Region->m_Active && !Node->m_Region->m_Decoration && Node->m_Region->PointInRegion(X, Y)) {
- if (Node->m_Region->m_Blocked) {
+ if (_mainLayer) {
+ for (int i = 0; i < _mainLayer->_nodes.GetSize(); i++) {
+ CAdSceneNode *Node = _mainLayer->_nodes[i];
+ if (Node->_type == OBJECT_REGION && Node->_region->_active && !Node->_region->_decoration && Node->_region->PointInRegion(X, Y)) {
+ if (Node->_region->_blocked) {
ret = false;
break;
} else ret = true;
@@ -446,39 +446,39 @@ void CAdScene::PathFinderStep() {
int lowest_dist = INT_MAX;
CAdPathPoint *lowest_pt = NULL;
- for (i = 0; i < m_PFPointsNum; i++)
- if (!m_PFPath[i]->m_Marked && m_PFPath[i]->m_Distance < lowest_dist) {
- lowest_dist = m_PFPath[i]->m_Distance;
- lowest_pt = m_PFPath[i];
+ for (i = 0; i < _pFPointsNum; i++)
+ if (!_pFPath[i]->_marked && _pFPath[i]->_distance < lowest_dist) {
+ lowest_dist = _pFPath[i]->_distance;
+ lowest_pt = _pFPath[i];
}
if (lowest_pt == NULL) { // no path -> terminate PathFinder
- m_PFReady = true;
- m_PFTargetPath->SetReady(true);
+ _pFReady = true;
+ _pFTargetPath->SetReady(true);
return;
}
- lowest_pt->m_Marked = true;
+ lowest_pt->_marked = true;
// target point marked, generate path and terminate
- if (lowest_pt->x == m_PFTarget->x && lowest_pt->y == m_PFTarget->y) {
+ if (lowest_pt->x == _pFTarget->x && lowest_pt->y == _pFTarget->y) {
while (lowest_pt != NULL) {
- m_PFTargetPath->m_Points.InsertAt(0, new CBPoint(lowest_pt->x, lowest_pt->y));
- lowest_pt = lowest_pt->m_Origin;
+ _pFTargetPath->_points.InsertAt(0, new CBPoint(lowest_pt->x, lowest_pt->y));
+ lowest_pt = lowest_pt->_origin;
}
- m_PFReady = true;
- m_PFTargetPath->SetReady(true);
+ _pFReady = true;
+ _pFTargetPath->SetReady(true);
return;
}
// otherwise keep on searching
- for (i = 0; i < m_PFPointsNum; i++)
- if (!m_PFPath[i]->m_Marked) {
- int j = GetPointsDist(*lowest_pt, *m_PFPath[i], m_PFRequester);
- if (j != -1 && lowest_pt->m_Distance + j < m_PFPath[i]->m_Distance) {
- m_PFPath[i]->m_Distance = lowest_pt->m_Distance + j;
- m_PFPath[i]->m_Origin = lowest_pt;
+ for (i = 0; i < _pFPointsNum; i++)
+ if (!_pFPath[i]->_marked) {
+ int j = GetPointsDist(*lowest_pt, *_pFPath[i], _pFRequester);
+ if (j != -1 && lowest_pt->_distance + j < _pFPath[i]->_distance) {
+ _pFPath[i]->_distance = lowest_pt->_distance + j;
+ _pFPath[i]->_origin = lowest_pt;
}
}
}
@@ -487,16 +487,16 @@ void CAdScene::PathFinderStep() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::InitLoop() {
#ifdef _DEBUGxxxx
- int num_steps = 0;
- uint32 start = Game->m_CurrentTime;
- while (!m_PFReady && CBPlatform::GetTime() - start <= m_PFMaxTime) {
+ int nu_steps = 0;
+ uint32 start = Game->_currentTime;
+ while (!_pFReady && CBPlatform::GetTime() - start <= _pFMaxTime) {
PathFinderStep();
- num_steps++;
+ nu_steps++;
}
- if (num_steps > 0) Game->LOG(0, "STAT: PathFinder iterations in one loop: %d (%s) m_PFMaxTime=%d", num_steps, m_PFReady ? "finished" : "not yet done", m_PFMaxTime);
+ if (nu_steps > 0) Game->LOG(0, "STAT: PathFinder iterations in one loop: %d (%s) _pFMaxTime=%d", nu_steps, _pFReady ? "finished" : "not yet done", _pFMaxTime);
#else
- uint32 start = Game->m_CurrentTime;
- while (!m_PFReady && CBPlatform::GetTime() - start <= m_PFMaxTime) PathFinderStep();
+ uint32 start = Game->_currentTime;
+ while (!_pFReady && CBPlatform::GetTime() - start <= _pFMaxTime) PathFinderStep();
#endif
return S_OK;
@@ -505,7 +505,7 @@ HRESULT CAdScene::InitLoop() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdScene::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -513,14 +513,14 @@ HRESULT CAdScene::LoadFile(char *Filename) {
HRESULT ret;
- delete[] m_Filename;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, Filename);
+ delete[] _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);
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, Filename);
+ _filename = new char [strlen(Filename) + 1];
+ strcpy(_filename, Filename);
delete [] Buffer;
@@ -650,11 +650,11 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
layer = NULL;
} else {
Game->RegisterObject(layer);
- m_Layers.Add(layer);
- if (layer->m_Main) {
- m_MainLayer = layer;
- m_Width = layer->m_Width;
- m_Height = layer->m_Height;
+ _layers.Add(layer);
+ if (layer->_main) {
+ _mainLayer = layer;
+ _width = layer->_width;
+ _height = layer->_height;
}
}
}
@@ -668,7 +668,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
wpt = NULL;
} else {
Game->RegisterObject(wpt);
- m_WaypointGroups.Add(wpt);
+ _waypointGroups.Add(wpt);
}
}
break;
@@ -681,7 +681,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
sl = NULL;
} else {
Game->RegisterObject(sl);
- m_ScaleLevels.Add(sl);
+ _scaleLevels.Add(sl);
}
}
break;
@@ -694,7 +694,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
rl = NULL;
} else {
Game->RegisterObject(rl);
- m_RotLevels.Add(rl);
+ _rotLevels.Add(rl);
}
}
break;
@@ -712,11 +712,11 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_CURSOR:
- delete m_Cursor;
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- delete m_Cursor;
- m_Cursor = NULL;
+ delete _cursor;
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
@@ -726,91 +726,91 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_EDITOR_MARGIN_H:
- parser.ScanStr((char *)params, "%d", &m_EditorMarginH);
+ parser.ScanStr((char *)params, "%d", &_editorMarginH);
break;
case TOKEN_EDITOR_MARGIN_V:
- parser.ScanStr((char *)params, "%d", &m_EditorMarginV);
+ parser.ScanStr((char *)params, "%d", &_editorMarginV);
break;
case TOKEN_EDITOR_COLOR_FRAME:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColFrame = DRGBA(ar, ag, ab, aa);
+ _editorColFrame = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_ENTITY:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColEntity = DRGBA(ar, ag, ab, aa);
+ _editorColEntity = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_ENTITY_SEL:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColEntitySel = DRGBA(ar, ag, ab, aa);
+ _editorColEntitySel = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_REGION_SEL:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColRegionSel = DRGBA(ar, ag, ab, aa);
+ _editorColRegionSel = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_DECORATION_SEL:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColDecorSel = DRGBA(ar, ag, ab, aa);
+ _editorColDecorSel = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_BLOCKED_SEL:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColBlockedSel = DRGBA(ar, ag, ab, aa);
+ _editorColBlockedSel = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_WAYPOINTS_SEL:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColWaypointsSel = DRGBA(ar, ag, ab, aa);
+ _editorColWaypointsSel = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_REGION:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColRegion = DRGBA(ar, ag, ab, aa);
+ _editorColRegion = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_DECORATION:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColDecor = DRGBA(ar, ag, ab, aa);
+ _editorColDecor = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_BLOCKED:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColBlocked = DRGBA(ar, ag, ab, aa);
+ _editorColBlocked = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_WAYPOINTS:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColWaypoints = DRGBA(ar, ag, ab, aa);
+ _editorColWaypoints = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_COLOR_SCALE:
parser.ScanStr((char *)params, "%d,%d,%d,%d", &ar, &ag, &ab, &aa);
- m_EditorColScale = DRGBA(ar, ag, ab, aa);
+ _editorColScale = DRGBA(ar, ag, ab, aa);
break;
case TOKEN_EDITOR_SHOW_REGIONS:
- parser.ScanStr((char *)params, "%b", &m_EditorShowRegions);
+ parser.ScanStr((char *)params, "%b", &_editorShowRegions);
break;
case TOKEN_EDITOR_SHOW_BLOCKED:
- parser.ScanStr((char *)params, "%b", &m_EditorShowBlocked);
+ parser.ScanStr((char *)params, "%b", &_editorShowBlocked);
break;
case TOKEN_EDITOR_SHOW_DECORATION:
- parser.ScanStr((char *)params, "%b", &m_EditorShowDecor);
+ parser.ScanStr((char *)params, "%b", &_editorShowDecor);
break;
case TOKEN_EDITOR_SHOW_ENTITIES:
- parser.ScanStr((char *)params, "%b", &m_EditorShowEntities);
+ parser.ScanStr((char *)params, "%b", &_editorShowEntities);
break;
case TOKEN_EDITOR_SHOW_SCALE:
- parser.ScanStr((char *)params, "%b", &m_EditorShowScale);
+ parser.ScanStr((char *)params, "%b", &_editorShowScale);
break;
case TOKEN_SCRIPT:
@@ -824,16 +824,16 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_VIEWPORT: {
RECT rc;
parser.ScanStr((char *)params, "%d,%d,%d,%d", &rc.left, &rc.top, &rc.right, &rc.bottom);
- if (!m_Viewport) m_Viewport = new CBViewport(Game);
- if (m_Viewport) m_Viewport->SetRect(rc.left, rc.top, rc.right, rc.bottom, true);
+ if (!_viewport) _viewport = new CBViewport(Game);
+ if (_viewport) _viewport->SetRect(rc.left, rc.top, rc.right, rc.bottom, true);
}
case TOKEN_PERSISTENT_STATE:
- parser.ScanStr((char *)params, "%b", &m_PersistentState);
+ parser.ScanStr((char *)params, "%b", &_persistentState);
break;
case TOKEN_PERSISTENT_STATE_SPRITES:
- parser.ScanStr((char *)params, "%b", &m_PersistentStateSprites);
+ parser.ScanStr((char *)params, "%b", &_persistentStateSprites);
break;
case TOKEN_EDITOR_PROPERTY:
@@ -847,13 +847,13 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
return E_FAIL;
}
- if (m_MainLayer == NULL) Game->LOG(0, "Warning: scene '%s' has no main layer.", m_Filename);
+ if (_mainLayer == NULL) Game->LOG(0, "Warning: scene '%s' has no main layer.", _filename);
SortScaleLevels();
SortRotLevels();
- m_Initialized = true;
+ _initialized = true;
return S_OK;
@@ -861,7 +861,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::TraverseNodes(bool Update) {
- if (!m_Initialized) return S_OK;
+ if (!_initialized) return S_OK;
int j, k;
CAdGame *AdGame = (CAdGame *)Game;
@@ -870,11 +870,11 @@ HRESULT CAdScene::TraverseNodes(bool Update) {
//////////////////////////////////////////////////////////////////////////
// prepare viewport
bool PopViewport = false;
- if (m_Viewport && !Game->m_EditorMode) {
- Game->PushViewport(m_Viewport);
+ if (_viewport && !Game->_editorMode) {
+ Game->PushViewport(_viewport);
PopViewport = true;
- } else if (AdGame->m_SceneViewport && !Game->m_EditorMode) {
- Game->PushViewport(AdGame->m_SceneViewport);
+ } else if (AdGame->_sceneViewport && !Game->_editorMode) {
+ Game->PushViewport(AdGame->_sceneViewport);
PopViewport = true;
}
@@ -883,39 +883,39 @@ HRESULT CAdScene::TraverseNodes(bool Update) {
// *** adjust scroll offset
if (Update) {
/*
- if(m_AutoScroll && Game->m_MainObject != NULL)
+ if(_autoScroll && Game->_mainObject != NULL)
{
- ScrollToObject(Game->m_MainObject);
+ ScrollToObject(Game->_mainObject);
}
*/
- if (m_AutoScroll) {
+ if (_autoScroll) {
// adjust horizontal scroll
- if (Game->m_Timer - m_LastTimeH >= m_ScrollTimeH) {
- m_LastTimeH = Game->m_Timer;
- if (m_OffsetLeft < m_TargetOffsetLeft) {
- m_OffsetLeft += m_ScrollPixelsH;
- m_OffsetLeft = std::min(m_OffsetLeft, m_TargetOffsetLeft);
- } else if (m_OffsetLeft > m_TargetOffsetLeft) {
- m_OffsetLeft -= m_ScrollPixelsH;
- m_OffsetLeft = std::max(m_OffsetLeft, m_TargetOffsetLeft);
+ if (Game->_timer - _lastTimeH >= _scrollTimeH) {
+ _lastTimeH = Game->_timer;
+ if (_offsetLeft < _targetOffsetLeft) {
+ _offsetLeft += _scrollPixelsH;
+ _offsetLeft = std::min(_offsetLeft, _targetOffsetLeft);
+ } else if (_offsetLeft > _targetOffsetLeft) {
+ _offsetLeft -= _scrollPixelsH;
+ _offsetLeft = std::max(_offsetLeft, _targetOffsetLeft);
}
}
// adjust vertical scroll
- if (Game->m_Timer - m_LastTimeV >= m_ScrollTimeV) {
- m_LastTimeV = Game->m_Timer;
- if (m_OffsetTop < m_TargetOffsetTop) {
- m_OffsetTop += m_ScrollPixelsV;
- m_OffsetTop = std::min(m_OffsetTop, m_TargetOffsetTop);
- } else if (m_OffsetTop > m_TargetOffsetTop) {
- m_OffsetTop -= m_ScrollPixelsV;
- m_OffsetTop = std::max(m_OffsetTop, m_TargetOffsetTop);
+ if (Game->_timer - _lastTimeV >= _scrollTimeV) {
+ _lastTimeV = Game->_timer;
+ if (_offsetTop < _targetOffsetTop) {
+ _offsetTop += _scrollPixelsV;
+ _offsetTop = std::min(_offsetTop, _targetOffsetTop);
+ } else if (_offsetTop > _targetOffsetTop) {
+ _offsetTop -= _scrollPixelsV;
+ _offsetTop = std::max(_offsetTop, _targetOffsetTop);
}
}
- if (m_OffsetTop == m_TargetOffsetTop && m_OffsetLeft == m_TargetOffsetLeft) m_Ready = true;
- } else m_Ready = true; // not scrolling, i.e. always ready
+ if (_offsetTop == _targetOffsetTop && _offsetLeft == _targetOffsetLeft) _ready = true;
+ } else _ready = true; // not scrolling, i.e. always ready
}
@@ -928,11 +928,11 @@ HRESULT CAdScene::TraverseNodes(bool Update) {
int ViewportX, ViewportY;
GetViewportOffset(&ViewportX, &ViewportY);
- int ScrollableX = m_Width - ViewportWidth;
- int ScrollableY = m_Height - ViewportHeight;
+ int ScrollableX = _width - ViewportWidth;
+ int ScrollableY = _height - ViewportHeight;
- double WidthRatio = ScrollableX <= 0 ? 0 : ((double)(m_OffsetLeft) / (double)ScrollableX);
- double HeightRatio = ScrollableY <= 0 ? 0 : ((double)(m_OffsetTop) / (double)ScrollableY);
+ double WidthRatio = ScrollableX <= 0 ? 0 : ((double)(_offsetLeft) / (double)ScrollableX);
+ double HeightRatio = ScrollableY <= 0 ? 0 : ((double)(_offsetTop) / (double)ScrollableY);
int OrigX, OrigY;
Game->GetOffset(&OrigX, &OrigY);
@@ -941,70 +941,70 @@ HRESULT CAdScene::TraverseNodes(bool Update) {
//////////////////////////////////////////////////////////////////////////
// *** display/update everything
- Game->m_Renderer->Setup2D();
+ Game->_renderer->Setup2D();
// for each layer
int MainOffsetX = 0;
int MainOffsetY = 0;
- for (j = 0; j < m_Layers.GetSize(); j++) {
- if (!m_Layers[j]->m_Active) continue;
+ for (j = 0; j < _layers.GetSize(); j++) {
+ if (!_layers[j]->_active) continue;
// make layer exclusive
if (!Update) {
- if (m_Layers[j]->m_CloseUp && !Game->m_EditorMode) {
- if (!m_ShieldWindow) m_ShieldWindow = new CUIWindow(Game);
- if (m_ShieldWindow) {
- m_ShieldWindow->m_PosX = m_ShieldWindow->m_PosY = 0;
- m_ShieldWindow->m_Width = Game->m_Renderer->m_Width;
- m_ShieldWindow->m_Height = Game->m_Renderer->m_Height;
- m_ShieldWindow->Display();
+ if (_layers[j]->_closeUp && !Game->_editorMode) {
+ if (!_shieldWindow) _shieldWindow = new CUIWindow(Game);
+ if (_shieldWindow) {
+ _shieldWindow->_posX = _shieldWindow->_posY = 0;
+ _shieldWindow->_width = Game->_renderer->_width;
+ _shieldWindow->_height = Game->_renderer->_height;
+ _shieldWindow->Display();
}
}
}
- if (m_ParalaxScrolling) {
- int OffsetX = (int)(WidthRatio * (m_Layers[j]->m_Width - ViewportWidth) - ViewportX);
- int OffsetY = (int)(HeightRatio * (m_Layers[j]->m_Height - ViewportHeight) - ViewportY);
+ if (_paralaxScrolling) {
+ int OffsetX = (int)(WidthRatio * (_layers[j]->_width - ViewportWidth) - ViewportX);
+ int OffsetY = (int)(HeightRatio * (_layers[j]->_height - ViewportHeight) - ViewportY);
Game->SetOffset(OffsetX, OffsetY);
- Game->m_OffsetPercentX = (float)OffsetX / ((float)m_Layers[j]->m_Width - ViewportWidth) * 100.0f;
- Game->m_OffsetPercentY = (float)OffsetY / ((float)m_Layers[j]->m_Height - ViewportHeight) * 100.0f;
+ Game->_offsetPercentX = (float)OffsetX / ((float)_layers[j]->_width - ViewportWidth) * 100.0f;
+ Game->_offsetPercentY = (float)OffsetY / ((float)_layers[j]->_height - ViewportHeight) * 100.0f;
- //Game->QuickMessageForm("%d %f", OffsetX+ViewportX, Game->m_OffsetPercentX);
+ //Game->QuickMessageForm("%d %f", OffsetX+ViewportX, Game->_offsetPercentX);
} else {
- Game->SetOffset(m_OffsetLeft - ViewportX, m_OffsetTop - ViewportY);
+ Game->SetOffset(_offsetLeft - ViewportX, _offsetTop - ViewportY);
- Game->m_OffsetPercentX = (float)(m_OffsetLeft - ViewportX) / ((float)m_Layers[j]->m_Width - ViewportWidth) * 100.0f;
- Game->m_OffsetPercentY = (float)(m_OffsetTop - ViewportY) / ((float)m_Layers[j]->m_Height - ViewportHeight) * 100.0f;
+ Game->_offsetPercentX = (float)(_offsetLeft - ViewportX) / ((float)_layers[j]->_width - ViewportWidth) * 100.0f;
+ Game->_offsetPercentY = (float)(_offsetTop - ViewportY) / ((float)_layers[j]->_height - ViewportHeight) * 100.0f;
}
// for each node
- for (k = 0; k < m_Layers[j]->m_Nodes.GetSize(); k++) {
- CAdSceneNode *Node = m_Layers[j]->m_Nodes[k];
- switch (Node->m_Type) {
+ for (k = 0; k < _layers[j]->_nodes.GetSize(); k++) {
+ CAdSceneNode *Node = _layers[j]->_nodes[k];
+ switch (Node->_type) {
case OBJECT_ENTITY:
- if (Node->m_Entity->m_Active && (Game->m_EditorMode || !Node->m_Entity->m_EditorOnly)) {
- Game->m_Renderer->Setup2D();
+ if (Node->_entity->_active && (Game->_editorMode || !Node->_entity->_editorOnly)) {
+ Game->_renderer->Setup2D();
- if (Update) Node->m_Entity->Update();
- else Node->m_Entity->Display();
+ if (Update) Node->_entity->Update();
+ else Node->_entity->Display();
}
break;
case OBJECT_REGION: {
- if (Node->m_Region->m_Blocked) break;
- if (Node->m_Region->m_Decoration) break;
+ if (Node->_region->_blocked) break;
+ if (Node->_region->_decoration) break;
- if (!Update) DisplayRegionContent(Node->m_Region);
+ if (!Update) DisplayRegionContent(Node->_region);
}
break;
} // switch
} // each node
// display/update all objects which are off-regions
- if (m_Layers[j]->m_Main) {
+ if (_layers[j]->_main) {
if (Update) {
UpdateFreeObjects();
} else {
@@ -1016,12 +1016,12 @@ HRESULT CAdScene::TraverseNodes(bool Update) {
// restore state
Game->SetOffset(OrigX, OrigY);
- Game->m_Renderer->Setup2D();
+ Game->_renderer->Setup2D();
// display/update fader
- if (m_Fader) {
- if (Update) m_Fader->Update();
- else m_Fader->Display();
+ if (_fader) {
+ if (Update) _fader->Update();
+ else _fader->Display();
}
if (PopViewport) Game->PopViewport();
@@ -1044,24 +1044,24 @@ HRESULT CAdScene::UpdateFreeObjects() {
// *** update all active objects
Is3DSet = false;
- for (i = 0; i < AdGame->m_Objects.GetSize(); i++) {
- if (!AdGame->m_Objects[i]->m_Active) continue;
+ for (i = 0; i < AdGame->_objects.GetSize(); i++) {
+ if (!AdGame->_objects[i]->_active) continue;
- AdGame->m_Objects[i]->Update();
- AdGame->m_Objects[i]->m_Drawn = false;
+ AdGame->_objects[i]->Update();
+ AdGame->_objects[i]->_drawn = false;
}
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (!m_Objects[i]->m_Active) continue;
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (!_objects[i]->_active) continue;
- m_Objects[i]->Update();
- m_Objects[i]->m_Drawn = false;
+ _objects[i]->Update();
+ _objects[i]->_drawn = false;
}
- if (m_AutoScroll && Game->m_MainObject != NULL) {
- ScrollToObject(Game->m_MainObject);
+ if (_autoScroll && Game->_mainObject != NULL) {
+ ScrollToObject(Game->_mainObject);
}
@@ -1078,44 +1078,44 @@ HRESULT CAdScene::DisplayRegionContent(CAdRegion *Region, bool Display3DOnly) {
int i;
// global objects
- for (i = 0; i < AdGame->m_Objects.GetSize(); i++) {
- Obj = AdGame->m_Objects[i];
- if (Obj->m_Active && !Obj->m_Drawn && (Obj->m_StickRegion == Region || Region == NULL || (Obj->m_StickRegion == NULL && Region->PointInRegion(Obj->m_PosX, Obj->m_PosY)))) {
+ for (i = 0; i < AdGame->_objects.GetSize(); i++) {
+ Obj = AdGame->_objects[i];
+ if (Obj->_active && !Obj->_drawn && (Obj->_stickRegion == Region || Region == NULL || (Obj->_stickRegion == NULL && Region->PointInRegion(Obj->_posX, Obj->_posY)))) {
Objects.Add(Obj);
}
}
// scene objects
- for (i = 0; i < m_Objects.GetSize(); i++) {
- Obj = m_Objects[i];
- if (Obj->m_Active && !Obj->m_EditorOnly && !Obj->m_Drawn && (Obj->m_StickRegion == Region || Region == NULL || (Obj->m_StickRegion == NULL && Region->PointInRegion(Obj->m_PosX, Obj->m_PosY)))) {
+ for (i = 0; i < _objects.GetSize(); i++) {
+ Obj = _objects[i];
+ if (Obj->_active && !Obj->_editorOnly && !Obj->_drawn && (Obj->_stickRegion == Region || Region == NULL || (Obj->_stickRegion == NULL && Region->PointInRegion(Obj->_posX, Obj->_posY)))) {
Objects.Add(Obj);
}
}
- // sort by m_PosY
+ // sort by _posY
qsort(Objects.GetData(), Objects.GetSize(), sizeof(CAdObject *), CAdScene::CompareObjs);
// display them
for (i = 0; i < Objects.GetSize(); i++) {
Obj = Objects[i];
- if (Display3DOnly && !Obj->m_Is3D) continue;
+ if (Display3DOnly && !Obj->_is3D) continue;
- Game->m_Renderer->Setup2D();
+ Game->_renderer->Setup2D();
- if (Game->m_EditorMode || !Obj->m_EditorOnly) Obj->Display();
- Obj->m_Drawn = true;
+ if (Game->_editorMode || !Obj->_editorOnly) Obj->Display();
+ Obj->_drawn = true;
}
// display design only objects
if (!Display3DOnly) {
- if (Game->m_EditorMode && Region == NULL) {
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Active && m_Objects[i]->m_EditorOnly) {
- m_Objects[i]->Display();
- m_Objects[i]->m_Drawn = true;
+ if (Game->_editorMode && Region == NULL) {
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_active && _objects[i]->_editorOnly) {
+ _objects[i]->Display();
+ _objects[i]->_drawn = true;
}
}
}
@@ -1129,8 +1129,8 @@ int CAdScene::CompareObjs(const void *Obj1, const void *Obj2) {
CAdObject *Object1 = *(CAdObject **)Obj1;
CAdObject *Object2 = *(CAdObject **)Obj2;
- if (Object1->m_PosY < Object2->m_PosY) return -1;
- else if (Object1->m_PosY > Object2->m_PosY) return 1;
+ if (Object1->_posY < Object2->_posY) return -1;
+ else if (Object1->_posY > Object2->_posY) return 1;
else return 0;
}
@@ -1140,43 +1140,43 @@ HRESULT CAdScene::DisplayRegionContentOld(CAdRegion *Region) {
CAdObject *obj;
int i;
- // display all objects in region sorted by m_PosY
+ // display all objects in region sorted by _posY
do {
obj = NULL;
int minY = INT_MAX;
// global objects
- for (i = 0; i < AdGame->m_Objects.GetSize(); i++) {
- if (AdGame->m_Objects[i]->m_Active && !AdGame->m_Objects[i]->m_Drawn && AdGame->m_Objects[i]->m_PosY < minY && (AdGame->m_Objects[i]->m_StickRegion == Region || Region == NULL || (AdGame->m_Objects[i]->m_StickRegion == NULL && Region->PointInRegion(AdGame->m_Objects[i]->m_PosX, AdGame->m_Objects[i]->m_PosY)))) {
- obj = AdGame->m_Objects[i];
- minY = AdGame->m_Objects[i]->m_PosY;
+ for (i = 0; i < AdGame->_objects.GetSize(); i++) {
+ if (AdGame->_objects[i]->_active && !AdGame->_objects[i]->_drawn && AdGame->_objects[i]->_posY < minY && (AdGame->_objects[i]->_stickRegion == Region || Region == NULL || (AdGame->_objects[i]->_stickRegion == NULL && Region->PointInRegion(AdGame->_objects[i]->_posX, AdGame->_objects[i]->_posY)))) {
+ obj = AdGame->_objects[i];
+ minY = AdGame->_objects[i]->_posY;
}
}
// scene objects
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Active && !m_Objects[i]->m_EditorOnly && !m_Objects[i]->m_Drawn && m_Objects[i]->m_PosY < minY && (m_Objects[i]->m_StickRegion == Region || Region == NULL || (m_Objects[i]->m_StickRegion == NULL && Region->PointInRegion(m_Objects[i]->m_PosX, m_Objects[i]->m_PosY)))) {
- obj = m_Objects[i];
- minY = m_Objects[i]->m_PosY;
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_active && !_objects[i]->_editorOnly && !_objects[i]->_drawn && _objects[i]->_posY < minY && (_objects[i]->_stickRegion == Region || Region == NULL || (_objects[i]->_stickRegion == NULL && Region->PointInRegion(_objects[i]->_posX, _objects[i]->_posY)))) {
+ obj = _objects[i];
+ minY = _objects[i]->_posY;
}
}
if (obj != NULL) {
- Game->m_Renderer->Setup2D();
+ Game->_renderer->Setup2D();
- if (Game->m_EditorMode || !obj->m_EditorOnly) obj->Display();
- obj->m_Drawn = true;
+ if (Game->_editorMode || !obj->_editorOnly) obj->Display();
+ obj->_drawn = true;
}
} while (obj != NULL);
// design only objects
- if (Game->m_EditorMode && Region == NULL) {
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Active && m_Objects[i]->m_EditorOnly) {
- m_Objects[i]->Display();
- m_Objects[i]->m_Drawn = true;
+ if (Game->_editorMode && Region == NULL) {
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_active && _objects[i]->_editorOnly) {
+ _objects[i]->Display();
+ _objects[i]->_drawn = true;
}
}
}
@@ -1195,35 +1195,35 @@ void CAdScene::ScrollTo(int OffsetX, int OffsetY) {
int ViewportWidth, ViewportHeight;
GetViewportSize(&ViewportWidth, &ViewportHeight);
- int OrigOffsetLeft = m_TargetOffsetLeft;
- int OrigOffsetTop = m_TargetOffsetTop;
+ int OrigOffsetLeft = _targetOffsetLeft;
+ int OrigOffsetTop = _targetOffsetTop;
- m_TargetOffsetLeft = std::max(0, OffsetX - ViewportWidth / 2);
- m_TargetOffsetLeft = std::min(m_TargetOffsetLeft, m_Width - ViewportWidth);
+ _targetOffsetLeft = std::max(0, OffsetX - ViewportWidth / 2);
+ _targetOffsetLeft = std::min(_targetOffsetLeft, _width - ViewportWidth);
- m_TargetOffsetTop = std::max(0, OffsetY - ViewportHeight / 2);
- m_TargetOffsetTop = std::min(m_TargetOffsetTop, m_Height - ViewportHeight);
+ _targetOffsetTop = std::max(0, OffsetY - ViewportHeight / 2);
+ _targetOffsetTop = std::min(_targetOffsetTop, _height - ViewportHeight);
- if (Game->m_MainObject && Game->m_MainObject->m_Is3D) {
- if (abs(OrigOffsetLeft - m_TargetOffsetLeft) < 5) m_TargetOffsetLeft = OrigOffsetLeft;
- if (abs(OrigOffsetTop - m_TargetOffsetTop) < 5) m_TargetOffsetTop = OrigOffsetTop;
- //m_TargetOffsetTop = 0;
+ if (Game->_mainObject && Game->_mainObject->_is3D) {
+ if (abs(OrigOffsetLeft - _targetOffsetLeft) < 5) _targetOffsetLeft = OrigOffsetLeft;
+ if (abs(OrigOffsetTop - _targetOffsetTop) < 5) _targetOffsetTop = OrigOffsetTop;
+ //_targetOffsetTop = 0;
}
- m_Ready = false;
+ _ready = false;
}
//////////////////////////////////////////////////////////////////////////
void CAdScene::ScrollToObject(CBObject *Object) {
- if (Object) ScrollTo(Object->m_PosX, Object->m_PosY - Object->GetHeight() / 2);
+ if (Object) ScrollTo(Object->_posX, Object->_posY - Object->GetHeight() / 2);
}
//////////////////////////////////////////////////////////////////////////
void CAdScene::SkipToObject(CBObject *Object) {
- if (Object) SkipTo(Object->m_PosX, Object->m_PosY - Object->GetHeight() / 2);
+ if (Object) SkipTo(Object->_posX, Object->_posY - Object->GetHeight() / 2);
}
@@ -1232,14 +1232,14 @@ void CAdScene::SkipTo(int OffsetX, int OffsetY) {
int ViewportWidth, ViewportHeight;
GetViewportSize(&ViewportWidth, &ViewportHeight);
- m_OffsetLeft = std::max(0, OffsetX - ViewportWidth / 2);
- m_OffsetLeft = std::min(m_OffsetLeft, m_Width - ViewportWidth);
+ _offsetLeft = std::max(0, OffsetX - ViewportWidth / 2);
+ _offsetLeft = std::min(_offsetLeft, _width - ViewportWidth);
- m_OffsetTop = std::max(0, OffsetY - ViewportHeight / 2);
- m_OffsetTop = std::min(m_OffsetTop, m_Height - ViewportHeight);
+ _offsetTop = std::max(0, OffsetY - ViewportHeight / 2);
+ _offsetTop = std::min(_offsetTop, _height - ViewportHeight);
- m_TargetOffsetLeft = m_OffsetLeft;
- m_TargetOffsetTop = m_OffsetTop;
+ _targetOffsetLeft = _offsetLeft;
+ _targetOffsetTop = _offsetTop;
}
@@ -1350,14 +1350,14 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CScValue *val = Stack->Pop();
if (val->IsInt()) {
int layer = val->GetInt();
- if (layer < 0 || layer >= m_Layers.GetSize()) Stack->PushNULL();
- else Stack->PushNative(m_Layers[layer], true);
+ if (layer < 0 || layer >= _layers.GetSize()) Stack->PushNULL();
+ else Stack->PushNative(_layers[layer], true);
} else {
char *LayerName = val->GetString();
bool LayerFound = false;
- for (int i = 0; i < m_Layers.GetSize(); i++) {
- if (scumm_stricmp(LayerName, m_Layers[i]->m_Name) == 0) {
- Stack->PushNative(m_Layers[i], true);
+ for (int i = 0; i < _layers.GetSize(); i++) {
+ if (scumm_stricmp(LayerName, _layers[i]->_name) == 0) {
+ Stack->PushNative(_layers[i], true);
LayerFound = true;
break;
}
@@ -1373,8 +1373,8 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
else if (strcmp(Name, "GetWaypointGroup") == 0) {
Stack->CorrectParams(1);
int group = Stack->Pop()->GetInt();
- if (group < 0 || group >= m_WaypointGroups.GetSize()) Stack->PushNULL();
- else Stack->PushNative(m_WaypointGroups[group], true);
+ if (group < 0 || group >= _waypointGroups.GetSize()) Stack->PushNULL();
+ else Stack->PushNative(_waypointGroups[group], true);
return S_OK;
}
@@ -1402,12 +1402,12 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CAdObject *Ret = NULL;
if (Val->IsInt()) {
int Index = Val->GetInt();
- if (Index >= 0 && Index < m_Objects.GetSize()) Ret = m_Objects[Index];
+ if (Index >= 0 && Index < _objects.GetSize()) Ret = _objects[Index];
} else {
char *Name = Val->GetString();
- for (int i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i] && m_Objects[i]->m_Name && scumm_stricmp(m_Objects[i]->m_Name, Name) == 0) {
- Ret = m_Objects[i];
+ for (int i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i] && _objects[i]->_name && scumm_stricmp(_objects[i]->_name, Name) == 0) {
+ Ret = _objects[i];
break;
}
}
@@ -1430,13 +1430,13 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
bool IncludeDecors = false;
if (!Val->IsNULL()) IncludeDecors = Val->GetBool();
- if (m_MainLayer) {
- for (int i = m_MainLayer->m_Nodes.GetSize() - 1; i >= 0; i--) {
- CAdSceneNode *Node = m_MainLayer->m_Nodes[i];
- if (Node->m_Type == OBJECT_REGION && Node->m_Region->m_Active && Node->m_Region->PointInRegion(X, Y)) {
- if (Node->m_Region->m_Decoration && !IncludeDecors) continue;
+ if (_mainLayer) {
+ for (int i = _mainLayer->_nodes.GetSize() - 1; i >= 0; i--) {
+ CAdSceneNode *Node = _mainLayer->_nodes[i];
+ if (Node->_type == OBJECT_REGION && Node->_region->_active && Node->_region->PointInRegion(X, Y)) {
+ if (Node->_region->_decoration && !IncludeDecors) continue;
- Stack->PushNative(Node->m_Region, true);
+ Stack->PushNative(Node->_region, true);
return S_OK;
}
}
@@ -1499,8 +1499,8 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
else if (strcmp(Name, "IsScrolling") == 0) {
Stack->CorrectParams(0);
bool Ret = false;
- if (m_AutoScroll) {
- if (m_TargetOffsetLeft != m_OffsetLeft || m_TargetOffsetTop != m_OffsetTop) Ret = true;
+ if (_autoScroll) {
+ if (_targetOffsetLeft != _offsetLeft || _targetOffsetTop != _offsetTop) Ret = true;
}
Stack->PushBool(Ret);
@@ -1518,8 +1518,8 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
byte Blue = Stack->Pop()->GetInt(0);
byte Alpha = Stack->Pop()->GetInt(0xFF);
- m_Fader->FadeOut(DRGBA(Red, Green, Blue, Alpha), Duration);
- if (strcmp(Name, "FadeOutAsync") != 0) Script->WaitFor(m_Fader);
+ _fader->FadeOut(DRGBA(Red, Green, Blue, Alpha), Duration);
+ if (strcmp(Name, "FadeOutAsync") != 0) Script->WaitFor(_fader);
Stack->PushNULL();
return S_OK;
@@ -1536,8 +1536,8 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
byte Blue = Stack->Pop()->GetInt(0);
byte Alpha = Stack->Pop()->GetInt(0xFF);
- m_Fader->FadeIn(DRGBA(Red, Green, Blue, Alpha), Duration);
- if (strcmp(Name, "FadeInAsync") != 0) Script->WaitFor(m_Fader);
+ _fader->FadeIn(DRGBA(Red, Green, Blue, Alpha), Duration);
+ if (strcmp(Name, "FadeInAsync") != 0) Script->WaitFor(_fader);
Stack->PushNULL();
return S_OK;
@@ -1548,7 +1548,7 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetFadeColor") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_Fader->GetCurrentColor());
+ Stack->PushInt(_fader->GetCurrentColor());
return S_OK;
}
@@ -1573,11 +1573,11 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
int Width = Stack->Pop()->GetInt();
int Height = Stack->Pop()->GetInt();
- if (Width <= 0) Width = Game->m_Renderer->m_Width;
- if (Height <= 0) Height = Game->m_Renderer->m_Height;
+ if (Width <= 0) Width = Game->_renderer->_width;
+ if (Height <= 0) Height = Game->_renderer->_height;
- if (!m_Viewport) m_Viewport = new CBViewport(Game);
- if (m_Viewport) m_Viewport->SetRect(X, Y, X + Width, Y + Height);
+ if (!_viewport) _viewport = new CBViewport(Game);
+ if (_viewport) _viewport->SetRect(X, Y, X + Width, Y + Height);
Stack->PushBool(true);
@@ -1593,11 +1593,11 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CAdLayer *Layer = new CAdLayer(Game);
if (!Val->IsNULL()) Layer->SetName(Val->GetString());
- if (m_MainLayer) {
- Layer->m_Width = m_MainLayer->m_Width;
- Layer->m_Height = m_MainLayer->m_Height;
+ if (_mainLayer) {
+ Layer->_width = _mainLayer->_width;
+ Layer->_height = _mainLayer->_height;
}
- m_Layers.Add(Layer);
+ _layers.Add(Layer);
Game->RegisterObject(Layer);
Stack->PushNative(Layer, true);
@@ -1614,13 +1614,13 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CAdLayer *Layer = new CAdLayer(Game);
if (!Val->IsNULL()) Layer->SetName(Val->GetString());
- if (m_MainLayer) {
- Layer->m_Width = m_MainLayer->m_Width;
- Layer->m_Height = m_MainLayer->m_Height;
+ if (_mainLayer) {
+ Layer->_width = _mainLayer->_width;
+ Layer->_height = _mainLayer->_height;
}
if (Index < 0) Index = 0;
- if (Index <= m_Layers.GetSize() - 1) m_Layers.InsertAt(Index, Layer);
- else m_Layers.Add(Layer);
+ if (Index <= _layers.GetSize() - 1) _layers.InsertAt(Index, Layer);
+ else _layers.Add(Layer);
Game->RegisterObject(Layer);
@@ -1638,16 +1638,16 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CAdLayer *ToDelete = NULL;
if (Val->IsNative()) {
CBScriptable *Temp = Val->GetNative();
- for (int i = 0; i < m_Layers.GetSize(); i++) {
- if (m_Layers[i] == Temp) {
- ToDelete = m_Layers[i];
+ for (int i = 0; i < _layers.GetSize(); i++) {
+ if (_layers[i] == Temp) {
+ ToDelete = _layers[i];
break;
}
}
} else {
int Index = Val->GetInt();
- if (Index >= 0 && Index < m_Layers.GetSize()) {
- ToDelete = m_Layers[Index];
+ if (Index >= 0 && Index < _layers.GetSize()) {
+ ToDelete = _layers[Index];
}
}
if (ToDelete == NULL) {
@@ -1655,15 +1655,15 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
return S_OK;
}
- if (ToDelete->m_Main) {
+ if (ToDelete->_main) {
Script->RuntimeError("Scene.DeleteLayer - cannot delete main scene layer");
Stack->PushBool(false);
return S_OK;
}
- for (int i = 0; i < m_Layers.GetSize(); i++) {
- if (m_Layers[i] == ToDelete) {
- m_Layers.RemoveAt(i);
+ for (int i = 0; i < _layers.GetSize(); i++) {
+ if (_layers[i] == ToDelete) {
+ _layers.RemoveAt(i);
Game->UnregisterObject(ToDelete);
break;
}
@@ -1678,48 +1678,48 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
CScValue *CAdScene::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("scene");
- return m_ScValue;
+ _scValue->SetString("scene");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumLayers (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumLayers") == 0) {
- m_ScValue->SetInt(m_Layers.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_layers.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumWaypointGroups (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumWaypointGroups") == 0) {
- m_ScValue->SetInt(m_WaypointGroups.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_waypointGroups.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MainLayer (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MainLayer") == 0) {
- if (m_MainLayer) m_ScValue->SetNative(m_MainLayer, true);
- else m_ScValue->SetNULL();
+ if (_mainLayer) _scValue->SetNative(_mainLayer, true);
+ else _scValue->SetNULL();
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumFreeNodes (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumFreeNodes") == 0) {
- m_ScValue->SetInt(m_Objects.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_objects.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -1729,8 +1729,8 @@ CScValue *CAdScene::ScGetProperty(char *Name) {
int ViewportX;
GetViewportOffset(&ViewportX);
- m_ScValue->SetInt(Game->m_MousePos.x + m_OffsetLeft - ViewportX);
- return m_ScValue;
+ _scValue->SetInt(Game->_mousePos.x + _offsetLeft - ViewportX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -1740,48 +1740,48 @@ CScValue *CAdScene::ScGetProperty(char *Name) {
int ViewportY;
GetViewportOffset(NULL, &ViewportY);
- m_ScValue->SetInt(Game->m_MousePos.y + m_OffsetTop - ViewportY);
- return m_ScValue;
+ _scValue->SetInt(Game->_mousePos.y + _offsetTop - ViewportY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AutoScroll
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AutoScroll") == 0) {
- m_ScValue->SetBool(m_AutoScroll);
- return m_ScValue;
+ _scValue->SetBool(_autoScroll);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PersistentState
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PersistentState") == 0) {
- m_ScValue->SetBool(m_PersistentState);
- return m_ScValue;
+ _scValue->SetBool(_persistentState);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PersistentStateSprites
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PersistentStateSprites") == 0) {
- m_ScValue->SetBool(m_PersistentStateSprites);
- return m_ScValue;
+ _scValue->SetBool(_persistentStateSprites);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScrollPixelsX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScrollPixelsX") == 0) {
- m_ScValue->SetInt(m_ScrollPixelsH);
- return m_ScValue;
+ _scValue->SetInt(_scrollPixelsH);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScrollPixelsY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScrollPixelsY") == 0) {
- m_ScValue->SetInt(m_ScrollPixelsV);
- return m_ScValue;
+ _scValue->SetInt(_scrollPixelsV);
+ return _scValue;
}
@@ -1789,50 +1789,50 @@ CScValue *CAdScene::ScGetProperty(char *Name) {
// ScrollSpeedX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScrollSpeedX") == 0) {
- m_ScValue->SetInt(m_ScrollTimeH);
- return m_ScValue;
+ _scValue->SetInt(_scrollTimeH);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScrollSpeedY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScrollSpeedY") == 0) {
- m_ScValue->SetInt(m_ScrollTimeV);
- return m_ScValue;
+ _scValue->SetInt(_scrollTimeV);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// OffsetX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "OffsetX") == 0) {
- m_ScValue->SetInt(m_OffsetLeft);
- return m_ScValue;
+ _scValue->SetInt(_offsetLeft);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// OffsetY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "OffsetY") == 0) {
- m_ScValue->SetInt(m_OffsetTop);
- return m_ScValue;
+ _scValue->SetInt(_offsetTop);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Width (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Width") == 0) {
- if (m_MainLayer) m_ScValue->SetInt(m_MainLayer->m_Width);
- else m_ScValue->SetInt(0);
- return m_ScValue;
+ if (_mainLayer) _scValue->SetInt(_mainLayer->_width);
+ else _scValue->SetInt(0);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Height (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Height") == 0) {
- if (m_MainLayer) m_ScValue->SetInt(m_MainLayer->m_Height);
- else m_ScValue->SetInt(0);
- return m_ScValue;
+ if (_mainLayer) _scValue->SetInt(_mainLayer->_height);
+ else _scValue->SetInt(0);
+ return _scValue;
}
else return CBObject::ScGetProperty(Name);
@@ -1853,7 +1853,7 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// AutoScroll
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AutoScroll") == 0) {
- m_AutoScroll = Value->GetBool();
+ _autoScroll = Value->GetBool();
return S_OK;
}
@@ -1861,7 +1861,7 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// PersistentState
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PersistentState") == 0) {
- m_PersistentState = Value->GetBool();
+ _persistentState = Value->GetBool();
return S_OK;
}
@@ -1869,7 +1869,7 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// PersistentStateSprites
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PersistentStateSprites") == 0) {
- m_PersistentStateSprites = Value->GetBool();
+ _persistentStateSprites = Value->GetBool();
return S_OK;
}
@@ -1877,7 +1877,7 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// ScrollPixelsX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScrollPixelsX") == 0) {
- m_ScrollPixelsH = Value->GetInt();
+ _scrollPixelsH = Value->GetInt();
return S_OK;
}
@@ -1885,7 +1885,7 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// ScrollPixelsY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScrollPixelsY") == 0) {
- m_ScrollPixelsV = Value->GetInt();
+ _scrollPixelsV = Value->GetInt();
return S_OK;
}
@@ -1893,7 +1893,7 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// ScrollSpeedX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScrollSpeedX") == 0) {
- m_ScrollTimeH = Value->GetInt();
+ _scrollTimeH = Value->GetInt();
return S_OK;
}
@@ -1901,7 +1901,7 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// ScrollSpeedY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScrollSpeedY") == 0) {
- m_ScrollTimeV = Value->GetInt();
+ _scrollTimeV = Value->GetInt();
return S_OK;
}
@@ -1909,14 +1909,14 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// OffsetX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "OffsetX") == 0) {
- m_OffsetLeft = Value->GetInt();
+ _offsetLeft = Value->GetInt();
int ViewportWidth, ViewportHeight;
GetViewportSize(&ViewportWidth, &ViewportHeight);
- m_OffsetLeft = std::max(0, m_OffsetLeft - ViewportWidth / 2);
- m_OffsetLeft = std::min(m_OffsetLeft, m_Width - ViewportWidth);
- m_TargetOffsetLeft = m_OffsetLeft;
+ _offsetLeft = std::max(0, _offsetLeft - ViewportWidth / 2);
+ _offsetLeft = std::min(_offsetLeft, _width - ViewportWidth);
+ _targetOffsetLeft = _offsetLeft;
return S_OK;
}
@@ -1925,14 +1925,14 @@ HRESULT CAdScene::ScSetProperty(char *Name, CScValue *Value) {
// OffsetY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "OffsetY") == 0) {
- m_OffsetTop = Value->GetInt();
+ _offsetTop = Value->GetInt();
int ViewportWidth, ViewportHeight;
GetViewportSize(&ViewportWidth, &ViewportHeight);
- m_OffsetTop = std::max(0, m_OffsetTop - ViewportHeight / 2);
- m_OffsetTop = std::min(m_OffsetTop, m_Height - ViewportHeight);
- m_TargetOffsetTop = m_OffsetTop;
+ _offsetTop = std::max(0, _offsetTop - ViewportHeight / 2);
+ _offsetTop = std::min(_offsetTop, _height - ViewportHeight);
+ _targetOffsetTop = _offsetTop;
return S_OK;
}
@@ -1949,16 +1949,16 @@ char *CAdScene::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::AddObject(CAdObject *Object) {
- m_Objects.Add(Object);
+ _objects.Add(Object);
return Game->RegisterObject(Object);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::RemoveObject(CAdObject *Object) {
- for (int i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i] == Object) {
- m_Objects.RemoveAt(i);
+ for (int i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i] == Object) {
+ _objects.RemoveAt(i);
return Game->UnregisterObject(Object);
}
}
@@ -1972,29 +1972,29 @@ HRESULT CAdScene::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "SCENE {\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
- if (m_PersistentState)
- Buffer->PutTextIndent(Indent + 2, "PERSISTENT_STATE=%s\n", m_PersistentState ? "TRUE" : "FALSE");
+ if (_persistentState)
+ Buffer->PutTextIndent(Indent + 2, "PERSISTENT_STATE=%s\n", _persistentState ? "TRUE" : "FALSE");
- if (!m_PersistentStateSprites)
- Buffer->PutTextIndent(Indent + 2, "PERSISTENT_STATE_SPRITES=%s\n", m_PersistentStateSprites ? "TRUE" : "FALSE");
+ if (!_persistentStateSprites)
+ Buffer->PutTextIndent(Indent + 2, "PERSISTENT_STATE_SPRITES=%s\n", _persistentStateSprites ? "TRUE" : "FALSE");
// scripts
- for (i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
Buffer->PutTextIndent(Indent + 2, "\n");
// properties
- if (m_ScProp) m_ScProp->SaveAsText(Buffer, Indent + 2);
+ if (_scProp) _scProp->SaveAsText(Buffer, Indent + 2);
// viewport
- if (m_Viewport) {
- RECT *rc = m_Viewport->GetRect();
+ if (_viewport) {
+ RECT *rc = _viewport->GetRect();
Buffer->PutTextIndent(Indent + 2, "VIEWPORT { %d, %d, %d, %d }\n", rc->left, rc->top, rc->right, rc->bottom);
}
@@ -2002,26 +2002,26 @@ HRESULT CAdScene::SaveAsText(CBDynBuffer *Buffer, int Indent) {
// editor settings
Buffer->PutTextIndent(Indent + 2, "; ----- editor settings\n");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_MARGIN_H=%d\n", m_EditorMarginH);
- Buffer->PutTextIndent(Indent + 2, "EDITOR_MARGIN_V=%d\n", m_EditorMarginV);
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_FRAME { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColFrame), D3DCOLGetG(m_EditorColFrame), D3DCOLGetB(m_EditorColFrame), D3DCOLGetA(m_EditorColFrame));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_ENTITY_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColEntitySel), D3DCOLGetG(m_EditorColEntitySel), D3DCOLGetB(m_EditorColEntitySel), D3DCOLGetA(m_EditorColEntitySel));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_REGION_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColRegionSel), D3DCOLGetG(m_EditorColRegionSel), D3DCOLGetB(m_EditorColRegionSel), D3DCOLGetA(m_EditorColRegionSel));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_BLOCKED_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColBlockedSel), D3DCOLGetG(m_EditorColBlockedSel), D3DCOLGetB(m_EditorColBlockedSel), D3DCOLGetA(m_EditorColBlockedSel));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_DECORATION_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColDecorSel), D3DCOLGetG(m_EditorColDecorSel), D3DCOLGetB(m_EditorColDecorSel), D3DCOLGetA(m_EditorColDecorSel));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_WAYPOINTS_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColWaypointsSel), D3DCOLGetG(m_EditorColWaypointsSel), D3DCOLGetB(m_EditorColWaypointsSel), D3DCOLGetA(m_EditorColWaypointsSel));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_ENTITY { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColEntity), D3DCOLGetG(m_EditorColEntity), D3DCOLGetB(m_EditorColEntity), D3DCOLGetA(m_EditorColEntity));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_REGION { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColRegion), D3DCOLGetG(m_EditorColRegion), D3DCOLGetB(m_EditorColRegion), D3DCOLGetA(m_EditorColRegion));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_DECORATION { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColDecor), D3DCOLGetG(m_EditorColDecor), D3DCOLGetB(m_EditorColDecor), D3DCOLGetA(m_EditorColDecor));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_BLOCKED { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColBlocked), D3DCOLGetG(m_EditorColBlocked), D3DCOLGetB(m_EditorColBlocked), D3DCOLGetA(m_EditorColBlocked));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_WAYPOINTS { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColWaypoints), D3DCOLGetG(m_EditorColWaypoints), D3DCOLGetB(m_EditorColWaypoints), D3DCOLGetA(m_EditorColWaypoints));
- Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_SCALE { %d,%d,%d,%d }\n", D3DCOLGetR(m_EditorColScale), D3DCOLGetG(m_EditorColScale), D3DCOLGetB(m_EditorColScale), D3DCOLGetA(m_EditorColScale));
-
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_REGIONS=%s\n", m_EditorShowRegions ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_BLOCKED=%s\n", m_EditorShowBlocked ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_DECORATION=%s\n", m_EditorShowDecor ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_ENTITIES=%s\n", m_EditorShowEntities ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_SCALE=%s\n", m_EditorShowScale ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_MARGIN_H=%d\n", _editorMarginH);
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_MARGIN_V=%d\n", _editorMarginV);
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_FRAME { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColFrame), D3DCOLGetG(_editorColFrame), D3DCOLGetB(_editorColFrame), D3DCOLGetA(_editorColFrame));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_ENTITY_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColEntitySel), D3DCOLGetG(_editorColEntitySel), D3DCOLGetB(_editorColEntitySel), D3DCOLGetA(_editorColEntitySel));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_REGION_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColRegionSel), D3DCOLGetG(_editorColRegionSel), D3DCOLGetB(_editorColRegionSel), D3DCOLGetA(_editorColRegionSel));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_BLOCKED_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColBlockedSel), D3DCOLGetG(_editorColBlockedSel), D3DCOLGetB(_editorColBlockedSel), D3DCOLGetA(_editorColBlockedSel));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_DECORATION_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColDecorSel), D3DCOLGetG(_editorColDecorSel), D3DCOLGetB(_editorColDecorSel), D3DCOLGetA(_editorColDecorSel));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_WAYPOINTS_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColWaypointsSel), D3DCOLGetG(_editorColWaypointsSel), D3DCOLGetB(_editorColWaypointsSel), D3DCOLGetA(_editorColWaypointsSel));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_ENTITY { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColEntity), D3DCOLGetG(_editorColEntity), D3DCOLGetB(_editorColEntity), D3DCOLGetA(_editorColEntity));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_REGION { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColRegion), D3DCOLGetG(_editorColRegion), D3DCOLGetB(_editorColRegion), D3DCOLGetA(_editorColRegion));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_DECORATION { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColDecor), D3DCOLGetG(_editorColDecor), D3DCOLGetB(_editorColDecor), D3DCOLGetA(_editorColDecor));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_BLOCKED { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColBlocked), D3DCOLGetG(_editorColBlocked), D3DCOLGetB(_editorColBlocked), D3DCOLGetA(_editorColBlocked));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_WAYPOINTS { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColWaypoints), D3DCOLGetG(_editorColWaypoints), D3DCOLGetB(_editorColWaypoints), D3DCOLGetA(_editorColWaypoints));
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_COLOR_SCALE { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColScale), D3DCOLGetG(_editorColScale), D3DCOLGetB(_editorColScale), D3DCOLGetA(_editorColScale));
+
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_REGIONS=%s\n", _editorShowRegions ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_BLOCKED=%s\n", _editorShowBlocked ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_DECORATION=%s\n", _editorShowDecor ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_ENTITIES=%s\n", _editorShowEntities ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SHOW_SCALE=%s\n", _editorShowScale ? "TRUE" : "FALSE");
Buffer->PutTextIndent(Indent + 2, "\n");
@@ -2029,30 +2029,30 @@ HRESULT CAdScene::SaveAsText(CBDynBuffer *Buffer, int Indent) {
// waypoints
Buffer->PutTextIndent(Indent + 2, "; ----- waypoints\n");
- for (i = 0; i < m_WaypointGroups.GetSize(); i++) m_WaypointGroups[i]->SaveAsText(Buffer, Indent + 2);
+ for (i = 0; i < _waypointGroups.GetSize(); i++) _waypointGroups[i]->SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent + 2, "\n");
// layers
Buffer->PutTextIndent(Indent + 2, "; ----- layers\n");
- for (i = 0; i < m_Layers.GetSize(); i++) m_Layers[i]->SaveAsText(Buffer, Indent + 2);
+ for (i = 0; i < _layers.GetSize(); i++) _layers[i]->SaveAsText(Buffer, Indent + 2);
// scale levels
Buffer->PutTextIndent(Indent + 2, "; ----- scale levels\n");
- for (i = 0; i < m_ScaleLevels.GetSize(); i++) m_ScaleLevels[i]->SaveAsText(Buffer, Indent + 2);
+ for (i = 0; i < _scaleLevels.GetSize(); i++) _scaleLevels[i]->SaveAsText(Buffer, Indent + 2);
// rotation levels
Buffer->PutTextIndent(Indent + 2, "; ----- rotation levels\n");
- for (i = 0; i < m_RotLevels.GetSize(); i++) m_RotLevels[i]->SaveAsText(Buffer, Indent + 2);
+ for (i = 0; i < _rotLevels.GetSize(); i++) _rotLevels[i]->SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent + 2, "\n");
// free entities
Buffer->PutTextIndent(Indent + 2, "; ----- free entities\n");
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Type == OBJECT_ENTITY) {
- m_Objects[i]->SaveAsText(Buffer, Indent + 2);
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_type == OBJECT_ENTITY) {
+ _objects[i]->SaveAsText(Buffer, Indent + 2);
}
}
@@ -2069,11 +2069,11 @@ HRESULT CAdScene::SortScaleLevels() {
bool changed;
do {
changed = false;
- for (int i = 0; i < m_ScaleLevels.GetSize() - 1; i++) {
- if (m_ScaleLevels[i]->m_PosY > m_ScaleLevels[i + 1]->m_PosY) {
- CAdScaleLevel *sl = m_ScaleLevels[i];
- m_ScaleLevels[i] = m_ScaleLevels[i + 1];
- m_ScaleLevels[i + 1] = sl;
+ for (int i = 0; i < _scaleLevels.GetSize() - 1; i++) {
+ if (_scaleLevels[i]->_posY > _scaleLevels[i + 1]->_posY) {
+ CAdScaleLevel *sl = _scaleLevels[i];
+ _scaleLevels[i] = _scaleLevels[i + 1];
+ _scaleLevels[i + 1] = sl;
changed = true;
}
@@ -2090,11 +2090,11 @@ HRESULT CAdScene::SortRotLevels() {
bool changed;
do {
changed = false;
- for (int i = 0; i < m_RotLevels.GetSize() - 1; i++) {
- if (m_RotLevels[i]->m_PosX > m_RotLevels[i + 1]->m_PosX) {
- CAdRotLevel *rl = m_RotLevels[i];
- m_RotLevels[i] = m_RotLevels[i + 1];
- m_RotLevels[i + 1] = rl;
+ for (int i = 0; i < _rotLevels.GetSize() - 1; i++) {
+ if (_rotLevels[i]->_posX > _rotLevels[i + 1]->_posX) {
+ CAdRotLevel *rl = _rotLevels[i];
+ _rotLevels[i] = _rotLevels[i + 1];
+ _rotLevels[i + 1] = rl;
changed = true;
}
@@ -2111,24 +2111,24 @@ float CAdScene::GetScaleAt(int Y) {
CAdScaleLevel *prev = NULL;
CAdScaleLevel *next = NULL;
- for (int i = 0; i < m_ScaleLevels.GetSize(); i++) {
- CAdScaleLevel *xxx = m_ScaleLevels[i];
- int j = m_ScaleLevels.GetSize();
- if (m_ScaleLevels[i]->m_PosY < Y) prev = m_ScaleLevels[i];
+ for (int i = 0; i < _scaleLevels.GetSize(); i++) {
+ CAdScaleLevel *xxx = _scaleLevels[i];
+ int j = _scaleLevels.GetSize();
+ if (_scaleLevels[i]->_posY < Y) prev = _scaleLevels[i];
else {
- next = m_ScaleLevels[i];
+ next = _scaleLevels[i];
break;
}
}
if (prev == NULL || next == NULL) return 100;
- int delta_y = next->m_PosY - prev->m_PosY;
- float delta_scale = next->m_Scale - prev->m_Scale;
- Y -= prev->m_PosY;
+ int delta_y = next->_posY - prev->_posY;
+ float delta_scale = next->_scale - prev->_scale;
+ Y -= prev->_posY;
float percent = (float)Y / ((float)delta_y / 100.0f);
- return prev->m_Scale + delta_scale / 100 * percent;
+ return prev->_scale + delta_scale / 100 * percent;
}
@@ -2136,58 +2136,58 @@ float CAdScene::GetScaleAt(int Y) {
HRESULT CAdScene::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_AutoScroll));
- PersistMgr->Transfer(TMEMBER(m_EditorColBlocked));
- PersistMgr->Transfer(TMEMBER(m_EditorColBlockedSel));
- PersistMgr->Transfer(TMEMBER(m_EditorColDecor));
- PersistMgr->Transfer(TMEMBER(m_EditorColDecorSel));
- PersistMgr->Transfer(TMEMBER(m_EditorColEntity));
- PersistMgr->Transfer(TMEMBER(m_EditorColEntitySel));
- PersistMgr->Transfer(TMEMBER(m_EditorColFrame));
- PersistMgr->Transfer(TMEMBER(m_EditorColRegion));
- PersistMgr->Transfer(TMEMBER(m_EditorColRegionSel));
- PersistMgr->Transfer(TMEMBER(m_EditorColScale));
- PersistMgr->Transfer(TMEMBER(m_EditorColWaypoints));
- PersistMgr->Transfer(TMEMBER(m_EditorColWaypointsSel));
- PersistMgr->Transfer(TMEMBER(m_EditorMarginH));
- PersistMgr->Transfer(TMEMBER(m_EditorMarginV));
- PersistMgr->Transfer(TMEMBER(m_EditorShowBlocked));
- PersistMgr->Transfer(TMEMBER(m_EditorShowDecor));
- PersistMgr->Transfer(TMEMBER(m_EditorShowEntities));
- PersistMgr->Transfer(TMEMBER(m_EditorShowRegions));
- PersistMgr->Transfer(TMEMBER(m_EditorShowScale));
- PersistMgr->Transfer(TMEMBER(m_Fader));
- PersistMgr->Transfer(TMEMBER(m_Height));
- PersistMgr->Transfer(TMEMBER(m_Initialized));
- PersistMgr->Transfer(TMEMBER(m_LastTimeH));
- PersistMgr->Transfer(TMEMBER(m_LastTimeV));
- m_Layers.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_MainLayer));
- m_Objects.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_OffsetLeft));
- PersistMgr->Transfer(TMEMBER(m_OffsetTop));
- PersistMgr->Transfer(TMEMBER(m_ParalaxScrolling));
- PersistMgr->Transfer(TMEMBER(m_PersistentState));
- PersistMgr->Transfer(TMEMBER(m_PersistentStateSprites));
- PersistMgr->Transfer(TMEMBER(m_PFMaxTime));
- m_PFPath.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_PFPointsNum));
- PersistMgr->Transfer(TMEMBER(m_PFReady));
- PersistMgr->Transfer(TMEMBER(m_PFRequester));
- PersistMgr->Transfer(TMEMBER(m_PFTarget));
- PersistMgr->Transfer(TMEMBER(m_PFTargetPath));
- m_RotLevels.Persist(PersistMgr);
- m_ScaleLevels.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_ScrollPixelsH));
- PersistMgr->Transfer(TMEMBER(m_ScrollPixelsV));
- PersistMgr->Transfer(TMEMBER(m_ScrollTimeH));
- PersistMgr->Transfer(TMEMBER(m_ScrollTimeV));
- PersistMgr->Transfer(TMEMBER(m_ShieldWindow));
- PersistMgr->Transfer(TMEMBER(m_TargetOffsetLeft));
- PersistMgr->Transfer(TMEMBER(m_TargetOffsetTop));
- m_WaypointGroups.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Viewport));
- PersistMgr->Transfer(TMEMBER(m_Width));
+ PersistMgr->Transfer(TMEMBER(_autoScroll));
+ PersistMgr->Transfer(TMEMBER(_editorColBlocked));
+ PersistMgr->Transfer(TMEMBER(_editorColBlockedSel));
+ PersistMgr->Transfer(TMEMBER(_editorColDecor));
+ PersistMgr->Transfer(TMEMBER(_editorColDecorSel));
+ PersistMgr->Transfer(TMEMBER(_editorColEntity));
+ PersistMgr->Transfer(TMEMBER(_editorColEntitySel));
+ PersistMgr->Transfer(TMEMBER(_editorColFrame));
+ PersistMgr->Transfer(TMEMBER(_editorColRegion));
+ PersistMgr->Transfer(TMEMBER(_editorColRegionSel));
+ PersistMgr->Transfer(TMEMBER(_editorColScale));
+ PersistMgr->Transfer(TMEMBER(_editorColWaypoints));
+ PersistMgr->Transfer(TMEMBER(_editorColWaypointsSel));
+ PersistMgr->Transfer(TMEMBER(_editorMarginH));
+ PersistMgr->Transfer(TMEMBER(_editorMarginV));
+ PersistMgr->Transfer(TMEMBER(_editorShowBlocked));
+ PersistMgr->Transfer(TMEMBER(_editorShowDecor));
+ PersistMgr->Transfer(TMEMBER(_editorShowEntities));
+ PersistMgr->Transfer(TMEMBER(_editorShowRegions));
+ PersistMgr->Transfer(TMEMBER(_editorShowScale));
+ PersistMgr->Transfer(TMEMBER(_fader));
+ PersistMgr->Transfer(TMEMBER(_height));
+ PersistMgr->Transfer(TMEMBER(_initialized));
+ PersistMgr->Transfer(TMEMBER(_lastTimeH));
+ PersistMgr->Transfer(TMEMBER(_lastTimeV));
+ _layers.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_mainLayer));
+ _objects.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_offsetLeft));
+ PersistMgr->Transfer(TMEMBER(_offsetTop));
+ PersistMgr->Transfer(TMEMBER(_paralaxScrolling));
+ PersistMgr->Transfer(TMEMBER(_persistentState));
+ PersistMgr->Transfer(TMEMBER(_persistentStateSprites));
+ PersistMgr->Transfer(TMEMBER(_pFMaxTime));
+ _pFPath.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_pFPointsNum));
+ PersistMgr->Transfer(TMEMBER(_pFReady));
+ PersistMgr->Transfer(TMEMBER(_pFRequester));
+ PersistMgr->Transfer(TMEMBER(_pFTarget));
+ PersistMgr->Transfer(TMEMBER(_pFTargetPath));
+ _rotLevels.Persist(PersistMgr);
+ _scaleLevels.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_scrollPixelsH));
+ PersistMgr->Transfer(TMEMBER(_scrollPixelsV));
+ PersistMgr->Transfer(TMEMBER(_scrollTimeH));
+ PersistMgr->Transfer(TMEMBER(_scrollTimeV));
+ PersistMgr->Transfer(TMEMBER(_shieldWindow));
+ PersistMgr->Transfer(TMEMBER(_targetOffsetLeft));
+ PersistMgr->Transfer(TMEMBER(_targetOffsetTop));
+ _waypointGroups.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_viewport));
+ PersistMgr->Transfer(TMEMBER(_width));
return S_OK;
}
@@ -2261,14 +2261,14 @@ HRESULT CAdScene::CorrectTargetPoint(int StartX, int StartY, int *X, int *Y, boo
int x = *X;
int y = *Y;
- if (IsWalkableAt(x, y, CheckFreeObjects, Requester) || !m_MainLayer) {
+ if (IsWalkableAt(x, y, CheckFreeObjects, Requester) || !_mainLayer) {
return S_OK;
}
// right
int length_right = 0;
bool found_right = false;
- for (x = *X, y = *Y; x < m_MainLayer->m_Width; x++, length_right++) {
+ for (x = *X, y = *Y; x < _mainLayer->_width; x++, length_right++) {
if (IsWalkableAt(x, y, CheckFreeObjects, Requester) && IsWalkableAt(x - 5, y, CheckFreeObjects, Requester)) {
found_right = true;
break;
@@ -2298,7 +2298,7 @@ HRESULT CAdScene::CorrectTargetPoint(int StartX, int StartY, int *X, int *Y, boo
// down
int length_down = 0;
bool found_down = false;
- for (x = *X, y = *Y; y < m_MainLayer->m_Height; y++, length_down++) {
+ for (x = *X, y = *Y; y < _mainLayer->_height; y++, length_down++) {
if (IsWalkableAt(x, y, CheckFreeObjects, Requester) && IsWalkableAt(x, y - 5, CheckFreeObjects, Requester)) {
found_down = true;
break;
@@ -2335,35 +2335,35 @@ HRESULT CAdScene::CorrectTargetPoint(int StartX, int StartY, int *X, int *Y, boo
//////////////////////////////////////////////////////////////////////////
void CAdScene::PFPointsStart() {
- m_PFPointsNum = 0;
+ _pFPointsNum = 0;
}
//////////////////////////////////////////////////////////////////////////
void CAdScene::PFPointsAdd(int X, int Y, int Distance) {
- if (m_PFPointsNum >= m_PFPath.GetSize()) {
- m_PFPath.Add(new CAdPathPoint(X, Y, Distance));
+ if (_pFPointsNum >= _pFPath.GetSize()) {
+ _pFPath.Add(new CAdPathPoint(X, Y, Distance));
} else {
- m_PFPath[m_PFPointsNum]->x = X;
- m_PFPath[m_PFPointsNum]->y = Y;
- m_PFPath[m_PFPointsNum]->m_Distance = Distance;
- m_PFPath[m_PFPointsNum]->m_Marked = false;
- m_PFPath[m_PFPointsNum]->m_Origin = NULL;
+ _pFPath[_pFPointsNum]->x = X;
+ _pFPath[_pFPointsNum]->y = Y;
+ _pFPath[_pFPointsNum]->_distance = Distance;
+ _pFPath[_pFPointsNum]->_marked = false;
+ _pFPath[_pFPointsNum]->_origin = NULL;
}
- m_PFPointsNum++;
+ _pFPointsNum++;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::GetViewportOffset(int *OffsetX, int *OffsetY) {
CAdGame *AdGame = (CAdGame *)Game;
- if (m_Viewport && !Game->m_EditorMode) {
- if (OffsetX) *OffsetX = m_Viewport->m_OffsetX;
- if (OffsetY) *OffsetY = m_Viewport->m_OffsetY;
- } else if (AdGame->m_SceneViewport && !Game->m_EditorMode) {
- if (OffsetX) *OffsetX = AdGame->m_SceneViewport->m_OffsetX;
- if (OffsetY) *OffsetY = AdGame->m_SceneViewport->m_OffsetY;
+ if (_viewport && !Game->_editorMode) {
+ if (OffsetX) *OffsetX = _viewport->_offsetX;
+ if (OffsetY) *OffsetY = _viewport->_offsetY;
+ } else if (AdGame->_sceneViewport && !Game->_editorMode) {
+ if (OffsetX) *OffsetX = AdGame->_sceneViewport->_offsetX;
+ if (OffsetY) *OffsetY = AdGame->_sceneViewport->_offsetY;
} else {
if (OffsetX) *OffsetX = 0;
if (OffsetY) *OffsetY = 0;
@@ -2375,15 +2375,15 @@ HRESULT CAdScene::GetViewportOffset(int *OffsetX, int *OffsetY) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::GetViewportSize(int *Width, int *Height) {
CAdGame *AdGame = (CAdGame *)Game;
- if (m_Viewport && !Game->m_EditorMode) {
- if (Width) *Width = m_Viewport->GetWidth();
- if (Height) *Height = m_Viewport->GetHeight();
- } else if (AdGame->m_SceneViewport && !Game->m_EditorMode) {
- if (Width) *Width = AdGame->m_SceneViewport->GetWidth();
- if (Height) *Height = AdGame->m_SceneViewport->GetHeight();
+ if (_viewport && !Game->_editorMode) {
+ if (Width) *Width = _viewport->GetWidth();
+ if (Height) *Height = _viewport->GetHeight();
+ } else if (AdGame->_sceneViewport && !Game->_editorMode) {
+ if (Width) *Width = AdGame->_sceneViewport->GetWidth();
+ if (Height) *Height = AdGame->_sceneViewport->GetHeight();
} else {
- if (Width) *Width = Game->m_Renderer->m_Width;
- if (Height) *Height = Game->m_Renderer->m_Height;
+ if (Width) *Width = Game->_renderer->_width;
+ if (Height) *Height = Game->_renderer->_height;
}
return S_OK;
}
@@ -2394,7 +2394,7 @@ int CAdScene::GetOffsetLeft() {
int ViewportX;
GetViewportOffset(&ViewportX);
- return m_OffsetLeft - ViewportX;
+ return _offsetLeft - ViewportX;
}
@@ -2403,7 +2403,7 @@ int CAdScene::GetOffsetTop() {
int ViewportY;
GetViewportOffset(NULL, &ViewportY);
- return m_OffsetTop - ViewportY;
+ return _offsetTop - ViewportY;
}
@@ -2420,8 +2420,8 @@ bool CAdScene::PointInViewport(int X, int Y) {
//////////////////////////////////////////////////////////////////////////
void CAdScene::SetOffset(int OffsetLeft, int OffsetTop) {
- m_OffsetLeft = OffsetLeft;
- m_OffsetTop = OffsetTop;
+ _offsetLeft = OffsetLeft;
+ _offsetTop = OffsetTop;
}
@@ -2431,18 +2431,18 @@ CBObject *CAdScene::GetNodeByName(char *Name) {
CBObject *ret = NULL;
// dependent objects
- for (i = 0; i < m_Layers.GetSize(); i++) {
- CAdLayer *layer = m_Layers[i];
- for (int j = 0; j < layer->m_Nodes.GetSize(); j++) {
- CAdSceneNode *node = layer->m_Nodes[j];
- if ((node->m_Type == OBJECT_ENTITY && !scumm_stricmp(Name, node->m_Entity->m_Name)) ||
- (node->m_Type == OBJECT_REGION && !scumm_stricmp(Name, node->m_Region->m_Name))) {
- switch (node->m_Type) {
+ for (i = 0; i < _layers.GetSize(); i++) {
+ CAdLayer *layer = _layers[i];
+ for (int j = 0; j < layer->_nodes.GetSize(); j++) {
+ CAdSceneNode *node = layer->_nodes[j];
+ if ((node->_type == OBJECT_ENTITY && !scumm_stricmp(Name, node->_entity->_name)) ||
+ (node->_type == OBJECT_REGION && !scumm_stricmp(Name, node->_region->_name))) {
+ switch (node->_type) {
case OBJECT_ENTITY:
- ret = node->m_Entity;
+ ret = node->_entity;
break;
case OBJECT_REGION:
- ret = node->m_Region;
+ ret = node->_region;
break;
default:
ret = NULL;
@@ -2453,16 +2453,16 @@ CBObject *CAdScene::GetNodeByName(char *Name) {
}
// free entities
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Type == OBJECT_ENTITY && !scumm_stricmp(Name, m_Objects[i]->m_Name)) {
- return m_Objects[i];
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_type == OBJECT_ENTITY && !scumm_stricmp(Name, _objects[i]->_name)) {
+ return _objects[i];
}
}
// waypoint groups
- for (i = 0; i < m_WaypointGroups.GetSize(); i++) {
- if (!scumm_stricmp(Name, m_WaypointGroups[i]->m_Name)) {
- return m_WaypointGroups[i];
+ for (i = 0; i < _waypointGroups.GetSize(); i++) {
+ if (!scumm_stricmp(Name, _waypointGroups[i]->_name)) {
+ return _waypointGroups[i];
}
}
@@ -2484,10 +2484,10 @@ HRESULT CAdScene::LoadState() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::PersistState(bool Saving) {
- if (!m_PersistentState) return S_OK;
+ if (!_persistentState) return S_OK;
CAdGame *AdGame = (CAdGame *)Game;
- CAdSceneState *State = AdGame->GetSceneState(m_Filename, Saving);
+ CAdSceneState *State = AdGame->GetSceneState(_filename, Saving);
if (!State) return S_OK;
@@ -2495,26 +2495,26 @@ HRESULT CAdScene::PersistState(bool Saving) {
CAdNodeState *NodeState;
// dependent objects
- for (i = 0; i < m_Layers.GetSize(); i++) {
- CAdLayer *layer = m_Layers[i];
- for (int j = 0; j < layer->m_Nodes.GetSize(); j++) {
- CAdSceneNode *node = layer->m_Nodes[j];
- switch (node->m_Type) {
+ for (i = 0; i < _layers.GetSize(); i++) {
+ CAdLayer *layer = _layers[i];
+ for (int j = 0; j < layer->_nodes.GetSize(); j++) {
+ CAdSceneNode *node = layer->_nodes[j];
+ switch (node->_type) {
case OBJECT_ENTITY:
- if (!node->m_Entity->m_SaveState) continue;
- NodeState = State->GetNodeState(node->m_Entity->m_Name, Saving);
+ if (!node->_entity->_saveState) continue;
+ NodeState = State->GetNodeState(node->_entity->_name, Saving);
if (NodeState) {
- NodeState->TransferEntity(node->m_Entity, m_PersistentStateSprites, Saving);
- //if(Saving) NodeState->m_Active = node->m_Entity->m_Active;
- //else node->m_Entity->m_Active = NodeState->m_Active;
+ NodeState->TransferEntity(node->_entity, _persistentStateSprites, Saving);
+ //if(Saving) NodeState->_active = node->_entity->_active;
+ //else node->_entity->_active = NodeState->_active;
}
break;
case OBJECT_REGION:
- if (!node->m_Region->m_SaveState) continue;
- NodeState = State->GetNodeState(node->m_Region->m_Name, Saving);
+ if (!node->_region->_saveState) continue;
+ NodeState = State->GetNodeState(node->_region->_name, Saving);
if (NodeState) {
- if (Saving) NodeState->m_Active = node->m_Region->m_Active;
- else node->m_Region->m_Active = NodeState->m_Active;
+ if (Saving) NodeState->_active = node->_region->_active;
+ else node->_region->_active = NodeState->_active;
}
break;
}
@@ -2522,24 +2522,24 @@ HRESULT CAdScene::PersistState(bool Saving) {
}
// free entities
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (!m_Objects[i]->m_SaveState) continue;
- if (m_Objects[i]->m_Type == OBJECT_ENTITY) {
- NodeState = State->GetNodeState(m_Objects[i]->m_Name, 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);
if (NodeState) {
- NodeState->TransferEntity((CAdEntity *)m_Objects[i], m_PersistentStateSprites, Saving);
- //if(Saving) NodeState->m_Active = m_Objects[i]->m_Active;
- //else m_Objects[i]->m_Active = NodeState->m_Active;
+ NodeState->TransferEntity((CAdEntity *)_objects[i], _persistentStateSprites, Saving);
+ //if(Saving) NodeState->_active = _objects[i]->_active;
+ //else _objects[i]->_active = NodeState->_active;
}
}
}
// waypoint groups
- for (i = 0; i < m_WaypointGroups.GetSize(); i++) {
- NodeState = State->GetNodeState(m_WaypointGroups[i]->m_Name, Saving);
+ for (i = 0; i < _waypointGroups.GetSize(); i++) {
+ NodeState = State->GetNodeState(_waypointGroups[i]->_name, Saving);
if (NodeState) {
- if (Saving) NodeState->m_Active = m_WaypointGroups[i]->m_Active;
- else m_WaypointGroups[i]->m_Active = NodeState->m_Active;
+ if (Saving) NodeState->_active = _waypointGroups[i]->_active;
+ else _waypointGroups[i]->_active = NodeState->_active;
}
}
@@ -2552,24 +2552,24 @@ float CAdScene::GetRotationAt(int X, int Y) {
CAdRotLevel *prev = NULL;
CAdRotLevel *next = NULL;
- for (int i = 0; i < m_RotLevels.GetSize(); i++) {
- CAdRotLevel *xxx = m_RotLevels[i];
- int j = m_RotLevels.GetSize();
- if (m_RotLevels[i]->m_PosX < X) prev = m_RotLevels[i];
+ for (int i = 0; i < _rotLevels.GetSize(); i++) {
+ CAdRotLevel *xxx = _rotLevels[i];
+ int j = _rotLevels.GetSize();
+ if (_rotLevels[i]->_posX < X) prev = _rotLevels[i];
else {
- next = m_RotLevels[i];
+ next = _rotLevels[i];
break;
}
}
if (prev == NULL || next == NULL) return 0;
- int delta_x = next->m_PosX - prev->m_PosX;
- float delta_rot = next->m_Rotation - prev->m_Rotation;
- X -= prev->m_PosX;
+ int delta_x = next->_posX - prev->_posX;
+ float delta_rot = next->_rotation - prev->_rotation;
+ X -= prev->_posX;
float percent = (float)X / ((float)delta_x / 100.0f);
- return prev->m_Rotation + delta_rot / 100 * percent;
+ return prev->_rotation + delta_rot / 100 * percent;
}
@@ -2577,21 +2577,21 @@ float CAdScene::GetRotationAt(int X, int Y) {
HRESULT CAdScene::HandleItemAssociations(char *ItemName, bool Show) {
int i;
- for (i = 0; i < m_Layers.GetSize(); i++) {
- CAdLayer *Layer = m_Layers[i];
- for (int j = 0; j < Layer->m_Nodes.GetSize(); j++) {
- if (Layer->m_Nodes[j]->m_Type == OBJECT_ENTITY) {
- CAdEntity *Ent = Layer->m_Nodes[j]->m_Entity;
+ for (i = 0; i < _layers.GetSize(); i++) {
+ CAdLayer *Layer = _layers[i];
+ for (int j = 0; j < Layer->_nodes.GetSize(); j++) {
+ if (Layer->_nodes[j]->_type == OBJECT_ENTITY) {
+ CAdEntity *Ent = Layer->_nodes[j]->_entity;
- if (Ent->m_Item && strcmp(Ent->m_Item, ItemName) == 0) Ent->m_Active = Show;
+ if (Ent->_item && strcmp(Ent->_item, ItemName) == 0) Ent->_active = Show;
}
}
}
- for (i = 0; i < m_Objects.GetSize(); i++) {
- if (m_Objects[i]->m_Type == OBJECT_ENTITY) {
- CAdEntity *Ent = (CAdEntity *)m_Objects[i];
- if (Ent->m_Item && strcmp(Ent->m_Item, ItemName) == 0) Ent->m_Active = Show;
+ for (i = 0; i < _objects.GetSize(); i++) {
+ if (_objects[i]->_type == OBJECT_ENTITY) {
+ CAdEntity *Ent = (CAdEntity *)_objects[i];
+ if (Ent->_item && strcmp(Ent->_item, ItemName) == 0) Ent->_active = Show;
}
}
@@ -2603,12 +2603,12 @@ HRESULT CAdScene::HandleItemAssociations(char *ItemName, bool Show) {
HRESULT CAdScene::GetRegionsAt(int X, int Y, CAdRegion **RegionList, int NumRegions) {
int i;
int NumUsed = 0;
- if (m_MainLayer) {
- for (i = m_MainLayer->m_Nodes.GetSize() - 1; i >= 0; i--) {
- CAdSceneNode *Node = m_MainLayer->m_Nodes[i];
- if (Node->m_Type == OBJECT_REGION && Node->m_Region->m_Active && Node->m_Region->PointInRegion(X, Y)) {
+ if (_mainLayer) {
+ for (i = _mainLayer->_nodes.GetSize() - 1; i >= 0; i--) {
+ CAdSceneNode *Node = _mainLayer->_nodes[i];
+ if (Node->_type == OBJECT_REGION && Node->_region->_active && Node->_region->PointInRegion(X, Y)) {
if (NumUsed < NumRegions - 1) {
- RegionList[NumUsed] = Node->m_Region;
+ RegionList[NumUsed] = Node->_region;
NumUsed++;
} else break;
}
@@ -2670,24 +2670,24 @@ CBObject *CAdScene::GetPrevAccessObject(CBObject *CurrObject) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::GetSceneObjects(CBArray<CAdObject *, CAdObject *>& Objects, bool InteractiveOnly) {
- for (int i = 0; i < m_Layers.GetSize(); i++) {
+ for (int i = 0; i < _layers.GetSize(); i++) {
// close-up layer -> remove everything below it
- if (InteractiveOnly && m_Layers[i]->m_CloseUp) Objects.RemoveAll();
+ if (InteractiveOnly && _layers[i]->_closeUp) Objects.RemoveAll();
- for (int j = 0; j < m_Layers[i]->m_Nodes.GetSize(); j++) {
- CAdSceneNode *Node = m_Layers[i]->m_Nodes[j];
- switch (Node->m_Type) {
+ for (int j = 0; j < _layers[i]->_nodes.GetSize(); j++) {
+ CAdSceneNode *Node = _layers[i]->_nodes[j];
+ switch (Node->_type) {
case OBJECT_ENTITY: {
- CAdEntity *Ent = Node->m_Entity;
- if (Ent->m_Active && (Ent->m_Registrable || !InteractiveOnly))
+ CAdEntity *Ent = Node->_entity;
+ if (Ent->_active && (Ent->_registrable || !InteractiveOnly))
Objects.Add(Ent);
}
break;
case OBJECT_REGION: {
CBArray<CAdObject *, CAdObject *> RegionObj;
- GetRegionObjects(Node->m_Region, RegionObj, InteractiveOnly);
+ GetRegionObjects(Node->_region, RegionObj, InteractiveOnly);
for (int New = 0; New < RegionObj.GetSize(); New++) {
bool Found = false;
for (int Old = 0; Old < Objects.GetSize(); Old++) {
@@ -2732,26 +2732,26 @@ HRESULT CAdScene::GetRegionObjects(CAdRegion *Region, CBArray<CAdObject *, CAdOb
int i;
// global objects
- for (i = 0; i < AdGame->m_Objects.GetSize(); i++) {
- Obj = AdGame->m_Objects[i];
- if (Obj->m_Active && (Obj->m_StickRegion == Region || Region == NULL || (Obj->m_StickRegion == NULL && Region->PointInRegion(Obj->m_PosX, Obj->m_PosY)))) {
- if (InteractiveOnly && !Obj->m_Registrable) continue;
+ for (i = 0; i < AdGame->_objects.GetSize(); i++) {
+ Obj = AdGame->_objects[i];
+ if (Obj->_active && (Obj->_stickRegion == Region || Region == NULL || (Obj->_stickRegion == NULL && Region->PointInRegion(Obj->_posX, Obj->_posY)))) {
+ if (InteractiveOnly && !Obj->_registrable) continue;
Objects.Add(Obj);
}
}
// scene objects
- for (i = 0; i < m_Objects.GetSize(); i++) {
- Obj = m_Objects[i];
- if (Obj->m_Active && !Obj->m_EditorOnly && (Obj->m_StickRegion == Region || Region == NULL || (Obj->m_StickRegion == NULL && Region->PointInRegion(Obj->m_PosX, Obj->m_PosY)))) {
- if (InteractiveOnly && !Obj->m_Registrable) continue;
+ for (i = 0; i < _objects.GetSize(); i++) {
+ Obj = _objects[i];
+ if (Obj->_active && !Obj->_editorOnly && (Obj->_stickRegion == Region || Region == NULL || (Obj->_stickRegion == NULL && Region->PointInRegion(Obj->_posX, Obj->_posY)))) {
+ if (InteractiveOnly && !Obj->_registrable) continue;
Objects.Add(Obj);
}
}
- // sort by m_PosY
+ // sort by _posY
qsort(Objects.GetData(), Objects.GetSize(), sizeof(CAdObject *), CAdScene::CompareObjs);
return S_OK;
diff --git a/engines/wintermute/AdScene.h b/engines/wintermute/AdScene.h
index c3124cf814..874e05ac61 100644
--- a/engines/wintermute/AdScene.h
+++ b/engines/wintermute/AdScene.h
@@ -56,12 +56,12 @@ public:
HRESULT GetRegionsAt(int X, int Y, CAdRegion **RegionList, int NumRegions);
HRESULT HandleItemAssociations(char *ItemName, bool Show);
- CUIWindow *m_ShieldWindow;
+ CUIWindow *_shieldWindow;
float GetRotationAt(int X, int Y);
HRESULT LoadState();
HRESULT SaveState();
- bool m_PersistentState;
- bool m_PersistentStateSprites;
+ bool _persistentState;
+ bool _persistentStateSprites;
CBObject *GetNodeByName(char *Name);
void SetOffset(int OffsetLeft, int OffsetTop);
bool PointInViewport(int X, int Y);
@@ -69,12 +69,12 @@ public:
int GetOffsetLeft();
HRESULT GetViewportSize(int *Width = NULL, int *Height = NULL);
HRESULT GetViewportOffset(int *OffsetX = NULL, int *OffsetY = NULL);
- CBViewport *m_Viewport;
- CBFader *m_Fader;
- int m_PFPointsNum;
+ CBViewport *_viewport;
+ CBFader *_fader;
+ int _pFPointsNum;
void PFPointsAdd(int X, int Y, int Distance);
void PFPointsStart();
- bool m_Initialized;
+ bool _initialized;
HRESULT CorrectTargetPoint(int StartX, int StartY, int *X, int *Y, bool CheckFreeObjects = false, CBObject *Requester = NULL);
HRESULT CorrectTargetPoint2(int StartX, int StartY, int *TargetX, int *TargetY, bool CheckFreeObjects, CBObject *Requester);
DECLARE_PERSISTENT(CAdScene, CBObject)
@@ -89,7 +89,7 @@ public:
HRESULT SortRotLevels();
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
uint32 GetAlphaAt(int X, int Y, bool ColorCheck = false);
- bool m_ParalaxScrolling;
+ bool _paralaxScrolling;
void SkipTo(int OffsetX, int OffsetY);
void SetDefaults();
void Cleanup();
@@ -97,60 +97,60 @@ public:
void ScrollToObject(CBObject *Object);
void ScrollTo(int OffsetX, int OffsetY);
virtual HRESULT Update();
- bool m_AutoScroll;
- int m_TargetOffsetTop;
- int m_TargetOffsetLeft;
+ bool _autoScroll;
+ int _targetOffsetTop;
+ int _targetOffsetLeft;
- int m_ScrollPixelsV;
- uint32 m_ScrollTimeV;
- uint32 m_LastTimeV;
+ int _scrollPixelsV;
+ uint32 _scrollTimeV;
+ uint32 _lastTimeV;
- int m_ScrollPixelsH;
- uint32 m_ScrollTimeH;
- uint32 m_LastTimeH;
+ int _scrollPixelsH;
+ uint32 _scrollTimeH;
+ uint32 _lastTimeH;
virtual HRESULT Display();
- uint32 m_PFMaxTime;
+ uint32 _pFMaxTime;
HRESULT InitLoop();
void PathFinderStep();
bool IsBlockedAt(int X, int Y, bool CheckFreeObjects = false, CBObject *Requester = NULL);
bool IsWalkableAt(int X, int Y, bool CheckFreeObjects = false, CBObject *Requester = NULL);
- CAdLayer *m_MainLayer;
+ CAdLayer *_mainLayer;
float GetZoomAt(int X, int Y);
bool GetPath(CBPoint source, CBPoint target, CAdPath *path, CBObject *requester = NULL);
CAdScene(CBGame *inGame);
virtual ~CAdScene();
- CBArray<CAdLayer *, CAdLayer *> m_Layers;
- CBArray<CAdObject *, CAdObject *> m_Objects;
- CBArray<CAdWaypointGroup *, CAdWaypointGroup *> m_WaypointGroups;
+ CBArray<CAdLayer *, CAdLayer *> _layers;
+ CBArray<CAdObject *, CAdObject *> _objects;
+ CBArray<CAdWaypointGroup *, CAdWaypointGroup *> _waypointGroups;
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
- int m_Width;
- int m_Height;
+ int _width;
+ int _height;
HRESULT AddObject(CAdObject *Object);
HRESULT RemoveObject(CAdObject *Object);
- int m_EditorMarginH;
- int m_EditorMarginV;
- uint32 m_EditorColFrame;
- uint32 m_EditorColEntity;
- uint32 m_EditorColRegion;
- uint32 m_EditorColBlocked;
- uint32 m_EditorColWaypoints;
- uint32 m_EditorColEntitySel;
- uint32 m_EditorColRegionSel;
- uint32 m_EditorColBlockedSel;
- uint32 m_EditorColWaypointsSel;
- uint32 m_EditorColScale;
- uint32 m_EditorColDecor;
- uint32 m_EditorColDecorSel;
-
- bool m_EditorShowRegions;
- bool m_EditorShowBlocked;
- bool m_EditorShowDecor;
- bool m_EditorShowEntities;
- bool m_EditorShowScale;
- CBArray<CAdScaleLevel *, CAdScaleLevel *> m_ScaleLevels;
- CBArray<CAdRotLevel *, CAdRotLevel *> m_RotLevels;
+ int _editorMarginH;
+ int _editorMarginV;
+ uint32 _editorColFrame;
+ uint32 _editorColEntity;
+ uint32 _editorColRegion;
+ uint32 _editorColBlocked;
+ uint32 _editorColWaypoints;
+ uint32 _editorColEntitySel;
+ uint32 _editorColRegionSel;
+ uint32 _editorColBlockedSel;
+ uint32 _editorColWaypointsSel;
+ uint32 _editorColScale;
+ uint32 _editorColDecor;
+ uint32 _editorColDecorSel;
+
+ bool _editorShowRegions;
+ bool _editorShowBlocked;
+ bool _editorShowDecor;
+ bool _editorShowEntities;
+ bool _editorShowScale;
+ CBArray<CAdScaleLevel *, CAdScaleLevel *> _scaleLevels;
+ CBArray<CAdRotLevel *, CAdRotLevel *> _rotLevels;
virtual HRESULT RestoreDeviceObjects();
int GetPointsDist(CBPoint p1, CBPoint p2, CBObject *requester = NULL);
@@ -165,14 +165,14 @@ public:
private:
HRESULT PersistState(bool Saving = true);
void PFAddWaypointGroup(CAdWaypointGroup *Wpt, CBObject *Requester = NULL);
- bool m_PFReady;
- CBPoint *m_PFTarget;
- CAdPath *m_PFTargetPath;
- CBObject *m_PFRequester;
- CBArray<CAdPathPoint *, CAdPathPoint *> m_PFPath;
-
- int m_OffsetTop;
- int m_OffsetLeft;
+ bool _pFReady;
+ CBPoint *_pFTarget;
+ CAdPath *_pFTargetPath;
+ CBObject *_pFRequester;
+ CBArray<CAdPathPoint *, CAdPathPoint *> _pFPath;
+
+ int _offsetTop;
+ int _offsetLeft;
};
diff --git a/engines/wintermute/AdSceneNode.cpp b/engines/wintermute/AdSceneNode.cpp
index 4f20a47324..4085eade56 100644
--- a/engines/wintermute/AdSceneNode.cpp
+++ b/engines/wintermute/AdSceneNode.cpp
@@ -36,34 +36,34 @@ IMPLEMENT_PERSISTENT(CAdSceneNode, false)
//////////////////////////////////////////////////////////////////////////
CAdSceneNode::CAdSceneNode(CBGame *inGame): CBObject(inGame) {
- m_Type = OBJECT_NONE;
- m_Region = NULL;
- m_Entity = NULL;
+ _type = OBJECT_NONE;
+ _region = NULL;
+ _entity = NULL;
}
//////////////////////////////////////////////////////////////////////////
CAdSceneNode::~CAdSceneNode() {
- Game->UnregisterObject(m_Region);
- m_Region = NULL;
+ Game->UnregisterObject(_region);
+ _region = NULL;
- Game->UnregisterObject(m_Entity);
- m_Entity = NULL;
+ Game->UnregisterObject(_entity);
+ _entity = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSceneNode::SetEntity(CAdEntity *Entity) {
- m_Type = OBJECT_ENTITY;
- m_Entity = Entity;
+ _type = OBJECT_ENTITY;
+ _entity = Entity;
return Game->RegisterObject(Entity);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSceneNode::SetRegion(CAdRegion *Region) {
- m_Type = OBJECT_REGION;
- m_Region = Region;
+ _type = OBJECT_REGION;
+ _region = Region;
return Game->RegisterObject(Region);
}
@@ -73,9 +73,9 @@ HRESULT CAdSceneNode::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Entity));
- PersistMgr->Transfer(TMEMBER(m_Region));
- PersistMgr->Transfer(TMEMBER_INT(m_Type));
+ PersistMgr->Transfer(TMEMBER(_entity));
+ PersistMgr->Transfer(TMEMBER(_region));
+ PersistMgr->Transfer(TMEMBER_INT(_type));
return S_OK;
}
diff --git a/engines/wintermute/AdSceneNode.h b/engines/wintermute/AdSceneNode.h
index 94bd6f9aab..366e765cdd 100644
--- a/engines/wintermute/AdSceneNode.h
+++ b/engines/wintermute/AdSceneNode.h
@@ -41,9 +41,9 @@ public:
DECLARE_PERSISTENT(CAdSceneNode, CBObject)
HRESULT SetRegion(CAdRegion *Region);
HRESULT SetEntity(CAdEntity *Entity);
- CAdEntity *m_Entity;
- CAdRegion *m_Region;
- TObjectType m_Type;
+ CAdEntity *_entity;
+ CAdRegion *_region;
+ TObjectType _type;
CAdSceneNode(CBGame *inGame);
virtual ~CAdSceneNode();
diff --git a/engines/wintermute/AdSceneState.cpp b/engines/wintermute/AdSceneState.cpp
index 7ed571a711..2fd2648448 100644
--- a/engines/wintermute/AdSceneState.cpp
+++ b/engines/wintermute/AdSceneState.cpp
@@ -39,23 +39,23 @@ IMPLEMENT_PERSISTENT(CAdSceneState, false)
//////////////////////////////////////////////////////////////////////////
CAdSceneState::CAdSceneState(CBGame *inGame): CBBase(inGame) {
- m_Filename = NULL;
+ _filename = NULL;
}
//////////////////////////////////////////////////////////////////////////
CAdSceneState::~CAdSceneState() {
- SAFE_DELETE_ARRAY(m_Filename);
+ SAFE_DELETE_ARRAY(_filename);
- for (int i = 0; i < m_NodeStates.GetSize(); i++) delete m_NodeStates[i];
- m_NodeStates.RemoveAll();
+ for (int i = 0; i < _nodeStates.GetSize(); i++) delete _nodeStates[i];
+ _nodeStates.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSceneState::Persist(CBPersistMgr *PersistMgr) {
- PersistMgr->Transfer(TMEMBER(m_Filename));
- m_NodeStates.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_filename));
+ _nodeStates.Persist(PersistMgr);
return S_OK;
}
@@ -63,22 +63,22 @@ HRESULT CAdSceneState::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
void CAdSceneState::SetFilename(char *Filename) {
- SAFE_DELETE_ARRAY(m_Filename);
- m_Filename = new char [strlen(Filename) + 1];
- if (m_Filename) strcpy(m_Filename, Filename);
+ SAFE_DELETE_ARRAY(_filename);
+ _filename = new char [strlen(Filename) + 1];
+ if (_filename) strcpy(_filename, Filename);
}
//////////////////////////////////////////////////////////////////////////
CAdNodeState *CAdSceneState::GetNodeState(char *Name, bool Saving) {
- for (int i = 0; i < m_NodeStates.GetSize(); i++) {
- if (scumm_stricmp(m_NodeStates[i]->m_Name, Name) == 0) return m_NodeStates[i];
+ for (int i = 0; i < _nodeStates.GetSize(); i++) {
+ if (scumm_stricmp(_nodeStates[i]->_name, Name) == 0) return _nodeStates[i];
}
if (Saving) {
CAdNodeState *ret = new CAdNodeState(Game);
ret->SetName(Name);
- m_NodeStates.Add(ret);
+ _nodeStates.Add(ret);
return ret;
} else return NULL;
diff --git a/engines/wintermute/AdSceneState.h b/engines/wintermute/AdSceneState.h
index 6abb5c9a7f..a49f0ba5f7 100644
--- a/engines/wintermute/AdSceneState.h
+++ b/engines/wintermute/AdSceneState.h
@@ -42,8 +42,8 @@ public:
DECLARE_PERSISTENT(CAdSceneState, CBBase)
CAdSceneState(CBGame *inGame);
virtual ~CAdSceneState();
- char *m_Filename;
- CBArray<CAdNodeState *, CAdNodeState *> m_NodeStates;
+ char *_filename;
+ CBArray<CAdNodeState *, CAdNodeState *> _nodeStates;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/AdSentence.cpp b/engines/wintermute/AdSentence.cpp
index f9574302ed..81bcfcf366 100644
--- a/engines/wintermute/AdSentence.cpp
+++ b/engines/wintermute/AdSentence.cpp
@@ -45,98 +45,98 @@ IMPLEMENT_PERSISTENT(CAdSentence, false)
//////////////////////////////////////////////////////////////////////////
CAdSentence::CAdSentence(CBGame *inGame): CBBase(inGame) {
- m_Text = NULL;
- m_Stances = NULL;
- m_TempStance = NULL;
+ _text = NULL;
+ _stances = NULL;
+ _tempStance = NULL;
- m_Duration = 0;
- m_StartTime = 0;
- m_CurrentStance = 0;
+ _duration = 0;
+ _startTime = 0;
+ _currentStance = 0;
- m_Font = NULL;
+ _font = NULL;
- m_Pos.x = m_Pos.y = 0;
- m_Width = Game->m_Renderer->m_Width;
+ _pos.x = _pos.y = 0;
+ _width = Game->_renderer->_width;
- m_Align = (TTextAlign)TAL_CENTER;
+ _align = (TTextAlign)TAL_CENTER;
- m_Sound = NULL;
- m_SoundStarted = false;
+ _sound = NULL;
+ _soundStarted = false;
- m_TalkDef = NULL;
- m_CurrentSprite = NULL;
- m_CurrentSkelAnim = NULL;
- m_FixedPos = false;
- m_Freezable = true;
+ _talkDef = NULL;
+ _currentSprite = NULL;
+ _currentSkelAnim = NULL;
+ _fixedPos = false;
+ _freezable = true;
}
//////////////////////////////////////////////////////////////////////////
CAdSentence::~CAdSentence() {
- delete m_Sound;
- delete[] m_Text;
- delete[] m_Stances;
- delete[] m_TempStance;
- delete m_TalkDef;
- m_Sound = NULL;
- m_Text = NULL;
- m_Stances = NULL;
- m_TempStance = NULL;
- m_TalkDef = NULL;
-
- m_CurrentSprite = NULL; // ref only
- m_CurrentSkelAnim = NULL;
- m_Font = NULL; // ref only
+ delete _sound;
+ delete[] _text;
+ delete[] _stances;
+ delete[] _tempStance;
+ delete _talkDef;
+ _sound = NULL;
+ _text = NULL;
+ _stances = NULL;
+ _tempStance = NULL;
+ _talkDef = NULL;
+
+ _currentSprite = NULL; // ref only
+ _currentSkelAnim = NULL;
+ _font = NULL; // ref only
}
//////////////////////////////////////////////////////////////////////////
void CAdSentence::SetText(char *Text) {
- if (m_Text) delete [] m_Text;
- m_Text = new char[strlen(Text) + 1];
- if (m_Text) strcpy(m_Text, Text);
+ if (_text) delete [] _text;
+ _text = new char[strlen(Text) + 1];
+ if (_text) strcpy(_text, Text);
}
//////////////////////////////////////////////////////////////////////////
void CAdSentence::SetStances(char *Stances) {
- if (m_Stances) delete [] m_Stances;
+ if (_stances) delete [] _stances;
if (Stances) {
- m_Stances = new char[strlen(Stances) + 1];
- if (m_Stances) strcpy(m_Stances, Stances);
- } else m_Stances = NULL;
+ _stances = new char[strlen(Stances) + 1];
+ if (_stances) strcpy(_stances, Stances);
+ } else _stances = NULL;
}
//////////////////////////////////////////////////////////////////////////
char *CAdSentence::GetCurrentStance() {
- return GetStance(m_CurrentStance);
+ return GetStance(_currentStance);
}
//////////////////////////////////////////////////////////////////////////
char *CAdSentence::GetNextStance() {
- m_CurrentStance++;
- return GetStance(m_CurrentStance);
+ _currentStance++;
+ return GetStance(_currentStance);
}
//////////////////////////////////////////////////////////////////////////
char *CAdSentence::GetStance(int Stance) {
- if (m_Stances == NULL) return NULL;
+ if (_stances == NULL) return NULL;
- if (m_TempStance) delete [] m_TempStance;
- m_TempStance = NULL;
+ if (_tempStance) delete [] _tempStance;
+ _tempStance = NULL;
char *start;
char *curr;
int pos;
- if (Stance == 0) start = m_Stances;
+ if (Stance == 0) start = _stances;
else {
pos = 0;
start = NULL;
- curr = m_Stances;
+ curr = _stances;
while (pos < Stance) {
if (*curr == '\0') break;
if (*curr == ',') pos++;
@@ -154,40 +154,40 @@ char *CAdSentence::GetStance(int Stance) {
while (curr > start && *(curr - 1) == ' ') curr--;
- m_TempStance = new char [curr - start + 1];
- if (m_TempStance) {
- m_TempStance[curr - start] = '\0';
- strncpy(m_TempStance, start, curr - start);
+ _tempStance = new char [curr - start + 1];
+ if (_tempStance) {
+ _tempStance[curr - start] = '\0';
+ strncpy(_tempStance, start, curr - start);
}
- return m_TempStance;
+ return _tempStance;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSentence::Display() {
- if (!m_Font || !m_Text) return E_FAIL;
+ if (!_font || !_text) return E_FAIL;
- if (m_Sound && !m_SoundStarted) {
- m_Sound->Play();
- m_SoundStarted = true;
+ if (_sound && !_soundStarted) {
+ _sound->Play();
+ _soundStarted = true;
}
- if (Game->m_Subtitles) {
- int x = m_Pos.x;
- int y = m_Pos.y;
+ if (Game->_subtitles) {
+ int x = _pos.x;
+ int y = _pos.y;
- if (!m_FixedPos) {
- x = x - ((CAdGame *)Game)->m_Scene->GetOffsetLeft();
- y = y - ((CAdGame *)Game)->m_Scene->GetOffsetTop();
+ if (!_fixedPos) {
+ x = x - ((CAdGame *)Game)->_scene->GetOffsetLeft();
+ y = y - ((CAdGame *)Game)->_scene->GetOffsetTop();
}
x = std::max(x, 0);
- x = std::min(x, Game->m_Renderer->m_Width - m_Width);
+ x = std::min(x, Game->_renderer->_width - _width);
y = std::max(y, 0);
- m_Font->DrawText((byte *)m_Text, x, y, m_Width, m_Align);
+ _font->DrawText((byte *)_text, x, y, _width, _align);
}
return S_OK;
@@ -197,15 +197,15 @@ HRESULT CAdSentence::Display() {
//////////////////////////////////////////////////////////////////////////
void CAdSentence::SetSound(CBSound *Sound) {
if (!Sound) return;
- delete m_Sound;
- m_Sound = Sound;
- m_SoundStarted = false;
+ delete _sound;
+ _sound = Sound;
+ _soundStarted = false;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSentence::Finish() {
- if (m_Sound) m_Sound->Stop();
+ if (_sound) _sound->Stop();
return S_OK;
}
@@ -215,23 +215,23 @@ HRESULT CAdSentence::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER_INT(m_Align));
- PersistMgr->Transfer(TMEMBER(m_CurrentStance));
- PersistMgr->Transfer(TMEMBER(m_CurrentSprite));
- PersistMgr->Transfer(TMEMBER(m_CurrentSkelAnim));
- PersistMgr->Transfer(TMEMBER(m_Duration));
- PersistMgr->Transfer(TMEMBER(m_Font));
- PersistMgr->Transfer(TMEMBER(m_Pos));
- PersistMgr->Transfer(TMEMBER(m_Sound));
- PersistMgr->Transfer(TMEMBER(m_SoundStarted));
- PersistMgr->Transfer(TMEMBER(m_Stances));
- PersistMgr->Transfer(TMEMBER(m_StartTime));
- PersistMgr->Transfer(TMEMBER(m_TalkDef));
- PersistMgr->Transfer(TMEMBER(m_TempStance));
- PersistMgr->Transfer(TMEMBER(m_Text));
- PersistMgr->Transfer(TMEMBER(m_Width));
- PersistMgr->Transfer(TMEMBER(m_FixedPos));
- PersistMgr->Transfer(TMEMBER(m_Freezable));
+ PersistMgr->Transfer(TMEMBER_INT(_align));
+ PersistMgr->Transfer(TMEMBER(_currentStance));
+ PersistMgr->Transfer(TMEMBER(_currentSprite));
+ PersistMgr->Transfer(TMEMBER(_currentSkelAnim));
+ PersistMgr->Transfer(TMEMBER(_duration));
+ PersistMgr->Transfer(TMEMBER(_font));
+ PersistMgr->Transfer(TMEMBER(_pos));
+ PersistMgr->Transfer(TMEMBER(_sound));
+ PersistMgr->Transfer(TMEMBER(_soundStarted));
+ PersistMgr->Transfer(TMEMBER(_stances));
+ PersistMgr->Transfer(TMEMBER(_startTime));
+ PersistMgr->Transfer(TMEMBER(_talkDef));
+ PersistMgr->Transfer(TMEMBER(_tempStance));
+ PersistMgr->Transfer(TMEMBER(_text));
+ PersistMgr->Transfer(TMEMBER(_width));
+ PersistMgr->Transfer(TMEMBER(_fixedPos));
+ PersistMgr->Transfer(TMEMBER(_freezable));
return S_OK;
}
@@ -239,9 +239,9 @@ HRESULT CAdSentence::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSentence::SetupTalkFile(char *SoundFilename) {
- delete m_TalkDef;
- m_TalkDef = NULL;
- m_CurrentSprite = NULL;
+ delete _talkDef;
+ _talkDef = NULL;
+ _currentSprite = NULL;
if (!SoundFilename) return S_OK;
@@ -251,16 +251,16 @@ HRESULT CAdSentence::SetupTalkFile(char *SoundFilename) {
AnsiString talkDefFileName = PathUtil::Combine(path, name + ".talk");
- CBFile *file = Game->m_FileManager->OpenFile(talkDefFileName.c_str());
+ CBFile *file = Game->_fileManager->OpenFile(talkDefFileName.c_str());
if (file) {
- Game->m_FileManager->CloseFile(file);
+ Game->_fileManager->CloseFile(file);
} else return S_OK; // no talk def file found
- m_TalkDef = new CAdTalkDef(Game);
- if (!m_TalkDef || FAILED(m_TalkDef->LoadFile(talkDefFileName.c_str()))) {
- delete m_TalkDef;
- m_TalkDef = NULL;
+ _talkDef = new CAdTalkDef(Game);
+ if (!_talkDef || FAILED(_talkDef->LoadFile(talkDefFileName.c_str()))) {
+ delete _talkDef;
+ _talkDef = NULL;
return E_FAIL;
}
//Game->LOG(0, "Using .talk file: %s", TalkDefFile);
@@ -271,38 +271,38 @@ HRESULT CAdSentence::SetupTalkFile(char *SoundFilename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSentence::Update(TDirection Dir) {
- if (!m_TalkDef) return S_OK;
+ if (!_talkDef) return S_OK;
uint32 CurrentTime;
// if sound is available, synchronize with sound, otherwise use timer
/*
- if(m_Sound) CurrentTime = m_Sound->GetPositionTime();
- else CurrentTime = Game->m_Timer - m_StartTime;
+ if(_sound) CurrentTime = _sound->GetPositionTime();
+ else CurrentTime = Game->_timer - _startTime;
*/
- CurrentTime = Game->m_Timer - m_StartTime;
+ CurrentTime = Game->_timer - _startTime;
bool TalkNodeFound = false;
- for (int i = 0; i < m_TalkDef->m_Nodes.GetSize(); i++) {
- if (m_TalkDef->m_Nodes[i]->IsInTimeInterval(CurrentTime, Dir)) {
+ for (int i = 0; i < _talkDef->_nodes.GetSize(); i++) {
+ if (_talkDef->_nodes[i]->IsInTimeInterval(CurrentTime, Dir)) {
TalkNodeFound = true;
- CBSprite *NewSprite = m_TalkDef->m_Nodes[i]->GetSprite(Dir);
- if (NewSprite != m_CurrentSprite) NewSprite->Reset();
- m_CurrentSprite = NewSprite;
+ CBSprite *NewSprite = _talkDef->_nodes[i]->GetSprite(Dir);
+ if (NewSprite != _currentSprite) NewSprite->Reset();
+ _currentSprite = NewSprite;
- if (!m_TalkDef->m_Nodes[i]->m_PlayToEnd) break;
+ if (!_talkDef->_nodes[i]->_playToEnd) break;
}
}
// no talk node, try to use default sprite instead (if any)
if (!TalkNodeFound) {
- CBSprite *NewSprite = m_TalkDef->GetDefaultSprite(Dir);
+ CBSprite *NewSprite = _talkDef->GetDefaultSprite(Dir);
if (NewSprite) {
- if (NewSprite != m_CurrentSprite) NewSprite->Reset();
- m_CurrentSprite = NewSprite;
- } else m_CurrentSprite = NULL;
+ if (NewSprite != _currentSprite) NewSprite->Reset();
+ _currentSprite = NewSprite;
+ } else _currentSprite = NULL;
}
return S_OK;
@@ -311,7 +311,7 @@ HRESULT CAdSentence::Update(TDirection Dir) {
//////////////////////////////////////////////////////////////////////////
bool CAdSentence::CanSkip() {
// prevent accidental sentence skipping (TODO make configurable)
- return (Game->m_Timer - m_StartTime) > 300;
+ return (Game->_timer - _startTime) > 300;
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/AdSentence.h b/engines/wintermute/AdSentence.h
index 863f5569f1..ded17c83a7 100644
--- a/engines/wintermute/AdSentence.h
+++ b/engines/wintermute/AdSentence.h
@@ -41,39 +41,39 @@ class CBSprite;
class CBSound;
class CAdSentence : public CBBase {
public:
- bool m_Freezable;
- bool m_FixedPos;
- CBSprite *m_CurrentSprite;
- char *m_CurrentSkelAnim;
+ bool _freezable;
+ bool _fixedPos;
+ CBSprite *_currentSprite;
+ char *_currentSkelAnim;
HRESULT Update(TDirection Dir = DI_DOWN);
HRESULT SetupTalkFile(char *SoundFilename);
DECLARE_PERSISTENT(CAdSentence, CBBase)
HRESULT Finish();
void SetSound(CBSound *Sound);
- bool m_SoundStarted;
- CBSound *m_Sound;
- TTextAlign m_Align;
+ bool _soundStarted;
+ CBSound *_sound;
+ TTextAlign _align;
HRESULT Display();
- int m_Width;
- POINT m_Pos;
- CBFont *m_Font;
+ int _width;
+ POINT _pos;
+ CBFont *_font;
char *GetNextStance();
char *GetCurrentStance();
void SetStances(char *Stances);
void SetText(char *Text);
- int m_CurrentStance;
- uint32 m_StartTime;
- char *m_Stances;
- char *m_Text;
- uint32 m_Duration;
+ int _currentStance;
+ uint32 _startTime;
+ char *_stances;
+ char *_text;
+ uint32 _duration;
CAdSentence(CBGame *inGame);
virtual ~CAdSentence();
- CAdTalkDef *m_TalkDef;
+ CAdTalkDef *_talkDef;
bool CanSkip();
private:
- char *m_TempStance;
+ char *_tempStance;
char *GetStance(int Stance);
};
diff --git a/engines/wintermute/AdSpriteSet.cpp b/engines/wintermute/AdSpriteSet.cpp
index 1940559330..e65e701a85 100644
--- a/engines/wintermute/AdSpriteSet.cpp
+++ b/engines/wintermute/AdSpriteSet.cpp
@@ -39,27 +39,27 @@ IMPLEMENT_PERSISTENT(CAdSpriteSet, false)
//////////////////////////////////////////////////////////////////////////
CAdSpriteSet::CAdSpriteSet(CBGame *inGame, CBObject *Owner): CBObject(inGame) {
- m_Owner = Owner;
+ _owner = Owner;
for (int i = 0; i < NUM_DIRECTIONS; i++)
- m_Sprites[i] = NULL;
+ _sprites[i] = NULL;
}
//////////////////////////////////////////////////////////////////////////
CAdSpriteSet::~CAdSpriteSet() {
for (int i = 0; i < NUM_DIRECTIONS; i++) {
- delete m_Sprites[i];
- m_Sprites[i] = NULL;
+ delete _sprites[i];
+ _sprites[i] = NULL;
}
- m_Owner = NULL;
+ _owner = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSpriteSet::LoadFile(char *Filename, int LifeTime, TSpriteCacheType CacheType) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdSpriteSet::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -130,67 +130,67 @@ HRESULT CAdSpriteSet::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSp
break;
case TOKEN_LEFT:
- delete m_Sprites[DI_LEFT];
- m_Sprites[DI_LEFT] = NULL;
- spr = new CBSprite(Game, m_Owner);
+ 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;
- else m_Sprites[DI_LEFT] = spr;
+ else _sprites[DI_LEFT] = spr;
break;
case TOKEN_RIGHT:
- delete m_Sprites[DI_RIGHT];
- m_Sprites[DI_RIGHT] = NULL;
- spr = new CBSprite(Game, m_Owner);
+ 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;
- else m_Sprites[DI_RIGHT] = spr;
+ else _sprites[DI_RIGHT] = spr;
break;
case TOKEN_UP:
- delete m_Sprites[DI_UP];
- m_Sprites[DI_UP] = NULL;
- spr = new CBSprite(Game, m_Owner);
+ 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;
- else m_Sprites[DI_UP] = spr;
+ else _sprites[DI_UP] = spr;
break;
case TOKEN_DOWN:
- delete m_Sprites[DI_DOWN];
- m_Sprites[DI_DOWN] = NULL;
- spr = new CBSprite(Game, m_Owner);
+ 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;
- else m_Sprites[DI_DOWN] = spr;
+ else _sprites[DI_DOWN] = spr;
break;
case TOKEN_UP_LEFT:
- delete m_Sprites[DI_UPLEFT];
- m_Sprites[DI_UPLEFT] = NULL;
- spr = new CBSprite(Game, m_Owner);
+ 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;
- else m_Sprites[DI_UPLEFT] = spr;
+ else _sprites[DI_UPLEFT] = spr;
break;
case TOKEN_UP_RIGHT:
- delete m_Sprites[DI_UPRIGHT];
- m_Sprites[DI_UPRIGHT] = NULL;
- spr = new CBSprite(Game, m_Owner);
+ 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;
- else m_Sprites[DI_UPRIGHT] = spr;
+ else _sprites[DI_UPRIGHT] = spr;
break;
case TOKEN_DOWN_LEFT:
- delete m_Sprites[DI_DOWNLEFT];
- m_Sprites[DI_DOWNLEFT] = NULL;
- spr = new CBSprite(Game, m_Owner);
+ 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;
- else m_Sprites[DI_DOWNLEFT] = spr;
+ else _sprites[DI_DOWNLEFT] = spr;
break;
case TOKEN_DOWN_RIGHT:
- delete m_Sprites[DI_DOWNRIGHT];
- m_Sprites[DI_DOWNRIGHT] = NULL;
- spr = new CBSprite(Game, m_Owner);
+ 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;
- else m_Sprites[DI_DOWNRIGHT] = spr;
+ else _sprites[DI_DOWNRIGHT] = spr;
break;
case TOKEN_EDITOR_PROPERTY:
@@ -218,9 +218,9 @@ HRESULT CAdSpriteSet::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Owner));
+ PersistMgr->Transfer(TMEMBER(_owner));
for (int i = 0; i < NUM_DIRECTIONS; i++) {
- PersistMgr->Transfer("", &m_Sprites[i]);
+ PersistMgr->Transfer("", &_sprites[i]);
}
return S_OK;
@@ -239,16 +239,16 @@ CBSprite *CAdSpriteSet::GetSprite(TDirection Direction) {
int i;
int NumSteps = 0;
for (i = Dir, NumSteps = 0; i >= 0; i--) {
- if (m_Sprites[i] != NULL) {
- ret = m_Sprites[i];
+ if (_sprites[i] != NULL) {
+ ret = _sprites[i];
NumSteps = Dir - i;
break;
}
}
for (i = Dir; i < NUM_DIRECTIONS; i++) {
- if (m_Sprites[i] != NULL) {
- if (ret == NULL || NumSteps > i - Dir) return m_Sprites[i];
+ if (_sprites[i] != NULL) {
+ if (ret == NULL || NumSteps > i - Dir) return _sprites[i];
else return ret;
}
}
@@ -261,33 +261,33 @@ CBSprite *CAdSpriteSet::GetSprite(TDirection Direction) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdSpriteSet::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "SPRITESET {\n");
- if (m_Name) Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ if (_name) Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
for (int i = 0; i < NUM_DIRECTIONS; i++) {
- if (m_Sprites[i]) {
+ if (_sprites[i]) {
switch (i) {
case DI_UP:
- Buffer->PutTextIndent(Indent + 2, "UP=\"%s\"\n", m_Sprites[i]->m_Filename);
+ Buffer->PutTextIndent(Indent + 2, "UP=\"%s\"\n", _sprites[i]->_filename);
break;
case DI_UPRIGHT:
- Buffer->PutTextIndent(Indent + 2, "UP_RIGHT=\"%s\"\n", m_Sprites[i]->m_Filename);
+ Buffer->PutTextIndent(Indent + 2, "UP_RIGHT=\"%s\"\n", _sprites[i]->_filename);
break;
case DI_RIGHT:
- Buffer->PutTextIndent(Indent + 2, "RIGHT=\"%s\"\n", m_Sprites[i]->m_Filename);
+ Buffer->PutTextIndent(Indent + 2, "RIGHT=\"%s\"\n", _sprites[i]->_filename);
break;
case DI_DOWNRIGHT:
- Buffer->PutTextIndent(Indent + 2, "DOWN_RIGHT=\"%s\"\n", m_Sprites[i]->m_Filename);
+ Buffer->PutTextIndent(Indent + 2, "DOWN_RIGHT=\"%s\"\n", _sprites[i]->_filename);
break;
case DI_DOWN:
- Buffer->PutTextIndent(Indent + 2, "DOWN=\"%s\"\n", m_Sprites[i]->m_Filename);
+ Buffer->PutTextIndent(Indent + 2, "DOWN=\"%s\"\n", _sprites[i]->_filename);
break;
case DI_DOWNLEFT:
- Buffer->PutTextIndent(Indent + 2, "DOWN_LEFT=\"%s\"\n", m_Sprites[i]->m_Filename);
+ Buffer->PutTextIndent(Indent + 2, "DOWN_LEFT=\"%s\"\n", _sprites[i]->_filename);
break;
case DI_LEFT:
- Buffer->PutTextIndent(Indent + 2, "LEFT=\"%s\"\n", m_Sprites[i]->m_Filename);
+ Buffer->PutTextIndent(Indent + 2, "LEFT=\"%s\"\n", _sprites[i]->_filename);
break;
case DI_UPLEFT:
- Buffer->PutTextIndent(Indent + 2, "UP_LEFT=\"%s\"\n", m_Sprites[i]->m_Filename);
+ Buffer->PutTextIndent(Indent + 2, "UP_LEFT=\"%s\"\n", _sprites[i]->_filename);
break;
}
}
@@ -305,7 +305,7 @@ bool CAdSpriteSet::ContainsSprite(CBSprite *Sprite) {
if (!Sprite) return NULL;
for (int i = 0; i < NUM_DIRECTIONS; i++) {
- if (m_Sprites[i] == Sprite) return true;
+ if (_sprites[i] == Sprite) return true;
}
return false;
}
diff --git a/engines/wintermute/AdSpriteSet.h b/engines/wintermute/AdSpriteSet.h
index 08b1606962..629978bff3 100644
--- a/engines/wintermute/AdSpriteSet.h
+++ b/engines/wintermute/AdSpriteSet.h
@@ -41,12 +41,12 @@ public:
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent = 0);
CBSprite *GetSprite(TDirection Direction);
DECLARE_PERSISTENT(CAdSpriteSet, CBObject)
- CBObject *m_Owner;
+ CBObject *_owner;
CAdSpriteSet(CBGame *inGame, CBObject *Owner = NULL);
virtual ~CAdSpriteSet();
HRESULT LoadFile(char *Filename, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
- CBSprite *m_Sprites[NUM_DIRECTIONS];
+ CBSprite *_sprites[NUM_DIRECTIONS];
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/AdTalkDef.cpp b/engines/wintermute/AdTalkDef.cpp
index 77a1c86769..0545887cb3 100644
--- a/engines/wintermute/AdTalkDef.cpp
+++ b/engines/wintermute/AdTalkDef.cpp
@@ -43,34 +43,34 @@ IMPLEMENT_PERSISTENT(CAdTalkDef, false)
//////////////////////////////////////////////////////////////////////////
CAdTalkDef::CAdTalkDef(CBGame *inGame): CBObject(inGame) {
- m_DefaultSpriteFilename = NULL;
- m_DefaultSprite = NULL;
+ _defaultSpriteFilename = NULL;
+ _defaultSprite = NULL;
- m_DefaultSpriteSetFilename = NULL;
- m_DefaultSpriteSet = NULL;
+ _defaultSpriteSetFilename = NULL;
+ _defaultSpriteSet = NULL;
}
//////////////////////////////////////////////////////////////////////////
CAdTalkDef::~CAdTalkDef() {
- for (int i = 0; i < m_Nodes.GetSize(); i++) delete m_Nodes[i];
- m_Nodes.RemoveAll();
-
- delete[] m_DefaultSpriteFilename;
- delete m_DefaultSprite;
- m_DefaultSpriteFilename = NULL;
- m_DefaultSprite = NULL;
-
- delete[] m_DefaultSpriteSetFilename;
- delete m_DefaultSpriteSet;
- m_DefaultSpriteSetFilename = NULL;
- m_DefaultSpriteSet = NULL;
+ for (int i = 0; i < _nodes.GetSize(); i++) delete _nodes[i];
+ _nodes.RemoveAll();
+
+ delete[] _defaultSpriteFilename;
+ delete _defaultSprite;
+ _defaultSpriteFilename = NULL;
+ _defaultSprite = NULL;
+
+ delete[] _defaultSpriteSetFilename;
+ delete _defaultSpriteSet;
+ _defaultSpriteSetFilename = NULL;
+ _defaultSpriteSet = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdTalkDef::LoadFile(const char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdTalkDef::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -78,7 +78,7 @@ HRESULT CAdTalkDef::LoadFile(const char *Filename) {
HRESULT ret;
- CBUtils::SetString(&m_Filename, Filename);
+ CBUtils::SetString(&_filename, Filename);
if (FAILED(ret = LoadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TALK file '%s'", Filename);
@@ -129,7 +129,7 @@ HRESULT CAdTalkDef::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_ACTION: {
CAdTalkNode *Node = new CAdTalkNode(Game);
- if (Node && SUCCEEDED(Node->LoadBuffer(params, false))) m_Nodes.Add(Node);
+ if (Node && SUCCEEDED(Node->LoadBuffer(params, false))) _nodes.Add(Node);
else {
delete Node;
Node = NULL;
@@ -139,19 +139,19 @@ HRESULT CAdTalkDef::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_DEFAULT_SPRITE:
- CBUtils::SetString(&m_DefaultSpriteFilename, (char *)params);
+ CBUtils::SetString(&_defaultSpriteFilename, (char *)params);
break;
case TOKEN_DEFAULT_SPRITESET_FILE:
- CBUtils::SetString(&m_DefaultSpriteSetFilename, (char *)params);
+ CBUtils::SetString(&_defaultSpriteSetFilename, (char *)params);
break;
case TOKEN_DEFAULT_SPRITESET: {
- delete m_DefaultSpriteSet;
- m_DefaultSpriteSet = new CAdSpriteSet(Game);
- if (!m_DefaultSpriteSet || FAILED(m_DefaultSpriteSet->LoadBuffer(params, false))) {
- delete m_DefaultSpriteSet;
- m_DefaultSpriteSet = NULL;
+ delete _defaultSpriteSet;
+ _defaultSpriteSet = new CAdSpriteSet(Game);
+ if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->LoadBuffer(params, false))) {
+ delete _defaultSpriteSet;
+ _defaultSpriteSet = NULL;
cmd = PARSERR_GENERIC;
}
}
@@ -173,19 +173,19 @@ HRESULT CAdTalkDef::LoadBuffer(byte *Buffer, bool Complete) {
return E_FAIL;
}
- delete m_DefaultSprite;
- delete m_DefaultSpriteSet;
- m_DefaultSprite = NULL;
- m_DefaultSpriteSet = NULL;
+ delete _defaultSprite;
+ delete _defaultSpriteSet;
+ _defaultSprite = NULL;
+ _defaultSpriteSet = NULL;
- if (m_DefaultSpriteFilename) {
- m_DefaultSprite = new CBSprite(Game);
- if (!m_DefaultSprite || FAILED(m_DefaultSprite->LoadFile(m_DefaultSpriteFilename))) return E_FAIL;
+ if (_defaultSpriteFilename) {
+ _defaultSprite = new CBSprite(Game);
+ if (!_defaultSprite || FAILED(_defaultSprite->LoadFile(_defaultSpriteFilename))) return E_FAIL;
}
- if (m_DefaultSpriteSetFilename) {
- m_DefaultSpriteSet = new CAdSpriteSet(Game);
- if (!m_DefaultSpriteSet || FAILED(m_DefaultSpriteSet->LoadFile(m_DefaultSpriteSetFilename))) return E_FAIL;
+ if (_defaultSpriteSetFilename) {
+ _defaultSpriteSet = new CAdSpriteSet(Game);
+ if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->LoadFile(_defaultSpriteSetFilename))) return E_FAIL;
}
@@ -198,12 +198,12 @@ HRESULT CAdTalkDef::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_DefaultSprite));
- PersistMgr->Transfer(TMEMBER(m_DefaultSpriteFilename));
- PersistMgr->Transfer(TMEMBER(m_DefaultSpriteSet));
- PersistMgr->Transfer(TMEMBER(m_DefaultSpriteSetFilename));
+ PersistMgr->Transfer(TMEMBER(_defaultSprite));
+ PersistMgr->Transfer(TMEMBER(_defaultSpriteFilename));
+ PersistMgr->Transfer(TMEMBER(_defaultSpriteSet));
+ PersistMgr->Transfer(TMEMBER(_defaultSpriteSetFilename));
- m_Nodes.Persist(PersistMgr);
+ _nodes.Persist(PersistMgr);
return S_OK;
}
@@ -212,13 +212,13 @@ HRESULT CAdTalkDef::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdTalkDef::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "TALK {\n");
- if (m_DefaultSpriteFilename) Buffer->PutTextIndent(Indent + 2, "DEFAULT_SPRITE=\"%s\"\n", m_DefaultSpriteFilename);
+ if (_defaultSpriteFilename) Buffer->PutTextIndent(Indent + 2, "DEFAULT_SPRITE=\"%s\"\n", _defaultSpriteFilename);
- if (m_DefaultSpriteSetFilename) Buffer->PutTextIndent(Indent + 2, "DEFAULT_SPRITESET_FILE=\"%s\"\n", m_DefaultSpriteSetFilename);
- else if (m_DefaultSpriteSet) m_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 < m_Nodes.GetSize(); i++) {
- m_Nodes[i]->SaveAsText(Buffer, Indent + 2);
+ for (int i = 0; i < _nodes.GetSize(); i++) {
+ _nodes[i]->SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent, "\n");
}
CBBase::SaveAsText(Buffer, Indent + 2);
@@ -231,18 +231,18 @@ HRESULT CAdTalkDef::SaveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdTalkDef::LoadDefaultSprite() {
- if (m_DefaultSpriteFilename && !m_DefaultSprite) {
- m_DefaultSprite = new CBSprite(Game);
- if (!m_DefaultSprite || FAILED(m_DefaultSprite->LoadFile(m_DefaultSpriteFilename))) {
- delete m_DefaultSprite;
- m_DefaultSprite = NULL;
+ if (_defaultSpriteFilename && !_defaultSprite) {
+ _defaultSprite = new CBSprite(Game);
+ if (!_defaultSprite || FAILED(_defaultSprite->LoadFile(_defaultSpriteFilename))) {
+ delete _defaultSprite;
+ _defaultSprite = NULL;
return E_FAIL;
} else return S_OK;
- } else if (m_DefaultSpriteSetFilename && !m_DefaultSpriteSet) {
- m_DefaultSpriteSet = new CAdSpriteSet(Game);
- if (!m_DefaultSpriteSet || FAILED(m_DefaultSpriteSet->LoadFile(m_DefaultSpriteSetFilename))) {
- delete m_DefaultSpriteSet;
- m_DefaultSpriteSet = NULL;
+ } else if (_defaultSpriteSetFilename && !_defaultSpriteSet) {
+ _defaultSpriteSet = new CAdSpriteSet(Game);
+ if (!_defaultSpriteSet || FAILED(_defaultSpriteSet->LoadFile(_defaultSpriteSetFilename))) {
+ delete _defaultSpriteSet;
+ _defaultSpriteSet = NULL;
return E_FAIL;
} else return S_OK;
} else return S_OK;
@@ -252,8 +252,8 @@ HRESULT CAdTalkDef::LoadDefaultSprite() {
//////////////////////////////////////////////////////////////////////////
CBSprite *CAdTalkDef::GetDefaultSprite(TDirection Dir) {
LoadDefaultSprite();
- if (m_DefaultSprite) return m_DefaultSprite;
- else if (m_DefaultSpriteSet) return m_DefaultSpriteSet->GetSprite(Dir);
+ if (_defaultSprite) return _defaultSprite;
+ else if (_defaultSpriteSet) return _defaultSpriteSet->GetSprite(Dir);
else return NULL;
}
diff --git a/engines/wintermute/AdTalkDef.h b/engines/wintermute/AdTalkDef.h
index 4702a10fd6..2ead14540b 100644
--- a/engines/wintermute/AdTalkDef.h
+++ b/engines/wintermute/AdTalkDef.h
@@ -37,8 +37,8 @@ class CAdTalkNode;
class CAdSpriteSet;
class CAdTalkDef : public CBObject {
public:
- char *m_DefaultSpriteSetFilename;
- CAdSpriteSet *m_DefaultSpriteSet;
+ char *_defaultSpriteSetFilename;
+ CAdSpriteSet *_defaultSpriteSet;
CBSprite *GetDefaultSprite(TDirection Dir);
HRESULT LoadDefaultSprite();
DECLARE_PERSISTENT(CAdTalkDef, CBObject)
@@ -47,9 +47,9 @@ public:
virtual ~CAdTalkDef();
HRESULT LoadFile(const char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
- CBArray<CAdTalkNode *, CAdTalkNode *> m_Nodes;
- char *m_DefaultSpriteFilename;
- CBSprite *m_DefaultSprite;
+ CBArray<CAdTalkNode *, CAdTalkNode *> _nodes;
+ char *_defaultSpriteFilename;
+ CBSprite *_defaultSprite;
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent = 0);
};
diff --git a/engines/wintermute/AdTalkHolder.cpp b/engines/wintermute/AdTalkHolder.cpp
index 74a089167a..44ef2eddb7 100644
--- a/engines/wintermute/AdTalkHolder.cpp
+++ b/engines/wintermute/AdTalkHolder.cpp
@@ -43,21 +43,21 @@ IMPLEMENT_PERSISTENT(CAdTalkHolder, false)
//////////////////////////////////////////////////////////////////////////
CAdTalkHolder::CAdTalkHolder(CBGame *inGame): CAdObject(inGame) {
- m_Sprite = NULL;
+ _sprite = NULL;
}
//////////////////////////////////////////////////////////////////////////
CAdTalkHolder::~CAdTalkHolder() {
- delete m_Sprite;
- m_Sprite = NULL;
+ delete _sprite;
+ _sprite = NULL;
int i;
- for (i = 0; i < m_TalkSprites.GetSize(); i++) delete m_TalkSprites[i];
- m_TalkSprites.RemoveAll();
+ for (i = 0; i < _talkSprites.GetSize(); i++) delete _talkSprites[i];
+ _talkSprites.RemoveAll();
- for (i = 0; i < m_TalkSpritesEx.GetSize(); i++) delete m_TalkSpritesEx[i];
- m_TalkSpritesEx.RemoveAll();
+ for (i = 0; i < _talkSpritesEx.GetSize(); i++) delete _talkSpritesEx[i];
+ _talkSpritesEx.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
@@ -66,34 +66,34 @@ CBSprite *CAdTalkHolder::GetTalkStance(char *Stance) {
// forced stance?
- if (m_ForcedTalkAnimName && !m_ForcedTalkAnimUsed) {
- m_ForcedTalkAnimUsed = true;
- delete m_AnimSprite;
- m_AnimSprite = new CBSprite(Game, this);
- if (m_AnimSprite) {
- HRESULT res = m_AnimSprite->LoadFile(m_ForcedTalkAnimName);
+ if (_forcedTalkAnimName && !_forcedTalkAnimUsed) {
+ _forcedTalkAnimUsed = true;
+ delete _animSprite;
+ _animSprite = new CBSprite(Game, this);
+ if (_animSprite) {
+ HRESULT res = _animSprite->LoadFile(_forcedTalkAnimName);
if (FAILED(res)) {
- Game->LOG(res, "CAdTalkHolder::GetTalkStance: error loading talk sprite (object:\"%s\" sprite:\"%s\")", m_Name, m_ForcedTalkAnimName);
- delete m_AnimSprite;
- m_AnimSprite = NULL;
- } else return m_AnimSprite;
+ Game->LOG(res, "CAdTalkHolder::GetTalkStance: error loading talk sprite (object:\"%s\" sprite:\"%s\")", _name, _forcedTalkAnimName);
+ delete _animSprite;
+ _animSprite = NULL;
+ } else return _animSprite;
}
}
if (Stance != NULL) {
// search special talk stances
- for (int i = 0; i < m_TalkSpritesEx.GetSize(); i++) {
- if (scumm_stricmp(m_TalkSpritesEx[i]->m_Name, Stance) == 0) {
- ret = m_TalkSpritesEx[i];
+ for (int i = 0; i < _talkSpritesEx.GetSize(); i++) {
+ if (scumm_stricmp(_talkSpritesEx[i]->_name, Stance) == 0) {
+ ret = _talkSpritesEx[i];
break;
}
}
if (ret == NULL) {
// serach generic talk stances
- for (int i = 0; i < m_TalkSprites.GetSize(); i++) {
- if (scumm_stricmp(m_TalkSprites[i]->m_Name, Stance) == 0) {
- ret = m_TalkSprites[i];
+ for (int i = 0; i < _talkSprites.GetSize(); i++) {
+ if (scumm_stricmp(_talkSprites[i]->_name, Stance) == 0) {
+ ret = _talkSprites[i];
break;
}
}
@@ -102,11 +102,11 @@ CBSprite *CAdTalkHolder::GetTalkStance(char *Stance) {
// not a valid stance? get a random one
if (ret == NULL) {
- if (m_TalkSprites.GetSize() < 1) ret = m_Sprite;
+ if (_talkSprites.GetSize() < 1) ret = _sprite;
else {
// TODO: remember last
- int rnd = rand() % m_TalkSprites.GetSize();
- ret = m_TalkSprites[rnd];
+ int rnd = rand() % _talkSprites.GetSize();
+ ret = _talkSprites[rnd];
}
}
@@ -127,14 +127,14 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
CScValue *Val = Stack->Pop();
bool SetCurrent = false;
- if (m_CurrentSprite && m_CurrentSprite == m_Sprite) SetCurrent = true;
+ if (_currentSprite && _currentSprite == _sprite) SetCurrent = true;
- delete m_Sprite;
- m_Sprite = NULL;
+ delete _sprite;
+ _sprite = NULL;
if (Val->IsNULL()) {
- m_Sprite = NULL;
- if (SetCurrent) m_CurrentSprite = NULL;
+ _sprite = NULL;
+ if (SetCurrent) _currentSprite = NULL;
Stack->PushBool(true);
} else {
char *Filename = Val->GetString();
@@ -143,8 +143,8 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
Script->RuntimeError("SetSprite method failed for file '%s'", Filename);
Stack->PushBool(false);
} else {
- m_Sprite = spr;
- if (SetCurrent) m_CurrentSprite = m_Sprite;
+ _sprite = spr;
+ if (SetCurrent) _currentSprite = _sprite;
Stack->PushBool(true);
}
}
@@ -157,8 +157,8 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
else if (strcmp(Name, "GetSprite") == 0) {
Stack->CorrectParams(0);
- if (!m_Sprite || !m_Sprite->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_Sprite->m_Filename);
+ if (!_sprite || !_sprite->_filename) Stack->PushNULL();
+ else Stack->PushString(_sprite->_filename);
return S_OK;
}
@@ -168,8 +168,8 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
else if (strcmp(Name, "GetSpriteObject") == 0) {
Stack->CorrectParams(0);
- if (!m_Sprite) Stack->PushNULL();
- else Stack->PushNative(m_Sprite, true);
+ if (!_sprite) Stack->PushNULL();
+ else Stack->PushNative(_sprite, true);
return S_OK;
}
@@ -187,8 +187,8 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
Stack->PushBool(false);
Script->RuntimeError("AddTalkSprite method failed for file '%s'", Filename);
} else {
- if (Ex) m_TalkSpritesEx.Add(spr);
- else m_TalkSprites.Add(spr);
+ if (Ex) _talkSpritesEx.Add(spr);
+ else _talkSprites.Add(spr);
Stack->PushBool(true);
}
return S_OK;
@@ -208,22 +208,22 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
bool SetTemp2 = false;
if (Ex) {
- for (i = 0; i < m_TalkSpritesEx.GetSize(); i++) {
- if (scumm_stricmp(m_TalkSpritesEx[i]->m_Filename, Filename) == 0) {
- if (m_CurrentSprite == m_TalkSpritesEx[i]) SetCurrent = true;
- if (m_TempSprite2 == m_TalkSpritesEx[i]) SetTemp2 = true;
- delete m_TalkSpritesEx[i];
- m_TalkSpritesEx.RemoveAt(i);
+ for (i = 0; i < _talkSpritesEx.GetSize(); i++) {
+ if (scumm_stricmp(_talkSpritesEx[i]->_filename, Filename) == 0) {
+ if (_currentSprite == _talkSpritesEx[i]) SetCurrent = true;
+ if (_tempSprite2 == _talkSpritesEx[i]) SetTemp2 = true;
+ delete _talkSpritesEx[i];
+ _talkSpritesEx.RemoveAt(i);
break;
}
}
} else {
- for (i = 0; i < m_TalkSprites.GetSize(); i++) {
- if (scumm_stricmp(m_TalkSprites[i]->m_Filename, Filename) == 0) {
- if (m_CurrentSprite == m_TalkSprites[i]) SetCurrent = true;
- if (m_TempSprite2 == m_TalkSprites[i]) SetTemp2 = true;
- delete m_TalkSprites[i];
- m_TalkSprites.RemoveAt(i);
+ for (i = 0; i < _talkSprites.GetSize(); i++) {
+ if (scumm_stricmp(_talkSprites[i]->_filename, Filename) == 0) {
+ if (_currentSprite == _talkSprites[i]) SetCurrent = true;
+ if (_tempSprite2 == _talkSprites[i]) SetTemp2 = true;
+ delete _talkSprites[i];
+ _talkSprites.RemoveAt(i);
break;
}
}
@@ -231,8 +231,8 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
}
Stack->PushBool(true);
- if (SetCurrent) m_CurrentSprite = m_Sprite;
- if (SetTemp2) m_TempSprite2 = m_Sprite;
+ if (SetCurrent) _currentSprite = _sprite;
+ if (SetTemp2) _tempSprite2 = _sprite;
return S_OK;
}
@@ -257,28 +257,28 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
// delete current
int i;
if (Ex) {
- for (i = 0; i < m_TalkSpritesEx.GetSize(); i++) {
- if (m_TalkSpritesEx[i] == m_CurrentSprite) SetCurrent = true;
- if (m_TalkSpritesEx[i] == m_TempSprite2) SetTemp2 = true;
- delete m_TalkSpritesEx[i];
+ for (i = 0; i < _talkSpritesEx.GetSize(); i++) {
+ if (_talkSpritesEx[i] == _currentSprite) SetCurrent = true;
+ if (_talkSpritesEx[i] == _tempSprite2) SetTemp2 = true;
+ delete _talkSpritesEx[i];
}
- m_TalkSpritesEx.RemoveAll();
+ _talkSpritesEx.RemoveAll();
} else {
- for (i = 0; i < m_TalkSprites.GetSize(); i++) {
- if (m_TalkSprites[i] == m_CurrentSprite) SetCurrent = true;
- if (m_TalkSprites[i] == m_TempSprite2) SetTemp2 = true;
- delete m_TalkSprites[i];
+ for (i = 0; i < _talkSprites.GetSize(); i++) {
+ if (_talkSprites[i] == _currentSprite) SetCurrent = true;
+ if (_talkSprites[i] == _tempSprite2) SetTemp2 = true;
+ delete _talkSprites[i];
}
- m_TalkSprites.RemoveAll();
+ _talkSprites.RemoveAll();
}
// set new
- if (Ex) m_TalkSpritesEx.Add(spr);
- else m_TalkSprites.Add(spr);
+ if (Ex) _talkSpritesEx.Add(spr);
+ else _talkSprites.Add(spr);
Stack->PushBool(true);
- if (SetCurrent) m_CurrentSprite = spr;
- if (SetTemp2) m_TempSprite2 = spr;
+ if (SetCurrent) _currentSprite = spr;
+ if (SetTemp2) _tempSprite2 = spr;
}
return S_OK;
}
@@ -289,14 +289,14 @@ HRESULT CAdTalkHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
//////////////////////////////////////////////////////////////////////////
CScValue *CAdTalkHolder::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("talk-holder");
- return m_ScValue;
+ _scValue->SetString("talk-holder");
+ return _scValue;
}
else return CAdObject::ScGetProperty(Name);
@@ -327,14 +327,14 @@ char *CAdTalkHolder::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdTalkHolder::SaveAsText(CBDynBuffer *Buffer, int Indent) {
int i;
- for (i = 0; i < m_TalkSprites.GetSize(); i++) {
- if (m_TalkSprites[i]->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "TALK=\"%s\"\n", m_TalkSprites[i]->m_Filename);
+ for (i = 0; i < _talkSprites.GetSize(); i++) {
+ if (_talkSprites[i]->_filename)
+ Buffer->PutTextIndent(Indent + 2, "TALK=\"%s\"\n", _talkSprites[i]->_filename);
}
- for (i = 0; i < m_TalkSpritesEx.GetSize(); i++) {
- if (m_TalkSpritesEx[i]->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "TALK_SPECIAL=\"%s\"\n", m_TalkSpritesEx[i]->m_Filename);
+ for (i = 0; i < _talkSpritesEx.GetSize(); i++) {
+ if (_talkSpritesEx[i]->_filename)
+ Buffer->PutTextIndent(Indent + 2, "TALK_SPECIAL=\"%s\"\n", _talkSpritesEx[i]->_filename);
}
return S_OK;
@@ -345,9 +345,9 @@ HRESULT CAdTalkHolder::SaveAsText(CBDynBuffer *Buffer, int Indent) {
HRESULT CAdTalkHolder::Persist(CBPersistMgr *PersistMgr) {
CAdObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Sprite));
- m_TalkSprites.Persist(PersistMgr);
- m_TalkSpritesEx.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_sprite));
+ _talkSprites.Persist(PersistMgr);
+ _talkSpritesEx.Persist(PersistMgr);
return S_OK;
}
diff --git a/engines/wintermute/AdTalkHolder.h b/engines/wintermute/AdTalkHolder.h
index 7eb07a8f66..3b30779de8 100644
--- a/engines/wintermute/AdTalkHolder.h
+++ b/engines/wintermute/AdTalkHolder.h
@@ -38,9 +38,9 @@ public:
DECLARE_PERSISTENT(CAdTalkHolder, CAdObject)
virtual CBSprite *GetTalkStance(char *Stance);
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
- CBSprite *m_Sprite;
- CBArray<CBSprite *, CBSprite *> m_TalkSprites;
- CBArray<CBSprite *, CBSprite *> m_TalkSpritesEx;
+ CBSprite *_sprite;
+ CBArray<CBSprite *, CBSprite *> _talkSprites;
+ CBArray<CBSprite *, CBSprite *> _talkSpritesEx;
CAdTalkHolder(CBGame *inGame);
virtual ~CAdTalkHolder();
diff --git a/engines/wintermute/AdTalkNode.cpp b/engines/wintermute/AdTalkNode.cpp
index 03c0d90609..17e1ca2a2b 100644
--- a/engines/wintermute/AdTalkNode.cpp
+++ b/engines/wintermute/AdTalkNode.cpp
@@ -40,30 +40,30 @@ IMPLEMENT_PERSISTENT(CAdTalkNode, false)
//////////////////////////////////////////////////////////////////////////
CAdTalkNode::CAdTalkNode(CBGame *inGame): CBBase(inGame) {
- m_Sprite = NULL;
- m_SpriteFilename = NULL;
- m_SpriteSet = NULL;
- m_SpriteSetFilename = NULL;
- m_Comment = NULL;
-
- m_StartTime = m_EndTime = 0;
- m_PlayToEnd = false;
- m_PreCache = false;
+ _sprite = NULL;
+ _spriteFilename = NULL;
+ _spriteSet = NULL;
+ _spriteSetFilename = NULL;
+ _comment = NULL;
+
+ _startTime = _endTime = 0;
+ _playToEnd = false;
+ _preCache = false;
}
//////////////////////////////////////////////////////////////////////////
CAdTalkNode::~CAdTalkNode() {
- delete[] m_SpriteFilename;
- delete m_Sprite;
- delete[] m_SpriteSetFilename;
- delete m_SpriteSet;
- delete m_Comment;
- m_SpriteFilename = NULL;
- m_Sprite = NULL;
- m_SpriteSetFilename = NULL;
- m_SpriteSet = NULL;
- m_Comment = NULL;
+ delete[] _spriteFilename;
+ delete _sprite;
+ delete[] _spriteSetFilename;
+ delete _spriteSet;
+ delete _comment;
+ _spriteFilename = NULL;
+ _sprite = NULL;
+ _spriteSetFilename = NULL;
+ _spriteSet = NULL;
+ _comment = NULL;
}
@@ -105,45 +105,45 @@ HRESULT CAdTalkNode::LoadBuffer(byte *Buffer, bool Complete) {
Buffer = params;
}
- m_EndTime = 0;
- m_PlayToEnd = false;
- m_PreCache = false;
+ _endTime = 0;
+ _playToEnd = false;
+ _preCache = false;
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
case TOKEN_SPRITE:
- CBUtils::SetString(&m_SpriteFilename, (char *)params);
+ CBUtils::SetString(&_spriteFilename, (char *)params);
break;
case TOKEN_SPRITESET_FILE:
- CBUtils::SetString(&m_SpriteSetFilename, (char *)params);
+ CBUtils::SetString(&_spriteSetFilename, (char *)params);
break;
case TOKEN_SPRITESET: {
- delete m_SpriteSet;
- m_SpriteSet = new CAdSpriteSet(Game);
- if (!m_SpriteSet || FAILED(m_SpriteSet->LoadBuffer(params, false))) {
- delete m_SpriteSet;
- m_SpriteSet = NULL;
+ delete _spriteSet;
+ _spriteSet = new CAdSpriteSet(Game);
+ if (!_spriteSet || FAILED(_spriteSet->LoadBuffer(params, false))) {
+ delete _spriteSet;
+ _spriteSet = NULL;
cmd = PARSERR_GENERIC;
}
}
break;
case TOKEN_START_TIME:
- parser.ScanStr((char *)params, "%d", &m_StartTime);
+ parser.ScanStr((char *)params, "%d", &_startTime);
break;
case TOKEN_END_TIME:
- parser.ScanStr((char *)params, "%d", &m_EndTime);
+ parser.ScanStr((char *)params, "%d", &_endTime);
break;
case TOKEN_PRECACHE:
- parser.ScanStr((char *)params, "%b", &m_PreCache);
+ parser.ScanStr((char *)params, "%b", &_preCache);
break;
case TOKEN_COMMENT:
- if (Game->m_EditorMode) CBUtils::SetString(&m_Comment, (char *)params);
+ if (Game->_editorMode) CBUtils::SetString(&_comment, (char *)params);
break;
case TOKEN_EDITOR_PROPERTY:
@@ -161,19 +161,19 @@ HRESULT CAdTalkNode::LoadBuffer(byte *Buffer, bool Complete) {
return E_FAIL;
}
- if (m_EndTime == 0) m_PlayToEnd = true;
- else m_PlayToEnd = false;
+ if (_endTime == 0) _playToEnd = true;
+ else _playToEnd = false;
- if (m_PreCache && m_SpriteFilename) {
- delete m_Sprite;
- m_Sprite = new CBSprite(Game);
- if (!m_Sprite || FAILED(m_Sprite->LoadFile(m_SpriteFilename))) return E_FAIL;
+ if (_preCache && _spriteFilename) {
+ delete _sprite;
+ _sprite = new CBSprite(Game);
+ if (!_sprite || FAILED(_sprite->LoadFile(_spriteFilename))) return E_FAIL;
}
- if (m_PreCache && m_SpriteSetFilename) {
- delete m_SpriteSet;
- m_SpriteSet = new CAdSpriteSet(Game);
- if (!m_SpriteSet || FAILED(m_SpriteSet->LoadFile(m_SpriteSetFilename))) return E_FAIL;
+ if (_preCache && _spriteSetFilename) {
+ delete _spriteSet;
+ _spriteSet = new CAdSpriteSet(Game);
+ if (!_spriteSet || FAILED(_spriteSet->LoadFile(_spriteSetFilename))) return E_FAIL;
}
@@ -184,14 +184,14 @@ HRESULT CAdTalkNode::LoadBuffer(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdTalkNode::Persist(CBPersistMgr *PersistMgr) {
- PersistMgr->Transfer(TMEMBER(m_Comment));
- PersistMgr->Transfer(TMEMBER(m_StartTime));
- PersistMgr->Transfer(TMEMBER(m_EndTime));
- PersistMgr->Transfer(TMEMBER(m_PlayToEnd));
- PersistMgr->Transfer(TMEMBER(m_Sprite));
- PersistMgr->Transfer(TMEMBER(m_SpriteFilename));
- PersistMgr->Transfer(TMEMBER(m_SpriteSet));
- PersistMgr->Transfer(TMEMBER(m_SpriteSetFilename));
+ PersistMgr->Transfer(TMEMBER(_comment));
+ PersistMgr->Transfer(TMEMBER(_startTime));
+ PersistMgr->Transfer(TMEMBER(_endTime));
+ PersistMgr->Transfer(TMEMBER(_playToEnd));
+ PersistMgr->Transfer(TMEMBER(_sprite));
+ PersistMgr->Transfer(TMEMBER(_spriteFilename));
+ PersistMgr->Transfer(TMEMBER(_spriteSet));
+ PersistMgr->Transfer(TMEMBER(_spriteSetFilename));
return S_OK;
}
@@ -200,13 +200,13 @@ HRESULT CAdTalkNode::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdTalkNode::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "ACTION {\n");
- if (m_Comment) Buffer->PutTextIndent(Indent + 2, "COMMENT=\"%s\"\n", m_Comment);
- Buffer->PutTextIndent(Indent + 2, "START_TIME=%d\n", m_StartTime);
- if (!m_PlayToEnd) Buffer->PutTextIndent(Indent + 2, "END_TIME=%d\n", m_EndTime);
- if (m_SpriteFilename) Buffer->PutTextIndent(Indent + 2, "SPRITE=\"%s\"\n", m_SpriteFilename);
- if (m_SpriteSetFilename) Buffer->PutTextIndent(Indent + 2, "SPRITESET_FILE=\"%s\"\n", m_SpriteSetFilename);
- else if (m_SpriteSet) m_SpriteSet->SaveAsText(Buffer, Indent + 2);
- if (m_PreCache) Buffer->PutTextIndent(Indent + 2, "PRECACHE=\"%s\"\n", m_PreCache ? "TRUE" : "FALSE");
+ if (_comment) Buffer->PutTextIndent(Indent + 2, "COMMENT=\"%s\"\n", _comment);
+ Buffer->PutTextIndent(Indent + 2, "START_TIME=%d\n", _startTime);
+ if (!_playToEnd) Buffer->PutTextIndent(Indent + 2, "END_TIME=%d\n", _endTime);
+ if (_spriteFilename) Buffer->PutTextIndent(Indent + 2, "SPRITE=\"%s\"\n", _spriteFilename);
+ if (_spriteSetFilename) Buffer->PutTextIndent(Indent + 2, "SPRITESET_FILE=\"%s\"\n", _spriteSetFilename);
+ else if (_spriteSet) _spriteSet->SaveAsText(Buffer, Indent + 2);
+ if (_preCache) Buffer->PutTextIndent(Indent + 2, "PRECACHE=\"%s\"\n", _preCache ? "TRUE" : "FALSE");
CBBase::SaveAsText(Buffer, Indent + 2);
@@ -218,20 +218,20 @@ HRESULT CAdTalkNode::SaveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdTalkNode::LoadSprite() {
- if (m_SpriteFilename && !m_Sprite) {
- m_Sprite = new CBSprite(Game);
- if (!m_Sprite || FAILED(m_Sprite->LoadFile(m_SpriteFilename))) {
- delete m_Sprite;
- m_Sprite = NULL;
+ if (_spriteFilename && !_sprite) {
+ _sprite = new CBSprite(Game);
+ if (!_sprite || FAILED(_sprite->LoadFile(_spriteFilename))) {
+ delete _sprite;
+ _sprite = NULL;
return E_FAIL;
} else return S_OK;
}
- else if (m_SpriteSetFilename && !m_SpriteSet) {
- m_SpriteSet = new CAdSpriteSet(Game);
- if (!m_SpriteSet || FAILED(m_SpriteSet->LoadFile(m_SpriteSetFilename))) {
- delete m_SpriteSet;
- m_SpriteSet = NULL;
+ else if (_spriteSetFilename && !_spriteSet) {
+ _spriteSet = new CAdSpriteSet(Game);
+ if (!_spriteSet || FAILED(_spriteSet->LoadFile(_spriteSetFilename))) {
+ delete _spriteSet;
+ _spriteSet = NULL;
return E_FAIL;
} else return S_OK;
}
@@ -242,12 +242,12 @@ HRESULT CAdTalkNode::LoadSprite() {
//////////////////////////////////////////////////////////////////////////
bool CAdTalkNode::IsInTimeInterval(uint32 Time, TDirection Dir) {
- if (Time >= m_StartTime) {
- if (m_PlayToEnd) {
- if ((m_SpriteFilename && m_Sprite == NULL) || (m_Sprite && m_Sprite->m_Finished == false)) return true;
- else if ((m_SpriteSetFilename && m_SpriteSet == NULL) || (m_SpriteSet && m_SpriteSet->GetSprite(Dir) && m_SpriteSet->GetSprite(Dir)->m_Finished == false)) return true;
+ 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 return false;
- } else return m_EndTime >= Time;
+ } else return _endTime >= Time;
} else return false;
}
@@ -255,8 +255,8 @@ bool CAdTalkNode::IsInTimeInterval(uint32 Time, TDirection Dir) {
//////////////////////////////////////////////////////////////////////////
CBSprite *CAdTalkNode::GetSprite(TDirection Dir) {
LoadSprite();
- if (m_Sprite) return m_Sprite;
- else if (m_SpriteSet) return m_SpriteSet->GetSprite(Dir);
+ if (_sprite) return _sprite;
+ else if (_spriteSet) return _spriteSet->GetSprite(Dir);
else return NULL;
}
diff --git a/engines/wintermute/AdTalkNode.h b/engines/wintermute/AdTalkNode.h
index 3587cdb57b..d939847b70 100644
--- a/engines/wintermute/AdTalkNode.h
+++ b/engines/wintermute/AdTalkNode.h
@@ -37,8 +37,8 @@ class CAdSpriteSet;
class CBSprite;
class CAdTalkNode : public CBBase {
public:
- char *m_SpriteSetFilename;
- CAdSpriteSet *m_SpriteSet;
+ char *_spriteSetFilename;
+ CAdSpriteSet *_spriteSet;
CBSprite *GetSprite(TDirection Dir);
bool IsInTimeInterval(uint32 Time, TDirection Dir);
HRESULT LoadSprite();
@@ -48,13 +48,13 @@ public:
virtual ~CAdTalkNode();
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent = 0);
- char *m_SpriteFilename;
- CBSprite *m_Sprite;
- uint32 m_StartTime;
- uint32 m_EndTime;
- bool m_PlayToEnd;
- bool m_PreCache;
- char *m_Comment;
+ char *_spriteFilename;
+ CBSprite *_sprite;
+ uint32 _startTime;
+ uint32 _endTime;
+ bool _playToEnd;
+ bool _preCache;
+ char *_comment;
};
diff --git a/engines/wintermute/AdWaypointGroup.cpp b/engines/wintermute/AdWaypointGroup.cpp
index bbd1cdb92a..97a8056713 100644
--- a/engines/wintermute/AdWaypointGroup.cpp
+++ b/engines/wintermute/AdWaypointGroup.cpp
@@ -39,10 +39,10 @@ IMPLEMENT_PERSISTENT(CAdWaypointGroup, false)
//////////////////////////////////////////////////////////////////////////
CAdWaypointGroup::CAdWaypointGroup(CBGame *inGame): CBObject(inGame) {
- m_Active = true;
- m_EditorSelectedPoint = -1;
- m_LastMimicScale = -1;
- m_LastMimicX = m_LastMimicY = INT_MIN;
+ _active = true;
+ _editorSelectedPoint = -1;
+ _lastMimicScale = -1;
+ _lastMimicX = _lastMimicY = INT_MIN;
}
@@ -54,16 +54,16 @@ CAdWaypointGroup::~CAdWaypointGroup() {
//////////////////////////////////////////////////////////////////////////
void CAdWaypointGroup::Cleanup() {
- for (int i = 0; i < m_Points.GetSize(); i++)
- delete m_Points[i];
- m_Points.RemoveAll();
- m_EditorSelectedPoint = -1;
+ for (int i = 0; i < _points.GetSize(); i++)
+ delete _points[i];
+ _points.RemoveAll();
+ _editorSelectedPoint = -1;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdWaypointGroup::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CAdWaypointGroup::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -71,8 +71,8 @@ HRESULT CAdWaypointGroup::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -131,16 +131,16 @@ HRESULT CAdWaypointGroup::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_POINT: {
int x, y;
parser.ScanStr((char *)params, "%d,%d", &x, &y);
- m_Points.Add(new CBPoint(x, y));
+ _points.Add(new CBPoint(x, y));
}
break;
case TOKEN_EDITOR_SELECTED:
- parser.ScanStr((char *)params, "%b", &m_EditorSelected);
+ parser.ScanStr((char *)params, "%b", &_editorSelected);
break;
case TOKEN_EDITOR_SELECTED_POINT:
- parser.ScanStr((char *)params, "%d", &m_EditorSelectedPoint);
+ parser.ScanStr((char *)params, "%d", &_editorSelectedPoint);
break;
case TOKEN_PROPERTY:
@@ -164,15 +164,15 @@ HRESULT CAdWaypointGroup::LoadBuffer(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdWaypointGroup::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "WAYPOINTS {\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", m_EditorSelected ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED_POINT=%d\n", m_EditorSelectedPoint);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED_POINT=%d\n", _editorSelectedPoint);
- if (m_ScProp) m_ScProp->SaveAsText(Buffer, Indent + 2);
+ if (_scProp) _scProp->SaveAsText(Buffer, Indent + 2);
CBBase::SaveAsText(Buffer, Indent + 2);
- for (int i = 0; i < m_Points.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "POINT {%d,%d}\n", m_Points[i]->x, m_Points[i]->y);
+ for (int i = 0; i < _points.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
}
Buffer->PutTextIndent(Indent, "}\n");
@@ -186,12 +186,12 @@ HRESULT CAdWaypointGroup::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Active));
- PersistMgr->Transfer(TMEMBER(m_EditorSelectedPoint));
- PersistMgr->Transfer(TMEMBER(m_LastMimicScale));
- PersistMgr->Transfer(TMEMBER(m_LastMimicX));
- PersistMgr->Transfer(TMEMBER(m_LastMimicY));
- m_Points.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_active));
+ PersistMgr->Transfer(TMEMBER(_editorSelectedPoint));
+ PersistMgr->Transfer(TMEMBER(_lastMimicScale));
+ PersistMgr->Transfer(TMEMBER(_lastMimicX));
+ PersistMgr->Transfer(TMEMBER(_lastMimicY));
+ _points.Persist(PersistMgr);
return S_OK;
}
@@ -199,22 +199,22 @@ HRESULT CAdWaypointGroup::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
CScValue *CAdWaypointGroup::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("waypoint-group");
- return m_ScValue;
+ _scValue->SetString("waypoint-group");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Active") == 0) {
- m_ScValue->SetBool(m_Active);
- return m_ScValue;
+ _scValue->SetBool(_active);
+ return _scValue;
}
else return CBObject::ScGetProperty(Name);
@@ -227,7 +227,7 @@ HRESULT CAdWaypointGroup::ScSetProperty(char *Name, CScValue *Value) {
// Active
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Active") == 0) {
- m_Active = Value->GetBool();
+ _active = Value->GetBool();
return S_OK;
}
@@ -237,22 +237,22 @@ HRESULT CAdWaypointGroup::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdWaypointGroup::Mimic(CAdWaypointGroup *Wpt, float Scale, int X, int Y) {
- if (Scale == m_LastMimicScale && X == m_LastMimicX && Y == m_LastMimicY) return S_OK;
+ if (Scale == _lastMimicScale && X == _lastMimicX && Y == _lastMimicY) return S_OK;
Cleanup();
- for (int i = 0; i < Wpt->m_Points.GetSize(); i++) {
+ for (int i = 0; i < Wpt->_points.GetSize(); i++) {
int x, y;
- x = (int)((float)Wpt->m_Points[i]->x * Scale / 100.0f);
- y = (int)((float)Wpt->m_Points[i]->y * Scale / 100.0f);
+ x = (int)((float)Wpt->_points[i]->x * Scale / 100.0f);
+ y = (int)((float)Wpt->_points[i]->y * Scale / 100.0f);
- m_Points.Add(new CBPoint(x + X, y + Y));
+ _points.Add(new CBPoint(x + X, y + Y));
}
- m_LastMimicScale = Scale;
- m_LastMimicX = X;
- m_LastMimicY = Y;
+ _lastMimicScale = Scale;
+ _lastMimicX = X;
+ _lastMimicY = Y;
return S_OK;
}
diff --git a/engines/wintermute/AdWaypointGroup.h b/engines/wintermute/AdWaypointGroup.h
index 50992f1387..e997e89663 100644
--- a/engines/wintermute/AdWaypointGroup.h
+++ b/engines/wintermute/AdWaypointGroup.h
@@ -35,20 +35,20 @@ namespace WinterMute {
class CBPoint;
class CAdWaypointGroup : public CBObject {
public:
- float m_LastMimicScale;
- int m_LastMimicX;
- int m_LastMimicY;
+ float _lastMimicScale;
+ int _lastMimicX;
+ int _lastMimicY;
void Cleanup();
HRESULT Mimic(CAdWaypointGroup *Wpt, float Scale = 100.0f, int X = 0, int Y = 0);
DECLARE_PERSISTENT(CAdWaypointGroup, CBObject)
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
- bool m_Active;
+ bool _active;
CAdWaypointGroup(CBGame *inGame);
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
virtual ~CAdWaypointGroup();
- CBArray<CBPoint *, CBPoint *> m_Points;
- int m_EditorSelectedPoint;
+ CBArray<CBPoint *, CBPoint *> _points;
+ int _editorSelectedPoint;
virtual CScValue *ScGetProperty(char *Name);
virtual HRESULT ScSetProperty(char *Name, CScValue *Value);
};
diff --git a/engines/wintermute/BActiveRect.cpp b/engines/wintermute/BActiveRect.cpp
index 5827cb8d61..867b492a85 100644
--- a/engines/wintermute/BActiveRect.cpp
+++ b/engines/wintermute/BActiveRect.cpp
@@ -36,51 +36,51 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBActiveRect::CBActiveRect(CBGame *inGame): CBBase(inGame) {
- CBPlatform::SetRectEmpty(&m_Rect);
- m_Owner = NULL;
- m_Frame = NULL;
- m_Region = NULL;
- m_ZoomX = 100;
- m_ZoomY = 100;
- m_OffsetX = m_OffsetY = 0;
+ CBPlatform::SetRectEmpty(&_rect);
+ _owner = NULL;
+ _frame = NULL;
+ _region = NULL;
+ _zoomX = 100;
+ _zoomY = 100;
+ _offsetX = _offsetY = 0;
ClipRect();
}
//////////////////////////////////////////////////////////////////////
CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *Owner, CBSubFrame *Frame, int X, int Y, int Width, int Height, float ZoomX, float ZoomY, bool Precise): CBBase(inGame) {
- m_Owner = Owner;
- m_Frame = Frame;
- CBPlatform::SetRect(&m_Rect, X, Y, X + Width, Y + Height);
- m_ZoomX = ZoomX;
- m_ZoomY = ZoomY;
- m_Precise = Precise;
- m_Region = NULL;
- m_OffsetX = m_OffsetY = 0;
+ _owner = Owner;
+ _frame = Frame;
+ CBPlatform::SetRect(&_rect, X, Y, X + Width, Y + Height);
+ _zoomX = ZoomX;
+ _zoomY = ZoomY;
+ _precise = Precise;
+ _region = NULL;
+ _offsetX = _offsetY = 0;
ClipRect();
}
//////////////////////////////////////////////////////////////////////
CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *Owner, CBRegion *Region, int OffsetX, int OffsetY): CBBase(inGame) {
- m_Owner = Owner;
- m_Region = Region;
- CBPlatform::CopyRect(&m_Rect, &Region->m_Rect);
- CBPlatform::OffsetRect(&m_Rect, -OffsetX, -OffsetY);
- m_ZoomX = 100;
- m_ZoomY = 100;
- m_Precise = true;
- m_Frame = NULL;
+ _owner = Owner;
+ _region = Region;
+ CBPlatform::CopyRect(&_rect, &Region->_rect);
+ CBPlatform::OffsetRect(&_rect, -OffsetX, -OffsetY);
+ _zoomX = 100;
+ _zoomY = 100;
+ _precise = true;
+ _frame = NULL;
ClipRect();
- m_OffsetX = OffsetX;
- m_OffsetY = OffsetY;
+ _offsetX = OffsetX;
+ _offsetY = OffsetY;
}
//////////////////////////////////////////////////////////////////////
CBActiveRect::~CBActiveRect() {
- m_Owner = NULL;
- m_Frame = NULL;
- m_Region = NULL;
+ _owner = NULL;
+ _frame = NULL;
+ _region = NULL;
}
@@ -89,19 +89,19 @@ void CBActiveRect::ClipRect() {
RECT rc;
bool CustomViewport;
Game->GetCurrentViewportRect(&rc, &CustomViewport);
- CBRenderer *Rend = Game->m_Renderer;
+ CBRenderer *Rend = Game->_renderer;
if (!CustomViewport) {
- rc.left -= Rend->m_DrawOffsetX;
- rc.right -= Rend->m_DrawOffsetX;
- rc.top -= Rend->m_DrawOffsetY;
- rc.bottom -= Rend->m_DrawOffsetY;
+ rc.left -= Rend->_drawOffsetX;
+ rc.right -= Rend->_drawOffsetX;
+ rc.top -= Rend->_drawOffsetY;
+ rc.bottom -= Rend->_drawOffsetY;
}
- if (rc.left > m_Rect.left) m_OffsetX = rc.left - m_Rect.left;
- if (rc.top > m_Rect.top) m_OffsetY = rc.top - m_Rect.top;
+ if (rc.left > _rect.left) _offsetX = rc.left - _rect.left;
+ if (rc.top > _rect.top) _offsetY = rc.top - _rect.top;
- CBPlatform::IntersectRect(&m_Rect, &m_Rect, &rc);
+ CBPlatform::IntersectRect(&_rect, &_rect, &rc);
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/BActiveRect.h b/engines/wintermute/BActiveRect.h
index ee9bb8aea1..9143c1fa6e 100644
--- a/engines/wintermute/BActiveRect.h
+++ b/engines/wintermute/BActiveRect.h
@@ -38,15 +38,15 @@ class CBObject;
class CBActiveRect: CBBase {
public:
void ClipRect();
- bool m_Precise;
- float m_ZoomX;
- float m_ZoomY;
- CBSubFrame *m_Frame;
- CBObject *m_Owner;
- CBRegion *m_Region;
- int m_OffsetX;
- int m_OffsetY;
- RECT m_Rect;
+ bool _precise;
+ float _zoomX;
+ float _zoomY;
+ CBSubFrame *_frame;
+ CBObject *_owner;
+ CBRegion *_region;
+ int _offsetX;
+ int _offsetY;
+ RECT _rect;
CBActiveRect(CBGame *inGameOwner = NULL);
CBActiveRect(CBGame *inGameOwner, CBObject *Owner, CBSubFrame *Frame, int X, int Y, int Width, int Height, float ZoomX = 100, float ZoomY = 100, bool Precise = true);
CBActiveRect(CBGame *inGame, CBObject *Owner, CBRegion *Region, int OffsetX, int OffsetY);
diff --git a/engines/wintermute/BBase.cpp b/engines/wintermute/BBase.cpp
index 536decb5f9..32d89cea7f 100644
--- a/engines/wintermute/BBase.cpp
+++ b/engines/wintermute/BBase.cpp
@@ -37,29 +37,29 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBBase::CBBase(CBGame *GameOwner) {
Game = GameOwner;
- m_Persistable = true;
+ _persistable = true;
}
//////////////////////////////////////////////////////////////////////////
CBBase::CBBase() {
Game = NULL;
- m_Persistable = true;
+ _persistable = true;
}
//////////////////////////////////////////////////////////////////////
CBBase::~CBBase() {
- m_EditorProps.clear();
+ _editorProps.clear();
}
//////////////////////////////////////////////////////////////////////////
const char *CBBase::GetEditorProp(const char *PropName, const char *InitVal) {
- m_EditorPropsIter = m_EditorProps.find(PropName);
- if (m_EditorPropsIter != m_EditorProps.end())
- return m_EditorPropsIter->_value.c_str();
- //return m_EditorPropsIter->second.c_str(); // <- TODO Clean
+ _editorPropsIter = _editorProps.find(PropName);
+ if (_editorPropsIter != _editorProps.end())
+ return _editorPropsIter->_value.c_str();
+ //return _editorPropsIter->second.c_str(); // <- TODO Clean
else return InitVal;
}
@@ -69,9 +69,9 @@ HRESULT CBBase::SetEditorProp(const char *PropName, const char *PropValue) {
if (PropName == NULL) return E_FAIL;
if (PropValue == NULL) {
- m_EditorProps.erase(PropName);
+ _editorProps.erase(PropName);
} else {
- m_EditorProps[PropName] = PropValue;
+ _editorProps[PropName] = PropValue;
}
return S_OK;
}
@@ -92,7 +92,7 @@ HRESULT CBBase::ParseEditorProperty(byte *Buffer, bool Complete) {
TOKEN_TABLE_END
- if (!Game->m_EditorMode) return S_OK;
+ if (!Game->_editorMode) return S_OK;
byte *params;
@@ -159,17 +159,17 @@ HRESULT CBBase::ParseEditorProperty(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBBase::SaveAsText(CBDynBuffer *Buffer, int Indent) {
- m_EditorPropsIter = m_EditorProps.begin();
- while (m_EditorPropsIter != m_EditorProps.end()) {
+ _editorPropsIter = _editorProps.begin();
+ while (_editorPropsIter != _editorProps.end()) {
Buffer->PutTextIndent(Indent, "EDITOR_PROPERTY\n");
Buffer->PutTextIndent(Indent, "{\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", (char *)m_EditorPropsIter->_key.c_str());
- Buffer->PutTextIndent(Indent + 2, "VALUE=\"%s\"\n", m_EditorPropsIter->_value.c_str());
- //Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", (char *)m_EditorPropsIter->first.c_str()); // <- TODO, remove
- //Buffer->PutTextIndent(Indent + 2, "VALUE=\"%s\"\n", m_EditorPropsIter->second.c_str()); // <- TODO, remove
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", (char *)_editorPropsIter->_key.c_str());
+ Buffer->PutTextIndent(Indent + 2, "VALUE=\"%s\"\n", _editorPropsIter->_value.c_str());
+ //Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", (char *)_editorPropsIter->first.c_str()); // <- TODO, remove
+ //Buffer->PutTextIndent(Indent + 2, "VALUE=\"%s\"\n", _editorPropsIter->second.c_str()); // <- TODO, remove
Buffer->PutTextIndent(Indent, "}\n\n");
- m_EditorPropsIter++;
+ _editorPropsIter++;
}
return S_OK;
}
diff --git a/engines/wintermute/BBase.h b/engines/wintermute/BBase.h
index c72d687eca..423c9fef6a 100644
--- a/engines/wintermute/BBase.h
+++ b/engines/wintermute/BBase.h
@@ -44,7 +44,7 @@ class CBDynBuffer;
class CBBase {
public:
- bool m_Persistable;
+ bool _persistable;
HRESULT SetEditorProp(const char *PropName, const char *PropValue);
const char *GetEditorProp(const char *PropName, const char *InitVal = NULL);
CBBase(TDynamicConstructor, TDynamicConstructor) {};
@@ -55,10 +55,10 @@ public:
CBBase(CBGame *GameOwner);
virtual ~CBBase();
- Common::HashMap<Common::String, Common::String> m_EditorProps;
- Common::HashMap<Common::String, Common::String>::iterator m_EditorPropsIter;
-/* std::map<std::string, std::string> m_EditorProps;
- std::map<std::string, std::string>::iterator m_EditorPropsIter;*/
+ Common::HashMap<Common::String, Common::String> _editorProps;
+ Common::HashMap<Common::String, Common::String>::iterator _editorPropsIter;
+/* std::map<std::string, std::string> _editorProps;
+ std::map<std::string, std::string>::iterator _editorPropsIter;*/
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BDebugger.cpp b/engines/wintermute/BDebugger.cpp
index 13eae9fd18..5c26b6ae23 100644
--- a/engines/wintermute/BDebugger.cpp
+++ b/engines/wintermute/BDebugger.cpp
@@ -32,7 +32,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBDebugger::CBDebugger(CBGame *inGame) : CBBase(inGame) {
- m_Enabled = false;
+ _enabled = false;
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/BDebugger.h b/engines/wintermute/BDebugger.h
index 21a7d308a9..c443863af0 100644
--- a/engines/wintermute/BDebugger.h
+++ b/engines/wintermute/BDebugger.h
@@ -42,7 +42,7 @@ public:
virtual ~CBDebugger(void);
// initialization
- bool m_Enabled;
+ bool _enabled;
HRESULT Initialize();
HRESULT Shutdown();
diff --git a/engines/wintermute/BDiskFile.cpp b/engines/wintermute/BDiskFile.cpp
index ed735c846d..24c25f3bed 100644
--- a/engines/wintermute/BDiskFile.cpp
+++ b/engines/wintermute/BDiskFile.cpp
@@ -39,10 +39,10 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBDiskFile::CBDiskFile(CBGame *inGame): CBFile(inGame) {
- m_File = NULL;
- m_Data = NULL;
- m_Compressed = false;
- m_PrefixSize = 0;
+ _file = NULL;
+ _data = NULL;
+ _compressed = false;
+ _prefixSize = 0;
}
@@ -58,53 +58,53 @@ HRESULT CBDiskFile::Open(Common::String Filename) {
char FullPath[MAX_PATH];
- for (int i = 0; i < Game->m_FileManager->m_SinglePaths.GetSize(); i++) {
- sprintf(FullPath, "%s%s", Game->m_FileManager->m_SinglePaths[i], Filename.c_str());
+ for (int i = 0; i < Game->_fileManager->_singlePaths.GetSize(); i++) {
+ sprintf(FullPath, "%s%s", Game->_fileManager->_singlePaths[i], Filename.c_str());
CorrectSlashes(FullPath);
- //m_File = Common::createFileStream(FullPath);
+ //_file = Common::createFileStream(FullPath);
Common::File *tempFile = new Common::File();
if(tempFile->open(FullPath)) {
- m_File = tempFile;
+ _file = tempFile;
} else {
delete tempFile;
}
-/* if (m_File != NULL) {
+/* if (_file != NULL) {
error("Tried to open %s, but failed", Filename.c_str());
break;
}*/
}
// if we didn't find it in search paths, try to open directly
- if (!m_File) {
+ if (!_file) {
strcpy(FullPath, Filename.c_str());
CorrectSlashes(FullPath);
//error("Tried to open %s, TODO: add SearchMan-support", Filename.c_str());
- //m_File = Common::createFileStream(FullPath);
+ //_file = Common::createFileStream(FullPath);
Common::File *tempFile = new Common::File();
if (tempFile->open(FullPath)) {
- m_File = tempFile;
+ _file = tempFile;
} else {
delete tempFile;
}
}
- if (!m_File) {
+ if (!_file) {
warning("Couldn't load %s", Filename.c_str());
}
- if (m_File) {
+ if (_file) {
uint32 magic1, magic2;
- magic1 = m_File->readUint32LE();
- magic2 = m_File->readUint32LE();
+ magic1 = _file->readUint32LE();
+ magic2 = _file->readUint32LE();
- if (magic1 == DCGF_MAGIC && magic2 == COMPRESSED_FILE_MAGIC) m_Compressed = true;
+ if (magic1 == DCGF_MAGIC && magic2 == COMPRESSED_FILE_MAGIC) _compressed = true;
- if (m_Compressed) {
+ if (_compressed) {
uint32 DataOffset, CompSize, UncompSize;
- DataOffset = m_File->readUint32LE();
- CompSize = m_File->readUint32LE();
- UncompSize = m_File->readUint32LE();
+ DataOffset = _file->readUint32LE();
+ CompSize = _file->readUint32LE();
+ UncompSize = _file->readUint32LE();
byte *CompBuffer = new byte[CompSize];
if (!CompBuffer) {
@@ -113,17 +113,17 @@ HRESULT CBDiskFile::Open(Common::String Filename) {
return E_FAIL;
}
- m_Data = new byte[UncompSize];
- if (!m_Data) {
+ _data = new byte[UncompSize];
+ if (!_data) {
Game->LOG(0, "Error allocating buffer for file '%s'", Filename.c_str());
delete [] CompBuffer;
Close();
return E_FAIL;
}
- m_File->seek(DataOffset + m_PrefixSize, SEEK_SET);
- m_File->read(CompBuffer, CompSize);
+ _file->seek(DataOffset + _prefixSize, SEEK_SET);
+ _file->read(CompBuffer, CompSize);
- if (uncompress(m_Data, (uLongf *)&UncompSize, CompBuffer, CompSize) != Z_OK) {
+ if (uncompress(_data, (uLongf *)&UncompSize, CompBuffer, CompSize) != Z_OK) {
Game->LOG(0, "Error uncompressing file '%s'", Filename.c_str());
delete [] CompBuffer;
Close();
@@ -131,15 +131,15 @@ HRESULT CBDiskFile::Open(Common::String Filename) {
}
delete [] CompBuffer;
- m_Size = UncompSize;
- m_Pos = 0;
- delete m_File;
- m_File = NULL;
+ _size = UncompSize;
+ _pos = 0;
+ delete _file;
+ _file = NULL;
} else {
- m_Pos = 0;
- m_File->seek(0, SEEK_END);
- m_Size = m_File->pos() - m_PrefixSize;
- m_File->seek(m_PrefixSize,SEEK_SET);
+ _pos = 0;
+ _file->seek(0, SEEK_END);
+ _size = _file->pos() - _prefixSize;
+ _file->seek(_prefixSize,SEEK_SET);
}
return S_OK;
@@ -149,17 +149,17 @@ HRESULT CBDiskFile::Open(Common::String Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBDiskFile::Close() {
- if (m_File) {
- delete m_File;
+ if (_file) {
+ delete _file;
}
- m_File = NULL;
- m_Pos = 0;
- m_Size = 0;
+ _file = NULL;
+ _pos = 0;
+ _size = 0;
- delete[] m_Data;
- m_Data = NULL;
+ delete[] _data;
+ _data = NULL;
- m_Compressed = false;
+ _compressed = false;
return S_OK;
}
@@ -167,15 +167,15 @@ HRESULT CBDiskFile::Close() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBDiskFile::Read(void *Buffer, uint32 Size) {
- if (m_Compressed) {
- memcpy(Buffer, m_Data + m_Pos, Size);
- m_Pos += Size;
+ if (_compressed) {
+ memcpy(Buffer, _data + _pos, Size);
+ _pos += Size;
return S_OK;
} else {
- if (m_File) {
- size_t count = m_File->read(Buffer, Size);
- m_Pos += count;
+ if (_file) {
+ size_t count = _file->read(Buffer, Size);
+ _pos += count;
return S_OK;
} else return E_FAIL;
}
@@ -184,7 +184,7 @@ HRESULT CBDiskFile::Read(void *Buffer, uint32 Size) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBDiskFile::Seek(uint32 Pos, TSeek Origin) {
- if (m_Compressed) {
+ if (_compressed) {
uint32 NewPos = 0;
switch (Origin) {
@@ -192,33 +192,33 @@ HRESULT CBDiskFile::Seek(uint32 Pos, TSeek Origin) {
NewPos = Pos;
break;
case SEEK_TO_END:
- NewPos = m_Size + Pos;
+ NewPos = _size + Pos;
break;
case SEEK_TO_CURRENT:
- NewPos = m_Pos + Pos;
+ NewPos = _pos + Pos;
break;
}
- if (NewPos < 0 || NewPos > m_Size) return E_FAIL;
- else m_Pos = NewPos;
+ if (NewPos < 0 || NewPos > _size) return E_FAIL;
+ else _pos = NewPos;
return S_OK;
} else {
- if (!m_File) return E_FAIL;
+ if (!_file) return E_FAIL;
int ret = 1;
switch (Origin) {
case SEEK_TO_BEGIN:
- ret = m_File->seek(m_PrefixSize + Pos, SEEK_SET);
+ ret = _file->seek(_prefixSize + Pos, SEEK_SET);
break;
case SEEK_TO_END:
- ret = m_File->seek(Pos, SEEK_END);
+ ret = _file->seek(Pos, SEEK_END);
break;
case SEEK_TO_CURRENT:
- ret = m_File->seek(Pos, SEEK_CUR);
+ ret = _file->seek(Pos, SEEK_CUR);
break;
}
if (ret == 0) {
- m_Pos = m_File->pos() - m_PrefixSize;
+ _pos = _file->pos() - _prefixSize;
return S_OK;
} else return E_FAIL;
}
diff --git a/engines/wintermute/BDiskFile.h b/engines/wintermute/BDiskFile.h
index 7cb4a889aa..6991283437 100644
--- a/engines/wintermute/BDiskFile.h
+++ b/engines/wintermute/BDiskFile.h
@@ -48,10 +48,10 @@ public:
virtual HRESULT Open(Common::String Filename);
private:
void CorrectSlashes(char *fileName);
- Common::SeekableReadStream *m_File;
- byte *m_Data;
- bool m_Compressed;
- uint32 m_PrefixSize;
+ Common::SeekableReadStream *_file;
+ byte *_data;
+ bool _compressed;
+ uint32 _prefixSize;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BDynBuffer.cpp b/engines/wintermute/BDynBuffer.cpp
index 3fe99faeb1..68012f29f8 100644
--- a/engines/wintermute/BDynBuffer.cpp
+++ b/engines/wintermute/BDynBuffer.cpp
@@ -33,15 +33,15 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBDynBuffer::CBDynBuffer(CBGame *inGame, uint32 InitSize, uint32 GrowBy): CBBase(inGame) {
- m_Buffer = NULL;
- m_Size = 0;
- m_RealSize = 0;
+ _buffer = NULL;
+ _size = 0;
+ _realSize = 0;
- m_Offset = 0;
- m_InitSize = InitSize;
- m_GrowBy = GrowBy;
+ _offset = 0;
+ _initSize = InitSize;
+ _growBy = GrowBy;
- m_Initialized = false;
+ _initialized = false;
}
@@ -53,18 +53,18 @@ CBDynBuffer::~CBDynBuffer() {
//////////////////////////////////////////////////////////////////////////
void CBDynBuffer::Cleanup() {
- if (m_Buffer) free(m_Buffer);
- m_Buffer = NULL;
- m_Size = 0;
- m_RealSize = 0;
- m_Offset = 0;
- m_Initialized = false;
+ if (_buffer) free(_buffer);
+ _buffer = NULL;
+ _size = 0;
+ _realSize = 0;
+ _offset = 0;
+ _initialized = false;
}
//////////////////////////////////////////////////////////////////////////
uint32 CBDynBuffer::GetSize() {
- return m_Size;
+ return _size;
}
@@ -72,16 +72,16 @@ uint32 CBDynBuffer::GetSize() {
HRESULT CBDynBuffer::Init(uint32 InitSize) {
Cleanup();
- if (InitSize == 0) InitSize = m_InitSize;
+ if (InitSize == 0) InitSize = _initSize;
- m_Buffer = (byte *)malloc(InitSize);
- if (!m_Buffer) {
+ _buffer = (byte *)malloc(InitSize);
+ if (!_buffer) {
Game->LOG(0, "CBDynBuffer::Init - Error allocating %d bytes", InitSize);
return E_FAIL;
}
- m_RealSize = InitSize;
- m_Initialized = true;
+ _realSize = InitSize;
+ _initialized = true;
return S_OK;
}
@@ -89,20 +89,20 @@ HRESULT CBDynBuffer::Init(uint32 InitSize) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBDynBuffer::PutBytes(byte *Buffer, uint32 Size) {
- if (!m_Initialized) Init();
+ if (!_initialized) Init();
- while (m_Offset + Size > m_RealSize) {
- m_RealSize += m_GrowBy;
- m_Buffer = (byte *)realloc(m_Buffer, m_RealSize);
- if (!m_Buffer) {
- Game->LOG(0, "CBDynBuffer::PutBytes - Error reallocating buffer to %d bytes", m_RealSize);
+ while (_offset + Size > _realSize) {
+ _realSize += _growBy;
+ _buffer = (byte *)realloc(_buffer, _realSize);
+ if (!_buffer) {
+ Game->LOG(0, "CBDynBuffer::PutBytes - Error reallocating buffer to %d bytes", _realSize);
return E_FAIL;
}
}
- memcpy(m_Buffer + m_Offset, Buffer, Size);
- m_Offset += Size;
- m_Size += Size;
+ memcpy(_buffer + _offset, Buffer, Size);
+ _offset += Size;
+ _size += Size;
return S_OK;
}
@@ -110,15 +110,15 @@ HRESULT CBDynBuffer::PutBytes(byte *Buffer, uint32 Size) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBDynBuffer::GetBytes(byte *Buffer, uint32 Size) {
- if (!m_Initialized) Init();
+ if (!_initialized) Init();
- if (m_Offset + Size > m_Size) {
+ if (_offset + Size > _size) {
Game->LOG(0, "CBDynBuffer::GetBytes - Buffer underflow");
return E_FAIL;
}
- memcpy(Buffer, m_Buffer + m_Offset, Size);
- m_Offset += Size;
+ memcpy(Buffer, _buffer + _offset, Size);
+ _offset += Size;
return S_OK;
}
@@ -151,8 +151,8 @@ void CBDynBuffer::PutString(const char *Val) {
//////////////////////////////////////////////////////////////////////////
char *CBDynBuffer::GetString() {
uint32 len = GetDWORD();
- char *ret = (char *)(m_Buffer + m_Offset);
- m_Offset += len;
+ char *ret = (char *)(_buffer + _offset);
+ _offset += len;
if (!strcmp(ret, "(null)")) return NULL;
else return ret;
diff --git a/engines/wintermute/BDynBuffer.h b/engines/wintermute/BDynBuffer.h
index 7ef970fcd3..4b05ee88ff 100644
--- a/engines/wintermute/BDynBuffer.h
+++ b/engines/wintermute/BDynBuffer.h
@@ -36,7 +36,7 @@ namespace WinterMute {
class CBDynBuffer : public CBBase {
public:
- bool m_Initialized;
+ bool _initialized;
void PutText(LPCSTR fmt, ...);
void PutTextIndent(int Indent, LPCSTR fmt, ...);
uint32 GetDWORD();
@@ -48,16 +48,16 @@ public:
uint32 GetSize();
HRESULT Init(uint32 InitSize = 0);
void Cleanup();
- uint32 m_Size;
- byte *m_Buffer;
+ uint32 _size;
+ byte *_buffer;
CBDynBuffer(CBGame *inGame, uint32 InitSize = 1000, uint32 GrowBy = 1000);
virtual ~CBDynBuffer();
private:
- uint32 m_RealSize;
- uint32 m_GrowBy;
- uint32 m_InitSize;
- uint32 m_Offset;
+ uint32 _realSize;
+ uint32 _growBy;
+ uint32 _initSize;
+ uint32 _offset;
void PutTextForm(const char *format, va_list argptr);
};
diff --git a/engines/wintermute/BEvent.cpp b/engines/wintermute/BEvent.cpp
index fbeddacb39..977b965561 100644
--- a/engines/wintermute/BEvent.cpp
+++ b/engines/wintermute/BEvent.cpp
@@ -41,27 +41,27 @@ IMPLEMENT_PERSISTENT(CBEvent, false)
//////////////////////////////////////////////////////////////////////////
CBEvent::CBEvent(CBGame *inGame): CBBase(inGame) {
- m_Type = EVENT_NONE;
- m_Script = NULL;
- m_Name = NULL;
+ _type = EVENT_NONE;
+ _script = NULL;
+ _name = NULL;
}
//////////////////////////////////////////////////////////////////////////
CBEvent::CBEvent(CBGame *inGame, TEventType Type, char *Script): CBBase(inGame) {
- m_Type = Type;
- m_Script = new char [strlen(Script) + 1];
- if (m_Script) strcpy(m_Script, Script);
- m_Name = NULL;
+ _type = Type;
+ _script = new char [strlen(Script) + 1];
+ if (_script) strcpy(_script, Script);
+ _name = NULL;
}
//////////////////////////////////////////////////////////////////////////
CBEvent::~CBEvent() {
- delete[] m_Script;
- m_Script = NULL;
- delete[] m_Name;
- m_Name = NULL;
+ delete[] _script;
+ _script = NULL;
+ delete[] _name;
+ _name = NULL;
}
@@ -101,26 +101,26 @@ const char *CBEvent::GetEventName(TEventType Type) {
//////////////////////////////////////////////////////////////////////////
void CBEvent::SetScript(char *Script) {
- if (m_Script) delete [] m_Script;
+ if (_script) delete [] _script;
- m_Script = new char [strlen(Script) + 1];
- if (m_Script) strcpy(m_Script, Script);
+ _script = new char [strlen(Script) + 1];
+ if (_script) strcpy(_script, Script);
}
//////////////////////////////////////////////////////////////////////////
void CBEvent::SetName(char *Name) {
- if (m_Name) delete [] m_Name;
+ if (_name) delete [] _name;
- m_Name = new char [strlen(Name) + 1];
- if (m_Name) strcpy(m_Name, Name);
+ _name = new char [strlen(Name) + 1];
+ if (_name) strcpy(_name, Name);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBEvent::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CBEvent::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -187,9 +187,9 @@ HRESULT CBEvent::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_Script));
- PersistMgr->Transfer(TMEMBER(m_Name));
- PersistMgr->Transfer(TMEMBER_INT(m_Type));
+ PersistMgr->Transfer(TMEMBER(_script));
+ PersistMgr->Transfer(TMEMBER(_name));
+ PersistMgr->Transfer(TMEMBER_INT(_type));
return S_OK;
}
diff --git a/engines/wintermute/BEvent.h b/engines/wintermute/BEvent.h
index 006e10706e..87d3de0e96 100644
--- a/engines/wintermute/BEvent.h
+++ b/engines/wintermute/BEvent.h
@@ -41,9 +41,9 @@ public:
void SetScript(char *Script);
void SetName(char *Name);
static const char *GetEventName(TEventType Type);
- char *m_Script;
- char *m_Name;
- TEventType m_Type;
+ char *_script;
+ char *_name;
+ TEventType _type;
CBEvent(CBGame *inGame);
CBEvent(CBGame *inGame, TEventType Type, char *Script);
virtual ~CBEvent();
diff --git a/engines/wintermute/BFader.cpp b/engines/wintermute/BFader.cpp
index 955f0252f5..b40582318a 100644
--- a/engines/wintermute/BFader.cpp
+++ b/engines/wintermute/BFader.cpp
@@ -42,14 +42,14 @@ IMPLEMENT_PERSISTENT(CBFader, false)
//////////////////////////////////////////////////////////////////////////
CBFader::CBFader(CBGame *inGame): CBObject(inGame) {
- m_Active = false;
- m_Red = m_Green = m_Blue = 0;
- m_CurrentAlpha = 0x00;
- m_SourceAlpha = 0;
- m_TargetAlpha = 0;
- m_Duration = 1000;
- m_StartTime = 0;
- m_System = false;
+ _active = false;
+ _red = _green = _blue = 0;
+ _currentAlpha = 0x00;
+ _sourceAlpha = 0;
+ _targetAlpha = 0;
+ _duration = 1000;
+ _startTime = 0;
+ _system = false;
}
@@ -61,23 +61,23 @@ CBFader::~CBFader() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFader::Update() {
- if (!m_Active) return S_OK;
+ if (!_active) return S_OK;
- int AlphaDelta = m_TargetAlpha - m_SourceAlpha;
+ int AlphaDelta = _targetAlpha - _sourceAlpha;
uint32 time;
- if (m_System) time = CBPlatform::GetTime() - m_StartTime;
- else time = Game->m_Timer - m_StartTime;
+ if (_system) time = CBPlatform::GetTime() - _startTime;
+ else time = Game->_timer - _startTime;
- if (time >= m_Duration) m_CurrentAlpha = m_TargetAlpha;
+ if (time >= _duration) _currentAlpha = _targetAlpha;
else {
- m_CurrentAlpha = m_SourceAlpha + (float)time / (float)m_Duration * AlphaDelta;
+ _currentAlpha = _sourceAlpha + (float)time / (float)_duration * AlphaDelta;
}
- m_CurrentAlpha = MIN((unsigned char)255, MAX(m_CurrentAlpha, (byte )0)); // TODO: clean
+ _currentAlpha = MIN((unsigned char)255, MAX(_currentAlpha, (byte )0)); // TODO: clean
- m_Ready = time >= m_Duration;
- if (m_Ready && m_CurrentAlpha == 0x00) m_Active = false;
+ _ready = time >= _duration;
+ if (_ready && _currentAlpha == 0x00) _active = false;
return S_OK;
}
@@ -85,38 +85,38 @@ HRESULT CBFader::Update() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFader::Display() {
- if (!m_Active) return S_OK;
+ if (!_active) return S_OK;
- if (m_CurrentAlpha > 0x00) return Game->m_Renderer->FadeToColor(DRGBA(m_Red, m_Green, m_Blue, m_CurrentAlpha));
+ if (_currentAlpha > 0x00) return Game->_renderer->FadeToColor(DRGBA(_red, _green, _blue, _currentAlpha));
else return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBFader::Deactivate() {
- m_Active = false;
- m_Ready = true;
+ _active = false;
+ _ready = true;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBFader::FadeIn(uint32 SourceColor, uint32 Duration, bool System) {
- m_Ready = false;
- m_Active = true;
+ _ready = false;
+ _active = true;
- m_Red = D3DCOLGetR(SourceColor);
- m_Green = D3DCOLGetG(SourceColor);
- m_Blue = D3DCOLGetB(SourceColor);
+ _red = D3DCOLGetR(SourceColor);
+ _green = D3DCOLGetG(SourceColor);
+ _blue = D3DCOLGetB(SourceColor);
- m_SourceAlpha = D3DCOLGetA(SourceColor);
- m_TargetAlpha = 0;
+ _sourceAlpha = D3DCOLGetA(SourceColor);
+ _targetAlpha = 0;
- m_Duration = Duration;
- m_System = System;
+ _duration = Duration;
+ _system = System;
- if (m_System) m_StartTime = CBPlatform::GetTime();
- else m_StartTime = Game->m_Timer;
+ if (_system) _startTime = CBPlatform::GetTime();
+ else _startTime = Game->_timer;
return S_OK;
}
@@ -124,22 +124,22 @@ HRESULT CBFader::FadeIn(uint32 SourceColor, uint32 Duration, bool System) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFader::FadeOut(uint32 TargetColor, uint32 Duration, bool System) {
- m_Ready = false;
- m_Active = true;
+ _ready = false;
+ _active = true;
- m_Red = D3DCOLGetR(TargetColor);
- m_Green = D3DCOLGetG(TargetColor);
- m_Blue = D3DCOLGetB(TargetColor);
+ _red = D3DCOLGetR(TargetColor);
+ _green = D3DCOLGetG(TargetColor);
+ _blue = D3DCOLGetB(TargetColor);
- //m_SourceAlpha = 0;
- m_SourceAlpha = m_CurrentAlpha;
- m_TargetAlpha = D3DCOLGetA(TargetColor);
+ //_sourceAlpha = 0;
+ _sourceAlpha = _currentAlpha;
+ _targetAlpha = D3DCOLGetA(TargetColor);
- m_Duration = Duration;
- m_System = System;
+ _duration = Duration;
+ _system = System;
- if (m_System) m_StartTime = CBPlatform::GetTime();
- else m_StartTime = Game->m_Timer;
+ if (_system) _startTime = CBPlatform::GetTime();
+ else _startTime = Game->_timer;
return S_OK;
@@ -148,7 +148,7 @@ HRESULT CBFader::FadeOut(uint32 TargetColor, uint32 Duration, bool System) {
//////////////////////////////////////////////////////////////////////////
uint32 CBFader::GetCurrentColor() {
- return DRGBA(m_Red, m_Green, m_Blue, m_CurrentAlpha);
+ return DRGBA(_red, _green, _blue, _currentAlpha);
}
@@ -157,18 +157,18 @@ uint32 CBFader::GetCurrentColor() {
HRESULT CBFader::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Active));
- PersistMgr->Transfer(TMEMBER(m_Blue));
- PersistMgr->Transfer(TMEMBER(m_CurrentAlpha));
- PersistMgr->Transfer(TMEMBER(m_Duration));
- PersistMgr->Transfer(TMEMBER(m_Green));
- PersistMgr->Transfer(TMEMBER(m_Red));
- PersistMgr->Transfer(TMEMBER(m_SourceAlpha));
- PersistMgr->Transfer(TMEMBER(m_StartTime));
- PersistMgr->Transfer(TMEMBER(m_TargetAlpha));
- PersistMgr->Transfer(TMEMBER(m_System));
-
- if (m_System && !PersistMgr->m_Saving) m_StartTime = 0;
+ PersistMgr->Transfer(TMEMBER(_active));
+ PersistMgr->Transfer(TMEMBER(_blue));
+ PersistMgr->Transfer(TMEMBER(_currentAlpha));
+ PersistMgr->Transfer(TMEMBER(_duration));
+ PersistMgr->Transfer(TMEMBER(_green));
+ PersistMgr->Transfer(TMEMBER(_red));
+ PersistMgr->Transfer(TMEMBER(_sourceAlpha));
+ PersistMgr->Transfer(TMEMBER(_startTime));
+ PersistMgr->Transfer(TMEMBER(_targetAlpha));
+ PersistMgr->Transfer(TMEMBER(_system));
+
+ if (_system && !PersistMgr->_saving) _startTime = 0;
return S_OK;
}
diff --git a/engines/wintermute/BFader.h b/engines/wintermute/BFader.h
index 44ce256826..38ef8451ab 100644
--- a/engines/wintermute/BFader.h
+++ b/engines/wintermute/BFader.h
@@ -36,7 +36,7 @@ namespace WinterMute {
class CBFader : public CBObject {
public:
- bool m_System;
+ bool _system;
uint32 GetCurrentColor();
HRESULT FadeOut(uint32 TargetColor, uint32 Duration, bool System = false);
HRESULT FadeIn(uint32 SourceColor, uint32 Duration, bool System = false);
@@ -46,15 +46,15 @@ public:
DECLARE_PERSISTENT(CBFader, CBObject)
CBFader(CBGame *inGame);
virtual ~CBFader();
- bool m_Active;
- byte m_Red;
- byte m_Green;
- byte m_Blue;
- byte m_CurrentAlpha;
- byte m_TargetAlpha;
- byte m_SourceAlpha;
- uint32 m_Duration;
- uint32 m_StartTime;
+ bool _active;
+ byte _red;
+ byte _green;
+ byte _blue;
+ byte _currentAlpha;
+ byte _targetAlpha;
+ byte _sourceAlpha;
+ uint32 _duration;
+ uint32 _startTime;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BFile.cpp b/engines/wintermute/BFile.cpp
index f4d7da2c70..e66990f571 100644
--- a/engines/wintermute/BFile.cpp
+++ b/engines/wintermute/BFile.cpp
@@ -39,8 +39,8 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBFile::CBFile(CBGame *inGame): CBBase(inGame) {
- m_Pos = 0;
- m_Size = 0;
+ _pos = 0;
+ _size = 0;
}
@@ -52,7 +52,7 @@ CBFile::~CBFile() {
//////////////////////////////////////////////////////////////////////////
bool CBFile::IsEOF() {
- return m_Pos == m_Size;
+ return _pos == _size;
}
Common::SeekableReadStream *CBFile::getMemStream() {
diff --git a/engines/wintermute/BFile.h b/engines/wintermute/BFile.h
index db6a29d903..7b077b34b9 100644
--- a/engines/wintermute/BFile.h
+++ b/engines/wintermute/BFile.h
@@ -41,13 +41,13 @@ namespace WinterMute {
class CBFile : public CBBase {
public:
- uint32 m_Pos;
- uint32 m_Size;
+ uint32 _pos;
+ uint32 _size;
virtual uint32 GetSize() {
- return m_Size;
+ return _size;
};
virtual uint32 GetPos() {
- return m_Pos;
+ return _pos;
};
virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN) = 0;
virtual HRESULT Read(void *Buffer, uint32 Size) = 0;
diff --git a/engines/wintermute/BFileEntry.cpp b/engines/wintermute/BFileEntry.cpp
index 18a15e37f9..3b9a9fafa9 100644
--- a/engines/wintermute/BFileEntry.cpp
+++ b/engines/wintermute/BFileEntry.cpp
@@ -32,19 +32,19 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBFileEntry::CBFileEntry(CBGame *inGame): CBBase(inGame) {
- m_Package = NULL;
- m_Length = m_CompressedLength = m_Offset = m_Flags = 0;
- m_Filename = "";
+ _package = NULL;
+ _length = _compressedLength = _offset = _flags = 0;
+ _filename = "";
- m_TimeDate1 = m_TimeDate2 = 0;
+ _timeDate1 = _timeDate2 = 0;
- m_JournalTime = 0;
+ _journalTime = 0;
}
//////////////////////////////////////////////////////////////////////////
CBFileEntry::~CBFileEntry() {
- m_Package = NULL; // ref only
+ _package = NULL; // ref only
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/BFileEntry.h b/engines/wintermute/BFileEntry.h
index 2c555c8bfe..00e82f8640 100644
--- a/engines/wintermute/BFileEntry.h
+++ b/engines/wintermute/BFileEntry.h
@@ -38,15 +38,15 @@ class CBPackage;
class CBFileEntry : public CBBase {
public:
- uint32 m_TimeDate2;
- uint32 m_TimeDate1;
- uint32 m_Flags;
- uint32 m_JournalTime;
- Common::String m_Filename;
- uint32 m_CompressedLength;
- uint32 m_Length;
- uint32 m_Offset;
- CBPackage *m_Package;
+ uint32 _timeDate2;
+ uint32 _timeDate1;
+ uint32 _flags;
+ uint32 _journalTime;
+ Common::String _filename;
+ uint32 _compressedLength;
+ uint32 _length;
+ uint32 _offset;
+ CBPackage *_package;
CBFileEntry(CBGame *inGame);
virtual ~CBFileEntry();
diff --git a/engines/wintermute/BFileManager.cpp b/engines/wintermute/BFileManager.cpp
index 2e0e296eb0..fa491b62df 100644
--- a/engines/wintermute/BFileManager.cpp
+++ b/engines/wintermute/BFileManager.cpp
@@ -83,7 +83,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBFileManager::CBFileManager(CBGame *inGame): CBBase(inGame) {
- m_BasePath = NULL;
+ _basePath = NULL;
InitPaths();
RegisterPackages();
@@ -101,38 +101,38 @@ HRESULT CBFileManager::Cleanup() {
int i;
// delete registered paths
- for (i = 0; i < m_SinglePaths.GetSize(); i++)
- delete [] m_SinglePaths[i];
- m_SinglePaths.RemoveAll();
+ for (i = 0; i < _singlePaths.GetSize(); i++)
+ delete [] _singlePaths[i];
+ _singlePaths.RemoveAll();
- for (i = 0; i < m_PackagePaths.GetSize(); i++)
- delete [] m_PackagePaths[i];
- m_PackagePaths.RemoveAll();
+ for (i = 0; i < _packagePaths.GetSize(); i++)
+ delete [] _packagePaths[i];
+ _packagePaths.RemoveAll();
// delete file entries
- m_FilesIter = m_Files.begin();
- while (m_FilesIter != m_Files.end()) {
- delete m_FilesIter->_value;
- m_FilesIter++;
+ _filesIter = _files.begin();
+ while (_filesIter != _files.end()) {
+ delete _filesIter->_value;
+ _filesIter++;
}
- m_Files.clear();
+ _files.clear();
// close open files
- for (i = 0; i < m_OpenFiles.GetSize(); i++) {
- m_OpenFiles[i]->Close();
- delete m_OpenFiles[i];
+ for (i = 0; i < _openFiles.GetSize(); i++) {
+ _openFiles[i]->Close();
+ delete _openFiles[i];
}
- m_OpenFiles.RemoveAll();
+ _openFiles.RemoveAll();
// delete packages
- for (i = 0; i < m_Packages.GetSize(); i++)
- delete m_Packages[i];
- m_Packages.RemoveAll();
+ for (i = 0; i < _packages.GetSize(); i++)
+ delete _packages[i];
+ _packages.RemoveAll();
- delete[] m_BasePath;
- m_BasePath = NULL;
+ delete[] _basePath;
+ _basePath = NULL;
return S_OK;
}
@@ -241,8 +241,8 @@ HRESULT CBFileManager::SaveFile(char *Filename, byte *Buffer, uint32 BufferSize,
//////////////////////////////////////////////////////////////////////////
HRESULT CBFileManager::RequestCD(int CD, char *PackageFile, char *Filename) {
// unmount all non-local packages
- for (int i = 0; i < m_Packages.GetSize(); i++) {
- if (m_Packages[i]->m_CD > 0) m_Packages[i]->Close();
+ for (int i = 0; i < _packages.GetSize(); i++) {
+ if (_packages[i]->_cD > 0) _packages[i]->Close();
}
@@ -265,10 +265,10 @@ HRESULT CBFileManager::AddPath(TPathType Type, const char *Path) {
switch (Type) {
case PATH_SINGLE:
- m_SinglePaths.Add(buffer);
+ _singlePaths.Add(buffer);
break;
case PATH_PACKAGE:
- m_PackagePaths.Add(buffer);
+ _packagePaths.Add(buffer);
break;
}
@@ -278,13 +278,13 @@ HRESULT CBFileManager::AddPath(TPathType Type, const char *Path) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFileManager::ReloadPaths() {
// delete registered paths
- for (int i = 0; i < m_SinglePaths.GetSize(); i++)
- delete [] m_SinglePaths[i];
- m_SinglePaths.RemoveAll();
+ for (int i = 0; i < _singlePaths.GetSize(); i++)
+ delete [] _singlePaths[i];
+ _singlePaths.RemoveAll();
- for (int i = 0; i < m_PackagePaths.GetSize(); i++)
- delete [] m_PackagePaths[i];
- m_PackagePaths.RemoveAll();
+ for (int i = 0; i < _packagePaths.GetSize(); i++)
+ delete [] _packagePaths[i];
+ _packagePaths.RemoveAll();
return InitPaths();
}
@@ -299,7 +299,7 @@ HRESULT CBFileManager::InitPaths() {
int numPaths;
// single files paths
- pathList = Game->m_Registry->ReadString("Resource", "CustomPaths", "");
+ pathList = Game->_registry->ReadString("Resource", "CustomPaths", "");
numPaths = CBUtils::StrNumEntries(pathList.c_str(), ';');
for (int i = 0; i < numPaths; i++) {
@@ -343,7 +343,7 @@ HRESULT CBFileManager::InitPaths() {
#endif
- pathList = Game->m_Registry->ReadString("Resource", "PackagePaths", "");
+ pathList = Game->_registry->ReadString("Resource", "PackagePaths", "");
numPaths = CBUtils::StrNumEntries(pathList.c_str(), ';');
for (int i = 0; i < numPaths; i++) {
@@ -373,8 +373,8 @@ HRESULT CBFileManager::RegisterPackages() {
#if 0
AnsiString extension = AnsiString(".") + AnsiString(PACKAGE_EXTENSION);
- for (int i = 0; i < m_PackagePaths.GetSize(); i++) {
- boost::filesystem::path absPath = boost::filesystem::system_complete(m_PackagePaths[i]);
+ for (int i = 0; i < _packagePaths.GetSize(); i++) {
+ boost::filesystem::path absPath = boost::filesystem::syste_complete(_packagePaths[i]);
//Game->LOG(0, "Scanning: %s", absPath.string().c_str());
//printf("Scanning: %s\n", absPath.string().c_str());
@@ -398,10 +398,10 @@ HRESULT CBFileManager::RegisterPackages() {
}
}
- warning(" Registered %d files in %d package(s)", m_Files.size(), m_Packages.GetSize());
- Game->LOG(0, " Registered %d files in %d package(s)", m_Files.size(), m_Packages.GetSize());
+ warning(" Registered %d files in %d package(s)", _files.size(), _packages.GetSize());
+ Game->LOG(0, " Registered %d files in %d package(s)", _files.size(), _packages.GetSize());
#endif
- warning(" Registered %d files in %d package(s)", m_Files.size(), m_Packages.GetSize());
+ warning(" Registered %d files in %d package(s)", _files.size(), _packages.GetSize());
return S_OK;
}
@@ -455,17 +455,17 @@ HRESULT CBFileManager::RegisterPackage(Common::String Filename , bool SearchSign
CBPackage *pkg = new CBPackage(Game);
if (!pkg) return E_FAIL;
- pkg->m_BoundToExe = BoundToExe;
+ pkg->_boundToExe = BoundToExe;
// read package info
byte NameLength = package->readByte();
- pkg->m_Name = new char[NameLength];
- package->read(pkg->m_Name, NameLength);
- pkg->m_CD = package->readByte();
- pkg->m_Priority = hdr.Priority;
+ pkg->_name = new char[NameLength];
+ package->read(pkg->_name, NameLength);
+ pkg->_cD = package->readByte();
+ pkg->_priority = hdr.Priority;
- if (!hdr.MasterIndex) pkg->m_CD = 0; // override CD to fixed disk
- m_Packages.Add(pkg);
+ if (!hdr.MasterIndex) pkg->_cD = 0; // override CD to fixed disk
+ _packages.Add(pkg);
// read file entries
@@ -503,24 +503,24 @@ HRESULT CBFileManager::RegisterPackage(Common::String Filename , bool SearchSign
TimeDate1 = package->readUint32LE();
TimeDate2 = package->readUint32LE();
}
- m_FilesIter = m_Files.find(Name);
- if (m_FilesIter == m_Files.end()) {
+ _filesIter = _files.find(Name);
+ if (_filesIter == _files.end()) {
CBFileEntry *file = new CBFileEntry(Game);
- file->m_Package = pkg;
- file->m_Offset = Offset;
- file->m_Length = Length;
- file->m_CompressedLength = CompLength;
- file->m_Flags = Flags;
+ file->_package = pkg;
+ file->_offset = Offset;
+ file->_length = Length;
+ file->_compressedLength = CompLength;
+ file->_flags = Flags;
- m_Files[Name] = file;
+ _files[Name] = file;
} else {
// current package has lower CD number or higher priority, than the registered
- if (pkg->m_CD < m_FilesIter->_value->m_Package->m_CD || pkg->m_Priority > m_FilesIter->_value->m_Package->m_Priority) {
- m_FilesIter->_value->m_Package = pkg;
- m_FilesIter->_value->m_Offset = Offset;
- m_FilesIter->_value->m_Length = Length;
- m_FilesIter->_value->m_CompressedLength = CompLength;
- m_FilesIter->_value->m_Flags = Flags;
+ if (pkg->_cD < _filesIter->_value->_package->_cD || pkg->_priority > _filesIter->_value->_package->_priority) {
+ _filesIter->_value->_package = pkg;
+ _filesIter->_value->_offset = Offset;
+ _filesIter->_value->_length = Length;
+ _filesIter->_value->_compressedLength = CompLength;
+ _filesIter->_value->_flags = Flags;
}
}
delete [] Name;
@@ -584,18 +584,18 @@ HRESULT CBFileManager::RegisterPackage(const char *Path, const char *Name, bool
CBPackage *pkg = new CBPackage(Game);
if (!pkg) return E_FAIL;
- pkg->m_BoundToExe = BoundToExe;
+ pkg->_boundToExe = BoundToExe;
// read package info
byte NameLength;
fread(&NameLength, sizeof(byte ), 1, f);
- pkg->m_Name = new char[NameLength];
- fread(pkg->m_Name, NameLength, 1, f);
- fread(&pkg->m_CD, sizeof(byte ), 1, f);
- pkg->m_Priority = hdr.Priority;
+ pkg->_name = new char[NameLength];
+ fread(pkg->_name, NameLength, 1, f);
+ fread(&pkg->_cD, sizeof(byte ), 1, f);
+ pkg->_priority = hdr.Priority;
- if (!hdr.MasterIndex) pkg->m_CD = 0; // override CD to fixed disk
- m_Packages.Add(pkg);
+ if (!hdr.MasterIndex) pkg->_cD = 0; // override CD to fixed disk
+ _packages.Add(pkg);
// read file entries
@@ -634,24 +634,24 @@ HRESULT CBFileManager::RegisterPackage(const char *Path, const char *Name, bool
fread(&TimeDate1, sizeof(uint32), 1, f);
fread(&TimeDate2, sizeof(uint32), 1, f);
}
- m_FilesIter = m_Files.find(Name);
- if (m_FilesIter == m_Files.end()) {
+ _filesIter = _files.find(Name);
+ if (_filesIter == _files.end()) {
CBFileEntry *file = new CBFileEntry(Game);
- file->m_Package = pkg;
- file->m_Offset = Offset;
- file->m_Length = Length;
- file->m_CompressedLength = CompLength;
- file->m_Flags = Flags;
+ file->_package = pkg;
+ file->_offset = Offset;
+ file->_length = Length;
+ file->_compressedLength = CompLength;
+ file->_flags = Flags;
- m_Files[Name] = file;
+ _files[Name] = file;
} else {
// current package has lower CD number or higher priority, than the registered
- if (pkg->m_CD < m_FilesIter->_value->m_Package->m_CD || pkg->m_Priority > m_FilesIter->_value->m_Package->m_Priority) {
- m_FilesIter->_value->m_Package = pkg;
- m_FilesIter->_value->m_Offset = Offset;
- m_FilesIter->_value->m_Length = Length;
- m_FilesIter->_value->m_CompressedLength = CompLength;
- m_FilesIter->_value->m_Flags = Flags;
+ if (pkg->_cD < _filesIter->_value->_package->_cD || pkg->_priority > _filesIter->_value->_package->_priority) {
+ _filesIter->_value->_package = pkg;
+ _filesIter->_value->_offset = Offset;
+ _filesIter->_value->_length = Length;
+ _filesIter->_value->_compressedLength = CompLength;
+ _filesIter->_value->_flags = Flags;
}
}
delete [] Name;
@@ -685,8 +685,8 @@ Common::File *CBFileManager::OpenPackage(char *Name) {
Common::File *ret = new Common::File();
char Filename[MAX_PATH];
- for (int i = 0; i < m_PackagePaths.GetSize(); i++) {
- sprintf(Filename, "%s%s.%s", m_PackagePaths[i], Name, PACKAGE_EXTENSION);
+ for (int i = 0; i < _packagePaths.GetSize(); i++) {
+ sprintf(Filename, "%s%s.%s", _packagePaths[i], Name, PACKAGE_EXTENSION);
//ret = fopen(Filename, "rb");
ret->open(Filename);
if (ret->isOpen()) {
@@ -705,8 +705,8 @@ Common::File *CBFileManager::OpenSingleFile(char *Name) {
Common::File *ret = NULL;
char Filename[MAX_PATH];
- for (int i = 0; i < m_SinglePaths.GetSize(); i++) {
- sprintf(Filename, "%s%s", m_SinglePaths[i], Name);
+ for (int i = 0; i < _singlePaths.GetSize(); i++) {
+ sprintf(Filename, "%s%s", _singlePaths[i], Name);
ret->open(Filename);
if (ret->isOpen())
return ret;
@@ -730,8 +730,8 @@ bool CBFileManager::GetFullPath(char *Filename, char *Fullname) {
FILE *f = NULL;
bool found = false;
- for (int i = 0; i < m_SinglePaths.GetSize(); i++) {
- sprintf(Fullname, "%s%s", m_SinglePaths[i], Filename);
+ for (int i = 0; i < _singlePaths.GetSize(); i++) {
+ sprintf(Fullname, "%s%s", _singlePaths[i], Filename);
f = fopen(Fullname, "rb");
if (f) {
fclose(f);
@@ -760,8 +760,8 @@ CBFileEntry *CBFileManager::GetPackageEntry(const char *Filename) {
CBPlatform::strupr(upc_name);
CBFileEntry *ret = NULL;
- m_FilesIter = m_Files.find(upc_name);
- if (m_FilesIter != m_Files.end()) ret = m_FilesIter->_value;
+ _filesIter = _files.find(upc_name);
+ if (_filesIter != _files.end()) ret = _filesIter->_value;
delete [] upc_name;
@@ -774,7 +774,7 @@ CBFile *CBFileManager::OpenFile(const char *Filename, bool AbsPathWarning) {
if (strcmp(Filename, "") == 0) return NULL;
//Game->LOG(0, "open file: %s", Filename);
#ifdef __WIN32__
- if (Game->m_DEBUG_DebugMode && Game->m_DEBUG_AbsolutePathWarning && AbsPathWarning) {
+ if (Game->_dEBUG_DebugMode && Game->_dEBUG_AbsolutePathWarning && AbsPathWarning) {
char Drive[_MAX_DRIVE];
_splitpath(Filename, Drive, NULL, NULL, NULL);
if (Drive[0] != '\0') {
@@ -784,18 +784,18 @@ CBFile *CBFileManager::OpenFile(const char *Filename, bool AbsPathWarning) {
#endif
CBFile *File = OpenFileRaw(Filename);
- if (File) m_OpenFiles.Add(File);
+ if (File) _openFiles.Add(File);
return File;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBFileManager::CloseFile(CBFile *File) {
- for (int i = 0; i < m_OpenFiles.GetSize(); i++) {
- if (m_OpenFiles[i] == File) {
- m_OpenFiles[i]->Close();
- delete m_OpenFiles[i];
- m_OpenFiles.RemoveAt(i);
+ for (int i = 0; i < _openFiles.GetSize(); i++) {
+ if (_openFiles[i] == File) {
+ _openFiles[i]->Close();
+ delete _openFiles[i];
+ _openFiles.RemoveAt(i);
return S_OK;
}
}
@@ -837,9 +837,9 @@ CBFile *CBFileManager::OpenFileRaw(const char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFileManager::RestoreCurrentDir() {
- if (!m_BasePath) return S_OK;
+ if (!_basePath) return S_OK;
else {
- if (!chdir(m_BasePath)) return S_OK;
+ if (!chdir(_basePath)) return S_OK;
else return E_FAIL;
}
}
@@ -850,8 +850,8 @@ HRESULT CBFileManager::SetBasePath(char *Path) {
Cleanup();
if (Path) {
- m_BasePath = new char[strlen(Path) + 1];
- strcpy(m_BasePath, Path);
+ _basePath = new char[strlen(Path) + 1];
+ strcpy(_basePath, Path);
}
InitPaths();
diff --git a/engines/wintermute/BFileManager.h b/engines/wintermute/BFileManager.h
index bee43e696d..81b22ffef9 100644
--- a/engines/wintermute/BFileManager.h
+++ b/engines/wintermute/BFileManager.h
@@ -47,7 +47,7 @@ public:
HRESULT Cleanup();
HRESULT SetBasePath(char *Path);
HRESULT RestoreCurrentDir();
- char *m_BasePath;
+ char *_basePath;
bool GetFullPath(char *Filename, char *Fullname);
CBFile *OpenFileRaw(const char *Filename);
HRESULT CloseFile(CBFile *File);
@@ -67,16 +67,16 @@ public:
byte *ReadWholeFile(const char *Filename, uint32 *Size = NULL, bool MustExist = true);
CBFileManager(CBGame *inGame = NULL);
virtual ~CBFileManager();
- CBArray<char *, char *> m_SinglePaths;
- CBArray<char *, char *> m_PackagePaths;
- CBArray<CBPackage *, CBPackage *> m_Packages;
- CBArray<CBFile *, CBFile *> m_OpenFiles;
+ CBArray<char *, char *> _singlePaths;
+ CBArray<char *, char *> _packagePaths;
+ CBArray<CBPackage *, CBPackage *> _packages;
+ CBArray<CBFile *, CBFile *> _openFiles;
- Common::HashMap<Common::String, CBFileEntry *> m_Files;
+ Common::HashMap<Common::String, CBFileEntry *> _files;
private:
HRESULT RegisterPackage(const char *Path, const char *Name, bool SearchSignature = false);
HRESULT RegisterPackage(Common::String Filename, bool SearchSignature = false);
- Common::HashMap<Common::String, CBFileEntry *>::iterator m_FilesIter;
+ Common::HashMap<Common::String, CBFileEntry *>::iterator _filesIter;
bool IsValidPackage(const AnsiString &fileName) const;
};
diff --git a/engines/wintermute/BFont.cpp b/engines/wintermute/BFont.cpp
index 93d870875d..92ce8595ae 100644
--- a/engines/wintermute/BFont.cpp
+++ b/engines/wintermute/BFont.cpp
@@ -73,7 +73,7 @@ int CBFont::GetTextWidth(byte *text, int MaxLenght) {
//////////////////////////////////////////////////////////////////////
HRESULT CBFont::LoadFile(char * Filename)
{
- BYTE* Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ BYTE* Buffer = Game->_fileManager->ReadWholeFile(Filename);
if(Buffer==NULL){
Game->LOG(0, "CBFont::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -81,8 +81,8 @@ HRESULT CBFont::LoadFile(char * Filename)
HRESULT ret;
- m_Filename = new char [strlen(Filename)+1];
- strcpy(m_Filename, Filename);
+ _filename = new char [strlen(Filename)+1];
+ strcpy(_filename, Filename);
if(FAILED(ret = LoadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", Filename);
@@ -122,7 +122,7 @@ HRESULT CBFont::LoadBuffer(byte * Buffer)
case TOKEN_TRANSPARENT:
parser.ScanStr(params, "%d,%d,%d", &r, &g, &b);
- custom_trans = true;
+ custo_trans = true;
break;
}
@@ -187,7 +187,7 @@ bool CBFont::IsTrueType(CBGame *Game, char *Filename) {
TOKEN_TABLE_END
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) return false;
byte *WorkBuffer = Buffer;
diff --git a/engines/wintermute/BFontBitmap.cpp b/engines/wintermute/BFontBitmap.cpp
index 9b49a84079..3bec9d5a20 100644
--- a/engines/wintermute/BFontBitmap.cpp
+++ b/engines/wintermute/BFontBitmap.cpp
@@ -49,23 +49,23 @@ IMPLEMENT_PERSISTENT(CBFontBitmap, false)
//////////////////////////////////////////////////////////////////////
CBFontBitmap::CBFontBitmap(CBGame *inGame): CBFont(inGame) {
- m_Subframe = NULL;
- m_Sprite = NULL;
- m_WidthsFrame = 0;
- memset(m_Widths, 0, NUM_CHARACTERS);
- m_TileWidth = m_TileHeight = m_NumColumns = 0;
- m_FontextFix = false;
- m_Freezable = false;
- m_WholeCell = false;
+ _subframe = NULL;
+ _sprite = NULL;
+ _widthsFrame = 0;
+ memset(_widths, 0, NUM_CHARACTERS);
+ _tileWidth = _tileHeight = _numColumns = 0;
+ _fontextFix = false;
+ _freezable = false;
+ _wholeCell = false;
}
//////////////////////////////////////////////////////////////////////
CBFontBitmap::~CBFontBitmap() {
- delete m_Subframe;
- delete m_Sprite;
- m_Subframe = NULL;
- m_Sprite = NULL;
+ delete _subframe;
+ delete _sprite;
+ _subframe = NULL;
+ _sprite = NULL;
}
@@ -85,7 +85,7 @@ int CBFontBitmap::GetTextHeight(byte *text, int width) {
int CBFontBitmap::GetTextWidth(byte *text, int MaxLength) {
AnsiString str;
- if (Game->m_TextEncoding == TEXT_UTF8) {
+ if (Game->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::Utf8ToWide(Utf8String((char *)text));
str = StringUtil::WideToAnsi(wstr);
} else {
@@ -109,13 +109,13 @@ int CBFontBitmap::GetTextWidth(byte *text, int MaxLength) {
int CBFontBitmap::TextHeightDraw(byte *text, int x, int y, int width, TTextAlign align, bool draw, int max_height, int MaxLenght) {
if (MaxLenght == 0) return 0;
- if (text == NULL || text[0] == '\0') return m_TileHeight;
+ if (text == NULL || text[0] == '\0') return _tileHeight;
AnsiString str;
- if (Game->m_TextEncoding == TEXT_UTF8) {
+ if (Game->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::Utf8ToWide(Utf8String((char *)text));
str = StringUtil::WideToAnsi(wstr);
} else {
@@ -138,17 +138,17 @@ int CBFontBitmap::TextHeightDraw(byte *text, int x, int y, int width, TTextAlig
bool new_line = false;
bool long_line = false;
- if (draw) Game->m_Renderer->StartSpriteBatch();
+ if (draw) Game->_renderer->StartSpriteBatch();
while (!done) {
- if (max_height > 0 && (NumLines + 1)*m_TileHeight > max_height) {
- if (draw) Game->m_Renderer->EndSpriteBatch();
- return NumLines * m_TileHeight;
+ if (max_height > 0 && (NumLines + 1)*_tileHeight > max_height) {
+ if (draw) Game->_renderer->EndSpriteBatch();
+ return NumLines * _tileHeight;
}
index++;
- if (str[index] == ' ' && (max_height < 0 || max_height / m_TileHeight > 1)) {
+ if (str[index] == ' ' && (max_height < 0 || max_height / _tileHeight > 1)) {
end = index - 1;
RealLength = LineLength;
}
@@ -193,7 +193,7 @@ int CBFontBitmap::TextHeightDraw(byte *text, int x, int y, int width, TTextAlig
if (draw) DrawChar(str[i], StartX, y);
StartX += GetCharWidth(str[i]);
}
- y += m_TileHeight;
+ y += _tileHeight;
last_end = end;
if (long_line) end--;
start = end + 2;
@@ -205,45 +205,45 @@ int CBFontBitmap::TextHeightDraw(byte *text, int x, int y, int width, TTextAlig
}
}
- if (draw) Game->m_Renderer->EndSpriteBatch();
+ if (draw) Game->_renderer->EndSpriteBatch();
- return NumLines * m_TileHeight;
+ return NumLines * _tileHeight;
}
//////////////////////////////////////////////////////////////////////
void CBFontBitmap::DrawChar(byte c, int x, int y) {
- if (m_FontextFix) c--;
+ if (_fontextFix) c--;
int row, col;
- row = c / m_NumColumns;
- col = c % m_NumColumns;
+ row = c / _numColumns;
+ col = c % _numColumns;
RECT rect;
/* l t r b */
int TileWidth;
- if (m_WholeCell) TileWidth = m_TileWidth;
- else TileWidth = m_Widths[c];
+ if (_wholeCell) TileWidth = _tileWidth;
+ else TileWidth = _widths[c];
- CBPlatform::SetRect(&rect, col * m_TileWidth, row * m_TileHeight, col * m_TileWidth + TileWidth, (row + 1)*m_TileHeight);
+ CBPlatform::SetRect(&rect, col * _tileWidth, row * _tileHeight, col * _tileWidth + TileWidth, (row + 1)*_tileHeight);
bool Handled = false;
- if (m_Sprite) {
- m_Sprite->GetCurrentFrame();
- if (m_Sprite->m_CurrentFrame >= 0 && m_Sprite->m_CurrentFrame < m_Sprite->m_Frames.GetSize() && m_Sprite->m_Frames[m_Sprite->m_CurrentFrame]) {
- if (m_Sprite->m_Frames[m_Sprite->m_CurrentFrame]->m_Subframes.GetSize() > 0) {
- m_Sprite->m_Frames[m_Sprite->m_CurrentFrame]->m_Subframes[0]->m_Surface->DisplayTrans(x, y, rect);
+ if (_sprite) {
+ _sprite->GetCurrentFrame();
+ if (_sprite->_currentFrame >= 0 && _sprite->_currentFrame < _sprite->_frames.GetSize() && _sprite->_frames[_sprite->_currentFrame]) {
+ if (_sprite->_frames[_sprite->_currentFrame]->_subframes.GetSize() > 0) {
+ _sprite->_frames[_sprite->_currentFrame]->_subframes[0]->_surface->DisplayTrans(x, y, rect);
}
Handled = true;
}
}
- if (!Handled && m_Subframe) m_Subframe->m_Surface->DisplayTrans(x, y, rect);
+ if (!Handled && _subframe) _subframe->_surface->DisplayTrans(x, y, rect);
}
//////////////////////////////////////////////////////////////////////
HRESULT CBFontBitmap::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CBFontBitmap::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -251,8 +251,8 @@ HRESULT CBFontBitmap::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, Filename);
+ _filename = new char [strlen(Filename) + 1];
+ strcpy(_filename, Filename);
if (FAILED(ret = LoadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", Filename);
@@ -316,7 +316,7 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
int last_width = 0;
int i;
int r = 255, g = 255, b = 255;
- bool custom_trans = false;
+ bool custo_trans = false;
char *surface_file = NULL;
char *sprite_file = NULL;
@@ -337,13 +337,13 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
case TOKEN_TRANSPARENT:
parser.ScanStr(params, "%d,%d,%d", &r, &g, &b);
- custom_trans = true;
+ custo_trans = true;
break;
case TOKEN_WIDTHS:
parser.ScanStr(params, "%D", widths, &num);
for (i = 0; last_width < NUM_CHARACTERS, num > 0; last_width++, num--, i++) {
- m_Widths[last_width] = (byte )widths[i];
+ _widths[last_width] = (byte )widths[i];
}
break;
@@ -352,19 +352,19 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
break;
case TOKEN_WIDTHS_FRAME:
- parser.ScanStr(params, "%d", &m_WidthsFrame);
+ parser.ScanStr(params, "%d", &_widthsFrame);
break;
case TOKEN_COLUMNS:
- parser.ScanStr(params, "%d", &m_NumColumns);
+ parser.ScanStr(params, "%d", &_numColumns);
break;
case TOKEN_TILE_WIDTH:
- parser.ScanStr(params, "%d", &m_TileWidth);
+ parser.ScanStr(params, "%d", &_tileWidth);
break;
case TOKEN_TILE_HEIGHT:
- parser.ScanStr(params, "%d", &m_TileHeight);
+ parser.ScanStr(params, "%d", &_tileHeight);
break;
case TOKEN_AUTO_WIDTH:
@@ -372,11 +372,11 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
break;
case TOKEN_FONTEXT_FIX:
- parser.ScanStr(params, "%b", &m_FontextFix);
+ parser.ScanStr(params, "%b", &_fontextFix);
break;
case TOKEN_PAINT_WHOLE_CELL:
- parser.ScanStr(params, "%b", &m_WholeCell);
+ parser.ScanStr(params, "%b", &_wholeCell);
break;
case TOKEN_SPACE_WIDTH:
@@ -399,19 +399,19 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
}
if (sprite_file != NULL) {
- delete m_Sprite;
- m_Sprite = new CBSprite(Game, this);
- if (!m_Sprite || FAILED(m_Sprite->LoadFile(sprite_file))) SAFE_DELETE(m_Sprite);
+ delete _sprite;
+ _sprite = new CBSprite(Game, this);
+ if (!_sprite || FAILED(_sprite->LoadFile(sprite_file))) SAFE_DELETE(_sprite);
}
- if (surface_file != NULL && !m_Sprite) {
- m_Subframe = new CBSubFrame(Game);
- if (custom_trans) m_Subframe->SetSurface(surface_file, false, r, g, b);
- else m_Subframe->SetSurface(surface_file);
+ if (surface_file != NULL && !_sprite) {
+ _subframe = new CBSubFrame(Game);
+ if (custo_trans) _subframe->SetSurface(surface_file, false, r, g, b);
+ else _subframe->SetSurface(surface_file);
}
- if (((m_Subframe == NULL || m_Subframe->m_Surface == NULL) && m_Sprite == NULL) || m_NumColumns == 0 || m_TileWidth == 0 || m_TileHeight == 0) {
+ if (((_subframe == NULL || _subframe->_surface == NULL) && _sprite == NULL) || _numColumns == 0 || _tileWidth == 0 || _tileHeight == 0) {
Game->LOG(0, "Incomplete font definition");
return E_FAIL;
}
@@ -423,25 +423,25 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
// do we need to modify widths?
if (ExpandWidth != 0) {
for (i = 0; i < NUM_CHARACTERS; i++) {
- int NewWidth = (int)m_Widths[i] + ExpandWidth;
+ int NewWidth = (int)_widths[i] + ExpandWidth;
if (NewWidth < 0) NewWidth = 0;
- m_Widths[i] = (byte )NewWidth;
+ _widths[i] = (byte )NewWidth;
}
}
// handle space character
char SpaceChar = ' ';
- if (m_FontextFix) SpaceChar--;
+ if (_fontextFix) SpaceChar--;
- if (SpaceWidth != 0) m_Widths[SpaceChar] = SpaceWidth;
+ if (SpaceWidth != 0) _widths[SpaceChar] = SpaceWidth;
else {
- if (m_Widths[SpaceChar] == ExpandWidth || m_Widths[SpaceChar] == 0) {
- m_Widths[SpaceChar] = (m_Widths['m'] + m_Widths['i']) / 2;
+ if (_widths[SpaceChar] == ExpandWidth || _widths[SpaceChar] == 0) {
+ _widths[SpaceChar] = (_widths['m'] + _widths['i']) / 2;
}
}
} else {
- for (i = last_width; i < NUM_CHARACTERS; i++) m_Widths[i] = default_width;
+ for (i = last_width; i < NUM_CHARACTERS; i++) _widths[i] = default_width;
}
@@ -453,22 +453,22 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
HRESULT CBFontBitmap::Persist(CBPersistMgr *PersistMgr) {
CBFont::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_NumColumns));
+ PersistMgr->Transfer(TMEMBER(_numColumns));
- PersistMgr->Transfer(TMEMBER(m_Subframe));
- PersistMgr->Transfer(TMEMBER(m_TileHeight));
- PersistMgr->Transfer(TMEMBER(m_TileWidth));
- PersistMgr->Transfer(TMEMBER(m_Sprite));
- PersistMgr->Transfer(TMEMBER(m_WidthsFrame));
+ PersistMgr->Transfer(TMEMBER(_subframe));
+ PersistMgr->Transfer(TMEMBER(_tileHeight));
+ PersistMgr->Transfer(TMEMBER(_tileWidth));
+ PersistMgr->Transfer(TMEMBER(_sprite));
+ PersistMgr->Transfer(TMEMBER(_widthsFrame));
- if (PersistMgr->m_Saving)
- PersistMgr->PutBytes(m_Widths, sizeof(m_Widths));
+ if (PersistMgr->_saving)
+ PersistMgr->PutBytes(_widths, sizeof(_widths));
else
- PersistMgr->GetBytes(m_Widths, sizeof(m_Widths));
+ PersistMgr->GetBytes(_widths, sizeof(_widths));
- PersistMgr->Transfer(TMEMBER(m_FontextFix));
- PersistMgr->Transfer(TMEMBER(m_WholeCell));
+ PersistMgr->Transfer(TMEMBER(_fontextFix));
+ PersistMgr->Transfer(TMEMBER(_wholeCell));
return S_OK;
@@ -477,8 +477,8 @@ HRESULT CBFontBitmap::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
int CBFontBitmap::GetCharWidth(byte Index) {
- if (m_FontextFix) Index--;
- return m_Widths[Index];
+ if (_fontextFix) Index--;
+ return _widths[Index];
}
@@ -486,25 +486,25 @@ int CBFontBitmap::GetCharWidth(byte Index) {
HRESULT CBFontBitmap::GetWidths() {
CBSurface *surf = NULL;
- if (m_Sprite) {
- if (m_WidthsFrame >= 0 && m_WidthsFrame < m_Sprite->m_Frames.GetSize()) {
- if (m_Sprite->m_Frames[m_WidthsFrame] && m_Sprite->m_Frames[m_WidthsFrame]->m_Subframes.GetSize() > 0) {
- surf = m_Sprite->m_Frames[m_WidthsFrame]->m_Subframes[0]->m_Surface;
+ if (_sprite) {
+ if (_widthsFrame >= 0 && _widthsFrame < _sprite->_frames.GetSize()) {
+ if (_sprite->_frames[_widthsFrame] && _sprite->_frames[_widthsFrame]->_subframes.GetSize() > 0) {
+ surf = _sprite->_frames[_widthsFrame]->_subframes[0]->_surface;
}
}
}
- if (surf == NULL && m_Subframe) surf = m_Subframe->m_Surface;
+ if (surf == NULL && _subframe) surf = _subframe->_surface;
if (!surf || FAILED(surf->StartPixelOp())) return E_FAIL;
for (int i = 0; i < NUM_CHARACTERS; i++) {
- int xxx = (i % m_NumColumns) * m_TileWidth;
- int yyy = (i / m_NumColumns) * m_TileHeight;
+ int xxx = (i % _numColumns) * _tileWidth;
+ int yyy = (i / _numColumns) * _tileHeight;
int min_col = -1;
- for (int row = 0; row < m_TileHeight; row++) {
- for (int col = m_TileWidth - 1; col >= min_col + 1; col--) {
+ for (int row = 0; row < _tileHeight; row++) {
+ for (int col = _tileWidth - 1; col >= min_col + 1; col--) {
if (xxx + col < 0 || xxx + col >= surf->GetWidth() || yyy + row < 0 || yyy + row >= surf->GetHeight()) continue;
if (!surf->IsTransparentAtLite(xxx + col, yyy + row)) {
//min_col = col;
@@ -512,17 +512,17 @@ HRESULT CBFontBitmap::GetWidths() {
break;
}
}
- if (min_col == m_TileWidth - 1) break;
+ if (min_col == _tileWidth - 1) break;
}
- m_Widths[i] = min_col + 1;
+ _widths[i] = min_col + 1;
}
surf->EndPixelOp();
/*
- Game->LOG(0, "----- %s ------", m_Filename);
+ Game->LOG(0, "----- %s ------", _filename);
for(int j=0; j<16; j++)
{
- Game->LOG(0, "%02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d", m_Widths[j*16+0], m_Widths[j*16+1], m_Widths[j*16+2], m_Widths[j*16+3], m_Widths[j*16+4], m_Widths[j*16+5], m_Widths[j*16+6], m_Widths[j*16+7], m_Widths[j*16+8], m_Widths[j*16+9], m_Widths[j*16+10], m_Widths[j*16+11], m_Widths[j*16+12], m_Widths[j*16+13], m_Widths[j*16+14], m_Widths[j*16+15]);
+ Game->LOG(0, "%02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d %02d", _widths[j*16+0], _widths[j*16+1], _widths[j*16+2], _widths[j*16+3], _widths[j*16+4], _widths[j*16+5], _widths[j*16+6], _widths[j*16+7], _widths[j*16+8], _widths[j*16+9], _widths[j*16+10], _widths[j*16+11], _widths[j*16+12], _widths[j*16+13], _widths[j*16+14], _widths[j*16+15]);
}
*/
return S_OK;
@@ -530,7 +530,7 @@ HRESULT CBFontBitmap::GetWidths() {
//////////////////////////////////////////////////////////////////////////
int CBFontBitmap::GetLetterHeight() {
- return m_TileHeight;
+ return _tileHeight;
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/BFontBitmap.h b/engines/wintermute/BFontBitmap.h
index c56c192e63..b194674b7c 100644
--- a/engines/wintermute/BFontBitmap.h
+++ b/engines/wintermute/BFontBitmap.h
@@ -49,15 +49,15 @@ public:
HRESULT GetWidths();
- CBSprite *m_Sprite;
- int m_WidthsFrame;
- bool m_FontextFix;
- int m_NumColumns;
- int m_TileHeight;
- int m_TileWidth;
- byte m_Widths[NUM_CHARACTERS];
- CBSubFrame *m_Subframe;
- bool m_WholeCell;
+ CBSprite *_sprite;
+ int _widthsFrame;
+ bool _fontextFix;
+ int _numColumns;
+ int _tileHeight;
+ int _tileWidth;
+ byte _widths[NUM_CHARACTERS];
+ CBSubFrame *_subframe;
+ bool _wholeCell;
private:
int GetCharWidth(byte Index);
diff --git a/engines/wintermute/BFontStorage.cpp b/engines/wintermute/BFontStorage.cpp
index cb14714550..1ceb77cb1c 100644
--- a/engines/wintermute/BFontStorage.cpp
+++ b/engines/wintermute/BFontStorage.cpp
@@ -43,7 +43,7 @@ IMPLEMENT_PERSISTENT(CBFontStorage, true)
//////////////////////////////////////////////////////////////////////////
CBFontStorage::CBFontStorage(CBGame *inGame): CBBase(inGame) {
- m_FTLibrary = NULL;
+ _fTLibrary = NULL;
InitFreeType();
}
@@ -56,7 +56,7 @@ CBFontStorage::~CBFontStorage() {
//////////////////////////////////////////////////////////////////////////
void CBFontStorage::InitFreeType() {
- FT_Error error = FT_Init_FreeType(&m_FTLibrary);
+ FT_Error error = FT_Init_FreeType(&_fTLibrary);
if (error) {
Game->LOG(0, "Error initializing FreeType library.");
}
@@ -66,14 +66,14 @@ void CBFontStorage::InitFreeType() {
HRESULT CBFontStorage::Cleanup(bool Warn) {
int i;
- for (i = 0; i < m_Fonts.GetSize(); i++) {
- if (Warn) Game->LOG(0, "Removing orphan font '%s'", m_Fonts[i]->m_Filename);
- delete m_Fonts[i];
+ for (i = 0; i < _fonts.GetSize(); i++) {
+ if (Warn) Game->LOG(0, "Removing orphan font '%s'", _fonts[i]->_filename);
+ delete _fonts[i];
}
- m_Fonts.RemoveAll();
+ _fonts.RemoveAll();
- if (m_FTLibrary) FT_Done_FreeType(m_FTLibrary);
+ if (_fTLibrary) FT_Done_FreeType(_fTLibrary);
return S_OK;
@@ -81,8 +81,8 @@ HRESULT CBFontStorage::Cleanup(bool Warn) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFontStorage::InitLoop() {
- for (int i = 0; i < m_Fonts.GetSize(); i++) {
- m_Fonts[i]->InitLoop();
+ for (int i = 0; i < _fonts.GetSize(); i++) {
+ _fonts[i]->InitLoop();
}
return S_OK;
}
@@ -91,10 +91,10 @@ HRESULT CBFontStorage::InitLoop() {
CBFont *CBFontStorage::AddFont(char *Filename) {
if (!Filename) return NULL;
- for (int i = 0; i < m_Fonts.GetSize(); i++) {
- if (scumm_stricmp(m_Fonts[i]->m_Filename, Filename) == 0) {
- m_Fonts[i]->m_RefCount++;
- return m_Fonts[i];
+ for (int i = 0; i < _fonts.GetSize(); i++) {
+ if (scumm_stricmp(_fonts[i]->_filename, Filename) == 0) {
+ _fonts[i]->_refCount++;
+ return _fonts[i];
}
}
@@ -107,15 +107,15 @@ CBFont *CBFontStorage::AddFont(char *Filename) {
return NULL;
}
else {
- font->m_RefCount = 1;
- m_Fonts.Add(font);
+ font->_refCount = 1;
+ _fonts.Add(font);
return font;
}
*/
CBFont *font = CBFont::CreateFromFile(Game, Filename);
if (font) {
- font->m_RefCount = 1;
- m_Fonts.Add(font);
+ font->_refCount = 1;
+ _fonts.Add(font);
}
return font;
}
@@ -125,12 +125,12 @@ CBFont *CBFontStorage::AddFont(char *Filename) {
HRESULT CBFontStorage::RemoveFont(CBFont *Font) {
if (!Font) return E_FAIL;
- for (int i = 0; i < m_Fonts.GetSize(); i++) {
- if (m_Fonts[i] == Font) {
- m_Fonts[i]->m_RefCount--;
- if (m_Fonts[i]->m_RefCount <= 0) {
- delete m_Fonts[i];
- m_Fonts.RemoveAt(i);
+ for (int i = 0; i < _fonts.GetSize(); i++) {
+ if (_fonts[i] == Font) {
+ _fonts[i]->_refCount--;
+ if (_fonts[i]->_refCount <= 0) {
+ delete _fonts[i];
+ _fonts.RemoveAt(i);
}
break;
}
@@ -142,12 +142,12 @@ HRESULT CBFontStorage::RemoveFont(CBFont *Font) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFontStorage::Persist(CBPersistMgr *PersistMgr) {
- if (!PersistMgr->m_Saving) Cleanup(false);
+ if (!PersistMgr->_saving) Cleanup(false);
PersistMgr->Transfer(TMEMBER(Game));
- m_Fonts.Persist(PersistMgr);
+ _fonts.Persist(PersistMgr);
- if (!PersistMgr->m_Saving) InitFreeType();
+ if (!PersistMgr->_saving) InitFreeType();
return S_OK;
}
diff --git a/engines/wintermute/BFontStorage.h b/engines/wintermute/BFontStorage.h
index 6dc2273022..010d0a83c2 100644
--- a/engines/wintermute/BFontStorage.h
+++ b/engines/wintermute/BFontStorage.h
@@ -49,16 +49,16 @@ public:
CBFont *AddFont(char *Filename);
CBFontStorage(CBGame *inGame);
virtual ~CBFontStorage();
- CBArray<CBFont *, CBFont *> m_Fonts;
+ CBArray<CBFont *, CBFont *> _fonts;
HRESULT InitLoop();
FT_Library GetFTLibrary() const {
- return m_FTLibrary;
+ return _fTLibrary;
}
private:
void InitFreeType();
- FT_Library m_FTLibrary;
+ FT_Library _fTLibrary;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BFontTT.cpp b/engines/wintermute/BFontTT.cpp
index 398d3bb1d9..5e4370d69f 100644
--- a/engines/wintermute/BFontTT.cpp
+++ b/engines/wintermute/BFontTT.cpp
@@ -49,45 +49,45 @@ IMPLEMENT_PERSISTENT(CBFontTT, false)
//////////////////////////////////////////////////////////////////////////
CBFontTT::CBFontTT(CBGame *inGame): CBFont(inGame) {
- m_FontHeight = 12;
- m_IsBold = m_IsItalic = m_IsUnderline = m_IsStriked = false;
+ _fontHeight = 12;
+ _isBold = _isItalic = _isUnderline = _isStriked = false;
- m_FontFile = NULL;
+ _fontFile = NULL;
- for (int i = 0; i < NUM_CACHED_TEXTS; i++) m_CachedTexts[i] = NULL;
+ for (int i = 0; i < NUM_CACHED_TEXTS; i++) _cachedTexts[i] = NULL;
- m_FTFace = NULL;
- m_FTStream = NULL;
+ _fTFace = NULL;
+ _fTStream = NULL;
- m_GlyphCache = NULL;
+ _glyphCache = NULL;
- m_Ascender = m_Descender = m_LineHeight = m_PointSize = m_UnderlinePos = 0;
- m_HorDpi = m_VertDpi = 0;
- m_MaxCharWidth = m_MaxCharHeight = 0;
+ _ascender = _descender = _lineHeight = _pointSize = _underlinePos = 0;
+ _horDpi = _vertDpi = 0;
+ _maxCharWidth = _maxCharHeight = 0;
}
//////////////////////////////////////////////////////////////////////////
CBFontTT::~CBFontTT(void) {
ClearCache();
- for (int i = 0; i < m_Layers.GetSize(); i++) {
- delete m_Layers[i];
+ for (int i = 0; i < _layers.GetSize(); i++) {
+ delete _layers[i];
}
- m_Layers.RemoveAll();
+ _layers.RemoveAll();
- delete[] m_FontFile;
- m_FontFile = NULL;
+ delete[] _fontFile;
+ _fontFile = NULL;
- delete m_GlyphCache;
- m_GlyphCache = NULL;
+ delete _glyphCache;
+ _glyphCache = NULL;
- if (m_FTFace) {
- FT_Done_Face(m_FTFace);
- m_FTFace = NULL;
+ if (_fTFace) {
+ FT_Done_Face(_fTFace);
+ _fTFace = NULL;
}
- delete[] m_FTStream;
- m_FTStream = NULL;
+ delete[] _fTStream;
+ _fTStream = NULL;
}
@@ -95,8 +95,8 @@ CBFontTT::~CBFontTT(void) {
//////////////////////////////////////////////////////////////////////////
void CBFontTT::ClearCache() {
for (int i = 0; i < NUM_CACHED_TEXTS; i++) {
- if (m_CachedTexts[i]) delete m_CachedTexts[i];
- m_CachedTexts[i] = NULL;
+ if (_cachedTexts[i]) delete _cachedTexts[i];
+ _cachedTexts[i] = NULL;
}
}
@@ -104,15 +104,15 @@ void CBFontTT::ClearCache() {
//////////////////////////////////////////////////////////////////////////
void CBFontTT::InitLoop() {
// we need more aggressive cache management on iOS not to waste too much memory on fonts
- if (Game->m_ConstrainedMemory) {
+ if (Game->_constrainedMemory) {
// purge all cached images not used in the last frame
for (int i = 0; i < NUM_CACHED_TEXTS; i++) {
- if (m_CachedTexts[i] == NULL) continue;
+ if (_cachedTexts[i] == NULL) continue;
- if (!m_CachedTexts[i]->m_Marked) {
- delete m_CachedTexts[i];
- m_CachedTexts[i] = NULL;
- } else m_CachedTexts[i]->m_Marked = false;
+ if (!_cachedTexts[i]->_marked) {
+ delete _cachedTexts[i];
+ _cachedTexts[i] = NULL;
+ } else _cachedTexts[i]->_marked = false;
}
}
}
@@ -121,7 +121,7 @@ void CBFontTT::InitLoop() {
int CBFontTT::GetTextWidth(byte *Text, int MaxLength) {
WideString text;
- if (Game->m_TextEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
+ if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
else text = StringUtil::AnsiToWide((char *)Text);
if (MaxLength >= 0 && text.size() > MaxLength)
@@ -138,7 +138,7 @@ int CBFontTT::GetTextWidth(byte *Text, int MaxLength) {
int CBFontTT::GetTextHeight(byte *Text, int Width) {
WideString text;
- if (Game->m_TextEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
+ if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
else text = StringUtil::AnsiToWide((char *)Text);
@@ -155,14 +155,14 @@ void CBFontTT::DrawText(byte *Text, int X, int Y, int Width, TTextAlign Align,
WideString text;
- if (Game->m_TextEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
+ if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
else text = StringUtil::AnsiToWide((char *)Text);
if (MaxLength >= 0 && text.size() > MaxLength)
text = Common::String(text.c_str(), MaxLength);
//text = text.substr(0, MaxLength); // TODO: Remove
- CBRenderSDL *m_Renderer = (CBRenderSDL *)Game->m_Renderer;
+ CBRenderSDL *_renderer = (CBRenderSDL *)Game->_renderer;
// find cached surface, if exists
int MinPriority = INT_MAX;
@@ -171,19 +171,19 @@ void CBFontTT::DrawText(byte *Text, int X, int Y, int Width, TTextAlign Align,
int textOffset = 0;
for (int i = 0; i < NUM_CACHED_TEXTS; i++) {
- if (m_CachedTexts[i] == NULL) {
+ if (_cachedTexts[i] == NULL) {
MinPriority = 0;
MinIndex = i;
} else {
- if (m_CachedTexts[i]->m_Text == text && m_CachedTexts[i]->m_Align == Align && m_CachedTexts[i]->m_Width == Width && m_CachedTexts[i]->m_MaxHeight == MaxHeight && m_CachedTexts[i]->m_MaxLength == MaxLength) {
- Surface = m_CachedTexts[i]->m_Surface;
- textOffset = m_CachedTexts[i]->m_TextOffset;
- m_CachedTexts[i]->m_Priority++;
- m_CachedTexts[i]->m_Marked = true;
+ if (_cachedTexts[i]->_text == text && _cachedTexts[i]->_align == Align && _cachedTexts[i]->_width == Width && _cachedTexts[i]->_maxHeight == MaxHeight && _cachedTexts[i]->_maxLength == MaxLength) {
+ Surface = _cachedTexts[i]->_surface;
+ textOffset = _cachedTexts[i]->_textOffset;
+ _cachedTexts[i]->_priority++;
+ _cachedTexts[i]->_marked = true;
break;
} else {
- if (m_CachedTexts[i]->m_Priority < MinPriority) {
- MinPriority = m_CachedTexts[i]->m_Priority;
+ if (_cachedTexts[i]->_priority < MinPriority) {
+ MinPriority = _cachedTexts[i]->_priority;
MinIndex = i;
}
}
@@ -195,18 +195,18 @@ void CBFontTT::DrawText(byte *Text, int X, int Y, int Width, TTextAlign Align,
Surface = RenderTextToTexture(text, Width, Align, MaxHeight, textOffset);
if (Surface) {
// write surface to cache
- if (m_CachedTexts[MinIndex] != NULL) delete m_CachedTexts[MinIndex];
- m_CachedTexts[MinIndex] = new CBCachedTTFontText;
-
- m_CachedTexts[MinIndex]->m_Surface = Surface;
- m_CachedTexts[MinIndex]->m_Align = Align;
- m_CachedTexts[MinIndex]->m_Width = Width;
- m_CachedTexts[MinIndex]->m_MaxHeight = MaxHeight;
- m_CachedTexts[MinIndex]->m_MaxLength = MaxLength;
- m_CachedTexts[MinIndex]->m_Priority = 1;
- m_CachedTexts[MinIndex]->m_Text = text;
- m_CachedTexts[MinIndex]->m_TextOffset = textOffset;
- m_CachedTexts[MinIndex]->m_Marked = true;
+ if (_cachedTexts[MinIndex] != NULL) delete _cachedTexts[MinIndex];
+ _cachedTexts[MinIndex] = new CBCachedTTFontText;
+
+ _cachedTexts[MinIndex]->_surface = Surface;
+ _cachedTexts[MinIndex]->_align = Align;
+ _cachedTexts[MinIndex]->_width = Width;
+ _cachedTexts[MinIndex]->_maxHeight = MaxHeight;
+ _cachedTexts[MinIndex]->_maxLength = MaxLength;
+ _cachedTexts[MinIndex]->_priority = 1;
+ _cachedTexts[MinIndex]->_text = text;
+ _cachedTexts[MinIndex]->_textOffset = textOffset;
+ _cachedTexts[MinIndex]->_marked = true;
}
}
@@ -215,16 +215,16 @@ void CBFontTT::DrawText(byte *Text, int X, int Y, int Width, TTextAlign Align,
if (Surface) {
RECT rc;
CBPlatform::SetRect(&rc, 0, 0, Surface->GetWidth(), Surface->GetHeight());
- for (int i = 0; i < m_Layers.GetSize(); i++) {
- uint32 Color = m_Layers[i]->m_Color;
- uint32 OrigForceAlpha = m_Renderer->m_ForceAlphaColor;
- if (m_Renderer->m_ForceAlphaColor != 0) {
- Color = DRGBA(D3DCOLGetR(Color), D3DCOLGetG(Color), D3DCOLGetB(Color), D3DCOLGetA(m_Renderer->m_ForceAlphaColor));
- m_Renderer->m_ForceAlphaColor = 0;
+ for (int i = 0; i < _layers.GetSize(); i++) {
+ uint32 Color = _layers[i]->_color;
+ uint32 OrigForceAlpha = _renderer->_forceAlphaColor;
+ if (_renderer->_forceAlphaColor != 0) {
+ Color = DRGBA(D3DCOLGetR(Color), D3DCOLGetG(Color), D3DCOLGetB(Color), D3DCOLGetA(_renderer->_forceAlphaColor));
+ _renderer->_forceAlphaColor = 0;
}
- Surface->DisplayTransOffset(X, Y - textOffset, rc, Color, BLEND_NORMAL, false, false, m_Layers[i]->m_OffsetX, m_Layers[i]->m_OffsetY);
+ Surface->DisplayTransOffset(X, Y - textOffset, rc, Color, BLEND_NORMAL, false, false, _layers[i]->_offsetX, _layers[i]->_offsetY);
- m_Renderer->m_ForceAlphaColor = OrigForceAlpha;
+ _renderer->_forceAlphaColor = OrigForceAlpha;
}
}
@@ -239,12 +239,12 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex
TextLineList::iterator it;
- int textHeight = lines.size() * (m_MaxCharHeight + m_Ascender);
+ int textHeight = lines.size() * (_maxCharHeight + _ascender);
SDL_Surface *surface = SDL_CreateRGBSurface(0, width, textHeight, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
SDL_LockSurface(surface);
- int posY = (int)GetLineHeight() - (int)m_Descender;
+ int posY = (int)GetLineHeight() - (int)_descender;
for (it = lines.begin(); it != lines.end(); ++it) {
TextLine *line = (*it);
@@ -265,7 +265,7 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex
for (size_t i = 0; i < line->GetText().size(); i++) {
wchar_t ch = line->GetText()[i];
- GlyphInfo *glyph = m_GlyphCache->GetGlyph(ch);
+ GlyphInfo *glyph = _glyphCache->GetGlyph(ch);
if (!glyph) continue;
textOffset = std::max(textOffset, glyph->GetBearingY());
@@ -278,7 +278,7 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex
for (size_t i = 0; i < line->GetText().size(); i++) {
wchar_t ch = line->GetText()[i];
- GlyphInfo *glyph = m_GlyphCache->GetGlyph(ch);
+ GlyphInfo *glyph = _glyphCache->GetGlyph(ch);
if (!glyph) continue;
float kerning = 0;
@@ -303,9 +303,9 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex
posY += (int)(glyph->GetAdvanceY());
}
- if (m_IsUnderline) {
+ if (_isUnderline) {
for (int i = origPosX; i < origPosX + line->GetWidth(); i++) {
- Uint8 *buf = (Uint8 *)surface->pixels + (int)(m_UnderlinePos + m_Ascender) * surface->pitch;
+ Uint8 *buf = (Uint8 *)surface->pixels + (int)(_underlinePos + _ascender) * surface->pitch;
Uint32 *buf32 = (Uint32 *)buf;
buf32[i] = SDL_MapRGBA(surface->format, 255, 255, 255, 255);
@@ -361,7 +361,7 @@ int CBFontTT::GetLetterHeight() {
//////////////////////////////////////////////////////////////////////
HRESULT CBFontTT::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CBFontTT::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -369,8 +369,8 @@ HRESULT CBFontTT::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, Filename);
+ _filename = new char [strlen(Filename) + 1];
+ strcpy(_filename, Filename);
if (FAILED(ret = LoadBuffer(Buffer))) Game->LOG(0, "Error parsing TTFONT file '%s'", Filename);
@@ -428,7 +428,7 @@ HRESULT CBFontTT::LoadBuffer(byte *Buffer) {
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
case TOKEN_SIZE:
- parser.ScanStr(params, "%d", &m_FontHeight);
+ parser.ScanStr(params, "%d", &_fontHeight);
break;
case TOKEN_FACE:
@@ -436,23 +436,23 @@ HRESULT CBFontTT::LoadBuffer(byte *Buffer) {
break;
case TOKEN_FILENAME:
- CBUtils::SetString(&m_FontFile, params);
+ CBUtils::SetString(&_fontFile, params);
break;
case TOKEN_BOLD:
- parser.ScanStr(params, "%b", &m_IsBold);
+ parser.ScanStr(params, "%b", &_isBold);
break;
case TOKEN_ITALIC:
- parser.ScanStr(params, "%b", &m_IsItalic);
+ parser.ScanStr(params, "%b", &_isItalic);
break;
case TOKEN_UNDERLINE:
- parser.ScanStr(params, "%b", &m_IsUnderline);
+ parser.ScanStr(params, "%b", &_isUnderline);
break;
case TOKEN_STRIKE:
- parser.ScanStr(params, "%b", &m_IsStriked);
+ parser.ScanStr(params, "%b", &_isStriked);
break;
case TOKEN_CHARSET:
@@ -475,7 +475,7 @@ HRESULT CBFontTT::LoadBuffer(byte *Buffer) {
case TOKEN_LAYER: {
CBTTFontLayer *Layer = new CBTTFontLayer;
- if (Layer && SUCCEEDED(ParseLayer(Layer, (byte *)params))) m_Layers.Add(Layer);
+ if (Layer && SUCCEEDED(ParseLayer(Layer, (byte *)params))) _layers.Add(Layer);
else {
delete Layer;
Layer = NULL;
@@ -492,13 +492,13 @@ HRESULT CBFontTT::LoadBuffer(byte *Buffer) {
}
// create at least one layer
- if (m_Layers.GetSize() == 0) {
+ if (_layers.GetSize() == 0) {
CBTTFontLayer *Layer = new CBTTFontLayer;
- Layer->m_Color = BaseColor;
- m_Layers.Add(Layer);
+ Layer->_color = BaseColor;
+ _layers.Add(Layer);
}
- if (!m_FontFile) CBUtils::SetString(&m_FontFile, "arial.ttf");
+ if (!_fontFile) CBUtils::SetString(&_fontFile, "arial.ttf");
return InitFont();
}
@@ -520,24 +520,24 @@ HRESULT CBFontTT::ParseLayer(CBTTFontLayer *Layer, byte *Buffer) {
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
case TOKEN_OFFSET_X:
- parser.ScanStr(params, "%d", &Layer->m_OffsetX);
+ parser.ScanStr(params, "%d", &Layer->_offsetX);
break;
case TOKEN_OFFSET_Y:
- parser.ScanStr(params, "%d", &Layer->m_OffsetY);
+ parser.ScanStr(params, "%d", &Layer->_offsetY);
break;
case TOKEN_COLOR: {
int r, g, b;
parser.ScanStr(params, "%d,%d,%d", &r, &g, &b);
- Layer->m_Color = DRGBA(r, g, b, D3DCOLGetA(Layer->m_Color));
+ Layer->_color = DRGBA(r, g, b, D3DCOLGetA(Layer->_color));
}
break;
case TOKEN_ALPHA: {
int a;
parser.ScanStr(params, "%d", &a);
- Layer->m_Color = DRGBA(D3DCOLGetR(Layer->m_Color), D3DCOLGetG(Layer->m_Color), D3DCOLGetB(Layer->m_Color), a);
+ Layer->_color = DRGBA(D3DCOLGetR(Layer->_color), D3DCOLGetG(Layer->_color), D3DCOLGetB(Layer->_color), a);
}
break;
}
@@ -551,33 +551,33 @@ HRESULT CBFontTT::ParseLayer(CBTTFontLayer *Layer, byte *Buffer) {
HRESULT CBFontTT::Persist(CBPersistMgr *PersistMgr) {
CBFont::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_IsBold));
- PersistMgr->Transfer(TMEMBER(m_IsItalic));
- PersistMgr->Transfer(TMEMBER(m_IsUnderline));
- PersistMgr->Transfer(TMEMBER(m_IsStriked));
- PersistMgr->Transfer(TMEMBER(m_FontHeight));
- PersistMgr->Transfer(TMEMBER(m_FontFile));
+ PersistMgr->Transfer(TMEMBER(_isBold));
+ PersistMgr->Transfer(TMEMBER(_isItalic));
+ PersistMgr->Transfer(TMEMBER(_isUnderline));
+ PersistMgr->Transfer(TMEMBER(_isStriked));
+ PersistMgr->Transfer(TMEMBER(_fontHeight));
+ PersistMgr->Transfer(TMEMBER(_fontFile));
// persist layers
int NumLayers;
- if (PersistMgr->m_Saving) {
- NumLayers = m_Layers.GetSize();
+ if (PersistMgr->_saving) {
+ NumLayers = _layers.GetSize();
PersistMgr->Transfer(TMEMBER(NumLayers));
- for (int i = 0; i < NumLayers; i++) m_Layers[i]->Persist(PersistMgr);
+ for (int i = 0; i < NumLayers; i++) _layers[i]->Persist(PersistMgr);
} else {
- NumLayers = m_Layers.GetSize();
+ NumLayers = _layers.GetSize();
PersistMgr->Transfer(TMEMBER(NumLayers));
for (int i = 0; i < NumLayers; i++) {
CBTTFontLayer *Layer = new CBTTFontLayer;
Layer->Persist(PersistMgr);
- m_Layers.Add(Layer);
+ _layers.Add(Layer);
}
}
- if (!PersistMgr->m_Saving) {
- for (int i = 0; i < NUM_CACHED_TEXTS; i++) m_CachedTexts[i] = NULL;
- m_GlyphCache = NULL;
+ if (!PersistMgr->_saving) {
+ for (int i = 0; i < NUM_CACHED_TEXTS; i++) _cachedTexts[i] = NULL;
+ _glyphCache = NULL;
}
return S_OK;
@@ -591,16 +591,16 @@ void CBFontTT::AfterLoad() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFontTT::InitFont() {
- if (!m_FontFile) return E_FAIL;
+ if (!_fontFile) return E_FAIL;
- CBFile *file = Game->m_FileManager->OpenFile(m_FontFile);
+ CBFile *file = Game->_fileManager->OpenFile(_fontFile);
if (!file) {
// the requested font file is not in wme file space; try loading a system font
- AnsiString fontFileName = PathUtil::Combine(CBPlatform::GetSystemFontPath(), PathUtil::GetFileName(m_FontFile));
- file = Game->m_FileManager->OpenFile((char *)fontFileName.c_str(), false);
+ AnsiString fontFileName = PathUtil::Combine(CBPlatform::GetSystemFontPath(), PathUtil::GetFileName(_fontFile));
+ file = Game->_fileManager->OpenFile((char *)fontFileName.c_str(), false);
if (!file) {
- Game->LOG(0, "Error loading TrueType font '%s'", m_FontFile);
+ Game->LOG(0, "Error loading TrueType font '%s'", _fontFile);
return E_FAIL;
}
}
@@ -611,55 +611,55 @@ HRESULT CBFontTT::InitFont() {
float horDpi = 96.0;
- m_FTStream = (FT_Stream)new byte[sizeof(*m_FTStream)];
- memset(m_FTStream, 0, sizeof(*m_FTStream));
+ _fTStream = (FT_Stream)new byte[sizeof(*_fTStream)];
+ memset(_fTStream, 0, sizeof(*_fTStream));
- m_FTStream->read = CBFontTT::FTReadSeekProc;
- m_FTStream->close = CBFontTT::FTCloseProc;
- m_FTStream->descriptor.pointer = file;
- m_FTStream->size = file->GetSize();
+ _fTStream->read = CBFontTT::FTReadSeekProc;
+ _fTStream->close = CBFontTT::FTCloseProc;
+ _fTStream->descriptor.pointer = file;
+ _fTStream->size = file->GetSize();
FT_Open_Args args;
args.flags = FT_OPEN_STREAM;
- args.stream = m_FTStream;
+ args.stream = _fTStream;
- error = FT_Open_Face(Game->m_FontStorage->GetFTLibrary(), &args, 0, &m_FTFace);
+ error = FT_Open_Face(Game->_fontStorage->GetFTLibrary(), &args, 0, &_fTFace);
if (error) {
- SAFE_DELETE_ARRAY(m_FTStream);
- Game->m_FileManager->CloseFile(file);
+ SAFE_DELETE_ARRAY(_fTStream);
+ Game->_fileManager->CloseFile(file);
return E_FAIL;
}
- error = FT_Set_Char_Size(m_FTFace, 0, (FT_F26Dot6)(m_FontHeight * 64), (FT_UInt)horDpi, (FT_UInt)vertDpi);
+ error = FT_Set_Char_Size(_fTFace, 0, (FT_F26Dot6)(_fontHeight * 64), (FT_UInt)horDpi, (FT_UInt)vertDpi);
if (error) {
- FT_Done_Face(m_FTFace);
- m_FTFace = NULL;
+ FT_Done_Face(_fTFace);
+ _fTFace = NULL;
return E_FAIL;
}
- // http://en.wikipedia.org/wiki/Em_(typography)
- float pixelsPerEm = (m_FontHeight / 72.f) * vertDpi; // Size in inches * dpi
- float EmsPerUnit = 1.0f / m_FTFace->units_per_EM;
+ // http://en.wikipedia.org/wiki/E_(typography)
+ float pixelsPerEm = (_fontHeight / 72.f) * vertDpi; // Size in inches * dpi
+ float EmsPerUnit = 1.0f / _fTFace->units_per_EM;
float pixelsPerUnit = pixelsPerEm * EmsPerUnit;
// bounding box in pixels
- float xMin = m_FTFace->bbox.xMin * pixelsPerUnit;
- float xMax = m_FTFace->bbox.xMax * pixelsPerUnit;
- float yMin = m_FTFace->bbox.yMin * pixelsPerUnit;
- float yMax = m_FTFace->bbox.yMax * pixelsPerUnit;
+ float xMin = _fTFace->bbox.xMin * pixelsPerUnit;
+ float xMax = _fTFace->bbox.xMax * pixelsPerUnit;
+ float yMin = _fTFace->bbox.yMin * pixelsPerUnit;
+ float yMax = _fTFace->bbox.yMax * pixelsPerUnit;
// metrics in pixels
- m_Ascender = m_FTFace->ascender * pixelsPerUnit;
- m_Descender = - m_FTFace->descender * pixelsPerUnit;
- m_LineHeight = MathUtil::RoundUp(m_FTFace->height * pixelsPerUnit) + 2;
- m_UnderlinePos = - m_FTFace->underline_position * pixelsPerUnit;
+ _ascender = _fTFace->ascender * pixelsPerUnit;
+ _descender = - _fTFace->descender * pixelsPerUnit;
+ _lineHeight = MathUtil::RoundUp(_fTFace->height * pixelsPerUnit) + 2;
+ _underlinePos = - _fTFace->underline_position * pixelsPerUnit;
// max character size (used for texture grid)
- m_MaxCharWidth = (size_t)MathUtil::RoundUp(xMax - xMin);
- m_MaxCharHeight = (size_t)MathUtil::RoundUp(yMax - yMin);
+ _maxCharWidth = (size_t)MathUtil::RoundUp(xMax - xMin);
+ _maxCharHeight = (size_t)MathUtil::RoundUp(yMax - yMin);
- m_GlyphCache = new FontGlyphCache();
- m_GlyphCache->Initialize();
+ _glyphCache = new FontGlyphCache();
+ _glyphCache->Initialize();
return S_OK;
@@ -688,7 +688,7 @@ void CBFontTT::FTCloseProc(FT_Stream stream) {
CBGame *Game = f->Game;
- Game->m_FileManager->CloseFile(f);
+ Game->_fileManager->CloseFile(f);
stream->descriptor.pointer = NULL;
}
@@ -794,13 +794,13 @@ void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight,
//////////////////////////////////////////////////////////////////////////
float CBFontTT::GetKerning(wchar_t leftChar, wchar_t rightChar) {
- GlyphInfo *infoLeft = m_GlyphCache->GetGlyph(leftChar);
- GlyphInfo *infoRight = m_GlyphCache->GetGlyph(rightChar);
+ GlyphInfo *infoLeft = _glyphCache->GetGlyph(leftChar);
+ GlyphInfo *infoRight = _glyphCache->GetGlyph(rightChar);
if (!infoLeft || !infoRight) return 0;
FT_Vector delta;
- FT_Error error = FT_Get_Kerning(m_FTFace, infoLeft->GetGlyphIndex(), infoRight->GetGlyphIndex(), ft_kerning_unfitted, &delta);
+ FT_Error error = FT_Get_Kerning(_fTFace, infoLeft->GetGlyphIndex(), infoRight->GetGlyphIndex(), ft_kerning_unfitted, &delta);
if (error) return 0;
return delta.x * (1.0f / 64.0f);
@@ -812,45 +812,45 @@ void CBFontTT::PrepareGlyphs(const WideString &text) {
// make sure we have all the glyphs we need
for (size_t i = 0; i < text.size(); i++) {
wchar_t ch = text[i];
- if (!m_GlyphCache->HasGlyph(ch)) CacheGlyph(ch);
+ if (!_glyphCache->HasGlyph(ch)) CacheGlyph(ch);
}
}
//////////////////////////////////////////////////////////////////////////
void CBFontTT::CacheGlyph(wchar_t ch) {
- FT_UInt glyphIndex = FT_Get_Char_Index(m_FTFace, ch);
+ FT_UInt glyphIndex = FT_Get_Char_Index(_fTFace, ch);
if (!glyphIndex) return;
- FT_Error error = FT_Load_Glyph(m_FTFace, glyphIndex, FT_LOAD_DEFAULT);
+ FT_Error error = FT_Load_Glyph(_fTFace, glyphIndex, FT_LOAD_DEFAULT);
if (error) return;
- error = FT_Render_Glyph(m_FTFace->glyph, FT_RENDER_MODE_NORMAL);
+ error = FT_Render_Glyph(_fTFace->glyph, FT_RENDER_MODE_NORMAL);
if (error) return;
- byte *pixels = m_FTFace->glyph->bitmap.buffer;
- size_t stride = m_FTFace->glyph->bitmap.pitch;
+ byte *pixels = _fTFace->glyph->bitmap.buffer;
+ size_t stride = _fTFace->glyph->bitmap.pitch;
// convert from monochrome to grayscale if needed
byte *tempBuffer = NULL;
- if (pixels != NULL && m_FTFace->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
- tempBuffer = new byte[m_FTFace->glyph->bitmap.width * m_FTFace->glyph->bitmap.rows];
- for (int j = 0; j < m_FTFace->glyph->bitmap.rows; j++) {
+ if (pixels != NULL && _fTFace->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
+ tempBuffer = new byte[_fTFace->glyph->bitmap.width * _fTFace->glyph->bitmap.rows];
+ for (int j = 0; j < _fTFace->glyph->bitmap.rows; j++) {
int rowOffset = stride * j;
- for (int i = 0; i < m_FTFace->glyph->bitmap.width; i++) {
+ for (int i = 0; i < _fTFace->glyph->bitmap.width; i++) {
int byteOffset = i / 8;
int bitOffset = 7 - (i % 8);
byte bit = (pixels[rowOffset + byteOffset] & (1 << bitOffset)) >> bitOffset;
- tempBuffer[m_FTFace->glyph->bitmap.width * j + i] = 255 * bit;
+ tempBuffer[_fTFace->glyph->bitmap.width * j + i] = 255 * bit;
}
}
pixels = tempBuffer;
- stride = m_FTFace->glyph->bitmap.width;
+ stride = _fTFace->glyph->bitmap.width;
}
// add glyph to cache
- m_GlyphCache->AddGlyph(ch, glyphIndex, m_FTFace->glyph, m_FTFace->glyph->bitmap.width, m_FTFace->glyph->bitmap.rows, pixels, stride);
+ _glyphCache->AddGlyph(ch, glyphIndex, _fTFace->glyph, _fTFace->glyph->bitmap.width, _fTFace->glyph->bitmap.rows, pixels, stride);
if (tempBuffer) delete [] tempBuffer;
}
diff --git a/engines/wintermute/BFontTT.h b/engines/wintermute/BFontTT.h
index 5675cca5de..9dc3de1920 100644
--- a/engines/wintermute/BFontTT.h
+++ b/engines/wintermute/BFontTT.h
@@ -45,29 +45,29 @@ private:
//////////////////////////////////////////////////////////////////////////
class CBCachedTTFontText {
public:
- WideString m_Text;
- int m_Width;
- TTextAlign m_Align;
- int m_MaxHeight;
- int m_MaxLength;
- CBSurface *m_Surface;
- int m_Priority;
- int m_TextOffset;
- bool m_Marked;
+ WideString _text;
+ int _width;
+ TTextAlign _align;
+ int _maxHeight;
+ int _maxLength;
+ CBSurface *_surface;
+ int _priority;
+ int _textOffset;
+ bool _marked;
CBCachedTTFontText() {
- //m_Text = L"";
- m_Text = "";
- m_Width = m_MaxHeight = m_MaxLength = -1;
- m_Align = TAL_LEFT;
- m_Surface = NULL;
- m_Priority = -1;
- m_TextOffset = 0;
- m_Marked = false;
+ //_text = L"";
+ _text = "";
+ _width = _maxHeight = _maxLength = -1;
+ _align = TAL_LEFT;
+ _surface = NULL;
+ _priority = -1;
+ _textOffset = 0;
+ _marked = false;
}
virtual ~CBCachedTTFontText() {
- if (m_Surface) delete m_Surface;
+ if (_surface) delete _surface;
}
};
@@ -76,39 +76,39 @@ public:
class CBTTFontLayer {
public:
CBTTFontLayer() {
- m_OffsetX = m_OffsetY = 0;
- m_Color = 0x00000000;
+ _offsetX = _offsetY = 0;
+ _color = 0x00000000;
}
HRESULT Persist(CBPersistMgr *PersistMgr) {
- PersistMgr->Transfer(TMEMBER(m_OffsetX));
- PersistMgr->Transfer(TMEMBER(m_OffsetY));
- PersistMgr->Transfer(TMEMBER(m_Color));
+ PersistMgr->Transfer(TMEMBER(_offsetX));
+ PersistMgr->Transfer(TMEMBER(_offsetY));
+ PersistMgr->Transfer(TMEMBER(_color));
return S_OK;
}
- int m_OffsetX;
- int m_OffsetY;
- uint32 m_Color;
+ int _offsetX;
+ int _offsetY;
+ uint32 _color;
};
//////////////////////////////////////////////////////////////////////////
class TextLine {
public:
TextLine(const WideString &text, int width) {
- m_Text = text;
- m_Width = width;
+ _text = text;
+ _width = width;
}
const WideString &GetText() const {
- return m_Text;
+ return _text;
}
int GetWidth() const {
- return m_Width;
+ return _width;
}
private:
- WideString m_Text;
- int m_Width;
+ WideString _text;
+ int _width;
};
typedef Common::List<TextLine *> TextLineList;
@@ -130,11 +130,11 @@ public:
static void FTCloseProc(FT_Stream stream);
FontGlyphCache *GetGlyphCache() {
- return m_GlyphCache;
+ return _glyphCache;
}
float GetLineHeight() const {
- return m_LineHeight;
+ return _lineHeight;
}
void AfterLoad();
@@ -153,34 +153,34 @@ private:
void BlitSurface(SDL_Surface *src, SDL_Surface *target, SDL_Rect *targetRect);
- CBCachedTTFontText *m_CachedTexts[NUM_CACHED_TEXTS];
+ CBCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
HRESULT InitFont();
- FT_Stream m_FTStream;
- FT_Face m_FTFace;
+ FT_Stream _fTStream;
+ FT_Face _fTFace;
- FontGlyphCache *m_GlyphCache;
+ FontGlyphCache *_glyphCache;
- float m_Ascender;
- float m_Descender;
- float m_LineHeight;
- float m_UnderlinePos;
- float m_PointSize;
- float m_VertDpi;
- float m_HorDpi;
+ float _ascender;
+ float _descender;
+ float _lineHeight;
+ float _underlinePos;
+ float _pointSize;
+ float _vertDpi;
+ float _horDpi;
- size_t m_MaxCharWidth;
- size_t m_MaxCharHeight;
+ size_t _maxCharWidth;
+ size_t _maxCharHeight;
public:
- bool m_IsBold;
- bool m_IsItalic;
- bool m_IsUnderline;
- bool m_IsStriked;
- int m_FontHeight;
- char *m_FontFile;
-
- CBArray<CBTTFontLayer *, CBTTFontLayer *> m_Layers;
+ bool _isBold;
+ bool _isItalic;
+ bool _isUnderline;
+ bool _isStriked;
+ int _fontHeight;
+ char *_fontFile;
+
+ CBArray<CBTTFontLayer *, CBTTFontLayer *> _layers;
void ClearCache();
};
diff --git a/engines/wintermute/BFrame.cpp b/engines/wintermute/BFrame.cpp
index 37b263d505..f04b35bfe2 100644
--- a/engines/wintermute/BFrame.cpp
+++ b/engines/wintermute/BFrame.cpp
@@ -46,31 +46,31 @@ IMPLEMENT_PERSISTENT(CBFrame, false)
//////////////////////////////////////////////////////////////////////
CBFrame::CBFrame(CBGame *inGame): CBScriptable(inGame, true) {
- m_Delay = 0;
- m_MoveX = m_MoveY = 0;
+ _delay = 0;
+ _moveX = _moveY = 0;
- m_Sound = NULL;
- m_KillSound = false;
+ _sound = NULL;
+ _killSound = false;
- m_EditorExpanded = false;
- m_Keyframe = false;
+ _editorExpanded = false;
+ _keyframe = false;
}
//////////////////////////////////////////////////////////////////////
CBFrame::~CBFrame() {
- delete m_Sound;
- m_Sound = NULL;
+ delete _sound;
+ _sound = NULL;
int i;
- for (i = 0; i < m_Subframes.GetSize(); i++) delete m_Subframes[i];
- m_Subframes.RemoveAll();
+ for (i = 0; i < _subframes.GetSize(); i++) delete _subframes[i];
+ _subframes.RemoveAll();
- for (i = 0; i < m_ApplyEvent.GetSize(); i++) {
- SAFE_DELETE_ARRAY(m_ApplyEvent[i]);
+ for (i = 0; i < _applyEvent.GetSize(); i++) {
+ SAFE_DELETE_ARRAY(_applyEvent[i]);
}
- m_ApplyEvent.RemoveAll();
+ _applyEvent.RemoveAll();
}
@@ -78,8 +78,8 @@ CBFrame::~CBFrame() {
HRESULT CBFrame::Draw(int X, int Y, CBObject *Register, float ZoomX, float ZoomY, bool Precise, uint32 Alpha, bool AllFrames, float Rotate, TSpriteBlendMode BlendMode) {
HRESULT res;
- for (int i = 0; i < m_Subframes.GetSize(); i++) {
- res = m_Subframes[i]->Draw(X, Y, Register, ZoomX, ZoomY, Precise, Alpha, Rotate, BlendMode);
+ for (int i = 0; i < _subframes.GetSize(); i++) {
+ res = _subframes[i]->Draw(X, Y, Register, ZoomX, ZoomY, Precise, Alpha, Rotate, BlendMode);
if (FAILED(res)) return res;
}
return S_OK;
@@ -88,19 +88,19 @@ HRESULT CBFrame::Draw(int X, int Y, CBObject *Register, float ZoomX, float ZoomY
//////////////////////////////////////////////////////////////////////////
HRESULT CBFrame::OneTimeDisplay(CBObject *Owner, bool Muted) {
- if (m_Sound && !Muted) {
- if (Owner) Owner->UpdateOneSound(m_Sound);
- m_Sound->Play();
+ if (_sound && !Muted) {
+ if (Owner) Owner->UpdateOneSound(_sound);
+ _sound->Play();
/*
- if(Game->m_State==GAME_FROZEN)
+ if(Game->_state==GAME_FROZEN)
{
- m_Sound->Pause(true);
+ _sound->Pause(true);
}
*/
}
if (Owner) {
- for (int i = 0; i < m_ApplyEvent.GetSize(); i++) {
- Owner->ApplyEvent(m_ApplyEvent[i]);
+ for (int i = 0; i < _applyEvent.GetSize(); i++) {
+ Owner->ApplyEvent(_applyEvent[i]);
}
}
return S_OK;
@@ -164,7 +164,7 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
int HotspotX = 0, HotspotY = 0;
- bool custom_trans = false;
+ bool custo_trans = false;
bool editor_selected = false;
bool Is2DOnly = false;
bool Is3DOnly = false;
@@ -177,7 +177,7 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
while ((cmd = parser.GetCommand((char **)&Buffer, commands, &params)) > 0) {
switch (cmd) {
case TOKEN_DELAY:
- parser.ScanStr(params, "%d", &m_Delay);
+ parser.ScanStr(params, "%d", &_delay);
break;
case TOKEN_IMAGE:
@@ -186,7 +186,7 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
case TOKEN_TRANSPARENT:
parser.ScanStr(params, "%d,%d,%d", &r, &g, &b);
- custom_trans = true;
+ custo_trans = true;
break;
case TOKEN_RECT:
@@ -198,7 +198,7 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
break;
case TOKEN_MOVE:
- parser.ScanStr(params, "%d,%d", &m_MoveX, &m_MoveY);
+ parser.ScanStr(params, "%d,%d", &_moveX, &_moveY);
break;
case TOKEN_2D_ONLY:
@@ -230,11 +230,11 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
break;
case TOKEN_EDITOR_EXPANDED:
- parser.ScanStr(params, "%b", &m_EditorExpanded);
+ parser.ScanStr(params, "%b", &_editorExpanded);
break;
case TOKEN_KILL_SOUND:
- parser.ScanStr(params, "%b", &m_KillSound);
+ parser.ScanStr(params, "%b", &_killSound);
break;
case TOKEN_SUBFRAME: {
@@ -242,20 +242,20 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
if (!subframe || FAILED(subframe->LoadBuffer((byte *)params, LifeTime, KeepLoaded))) {
delete subframe;
cmd = PARSERR_GENERIC;
- } else m_Subframes.Add(subframe);
+ } else _subframes.Add(subframe);
}
break;
case TOKEN_SOUND: {
- if (m_Sound) {
- delete m_Sound;
- m_Sound = NULL;
+ if (_sound) {
+ delete _sound;
+ _sound = NULL;
}
- m_Sound = new CBSound(Game);
- if (!m_Sound || FAILED(m_Sound->SetSound(params, SOUND_SFX, false))) {
- if (Game->m_SoundMgr->m_SoundAvailable) Game->LOG(0, "Error loading sound '%s'.", params);
- delete m_Sound;
- m_Sound = NULL;
+ _sound = new CBSound(Game);
+ if (!_sound || FAILED(_sound->SetSound(params, SOUND_SFX, false))) {
+ if (Game->_soundMgr->_soundAvailable) Game->LOG(0, "Error loading sound '%s'.", params);
+ delete _sound;
+ _sound = NULL;
}
}
break;
@@ -263,12 +263,12 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
case TOKEN_APPLY_EVENT: {
char *Event = new char[strlen(params) + 1];
strcpy(Event, params);
- m_ApplyEvent.Add(Event);
+ _applyEvent.Add(Event);
}
break;
case TOKEN_KEYFRAME:
- parser.ScanStr(params, "%b", &m_Keyframe);
+ parser.ScanStr(params, "%b", &_keyframe);
break;
case TOKEN_DECORATION:
@@ -293,33 +293,33 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
CBSubFrame *sub = new CBSubFrame(Game);
if (surface_file != NULL) {
- if (custom_trans) sub->SetSurface(surface_file, false, r, g, b, LifeTime, KeepLoaded);
+ if (custo_trans) sub->SetSurface(surface_file, false, r, g, b, LifeTime, KeepLoaded);
else sub->SetSurface(surface_file, true, 0, 0, 0, LifeTime, KeepLoaded);
- if (!sub->m_Surface) {
+ if (!sub->_surface) {
delete sub;
Game->LOG(0, "Error loading SUBFRAME");
return E_FAIL;
}
- sub->m_Alpha = DRGBA(ar, ag, ab, alpha);
- if (custom_trans) sub->m_Transparent = DRGBA(r, g, b, 0xFF);
+ sub->_alpha = DRGBA(ar, ag, ab, alpha);
+ if (custo_trans) sub->_transparent = DRGBA(r, g, b, 0xFF);
}
if (CBPlatform::IsRectEmpty(&rect)) sub->SetDefaultRect();
- else sub->m_Rect = rect;
+ else sub->_rect = rect;
- sub->m_HotspotX = HotspotX;
- sub->m_HotspotY = HotspotY;
- sub->m_2DOnly = Is2DOnly;
- sub->m_3DOnly = Is3DOnly;
- sub->m_Decoration = Decoration;
- sub->m_MirrorX = MirrorX;
- sub->m_MirrorY = MirrorY;
+ sub->_hotspotX = HotspotX;
+ sub->_hotspotY = HotspotY;
+ sub->_2DOnly = Is2DOnly;
+ sub->_3DOnly = Is3DOnly;
+ sub->_decoration = Decoration;
+ sub->_mirrorX = MirrorX;
+ sub->_mirrorY = MirrorY;
- sub->m_EditorSelected = editor_selected;
- m_Subframes.InsertAt(0, sub);
+ sub->_editorSelected = editor_selected;
+ _subframes.InsertAt(0, sub);
return S_OK;
}
@@ -332,8 +332,8 @@ bool CBFrame::GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float Sca
RECT SubRect;
- for (int i = 0; i < m_Subframes.GetSize(); i++) {
- m_Subframes[i]->GetBoundingRect(&SubRect, X, Y, ScaleX, ScaleY);
+ for (int i = 0; i < _subframes.GetSize(); i++) {
+ _subframes[i]->GetBoundingRect(&SubRect, X, Y, ScaleX, ScaleY);
CBPlatform::UnionRect(Rect, Rect, &SubRect);
}
return true;
@@ -344,31 +344,31 @@ bool CBFrame::GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float Sca
//////////////////////////////////////////////////////////////////////////
HRESULT CBFrame::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "FRAME {\n");
- Buffer->PutTextIndent(Indent + 2, "DELAY = %d\n", m_Delay);
+ Buffer->PutTextIndent(Indent + 2, "DELAY = %d\n", _delay);
- if (m_MoveX != 0 || m_MoveY != 0)
- Buffer->PutTextIndent(Indent + 2, "MOVE {%d, %d}\n", m_MoveX, m_MoveY);
+ if (_moveX != 0 || _moveY != 0)
+ Buffer->PutTextIndent(Indent + 2, "MOVE {%d, %d}\n", _moveX, _moveY);
- if (m_Sound && m_Sound->m_SoundFilename)
- Buffer->PutTextIndent(Indent + 2, "SOUND=\"%s\"\n", m_Sound->m_SoundFilename);
+ if (_sound && _sound->_soundFilename)
+ Buffer->PutTextIndent(Indent + 2, "SOUND=\"%s\"\n", _sound->_soundFilename);
- Buffer->PutTextIndent(Indent + 2, "KEYFRAME=%s\n", m_Keyframe ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "KEYFRAME=%s\n", _keyframe ? "TRUE" : "FALSE");
- if (m_KillSound)
- Buffer->PutTextIndent(Indent + 2, "KILL_SOUND=%s\n", m_KillSound ? "TRUE" : "FALSE");
+ if (_killSound)
+ Buffer->PutTextIndent(Indent + 2, "KILL_SOUND=%s\n", _killSound ? "TRUE" : "FALSE");
- if (m_EditorExpanded)
- Buffer->PutTextIndent(Indent + 2, "EDITOR_EXPANDED=%s\n", m_EditorExpanded ? "TRUE" : "FALSE");
+ if (_editorExpanded)
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_EXPANDED=%s\n", _editorExpanded ? "TRUE" : "FALSE");
- if (m_Subframes.GetSize() > 0) m_Subframes[0]->SaveAsText(Buffer, Indent, false);
+ if (_subframes.GetSize() > 0) _subframes[0]->SaveAsText(Buffer, Indent, false);
int i;
- for (i = 1; i < m_Subframes.GetSize(); i++) {
- m_Subframes[i]->SaveAsText(Buffer, Indent + 2);
+ for (i = 1; i < _subframes.GetSize(); i++) {
+ _subframes[i]->SaveAsText(Buffer, Indent + 2);
}
- for (i = 0; i < m_ApplyEvent.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "APPLY_EVENT=\"%s\"\n", m_ApplyEvent[i]);
+ for (i = 0; i < _applyEvent.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "APPLY_EVENT=\"%s\"\n", _applyEvent[i]);
}
CBBase::SaveAsText(Buffer, Indent + 2);
@@ -384,15 +384,15 @@ HRESULT CBFrame::SaveAsText(CBDynBuffer *Buffer, int Indent) {
HRESULT CBFrame::Persist(CBPersistMgr *PersistMgr) {
CBScriptable::Persist(PersistMgr);
- m_ApplyEvent.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Delay));
- PersistMgr->Transfer(TMEMBER(m_EditorExpanded));
- PersistMgr->Transfer(TMEMBER(m_Keyframe));
- PersistMgr->Transfer(TMEMBER(m_KillSound));
- PersistMgr->Transfer(TMEMBER(m_MoveX));
- PersistMgr->Transfer(TMEMBER(m_MoveY));
- PersistMgr->Transfer(TMEMBER(m_Sound));
- m_Subframes.Persist(PersistMgr);
+ _applyEvent.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_delay));
+ PersistMgr->Transfer(TMEMBER(_editorExpanded));
+ PersistMgr->Transfer(TMEMBER(_keyframe));
+ PersistMgr->Transfer(TMEMBER(_killSound));
+ PersistMgr->Transfer(TMEMBER(_moveX));
+ PersistMgr->Transfer(TMEMBER(_moveY));
+ PersistMgr->Transfer(TMEMBER(_sound));
+ _subframes.Persist(PersistMgr);
return S_OK;
}
@@ -409,7 +409,7 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
if (strcmp(Name, "GetSound") == 0) {
Stack->CorrectParams(0);
- if (m_Sound && m_Sound->m_SoundFilename) Stack->PushString(m_Sound->m_SoundFilename);
+ if (_sound && _sound->_soundFilename) Stack->PushString(_sound->_soundFilename);
else Stack->PushNULL();
return S_OK;
}
@@ -420,15 +420,15 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
if (strcmp(Name, "SetSound") == 0) {
Stack->CorrectParams(1);
CScValue *Val = Stack->Pop();
- delete m_Sound;
- m_Sound = NULL;
+ delete _sound;
+ _sound = NULL;
if (!Val->IsNULL()) {
- m_Sound = new CBSound(Game);
- if (!m_Sound || FAILED(m_Sound->SetSound(Val->GetString(), SOUND_SFX, false))) {
+ _sound = new CBSound(Game);
+ if (!_sound || FAILED(_sound->SetSound(Val->GetString(), SOUND_SFX, false))) {
Stack->PushBool(false);
- delete m_Sound;
- m_Sound = NULL;
+ delete _sound;
+ _sound = NULL;
} else Stack->PushBool(true);
} else Stack->PushBool(true);
return S_OK;
@@ -440,10 +440,10 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
if (strcmp(Name, "GetSubframe") == 0) {
Stack->CorrectParams(1);
int Index = Stack->Pop()->GetInt(-1);
- if (Index < 0 || Index >= m_Subframes.GetSize()) {
+ if (Index < 0 || Index >= _subframes.GetSize()) {
Script->RuntimeError("Frame.GetSubframe: Subframe index %d is out of range.", Index);
Stack->PushNULL();
- } else Stack->PushNative(m_Subframes[Index], true);
+ } else Stack->PushNative(_subframes[Index], true);
return S_OK;
}
@@ -456,15 +456,15 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
CScValue *Val = Stack->Pop();
if (Val->IsInt()) {
int Index = Val->GetInt(-1);
- if (Index < 0 || Index >= m_Subframes.GetSize()) {
+ if (Index < 0 || Index >= _subframes.GetSize()) {
Script->RuntimeError("Frame.DeleteSubframe: Subframe index %d is out of range.", Index);
}
} else {
CBSubFrame *Sub = (CBSubFrame *)Val->GetNative();
- for (int i = 0; i < m_Subframes.GetSize(); i++) {
- if (m_Subframes[i] == Sub) {
- delete m_Subframes[i];
- m_Subframes.RemoveAt(i);
+ for (int i = 0; i < _subframes.GetSize(); i++) {
+ if (_subframes[i] == Sub) {
+ delete _subframes[i];
+ _subframes.RemoveAt(i);
break;
}
}
@@ -487,7 +487,7 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Sub->SetSurface(Filename);
Sub->SetDefaultRect();
}
- m_Subframes.Add(Sub);
+ _subframes.Add(Sub);
Stack->PushNative(Sub, true);
return S_OK;
@@ -510,8 +510,8 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Sub->SetSurface(Filename);
}
- if (Index >= m_Subframes.GetSize()) m_Subframes.Add(Sub);
- else m_Subframes.InsertAt(Index, Sub);
+ if (Index >= _subframes.GetSize()) _subframes.Add(Sub);
+ else _subframes.InsertAt(Index, Sub);
Stack->PushNative(Sub, true);
return S_OK;
@@ -523,10 +523,10 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "GetSubframe") == 0) {
Stack->CorrectParams(1);
int Index = Stack->Pop()->GetInt(-1);
- if (Index < 0 || Index >= m_ApplyEvent.GetSize()) {
+ if (Index < 0 || Index >= _applyEvent.GetSize()) {
Script->RuntimeError("Frame.GetEvent: Event index %d is out of range.", Index);
Stack->PushNULL();
- } else Stack->PushString(m_ApplyEvent[Index]);
+ } else Stack->PushString(_applyEvent[Index]);
return S_OK;
}
@@ -536,13 +536,13 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "AddEvent") == 0) {
Stack->CorrectParams(1);
char *Event = Stack->Pop()->GetString();
- for (int i = 0; i < m_ApplyEvent.GetSize(); i++) {
- if (scumm_stricmp(m_ApplyEvent[i], Event) == 0) {
+ for (int i = 0; i < _applyEvent.GetSize(); i++) {
+ if (scumm_stricmp(_applyEvent[i], Event) == 0) {
Stack->PushNULL();
return S_OK;
}
}
- m_ApplyEvent.Add(Event);
+ _applyEvent.Add(Event);
Stack->PushNULL();
return S_OK;
}
@@ -553,10 +553,10 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "DeleteEvent") == 0) {
Stack->CorrectParams(1);
char *Event = Stack->Pop()->GetString();
- for (int i = 0; i < m_ApplyEvent.GetSize(); i++) {
- if (scumm_stricmp(m_ApplyEvent[i], Event) == 0) {
- delete [] m_ApplyEvent[i];
- m_ApplyEvent.RemoveAt(i);
+ for (int i = 0; i < _applyEvent.GetSize(); i++) {
+ if (scumm_stricmp(_applyEvent[i], Event) == 0) {
+ delete [] _applyEvent[i];
+ _applyEvent.RemoveAt(i);
break;
}
}
@@ -566,7 +566,7 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else {
- if (m_Subframes.GetSize() == 1) return m_Subframes[0]->ScCallMethod(Script, Stack, ThisStack, Name);
+ if (_subframes.GetSize() == 1) return _subframes[0]->ScCallMethod(Script, Stack, ThisStack, Name);
else return CBScriptable::ScCallMethod(Script, Stack, ThisStack, Name);
}
}
@@ -574,76 +574,76 @@ HRESULT CBFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
CScValue *CBFrame::ScGetProperty(char *Name) {
- if (!m_ScValue) m_ScValue = new CScValue(Game);
- m_ScValue->SetNULL();
+ if (!_scValue) _scValue = new CScValue(Game);
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("frame");
- return m_ScValue;
+ _scValue->SetString("frame");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Delay
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Delay") == 0) {
- m_ScValue->SetInt(m_Delay);
- return m_ScValue;
+ _scValue->SetInt(_delay);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Keyframe
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Keyframe") == 0) {
- m_ScValue->SetBool(m_Keyframe);
- return m_ScValue;
+ _scValue->SetBool(_keyframe);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// KillSounds
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "KillSounds") == 0) {
- m_ScValue->SetBool(m_KillSound);
- return m_ScValue;
+ _scValue->SetBool(_killSound);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MoveX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MoveX") == 0) {
- m_ScValue->SetInt(m_MoveX);
- return m_ScValue;
+ _scValue->SetInt(_moveX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MoveY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MoveY") == 0) {
- m_ScValue->SetInt(m_MoveY);
- return m_ScValue;
+ _scValue->SetInt(_moveY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumSubframes (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumSubframes") == 0) {
- m_ScValue->SetInt(m_Subframes.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_subframes.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumEvents (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumEvents") == 0) {
- m_ScValue->SetInt(m_ApplyEvent.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_applyEvent.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
else {
- if (m_Subframes.GetSize() == 1) return m_Subframes[0]->ScGetProperty(Name);
+ if (_subframes.GetSize() == 1) return _subframes[0]->ScGetProperty(Name);
else return CBScriptable::ScGetProperty(Name);
}
}
@@ -655,7 +655,7 @@ HRESULT CBFrame::ScSetProperty(char *Name, CScValue *Value) {
// Delay
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Delay") == 0) {
- m_Delay = MAX(0, Value->GetInt());
+ _delay = MAX(0, Value->GetInt());
return S_OK;
}
@@ -663,7 +663,7 @@ HRESULT CBFrame::ScSetProperty(char *Name, CScValue *Value) {
// Keyframe
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Keyframe") == 0) {
- m_Keyframe = Value->GetBool();
+ _keyframe = Value->GetBool();
return S_OK;
}
@@ -671,7 +671,7 @@ HRESULT CBFrame::ScSetProperty(char *Name, CScValue *Value) {
// KillSounds
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "KillSounds") == 0) {
- m_KillSound = Value->GetBool();
+ _killSound = Value->GetBool();
return S_OK;
}
@@ -679,7 +679,7 @@ HRESULT CBFrame::ScSetProperty(char *Name, CScValue *Value) {
// MoveX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MoveX") == 0) {
- m_MoveX = Value->GetInt();
+ _moveX = Value->GetInt();
return S_OK;
}
@@ -687,13 +687,13 @@ HRESULT CBFrame::ScSetProperty(char *Name, CScValue *Value) {
// MoveY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MoveY") == 0) {
- m_MoveY = Value->GetInt();
+ _moveY = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
else {
- if (m_Subframes.GetSize() == 1) return m_Subframes[0]->ScSetProperty(Name, Value);
+ if (_subframes.GetSize() == 1) return _subframes[0]->ScSetProperty(Name, Value);
else return CBScriptable::ScSetProperty(Name, Value);
}
}
diff --git a/engines/wintermute/BFrame.h b/engines/wintermute/BFrame.h
index 9538305dd6..90a7c1b192 100644
--- a/engines/wintermute/BFrame.h
+++ b/engines/wintermute/BFrame.h
@@ -40,25 +40,25 @@ class CScScript;
class CScStack;
class CBFrame: public CBScriptable {
public:
- bool m_KillSound;
- bool m_Keyframe;
+ bool _killSound;
+ bool _keyframe;
HRESULT OneTimeDisplay(CBObject *Owner, bool Muted = false);
DECLARE_PERSISTENT(CBFrame, CBScriptable)
- CBSound *m_Sound;
- bool m_EditorExpanded;
+ CBSound *_sound;
+ bool _editorExpanded;
bool GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX = 100, float ScaleY = 100);
HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
- int m_MoveY;
- int m_MoveX;
- uint32 m_Delay;
- CBArray<CBSubFrame *, CBSubFrame *> m_Subframes;
+ int _moveY;
+ int _moveX;
+ 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);
CBFrame(CBGame *inGame);
virtual ~CBFrame();
- CBArray<char *, char *> m_ApplyEvent;
+ CBArray<char *, char *> _applyEvent;
// scripting interface
virtual CScValue *ScGetProperty(char *Name);
diff --git a/engines/wintermute/BGame.cpp b/engines/wintermute/BGame.cpp
index 5cc048b48d..7e2c0d316c 100644
--- a/engines/wintermute/BGame.cpp
+++ b/engines/wintermute/BGame.cpp
@@ -85,253 +85,253 @@ IMPLEMENT_PERSISTENT(CBGame, true)
//////////////////////////////////////////////////////////////////////
CBGame::CBGame(): CBObject(this) {
- m_ShuttingDown = false;
+ _shuttingDown = false;
- m_State = GAME_RUNNING;
- m_OrigState = GAME_RUNNING;
- m_FreezeLevel = 0;
+ _state = GAME_RUNNING;
+ _origState = GAME_RUNNING;
+ _freezeLevel = 0;
- m_Interactive = true;
- m_OrigInteractive = false;
+ _interactive = true;
+ _origInteractive = false;
- m_SurfaceStorage = NULL;
- m_FontStorage = NULL;
- m_Renderer = NULL;
- m_SoundMgr = NULL;
- m_FileManager = NULL;
- m_TransMgr = NULL;
- m_DebugMgr = NULL;
- m_ScEngine = NULL;
- m_KeyboardState = NULL;
+ _surfaceStorage = NULL;
+ _fontStorage = NULL;
+ _renderer = NULL;
+ _soundMgr = NULL;
+ _fileManager = NULL;
+ _transMgr = NULL;
+ _debugMgr = NULL;
+ _scEngine = NULL;
+ _keyboardState = NULL;
- m_MathClass = NULL;
+ _mathClass = NULL;
- m_DEBUG_LogFile = NULL;
- m_DEBUG_DebugMode = false;
- m_DEBUG_AbsolutePathWarning = true;
- m_DEBUG_ShowFPS = false;
+ _dEBUG_LogFile = NULL;
+ _dEBUG_DebugMode = false;
+ _dEBUG_AbsolutePathWarning = true;
+ _dEBUG_ShowFPS = false;
- m_SystemFont = NULL;
- m_VideoFont = NULL;
+ _systemFont = NULL;
+ _videoFont = NULL;
- m_MainObject = NULL;
- m_ActiveObject = NULL;
+ _mainObject = NULL;
+ _activeObject = NULL;
- m_Fader = NULL;
+ _fader = NULL;
- m_OffsetX = m_OffsetY = 0;
- m_OffsetPercentX = m_OffsetPercentY = 0.0f;
+ _offsetX = _offsetY = 0;
+ _offsetPercentX = _offsetPercentY = 0.0f;
- m_Subtitles = true;
- m_VideoSubtitles = true;
+ _subtitles = true;
+ _videoSubtitles = true;
- m_Timer = 0;
- m_TimerDelta = 0;
- m_TimerLast = 0;
+ _timer = 0;
+ _timerDelta = 0;
+ _timerLast = 0;
- m_LiveTimer = 0;
- m_LiveTimerDelta = 0;
- m_LiveTimerLast = 0;
+ _liveTimer = 0;
+ _liveTimerDelta = 0;
+ _liveTimerLast = 0;
- m_Sequence = 0;
+ _sequence = 0;
- m_MousePos.x = m_MousePos.y = 0;
- m_MouseLeftDown = m_MouseRightDown = m_MouseMidlleDown = false;
- m_CapturedObject = NULL;
+ _mousePos.x = _mousePos.y = 0;
+ _mouseLeftDown = _mouseRightDown = _mouseMidlleDown = false;
+ _capturedObject = NULL;
// FPS counters
- m_LastTime = m_FpsTime = m_DeltaTime = m_FramesRendered = m_Fps = 0;
+ _lastTime = _fpsTime = _deltaTime = _framesRendered = _fps = 0;
- m_CursorNoninteractive = NULL;
+ _cursorNoninteractive = NULL;
- m_UseD3D = false;
+ _useD3D = false;
srand((unsigned)time(NULL));
- m_Registry = new CBRegistry(this);
- m_StringTable = new CBStringTable(this);
+ _registry = new CBRegistry(this);
+ _stringTable = new CBStringTable(this);
for (int i = 0; i < NUM_MUSIC_CHANNELS; i++) {
- m_Music[i] = NULL;
- m_MusicStartTime[i] = 0;
+ _music[i] = NULL;
+ _musicStartTime[i] = 0;
}
- m_SettingsResWidth = 800;
- m_SettingsResHeight = 600;
- m_SettingsRequireAcceleration = false;
- m_SettingsRequireSound = false;
- m_SettingsTLMode = 0;
- m_SettingsAllowWindowed = true;
- m_SettingsGameFile = NULL;
- m_SettingsAllowAdvanced = false;
- m_SettingsAllowAccessTab = true;
- m_SettingsAllowAboutTab = true;
- m_SettingsAllowDesktopRes = false;
+ _settingsResWidth = 800;
+ _settingsResHeight = 600;
+ _settingsRequireAcceleration = false;
+ _settingsRequireSound = false;
+ _settingsTLMode = 0;
+ _settingsAllowWindowed = true;
+ _settingsGameFile = NULL;
+ _settingsAllowAdvanced = false;
+ _settingsAllowAccessTab = true;
+ _settingsAllowAboutTab = true;
+ _settingsAllowDesktopRes = false;
- m_EditorForceScripts = false;
- m_EditorAlwaysRegister = false;
+ _editorForceScripts = false;
+ _editorAlwaysRegister = false;
- m_FocusedWindow = NULL;
+ _focusedWindow = NULL;
- m_LoadInProgress = false;
+ _loadInProgress = false;
- m_Quitting = false;
- m_Loading = false;
- m_ScheduledLoadSlot = -1;
+ _quitting = false;
+ _loading = false;
+ _scheduledLoadSlot = -1;
- m_PersonalizedSave = false;
- m_CompressedSavegames = true;
+ _personalizedSave = false;
+ _compressedSavegames = true;
- m_EditorMode = false;
- m_DoNotExpandStrings = false;
+ _editorMode = false;
+ _doNotExpandStrings = false;
- m_EngineLogCallback = NULL;
- m_EngineLogCallbackData = NULL;
+ _engineLogCallback = NULL;
+ _engineLogCallbackData = NULL;
- m_SmartCache = false;
- m_SurfaceGCCycleTime = 10000;
+ _smartCache = false;
+ _surfaceGCCycleTime = 10000;
- m_ReportTextureFormat = false;
+ _reportTextureFormat = false;
- m_ViewportSP = -1;
+ _viewportSP = -1;
- m_SubtitlesSpeed = 70;
+ _subtitlesSpeed = 70;
- m_ResourceModule = NULL;
+ _resourceModule = NULL;
- m_ForceNonStreamedSounds = false;
+ _forceNonStreamedSounds = false;
- m_ThumbnailWidth = m_ThumbnailHeight = 0;
+ _thumbnailWidth = _thumbnailHeight = 0;
- m_IndicatorDisplay = false;
- m_IndicatorColor = DRGBA(255, 0, 0, 128);
- m_IndicatorProgress = 0;
- m_IndicatorX = -1;
- m_IndicatorY = -1;
- m_IndicatorWidth = -1;
- m_IndicatorHeight = 8;
- m_RichSavedGames = false;
- m_SavedGameExt = NULL;
- CBUtils::SetString(&m_SavedGameExt, "dsv");
+ _indicatorDisplay = false;
+ _indicatorColor = DRGBA(255, 0, 0, 128);
+ _indicatorProgress = 0;
+ _indicatorX = -1;
+ _indicatorY = -1;
+ _indicatorWidth = -1;
+ _indicatorHeight = 8;
+ _richSavedGames = false;
+ _savedGameExt = NULL;
+ CBUtils::SetString(&_savedGameExt, "dsv");
- m_MusicCrossfadeRunning = false;
- m_MusicCrossfadeStartTime = 0;
- m_MusicCrossfadeLength = 0;
- m_MusicCrossfadeChannel1 = -1;
- m_MusicCrossfadeChannel2 = -1;
- m_MusicCrossfadeSwap = false;
+ _musicCrossfadeRunning = false;
+ _musicCrossfadeStartTime = 0;
+ _musicCrossfadeLength = 0;
+ _musicCrossfadeChannel1 = -1;
+ _musicCrossfadeChannel2 = -1;
+ _musicCrossfadeSwap = false;
- m_LoadImageName = NULL;
- m_SaveImageName = NULL;
- m_SaveLoadImage = NULL;
+ _loadImageName = NULL;
+ _saveImageName = NULL;
+ _saveLoadImage = NULL;
- m_SaveImageX = m_SaveImageY = 0;
- m_LoadImageX = m_LoadImageY = 0;
+ _saveImageX = _saveImageY = 0;
+ _loadImageX = _loadImageY = 0;
- m_LocalSaveDir = NULL;
- CBUtils::SetString(&m_LocalSaveDir, "saves");
- m_SaveDirChecked = false;
+ _localSaveDir = NULL;
+ CBUtils::SetString(&_localSaveDir, "saves");
+ _saveDirChecked = false;
- m_LoadingIcon = NULL;
- m_LoadingIconX = m_LoadingIconY = 0;
- m_LoadingIconPersistent = false;
+ _loadingIcon = NULL;
+ _loadingIconX = _loadingIconY = 0;
+ _loadingIconPersistent = false;
- m_TextEncoding = TEXT_ANSI;
- m_TextRTL = false;
+ _textEncoding = TEXT_ANSI;
+ _textRTL = false;
- m_SoundBufferSizeSec = 3;
- m_SuspendedRendering = false;
+ _soundBufferSizeSec = 3;
+ _suspendedRendering = false;
- m_LastCursor = NULL;
+ _lastCursor = NULL;
- CBPlatform::SetRectEmpty(&m_MouseLockRect);
+ CBPlatform::SetRectEmpty(&_mouseLockRect);
- m_SuppressScriptErrors = false;
- m_LastMiniUpdate = 0;
- m_MiniUpdateEnabled = false;
+ _suppressScriptErrors = false;
+ _lastMiniUpdate = 0;
+ _miniUpdateEnabled = false;
- m_CachedThumbnail = NULL;
+ _cachedThumbnail = NULL;
- m_AutorunDisabled = false;
+ _autorunDisabled = false;
// compatibility bits
- m_CompatKillMethodThreads = false;
+ _compatKillMethodThreads = false;
- m_UsedMem = 0;
+ _usedMem = 0;
- m_AutoSaveOnExit = true;
- m_AutoSaveSlot = 999;
- m_CursorHidden = false;
+ _autoSaveOnExit = true;
+ _autoSaveSlot = 999;
+ _cursorHidden = false;
#ifdef __IPHONEOS__
- m_TouchInterface = true;
- m_ConstrainedMemory = true; // TODO differentiate old and new iOS devices
+ _touchInterface = true;
+ _constrainedMemory = true; // TODO differentiate old and new iOS devices
#else
- m_TouchInterface = false;
- m_ConstrainedMemory = false;
+ _touchInterface = false;
+ _constrainedMemory = false;
#endif
- m_Store = NULL;
+ _store = NULL;
}
//////////////////////////////////////////////////////////////////////
CBGame::~CBGame() {
- m_ShuttingDown = true;
+ _shuttingDown = true;
LOG(0, "");
LOG(0, "Shutting down...");
GetDebugMgr()->OnGameShutdown();
- m_Registry->WriteBool("System", "LastRun", true);
+ _registry->WriteBool("System", "LastRun", true);
Cleanup();
- delete[] m_LocalSaveDir;
- delete[] m_SettingsGameFile;
- delete[] m_SavedGameExt;
+ delete[] _localSaveDir;
+ delete[] _settingsGameFile;
+ delete[] _savedGameExt;
- delete m_CachedThumbnail;
+ delete _cachedThumbnail;
- delete m_SaveLoadImage;
- delete m_MathClass;
+ delete _saveLoadImage;
+ delete _mathClass;
- delete m_TransMgr;
- delete m_ScEngine;
- delete m_FontStorage;
- delete m_SurfaceStorage;
- delete m_SoundMgr;
- delete m_DebugMgr;
- //SAFE_DELETE(m_KeyboardState);
+ delete _transMgr;
+ delete _scEngine;
+ delete _fontStorage;
+ delete _surfaceStorage;
+ delete _soundMgr;
+ delete _debugMgr;
+ //SAFE_DELETE(_keyboardState);
- delete m_Renderer;
- delete m_FileManager;
- delete m_Registry;
- delete m_StringTable;
+ delete _renderer;
+ delete _fileManager;
+ delete _registry;
+ delete _stringTable;
- m_LocalSaveDir = NULL;
- m_SettingsGameFile = NULL;
- m_SavedGameExt = NULL;
+ _localSaveDir = NULL;
+ _settingsGameFile = NULL;
+ _savedGameExt = NULL;
- m_CachedThumbnail = NULL;
+ _cachedThumbnail = NULL;
- m_SaveLoadImage = NULL;
- m_MathClass = NULL;
+ _saveLoadImage = NULL;
+ _mathClass = NULL;
- m_TransMgr = NULL;
- m_ScEngine = NULL;
- m_FontStorage = NULL;
- m_SurfaceStorage = NULL;
- m_SoundMgr = NULL;
- m_DebugMgr = NULL;
-
- m_Renderer = NULL;
- m_FileManager = NULL;
- m_Registry = NULL;
- m_StringTable = NULL;
+ _transMgr = NULL;
+ _scEngine = NULL;
+ _fontStorage = NULL;
+ _surfaceStorage = NULL;
+ _soundMgr = NULL;
+ _debugMgr = NULL;
+
+ _renderer = NULL;
+ _fileManager = NULL;
+ _registry = NULL;
+ _stringTable = NULL;
DEBUG_DebugDisable();
CBPlatform::OutputDebugString("--- shutting down normally ---\n");
@@ -342,81 +342,81 @@ CBGame::~CBGame() {
HRESULT CBGame::Cleanup() {
int i;
- delete m_LoadingIcon;
- m_LoadingIcon = NULL;
+ delete _loadingIcon;
+ _loadingIcon = NULL;
- m_EngineLogCallback = NULL;
- m_EngineLogCallbackData = NULL;
+ _engineLogCallback = NULL;
+ _engineLogCallbackData = NULL;
for (i = 0; i < NUM_MUSIC_CHANNELS; i++) {
- delete m_Music[i];
- m_Music[i] = NULL;
- m_MusicStartTime[i] = 0;
+ delete _music[i];
+ _music[i] = NULL;
+ _musicStartTime[i] = 0;
}
- UnregisterObject(m_Store);
- m_Store = NULL;
+ UnregisterObject(_store);
+ _store = NULL;
- UnregisterObject(m_Fader);
- m_Fader = NULL;
+ UnregisterObject(_fader);
+ _fader = NULL;
- for (i = 0; i < m_RegObjects.GetSize(); i++) {
- delete m_RegObjects[i];
- m_RegObjects[i] = NULL;
+ for (i = 0; i < _regObjects.GetSize(); i++) {
+ delete _regObjects[i];
+ _regObjects[i] = NULL;
}
- m_RegObjects.RemoveAll();
+ _regObjects.RemoveAll();
- m_Windows.RemoveAll(); // refs only
- m_FocusedWindow = NULL; // ref only
+ _windows.RemoveAll(); // refs only
+ _focusedWindow = NULL; // ref only
- delete[] m_SaveImageName;
- delete[] m_LoadImageName;
- m_SaveImageName = NULL;
- m_LoadImageName = NULL;
+ delete[] _saveImageName;
+ delete[] _loadImageName;
+ _saveImageName = NULL;
+ _loadImageName = NULL;
- delete m_CursorNoninteractive;
- delete m_Cursor;
- delete m_ActiveCursor;
- m_CursorNoninteractive = NULL;
- m_Cursor = NULL;
- m_ActiveCursor = NULL;
+ delete _cursorNoninteractive;
+ delete _cursor;
+ delete _activeCursor;
+ _cursorNoninteractive = NULL;
+ _cursor = NULL;
+ _activeCursor = NULL;
- delete m_ScValue;
- delete m_SFX;
- m_ScValue = NULL;
- m_SFX = NULL;
+ delete _scValue;
+ delete _sFX;
+ _scValue = NULL;
+ _sFX = NULL;
- for (i = 0; i < m_Scripts.GetSize(); i++) {
- m_Scripts[i]->m_Owner = NULL;
- m_Scripts[i]->Finish();
+ for (i = 0; i < _scripts.GetSize(); i++) {
+ _scripts[i]->_owner = NULL;
+ _scripts[i]->Finish();
}
- m_Scripts.RemoveAll();
+ _scripts.RemoveAll();
- m_FontStorage->RemoveFont(m_SystemFont);
- m_SystemFont = NULL;
+ _fontStorage->RemoveFont(_systemFont);
+ _systemFont = NULL;
- m_FontStorage->RemoveFont(m_VideoFont);
- m_VideoFont = NULL;
+ _fontStorage->RemoveFont(_videoFont);
+ _videoFont = NULL;
- for (i = 0; i < m_QuickMessages.GetSize(); i++) delete m_QuickMessages[i];
- m_QuickMessages.RemoveAll();
+ for (i = 0; i < _quickMessages.GetSize(); i++) delete _quickMessages[i];
+ _quickMessages.RemoveAll();
- m_ViewportStack.RemoveAll();
- m_ViewportSP = -1;
+ _viewportStack.RemoveAll();
+ _viewportSP = -1;
- delete[] m_Name;
- delete[] m_Filename;
- m_Name = NULL;
- m_Filename = NULL;
+ delete[] _name;
+ delete[] _filename;
+ _name = NULL;
+ _filename = NULL;
for (int i = 0; i < 7; i++) {
- delete[] m_Caption[i];
- m_Caption[i] = NULL;
+ delete[] _caption[i];
+ _caption[i] = NULL;
}
- m_LastCursor = NULL;
+ _lastCursor = NULL;
- delete m_KeyboardState;
- m_KeyboardState = NULL;
+ delete _keyboardState;
+ _keyboardState = NULL;
return S_OK;
}
@@ -424,79 +424,79 @@ HRESULT CBGame::Cleanup() {
//////////////////////////////////////////////////////////////////////
HRESULT CBGame::Initialize1() {
- m_SurfaceStorage = new CBSurfaceStorage(this);
- if (m_SurfaceStorage == NULL) goto init_fail;
+ _surfaceStorage = new CBSurfaceStorage(this);
+ if (_surfaceStorage == NULL) goto init_fail;
- m_FontStorage = new CBFontStorage(this);
- if (m_FontStorage == NULL) goto init_fail;
+ _fontStorage = new CBFontStorage(this);
+ if (_fontStorage == NULL) goto init_fail;
- m_FileManager = new CBFileManager(this);
- if (m_FileManager == NULL) goto init_fail;
+ _fileManager = new CBFileManager(this);
+ if (_fileManager == NULL) goto init_fail;
- m_SoundMgr = new CBSoundMgr(this);
- if (m_SoundMgr == NULL) goto init_fail;
+ _soundMgr = new CBSoundMgr(this);
+ if (_soundMgr == NULL) goto init_fail;
- m_DebugMgr = new CBDebugger(this);
- if (m_DebugMgr == NULL) goto init_fail;
+ _debugMgr = new CBDebugger(this);
+ if (_debugMgr == NULL) goto init_fail;
- m_MathClass = new CSXMath(this);
- if (m_MathClass == NULL) goto init_fail;
+ _mathClass = new CSXMath(this);
+ if (_mathClass == NULL) goto init_fail;
- m_ScEngine = new CScEngine(this);
- if (m_ScEngine == NULL) goto init_fail;
+ _scEngine = new CScEngine(this);
+ if (_scEngine == NULL) goto init_fail;
- m_TransMgr = new CBTransitionMgr(this);
- if (m_TransMgr == NULL) goto init_fail;
+ _transMgr = new CBTransitionMgr(this);
+ if (_transMgr == NULL) goto init_fail;
- m_KeyboardState = new CBKeyboardState(this);
- if (m_KeyboardState == NULL) goto init_fail;
+ _keyboardState = new CBKeyboardState(this);
+ if (_keyboardState == NULL) goto init_fail;
- m_Fader = new CBFader(this);
- if (m_Fader == NULL) goto init_fail;
- RegisterObject(m_Fader);
+ _fader = new CBFader(this);
+ if (_fader == NULL) goto init_fail;
+ RegisterObject(_fader);
- m_Store = new CSXStore(this);
- if (m_Store == NULL) goto init_fail;
- RegisterObject(m_Store);
+ _store = new CSXStore(this);
+ if (_store == NULL) goto init_fail;
+ RegisterObject(_store);
return S_OK;
init_fail:
- if (m_MathClass) delete m_MathClass;
- if (m_Store) delete m_Store;
- if (m_KeyboardState) delete m_KeyboardState;
- if (m_TransMgr) delete m_TransMgr;
- if (m_DebugMgr) delete m_DebugMgr;
- if (m_SurfaceStorage) delete m_SurfaceStorage;
- if (m_FontStorage) delete m_FontStorage;
- if (m_SoundMgr) delete m_SoundMgr;
- if (m_FileManager) delete m_FileManager;
- if (m_ScEngine) delete m_ScEngine;
+ if (_mathClass) delete _mathClass;
+ if (_store) delete _store;
+ if (_keyboardState) delete _keyboardState;
+ if (_transMgr) delete _transMgr;
+ if (_debugMgr) delete _debugMgr;
+ if (_surfaceStorage) delete _surfaceStorage;
+ if (_fontStorage) delete _fontStorage;
+ if (_soundMgr) delete _soundMgr;
+ if (_fileManager) delete _fileManager;
+ if (_scEngine) delete _scEngine;
return E_FAIL;
}
//////////////////////////////////////////////////////////////////////
HRESULT CBGame::Initialize2() { // we know whether we are going to be accelerated
- m_Renderer = new CBRenderSDL(this);
- if (m_Renderer == NULL) goto init_fail;
+ _renderer = new CBRenderSDL(this);
+ if (_renderer == NULL) goto init_fail;
return S_OK;
init_fail:
- if (m_Renderer) delete m_Renderer;
+ if (_renderer) delete _renderer;
return E_FAIL;
}
//////////////////////////////////////////////////////////////////////
HRESULT CBGame::Initialize3() { // renderer is initialized
- m_PosX = m_Renderer->m_Width / 2;
- m_PosY = m_Renderer->m_Height / 2;
+ _posX = _renderer->_width / 2;
+ _posY = _renderer->_height / 2;
- if (m_IndicatorY == -1) m_IndicatorY = m_Renderer->m_Height - m_IndicatorHeight;
- if (m_IndicatorX == -1) m_IndicatorX = 0;
- if (m_IndicatorWidth == -1) m_IndicatorWidth = m_Renderer->m_Width;
+ if (_indicatorY == -1) _indicatorY = _renderer->_height - _indicatorHeight;
+ if (_indicatorX == -1) _indicatorX = 0;
+ if (_indicatorWidth == -1) _indicatorWidth = _renderer->_width;
return S_OK;
}
@@ -504,18 +504,18 @@ HRESULT CBGame::Initialize3() { // renderer is initialized
//////////////////////////////////////////////////////////////////////
void CBGame::DEBUG_DebugEnable(const char *Filename) {
- m_DEBUG_DebugMode = true;
+ _dEBUG_DebugMode = true;
#ifndef __IPHONEOS__
- if (Filename)m_DEBUG_LogFile = fopen(Filename, "a+");
- else m_DEBUG_LogFile = fopen("./zz_debug.log", "a+");
+ if (Filename)_dEBUG_LogFile = fopen(Filename, "a+");
+ else _dEBUG_LogFile = fopen("./zz_debug.log", "a+");
- if (!m_DEBUG_LogFile) {
+ if (!_dEBUG_LogFile) {
AnsiString safeLogFileName = PathUtil::GetSafeLogFileName();
- m_DEBUG_LogFile = fopen(safeLogFileName.c_str(), "a+");
+ _dEBUG_LogFile = fopen(safeLogFileName.c_str(), "a+");
}
- if (m_DEBUG_LogFile != NULL) fprintf((FILE*)m_DEBUG_LogFile, "\n");
+ if (_dEBUG_LogFile != NULL) fprintf((FILE*)_dEBUG_LogFile, "\n");
#endif
time_t timeNow;
@@ -539,19 +539,19 @@ void CBGame::DEBUG_DebugEnable(const char *Filename) {
//////////////////////////////////////////////////////////////////////
void CBGame::DEBUG_DebugDisable() {
- if (m_DEBUG_LogFile != NULL) {
+ if (_dEBUG_LogFile != NULL) {
LOG(0, "********** DEBUG LOG CLOSED ********************************************");
- fclose((FILE*)m_DEBUG_LogFile);
- m_DEBUG_LogFile = NULL;
+ fclose((FILE*)_dEBUG_LogFile);
+ _dEBUG_LogFile = NULL;
}
- m_DEBUG_DebugMode = false;
+ _dEBUG_DebugMode = false;
}
//////////////////////////////////////////////////////////////////////
void CBGame::LOG(HRESULT res, LPCSTR fmt, ...) {
#ifndef __IPHONEOS__
- if (!m_DEBUG_DebugMode) return;
+ if (!_dEBUG_DebugMode) return;
#endif
time_t timeNow;
time(&timeNow);
@@ -568,17 +568,17 @@ void CBGame::LOG(HRESULT res, LPCSTR fmt, ...) {
printf("%02d:%02d:%02d: %s\n", tm->tm_hour, tm->tm_min, tm->tm_sec, buff);
fflush(stdout);
#else
- if (m_DEBUG_LogFile == NULL) return;
+ if (_dEBUG_LogFile == NULL) return;
// redirect to an engine's own callback
- if (m_EngineLogCallback) {
- m_EngineLogCallback(buff, res, m_EngineLogCallbackData);
+ if (_engineLogCallback) {
+ _engineLogCallback(buff, res, _engineLogCallbackData);
}
- if (m_DebugMgr) m_DebugMgr->OnLog(res, buff);
+ if (_debugMgr) _debugMgr->OnLog(res, buff);
warning("%02d:%02d: %s\n", tm->tm_hour, tm->tm_min, buff);
- fprintf((FILE*)m_DEBUG_LogFile, "%02d:%02d: %s\n", tm->tm_hour, tm->tm_min, buff);
- fflush((FILE*)m_DEBUG_LogFile);
+ fprintf((FILE*)_dEBUG_LogFile, "%02d:%02d: %s\n", tm->tm_hour, tm->tm_min, buff);
+ fflush((FILE*)_dEBUG_LogFile);
#endif
//QuickMessage(buff);
@@ -587,64 +587,64 @@ void CBGame::LOG(HRESULT res, LPCSTR fmt, ...) {
//////////////////////////////////////////////////////////////////////////
void CBGame::SetEngineLogCallback(ENGINE_LOG_CALLBACK Callback, void *Data) {
- m_EngineLogCallback = Callback;
- m_EngineLogCallbackData = Data;
+ _engineLogCallback = Callback;
+ _engineLogCallbackData = Data;
}
//////////////////////////////////////////////////////////////////////
HRESULT CBGame::InitLoop() {
- m_ViewportSP = -1;
+ _viewportSP = -1;
- m_CurrentTime = CBPlatform::GetTime();
+ _currentTime = CBPlatform::GetTime();
GetDebugMgr()->OnGameTick();
- m_Renderer->InitLoop();
- m_SoundMgr->InitLoop();
+ _renderer->InitLoop();
+ _soundMgr->InitLoop();
UpdateMusicCrossfade();
- m_SurfaceStorage->InitLoop();
- m_FontStorage->InitLoop();
+ _surfaceStorage->InitLoop();
+ _fontStorage->InitLoop();
- //m_ActiveObject = NULL;
+ //_activeObject = NULL;
// count FPS
- m_DeltaTime = m_CurrentTime - m_LastTime;
- m_LastTime = m_CurrentTime;
- m_FpsTime += m_DeltaTime;
-
- m_LiveTimerDelta = m_LiveTimer - m_LiveTimerLast;
- m_LiveTimerLast = m_LiveTimer;
- m_LiveTimer += MIN((uint32)1000, m_DeltaTime);
-
- if (m_State != GAME_FROZEN) {
- m_TimerDelta = m_Timer - m_TimerLast;
- m_TimerLast = m_Timer;
- m_Timer += MIN((uint32)1000, m_DeltaTime);
- } else m_TimerDelta = 0;
-
- m_FramesRendered++;
- if (m_FpsTime > 1000) {
- m_Fps = m_FramesRendered;
- m_FramesRendered = 0;
- m_FpsTime = 0;
- }
- //Game->LOG(0, "%d", m_Fps);
-
- GetMousePos(&m_MousePos);
-
- m_FocusedWindow = NULL;
- for (int i = m_Windows.GetSize() - 1; i >= 0; i--) {
- if (m_Windows[i]->m_Visible) {
- m_FocusedWindow = m_Windows[i];
+ _deltaTime = _currentTime - _lastTime;
+ _lastTime = _currentTime;
+ _fpsTime += _deltaTime;
+
+ _liveTimerDelta = _liveTimer - _liveTimerLast;
+ _liveTimerLast = _liveTimer;
+ _liveTimer += MIN((uint32)1000, _deltaTime);
+
+ if (_state != GAME_FROZEN) {
+ _timerDelta = _timer - _timerLast;
+ _timerLast = _timer;
+ _timer += MIN((uint32)1000, _deltaTime);
+ } else _timerDelta = 0;
+
+ _framesRendered++;
+ if (_fpsTime > 1000) {
+ _fps = _framesRendered;
+ _framesRendered = 0;
+ _fpsTime = 0;
+ }
+ //Game->LOG(0, "%d", _fps);
+
+ GetMousePos(&_mousePos);
+
+ _focusedWindow = NULL;
+ for (int i = _windows.GetSize() - 1; i >= 0; i--) {
+ if (_windows[i]->_visible) {
+ _focusedWindow = _windows[i];
break;
}
}
UpdateSounds();
- if (m_Fader) m_Fader->Update();
+ if (_fader) _fader->Update();
return S_OK;
}
@@ -658,26 +658,26 @@ HRESULT CBGame::InitInput(HINSTANCE hInst, HWND hWnd) {
//////////////////////////////////////////////////////////////////////////
int CBGame::GetSequence() {
- return ++m_Sequence;
+ return ++_sequence;
}
//////////////////////////////////////////////////////////////////////////
void CBGame::SetOffset(int OffsetX, int OffsetY) {
- m_OffsetX = OffsetX;
- m_OffsetY = OffsetY;
+ _offsetX = OffsetX;
+ _offsetY = OffsetY;
}
//////////////////////////////////////////////////////////////////////////
void CBGame::GetOffset(int *OffsetX, int *OffsetY) {
- if (OffsetX != NULL) *OffsetX = m_OffsetX;
- if (OffsetY != NULL) *OffsetY = m_OffsetY;
+ if (OffsetX != NULL) *OffsetX = _offsetX;
+ if (OffsetY != NULL) *OffsetY = _offsetY;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::LoadFile(const char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CBGame::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -685,8 +685,8 @@ HRESULT CBGame::LoadFile(const char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -810,47 +810,47 @@ HRESULT CBGame::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_SYSTEM_FONT:
- if (m_SystemFont) m_FontStorage->RemoveFont(m_SystemFont);
- m_SystemFont = NULL;
+ if (_systemFont) _fontStorage->RemoveFont(_systemFont);
+ _systemFont = NULL;
- m_SystemFont = Game->m_FontStorage->AddFont((char *)params);
+ _systemFont = Game->_fontStorage->AddFont((char *)params);
break;
case TOKEN_VIDEO_FONT:
- if (m_VideoFont) m_FontStorage->RemoveFont(m_VideoFont);
- m_VideoFont = NULL;
+ if (_videoFont) _fontStorage->RemoveFont(_videoFont);
+ _videoFont = NULL;
- m_VideoFont = Game->m_FontStorage->AddFont((char *)params);
+ _videoFont = Game->_fontStorage->AddFont((char *)params);
break;
case TOKEN_CURSOR:
- delete m_Cursor;
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- delete m_Cursor;
- m_Cursor = NULL;
+ delete _cursor;
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_ACTIVE_CURSOR:
- delete m_ActiveCursor;
- m_ActiveCursor = NULL;
- m_ActiveCursor = new CBSprite(Game);
- if (!m_ActiveCursor || FAILED(m_ActiveCursor->LoadFile((char *)params))) {
- delete m_ActiveCursor;
- m_ActiveCursor = NULL;
+ delete _activeCursor;
+ _activeCursor = NULL;
+ _activeCursor = new CBSprite(Game);
+ if (!_activeCursor || FAILED(_activeCursor->LoadFile((char *)params))) {
+ delete _activeCursor;
+ _activeCursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_NONINTERACTIVE_CURSOR:
- delete m_CursorNoninteractive;
- m_CursorNoninteractive = new CBSprite(Game);
- if (!m_CursorNoninteractive || FAILED(m_CursorNoninteractive->LoadFile((char *)params))) {
- delete m_CursorNoninteractive;
- m_CursorNoninteractive = NULL;
+ delete _cursorNoninteractive;
+ _cursorNoninteractive = new CBSprite(Game);
+ if (!_cursorNoninteractive || FAILED(_cursorNoninteractive->LoadFile((char *)params))) {
+ delete _cursorNoninteractive;
+ _cursorNoninteractive = NULL;
cmd = PARSERR_GENERIC;
}
break;
@@ -860,19 +860,19 @@ HRESULT CBGame::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_PERSONAL_SAVEGAMES:
- parser.ScanStr((char *)params, "%b", &m_PersonalizedSave);
+ parser.ScanStr((char *)params, "%b", &_personalizedSave);
break;
case TOKEN_SUBTITLES:
- parser.ScanStr((char *)params, "%b", &m_Subtitles);
+ parser.ScanStr((char *)params, "%b", &_subtitles);
break;
case TOKEN_SUBTITLES_SPEED:
- parser.ScanStr((char *)params, "%d", &m_SubtitlesSpeed);
+ parser.ScanStr((char *)params, "%d", &_subtitlesSpeed);
break;
case TOKEN_VIDEO_SUBTITLES:
- parser.ScanStr((char *)params, "%b", &m_VideoSubtitles);
+ parser.ScanStr((char *)params, "%b", &_videoSubtitles);
break;
case TOKEN_PROPERTY:
@@ -884,71 +884,71 @@ HRESULT CBGame::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_THUMBNAIL_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_ThumbnailWidth);
+ parser.ScanStr((char *)params, "%d", &_thumbnailWidth);
break;
case TOKEN_THUMBNAIL_HEIGHT:
- parser.ScanStr((char *)params, "%d", &m_ThumbnailHeight);
+ parser.ScanStr((char *)params, "%d", &_thumbnailHeight);
break;
case TOKEN_INDICATOR_X:
- parser.ScanStr((char *)params, "%d", &m_IndicatorX);
+ parser.ScanStr((char *)params, "%d", &_indicatorX);
break;
case TOKEN_INDICATOR_Y:
- parser.ScanStr((char *)params, "%d", &m_IndicatorY);
+ parser.ScanStr((char *)params, "%d", &_indicatorY);
break;
case TOKEN_INDICATOR_COLOR: {
int r, g, b, a;
parser.ScanStr((char *)params, "%d,%d,%d,%d", &r, &g, &b, &a);
- m_IndicatorColor = DRGBA(r, g, b, a);
+ _indicatorColor = DRGBA(r, g, b, a);
}
break;
case TOKEN_INDICATOR_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_IndicatorWidth);
+ parser.ScanStr((char *)params, "%d", &_indicatorWidth);
break;
case TOKEN_INDICATOR_HEIGHT:
- parser.ScanStr((char *)params, "%d", &m_IndicatorHeight);
+ parser.ScanStr((char *)params, "%d", &_indicatorHeight);
break;
case TOKEN_SAVE_IMAGE:
- CBUtils::SetString(&m_SaveImageName, (char *)params);
+ CBUtils::SetString(&_saveImageName, (char *)params);
break;
case TOKEN_SAVE_IMAGE_X:
- parser.ScanStr((char *)params, "%d", &m_SaveImageX);
+ parser.ScanStr((char *)params, "%d", &_saveImageX);
break;
case TOKEN_SAVE_IMAGE_Y:
- parser.ScanStr((char *)params, "%d", &m_SaveImageY);
+ parser.ScanStr((char *)params, "%d", &_saveImageY);
break;
case TOKEN_LOAD_IMAGE:
- CBUtils::SetString(&m_LoadImageName, (char *)params);
+ CBUtils::SetString(&_loadImageName, (char *)params);
break;
case TOKEN_LOAD_IMAGE_X:
- parser.ScanStr((char *)params, "%d", &m_LoadImageX);
+ parser.ScanStr((char *)params, "%d", &_loadImageX);
break;
case TOKEN_LOAD_IMAGE_Y:
- parser.ScanStr((char *)params, "%d", &m_LoadImageY);
+ parser.ScanStr((char *)params, "%d", &_loadImageY);
break;
case TOKEN_LOCAL_SAVE_DIR:
- CBUtils::SetString(&m_LocalSaveDir, (char *)params);
+ CBUtils::SetString(&_localSaveDir, (char *)params);
break;
case TOKEN_COMPAT_KILL_METHOD_THREADS:
- parser.ScanStr((char *)params, "%b", &m_CompatKillMethodThreads);
+ parser.ScanStr((char *)params, "%b", &_compatKillMethodThreads);
break;
}
}
- if (!m_SystemFont) m_SystemFont = Game->m_FontStorage->AddFont("system_font.fnt");
+ if (!_systemFont) _systemFont = Game->_fontStorage->AddFont("syste_font.fnt");
if (cmd == PARSERR_TOKENNOTFOUND) {
@@ -1023,7 +1023,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
if (Val->IsNULL()) ClearOld = true;
else ClearOld = Val->GetBool();
- if (FAILED(m_StringTable->LoadFile(Filename, ClearOld)))
+ if (FAILED(_stringTable->LoadFile(Filename, ClearOld)))
Stack->PushBool(false);
else
Stack->PushBool(true);
@@ -1076,7 +1076,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Stack->CorrectParams(1);
CUIWindow *win = new CUIWindow(Game);
if (win && SUCCEEDED(win->LoadFile(Stack->Pop()->GetString()))) {
- m_Windows.Add(win);
+ _windows.Add(win);
RegisterObject(win);
Stack->PushNative(win, true);
} else {
@@ -1095,7 +1095,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
CScValue *val = Stack->Pop();
char *str = new char[strlen(val->GetString()) + 1];
strcpy(str, val->GetString());
- m_StringTable->Expand(&str);
+ _stringTable->Expand(&str);
Stack->PushString(str);
delete [] str;
return S_OK;
@@ -1187,8 +1187,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
}
if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS) Stack->PushNULL();
else {
- if (!m_Music[Channel] || !m_Music[Channel]->m_SoundFilename) Stack->PushNULL();
- else Stack->PushString(m_Music[Channel]->m_SoundFilename);
+ if (!_music[Channel] || !_music[Channel]->_soundFilename) Stack->PushNULL();
+ else Stack->PushString(_music[Channel]->_soundFilename);
}
return S_OK;
}
@@ -1223,8 +1223,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Channel = Stack->Pop()->GetInt();
}
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !m_Music[Channel]) Stack->PushInt(0);
- else Stack->PushInt(m_Music[Channel]->GetPositionTime());
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) Stack->PushInt(0);
+ else Stack->PushInt(_music[Channel]->GetPositionTime());
return S_OK;
}
@@ -1239,8 +1239,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Channel = Stack->Pop()->GetInt();
}
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !m_Music[Channel]) Stack->PushBool(false);
- else Stack->PushBool(m_Music[Channel]->IsPlaying());
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) Stack->PushBool(false);
+ else Stack->PushBool(_music[Channel]->IsPlaying());
return S_OK;
}
@@ -1256,9 +1256,9 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
}
int Volume = Stack->Pop()->GetInt();
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !m_Music[Channel]) Stack->PushBool(false);
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) Stack->PushBool(false);
else {
- if (FAILED(m_Music[Channel]->SetVolume(Volume))) Stack->PushBool(false);
+ if (FAILED(_music[Channel]->SetVolume(Volume))) Stack->PushBool(false);
else Stack->PushBool(true);
}
return S_OK;
@@ -1275,8 +1275,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Channel = Stack->Pop()->GetInt();
}
- if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !m_Music[Channel]) Stack->PushInt(0);
- else Stack->PushInt(m_Music[Channel]->GetVolume());
+ if (Channel < 0 || Channel >= NUM_MUSIC_CHANNELS || !_music[Channel]) Stack->PushInt(0);
+ else Stack->PushInt(_music[Channel]->GetVolume());
return S_OK;
}
@@ -1291,19 +1291,19 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
uint32 FadeLength = (uint32)Stack->Pop()->GetInt(0);
bool Swap = Stack->Pop()->GetBool(true);
- if (m_MusicCrossfadeRunning) {
+ if (_musicCrossfadeRunning) {
Script->RuntimeError("Game.MusicCrossfade: Music crossfade is already in progress.");
Stack->PushBool(false);
return S_OK;
}
- m_MusicCrossfadeStartTime = m_LiveTimer;
- m_MusicCrossfadeChannel1 = Channel1;
- m_MusicCrossfadeChannel2 = Channel2;
- m_MusicCrossfadeLength = FadeLength;
- m_MusicCrossfadeSwap = Swap;
+ _musicCrossfadeStartTime = _liveTimer;
+ _musicCrossfadeChannel1 = Channel1;
+ _musicCrossfadeChannel2 = Channel2;
+ _musicCrossfadeLength = FadeLength;
+ _musicCrossfadeSwap = Swap;
- m_MusicCrossfadeRunning = true;
+ _musicCrossfadeRunning = true;
Stack->PushBool(true);
return S_OK;
@@ -1336,12 +1336,12 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
int x = Stack->Pop()->GetInt();
int y = Stack->Pop()->GetInt();
x = std::max(x, 0);
- x = std::min(x, m_Renderer->m_Width);
+ x = std::min(x, _renderer->_width);
y = std::max(y, 0);
- y = std::min(y, m_Renderer->m_Height);
+ y = std::min(y, _renderer->_height);
POINT p;
- p.x = x + m_Renderer->m_DrawOffsetX;
- p.y = y + m_Renderer->m_DrawOffsetY;
+ p.x = x + _renderer->_drawOffsetX;
+ p.y = y + _renderer->_drawOffsetY;
CBPlatform::SetCursorPos(p.x, p.y);
@@ -1362,7 +1362,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
if (right < left) CBUtils::Swap(&left, &right);
if (bottom < top) CBUtils::Swap(&top, &bottom);
- CBPlatform::SetRect(&m_MouseLockRect, left, top, right, bottom);
+ CBPlatform::SetRect(&_mouseLockRect, left, top, right, bottom);
Stack->PushNULL();
return S_OK;
@@ -1394,7 +1394,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "QuitGame") == 0) {
Stack->CorrectParams(0);
Stack->PushNULL();
- m_Quitting = true;
+ _quitting = true;
return S_OK;
}
@@ -1405,7 +1405,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Stack->CorrectParams(2);
char *Key = Stack->Pop()->GetString();
int Val = Stack->Pop()->GetInt();
- m_Registry->WriteInt("PrivateSettings", Key, Val);
+ _registry->WriteInt("PrivateSettings", Key, Val);
Stack->PushNULL();
return S_OK;
}
@@ -1417,7 +1417,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Stack->CorrectParams(2);
char *Key = Stack->Pop()->GetString();
int InitVal = Stack->Pop()->GetInt();
- Stack->PushInt(m_Registry->ReadInt("PrivateSettings", Key, InitVal));
+ Stack->PushInt(_registry->ReadInt("PrivateSettings", Key, InitVal));
return S_OK;
}
@@ -1428,7 +1428,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Stack->CorrectParams(2);
char *Key = Stack->Pop()->GetString();
char *Val = Stack->Pop()->GetString();
- m_Registry->WriteString("PrivateSettings", Key, Val);
+ _registry->WriteString("PrivateSettings", Key, Val);
Stack->PushNULL();
return S_OK;
}
@@ -1440,7 +1440,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Stack->CorrectParams(2);
char *Key = Stack->Pop()->GetString();
char *InitVal = Stack->Pop()->GetString();
- AnsiString val = m_Registry->ReadString("PrivateSettings", Key, InitVal);
+ AnsiString val = _registry->ReadString("PrivateSettings", Key, InitVal);
Stack->PushString((char *)val.c_str());
return S_OK;
}
@@ -1470,8 +1470,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LoadGame") == 0) {
Stack->CorrectParams(1);
- m_ScheduledLoadSlot = Stack->Pop()->GetInt();
- m_Loading = true;
+ _scheduledLoadSlot = Stack->Pop()->GetInt();
+ _loading = true;
Stack->PushBool(false);
Script->Sleep(0);
return S_OK;
@@ -1516,7 +1516,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetGlobalSFXVolume") == 0) {
Stack->CorrectParams(1);
- Game->m_SoundMgr->SetVolumePercent(SOUND_SFX, (byte )Stack->Pop()->GetInt());
+ Game->_soundMgr->SetVolumePercent(SOUND_SFX, (byte )Stack->Pop()->GetInt());
Stack->PushNULL();
return S_OK;
}
@@ -1526,7 +1526,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetGlobalSpeechVolume") == 0) {
Stack->CorrectParams(1);
- Game->m_SoundMgr->SetVolumePercent(SOUND_SPEECH, (byte )Stack->Pop()->GetInt());
+ Game->_soundMgr->SetVolumePercent(SOUND_SPEECH, (byte )Stack->Pop()->GetInt());
Stack->PushNULL();
return S_OK;
}
@@ -1536,7 +1536,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetGlobalMusicVolume") == 0) {
Stack->CorrectParams(1);
- Game->m_SoundMgr->SetVolumePercent(SOUND_MUSIC, (byte )Stack->Pop()->GetInt());
+ Game->_soundMgr->SetVolumePercent(SOUND_MUSIC, (byte )Stack->Pop()->GetInt());
Stack->PushNULL();
return S_OK;
}
@@ -1546,7 +1546,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetGlobalMasterVolume") == 0) {
Stack->CorrectParams(1);
- Game->m_SoundMgr->SetMasterVolumePercent((byte )Stack->Pop()->GetInt());
+ Game->_soundMgr->SetMasterVolumePercent((byte )Stack->Pop()->GetInt());
Stack->PushNULL();
return S_OK;
}
@@ -1556,7 +1556,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetGlobalSFXVolume") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_SoundMgr->GetVolumePercent(SOUND_SFX));
+ Stack->PushInt(_soundMgr->GetVolumePercent(SOUND_SFX));
return S_OK;
}
@@ -1565,7 +1565,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetGlobalSpeechVolume") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_SoundMgr->GetVolumePercent(SOUND_SPEECH));
+ Stack->PushInt(_soundMgr->GetVolumePercent(SOUND_SPEECH));
return S_OK;
}
@@ -1574,7 +1574,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetGlobalMusicVolume") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_SoundMgr->GetVolumePercent(SOUND_MUSIC));
+ Stack->PushInt(_soundMgr->GetVolumePercent(SOUND_MUSIC));
return S_OK;
}
@@ -1583,7 +1583,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetGlobalMasterVolume") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_SoundMgr->GetMasterVolumePercent());
+ Stack->PushInt(_soundMgr->GetMasterVolumePercent());
return S_OK;
}
@@ -1603,8 +1603,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetActiveCursor") == 0) {
Stack->CorrectParams(0);
- if (!m_ActiveCursor || !m_ActiveCursor->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_ActiveCursor->m_Filename);
+ if (!_activeCursor || !_activeCursor->_filename) Stack->PushNULL();
+ else Stack->PushString(_activeCursor->_filename);
return S_OK;
}
@@ -1614,8 +1614,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetActiveCursorObject") == 0) {
Stack->CorrectParams(0);
- if (!m_ActiveCursor) Stack->PushNULL();
- else Stack->PushNative(m_ActiveCursor, true);
+ if (!_activeCursor) Stack->PushNULL();
+ else Stack->PushNative(_activeCursor, true);
return S_OK;
}
@@ -1625,8 +1625,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "RemoveActiveCursor") == 0) {
Stack->CorrectParams(0);
- delete m_ActiveCursor;
- m_ActiveCursor = NULL;
+ delete _activeCursor;
+ _activeCursor = NULL;
Stack->PushNULL();
return S_OK;
@@ -1638,7 +1638,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "HasActiveCursor") == 0) {
Stack->CorrectParams(0);
- if (m_ActiveCursor) Stack->PushBool(true);
+ if (_activeCursor) Stack->PushBool(true);
else Stack->PushBool(false);
return S_OK;
@@ -1651,10 +1651,10 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Stack->CorrectParams(1);
char *Filename = Stack->Pop()->GetString();
- CBFile *File = m_FileManager->OpenFile(Filename, false);
+ CBFile *File = _fileManager->OpenFile(Filename, false);
if (!File) Stack->PushBool(false);
else {
- m_FileManager->CloseFile(File);
+ _fileManager->CloseFile(File);
Stack->PushBool(true);
}
return S_OK;
@@ -1673,8 +1673,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
bool System = (strcmp(Name, "SystemFadeOut") == 0 || strcmp(Name, "SystemFadeOutAsync") == 0);
- m_Fader->FadeOut(DRGBA(Red, Green, Blue, Alpha), Duration, System);
- if (strcmp(Name, "FadeOutAsync") != 0 && strcmp(Name, "SystemFadeOutAsync") != 0) Script->WaitFor(m_Fader);
+ _fader->FadeOut(DRGBA(Red, Green, Blue, Alpha), Duration, System);
+ if (strcmp(Name, "FadeOutAsync") != 0 && strcmp(Name, "SystemFadeOutAsync") != 0) Script->WaitFor(_fader);
Stack->PushNULL();
return S_OK;
@@ -1693,8 +1693,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
bool System = (strcmp(Name, "SystemFadeIn") == 0 || strcmp(Name, "SystemFadeInAsync") == 0);
- m_Fader->FadeIn(DRGBA(Red, Green, Blue, Alpha), Duration, System);
- if (strcmp(Name, "FadeInAsync") != 0 && strcmp(Name, "SystemFadeInAsync") != 0) Script->WaitFor(m_Fader);
+ _fader->FadeIn(DRGBA(Red, Green, Blue, Alpha), Duration, System);
+ if (strcmp(Name, "FadeInAsync") != 0 && strcmp(Name, "SystemFadeInAsync") != 0) Script->WaitFor(_fader);
Stack->PushNULL();
return S_OK;
@@ -1705,7 +1705,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetFadeColor") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_Fader->GetCurrentColor());
+ Stack->PushInt(_fader->GetCurrentColor());
return S_OK;
}
@@ -1720,7 +1720,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
int FileNum = 0;
while (true) {
- sprintf(Filename, "%s%03d.bmp", Val->IsNULL() ? m_Name : Val->GetString(), FileNum);
+ sprintf(Filename, "%s%03d.bmp", Val->IsNULL() ? _name : Val->GetString(), FileNum);
FILE *f = fopen(Filename, "rb");
if (!f) break;
else fclose(f);
@@ -1728,7 +1728,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
}
bool ret = false;
- CBImage *Image = Game->m_Renderer->TakeScreenshot();
+ CBImage *Image = Game->_renderer->TakeScreenshot();
if (Image) {
ret = SUCCEEDED(Image->SaveBMPFile(Filename));
delete Image;
@@ -1744,11 +1744,11 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "ScreenshotEx") == 0) {
Stack->CorrectParams(3);
char *Filename = Stack->Pop()->GetString();
- int SizeX = Stack->Pop()->GetInt(m_Renderer->m_Width);
- int SizeY = Stack->Pop()->GetInt(m_Renderer->m_Height);
+ int SizeX = Stack->Pop()->GetInt(_renderer->_width);
+ int SizeY = Stack->Pop()->GetInt(_renderer->_height);
bool ret = false;
- CBImage *Image = Game->m_Renderer->TakeScreenshot();
+ CBImage *Image = Game->_renderer->TakeScreenshot();
if (Image) {
ret = SUCCEEDED(Image->Resize(SizeX, SizeY));
if (ret) ret = SUCCEEDED(Image->SaveBMPFile(Filename));
@@ -1767,7 +1767,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
CScValue *Val = Stack->Pop();
CUIWindow *Win = new CUIWindow(Game);
- m_Windows.Add(Win);
+ _windows.Add(Win);
RegisterObject(Win);
if (!Val->IsNULL()) Win->SetName(Val->GetString());
Stack->PushNative(Win, true);
@@ -1780,9 +1780,9 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "DeleteWindow") == 0) {
Stack->CorrectParams(1);
CBObject *Obj = (CBObject *)Stack->Pop()->GetNative();
- for (int i = 0; i < m_Windows.GetSize(); i++) {
- if (m_Windows[i] == Obj) {
- UnregisterObject(m_Windows[i]);
+ for (int i = 0; i < _windows.GetSize(); i++) {
+ if (_windows[i] == Obj) {
+ UnregisterObject(_windows[i]);
Stack->PushBool(true);
return S_OK;
}
@@ -1797,8 +1797,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "OpenDocument") == 0) {
#ifdef __WIN32__
Stack->CorrectParams(1);
- if (!m_Renderer->m_Windowed) CBPlatform::ShowWindow(m_Renderer->m_Window, SW_MINIMIZE);
- HINSTANCE i = CBPlatform::ShellExecute(m_Renderer->m_Window, "open", Stack->Pop()->GetString(), NULL, NULL, SW_MAXIMIZE);
+ if (!_renderer->_windowed) CBPlatform::ShowWindow(_renderer->_window, SW_MINIMIZE);
+ HINSTANCE i = CBPlatform::ShellExecute(_renderer->_window, "open", Stack->Pop()->GetString(), NULL, NULL, SW_MAXIMIZE);
Stack->PushBool((int)i > 32);
#else
Stack->CorrectParams(0);
@@ -1823,14 +1823,14 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "SetLoadingScreen") == 0) {
Stack->CorrectParams(3);
CScValue *Val = Stack->Pop();
- m_LoadImageX = Stack->Pop()->GetInt();
- m_LoadImageY = Stack->Pop()->GetInt();
+ _loadImageX = Stack->Pop()->GetInt();
+ _loadImageY = Stack->Pop()->GetInt();
if (Val->IsNULL()) {
- delete[] m_LoadImageName;
- m_LoadImageName = NULL;
+ delete[] _loadImageName;
+ _loadImageName = NULL;
} else {
- CBUtils::SetString(&m_LoadImageName, Val->GetString());
+ CBUtils::SetString(&_loadImageName, Val->GetString());
}
Stack->PushNULL();
return S_OK;
@@ -1842,14 +1842,14 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "SetSavingScreen") == 0) {
Stack->CorrectParams(3);
CScValue *Val = Stack->Pop();
- m_SaveImageX = Stack->Pop()->GetInt();
- m_SaveImageY = Stack->Pop()->GetInt();
+ _saveImageX = Stack->Pop()->GetInt();
+ _saveImageY = Stack->Pop()->GetInt();
if (Val->IsNULL()) {
- delete[] m_SaveImageName;
- m_SaveImageName = NULL;
+ delete[] _saveImageName;
+ _saveImageName = NULL;
} else {
- CBUtils::SetString(&m_SaveImageName, Val->GetString());
+ CBUtils::SetString(&_saveImageName, Val->GetString());
}
Stack->PushNULL();
return S_OK;
@@ -1871,8 +1871,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "RemoveWaitCursor") == 0) {
Stack->CorrectParams(0);
- delete m_CursorNoninteractive;
- m_CursorNoninteractive = NULL;
+ delete _cursorNoninteractive;
+ _cursorNoninteractive = NULL;
Stack->PushNULL();
@@ -1884,8 +1884,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetWaitCursor") == 0) {
Stack->CorrectParams(0);
- if (!m_CursorNoninteractive || !m_CursorNoninteractive->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_CursorNoninteractive->m_Filename);
+ if (!_cursorNoninteractive || !_cursorNoninteractive->_filename) Stack->PushNULL();
+ else Stack->PushString(_cursorNoninteractive->_filename);
return S_OK;
}
@@ -1895,8 +1895,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetWaitCursorObject") == 0) {
Stack->CorrectParams(0);
- if (!m_CursorNoninteractive) Stack->PushNULL();
- else Stack->PushNative(m_CursorNoninteractive, true);
+ if (!_cursorNoninteractive) Stack->PushNULL();
+ else Stack->PushNative(_cursorNoninteractive, true);
return S_OK;
}
@@ -1906,7 +1906,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ClearScriptCache") == 0) {
Stack->CorrectParams(0);
- Stack->PushBool(SUCCEEDED(m_ScEngine->EmptyScriptCache()));
+ Stack->PushBool(SUCCEEDED(_scEngine->EmptyScriptCache()));
return S_OK;
}
@@ -1917,19 +1917,19 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Stack->CorrectParams(4);
char *Filename = Stack->Pop()->GetString();
- m_LoadingIconX = Stack->Pop()->GetInt();
- m_LoadingIconY = Stack->Pop()->GetInt();
- m_LoadingIconPersistent = Stack->Pop()->GetBool();
-
- delete m_LoadingIcon;
- m_LoadingIcon = new CBSprite(this);
- if (!m_LoadingIcon || FAILED(m_LoadingIcon->LoadFile(Filename))) {
- delete m_LoadingIcon;
- m_LoadingIcon = NULL;
+ _loadingIconX = Stack->Pop()->GetInt();
+ _loadingIconY = Stack->Pop()->GetInt();
+ _loadingIconPersistent = Stack->Pop()->GetBool();
+
+ delete _loadingIcon;
+ _loadingIcon = new CBSprite(this);
+ if (!_loadingIcon || FAILED(_loadingIcon->LoadFile(Filename))) {
+ delete _loadingIcon;
+ _loadingIcon = NULL;
} else {
DisplayContent(false, true);
- Game->m_Renderer->Flip();
- Game->m_Renderer->InitLoop();
+ Game->_renderer->Flip();
+ Game->_renderer->InitLoop();
}
Stack->PushNULL();
@@ -1941,8 +1941,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "HideLoadingIcon") == 0) {
Stack->CorrectParams(0);
- delete m_LoadingIcon;
- m_LoadingIcon = NULL;
+ delete _loadingIcon;
+ _loadingIcon = NULL;
Stack->PushNULL();
return S_OK;
}
@@ -1954,7 +1954,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
Stack->CorrectParams(1);
char *Filename = Stack->Pop()->GetString();
- m_Renderer->DumpData(Filename);
+ _renderer->DumpData(Filename);
Stack->PushNULL();
return S_OK;
@@ -1978,11 +1978,11 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "StoreSaveThumbnail") == 0) {
Stack->CorrectParams(0);
- delete m_CachedThumbnail;
- m_CachedThumbnail = new CBSaveThumbHelper(this);
- if (FAILED(m_CachedThumbnail->StoreThumbnail())) {
- delete m_CachedThumbnail;
- m_CachedThumbnail = NULL;
+ delete _cachedThumbnail;
+ _cachedThumbnail = new CBSaveThumbHelper(this);
+ if (FAILED(_cachedThumbnail->StoreThumbnail())) {
+ delete _cachedThumbnail;
+ _cachedThumbnail = NULL;
Stack->PushBool(false);
} else Stack->PushBool(true);
@@ -1994,8 +1994,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DeleteSaveThumbnail") == 0) {
Stack->CorrectParams(0);
- delete m_CachedThumbnail;
- m_CachedThumbnail = NULL;
+ delete _cachedThumbnail;
+ _cachedThumbnail = NULL;
Stack->PushNULL();
return S_OK;
@@ -2009,7 +2009,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
char *Filename = Stack->Pop()->GetString();
bool AsHex = Stack->Pop()->GetBool(false);
- CBFile *File = m_FileManager->OpenFile(Filename, false);
+ CBFile *File = _fileManager->OpenFile(Filename, false);
if (File) {
crc remainder = crc_initialize();
byte Buf[1024];
@@ -2033,7 +2033,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
} else
Stack->PushInt(checksum);
- m_FileManager->CloseFile(File);
+ _fileManager->CloseFile(File);
File = NULL;
} else Stack->PushNULL();
@@ -2045,7 +2045,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "EnableScriptProfiling") == 0) {
Stack->CorrectParams(0);
- m_ScEngine->EnableProfiling();
+ _scEngine->EnableProfiling();
Stack->PushNULL();
return S_OK;
@@ -2056,7 +2056,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DisableScriptProfiling") == 0) {
Stack->CorrectParams(0);
- m_ScEngine->DisableProfiling();
+ _scEngine->DisableProfiling();
Stack->PushNULL();
return S_OK;
@@ -2094,124 +2094,124 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
CScValue *CBGame::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("game");
- return m_ScValue;
+ _scValue->SetString("game");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Name") == 0) {
- m_ScValue->SetString(m_Name);
- return m_ScValue;
+ _scValue->SetString(_name);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Hwnd (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Hwnd") == 0) {
- m_ScValue->SetInt((int)m_Renderer->m_Window);
- return m_ScValue;
+ _scValue->SetInt((int)_renderer->_window);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// CurrentTime (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CurrentTime") == 0) {
- m_ScValue->SetInt((int)m_Timer);
- return m_ScValue;
+ _scValue->SetInt((int)_timer);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// WindowsTime (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WindowsTime") == 0) {
- m_ScValue->SetInt((int)CBPlatform::GetTime());
- return m_ScValue;
+ _scValue->SetInt((int)CBPlatform::GetTime());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// WindowedMode (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WindowedMode") == 0) {
- m_ScValue->SetBool(m_Renderer->m_Windowed);
- return m_ScValue;
+ _scValue->SetBool(_renderer->_windowed);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MouseX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MouseX") == 0) {
- m_ScValue->SetInt(m_MousePos.x);
- return m_ScValue;
+ _scValue->SetInt(_mousePos.x);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MouseY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MouseY") == 0) {
- m_ScValue->SetInt(m_MousePos.y);
- return m_ScValue;
+ _scValue->SetInt(_mousePos.y);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MainObject
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MainObject") == 0) {
- m_ScValue->SetNative(m_MainObject, true);
- return m_ScValue;
+ _scValue->SetNative(_mainObject, true);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ActiveObject (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ActiveObject") == 0) {
- m_ScValue->SetNative(m_ActiveObject, true);
- return m_ScValue;
+ _scValue->SetNative(_activeObject, true);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScreenWidth (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScreenWidth") == 0) {
- m_ScValue->SetInt(m_Renderer->m_Width);
- return m_ScValue;
+ _scValue->SetInt(_renderer->_width);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScreenHeight (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScreenHeight") == 0) {
- m_ScValue->SetInt(m_Renderer->m_Height);
- return m_ScValue;
+ _scValue->SetInt(_renderer->_height);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Interactive
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Interactive") == 0) {
- m_ScValue->SetBool(m_Interactive);
- return m_ScValue;
+ _scValue->SetBool(_interactive);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// DebugMode (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DebugMode") == 0) {
- m_ScValue->SetBool(m_DEBUG_DebugMode);
- return m_ScValue;
+ _scValue->SetBool(_dEBUG_DebugMode);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SoundAvailable (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SoundAvailable") == 0) {
- m_ScValue->SetBool(m_SoundMgr->m_SoundAvailable);
- return m_ScValue;
+ _scValue->SetBool(_soundMgr->_soundAvailable);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -2219,8 +2219,8 @@ CScValue *CBGame::ScGetProperty(char *Name) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SFXVolume") == 0) {
Game->LOG(0, "**Warning** The SFXVolume attribute is obsolete");
- m_ScValue->SetInt(m_SoundMgr->GetVolumePercent(SOUND_SFX));
- return m_ScValue;
+ _scValue->SetInt(_soundMgr->GetVolumePercent(SOUND_SFX));
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -2228,8 +2228,8 @@ CScValue *CBGame::ScGetProperty(char *Name) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SpeechVolume") == 0) {
Game->LOG(0, "**Warning** The SpeechVolume attribute is obsolete");
- m_ScValue->SetInt(m_SoundMgr->GetVolumePercent(SOUND_SPEECH));
- return m_ScValue;
+ _scValue->SetInt(_soundMgr->GetVolumePercent(SOUND_SPEECH));
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -2237,8 +2237,8 @@ CScValue *CBGame::ScGetProperty(char *Name) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MusicVolume") == 0) {
Game->LOG(0, "**Warning** The MusicVolume attribute is obsolete");
- m_ScValue->SetInt(m_SoundMgr->GetVolumePercent(SOUND_MUSIC));
- return m_ScValue;
+ _scValue->SetInt(_soundMgr->GetVolumePercent(SOUND_MUSIC));
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -2246,97 +2246,97 @@ CScValue *CBGame::ScGetProperty(char *Name) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MasterVolume") == 0) {
Game->LOG(0, "**Warning** The MasterVolume attribute is obsolete");
- m_ScValue->SetInt(m_SoundMgr->GetMasterVolumePercent());
- return m_ScValue;
+ _scValue->SetInt(_soundMgr->GetMasterVolumePercent());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Keyboard (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Keyboard") == 0) {
- if (m_KeyboardState) m_ScValue->SetNative(m_KeyboardState, true);
- else m_ScValue->SetNULL();
+ if (_keyboardState) _scValue->SetNative(_keyboardState, true);
+ else _scValue->SetNULL();
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Subtitles
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Subtitles") == 0) {
- m_ScValue->SetBool(m_Subtitles);
- return m_ScValue;
+ _scValue->SetBool(_subtitles);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SubtitlesSpeed
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesSpeed") == 0) {
- m_ScValue->SetInt(m_SubtitlesSpeed);
- return m_ScValue;
+ _scValue->SetInt(_subtitlesSpeed);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// VideoSubtitles
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "VideoSubtitles") == 0) {
- m_ScValue->SetBool(m_VideoSubtitles);
- return m_ScValue;
+ _scValue->SetBool(_videoSubtitles);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// FPS (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FPS") == 0) {
- m_ScValue->SetInt(m_Fps);
- return m_ScValue;
+ _scValue->SetInt(_fps);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AcceleratedMode / Accelerated (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AcceleratedMode") == 0 || strcmp(Name, "Accelerated") == 0) {
- m_ScValue->SetBool(m_UseD3D);
- return m_ScValue;
+ _scValue->SetBool(_useD3D);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TextEncoding
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TextEncoding") == 0) {
- m_ScValue->SetInt(m_TextEncoding);
- return m_ScValue;
+ _scValue->SetInt(_textEncoding);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TextRTL
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TextRTL") == 0) {
- m_ScValue->SetBool(m_TextRTL);
- return m_ScValue;
+ _scValue->SetBool(_textRTL);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SoundBufferSize
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SoundBufferSize") == 0) {
- m_ScValue->SetInt(m_SoundBufferSizeSec);
- return m_ScValue;
+ _scValue->SetInt(_soundBufferSizeSec);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SuspendedRendering
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SuspendedRendering") == 0) {
- m_ScValue->SetBool(m_SuspendedRendering);
- return m_ScValue;
+ _scValue->SetBool(_suspendedRendering);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SuppressScriptErrors
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SuppressScriptErrors") == 0) {
- m_ScValue->SetBool(m_SuppressScriptErrors);
- return m_ScValue;
+ _scValue->SetBool(_suppressScriptErrors);
+ return _scValue;
}
@@ -2344,72 +2344,72 @@ CScValue *CBGame::ScGetProperty(char *Name) {
// Frozen
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Frozen") == 0) {
- m_ScValue->SetBool(m_State == GAME_FROZEN);
- return m_ScValue;
+ _scValue->SetBool(_state == GAME_FROZEN);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccTTSEnabled
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccTTSEnabled") == 0) {
- m_ScValue->SetBool(false);
- return m_ScValue;
+ _scValue->SetBool(false);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccTTSTalk
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccTTSTalk") == 0) {
- m_ScValue->SetBool(false);
- return m_ScValue;
+ _scValue->SetBool(false);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccTTSCaptions
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccTTSCaptions") == 0) {
- m_ScValue->SetBool(false);
- return m_ScValue;
+ _scValue->SetBool(false);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccTTSKeypress
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccTTSKeypress") == 0) {
- m_ScValue->SetBool(false);
- return m_ScValue;
+ _scValue->SetBool(false);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccKeyboardEnabled
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccKeyboardEnabled") == 0) {
- m_ScValue->SetBool(false);
- return m_ScValue;
+ _scValue->SetBool(false);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccKeyboardCursorSkip
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccKeyboardCursorSkip") == 0) {
- m_ScValue->SetBool(false);
- return m_ScValue;
+ _scValue->SetBool(false);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccKeyboardPause
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccKeyboardPause") == 0) {
- m_ScValue->SetBool(false);
- return m_ScValue;
+ _scValue->SetBool(false);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AutorunDisabled
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AutorunDisabled") == 0) {
- m_ScValue->SetBool(m_AutorunDisabled);
- return m_ScValue;
+ _scValue->SetBool(_autorunDisabled);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -2417,66 +2417,66 @@ CScValue *CBGame::ScGetProperty(char *Name) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SaveDirectory") == 0) {
AnsiString dataDir = GetDataDir();
- m_ScValue->SetString((char *)dataDir.c_str());
- return m_ScValue;
+ _scValue->SetString((char *)dataDir.c_str());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AutoSaveOnExit
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AutoSaveOnExit") == 0) {
- m_ScValue->SetBool(m_AutoSaveOnExit);
- return m_ScValue;
+ _scValue->SetBool(_autoSaveOnExit);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AutoSaveSlot
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AutoSaveSlot") == 0) {
- m_ScValue->SetInt(m_AutoSaveSlot);
- return m_ScValue;
+ _scValue->SetInt(_autoSaveSlot);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// CursorHidden
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CursorHidden") == 0) {
- m_ScValue->SetBool(m_CursorHidden);
- return m_ScValue;
+ _scValue->SetBool(_cursorHidden);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Platform (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Platform") == 0) {
- m_ScValue->SetString(CBPlatform::GetPlatformName().c_str());
- return m_ScValue;
+ _scValue->SetString(CBPlatform::GetPlatformName().c_str());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// DeviceType (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DeviceType") == 0) {
- m_ScValue->SetString(GetDeviceType().c_str());
- return m_ScValue;
+ _scValue->SetString(GetDeviceType().c_str());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MostRecentSaveSlot (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MostRecentSaveSlot") == 0) {
- m_ScValue->SetInt(m_Registry->ReadInt("System", "MostRecentSaveSlot", -1));
- return m_ScValue;
+ _scValue->SetInt(_registry->ReadInt("System", "MostRecentSaveSlot", -1));
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Store (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Store") == 0) {
- if (m_Store) m_ScValue->SetNative(m_Store, true);
- else m_ScValue->SetNULL();
+ if (_store) _scValue->SetNative(_store, true);
+ else _scValue->SetNULL();
- return m_ScValue;
+ return _scValue;
}
else return CBObject::ScGetProperty(Name);
@@ -2498,7 +2498,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// MouseX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MouseX") == 0) {
- m_MousePos.x = Value->GetInt();
+ _mousePos.x = Value->GetInt();
ResetMousePos();
return S_OK;
}
@@ -2507,7 +2507,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// MouseY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MouseY") == 0) {
- m_MousePos.y = Value->GetInt();
+ _mousePos.y = Value->GetInt();
ResetMousePos();
return S_OK;
}
@@ -2526,7 +2526,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MainObject") == 0) {
CBScriptable *obj = Value->GetNative();
- if (obj == NULL || ValidObject((CBObject *)obj)) m_MainObject = (CBObject *)obj;
+ if (obj == NULL || ValidObject((CBObject *)obj)) _mainObject = (CBObject *)obj;
return S_OK;
}
@@ -2543,7 +2543,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SFXVolume") == 0) {
Game->LOG(0, "**Warning** The SFXVolume attribute is obsolete");
- Game->m_SoundMgr->SetVolumePercent(SOUND_SFX, (byte )Value->GetInt());
+ Game->_soundMgr->SetVolumePercent(SOUND_SFX, (byte )Value->GetInt());
return S_OK;
}
@@ -2552,7 +2552,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SpeechVolume") == 0) {
Game->LOG(0, "**Warning** The SpeechVolume attribute is obsolete");
- Game->m_SoundMgr->SetVolumePercent(SOUND_SPEECH, (byte )Value->GetInt());
+ Game->_soundMgr->SetVolumePercent(SOUND_SPEECH, (byte )Value->GetInt());
return S_OK;
}
@@ -2561,7 +2561,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MusicVolume") == 0) {
Game->LOG(0, "**Warning** The MusicVolume attribute is obsolete");
- Game->m_SoundMgr->SetVolumePercent(SOUND_MUSIC, (byte )Value->GetInt());
+ Game->_soundMgr->SetVolumePercent(SOUND_MUSIC, (byte )Value->GetInt());
return S_OK;
}
@@ -2570,7 +2570,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MasterVolume") == 0) {
Game->LOG(0, "**Warning** The MasterVolume attribute is obsolete");
- Game->m_SoundMgr->SetMasterVolumePercent((byte )Value->GetInt());
+ Game->_soundMgr->SetMasterVolumePercent((byte )Value->GetInt());
return S_OK;
}
@@ -2578,7 +2578,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// Subtitles
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Subtitles") == 0) {
- m_Subtitles = Value->GetBool();
+ _subtitles = Value->GetBool();
return S_OK;
}
@@ -2586,7 +2586,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// SubtitlesSpeed
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SubtitlesSpeed") == 0) {
- m_SubtitlesSpeed = Value->GetInt();
+ _subtitlesSpeed = Value->GetInt();
return S_OK;
}
@@ -2594,7 +2594,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// VideoSubtitles
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "VideoSubtitles") == 0) {
- m_VideoSubtitles = Value->GetBool();
+ _videoSubtitles = Value->GetBool();
return S_OK;
}
@@ -2605,7 +2605,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
int Enc = Value->GetInt();
if (Enc < 0) Enc = 0;
if (Enc >= NUM_TEXT_ENCODINGS) Enc = NUM_TEXT_ENCODINGS - 1;
- m_TextEncoding = (TTextEncoding)Enc;
+ _textEncoding = (TTextEncoding)Enc;
return S_OK;
}
@@ -2613,7 +2613,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// TextRTL
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TextRTL") == 0) {
- m_TextRTL = Value->GetBool();
+ _textRTL = Value->GetBool();
return S_OK;
}
@@ -2621,8 +2621,8 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// SoundBufferSize
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SoundBufferSize") == 0) {
- m_SoundBufferSizeSec = Value->GetInt();
- m_SoundBufferSizeSec = std::max(3, m_SoundBufferSizeSec);
+ _soundBufferSizeSec = Value->GetInt();
+ _soundBufferSizeSec = std::max(3, _soundBufferSizeSec);
return S_OK;
}
@@ -2630,7 +2630,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// SuspendedRendering
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SuspendedRendering") == 0) {
- m_SuspendedRendering = Value->GetBool();
+ _suspendedRendering = Value->GetBool();
return S_OK;
}
@@ -2638,7 +2638,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// SuppressScriptErrors
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SuppressScriptErrors") == 0) {
- m_SuppressScriptErrors = Value->GetBool();
+ _suppressScriptErrors = Value->GetBool();
return S_OK;
}
@@ -2646,7 +2646,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// AutorunDisabled
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AutorunDisabled") == 0) {
- m_AutorunDisabled = Value->GetBool();
+ _autorunDisabled = Value->GetBool();
return S_OK;
}
@@ -2654,7 +2654,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// AutoSaveOnExit
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AutoSaveOnExit") == 0) {
- m_AutoSaveOnExit = Value->GetBool();
+ _autoSaveOnExit = Value->GetBool();
return S_OK;
}
@@ -2662,7 +2662,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// AutoSaveSlot
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AutoSaveSlot") == 0) {
- m_AutoSaveSlot = Value->GetInt();
+ _autoSaveSlot = Value->GetInt();
return S_OK;
}
@@ -2670,7 +2670,7 @@ HRESULT CBGame::ScSetProperty(char *Name, CScValue *Value) {
// CursorHidden
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CursorHidden") == 0) {
- m_CursorHidden = Value->GetBool();
+ _cursorHidden = Value->GetBool();
return S_OK;
}
@@ -2688,15 +2688,15 @@ char *CBGame::ScToString() {
#define QUICK_MSG_DURATION 3000
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::DisplayQuickMsg() {
- if (m_QuickMessages.GetSize() == 0 || !m_SystemFont) return S_OK;
+ if (_quickMessages.GetSize() == 0 || !_systemFont) return S_OK;
int i;
// update
- for (i = 0; i < m_QuickMessages.GetSize(); i++) {
- if (m_CurrentTime - m_QuickMessages[i]->m_StartTime >= QUICK_MSG_DURATION) {
- delete m_QuickMessages[i];
- m_QuickMessages.RemoveAt(i);
+ for (i = 0; i < _quickMessages.GetSize(); i++) {
+ if (_currentTime - _quickMessages[i]->_startTime >= QUICK_MSG_DURATION) {
+ delete _quickMessages[i];
+ _quickMessages.RemoveAt(i);
i--;
}
}
@@ -2704,9 +2704,9 @@ HRESULT CBGame::DisplayQuickMsg() {
int PosY = 20;
// display
- for (i = 0; i < m_QuickMessages.GetSize(); i++) {
- m_SystemFont->DrawText((byte *)m_QuickMessages[i]->GetText(), 0, PosY, m_Renderer->m_Width);
- PosY += m_SystemFont->GetTextHeight((byte *)m_QuickMessages[i]->GetText(), m_Renderer->m_Width);
+ for (i = 0; i < _quickMessages.GetSize(); i++) {
+ _systemFont->DrawText((byte *)_quickMessages[i]->GetText(), 0, PosY, _renderer->_width);
+ PosY += _systemFont->GetTextHeight((byte *)_quickMessages[i]->GetText(), _renderer->_width);
}
return S_OK;
}
@@ -2715,11 +2715,11 @@ HRESULT CBGame::DisplayQuickMsg() {
#define MAX_QUICK_MSG 5
//////////////////////////////////////////////////////////////////////////
void CBGame::QuickMessage(char *Text) {
- if (m_QuickMessages.GetSize() >= MAX_QUICK_MSG) {
- delete m_QuickMessages[0];
- m_QuickMessages.RemoveAt(0);
+ if (_quickMessages.GetSize() >= MAX_QUICK_MSG) {
+ delete _quickMessages[0];
+ _quickMessages.RemoveAt(0);
}
- m_QuickMessages.Add(new CBQuickMsg(Game, Text));
+ _quickMessages.Add(new CBQuickMsg(Game, Text));
}
@@ -2738,7 +2738,7 @@ void CBGame::QuickMessageForm(LPSTR fmt, ...) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::RegisterObject(CBObject *Object) {
- m_RegObjects.Add(Object);
+ _regObjects.Add(Object);
return S_OK;
}
@@ -2750,30 +2750,30 @@ HRESULT CBGame::UnregisterObject(CBObject *Object) {
int i;
// is it a window?
- for (i = 0; i < m_Windows.GetSize(); i++) {
- if ((CBObject *)m_Windows[i] == Object) {
- m_Windows.RemoveAt(i);
+ for (i = 0; i < _windows.GetSize(); i++) {
+ if ((CBObject *)_windows[i] == Object) {
+ _windows.RemoveAt(i);
// get new focused window
- if (m_FocusedWindow == Object) m_FocusedWindow = NULL;
+ if (_focusedWindow == Object) _focusedWindow = NULL;
break;
}
}
// is it active object?
- if (m_ActiveObject == Object) m_ActiveObject = NULL;
+ if (_activeObject == Object) _activeObject = NULL;
// is it main object?
- if (m_MainObject == Object) m_MainObject = NULL;
+ if (_mainObject == Object) _mainObject = NULL;
- if (m_Store) m_Store->OnObjectDestroyed(Object);
+ if (_store) _store->OnObjectDestroyed(Object);
// destroy object
- for (i = 0; i < m_RegObjects.GetSize(); i++) {
- if (m_RegObjects[i] == Object) {
- m_RegObjects.RemoveAt(i);
- if (!m_LoadInProgress) CSysClassRegistry::GetInstance()->EnumInstances(InvalidateValues, "CScValue", (void *)Object);
+ for (i = 0; i < _regObjects.GetSize(); i++) {
+ if (_regObjects[i] == Object) {
+ _regObjects.RemoveAt(i);
+ if (!_loadInProgress) CSysClassRegistry::GetInstance()->EnumInstances(InvalidateValues, "CScValue", (void *)Object);
delete Object;
return S_OK;
}
@@ -2787,8 +2787,8 @@ HRESULT CBGame::UnregisterObject(CBObject *Object) {
void CBGame::InvalidateValues(void *Value, void *Data) {
CScValue *val = (CScValue *)Value;
if (val->IsNative() && val->GetNative() == Data) {
- if (!val->m_Persistent && ((CBScriptable *)Data)->m_RefCount == 1) {
- ((CBScriptable *)Data)->m_RefCount++;
+ if (!val->_persistent && ((CBScriptable *)Data)->_refCount == 1) {
+ ((CBScriptable *)Data)->_refCount++;
}
val->SetNative(NULL);
val->SetNULL();
@@ -2802,8 +2802,8 @@ bool CBGame::ValidObject(CBObject *Object) {
if (!Object) return false;
if (Object == this) return true;
- for (int i = 0; i < m_RegObjects.GetSize(); i++) {
- if (m_RegObjects[i] == Object) return true;
+ for (int i = 0; i < _regObjects.GetSize(); i++) {
+ if (_regObjects[i] == Object) return true;
}
return false;
}
@@ -2811,44 +2811,44 @@ bool CBGame::ValidObject(CBObject *Object) {
//////////////////////////////////////////////////////////////////////////
void CBGame::PublishNatives() {
- if (!m_ScEngine || !m_ScEngine->m_CompilerAvailable) return;
-
- m_ScEngine->ExtDefineFunction("LOG");
- m_ScEngine->ExtDefineFunction("String");
- m_ScEngine->ExtDefineFunction("MemBuffer");
- m_ScEngine->ExtDefineFunction("File");
- m_ScEngine->ExtDefineFunction("Date");
- m_ScEngine->ExtDefineFunction("Array");
- m_ScEngine->ExtDefineFunction("TcpClient");
- m_ScEngine->ExtDefineFunction("Object");
- //m_ScEngine->ExtDefineFunction("Game");
- m_ScEngine->ExtDefineFunction("Sleep");
- m_ScEngine->ExtDefineFunction("WaitFor");
- m_ScEngine->ExtDefineFunction("Random");
- m_ScEngine->ExtDefineFunction("SetScriptTimeSlice");
- m_ScEngine->ExtDefineFunction("MakeRGBA");
- m_ScEngine->ExtDefineFunction("MakeRGB");
- m_ScEngine->ExtDefineFunction("MakeHSL");
- m_ScEngine->ExtDefineFunction("RGB");
- m_ScEngine->ExtDefineFunction("GetRValue");
- m_ScEngine->ExtDefineFunction("GetGValue");
- m_ScEngine->ExtDefineFunction("GetBValue");
- m_ScEngine->ExtDefineFunction("GetAValue");
- m_ScEngine->ExtDefineFunction("GetHValue");
- m_ScEngine->ExtDefineFunction("GetSValue");
- m_ScEngine->ExtDefineFunction("GetLValue");
- m_ScEngine->ExtDefineFunction("Debug");
-
- m_ScEngine->ExtDefineFunction("ToString");
- m_ScEngine->ExtDefineFunction("ToInt");
- m_ScEngine->ExtDefineFunction("ToBool");
- m_ScEngine->ExtDefineFunction("ToFloat");
-
- m_ScEngine->ExtDefineVariable("Game");
- m_ScEngine->ExtDefineVariable("Math");
- m_ScEngine->ExtDefineVariable("Directory");
- m_ScEngine->ExtDefineVariable("self");
- m_ScEngine->ExtDefineVariable("this");
+ if (!_scEngine || !_scEngine->_compilerAvailable) return;
+
+ _scEngine->ExtDefineFunction("LOG");
+ _scEngine->ExtDefineFunction("String");
+ _scEngine->ExtDefineFunction("MemBuffer");
+ _scEngine->ExtDefineFunction("File");
+ _scEngine->ExtDefineFunction("Date");
+ _scEngine->ExtDefineFunction("Array");
+ _scEngine->ExtDefineFunction("TcpClient");
+ _scEngine->ExtDefineFunction("Object");
+ //_scEngine->ExtDefineFunction("Game");
+ _scEngine->ExtDefineFunction("Sleep");
+ _scEngine->ExtDefineFunction("WaitFor");
+ _scEngine->ExtDefineFunction("Random");
+ _scEngine->ExtDefineFunction("SetScriptTimeSlice");
+ _scEngine->ExtDefineFunction("MakeRGBA");
+ _scEngine->ExtDefineFunction("MakeRGB");
+ _scEngine->ExtDefineFunction("MakeHSL");
+ _scEngine->ExtDefineFunction("RGB");
+ _scEngine->ExtDefineFunction("GetRValue");
+ _scEngine->ExtDefineFunction("GetGValue");
+ _scEngine->ExtDefineFunction("GetBValue");
+ _scEngine->ExtDefineFunction("GetAValue");
+ _scEngine->ExtDefineFunction("GetHValue");
+ _scEngine->ExtDefineFunction("GetSValue");
+ _scEngine->ExtDefineFunction("GetLValue");
+ _scEngine->ExtDefineFunction("Debug");
+
+ _scEngine->ExtDefineFunction("ToString");
+ _scEngine->ExtDefineFunction("ToInt");
+ _scEngine->ExtDefineFunction("ToBool");
+ _scEngine->ExtDefineFunction("ToFloat");
+
+ _scEngine->ExtDefineVariable("Game");
+ _scEngine->ExtDefineVariable("Math");
+ _scEngine->ExtDefineVariable("Directory");
+ _scEngine->ExtDefineVariable("self");
+ _scEngine->ExtDefineVariable("this");
}
@@ -2964,7 +2964,7 @@ HRESULT CBGame::ExternalCall(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "SetScriptTimeSlice") == 0) {
Stack->CorrectParams(1);
- Script->m_TimeSlice = (uint32)Stack->Pop()->GetInt();
+ Script->_timeSlice = (uint32)Stack->Pop()->GetInt();
Stack->PushNULL();
}
@@ -3078,7 +3078,7 @@ HRESULT CBGame::ExternalCall(CScScript *Script, CScStack *Stack, CScStack *ThisS
else if (strcmp(Name, "Debug") == 0) {
Stack->CorrectParams(0);
- if (Game->GetDebugMgr()->m_Enabled) {
+ if (Game->GetDebugMgr()->_enabled) {
Game->GetDebugMgr()->OnScriptHitBreakpoint(Script);
Script->Sleep(0);
}
@@ -3138,15 +3138,15 @@ HRESULT CBGame::ExternalCall(CScScript *Script, CScStack *Stack, CScStack *ThisS
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::ShowCursor() {
- if (m_CursorHidden) return S_OK;
+ if (_cursorHidden) return S_OK;
- if (!m_Interactive && Game->m_State == GAME_RUNNING) {
- if (m_CursorNoninteractive) return DrawCursor(m_CursorNoninteractive);
+ if (!_interactive && Game->_state == GAME_RUNNING) {
+ if (_cursorNoninteractive) return DrawCursor(_cursorNoninteractive);
} else {
- if (m_ActiveObject && !FAILED(m_ActiveObject->ShowCursor())) return S_OK;
+ if (_activeObject && !FAILED(_activeObject->ShowCursor())) return S_OK;
else {
- if (m_ActiveObject && m_ActiveCursor && m_ActiveObject->GetExtendedFlag("usable")) return DrawCursor(m_ActiveCursor);
- else if (m_Cursor) return DrawCursor(m_Cursor);
+ if (_activeObject && _activeCursor && _activeObject->GetExtendedFlag("usable")) return DrawCursor(_activeCursor);
+ else if (_cursor) return DrawCursor(_cursor);
}
}
return E_FAIL;
@@ -3164,20 +3164,20 @@ HRESULT CBGame::SaveGame(int slot, char *desc, bool quickSave) {
HRESULT ret;
- m_IndicatorDisplay = true;
- m_IndicatorProgress = 0;
+ _indicatorDisplay = true;
+ _indicatorProgress = 0;
CBPersistMgr *pm = new CBPersistMgr(Game);
if (FAILED(ret = pm->InitSave(desc))) goto save_finish;
if (!quickSave) {
- delete m_SaveLoadImage;
- m_SaveLoadImage = NULL;
- if (m_SaveImageName) {
- m_SaveLoadImage = new CBSurfaceSDL(this);
-
- if (!m_SaveLoadImage || FAILED(m_SaveLoadImage->Create(m_SaveImageName, true, 0, 0, 0))) {
- delete m_SaveLoadImage;
- m_SaveLoadImage = NULL;
+ delete _saveLoadImage;
+ _saveLoadImage = NULL;
+ if (_saveImageName) {
+ _saveLoadImage = new CBSurfaceSDL(this);
+
+ if (!_saveLoadImage || FAILED(_saveLoadImage->Create(_saveImageName, true, 0, 0, 0))) {
+ delete _saveLoadImage;
+ _saveLoadImage = NULL;
}
}
}
@@ -3186,14 +3186,14 @@ HRESULT CBGame::SaveGame(int slot, char *desc, bool quickSave) {
if (FAILED(ret = CSysClassRegistry::GetInstance()->SaveInstances(Game, pm, quickSave))) goto save_finish;
if (FAILED(ret = pm->SaveFile(Filename))) goto save_finish;
- m_Registry->WriteInt("System", "MostRecentSaveSlot", slot);
+ _registry->WriteInt("System", "MostRecentSaveSlot", slot);
save_finish:
delete pm;
- m_IndicatorDisplay = false;
+ _indicatorDisplay = false;
- delete m_SaveLoadImage;
- m_SaveLoadImage = NULL;
+ delete _saveLoadImage;
+ _saveLoadImage = NULL;
return ret;
}
@@ -3203,8 +3203,8 @@ save_finish:
HRESULT CBGame::LoadGame(int Slot) {
//Game->LOG(0, "Load start %d", CBUtils::GetUsedMemMB());
- m_Loading = false;
- m_ScheduledLoadSlot = -1;
+ _loading = false;
+ _scheduledLoadSlot = -1;
char Filename[MAX_PATH + 1];
GetSaveSlotFilename(Slot, Filename);
@@ -3220,23 +3220,23 @@ HRESULT CBGame::LoadGame(char *Filename) {
HRESULT ret;
- delete m_SaveLoadImage;
- m_SaveLoadImage = NULL;
- if (m_LoadImageName) {
- m_SaveLoadImage = new CBSurfaceSDL(this);
+ delete _saveLoadImage;
+ _saveLoadImage = NULL;
+ if (_loadImageName) {
+ _saveLoadImage = new CBSurfaceSDL(this);
- if (!m_SaveLoadImage || FAILED(m_SaveLoadImage->Create(m_LoadImageName, true, 0, 0, 0))) {
- delete m_SaveLoadImage;
- m_SaveLoadImage = NULL;
+ if (!_saveLoadImage || FAILED(_saveLoadImage->Create(_loadImageName, true, 0, 0, 0))) {
+ delete _saveLoadImage;
+ _saveLoadImage = NULL;
}
}
- m_LoadInProgress = true;
- m_IndicatorDisplay = true;
- m_IndicatorProgress = 0;
+ _loadInProgress = true;
+ _indicatorDisplay = true;
+ _indicatorProgress = 0;
CBPersistMgr *pm = new CBPersistMgr(Game);
- m_DEBUG_AbsolutePathWarning = false;
+ _dEBUG_AbsolutePathWarning = false;
if (FAILED(ret = pm->InitLoad(Filename))) goto load_finish;
//if(FAILED(ret = Cleanup())) goto load_finish;
@@ -3249,19 +3249,19 @@ HRESULT CBGame::LoadGame(char *Filename) {
Game->ApplyEvent("AfterLoad", true);
DisplayContent(true, false);
- //m_Renderer->Flip();
+ //_renderer->Flip();
GetDebugMgr()->OnGameInit();
load_finish:
- m_DEBUG_AbsolutePathWarning = true;
+ _dEBUG_AbsolutePathWarning = true;
- m_IndicatorDisplay = false;
+ _indicatorDisplay = false;
delete pm;
- m_LoadInProgress = false;
+ _loadInProgress = false;
- delete m_SaveLoadImage;
- m_SaveLoadImage = NULL;
+ delete _saveLoadImage;
+ _saveLoadImage = NULL;
//Game->LOG(0, "Load end %d", CBUtils::GetUsedMemMB());
@@ -3277,8 +3277,8 @@ HRESULT CBGame::InitAfterLoad() {
CSysClassRegistry::GetInstance()->EnumInstances(AfterLoadFont, "CBFontTT", NULL);
CSysClassRegistry::GetInstance()->EnumInstances(AfterLoadScript, "CScScript", NULL);
- m_ScEngine->RefreshScriptBreakpoints();
- if (m_Store) m_Store->AfterLoad();
+ _scEngine->RefreshScriptBreakpoints();
+ if (_store) _store->AfterLoad();
return S_OK;
}
@@ -3318,21 +3318,21 @@ HRESULT CBGame::DisplayWindows(bool InGame) {
int i;
// did we lose focus? focus topmost window
- if (m_FocusedWindow == NULL || !m_FocusedWindow->m_Visible || m_FocusedWindow->m_Disable) {
- m_FocusedWindow = NULL;
- for (i = m_Windows.GetSize() - 1; i >= 0; i--) {
- if (m_Windows[i]->m_Visible && !m_Windows[i]->m_Disable) {
- m_FocusedWindow = m_Windows[i];
+ if (_focusedWindow == NULL || !_focusedWindow->_visible || _focusedWindow->_disable) {
+ _focusedWindow = NULL;
+ for (i = _windows.GetSize() - 1; i >= 0; i--) {
+ if (_windows[i]->_visible && !_windows[i]->_disable) {
+ _focusedWindow = _windows[i];
break;
}
}
}
// display all windows
- for (i = 0; i < m_Windows.GetSize(); i++) {
- if (m_Windows[i]->m_Visible && m_Windows[i]->m_InGame == InGame) {
+ for (i = 0; i < _windows.GetSize(); i++) {
+ if (_windows[i]->_visible && _windows[i]->_inGame == InGame) {
- res = m_Windows[i]->Display();
+ res = _windows[i]->Display();
if (FAILED(res)) return res;
}
}
@@ -3348,20 +3348,20 @@ HRESULT CBGame::PlayMusic(int Channel, char *Filename, bool Looping, uint32 Loop
return E_FAIL;
}
- delete m_Music[Channel];
- m_Music[Channel] = NULL;
+ delete _music[Channel];
+ _music[Channel] = NULL;
- m_Music[Channel] = new CBSound(Game);
- if (m_Music[Channel] && SUCCEEDED(m_Music[Channel]->SetSound(Filename, SOUND_MUSIC, true))) {
- if (m_MusicStartTime[Channel]) {
- m_Music[Channel]->SetPositionTime(m_MusicStartTime[Channel]);
- m_MusicStartTime[Channel] = 0;
+ _music[Channel] = new CBSound(Game);
+ if (_music[Channel] && SUCCEEDED(_music[Channel]->SetSound(Filename, SOUND_MUSIC, true))) {
+ if (_musicStartTime[Channel]) {
+ _music[Channel]->SetPositionTime(_musicStartTime[Channel]);
+ _musicStartTime[Channel] = 0;
}
- if (LoopStart) m_Music[Channel]->SetLoopStart(LoopStart);
- return m_Music[Channel]->Play(Looping);
+ if (LoopStart) _music[Channel]->SetLoopStart(LoopStart);
+ return _music[Channel]->Play(Looping);
} else {
- delete m_Music[Channel];
- m_Music[Channel] = NULL;
+ delete _music[Channel];
+ _music[Channel] = NULL;
return E_FAIL;
}
}
@@ -3374,10 +3374,10 @@ HRESULT CBGame::StopMusic(int Channel) {
return E_FAIL;
}
- if (m_Music[Channel]) {
- m_Music[Channel]->Stop();
- delete m_Music[Channel];
- m_Music[Channel] = NULL;
+ if (_music[Channel]) {
+ _music[Channel]->Stop();
+ delete _music[Channel];
+ _music[Channel] = NULL;
return S_OK;
} else return E_FAIL;
}
@@ -3390,7 +3390,7 @@ HRESULT CBGame::PauseMusic(int Channel) {
return E_FAIL;
}
- if (m_Music[Channel]) return m_Music[Channel]->Pause();
+ if (_music[Channel]) return _music[Channel]->Pause();
else return E_FAIL;
}
@@ -3402,7 +3402,7 @@ HRESULT CBGame::ResumeMusic(int Channel) {
return E_FAIL;
}
- if (m_Music[Channel]) return m_Music[Channel]->Resume();
+ if (_music[Channel]) return _music[Channel]->Resume();
else return E_FAIL;
}
@@ -3415,8 +3415,8 @@ HRESULT CBGame::SetMusicStartTime(int Channel, uint32 Time) {
return E_FAIL;
}
- m_MusicStartTime[Channel] = Time;
- if (m_Music[Channel] && m_Music[Channel]->IsPlaying()) return m_Music[Channel]->SetPositionTime(Time);
+ _musicStartTime[Channel] = Time;
+ if (_music[Channel] && _music[Channel]->IsPlaying()) return _music[Channel]->SetPositionTime(Time);
else return S_OK;
}
@@ -3443,7 +3443,7 @@ HRESULT CBGame::LoadSettings(char *Filename) {
TOKEN_TABLE_END
- byte *OrigBuffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *OrigBuffer = Game->_fileManager->ReadWholeFile(Filename);
if (OrigBuffer == NULL) {
Game->LOG(0, "CBGame::LoadSettings failed for file '%s'", Filename);
return E_FAIL;
@@ -3464,61 +3464,61 @@ HRESULT CBGame::LoadSettings(char *Filename) {
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
case TOKEN_GAME:
- SAFE_DELETE_ARRAY(m_SettingsGameFile);
- m_SettingsGameFile = new char[strlen((char *)params) + 1];
- if (m_SettingsGameFile) strcpy(m_SettingsGameFile, (char *)params);
+ SAFE_DELETE_ARRAY(_settingsGameFile);
+ _settingsGameFile = new char[strlen((char *)params) + 1];
+ if (_settingsGameFile) strcpy(_settingsGameFile, (char *)params);
break;
case TOKEN_STRING_TABLE:
- if (FAILED(m_StringTable->LoadFile((char *)params))) cmd = PARSERR_GENERIC;
+ if (FAILED(_stringTable->LoadFile((char *)params))) cmd = PARSERR_GENERIC;
break;
case TOKEN_RESOLUTION:
- parser.ScanStr((char *)params, "%d,%d", &m_SettingsResWidth, &m_SettingsResHeight);
+ parser.ScanStr((char *)params, "%d,%d", &_settingsResWidth, &_settingsResHeight);
break;
case TOKEN_REQUIRE_3D_ACCELERATION:
- parser.ScanStr((char *)params, "%b", &m_SettingsRequireAcceleration);
+ parser.ScanStr((char *)params, "%b", &_settingsRequireAcceleration);
break;
case TOKEN_REQUIRE_SOUND:
- parser.ScanStr((char *)params, "%b", &m_SettingsRequireSound);
+ parser.ScanStr((char *)params, "%b", &_settingsRequireSound);
break;
case TOKEN_HWTL_MODE:
- parser.ScanStr((char *)params, "%d", &m_SettingsTLMode);
+ parser.ScanStr((char *)params, "%d", &_settingsTLMode);
break;
case TOKEN_ALLOW_WINDOWED_MODE:
- parser.ScanStr((char *)params, "%b", &m_SettingsAllowWindowed);
+ parser.ScanStr((char *)params, "%b", &_settingsAllowWindowed);
break;
case TOKEN_ALLOW_DESKTOP_RES:
- parser.ScanStr((char *)params, "%b", &m_SettingsAllowDesktopRes);
+ parser.ScanStr((char *)params, "%b", &_settingsAllowDesktopRes);
break;
case TOKEN_ALLOW_ADVANCED:
- parser.ScanStr((char *)params, "%b", &m_SettingsAllowAdvanced);
+ parser.ScanStr((char *)params, "%b", &_settingsAllowAdvanced);
break;
case TOKEN_ALLOW_ACCESSIBILITY_TAB:
- parser.ScanStr((char *)params, "%b", &m_SettingsAllowAccessTab);
+ parser.ScanStr((char *)params, "%b", &_settingsAllowAccessTab);
break;
case TOKEN_ALLOW_ABOUT_TAB:
- parser.ScanStr((char *)params, "%b", &m_SettingsAllowAboutTab);
+ parser.ScanStr((char *)params, "%b", &_settingsAllowAboutTab);
break;
case TOKEN_REGISTRY_PATH:
- m_Registry->SetBasePath((char *)params);
+ _registry->SetBasePath((char *)params);
break;
case TOKEN_RICH_SAVED_GAMES:
- parser.ScanStr((char *)params, "%b", &m_RichSavedGames);
+ parser.ScanStr((char *)params, "%b", &_richSavedGames);
break;
case TOKEN_SAVED_GAME_EXT:
- CBUtils::SetString(&m_SavedGameExt, (char *)params);
+ CBUtils::SetString(&_savedGameExt, (char *)params);
break;
case TOKEN_GUID:
@@ -3534,9 +3534,9 @@ HRESULT CBGame::LoadSettings(char *Filename) {
ret = E_FAIL;
}
- m_SettingsAllowWindowed = m_Registry->ReadBool("Debug", "AllowWindowed", m_SettingsAllowWindowed);
- m_CompressedSavegames = m_Registry->ReadBool("Debug", "CompressedSavegames", m_CompressedSavegames);
- //m_CompressedSavegames = false;
+ _settingsAllowWindowed = _registry->ReadBool("Debug", "AllowWindowed", _settingsAllowWindowed);
+ _compressedSavegames = _registry->ReadBool("Debug", "CompressedSavegames", _compressedSavegames);
+ //_compressedSavegames = false;
delete [] OrigBuffer;
@@ -3546,95 +3546,95 @@ HRESULT CBGame::LoadSettings(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::Persist(CBPersistMgr *PersistMgr) {
- if (!PersistMgr->m_Saving) Cleanup();
+ if (!PersistMgr->_saving) Cleanup();
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_ActiveObject));
- PersistMgr->Transfer(TMEMBER(m_CapturedObject));
- PersistMgr->Transfer(TMEMBER(m_CursorNoninteractive));
- PersistMgr->Transfer(TMEMBER(m_DoNotExpandStrings));
- PersistMgr->Transfer(TMEMBER(m_EditorMode));
- PersistMgr->Transfer(TMEMBER(m_Fader));
- PersistMgr->Transfer(TMEMBER(m_FreezeLevel));
- PersistMgr->Transfer(TMEMBER(m_FocusedWindow));
- PersistMgr->Transfer(TMEMBER(m_FontStorage));
- PersistMgr->Transfer(TMEMBER(m_Interactive));
- PersistMgr->Transfer(TMEMBER(m_KeyboardState));
- PersistMgr->Transfer(TMEMBER(m_LastTime));
- PersistMgr->Transfer(TMEMBER(m_MainObject));
+ PersistMgr->Transfer(TMEMBER(_activeObject));
+ PersistMgr->Transfer(TMEMBER(_capturedObject));
+ PersistMgr->Transfer(TMEMBER(_cursorNoninteractive));
+ PersistMgr->Transfer(TMEMBER(_doNotExpandStrings));
+ PersistMgr->Transfer(TMEMBER(_editorMode));
+ PersistMgr->Transfer(TMEMBER(_fader));
+ PersistMgr->Transfer(TMEMBER(_freezeLevel));
+ PersistMgr->Transfer(TMEMBER(_focusedWindow));
+ PersistMgr->Transfer(TMEMBER(_fontStorage));
+ PersistMgr->Transfer(TMEMBER(_interactive));
+ PersistMgr->Transfer(TMEMBER(_keyboardState));
+ PersistMgr->Transfer(TMEMBER(_lastTime));
+ PersistMgr->Transfer(TMEMBER(_mainObject));
for (int i = 0; i < NUM_MUSIC_CHANNELS; i++) {
- PersistMgr->Transfer(TMEMBER(m_Music[i]));
- PersistMgr->Transfer(TMEMBER(m_MusicStartTime[i]));
+ PersistMgr->Transfer(TMEMBER(_music[i]));
+ PersistMgr->Transfer(TMEMBER(_musicStartTime[i]));
}
- PersistMgr->Transfer(TMEMBER(m_OffsetX));
- PersistMgr->Transfer(TMEMBER(m_OffsetY));
- PersistMgr->Transfer(TMEMBER(m_OffsetPercentX));
- PersistMgr->Transfer(TMEMBER(m_OffsetPercentY));
+ PersistMgr->Transfer(TMEMBER(_offsetX));
+ PersistMgr->Transfer(TMEMBER(_offsetY));
+ PersistMgr->Transfer(TMEMBER(_offsetPercentX));
+ PersistMgr->Transfer(TMEMBER(_offsetPercentY));
- PersistMgr->Transfer(TMEMBER(m_OrigInteractive));
- PersistMgr->Transfer(TMEMBER_INT(m_OrigState));
- PersistMgr->Transfer(TMEMBER(m_PersonalizedSave));
- PersistMgr->Transfer(TMEMBER(m_Quitting));
+ PersistMgr->Transfer(TMEMBER(_origInteractive));
+ PersistMgr->Transfer(TMEMBER_INT(_origState));
+ PersistMgr->Transfer(TMEMBER(_personalizedSave));
+ PersistMgr->Transfer(TMEMBER(_quitting));
- m_RegObjects.Persist(PersistMgr);
+ _regObjects.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_ScEngine));
- //PersistMgr->Transfer(TMEMBER(m_SoundMgr));
- PersistMgr->Transfer(TMEMBER_INT(m_State));
- //PersistMgr->Transfer(TMEMBER(m_SurfaceStorage));
- PersistMgr->Transfer(TMEMBER(m_Subtitles));
- PersistMgr->Transfer(TMEMBER(m_SubtitlesSpeed));
- PersistMgr->Transfer(TMEMBER(m_SystemFont));
- PersistMgr->Transfer(TMEMBER(m_VideoFont));
- PersistMgr->Transfer(TMEMBER(m_VideoSubtitles));
+ PersistMgr->Transfer(TMEMBER(_scEngine));
+ //PersistMgr->Transfer(TMEMBER(_soundMgr));
+ PersistMgr->Transfer(TMEMBER_INT(_state));
+ //PersistMgr->Transfer(TMEMBER(_surfaceStorage));
+ PersistMgr->Transfer(TMEMBER(_subtitles));
+ PersistMgr->Transfer(TMEMBER(_subtitlesSpeed));
+ PersistMgr->Transfer(TMEMBER(_systemFont));
+ PersistMgr->Transfer(TMEMBER(_videoFont));
+ PersistMgr->Transfer(TMEMBER(_videoSubtitles));
- PersistMgr->Transfer(TMEMBER(m_Timer));
- PersistMgr->Transfer(TMEMBER(m_TimerDelta));
- PersistMgr->Transfer(TMEMBER(m_TimerLast));
+ PersistMgr->Transfer(TMEMBER(_timer));
+ PersistMgr->Transfer(TMEMBER(_timerDelta));
+ PersistMgr->Transfer(TMEMBER(_timerLast));
- PersistMgr->Transfer(TMEMBER(m_LiveTimer));
- PersistMgr->Transfer(TMEMBER(m_LiveTimerDelta));
- PersistMgr->Transfer(TMEMBER(m_LiveTimerLast));
+ PersistMgr->Transfer(TMEMBER(_liveTimer));
+ PersistMgr->Transfer(TMEMBER(_liveTimerDelta));
+ PersistMgr->Transfer(TMEMBER(_liveTimerLast));
- PersistMgr->Transfer(TMEMBER(m_MusicCrossfadeRunning));
- PersistMgr->Transfer(TMEMBER(m_MusicCrossfadeStartTime));
- PersistMgr->Transfer(TMEMBER(m_MusicCrossfadeLength));
- PersistMgr->Transfer(TMEMBER(m_MusicCrossfadeChannel1));
- PersistMgr->Transfer(TMEMBER(m_MusicCrossfadeChannel2));
- PersistMgr->Transfer(TMEMBER(m_MusicCrossfadeSwap));
+ PersistMgr->Transfer(TMEMBER(_musicCrossfadeRunning));
+ PersistMgr->Transfer(TMEMBER(_musicCrossfadeStartTime));
+ PersistMgr->Transfer(TMEMBER(_musicCrossfadeLength));
+ PersistMgr->Transfer(TMEMBER(_musicCrossfadeChannel1));
+ PersistMgr->Transfer(TMEMBER(_musicCrossfadeChannel2));
+ PersistMgr->Transfer(TMEMBER(_musicCrossfadeSwap));
- PersistMgr->Transfer(TMEMBER(m_LoadImageName));
- PersistMgr->Transfer(TMEMBER(m_SaveImageName));
- PersistMgr->Transfer(TMEMBER(m_SaveImageX));
- PersistMgr->Transfer(TMEMBER(m_SaveImageY));
- PersistMgr->Transfer(TMEMBER(m_LoadImageX));
- PersistMgr->Transfer(TMEMBER(m_LoadImageY));
+ PersistMgr->Transfer(TMEMBER(_loadImageName));
+ PersistMgr->Transfer(TMEMBER(_saveImageName));
+ PersistMgr->Transfer(TMEMBER(_saveImageX));
+ PersistMgr->Transfer(TMEMBER(_saveImageY));
+ PersistMgr->Transfer(TMEMBER(_loadImageX));
+ PersistMgr->Transfer(TMEMBER(_loadImageY));
- PersistMgr->Transfer(TMEMBER_INT(m_TextEncoding));
- PersistMgr->Transfer(TMEMBER(m_TextRTL));
+ PersistMgr->Transfer(TMEMBER_INT(_textEncoding));
+ PersistMgr->Transfer(TMEMBER(_textRTL));
- PersistMgr->Transfer(TMEMBER(m_SoundBufferSizeSec));
- PersistMgr->Transfer(TMEMBER(m_SuspendedRendering));
+ PersistMgr->Transfer(TMEMBER(_soundBufferSizeSec));
+ PersistMgr->Transfer(TMEMBER(_suspendedRendering));
- PersistMgr->Transfer(TMEMBER(m_MouseLockRect));
+ PersistMgr->Transfer(TMEMBER(_mouseLockRect));
- m_Windows.Persist(PersistMgr);
+ _windows.Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_SuppressScriptErrors));
- PersistMgr->Transfer(TMEMBER(m_AutorunDisabled));
+ PersistMgr->Transfer(TMEMBER(_suppressScriptErrors));
+ PersistMgr->Transfer(TMEMBER(_autorunDisabled));
- PersistMgr->Transfer(TMEMBER(m_AutoSaveOnExit));
- PersistMgr->Transfer(TMEMBER(m_AutoSaveSlot));
- PersistMgr->Transfer(TMEMBER(m_CursorHidden));
+ PersistMgr->Transfer(TMEMBER(_autoSaveOnExit));
+ PersistMgr->Transfer(TMEMBER(_autoSaveSlot));
+ PersistMgr->Transfer(TMEMBER(_cursorHidden));
if (PersistMgr->CheckVersion(1, 0, 1))
- PersistMgr->Transfer(TMEMBER(m_Store));
+ PersistMgr->Transfer(TMEMBER(_store));
else
- m_Store = NULL;
+ _store = NULL;
- if (!PersistMgr->m_Saving) m_Quitting = false;
+ if (!PersistMgr->_saving) _quitting = false;
return S_OK;
}
@@ -3642,19 +3642,19 @@ HRESULT CBGame::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::FocusWindow(CUIWindow *Window) {
- CUIWindow *Prev = m_FocusedWindow;
+ CUIWindow *Prev = _focusedWindow;
int i;
- for (i = 0; i < m_Windows.GetSize(); i++) {
- if (m_Windows[i] == Window) {
- if (i < m_Windows.GetSize() - 1) {
- m_Windows.RemoveAt(i);
- m_Windows.Add(Window);
+ for (i = 0; i < _windows.GetSize(); i++) {
+ if (_windows[i] == Window) {
+ if (i < _windows.GetSize() - 1) {
+ _windows.RemoveAt(i);
+ _windows.Add(Window);
- Game->m_FocusedWindow = Window;
+ Game->_focusedWindow = Window;
}
- if (Window->m_Mode == WINDOW_NORMAL && Prev != Window && Game->ValidObject(Prev) && (Prev->m_Mode == WINDOW_EXCLUSIVE || Prev->m_Mode == WINDOW_SYSTEM_EXCLUSIVE))
+ if (Window->_mode == WINDOW_NORMAL && Prev != Window && Game->ValidObject(Prev) && (Prev->_mode == WINDOW_EXCLUSIVE || Prev->_mode == WINDOW_SYSTEM_EXCLUSIVE))
return FocusWindow(Prev);
else return S_OK;
}
@@ -3665,15 +3665,15 @@ HRESULT CBGame::FocusWindow(CUIWindow *Window) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::Freeze(bool IncludingMusic) {
- if (m_FreezeLevel == 0) {
- m_ScEngine->PauseAll();
- m_SoundMgr->PauseAll(IncludingMusic);
- m_OrigState = m_State;
- m_OrigInteractive = m_Interactive;
- m_Interactive = true;
+ if (_freezeLevel == 0) {
+ _scEngine->PauseAll();
+ _soundMgr->PauseAll(IncludingMusic);
+ _origState = _state;
+ _origInteractive = _interactive;
+ _interactive = true;
}
- m_State = GAME_FROZEN;
- m_FreezeLevel++;
+ _state = GAME_FROZEN;
+ _freezeLevel++;
return S_OK;
}
@@ -3681,14 +3681,14 @@ HRESULT CBGame::Freeze(bool IncludingMusic) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::Unfreeze() {
- if (m_FreezeLevel == 0) return S_OK;
+ if (_freezeLevel == 0) return S_OK;
- m_FreezeLevel--;
- if (m_FreezeLevel == 0) {
- m_State = m_OrigState;
- m_Interactive = m_OrigInteractive;
- m_ScEngine->ResumeAll();
- m_SoundMgr->ResumeAll();
+ _freezeLevel--;
+ if (_freezeLevel == 0) {
+ _state = _origState;
+ _interactive = _origInteractive;
+ _scEngine->ResumeAll();
+ _soundMgr->ResumeAll();
}
return S_OK;
@@ -3706,20 +3706,20 @@ bool CBGame::HandleKeypress(SDL_Event *event) {
#endif
if (event->type == SDL_KEYDOWN && event->key.keysym.sym == SDLK_RETURN && (event->key.keysym.mod == KMOD_LALT || event->key.keysym.mod == KMOD_RALT)) {
- m_Renderer->SwitchFullscreen();
+ _renderer->SwitchFullscreen();
return true;
}
- m_KeyboardState->ReadKey(event);
+ _keyboardState->ReadKey(event);
// TODO
#if 0
- if (m_FocusedWindow) {
- if (!Game->m_FocusedWindow->HandleKeypress(event)) {
+ if (_focusedWindow) {
+ if (!Game->_focusedWindow->HandleKeypress(event)) {
if (event->type != SDL_TEXTINPUT) {
- if (Game->m_FocusedWindow->CanHandleEvent("Keypress"))
- Game->m_FocusedWindow->ApplyEvent("Keypress");
+ if (Game->_focusedWindow->CanHandleEvent("Keypress"))
+ Game->_focusedWindow->ApplyEvent("Keypress");
else
ApplyEvent("Keypress");
}
@@ -3739,15 +3739,15 @@ bool CBGame::HandleKeypress(SDL_Event *event) {
//////////////////////////////////////////////////////////////////////////
bool CBGame::HandleMouseWheel(int Delta) {
bool Handled = false;
- if (m_FocusedWindow) {
- Handled = Game->m_FocusedWindow->HandleMouseWheel(Delta);
+ if (_focusedWindow) {
+ Handled = Game->_focusedWindow->HandleMouseWheel(Delta);
if (!Handled) {
- if (Delta < 0 && Game->m_FocusedWindow->CanHandleEvent("MouseWheelDown")) {
- Game->m_FocusedWindow->ApplyEvent("MouseWheelDown");
+ if (Delta < 0 && Game->_focusedWindow->CanHandleEvent("MouseWheelDown")) {
+ Game->_focusedWindow->ApplyEvent("MouseWheelDown");
Handled = true;
- } else if (Game->m_FocusedWindow->CanHandleEvent("MouseWheelUp")) {
- Game->m_FocusedWindow->ApplyEvent("MouseWheelUp");
+ } else if (Game->_focusedWindow->CanHandleEvent("MouseWheelUp")) {
+ Game->_focusedWindow->ApplyEvent("MouseWheelUp");
Handled = true;
}
@@ -3780,22 +3780,22 @@ HRESULT CBGame::GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byte
//////////////////////////////////////////////////////////////////////////
void CBGame::SetWindowTitle() {
- if (m_Renderer) {
+ if (_renderer) {
char Title[512];
- strcpy(Title, m_Caption[0]);
+ strcpy(Title, _caption[0]);
if (Title[0] != '\0') strcat(Title, " - ");
strcat(Title, "WME Lite");
Utf8String title;
- if (m_TextEncoding == TEXT_UTF8) {
+ if (_textEncoding == TEXT_UTF8) {
title = Utf8String(Title);
} else {
WideString wstr = StringUtil::AnsiToWide(Title);
title = StringUtil::WideToUtf8(wstr);
}
- CBRenderSDL *renderer = static_cast<CBRenderSDL *>(m_Renderer);
+ CBRenderSDL *renderer = static_cast<CBRenderSDL *>(_renderer);
// TODO
#if 0
SDL_SetWindowTitle(renderer->GetSdlWindow(), title.c_str());
@@ -3807,7 +3807,7 @@ void CBGame::SetWindowTitle() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::GetSaveSlotFilename(int Slot, char *Buffer) {
AnsiString dataDir = GetDataDir();
- sprintf(Buffer, "%s/save%03d.%s", dataDir.c_str(), Slot, m_SavedGameExt);
+ sprintf(Buffer, "%s/save%03d.%s", dataDir.c_str(), Slot, _savedGameExt);
return S_OK;
}
@@ -3818,7 +3818,7 @@ AnsiString CBGame::GetDataDir() {
#ifdef __IPHONEOS__
return userDir;
#else
- AnsiString baseDir = m_Registry->GetBasePath();
+ AnsiString baseDir = _registry->GetBasePath();
return PathUtil::Combine(userDir, baseDir);
#endif
}
@@ -3833,15 +3833,15 @@ HRESULT CBGame::GetSaveSlotDescription(int Slot, char *Buffer) {
CBPersistMgr *pm = new CBPersistMgr(Game);
if (!pm) return E_FAIL;
- m_DEBUG_AbsolutePathWarning = false;
+ _dEBUG_AbsolutePathWarning = false;
if (FAILED(pm->InitLoad(Filename))) {
- m_DEBUG_AbsolutePathWarning = true;
+ _dEBUG_AbsolutePathWarning = true;
delete pm;
return E_FAIL;
}
- m_DEBUG_AbsolutePathWarning = true;
- strcpy(Buffer, pm->m_SavedDescription);
+ _dEBUG_AbsolutePathWarning = true;
+ strcpy(Buffer, pm->_savedDescription);
delete pm;
return S_OK;
@@ -3853,10 +3853,10 @@ bool CBGame::IsSaveSlotUsed(int Slot) {
char Filename[MAX_PATH + 1];
GetSaveSlotFilename(Slot, Filename);
- CBFile *File = m_FileManager->OpenFile(Filename, false);
+ CBFile *File = _fileManager->OpenFile(Filename, false);
if (!File) return false;
- m_FileManager->CloseFile(File);
+ _fileManager->CloseFile(File);
return true;
}
@@ -3875,17 +3875,17 @@ HRESULT CBGame::EmptySaveSlot(int Slot) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::SetActiveObject(CBObject *Obj) {
// not-active when game is frozen
- if (Obj && !Game->m_Interactive && !Obj->m_NonIntMouseEvents) {
+ if (Obj && !Game->_interactive && !Obj->_nonIntMouseEvents) {
Obj = NULL;
}
- if (Obj == m_ActiveObject) return S_OK;
+ if (Obj == _activeObject) return S_OK;
- if (m_ActiveObject) m_ActiveObject->ApplyEvent("MouseLeave");
- //if(ValidObject(m_ActiveObject)) m_ActiveObject->ApplyEvent("MouseLeave");
- m_ActiveObject = Obj;
- if (m_ActiveObject) {
- m_ActiveObject->ApplyEvent("MouseEntry");
+ if (_activeObject) _activeObject->ApplyEvent("MouseLeave");
+ //if(ValidObject(_activeObject)) _activeObject->ApplyEvent("MouseLeave");
+ _activeObject = Obj;
+ if (_activeObject) {
+ _activeObject->ApplyEvent("MouseEntry");
}
return S_OK;
@@ -3894,11 +3894,11 @@ HRESULT CBGame::SetActiveObject(CBObject *Obj) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::PushViewport(CBViewport *Viewport) {
- m_ViewportSP++;
- if (m_ViewportSP >= m_ViewportStack.GetSize()) m_ViewportStack.Add(Viewport);
- else m_ViewportStack[m_ViewportSP] = Viewport;
+ _viewportSP++;
+ if (_viewportSP >= _viewportStack.GetSize()) _viewportStack.Add(Viewport);
+ else _viewportStack[_viewportSP] = Viewport;
- m_Renderer->SetViewport(Viewport->GetRect());
+ _renderer->SetViewport(Viewport->GetRect());
return S_OK;
}
@@ -3906,14 +3906,14 @@ HRESULT CBGame::PushViewport(CBViewport *Viewport) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::PopViewport() {
- m_ViewportSP--;
- if (m_ViewportSP < -1) Game->LOG(0, "Fatal: Viewport stack underflow!");
+ _viewportSP--;
+ if (_viewportSP < -1) Game->LOG(0, "Fatal: Viewport stack underflow!");
- if (m_ViewportSP >= 0 && m_ViewportSP < m_ViewportStack.GetSize()) m_Renderer->SetViewport(m_ViewportStack[m_ViewportSP]->GetRect());
- else m_Renderer->SetViewport(m_Renderer->m_DrawOffsetX,
- m_Renderer->m_DrawOffsetY,
- m_Renderer->m_Width + m_Renderer->m_DrawOffsetX,
- m_Renderer->m_Height + m_Renderer->m_DrawOffsetY);
+ if (_viewportSP >= 0 && _viewportSP < _viewportStack.GetSize()) _renderer->SetViewport(_viewportStack[_viewportSP]->GetRect());
+ else _renderer->SetViewport(_renderer->_drawOffsetX,
+ _renderer->_drawOffsetY,
+ _renderer->_width + _renderer->_drawOffsetX,
+ _renderer->_height + _renderer->_drawOffsetY);
return S_OK;
}
@@ -3923,14 +3923,14 @@ HRESULT CBGame::PopViewport() {
HRESULT CBGame::GetCurrentViewportRect(RECT *Rect, bool *Custom) {
if (Rect == NULL) return E_FAIL;
else {
- if (m_ViewportSP >= 0) {
- CBPlatform::CopyRect(Rect, m_ViewportStack[m_ViewportSP]->GetRect());
+ if (_viewportSP >= 0) {
+ CBPlatform::CopyRect(Rect, _viewportStack[_viewportSP]->GetRect());
if (Custom) *Custom = true;
} else {
- CBPlatform::SetRect(Rect, m_Renderer->m_DrawOffsetX,
- m_Renderer->m_DrawOffsetY,
- m_Renderer->m_Width + m_Renderer->m_DrawOffsetX,
- m_Renderer->m_Height + m_Renderer->m_DrawOffsetY);
+ CBPlatform::SetRect(Rect, _renderer->_drawOffsetX,
+ _renderer->_drawOffsetY,
+ _renderer->_width + _renderer->_drawOffsetX,
+ _renderer->_height + _renderer->_drawOffsetY);
if (Custom) *Custom = false;
}
@@ -3941,9 +3941,9 @@ HRESULT CBGame::GetCurrentViewportRect(RECT *Rect, bool *Custom) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::GetCurrentViewportOffset(int *OffsetX, int *OffsetY) {
- if (m_ViewportSP >= 0) {
- if (OffsetX) *OffsetX = m_ViewportStack[m_ViewportSP]->m_OffsetX;
- if (OffsetY) *OffsetY = m_ViewportStack[m_ViewportSP]->m_OffsetY;
+ if (_viewportSP >= 0) {
+ if (OffsetX) *OffsetX = _viewportStack[_viewportSP]->_offsetX;
+ if (OffsetY) *OffsetY = _viewportStack[_viewportSP]->_offsetY;
} else {
if (OffsetX) *OffsetX = 0;
if (OffsetY) *OffsetY = 0;
@@ -3967,16 +3967,16 @@ HRESULT CBGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScSta
//////////////////////////////////////////////////////////////////////////
void CBGame::SetInteractive(bool State) {
- m_Interactive = State;
- if (m_TransMgr) m_TransMgr->m_OrigInteractive = State;
+ _interactive = State;
+ if (_transMgr) _transMgr->_origInteractive = State;
}
//////////////////////////////////////////////////////////////////////////
void CBGame::ResetMousePos() {
POINT p;
- p.x = m_MousePos.x + m_Renderer->m_DrawOffsetX;
- p.y = m_MousePos.y + m_Renderer->m_DrawOffsetY;
+ p.x = _mousePos.x + _renderer->_drawOffsetX;
+ p.y = _mousePos.y + _renderer->_drawOffsetY;
CBPlatform::SetCursorPos(p.x, p.y);
}
@@ -3984,7 +3984,7 @@ void CBGame::ResetMousePos() {
//////////////////////////////////////////////////////////////////////////
void CBGame::SetResourceModule(HMODULE ResModule) {
- m_ResourceModule = ResModule;
+ _resourceModule = ResModule;
}
@@ -3997,8 +3997,8 @@ HRESULT CBGame::DisplayContent(bool Update, bool DisplayAll) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::DisplayContentSimple() {
// fill black
- m_Renderer->Fill(0, 0, 0);
- if (m_IndicatorDisplay) DisplayIndicator();
+ _renderer->Fill(0, 0, 0);
+ if (_indicatorDisplay) DisplayIndicator();
return S_OK;
}
@@ -4006,71 +4006,71 @@ HRESULT CBGame::DisplayContentSimple() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::DisplayIndicator() {
- if (m_SaveLoadImage) {
+ if (_saveLoadImage) {
RECT rc;
- CBPlatform::SetRect(&rc, 0, 0, m_SaveLoadImage->GetWidth(), m_SaveLoadImage->GetHeight());
- if (m_LoadInProgress) m_SaveLoadImage->DisplayTrans(m_LoadImageX, m_LoadImageY, rc);
- else m_SaveLoadImage->DisplayTrans(m_SaveImageX, m_SaveImageY, rc);
+ CBPlatform::SetRect(&rc, 0, 0, _saveLoadImage->GetWidth(), _saveLoadImage->GetHeight());
+ if (_loadInProgress) _saveLoadImage->DisplayTrans(_loadImageX, _loadImageY, rc);
+ else _saveLoadImage->DisplayTrans(_saveImageX, _saveImageY, rc);
}
- if (!m_IndicatorDisplay && m_IndicatorWidth <= 0 || m_IndicatorHeight <= 0) return S_OK;
- m_Renderer->SetupLines();
- for (int i = 0; i < m_IndicatorHeight; i++)
- m_Renderer->DrawLine(m_IndicatorX, m_IndicatorY + i, m_IndicatorX + (int)(m_IndicatorWidth * (float)((float)m_IndicatorProgress / 100.0f)), m_IndicatorY + i, m_IndicatorColor);
+ if (!_indicatorDisplay && _indicatorWidth <= 0 || _indicatorHeight <= 0) return S_OK;
+ _renderer->SetupLines();
+ for (int i = 0; i < _indicatorHeight; i++)
+ _renderer->DrawLine(_indicatorX, _indicatorY + i, _indicatorX + (int)(_indicatorWidth * (float)((float)_indicatorProgress / 100.0f)), _indicatorY + i, _indicatorColor);
- m_Renderer->Setup2D();
+ _renderer->Setup2D();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::UpdateMusicCrossfade() {
- byte GlobMusicVol = m_SoundMgr->GetVolumePercent(SOUND_MUSIC);
+ byte GlobMusicVol = _soundMgr->GetVolumePercent(SOUND_MUSIC);
- if (!m_MusicCrossfadeRunning) return S_OK;
- if (m_State == GAME_FROZEN) return S_OK;
+ if (!_musicCrossfadeRunning) return S_OK;
+ if (_state == GAME_FROZEN) return S_OK;
- if (m_MusicCrossfadeChannel1 < 0 || m_MusicCrossfadeChannel1 >= NUM_MUSIC_CHANNELS || !m_Music[m_MusicCrossfadeChannel1]) {
- m_MusicCrossfadeRunning = false;
+ if (_musicCrossfadeChannel1 < 0 || _musicCrossfadeChannel1 >= NUM_MUSIC_CHANNELS || !_music[_musicCrossfadeChannel1]) {
+ _musicCrossfadeRunning = false;
return S_OK;
}
- if (m_MusicCrossfadeChannel2 < 0 || m_MusicCrossfadeChannel2 >= NUM_MUSIC_CHANNELS || !m_Music[m_MusicCrossfadeChannel2]) {
- m_MusicCrossfadeRunning = false;
+ if (_musicCrossfadeChannel2 < 0 || _musicCrossfadeChannel2 >= NUM_MUSIC_CHANNELS || !_music[_musicCrossfadeChannel2]) {
+ _musicCrossfadeRunning = false;
return S_OK;
}
- if (!m_Music[m_MusicCrossfadeChannel1]->IsPlaying()) m_Music[m_MusicCrossfadeChannel1]->Play();
- if (!m_Music[m_MusicCrossfadeChannel2]->IsPlaying()) m_Music[m_MusicCrossfadeChannel2]->Play();
+ if (!_music[_musicCrossfadeChannel1]->IsPlaying()) _music[_musicCrossfadeChannel1]->Play();
+ if (!_music[_musicCrossfadeChannel2]->IsPlaying()) _music[_musicCrossfadeChannel2]->Play();
- uint32 CurrentTime = Game->m_LiveTimer - m_MusicCrossfadeStartTime;
+ uint32 CurrentTime = Game->_liveTimer - _musicCrossfadeStartTime;
- if (CurrentTime >= m_MusicCrossfadeLength) {
- m_MusicCrossfadeRunning = false;
- //m_Music[m_MusicCrossfadeChannel2]->SetVolume(GlobMusicVol);
- m_Music[m_MusicCrossfadeChannel2]->SetVolume(100);
+ if (CurrentTime >= _musicCrossfadeLength) {
+ _musicCrossfadeRunning = false;
+ //_music[_musicCrossfadeChannel2]->SetVolume(GlobMusicVol);
+ _music[_musicCrossfadeChannel2]->SetVolume(100);
- m_Music[m_MusicCrossfadeChannel1]->Stop();
- //m_Music[m_MusicCrossfadeChannel1]->SetVolume(GlobMusicVol);
- m_Music[m_MusicCrossfadeChannel1]->SetVolume(100);
+ _music[_musicCrossfadeChannel1]->Stop();
+ //_music[_musicCrossfadeChannel1]->SetVolume(GlobMusicVol);
+ _music[_musicCrossfadeChannel1]->SetVolume(100);
- if (m_MusicCrossfadeSwap) {
+ if (_musicCrossfadeSwap) {
// swap channels
- CBSound *Dummy = m_Music[m_MusicCrossfadeChannel1];
- int DummyInt = m_MusicStartTime[m_MusicCrossfadeChannel1];
+ CBSound *Dummy = _music[_musicCrossfadeChannel1];
+ int DummyInt = _musicStartTime[_musicCrossfadeChannel1];
- m_Music[m_MusicCrossfadeChannel1] = m_Music[m_MusicCrossfadeChannel2];
- m_MusicStartTime[m_MusicCrossfadeChannel1] = m_MusicStartTime[m_MusicCrossfadeChannel2];
+ _music[_musicCrossfadeChannel1] = _music[_musicCrossfadeChannel2];
+ _musicStartTime[_musicCrossfadeChannel1] = _musicStartTime[_musicCrossfadeChannel2];
- m_Music[m_MusicCrossfadeChannel2] = Dummy;
- m_MusicStartTime[m_MusicCrossfadeChannel2] = DummyInt;
+ _music[_musicCrossfadeChannel2] = Dummy;
+ _musicStartTime[_musicCrossfadeChannel2] = DummyInt;
}
} else {
- //m_Music[m_MusicCrossfadeChannel1]->SetVolume(GlobMusicVol - (float)CurrentTime / (float)m_MusicCrossfadeLength * GlobMusicVol);
- //m_Music[m_MusicCrossfadeChannel2]->SetVolume((float)CurrentTime / (float)m_MusicCrossfadeLength * GlobMusicVol);
- m_Music[m_MusicCrossfadeChannel1]->SetVolume(100 - (float)CurrentTime / (float)m_MusicCrossfadeLength * 100);
- m_Music[m_MusicCrossfadeChannel2]->SetVolume((float)CurrentTime / (float)m_MusicCrossfadeLength * 100);
+ //_music[_musicCrossfadeChannel1]->SetVolume(GlobMusicVol - (float)CurrentTime / (float)_musicCrossfadeLength * GlobMusicVol);
+ //_music[_musicCrossfadeChannel2]->SetVolume((float)CurrentTime / (float)_musicCrossfadeLength * GlobMusicVol);
+ _music[_musicCrossfadeChannel1]->SetVolume(100 - (float)CurrentTime / (float)_musicCrossfadeLength * 100);
+ _music[_musicCrossfadeChannel2]->SetVolume((float)CurrentTime / (float)_musicCrossfadeLength * 100);
- //Game->QuickMessageForm("%d %d", m_Music[m_MusicCrossfadeChannel1]->GetVolume(), m_Music[m_MusicCrossfadeChannel2]->GetVolume());
+ //Game->QuickMessageForm("%d %d", _music[_musicCrossfadeChannel1]->GetVolume(), _music[_musicCrossfadeChannel2]->GetVolume());
}
return S_OK;
@@ -4079,9 +4079,9 @@ HRESULT CBGame::UpdateMusicCrossfade() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::ResetContent() {
- m_ScEngine->ClearGlobals();
- //m_Timer = 0;
- //m_LiveTimer = 0;
+ _scEngine->ClearGlobals();
+ //_timer = 0;
+ //_liveTimer = 0;
return S_OK;
}
@@ -4099,8 +4099,8 @@ void CBGame::DEBUG_DumpClassRegistry() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::InvalidateDeviceObjects() {
- for (int i = 0; i < m_RegObjects.GetSize(); i++) {
- m_RegObjects[i]->InvalidateDeviceObjects();
+ for (int i = 0; i < _regObjects.GetSize(); i++) {
+ _regObjects[i]->InvalidateDeviceObjects();
}
return S_OK;
}
@@ -4108,21 +4108,21 @@ HRESULT CBGame::InvalidateDeviceObjects() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::RestoreDeviceObjects() {
- for (int i = 0; i < m_RegObjects.GetSize(); i++) {
- m_RegObjects[i]->RestoreDeviceObjects();
+ for (int i = 0; i < _regObjects.GetSize(); i++) {
+ _regObjects[i]->RestoreDeviceObjects();
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::SetWaitCursor(char *Filename) {
- delete m_CursorNoninteractive;
- m_CursorNoninteractive = NULL;
+ delete _cursorNoninteractive;
+ _cursorNoninteractive = NULL;
- m_CursorNoninteractive = new CBSprite(Game);
- if (!m_CursorNoninteractive || FAILED(m_CursorNoninteractive->LoadFile(Filename))) {
- delete m_CursorNoninteractive;
- m_CursorNoninteractive = NULL;
+ _cursorNoninteractive = new CBSprite(Game);
+ if (!_cursorNoninteractive || FAILED(_cursorNoninteractive->LoadFile(Filename))) {
+ delete _cursorNoninteractive;
+ _cursorNoninteractive = NULL;
return E_FAIL;
} else return S_OK;
}
@@ -4131,63 +4131,63 @@ HRESULT CBGame::SetWaitCursor(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::DrawCursor(CBSprite *Cursor) {
if (!Cursor) return E_FAIL;
- if (Cursor != m_LastCursor) {
+ if (Cursor != _lastCursor) {
Cursor->Reset();
- m_LastCursor = Cursor;
+ _lastCursor = Cursor;
}
- return Cursor->Draw(m_MousePos.x, m_MousePos.y);
+ return Cursor->Draw(_mousePos.x, _mousePos.y);
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnActivate(bool Activate, bool RefreshMouse) {
- if (m_ShuttingDown || !m_Renderer) return S_OK;
+ if (_shuttingDown || !_renderer) return S_OK;
- m_Renderer->m_Active = Activate;
+ _renderer->_active = Activate;
if (RefreshMouse) {
POINT p;
GetMousePos(&p);
- SetActiveObject(m_Renderer->GetObjectAt(p.x, p.y));
+ SetActiveObject(_renderer->GetObjectAt(p.x, p.y));
}
- if (Activate) m_SoundMgr->ResumeAll();
- else m_SoundMgr->PauseAll();
+ if (Activate) _soundMgr->ResumeAll();
+ else _soundMgr->PauseAll();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnMouseLeftDown() {
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_LEFT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_LEFT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftClick"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftClick"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("LeftClick");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("LeftClick");
}
}
- if (m_ActiveObject != NULL) m_CapturedObject = m_ActiveObject;
- m_MouseLeftDown = true;
- CBPlatform::SetCapture(m_Renderer->m_Window);
+ if (_activeObject != NULL) _capturedObject = _activeObject;
+ _mouseLeftDown = true;
+ CBPlatform::SetCapture(_renderer->_window);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnMouseLeftUp() {
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
CBPlatform::ReleaseCapture();
- m_CapturedObject = NULL;
- m_MouseLeftDown = false;
+ _capturedObject = NULL;
+ _mouseLeftDown = false;
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftRelease"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftRelease"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("LeftRelease");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("LeftRelease");
}
}
return S_OK;
@@ -4195,14 +4195,14 @@ HRESULT CBGame::OnMouseLeftUp() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnMouseLeftDblClick() {
- if (m_State == GAME_RUNNING && !m_Interactive) return S_OK;
+ if (_state == GAME_RUNNING && !_interactive) return S_OK;
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_LEFT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_LEFT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftDoubleClick"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("LeftDoubleClick"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("LeftDoubleClick");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("LeftDoubleClick");
}
}
return S_OK;
@@ -4210,14 +4210,14 @@ HRESULT CBGame::OnMouseLeftDblClick() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnMouseRightDblClick() {
- if (m_State == GAME_RUNNING && !m_Interactive) return S_OK;
+ if (_state == GAME_RUNNING && !_interactive) return S_OK;
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_RIGHT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_RIGHT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightDoubleClick"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightDoubleClick"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("RightDoubleClick");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("RightDoubleClick");
}
}
return S_OK;
@@ -4225,12 +4225,12 @@ HRESULT CBGame::OnMouseRightDblClick() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnMouseRightDown() {
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_RIGHT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_RIGHT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightClick"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightClick"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("RightClick");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("RightClick");
}
}
return S_OK;
@@ -4238,12 +4238,12 @@ HRESULT CBGame::OnMouseRightDown() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnMouseRightUp() {
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_RIGHT);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_RIGHT);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightRelease"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("RightRelease"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("RightRelease");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("RightRelease");
}
}
return S_OK;
@@ -4251,14 +4251,14 @@ HRESULT CBGame::OnMouseRightUp() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnMouseMiddleDown() {
- if (m_State == GAME_RUNNING && !m_Interactive) return S_OK;
+ if (_state == GAME_RUNNING && !_interactive) return S_OK;
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_MIDDLE);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_CLICK, MOUSE_BUTTON_MIDDLE);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("MiddleClick"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("MiddleClick"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("MiddleClick");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("MiddleClick");
}
}
return S_OK;
@@ -4266,12 +4266,12 @@ HRESULT CBGame::OnMouseMiddleDown() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnMouseMiddleUp() {
- if (m_ActiveObject) m_ActiveObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_MIDDLE);
+ if (_activeObject) _activeObject->HandleMouse(MOUSE_RELEASE, MOUSE_BUTTON_MIDDLE);
- bool Handled = m_State == GAME_RUNNING && SUCCEEDED(ApplyEvent("MiddleRelease"));
+ bool Handled = _state == GAME_RUNNING && SUCCEEDED(ApplyEvent("MiddleRelease"));
if (!Handled) {
- if (m_ActiveObject != NULL) {
- m_ActiveObject->ApplyEvent("MiddleRelease");
+ if (_activeObject != NULL) {
+ _activeObject->ApplyEvent("MiddleRelease");
}
}
return S_OK;
@@ -4279,11 +4279,11 @@ HRESULT CBGame::OnMouseMiddleUp() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnPaint() {
- if (m_Renderer && m_Renderer->m_Windowed && m_Renderer->m_Ready) {
- m_Renderer->InitLoop();
+ if (_renderer && _renderer->_windowed && _renderer->_ready) {
+ _renderer->InitLoop();
DisplayContent(false, true);
DisplayDebugInfo();
- m_Renderer->WindowedBlt();
+ _renderer->WindowedBlt();
}
return S_OK;
}
@@ -4291,7 +4291,7 @@ HRESULT CBGame::OnPaint() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::OnWindowClose() {
if (CanHandleEvent("QuitGame")) {
- if (m_State != GAME_FROZEN) Game->ApplyEvent("QuitGame");
+ if (_state != GAME_FROZEN) Game->ApplyEvent("QuitGame");
return S_OK;
} else return E_FAIL;
}
@@ -4300,37 +4300,37 @@ HRESULT CBGame::OnWindowClose() {
HRESULT CBGame::DisplayDebugInfo() {
char str[100];
- if (m_DEBUG_ShowFPS) {
- sprintf(str, "FPS: %d", Game->m_Fps);
- m_SystemFont->DrawText((byte *)str, 0, 0, 100, TAL_LEFT);
+ if (_dEBUG_ShowFPS) {
+ sprintf(str, "FPS: %d", Game->_fps);
+ _systemFont->DrawText((byte *)str, 0, 0, 100, TAL_LEFT);
}
- if (Game->m_DEBUG_DebugMode) {
- if (!Game->m_Renderer->m_Windowed)
- sprintf(str, "Mode: %dx%dx%d", m_Renderer->m_Width, m_Renderer->m_Height, m_Renderer->m_BPP);
+ if (Game->_dEBUG_DebugMode) {
+ if (!Game->_renderer->_windowed)
+ sprintf(str, "Mode: %dx%dx%d", _renderer->_width, _renderer->_height, _renderer->_bPP);
else
- sprintf(str, "Mode: %dx%d windowed", m_Renderer->m_Width, m_Renderer->m_Height);
+ sprintf(str, "Mode: %dx%d windowed", _renderer->_width, _renderer->_height);
strcat(str, " (");
- strcat(str, m_Renderer->GetName());
+ strcat(str, _renderer->GetName());
strcat(str, ")");
- m_SystemFont->DrawText((byte *)str, 0, 0, m_Renderer->m_Width, TAL_RIGHT);
+ _systemFont->DrawText((byte *)str, 0, 0, _renderer->_width, TAL_RIGHT);
- m_Renderer->DisplayDebugInfo();
+ _renderer->DisplayDebugInfo();
int ScrTotal, ScrRunning, ScrWaiting, ScrPersistent;
- ScrTotal = m_ScEngine->GetNumScripts(&ScrRunning, &ScrWaiting, &ScrPersistent);
+ ScrTotal = _scEngine->GetNumScripts(&ScrRunning, &ScrWaiting, &ScrPersistent);
sprintf(str, "Running scripts: %d (r:%d w:%d p:%d)", ScrTotal, ScrRunning, ScrWaiting, ScrPersistent);
- m_SystemFont->DrawText((byte *)str, 0, 70, m_Renderer->m_Width, TAL_RIGHT);
+ _systemFont->DrawText((byte *)str, 0, 70, _renderer->_width, TAL_RIGHT);
- sprintf(str, "Timer: %d", m_Timer);
- Game->m_SystemFont->DrawText((byte *)str, 0, 130, m_Renderer->m_Width, TAL_RIGHT);
+ sprintf(str, "Timer: %d", _timer);
+ Game->_systemFont->DrawText((byte *)str, 0, 130, _renderer->_width, TAL_RIGHT);
- if (m_ActiveObject != NULL) m_SystemFont->DrawText((byte *)m_ActiveObject->m_Name, 0, 150, m_Renderer->m_Width, TAL_RIGHT);
+ if (_activeObject != NULL) _systemFont->DrawText((byte *)_activeObject->_name, 0, 150, _renderer->_width, TAL_RIGHT);
- sprintf(str, "GfxMem: %dMB", m_UsedMem / (1024 * 1024));
- m_SystemFont->DrawText((byte *)str, 0, 170, m_Renderer->m_Width, TAL_RIGHT);
+ sprintf(str, "GfxMem: %dMB", _usedMem / (1024 * 1024));
+ _systemFont->DrawText((byte *)str, 0, 170, _renderer->_width, TAL_RIGHT);
}
@@ -4339,8 +4339,8 @@ HRESULT CBGame::DisplayDebugInfo() {
//////////////////////////////////////////////////////////////////////////
CBDebugger *CBGame::GetDebugMgr() {
- if (!m_DebugMgr) m_DebugMgr = new CBDebugger(this);
- return m_DebugMgr;
+ if (!_debugMgr) _debugMgr = new CBDebugger(this);
+ return _debugMgr;
}
@@ -4348,35 +4348,35 @@ CBDebugger *CBGame::GetDebugMgr() {
void CBGame::GetMousePos(POINT *Pos) {
CBPlatform::GetCursorPos(Pos);
- Pos->x -= m_Renderer->m_DrawOffsetX;
- Pos->y -= m_Renderer->m_DrawOffsetY;
+ Pos->x -= _renderer->_drawOffsetX;
+ Pos->y -= _renderer->_drawOffsetY;
/*
// Windows can squish maximized window if it's larger than desktop
// so we need to modify mouse position appropriately (tnx mRax)
- if(m_Renderer->m_Windowed && ::IsZoomed(m_Renderer->m_Window))
+ if(_renderer->_windowed && ::IsZoomed(_renderer->_window))
{
RECT rc;
- ::GetClientRect(m_Renderer->m_Window, &rc);
- Pos->x *= Game->m_Renderer->m_RealWidth;
+ ::GetClientRect(_renderer->_window, &rc);
+ Pos->x *= Game->_renderer->_realWidth;
Pos->x /= (rc.right - rc.left);
- Pos->y *= Game->m_Renderer->m_RealHeight;
+ Pos->y *= Game->_renderer->_realHeight;
Pos->y /= (rc.bottom - rc.top);
}
*/
- if (m_MouseLockRect.left != 0 && m_MouseLockRect.right != 0 && m_MouseLockRect.top != 0 && m_MouseLockRect.bottom != 0) {
- if (!CBPlatform::PtInRect(&m_MouseLockRect, *Pos)) {
- Pos->x = std::max(m_MouseLockRect.left, Pos->x);
- Pos->y = std::max(m_MouseLockRect.top, Pos->y);
+ if (_mouseLockRect.left != 0 && _mouseLockRect.right != 0 && _mouseLockRect.top != 0 && _mouseLockRect.bottom != 0) {
+ if (!CBPlatform::PtInRect(&_mouseLockRect, *Pos)) {
+ Pos->x = std::max(_mouseLockRect.left, Pos->x);
+ Pos->y = std::max(_mouseLockRect.top, Pos->y);
- Pos->x = std::min(m_MouseLockRect.right, Pos->x);
- Pos->y = std::min(m_MouseLockRect.bottom, Pos->y);
+ Pos->x = std::min(_mouseLockRect.right, Pos->x);
+ Pos->y = std::min(_mouseLockRect.bottom, Pos->y);
POINT NewPos = *Pos;
- NewPos.x += m_Renderer->m_DrawOffsetX;
- NewPos.y += m_Renderer->m_DrawOffsetY;
+ NewPos.x += _renderer->_drawOffsetX;
+ NewPos.y += _renderer->_drawOffsetY;
CBPlatform::SetCursorPos(NewPos.x, NewPos.y);
}
@@ -4385,11 +4385,11 @@ void CBGame::GetMousePos(POINT *Pos) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::MiniUpdate() {
- if (!m_MiniUpdateEnabled) return S_OK;
+ if (!_miniUpdateEnabled) return S_OK;
- if (CBPlatform::GetTime() - m_LastMiniUpdate > 200) {
- if (m_SoundMgr) m_SoundMgr->InitLoop();
- m_LastMiniUpdate = CBPlatform::GetTime();
+ if (CBPlatform::GetTime() - _lastMiniUpdate > 200) {
+ if (_soundMgr) _soundMgr->InitLoop();
+ _lastMiniUpdate = CBPlatform::GetTime();
}
return S_OK;
}
@@ -4427,35 +4427,35 @@ bool CBGame::IsDoubleClick(int buttonIndex) {
POINT pos;
CBPlatform::GetCursorPos(&pos);
- int moveX = abs(pos.x - m_LastClick[buttonIndex].PosX);
- int moveY = abs(pos.y - m_LastClick[buttonIndex].PosY);
+ int moveX = abs(pos.x - _lastClick[buttonIndex].PosX);
+ int moveY = abs(pos.y - _lastClick[buttonIndex].PosY);
- if (m_LastClick[buttonIndex].Time == 0 || CBPlatform::GetTime() - m_LastClick[buttonIndex].Time > maxDoubleCLickTime || moveX > maxMoveX || moveY > maxMoveY) {
- m_LastClick[buttonIndex].Time = CBPlatform::GetTime();
- m_LastClick[buttonIndex].PosX = pos.x;
- m_LastClick[buttonIndex].PosY = pos.y;
+ if (_lastClick[buttonIndex].Time == 0 || CBPlatform::GetTime() - _lastClick[buttonIndex].Time > maxDoubleCLickTime || moveX > maxMoveX || moveY > maxMoveY) {
+ _lastClick[buttonIndex].Time = CBPlatform::GetTime();
+ _lastClick[buttonIndex].PosX = pos.x;
+ _lastClick[buttonIndex].PosY = pos.y;
return false;
} else {
- m_LastClick[buttonIndex].Time = 0;
+ _lastClick[buttonIndex].Time = 0;
return true;
}
}
//////////////////////////////////////////////////////////////////////////
void CBGame::AutoSaveOnExit() {
- m_SoundMgr->SaveSettings();
- m_Registry->SaveValues();
+ _soundMgr->SaveSettings();
+ _registry->SaveValues();
- if (!m_AutoSaveOnExit) return;
- if (m_State == GAME_FROZEN) return;
+ if (!_autoSaveOnExit) return;
+ if (_state == GAME_FROZEN) return;
- SaveGame(m_AutoSaveSlot, "autosave", true);
+ SaveGame(_autoSaveSlot, "autosave", true);
}
//////////////////////////////////////////////////////////////////////////
void CBGame::AddMem(int bytes) {
- m_UsedMem += bytes;
+ _usedMem += bytes;
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/BGame.h b/engines/wintermute/BGame.h
index 5de2beacc3..f783f2a967 100644
--- a/engines/wintermute/BGame.h
+++ b/engines/wintermute/BGame.h
@@ -84,140 +84,140 @@ public:
bool IsLeftDoubleClick();
bool IsRightDoubleClick();
- bool m_AutorunDisabled;
+ bool _autorunDisabled;
- uint32 m_LastMiniUpdate;
- bool m_MiniUpdateEnabled;
+ uint32 _lastMiniUpdate;
+ bool _miniUpdateEnabled;
virtual HRESULT MiniUpdate();
void GetMousePos(POINT *Pos);
- RECT m_MouseLockRect;
+ RECT _mouseLockRect;
- bool m_ShuttingDown;
+ bool _shuttingDown;
virtual HRESULT DisplayDebugInfo();
- bool m_DEBUG_ShowFPS;
+ bool _dEBUG_ShowFPS;
- bool m_SuspendedRendering;
- int m_SoundBufferSizeSec;
+ bool _suspendedRendering;
+ int _soundBufferSizeSec;
- TTextEncoding m_TextEncoding;
- bool m_TextRTL;
+ TTextEncoding _textEncoding;
+ bool _textRTL;
- CBSprite *m_LoadingIcon;
- int m_LoadingIconX;
- int m_LoadingIconY;
- int m_LoadingIconPersistent;
+ CBSprite *_loadingIcon;
+ int _loadingIconX;
+ int _loadingIconY;
+ int _loadingIconPersistent;
virtual HRESULT ResetContent();
void DEBUG_DumpClassRegistry();
HRESULT SetWaitCursor(char *Filename);
- char *m_LocalSaveDir;
- bool m_SaveDirChecked;
+ char *_localSaveDir;
+ bool _saveDirChecked;
- bool m_IndicatorDisplay;
- uint32 m_IndicatorColor;
- int m_IndicatorProgress;
- int m_IndicatorX;
- int m_IndicatorY;
- int m_IndicatorWidth;
- int m_IndicatorHeight;
+ bool _indicatorDisplay;
+ uint32 _indicatorColor;
+ int _indicatorProgress;
+ int _indicatorX;
+ int _indicatorY;
+ int _indicatorWidth;
+ int _indicatorHeight;
- bool m_RichSavedGames;
- char *m_SavedGameExt;
+ bool _richSavedGames;
+ char *_savedGameExt;
- char *m_LoadImageName;
- char *m_SaveImageName;
- int m_SaveImageX;
- int m_SaveImageY;
- int m_LoadImageX;
- int m_LoadImageY;
- CBSurface *m_SaveLoadImage;
+ char *_loadImageName;
+ char *_saveImageName;
+ int _saveImageX;
+ int _saveImageY;
+ int _loadImageX;
+ int _loadImageY;
+ CBSurface *_saveLoadImage;
HRESULT DisplayIndicator();
- int m_ThumbnailWidth;
- int m_ThumbnailHeight;
+ int _thumbnailWidth;
+ int _thumbnailHeight;
- bool m_ReportTextureFormat;
- HMODULE m_ResourceModule;
+ bool _reportTextureFormat;
+ HMODULE _resourceModule;
void SetResourceModule(HMODULE ResModule);
void SetEngineLogCallback(ENGINE_LOG_CALLBACK Callback = NULL, void *Data = NULL);
- ENGINE_LOG_CALLBACK m_EngineLogCallback;
- void *m_EngineLogCallbackData;
- bool m_EditorMode;
+ ENGINE_LOG_CALLBACK _engineLogCallback;
+ void *_engineLogCallbackData;
+ bool _editorMode;
- bool m_DoNotExpandStrings;
+ bool _doNotExpandStrings;
void GetOffset(int *OffsetX, int *OffsetY);
void SetOffset(int OffsetX, int OffsetY);
int GetSequence();
- int m_OffsetY;
- int m_OffsetX;
- float m_OffsetPercentX;
- float m_OffsetPercentY;
- CBObject *m_MainObject;
+ int _offsetY;
+ int _offsetX;
+ float _offsetPercentX;
+ float _offsetPercentY;
+ CBObject *_mainObject;
HRESULT InitInput(HINSTANCE hInst, HWND hWnd);
HRESULT InitLoop();
- uint32 m_CurrentTime;
- uint32 m_DeltaTime;
- CBFont *m_SystemFont;
- CBFont *m_VideoFont;
+ uint32 _currentTime;
+ uint32 _deltaTime;
+ CBFont *_systemFont;
+ CBFont *_videoFont;
HRESULT Initialize1();
HRESULT Initialize2();
HRESULT Initialize3();
- CBFileManager *m_FileManager;
- CBTransitionMgr *m_TransMgr;
+ CBFileManager *_fileManager;
+ CBTransitionMgr *_transMgr;
CBDebugger *GetDebugMgr();
void LOG(HRESULT res, LPCSTR fmt, ...);
- CBRenderer *m_Renderer;
- CBSoundMgr *m_SoundMgr;
- CScEngine *m_ScEngine;
- CSXMath *m_MathClass;
- CSXStore *m_Store;
- CBSurfaceStorage *m_SurfaceStorage;
- CBFontStorage *m_FontStorage;
+ CBRenderer *_renderer;
+ CBSoundMgr *_soundMgr;
+ CScEngine *_scEngine;
+ CSXMath *_mathClass;
+ CSXStore *_store;
+ CBSurfaceStorage *_surfaceStorage;
+ CBFontStorage *_fontStorage;
CBGame();
virtual ~CBGame();
void DEBUG_DebugDisable();
void DEBUG_DebugEnable(const char *Filename = NULL);
- bool m_DEBUG_DebugMode;
- bool m_DEBUG_AbsolutePathWarning;
+ bool _dEBUG_DebugMode;
+ bool _dEBUG_AbsolutePathWarning;
- void *m_DEBUG_LogFile;
- int m_Sequence;
+ void *_dEBUG_LogFile;
+ int _sequence;
virtual HRESULT LoadFile(const char *Filename);
virtual HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
- CBArray<CBQuickMsg *, CBQuickMsg *> m_QuickMessages;
- CBArray<CUIWindow *, CUIWindow *> m_Windows;
- CBArray<CBViewport *, CBViewport *> m_ViewportStack;
-
- int m_ViewportSP;
- bool m_MouseLeftDown;
- bool m_MouseRightDown;
- bool m_MouseMidlleDown;
- CBStringTable *m_StringTable;
-
- int m_SettingsResWidth;
- int m_SettingsResHeight;
- bool m_SettingsRequireAcceleration;
- bool m_SettingsAllowWindowed;
- bool m_SettingsAllowAdvanced;
- bool m_SettingsAllowAccessTab;
- bool m_SettingsAllowAboutTab;
- bool m_SettingsRequireSound;
- bool m_SettingsAllowDesktopRes;
- int m_SettingsTLMode;
- char *m_SettingsGameFile;
- CBFader *m_Fader;
- bool m_SuppressScriptErrors;
+ CBArray<CBQuickMsg *, CBQuickMsg *> _quickMessages;
+ CBArray<CUIWindow *, CUIWindow *> _windows;
+ CBArray<CBViewport *, CBViewport *> _viewportStack;
+
+ int _viewportSP;
+ bool _mouseLeftDown;
+ bool _mouseRightDown;
+ bool _mouseMidlleDown;
+ CBStringTable *_stringTable;
+
+ int _settingsResWidth;
+ int _settingsResHeight;
+ bool _settingsRequireAcceleration;
+ bool _settingsAllowWindowed;
+ bool _settingsAllowAdvanced;
+ bool _settingsAllowAccessTab;
+ bool _settingsAllowAboutTab;
+ bool _settingsRequireSound;
+ bool _settingsAllowDesktopRes;
+ int _settingsTLMode;
+ char *_settingsGameFile;
+ CBFader *_fader;
+ bool _suppressScriptErrors;
virtual HRESULT InvalidateDeviceObjects();
virtual HRESULT RestoreDeviceObjects();
@@ -230,42 +230,42 @@ public:
virtual HRESULT ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name);
virtual char *ScToString();
// compatibility bits
- bool m_CompatKillMethodThreads;
+ bool _compatKillMethodThreads;
private:
// FPS stuff
- uint32 m_LastTime;
- uint32 m_FpsTime;
- uint32 m_FramesRendered;
+ uint32 _lastTime;
+ uint32 _fpsTime;
+ uint32 _framesRendered;
public:
- uint32 m_SurfaceGCCycleTime;
- bool m_SmartCache;
- bool m_VideoSubtitles;
- bool m_Subtitles;
- uint32 m_MusicStartTime[NUM_MUSIC_CHANNELS];
- bool m_CompressedSavegames;
- int m_ScheduledLoadSlot;
- bool m_Loading;
- bool m_PersonalizedSave;
+ uint32 _surfaceGCCycleTime;
+ bool _smartCache;
+ bool _videoSubtitles;
+ bool _subtitles;
+ uint32 _musicStartTime[NUM_MUSIC_CHANNELS];
+ bool _compressedSavegames;
+ int _scheduledLoadSlot;
+ bool _loading;
+ bool _personalizedSave;
HRESULT EmptySaveSlot(int Slot);
bool IsSaveSlotUsed(int Slot);
HRESULT GetSaveSlotDescription(int Slot, char *Buffer);
HRESULT GetSaveSlotFilename(int Slot, char *Buffer);
void SetWindowTitle();
virtual bool HandleMouseWheel(int Delta);
- bool m_Quitting;
+ bool _quitting;
virtual HRESULT GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byte *ExtMinor);
virtual bool HandleKeypress(SDL_Event *event);
- int m_FreezeLevel;
+ int _freezeLevel;
HRESULT Unfreeze();
HRESULT Freeze(bool IncludingMusic = true);
HRESULT FocusWindow(CUIWindow *Window);
- bool m_LoadInProgress;
- CUIWindow *m_FocusedWindow;
- bool m_EditorForceScripts;
+ bool _loadInProgress;
+ CUIWindow *_focusedWindow;
+ bool _editorForceScripts;
static void AfterLoadRegion(void *Region, void *Data);
static void AfterLoadSubFrame(void *Subframe, void *Data);
static void AfterLoadSound(void *Sound, void *Data);
@@ -279,55 +279,55 @@ public:
HRESULT PauseMusic(int Channel);
HRESULT StopMusic(int Channel);
HRESULT PlayMusic(int Channel, char *Filename, bool Looping = true, uint32 LoopStart = 0);
- CBSound *m_Music[NUM_MUSIC_CHANNELS];
- bool m_MusicCrossfadeRunning;
- bool m_MusicCrossfadeSwap;
- uint32 m_MusicCrossfadeStartTime;
- uint32 m_MusicCrossfadeLength;
- int m_MusicCrossfadeChannel1;
- int m_MusicCrossfadeChannel2;
+ CBSound *_music[NUM_MUSIC_CHANNELS];
+ bool _musicCrossfadeRunning;
+ bool _musicCrossfadeSwap;
+ uint32 _musicCrossfadeStartTime;
+ uint32 _musicCrossfadeLength;
+ int _musicCrossfadeChannel1;
+ int _musicCrossfadeChannel2;
HRESULT DisplayWindows(bool InGame = false);
- CBRegistry *m_Registry;
- bool m_UseD3D;
+ CBRegistry *_registry;
+ bool _useD3D;
virtual HRESULT Cleanup();
virtual HRESULT LoadGame(int Slot);
virtual HRESULT LoadGame(char *Filename);
virtual HRESULT SaveGame(int slot, char *desc, bool quickSave = false);
virtual HRESULT ShowCursor();
- CBSprite *m_CursorNoninteractive;
- CBObject *m_ActiveObject;
- CBKeyboardState *m_KeyboardState;
- bool m_Interactive;
- TGameState m_State;
- TGameState m_OrigState;
- bool m_OrigInteractive;
- uint32 m_Timer;
- uint32 m_TimerDelta;
- uint32 m_TimerLast;
-
- uint32 m_LiveTimer;
- uint32 m_LiveTimerDelta;
- uint32 m_LiveTimerLast;
-
- CBObject *m_CapturedObject;
- POINT m_MousePos;
+ CBSprite *_cursorNoninteractive;
+ CBObject *_activeObject;
+ CBKeyboardState *_keyboardState;
+ bool _interactive;
+ TGameState _state;
+ TGameState _origState;
+ bool _origInteractive;
+ uint32 _timer;
+ uint32 _timerDelta;
+ uint32 _timerLast;
+
+ uint32 _liveTimer;
+ uint32 _liveTimerDelta;
+ uint32 _liveTimerLast;
+
+ CBObject *_capturedObject;
+ POINT _mousePos;
bool ValidObject(CBObject *Object);
HRESULT UnregisterObject(CBObject *Object);
HRESULT RegisterObject(CBObject *Object);
void QuickMessage(char *Text);
void QuickMessageForm(LPSTR fmt, ...);
HRESULT DisplayQuickMsg();
- uint32 m_Fps;
+ uint32 _fps;
HRESULT UpdateMusicCrossfade();
- CBArray<CBObject *, CBObject *> m_RegObjects;
+ CBArray<CBObject *, CBObject *> _regObjects;
public:
virtual HRESULT DisplayContent(bool Update = true, bool DisplayAll = false);
virtual HRESULT DisplayContentSimple();
- bool m_ForceNonStreamedSounds;
+ bool _forceNonStreamedSounds;
void ResetMousePos();
- int m_SubtitlesSpeed;
+ int _subtitlesSpeed;
void SetInteractive(bool State);
virtual HRESULT WindowLoadHook(CUIWindow *Win, char **Buf, char **Params);
virtual HRESULT WindowScriptMethodHook(CUIWindow *Win, CScScript *Script, CScStack *Stack, char *Name);
@@ -336,20 +336,20 @@ public:
HRESULT PopViewport();
HRESULT PushViewport(CBViewport *Viewport);
HRESULT SetActiveObject(CBObject *Obj);
- CBSprite *m_LastCursor;
+ CBSprite *_lastCursor;
HRESULT DrawCursor(CBSprite *Cursor);
virtual HRESULT InitAfterLoad();
- CBSaveThumbHelper *m_CachedThumbnail;
+ CBSaveThumbHelper *_cachedThumbnail;
AnsiString GetDataDir();
void AddMem(int bytes);
- bool m_TouchInterface;
- bool m_ConstrainedMemory;
+ bool _touchInterface;
+ bool _constrainedMemory;
AnsiString GetDeviceType() const;
private:
- CBDebugger *m_DebugMgr;
+ CBDebugger *_debugMgr;
struct LastClickInfo {
LastClickInfo() {
@@ -362,17 +362,17 @@ private:
uint32 Time;
};
- LastClickInfo m_LastClick[2];
+ LastClickInfo _lastClick[2];
bool IsDoubleClick(int buttonIndex);
- uint32 m_UsedMem;
+ uint32 _usedMem;
protected:
// WME Lite specific
- bool m_AutoSaveOnExit;
- int m_AutoSaveSlot;
- bool m_CursorHidden;
+ bool _autoSaveOnExit;
+ int _autoSaveSlot;
+ bool _cursorHidden;
public:
void AutoSaveOnExit();
diff --git a/engines/wintermute/BImage.cpp b/engines/wintermute/BImage.cpp
index 6f0d0235aa..a773bc00c9 100644
--- a/engines/wintermute/BImage.cpp
+++ b/engines/wintermute/BImage.cpp
@@ -32,16 +32,16 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBImage::CBImage(CBGame *inGame, FIBITMAP *bitmap): CBBase(inGame) {
#if 0
- m_Bitmap = bitmap;
+ _bitmap = bitmap;
#endif
- m_Bitmap = NULL;
+ _bitmap = NULL;
}
//////////////////////////////////////////////////////////////////////
CBImage::~CBImage() {
#if 0
- if (m_Bitmap) FreeImage_Unload(m_Bitmap);
+ if (_bitmap) FreeImage_Unload(_bitmap);
#endif
}
@@ -49,9 +49,9 @@ CBImage::~CBImage() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBImage::SaveBMPFile(char *Filename) {
#if 0
- if (!m_Bitmap) return E_FAIL;
+ if (!_bitmap) return E_FAIL;
- if (FreeImage_Save(FIF_BMP, m_Bitmap, Filename)) return S_OK;
+ if (FreeImage_Save(FIF_BMP, _bitmap, Filename)) return S_OK;
else return E_FAIL;
#endif
return E_FAIL;
@@ -61,16 +61,16 @@ HRESULT CBImage::SaveBMPFile(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBImage::Resize(int NewWidth, int NewHeight) {
#if 0
- if (!m_Bitmap) return E_FAIL;
+ if (!_bitmap) return E_FAIL;
- if (NewWidth == 0) NewWidth = FreeImage_GetWidth(m_Bitmap);
- if (NewHeight == 0) NewHeight = FreeImage_GetHeight(m_Bitmap);
+ if (NewWidth == 0) NewWidth = FreeImage_GetWidth(_bitmap);
+ if (NewHeight == 0) NewHeight = FreeImage_GetHeight(_bitmap);
- FIBITMAP *newImg = FreeImage_Rescale(m_Bitmap, NewWidth, NewHeight, FILTER_BILINEAR);
+ FIBITMAP *newImg = FreeImage_Rescale(_bitmap, NewWidth, NewHeight, FILTER_BILINEAR);
if (newImg) {
- FreeImage_Unload(m_Bitmap);
- m_Bitmap = newImg;
+ FreeImage_Unload(_bitmap);
+ _bitmap = newImg;
return S_OK;
} else return E_FAIL;
#endif
@@ -80,10 +80,10 @@ HRESULT CBImage::Resize(int NewWidth, int NewHeight) {
//////////////////////////////////////////////////////////////////////////
byte *CBImage::CreateBMPBuffer(uint32 *BufferSize) {
- if (!m_Bitmap) return NULL;
+ if (!_bitmap) return NULL;
#if 0
FIMEMORY *fiMem = FreeImage_OpenMemory();
- FreeImage_SaveToMemory(FIF_PNG, m_Bitmap, fiMem);
+ FreeImage_SaveToMemory(FIF_PNG, _bitmap, fiMem);
uint32 size;
byte *data;
FreeImage_AcquireMemory(fiMem, &data, &size);
@@ -104,12 +104,12 @@ byte *CBImage::CreateBMPBuffer(uint32 *BufferSize) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBImage::CopyFrom(CBImage *OrigImage, int NewWidth, int NewHeight) {
#if 0
- if (m_Bitmap) FreeImage_Unload(m_Bitmap);
+ if (_bitmap) FreeImage_Unload(_bitmap);
if (NewWidth == 0) NewWidth = FreeImage_GetWidth(OrigImage->GetBitmap());
if (NewHeight == 0) NewHeight = FreeImage_GetHeight(OrigImage->GetBitmap());
- m_Bitmap = FreeImage_Rescale(OrigImage->GetBitmap(), NewWidth, NewHeight, FILTER_BILINEAR);
+ _bitmap = FreeImage_Rescale(OrigImage->GetBitmap(), NewWidth, NewHeight, FILTER_BILINEAR);
#endif
return S_OK;
}
diff --git a/engines/wintermute/BImage.h b/engines/wintermute/BImage.h
index a738fb418b..98b6dfaac6 100644
--- a/engines/wintermute/BImage.h
+++ b/engines/wintermute/BImage.h
@@ -51,10 +51,10 @@ public:
HRESULT CopyFrom(CBImage *OrigImage, int NewWidth = 0, int NewHeight = 0);
FIBITMAP *GetBitmap() const {
- return m_Bitmap;
+ return _bitmap;
}
private:
- FIBITMAP *m_Bitmap;
+ FIBITMAP *_bitmap;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BKeyboardState.cpp b/engines/wintermute/BKeyboardState.cpp
index d15b800d8e..6b68f4a2d3 100644
--- a/engines/wintermute/BKeyboardState.cpp
+++ b/engines/wintermute/BKeyboardState.cpp
@@ -37,13 +37,13 @@ IMPLEMENT_PERSISTENT(CBKeyboardState, false)
//////////////////////////////////////////////////////////////////////////
CBKeyboardState::CBKeyboardState(CBGame *inGame): CBScriptable(inGame) {
- m_CurrentPrintable = false;
- m_CurrentCharCode = 0;
- m_CurrentKeyData = 0;
+ _currentPrintable = false;
+ _currentCharCode = 0;
+ _currentKeyData = 0;
- m_CurrentShift = false;
- m_CurrentAlt = false;
- m_CurrentControl = false;
+ _currentShift = false;
+ _currentAlt = false;
+ _currentControl = false;
}
@@ -65,7 +65,7 @@ HRESULT CBKeyboardState::ScCallMethod(CScScript *Script, CScStack *Stack, CScSta
CScValue *val = Stack->Pop();
int vKey;
- if (val->m_Type == VAL_STRING && strlen(val->GetString()) > 0) {
+ if (val->_type == VAL_STRING && strlen(val->GetString()) > 0) {
char *str = val->GetString();
if (str[0] >= 'A' && str[0] <= 'Z') str[0] += ('a' - 'A');
vKey = (int)str[0];
@@ -86,68 +86,68 @@ HRESULT CBKeyboardState::ScCallMethod(CScScript *Script, CScStack *Stack, CScSta
//////////////////////////////////////////////////////////////////////////
CScValue *CBKeyboardState::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("keyboard");
- return m_ScValue;
+ _scValue->SetString("keyboard");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Key
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Key") == 0) {
- if (m_CurrentPrintable) {
+ if (_currentPrintable) {
char key[2];
- key[0] = (char)m_CurrentCharCode;
+ key[0] = (char)_currentCharCode;
key[1] = '\0';
- m_ScValue->SetString(key);
- } else m_ScValue->SetString("");
+ _scValue->SetString(key);
+ } else _scValue->SetString("");
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Printable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Printable") == 0) {
- m_ScValue->SetBool(m_CurrentPrintable);
- return m_ScValue;
+ _scValue->SetBool(_currentPrintable);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// KeyCode
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "KeyCode") == 0) {
- m_ScValue->SetInt(m_CurrentCharCode);
- return m_ScValue;
+ _scValue->SetInt(_currentCharCode);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// IsShift
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IsShift") == 0) {
- m_ScValue->SetBool(m_CurrentShift);
- return m_ScValue;
+ _scValue->SetBool(_currentShift);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// IsAlt
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IsAlt") == 0) {
- m_ScValue->SetBool(m_CurrentAlt);
- return m_ScValue;
+ _scValue->SetBool(_currentAlt);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// IsControl
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IsControl") == 0) {
- m_ScValue->SetBool(m_CurrentControl);
- return m_ScValue;
+ _scValue->SetBool(_currentControl);
+ return _scValue;
}
else return CBScriptable::ScGetProperty(Name);
@@ -162,7 +162,7 @@ HRESULT CBKeyboardState::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
if(strcmp(Name, "Name")==0){
SetName(Value->GetString());
- if(m_Renderer) SetWindowText(m_Renderer->m_Window, m_Name);
+ if(_renderer) SetWindowText(_renderer->_window, _name);
return S_OK;
}
@@ -178,13 +178,13 @@ char *CBKeyboardState::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBKeyboardState::ReadKey(SDL_Event *event) {
- //m_CurrentPrintable = (event->type == SDL_TEXTINPUT); // TODO
- m_CurrentCharCode = KeyCodeToVKey(event);
- //m_CurrentKeyData = KeyData;
+ //_currentPrintable = (event->type == SDL_TEXTINPUT); // TODO
+ _currentCharCode = KeyCodeToVKey(event);
+ //_currentKeyData = KeyData;
- m_CurrentControl = IsControlDown();
- m_CurrentAlt = IsAltDown();
- m_CurrentShift = IsShiftDown();
+ _currentControl = IsControlDown();
+ _currentAlt = IsAltDown();
+ _currentShift = IsShiftDown();
return S_OK;
}
@@ -192,15 +192,15 @@ HRESULT CBKeyboardState::ReadKey(SDL_Event *event) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBKeyboardState::Persist(CBPersistMgr *PersistMgr) {
- //if(!PersistMgr->m_Saving) Cleanup();
+ //if(!PersistMgr->_saving) Cleanup();
CBScriptable::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_CurrentAlt));
- PersistMgr->Transfer(TMEMBER(m_CurrentCharCode));
- PersistMgr->Transfer(TMEMBER(m_CurrentControl));
- PersistMgr->Transfer(TMEMBER(m_CurrentKeyData));
- PersistMgr->Transfer(TMEMBER(m_CurrentPrintable));
- PersistMgr->Transfer(TMEMBER(m_CurrentShift));
+ PersistMgr->Transfer(TMEMBER(_currentAlt));
+ PersistMgr->Transfer(TMEMBER(_currentCharCode));
+ PersistMgr->Transfer(TMEMBER(_currentControl));
+ PersistMgr->Transfer(TMEMBER(_currentKeyData));
+ PersistMgr->Transfer(TMEMBER(_currentPrintable));
+ PersistMgr->Transfer(TMEMBER(_currentShift));
return S_OK;
}
diff --git a/engines/wintermute/BKeyboardState.h b/engines/wintermute/BKeyboardState.h
index 5d4a6bada6..9b43190382 100644
--- a/engines/wintermute/BKeyboardState.h
+++ b/engines/wintermute/BKeyboardState.h
@@ -39,13 +39,13 @@ namespace WinterMute {
class CBKeyboardState : public CBScriptable {
public:
- uint32 m_CurrentKeyData;
- uint32 m_CurrentCharCode;
- bool m_CurrentPrintable;
+ uint32 _currentKeyData;
+ uint32 _currentCharCode;
+ bool _currentPrintable;
- bool m_CurrentShift;
- bool m_CurrentAlt;
- bool m_CurrentControl;
+ bool _currentShift;
+ bool _currentAlt;
+ bool _currentControl;
DECLARE_PERSISTENT(CBKeyboardState, CBScriptable)
CBKeyboardState(CBGame *inGame);
diff --git a/engines/wintermute/BNamedObject.cpp b/engines/wintermute/BNamedObject.cpp
index 161f479b81..fb8526ddad 100644
--- a/engines/wintermute/BNamedObject.cpp
+++ b/engines/wintermute/BNamedObject.cpp
@@ -33,33 +33,33 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBNamedObject::CBNamedObject(CBGame *inGame) : CBBase(inGame) {
- m_Name = NULL;
+ _name = NULL;
}
//////////////////////////////////////////////////////////////////////////
CBNamedObject::CBNamedObject() : CBBase() {
- m_Name = NULL;
+ _name = NULL;
}
//////////////////////////////////////////////////////////////////////////
CBNamedObject::CBNamedObject(TDynamicConstructor, TDynamicConstructor) {
- m_Name = NULL;
+ _name = NULL;
}
//////////////////////////////////////////////////////////////////////////
CBNamedObject::~CBNamedObject(void) {
- delete[] m_Name;
- m_Name = NULL;
+ delete[] _name;
+ _name = NULL;
}
//////////////////////////////////////////////////////////////////////
void CBNamedObject::SetName(char *Name) {
- delete[] m_Name;
+ delete[] _name;
- m_Name = new char [strlen(Name) + 1];
- if (m_Name != NULL) strcpy(m_Name, Name);
+ _name = new char [strlen(Name) + 1];
+ if (_name != NULL) strcpy(_name, Name);
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/BNamedObject.h b/engines/wintermute/BNamedObject.h
index 6473748134..c3b9abb7bc 100644
--- a/engines/wintermute/BNamedObject.h
+++ b/engines/wintermute/BNamedObject.h
@@ -41,7 +41,7 @@ public:
virtual ~CBNamedObject(void);
CBNamedObject(TDynamicConstructor, TDynamicConstructor);
- char *m_Name;
+ char *_name;
void SetName(char *Name);
};
diff --git a/engines/wintermute/BObject.cpp b/engines/wintermute/BObject.cpp
index 43fb347cc3..3665341550 100644
--- a/engines/wintermute/BObject.cpp
+++ b/engines/wintermute/BObject.cpp
@@ -44,58 +44,58 @@ IMPLEMENT_PERSISTENT(CBObject, false)
//////////////////////////////////////////////////////////////////////
CBObject::CBObject(CBGame *inGame): CBScriptHolder(inGame) {
- m_PosX = m_PosY = 0;
- m_Movable = true;
- m_Zoomable = true;
- m_Registrable = true;
- m_Shadowable = true;
- m_Rotatable = false;
- m_Is3D = false;
+ _posX = _posY = 0;
+ _movable = true;
+ _zoomable = true;
+ _registrable = true;
+ _shadowable = true;
+ _rotatable = false;
+ _is3D = false;
- m_AlphaColor = 0;
- m_Scale = -1;
- m_RelativeScale = 0;
+ _alphaColor = 0;
+ _scale = -1;
+ _relativeScale = 0;
- m_ScaleX = -1;
- m_ScaleY = -1;
+ _scaleX = -1;
+ _scaleY = -1;
- m_Ready = true;
+ _ready = true;
- m_SoundEvent = NULL;
+ _soundEvent = NULL;
- m_ID = Game->GetSequence();
+ _iD = Game->GetSequence();
- CBPlatform::SetRectEmpty(&m_Rect);
- m_RectSet = false;
+ CBPlatform::SetRectEmpty(&_rect);
+ _rectSet = false;
- m_Cursor = NULL;
- m_ActiveCursor = NULL;
- m_SharedCursors = false;
+ _cursor = NULL;
+ _activeCursor = NULL;
+ _sharedCursors = false;
- m_SFX = NULL;
- m_SFXStart = 0;
- m_SFXVolume = 100;
- m_AutoSoundPanning = true;
+ _sFX = NULL;
+ _sFXStart = 0;
+ _sFXVolume = 100;
+ _autoSoundPanning = true;
- m_EditorAlwaysRegister = false;
- m_EditorSelected = false;
+ _editorAlwaysRegister = false;
+ _editorSelected = false;
- m_EditorOnly = false;
+ _editorOnly = false;
- m_Rotate = 0.0f;
- m_RotateValid = false;
- m_RelativeRotate = 0.0f;
+ _rotate = 0.0f;
+ _rotateValid = false;
+ _relativeRotate = 0.0f;
- for (int i = 0; i < 7; i++) m_Caption[i] = NULL;
- m_SaveState = true;
+ for (int i = 0; i < 7; i++) _caption[i] = NULL;
+ _saveState = true;
- m_NonIntMouseEvents = false;
+ _nonIntMouseEvents = false;
// sound FX
- m_SFXType = SFX_NONE;
- m_SFXParam1 = m_SFXParam2 = m_SFXParam3 = m_SFXParam4 = 0;
+ _sFXType = SFX_NONE;
+ _sFXParam1 = _sFXParam2 = _sFXParam3 = _sFXParam4 = 0;
- m_BlendMode = BLEND_NORMAL;
+ _blendMode = BLEND_NORMAL;
}
@@ -107,28 +107,28 @@ CBObject::~CBObject() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::Cleanup() {
- if (Game && Game->m_ActiveObject == this) Game->m_ActiveObject = NULL;
+ if (Game && Game->_activeObject == this) Game->_activeObject = NULL;
CBScriptHolder::Cleanup();
- delete[] m_SoundEvent;
- m_SoundEvent = NULL;
+ delete[] _soundEvent;
+ _soundEvent = NULL;
- if (!m_SharedCursors) {
- delete m_Cursor;
- delete m_ActiveCursor;
- m_Cursor = NULL;
- m_ActiveCursor = NULL;
+ if (!_sharedCursors) {
+ delete _cursor;
+ delete _activeCursor;
+ _cursor = NULL;
+ _activeCursor = NULL;
}
- delete m_SFX;
- m_SFX = NULL;
+ delete _sFX;
+ _sFX = NULL;
for (int i = 0; i < 7; i++) {
- delete[] m_Caption[i];
- m_Caption[i] = NULL;
+ delete[] _caption[i];
+ _caption[i] = NULL;
}
- m_SFXType = SFX_NONE;
- m_SFXParam1 = m_SFXParam2 = m_SFXParam3 = m_SFXParam4 = 0;
+ _sFXType = SFX_NONE;
+ _sFXParam1 = _sFXParam2 = _sFXParam3 = _sFXParam4 = 0;
return S_OK;
}
@@ -139,11 +139,11 @@ void CBObject::SetCaption(char *Caption, int Case) {
if (Case == 0) Case = 1;
if (Case < 1 || Case > 7) return;
- delete[] m_Caption[Case - 1];
- m_Caption[Case - 1] = new char[strlen(Caption) + 1];
- if (m_Caption[Case - 1]) {
- strcpy(m_Caption[Case - 1], Caption);
- Game->m_StringTable->Expand(&m_Caption[Case - 1]);
+ delete[] _caption[Case - 1];
+ _caption[Case - 1] = new char[strlen(Caption) + 1];
+ if (_caption[Case - 1]) {
+ strcpy(_caption[Case - 1], Caption);
+ Game->_stringTable->Expand(&_caption[Case - 1]);
}
}
@@ -151,8 +151,8 @@ void CBObject::SetCaption(char *Caption, int Case) {
//////////////////////////////////////////////////////////////////////////
char *CBObject::GetCaption(int Case) {
if (Case == 0) Case = 1;
- if (Case < 1 || Case > 7 || m_Caption[Case - 1] == NULL) return "";
- else return m_Caption[Case - 1];
+ if (Case < 1 || Case > 7 || _caption[Case - 1] == NULL) return "";
+ else return _caption[Case - 1];
}
@@ -172,8 +172,8 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "SkipTo") == 0) {
Stack->CorrectParams(2);
- m_PosX = Stack->Pop()->GetInt();
- m_PosY = Stack->Pop()->GetInt();
+ _posX = Stack->Pop()->GetInt();
+ _posY = Stack->Pop()->GetInt();
AfterMove();
Stack->PushNULL();
@@ -206,11 +206,11 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "RemoveCursor") == 0) {
Stack->CorrectParams(0);
- if (!m_SharedCursors) {
- delete m_Cursor;
- m_Cursor = NULL;
+ if (!_sharedCursors) {
+ delete _cursor;
+ _cursor = NULL;
} else {
- m_Cursor = NULL;
+ _cursor = NULL;
}
Stack->PushNULL();
@@ -223,8 +223,8 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetCursor") == 0) {
Stack->CorrectParams(0);
- if (!m_Cursor || !m_Cursor->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_Cursor->m_Filename);
+ if (!_cursor || !_cursor->_filename) Stack->PushNULL();
+ else Stack->PushString(_cursor->_filename);
return S_OK;
}
@@ -234,8 +234,8 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetCursorObject") == 0) {
Stack->CorrectParams(0);
- if (!m_Cursor) Stack->PushNULL();
- else Stack->PushNative(m_Cursor, true);
+ if (!_cursor) Stack->PushNULL();
+ else Stack->PushNative(_cursor, true);
return S_OK;
}
@@ -246,7 +246,7 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
else if (strcmp(Name, "HasCursor") == 0) {
Stack->CorrectParams(0);
- if (m_Cursor) Stack->PushBool(true);
+ if (_cursor) Stack->PushBool(true);
else Stack->PushBool(false);
return S_OK;
@@ -291,7 +291,7 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CScValue *val2 = Stack->Pop();
CScValue *val3 = Stack->Pop();
- if (val1->m_Type == VAL_BOOL) {
+ if (val1->_type == VAL_BOOL) {
Filename = NULL;
Looping = val1->GetBool();
LoopStart = val2->GetInt();
@@ -371,7 +371,7 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
else if (strcmp(Name, "IsSoundPlaying") == 0) {
Stack->CorrectParams(0);
- if (m_SFX && m_SFX->IsPlaying()) Stack->PushBool(true);
+ if (_sFX && _sFX->IsPlaying()) Stack->PushBool(true);
else Stack->PushBool(false);
return S_OK;
}
@@ -394,8 +394,8 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
else if (strcmp(Name, "GetSoundPosition") == 0) {
Stack->CorrectParams(0);
- if (!m_SFX) Stack->PushInt(0);
- else Stack->PushInt(m_SFX->GetPositionTime());
+ if (!_sFX) Stack->PushInt(0);
+ else Stack->PushInt(_sFX->GetPositionTime());
return S_OK;
}
@@ -417,8 +417,8 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
else if (strcmp(Name, "GetSoundVolume") == 0) {
Stack->CorrectParams(0);
- if (!m_SFX) Stack->PushInt(m_SFXVolume);
- else Stack->PushInt(m_SFX->GetVolume());
+ if (!_sFX) Stack->PushInt(_sFXVolume);
+ else Stack->PushInt(_sFX->GetVolume());
return S_OK;
}
@@ -428,11 +428,11 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SoundFXNone") == 0) {
Stack->CorrectParams(0);
- m_SFXType = SFX_NONE;
- m_SFXParam1 = 0;
- m_SFXParam2 = 0;
- m_SFXParam3 = 0;
- m_SFXParam4 = 0;
+ _sFXType = SFX_NONE;
+ _sFXParam1 = 0;
+ _sFXParam2 = 0;
+ _sFXParam3 = 0;
+ _sFXParam4 = 0;
Stack->PushNULL();
return S_OK;
@@ -443,11 +443,11 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SoundFXEcho") == 0) {
Stack->CorrectParams(4);
- m_SFXType = SFX_ECHO;
- m_SFXParam1 = (float)Stack->Pop()->GetFloat(0); // Wet/Dry Mix [%] (0-100)
- m_SFXParam2 = (float)Stack->Pop()->GetFloat(0); // Feedback [%] (0-100)
- m_SFXParam3 = (float)Stack->Pop()->GetFloat(333.0f); // Left Delay [ms] (1-2000)
- m_SFXParam4 = (float)Stack->Pop()->GetFloat(333.0f); // Right Delay [ms] (1-2000)
+ _sFXType = SFX_ECHO;
+ _sFXParam1 = (float)Stack->Pop()->GetFloat(0); // Wet/Dry Mix [%] (0-100)
+ _sFXParam2 = (float)Stack->Pop()->GetFloat(0); // Feedback [%] (0-100)
+ _sFXParam3 = (float)Stack->Pop()->GetFloat(333.0f); // Left Delay [ms] (1-2000)
+ _sFXParam4 = (float)Stack->Pop()->GetFloat(333.0f); // Right Delay [ms] (1-2000)
Stack->PushNULL();
return S_OK;
@@ -458,11 +458,11 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SoundFXReverb") == 0) {
Stack->CorrectParams(4);
- m_SFXType = SFX_REVERB;
- m_SFXParam1 = (float)Stack->Pop()->GetFloat(0); // In Gain [dB] (-96 - 0)
- m_SFXParam2 = (float)Stack->Pop()->GetFloat(0); // Reverb Mix [dB] (-96 - 0)
- m_SFXParam3 = (float)Stack->Pop()->GetFloat(1000.0f); // Reverb Time [ms] (0.001 - 3000)
- m_SFXParam4 = (float)Stack->Pop()->GetFloat(0.001f); // HighFreq RT Ratio (0.001 - 0.999)
+ _sFXType = SFX_REVERB;
+ _sFXParam1 = (float)Stack->Pop()->GetFloat(0); // In Gain [dB] (-96 - 0)
+ _sFXParam2 = (float)Stack->Pop()->GetFloat(0); // Reverb Mix [dB] (-96 - 0)
+ _sFXParam3 = (float)Stack->Pop()->GetFloat(1000.0f); // Reverb Time [ms] (0.001 - 3000)
+ _sFXParam4 = (float)Stack->Pop()->GetFloat(0.001f); // HighFreq RT Ratio (0.001 - 0.999)
Stack->PushNULL();
return S_OK;
@@ -474,191 +474,191 @@ HRESULT CBObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
CScValue *CBObject::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("object");
- return m_ScValue;
+ _scValue->SetString("object");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Caption
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Caption") == 0) {
- m_ScValue->SetString(GetCaption(1));
- return m_ScValue;
+ _scValue->SetString(GetCaption(1));
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "X") == 0) {
- m_ScValue->SetInt(m_PosX);
- return m_ScValue;
+ _scValue->SetInt(_posX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Y") == 0) {
- m_ScValue->SetInt(m_PosY);
- return m_ScValue;
+ _scValue->SetInt(_posY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Height (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Height") == 0) {
- m_ScValue->SetInt(GetHeight());
- return m_ScValue;
+ _scValue->SetInt(GetHeight());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Ready (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Ready") == 0) {
- m_ScValue->SetBool(m_Ready);
- return m_ScValue;
+ _scValue->SetBool(_ready);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Movable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Movable") == 0) {
- m_ScValue->SetBool(m_Movable);
- return m_ScValue;
+ _scValue->SetBool(_movable);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Registrable/Interactive
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Registrable") == 0 || strcmp(Name, "Interactive") == 0) {
- m_ScValue->SetBool(m_Registrable);
- return m_ScValue;
+ _scValue->SetBool(_registrable);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Zoomable/Scalable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Zoomable") == 0 || strcmp(Name, "Scalable") == 0) {
- m_ScValue->SetBool(m_Zoomable);
- return m_ScValue;
+ _scValue->SetBool(_zoomable);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Rotatable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Rotatable") == 0) {
- m_ScValue->SetBool(m_Rotatable);
- return m_ScValue;
+ _scValue->SetBool(_rotatable);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AlphaColor") == 0) {
- m_ScValue->SetInt((int)m_AlphaColor);
- return m_ScValue;
+ _scValue->SetInt((int)_alphaColor);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// BlendMode
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "BlendMode") == 0) {
- m_ScValue->SetInt((int)m_BlendMode);
- return m_ScValue;
+ _scValue->SetInt((int)_blendMode);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Scale
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scale") == 0) {
- if (m_Scale < 0) m_ScValue->SetNULL();
- else m_ScValue->SetFloat((double)m_Scale);
- return m_ScValue;
+ if (_scale < 0) _scValue->SetNULL();
+ else _scValue->SetFloat((double)_scale);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScaleX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScaleX") == 0) {
- if (m_ScaleX < 0) m_ScValue->SetNULL();
- else m_ScValue->SetFloat((double)m_ScaleX);
- return m_ScValue;
+ if (_scaleX < 0) _scValue->SetNULL();
+ else _scValue->SetFloat((double)_scaleX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScaleY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScaleY") == 0) {
- if (m_ScaleY < 0) m_ScValue->SetNULL();
- else m_ScValue->SetFloat((double)m_ScaleY);
- return m_ScValue;
+ if (_scaleY < 0) _scValue->SetNULL();
+ else _scValue->SetFloat((double)_scaleY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// RelativeScale
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "RelativeScale") == 0) {
- m_ScValue->SetFloat((double)m_RelativeScale);
- return m_ScValue;
+ _scValue->SetFloat((double)_relativeScale);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Rotate
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Rotate") == 0) {
- if (!m_RotateValid) m_ScValue->SetNULL();
- else m_ScValue->SetFloat((double)m_Rotate);
- return m_ScValue;
+ if (!_rotateValid) _scValue->SetNULL();
+ else _scValue->SetFloat((double)_rotate);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// RelativeRotate
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "RelativeRotate") == 0) {
- m_ScValue->SetFloat((double)m_RelativeRotate);
- return m_ScValue;
+ _scValue->SetFloat((double)_relativeRotate);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Colorable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Colorable") == 0) {
- m_ScValue->SetBool(m_Shadowable);
- return m_ScValue;
+ _scValue->SetBool(_shadowable);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SoundPanning
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SoundPanning") == 0) {
- m_ScValue->SetBool(m_AutoSoundPanning);
- return m_ScValue;
+ _scValue->SetBool(_autoSoundPanning);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SaveState
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SaveState") == 0) {
- m_ScValue->SetBool(m_SaveState);
- return m_ScValue;
+ _scValue->SetBool(_saveState);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NonIntMouseEvents
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NonIntMouseEvents") == 0) {
- m_ScValue->SetBool(m_NonIntMouseEvents);
- return m_ScValue;
+ _scValue->SetBool(_nonIntMouseEvents);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccCaption
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccCaption") == 0) {
- m_ScValue->SetNULL();
- return m_ScValue;
+ _scValue->SetNULL();
+ return _scValue;
}
else return CBScriptHolder::ScGetProperty(Name);
@@ -679,7 +679,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// X
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "X") == 0) {
- m_PosX = Value->GetInt();
+ _posX = Value->GetInt();
AfterMove();
return S_OK;
}
@@ -688,7 +688,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// Y
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Y") == 0) {
- m_PosY = Value->GetInt();
+ _posY = Value->GetInt();
AfterMove();
return S_OK;
}
@@ -697,7 +697,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// Movable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Movable") == 0) {
- m_Movable = Value->GetBool();
+ _movable = Value->GetBool();
return S_OK;
}
@@ -705,7 +705,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// Registrable/Interactive
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Registrable") == 0 || strcmp(Name, "Interactive") == 0) {
- m_Registrable = Value->GetBool();
+ _registrable = Value->GetBool();
return S_OK;
}
@@ -713,7 +713,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// Zoomable/Scalable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Zoomable") == 0 || strcmp(Name, "Scalable") == 0) {
- m_Zoomable = Value->GetBool();
+ _zoomable = Value->GetBool();
return S_OK;
}
@@ -721,7 +721,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// Rotatable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Rotatable") == 0) {
- m_Rotatable = Value->GetBool();
+ _rotatable = Value->GetBool();
return S_OK;
}
@@ -729,7 +729,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// AlphaColor
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AlphaColor") == 0) {
- m_AlphaColor = (uint32)Value->GetInt();
+ _alphaColor = (uint32)Value->GetInt();
return S_OK;
}
@@ -739,7 +739,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
else if (strcmp(Name, "BlendMode") == 0) {
int i = Value->GetInt();
if (i < BLEND_NORMAL || i >= NUM_BLEND_MODES) i = BLEND_NORMAL;
- m_BlendMode = (TSpriteBlendMode)i;
+ _blendMode = (TSpriteBlendMode)i;
return S_OK;
}
@@ -747,8 +747,8 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// Scale
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scale") == 0) {
- if (Value->IsNULL()) m_Scale = -1;
- else m_Scale = (float)Value->GetFloat();
+ if (Value->IsNULL()) _scale = -1;
+ else _scale = (float)Value->GetFloat();
return S_OK;
}
@@ -756,8 +756,8 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// ScaleX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScaleX") == 0) {
- if (Value->IsNULL()) m_ScaleX = -1;
- else m_ScaleX = (float)Value->GetFloat();
+ if (Value->IsNULL()) _scaleX = -1;
+ else _scaleX = (float)Value->GetFloat();
return S_OK;
}
@@ -765,8 +765,8 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// ScaleY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScaleY") == 0) {
- if (Value->IsNULL()) m_ScaleY = -1;
- else m_ScaleY = (float)Value->GetFloat();
+ if (Value->IsNULL()) _scaleY = -1;
+ else _scaleY = (float)Value->GetFloat();
return S_OK;
}
@@ -774,7 +774,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// RelativeScale
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "RelativeScale") == 0) {
- m_RelativeScale = (float)Value->GetFloat();
+ _relativeScale = (float)Value->GetFloat();
return S_OK;
}
@@ -783,11 +783,11 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Rotate") == 0) {
if (Value->IsNULL()) {
- m_Rotate = 0.0f;
- m_RotateValid = false;
+ _rotate = 0.0f;
+ _rotateValid = false;
} else {
- m_Rotate = (float)Value->GetFloat();
- m_RotateValid = true;
+ _rotate = (float)Value->GetFloat();
+ _rotateValid = true;
}
return S_OK;
}
@@ -796,7 +796,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// RelativeRotate
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "RelativeRotate") == 0) {
- m_RelativeRotate = (float)Value->GetFloat();
+ _relativeRotate = (float)Value->GetFloat();
return S_OK;
}
@@ -804,7 +804,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// Colorable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Colorable") == 0) {
- m_Shadowable = Value->GetBool();
+ _shadowable = Value->GetBool();
return S_OK;
}
@@ -812,8 +812,8 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// SoundPanning
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SoundPanning") == 0) {
- m_AutoSoundPanning = Value->GetBool();
- if (!m_AutoSoundPanning) ResetSoundPan();
+ _autoSoundPanning = Value->GetBool();
+ if (!_autoSoundPanning) ResetSoundPan();
return S_OK;
}
@@ -821,7 +821,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// SaveState
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SaveState") == 0) {
- m_SaveState = Value->GetBool();
+ _saveState = Value->GetBool();
return S_OK;
}
@@ -829,7 +829,7 @@ HRESULT CBObject::ScSetProperty(char *Name, CScValue *Value) {
// NonIntMouseEvents
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NonIntMouseEvents") == 0) {
- m_NonIntMouseEvents = Value->GetBool();
+ _nonIntMouseEvents = Value->GetBool();
return S_OK;
}
@@ -852,7 +852,7 @@ char *CBObject::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::ShowCursor() {
- if (m_Cursor) return Game->DrawCursor(m_Cursor);
+ if (_cursor) return Game->DrawCursor(_cursor);
else return E_FAIL;
}
@@ -867,52 +867,52 @@ HRESULT CBObject::SaveAsText(CBDynBuffer *Buffer, int Indent) {
HRESULT CBObject::Persist(CBPersistMgr *PersistMgr) {
CBScriptHolder::Persist(PersistMgr);
- for (int i = 0; i < 7; i++) PersistMgr->Transfer(TMEMBER(m_Caption[i]));
- PersistMgr->Transfer(TMEMBER(m_ActiveCursor));
- PersistMgr->Transfer(TMEMBER(m_AlphaColor));
- PersistMgr->Transfer(TMEMBER(m_AutoSoundPanning));
- PersistMgr->Transfer(TMEMBER(m_Cursor));
- PersistMgr->Transfer(TMEMBER(m_SharedCursors));
- PersistMgr->Transfer(TMEMBER(m_EditorAlwaysRegister));
- PersistMgr->Transfer(TMEMBER(m_EditorOnly));
- PersistMgr->Transfer(TMEMBER(m_EditorSelected));
- PersistMgr->Transfer(TMEMBER(m_ID));
- PersistMgr->Transfer(TMEMBER(m_Is3D));
- PersistMgr->Transfer(TMEMBER(m_Movable));
- PersistMgr->Transfer(TMEMBER(m_PosX));
- PersistMgr->Transfer(TMEMBER(m_PosY));
- PersistMgr->Transfer(TMEMBER(m_RelativeScale));
- PersistMgr->Transfer(TMEMBER(m_Rotatable));
- PersistMgr->Transfer(TMEMBER(m_Scale));
- PersistMgr->Transfer(TMEMBER(m_SFX));
- PersistMgr->Transfer(TMEMBER(m_SFXStart));
- PersistMgr->Transfer(TMEMBER(m_SFXVolume));
- PersistMgr->Transfer(TMEMBER(m_Ready));
- PersistMgr->Transfer(TMEMBER(m_Rect));
- PersistMgr->Transfer(TMEMBER(m_RectSet));
- PersistMgr->Transfer(TMEMBER(m_Registrable));
- PersistMgr->Transfer(TMEMBER(m_Shadowable));
- PersistMgr->Transfer(TMEMBER(m_SoundEvent));
- PersistMgr->Transfer(TMEMBER(m_Zoomable));
-
- PersistMgr->Transfer(TMEMBER(m_ScaleX));
- PersistMgr->Transfer(TMEMBER(m_ScaleY));
-
- PersistMgr->Transfer(TMEMBER(m_Rotate));
- PersistMgr->Transfer(TMEMBER(m_RotateValid));
- PersistMgr->Transfer(TMEMBER(m_RelativeRotate));
-
- PersistMgr->Transfer(TMEMBER(m_SaveState));
- PersistMgr->Transfer(TMEMBER(m_NonIntMouseEvents));
-
- PersistMgr->Transfer(TMEMBER_INT(m_SFXType));
- PersistMgr->Transfer(TMEMBER(m_SFXParam1));
- PersistMgr->Transfer(TMEMBER(m_SFXParam2));
- PersistMgr->Transfer(TMEMBER(m_SFXParam3));
- PersistMgr->Transfer(TMEMBER(m_SFXParam4));
-
-
- PersistMgr->Transfer(TMEMBER_INT(m_BlendMode));
+ for (int i = 0; i < 7; i++) PersistMgr->Transfer(TMEMBER(_caption[i]));
+ PersistMgr->Transfer(TMEMBER(_activeCursor));
+ PersistMgr->Transfer(TMEMBER(_alphaColor));
+ PersistMgr->Transfer(TMEMBER(_autoSoundPanning));
+ PersistMgr->Transfer(TMEMBER(_cursor));
+ PersistMgr->Transfer(TMEMBER(_sharedCursors));
+ PersistMgr->Transfer(TMEMBER(_editorAlwaysRegister));
+ PersistMgr->Transfer(TMEMBER(_editorOnly));
+ PersistMgr->Transfer(TMEMBER(_editorSelected));
+ PersistMgr->Transfer(TMEMBER(_iD));
+ PersistMgr->Transfer(TMEMBER(_is3D));
+ PersistMgr->Transfer(TMEMBER(_movable));
+ PersistMgr->Transfer(TMEMBER(_posX));
+ PersistMgr->Transfer(TMEMBER(_posY));
+ PersistMgr->Transfer(TMEMBER(_relativeScale));
+ PersistMgr->Transfer(TMEMBER(_rotatable));
+ PersistMgr->Transfer(TMEMBER(_scale));
+ PersistMgr->Transfer(TMEMBER(_sFX));
+ PersistMgr->Transfer(TMEMBER(_sFXStart));
+ PersistMgr->Transfer(TMEMBER(_sFXVolume));
+ PersistMgr->Transfer(TMEMBER(_ready));
+ PersistMgr->Transfer(TMEMBER(_rect));
+ PersistMgr->Transfer(TMEMBER(_rectSet));
+ PersistMgr->Transfer(TMEMBER(_registrable));
+ PersistMgr->Transfer(TMEMBER(_shadowable));
+ PersistMgr->Transfer(TMEMBER(_soundEvent));
+ PersistMgr->Transfer(TMEMBER(_zoomable));
+
+ PersistMgr->Transfer(TMEMBER(_scaleX));
+ PersistMgr->Transfer(TMEMBER(_scaleY));
+
+ PersistMgr->Transfer(TMEMBER(_rotate));
+ PersistMgr->Transfer(TMEMBER(_rotateValid));
+ PersistMgr->Transfer(TMEMBER(_relativeRotate));
+
+ PersistMgr->Transfer(TMEMBER(_saveState));
+ PersistMgr->Transfer(TMEMBER(_nonIntMouseEvents));
+
+ PersistMgr->Transfer(TMEMBER_INT(_sFXType));
+ PersistMgr->Transfer(TMEMBER(_sFXParam1));
+ PersistMgr->Transfer(TMEMBER(_sFXParam2));
+ PersistMgr->Transfer(TMEMBER(_sFXParam3));
+ PersistMgr->Transfer(TMEMBER(_sFXParam4));
+
+
+ PersistMgr->Transfer(TMEMBER_INT(_blendMode));
return S_OK;
}
@@ -920,16 +920,16 @@ HRESULT CBObject::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::SetCursor(char *Filename) {
- if (!m_SharedCursors) {
- delete m_Cursor;
- m_Cursor = NULL;
+ if (!_sharedCursors) {
+ delete _cursor;
+ _cursor = NULL;
}
- m_SharedCursors = false;
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile(Filename))) {
- delete m_Cursor;
- m_Cursor = NULL;
+ _sharedCursors = false;
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile(Filename))) {
+ delete _cursor;
+ _cursor = NULL;
return E_FAIL;
} else return S_OK;
}
@@ -937,11 +937,11 @@ HRESULT CBObject::SetCursor(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::SetActiveCursor(char *Filename) {
- delete m_ActiveCursor;
- m_ActiveCursor = new CBSprite(Game);
- if (!m_ActiveCursor || FAILED(m_ActiveCursor->LoadFile(Filename))) {
- delete m_ActiveCursor;
- m_ActiveCursor = NULL;
+ delete _activeCursor;
+ _activeCursor = new CBSprite(Game);
+ if (!_activeCursor || FAILED(_activeCursor->LoadFile(Filename))) {
+ delete _activeCursor;
+ _activeCursor = NULL;
return E_FAIL;
} else return S_OK;
}
@@ -974,40 +974,40 @@ bool CBObject::HandleMouseWheel(int Delta) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::PlaySFX(char *Filename, bool Looping, bool PlayNow, char *EventName, uint32 LoopStart) {
// just play loaded sound
- if (Filename == NULL && m_SFX) {
- if (Game->m_EditorMode || m_SFXStart) {
- m_SFX->SetVolume(m_SFXVolume);
- m_SFX->SetPositionTime(m_SFXStart);
- if (!Game->m_EditorMode) m_SFXStart = 0;
+ if (Filename == NULL && _sFX) {
+ if (Game->_editorMode || _sFXStart) {
+ _sFX->SetVolume(_sFXVolume);
+ _sFX->SetPositionTime(_sFXStart);
+ if (!Game->_editorMode) _sFXStart = 0;
}
if (PlayNow) {
SetSoundEvent(EventName);
- if (LoopStart) m_SFX->SetLoopStart(LoopStart);
- return m_SFX->Play(Looping);
+ if (LoopStart) _sFX->SetLoopStart(LoopStart);
+ return _sFX->Play(Looping);
} else return S_OK;
}
if (Filename == NULL) return E_FAIL;
// create new sound
- delete m_SFX;
-
- m_SFX = new CBSound(Game);
- if (m_SFX && SUCCEEDED(m_SFX->SetSound(Filename, SOUND_SFX, true))) {
- m_SFX->SetVolume(m_SFXVolume);
- if (m_SFXStart) {
- m_SFX->SetPositionTime(m_SFXStart);
- m_SFXStart = 0;
+ delete _sFX;
+
+ _sFX = new CBSound(Game);
+ if (_sFX && SUCCEEDED(_sFX->SetSound(Filename, SOUND_SFX, true))) {
+ _sFX->SetVolume(_sFXVolume);
+ if (_sFXStart) {
+ _sFX->SetPositionTime(_sFXStart);
+ _sFXStart = 0;
}
- m_SFX->ApplyFX(m_SFXType, m_SFXParam1, m_SFXParam2, m_SFXParam3, m_SFXParam4);
+ _sFX->ApplyFX(_sFXType, _sFXParam1, _sFXParam2, _sFXParam3, _sFXParam4);
if (PlayNow) {
SetSoundEvent(EventName);
- if (LoopStart) m_SFX->SetLoopStart(LoopStart);
- return m_SFX->Play(Looping);
+ if (LoopStart) _sFX->SetLoopStart(LoopStart);
+ return _sFX->Play(Looping);
} else return S_OK;
} else {
- delete m_SFX;
- m_SFX = NULL;
+ delete _sFX;
+ _sFX = NULL;
return E_FAIL;
}
}
@@ -1015,11 +1015,11 @@ HRESULT CBObject::PlaySFX(char *Filename, bool Looping, bool PlayNow, char *Even
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::StopSFX(bool DeleteSound) {
- if (m_SFX) {
- m_SFX->Stop();
+ if (_sFX) {
+ _sFX->Stop();
if (DeleteSound) {
- delete m_SFX;
- m_SFX = NULL;
+ delete _sFX;
+ _sFX = NULL;
}
return S_OK;
} else return E_FAIL;
@@ -1028,44 +1028,44 @@ HRESULT CBObject::StopSFX(bool DeleteSound) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::PauseSFX() {
- if (m_SFX) return m_SFX->Pause();
+ if (_sFX) return _sFX->Pause();
else return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::ResumeSFX() {
- if (m_SFX) return m_SFX->Resume();
+ if (_sFX) return _sFX->Resume();
else return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::SetSFXTime(uint32 Time) {
- m_SFXStart = Time;
- if (m_SFX && m_SFX->IsPlaying()) return m_SFX->SetPositionTime(Time);
+ _sFXStart = Time;
+ if (_sFX && _sFX->IsPlaying()) return _sFX->SetPositionTime(Time);
else return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::SetSFXVolume(int Volume) {
- m_SFXVolume = Volume;
- if (m_SFX) return m_SFX->SetVolume(Volume);
+ _sFXVolume = Volume;
+ if (_sFX) return _sFX->SetVolume(Volume);
else return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::UpdateSounds() {
- if (m_SoundEvent) {
- if (m_SFX && !m_SFX->IsPlaying()) {
- ApplyEvent(m_SoundEvent);
+ if (_soundEvent) {
+ if (_sFX && !_sFX->IsPlaying()) {
+ ApplyEvent(_soundEvent);
SetSoundEvent(NULL);
}
}
- if (m_SFX) UpdateOneSound(m_SFX);
+ if (_sFX) UpdateOneSound(_sFX);
return S_OK;
}
@@ -1075,19 +1075,19 @@ HRESULT CBObject::UpdateOneSound(CBSound *Sound) {
HRESULT Ret = S_OK;
if (Sound) {
- if (m_AutoSoundPanning)
- Ret = Sound->SetPan(Game->m_SoundMgr->PosToPan(m_PosX - Game->m_OffsetX, m_PosY - Game->m_OffsetY));
+ if (_autoSoundPanning)
+ Ret = Sound->SetPan(Game->_soundMgr->PosToPan(_posX - Game->_offsetX, _posY - Game->_offsetY));
- Ret = Sound->ApplyFX(m_SFXType, m_SFXParam1, m_SFXParam2, m_SFXParam3, m_SFXParam4);
+ Ret = Sound->ApplyFX(_sFXType, _sFXParam1, _sFXParam2, _sFXParam3, _sFXParam4);
}
return Ret;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBObject::ResetSoundPan() {
- if (!m_SFX) return S_OK;
+ if (!_sFX) return S_OK;
else {
- return m_SFX->SetPan(0.0f);
+ return _sFX->SetPan(0.0f);
}
}
@@ -1100,17 +1100,17 @@ bool CBObject::GetExtendedFlag(char *FlagName) {
//////////////////////////////////////////////////////////////////////////
bool CBObject::IsReady() {
- return m_Ready;
+ return _ready;
}
//////////////////////////////////////////////////////////////////////////
void CBObject::SetSoundEvent(char *EventName) {
- delete[] m_SoundEvent;
- m_SoundEvent = NULL;
+ delete[] _soundEvent;
+ _soundEvent = NULL;
if (EventName) {
- m_SoundEvent = new char[strlen(EventName) + 1];
- if (m_SoundEvent) strcpy(m_SoundEvent, EventName);
+ _soundEvent = new char[strlen(EventName) + 1];
+ if (_soundEvent) strcpy(_soundEvent, EventName);
}
}
diff --git a/engines/wintermute/BObject.h b/engines/wintermute/BObject.h
index 3fd22fafcd..43fe719ae2 100644
--- a/engines/wintermute/BObject.h
+++ b/engines/wintermute/BObject.h
@@ -47,39 +47,39 @@ class CScStack;
class CScScript;
class CBObject : public CBScriptHolder {
public:
- TSpriteBlendMode m_BlendMode;
+ TSpriteBlendMode _blendMode;
virtual HRESULT AfterMove();
- float m_RelativeRotate;
- bool m_RotateValid;
- float m_Rotate;
+ float _relativeRotate;
+ bool _rotateValid;
+ float _rotate;
void SetSoundEvent(char *EventName);
- bool m_Rotatable;
- uint32 m_AlphaColor;
- float m_Scale;
- float m_ScaleX;
- float m_ScaleY;
- float m_RelativeScale;
+ bool _rotatable;
+ uint32 _alphaColor;
+ float _scale;
+ float _scaleX;
+ float _scaleY;
+ float _relativeScale;
virtual bool IsReady();
virtual bool GetExtendedFlag(char *FlagName);
virtual HRESULT ResetSoundPan();
virtual HRESULT UpdateSounds();
HRESULT UpdateOneSound(CBSound *Sound);
- bool m_AutoSoundPanning;
- uint32 m_SFXStart;
- int m_SFXVolume;
+ bool _autoSoundPanning;
+ uint32 _sFXStart;
+ int _sFXVolume;
HRESULT SetSFXTime(uint32 Time);
HRESULT SetSFXVolume(int Volume);
HRESULT ResumeSFX();
HRESULT PauseSFX();
HRESULT StopSFX(bool DeleteSound = true);
HRESULT PlaySFX(char *Filename, bool Looping = false, bool PlayNow = true, char *EventName = NULL, uint32 LoopStart = 0);
- CBSound *m_SFX;
+ CBSound *_sFX;
- TSFXType m_SFXType;
- float m_SFXParam1;
- float m_SFXParam2;
- float m_SFXParam3;
- float m_SFXParam4;
+ TSFXType _sFXType;
+ float _sFXParam1;
+ float _sFXParam2;
+ float _sFXParam3;
+ float _sFXParam4;
virtual bool HandleMouseWheel(int Delta);
virtual HRESULT HandleMouse(TMouseEvent Event, TMouseButton Button);
@@ -90,32 +90,32 @@ public:
HRESULT Cleanup();
char *GetCaption(int Case = 1);
void SetCaption(char *Caption, int Case = 1);
- bool m_EditorSelected;
- bool m_EditorAlwaysRegister;
- bool m_EditorOnly;
- bool m_Is3D;
+ bool _editorSelected;
+ bool _editorAlwaysRegister;
+ bool _editorOnly;
+ bool _is3D;
DECLARE_PERSISTENT(CBObject, CBScriptHolder)
virtual HRESULT ShowCursor();
- CBSprite *m_Cursor;
- bool m_SharedCursors;
- CBSprite *m_ActiveCursor;
+ CBSprite *_cursor;
+ bool _sharedCursors;
+ CBSprite *_activeCursor;
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
virtual HRESULT Listen(CBScriptHolder *param1, uint32 param2);
- bool m_Ready;
- bool m_Registrable;
- bool m_Zoomable;
- bool m_Shadowable;
- RECT m_Rect;
- bool m_RectSet;
- int m_ID;
- bool m_Movable;
+ bool _ready;
+ bool _registrable;
+ bool _zoomable;
+ bool _shadowable;
+ RECT _rect;
+ bool _rectSet;
+ int _iD;
+ bool _movable;
CBObject(CBGame *inGame);
virtual ~CBObject();
- char *m_Caption[7];
- char *m_SoundEvent;
- int m_PosY;
- int m_PosX;
- bool m_SaveState;
+ char *_caption[7];
+ char *_soundEvent;
+ int _posY;
+ int _posX;
+ bool _saveState;
// base
virtual HRESULT Update() {
@@ -130,7 +130,7 @@ public:
virtual HRESULT RestoreDeviceObjects() {
return S_OK;
};
- bool m_NonIntMouseEvents;
+ bool _nonIntMouseEvents;
public:
diff --git a/engines/wintermute/BPackage.cpp b/engines/wintermute/BPackage.cpp
index 2193999e2c..64e19491d5 100644
--- a/engines/wintermute/BPackage.cpp
+++ b/engines/wintermute/BPackage.cpp
@@ -40,35 +40,35 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBPackage::CBPackage(CBGame *inGame): CBBase(inGame) {
- m_File = NULL;
- m_Name = NULL;
- m_CD = 0;
- m_Priority = 0;
- m_BoundToExe = false;
+ _file = NULL;
+ _name = NULL;
+ _cD = 0;
+ _priority = 0;
+ _boundToExe = false;
}
//////////////////////////////////////////////////////////////////////////
CBPackage::~CBPackage() {
- if (m_Name) delete [] m_Name;
- CloseFilePointer(m_File);
+ if (_name) delete [] _name;
+ CloseFilePointer(_file);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBPackage::Open() {
- if (m_File) return S_OK;
+ if (_file) return S_OK;
else {
- m_File = GetFilePointer();
- return m_File ? S_OK : E_FAIL;
+ _file = GetFilePointer();
+ return _file ? S_OK : E_FAIL;
}
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBPackage::Close() {
- delete m_File;
- m_File = NULL;
+ delete _file;
+ _file = NULL;
return S_OK;
}
@@ -86,10 +86,10 @@ HRESULT CBPackage::Read(Common::File *file, uint32 offset, byte *buffer, uint32
//////////////////////////////////////////////////////////////////////////
Common::File *CBPackage::GetFilePointer() {
- Common::File *file = Game->m_FileManager->OpenPackage(m_Name);
+ Common::File *file = Game->_fileManager->OpenPackage(_name);
if (!file) {
- Game->m_FileManager->RequestCD(m_CD, m_Name, "");
- file = Game->m_FileManager->OpenPackage(m_Name);
+ Game->_fileManager->RequestCD(_cD, _name, "");
+ file = Game->_fileManager->OpenPackage(_name);
}
return file;
}
diff --git a/engines/wintermute/BPackage.h b/engines/wintermute/BPackage.h
index 6f1c8e1561..347582da4c 100644
--- a/engines/wintermute/BPackage.h
+++ b/engines/wintermute/BPackage.h
@@ -43,14 +43,14 @@ public:
Common::File *GetFilePointer();
void CloseFilePointer(Common::File*& file);
- bool m_BoundToExe;
- byte m_Priority;
+ bool _boundToExe;
+ byte _priority;
HRESULT Read(Common::File *file, uint32 offset, byte *buffer, uint32 size);
HRESULT Close();
HRESULT Open();
- char *m_Name;
- int m_CD;
- Common::File *m_File;
+ char *_name;
+ int _cD;
+ Common::File *_file;
CBPackage(CBGame *inGame);
virtual ~CBPackage();
diff --git a/engines/wintermute/BParser.cpp b/engines/wintermute/BParser.cpp
index 94de0771f9..7f40cc8030 100644
--- a/engines/wintermute/BParser.cpp
+++ b/engines/wintermute/BParser.cpp
@@ -44,32 +44,32 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBParser::CBParser(CBGame *inGame): CBBase(inGame) {
- m_WhiteSpace = new char [strlen(WHITESPACE) + 1];
- strcpy(m_WhiteSpace, WHITESPACE);
+ _whiteSpace = new char [strlen(WHITESPACE) + 1];
+ strcpy(_whiteSpace, WHITESPACE);
}
//////////////////////////////////////////////////////////////////////
CBParser::~CBParser() {
- if (m_WhiteSpace != NULL) delete [] m_WhiteSpace;
+ if (_whiteSpace != NULL) delete [] _whiteSpace;
}
//////////////////////////////////////////////////////////////////////
char *CBParser::GetLastOffender() {
- return m_LastOffender;
+ return _lastOffender;
}
//////////////////////////////////////////////////////////////////////
long CBParser::GetObject(char **buf, TokenDesc *tokens, char **name, char **data) {
- SkipCharacters(buf, m_WhiteSpace);
+ SkipCharacters(buf, _whiteSpace);
// skip comment lines.
while (**buf == ';') {
*buf = strchr(*buf, '\n');
- m_ParserLine++;
- SkipCharacters(buf, m_WhiteSpace);
+ _parserLine++;
+ SkipCharacters(buf, _whiteSpace);
}
if (! **buf) // at end of file
@@ -89,18 +89,18 @@ long CBParser::GetObject(char **buf, TokenDesc *tokens, char **name, char **data
if (tokens->id == 0) {
char *p = strchr(*buf, '\n');
if (p && p > *buf) {
- strncpy(m_LastOffender, *buf, MIN((long int)255, p - *buf)); // TODO, clean
- } else strcpy(m_LastOffender, "");
+ strncpy(_lastOffender, *buf, MIN((long int)255, p - *buf)); // TODO, clean
+ } else strcpy(_lastOffender, "");
return PARSERR_TOKENNOTFOUND;
}
// skip the token
*buf += strlen(tokens->token);
- SkipCharacters(buf, m_WhiteSpace);
+ SkipCharacters(buf, _whiteSpace);
// get optional name
*name = GetSubText(buf, '\'', '\''); // single quotes
- SkipCharacters(buf, m_WhiteSpace);
+ SkipCharacters(buf, _whiteSpace);
// get optional data
if (**buf == '=') // An assignment rather than a command/object.
@@ -125,7 +125,7 @@ long CBParser::GetCommand(char **buf, TokenDesc *tokens, char **params) {
void CBParser::SkipCharacters(char **buf, const char *toSkip) {
char ch;
while ((ch = **buf) != 0) {
- if (ch == '\n') m_ParserLine++;
+ if (ch == '\n') _parserLine++;
if (strchr(toSkip, ch) == NULL)
return;
++*buf; // skip this character
@@ -166,7 +166,7 @@ char *CBParser::GetSubText(char **buf, char open, char close) {
//////////////////////////////////////////////////////////////////////
char *CBParser::GetAssignmentText(char **buf) {
++*buf; // skip the '='
- SkipCharacters(buf, m_WhiteSpace);
+ SkipCharacters(buf, _whiteSpace);
char *result = *buf;
diff --git a/engines/wintermute/BParser.h b/engines/wintermute/BParser.h
index 6e4282c833..bf5edf7888 100644
--- a/engines/wintermute/BParser.h
+++ b/engines/wintermute/BParser.h
@@ -76,11 +76,11 @@ public:
void SkipCharacters(char **buf, const char *toSkip);
long GetCommand(char **buf, TokenDesc *tokens, char **params);
long GetObject(char **buf, TokenDesc *tokens, char **name, char **data);
- int m_ParserLine;
- char m_LastOffender[255];
+ int _parserLine;
+ char _lastOffender[255];
CBParser(CBGame *inGame = NULL);
virtual ~CBParser();
- char *m_WhiteSpace;
+ char *_whiteSpace;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BPersistMgr.cpp b/engines/wintermute/BPersistMgr.cpp
index e4002d9299..e8b47441fc 100644
--- a/engines/wintermute/BPersistMgr.cpp
+++ b/engines/wintermute/BPersistMgr.cpp
@@ -48,21 +48,21 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBPersistMgr::CBPersistMgr(CBGame *inGame): CBBase(inGame) {
- m_Saving = false;
- m_Buffer = NULL;
- m_BufferSize = 0;
- m_Offset = 0;
+ _saving = false;
+ _buffer = NULL;
+ _bufferSize = 0;
+ _offset = 0;
- m_RichBuffer = NULL;
- m_RichBufferSize = 0;
+ _richBuffer = NULL;
+ _richBufferSize = 0;
- m_SavedDescription = NULL;
- m_SavedTimestamp = 0;
- m_SavedVerMajor = m_SavedVerMinor = m_SavedVerBuild = 0;
- m_SavedExtMajor = m_SavedExtMinor = 0;
+ _savedDescription = NULL;
+ _savedTimestamp = 0;
+ _savedVerMajor = _savedVerMinor = _savedVerBuild = 0;
+ _savedExtMajor = _savedExtMinor = 0;
- m_ThumbnailDataSize = 0;
- m_ThumbnailData = NULL;
+ _thumbnailDataSize = 0;
+ _thumbnailData = NULL;
}
@@ -74,28 +74,28 @@ CBPersistMgr::~CBPersistMgr() {
//////////////////////////////////////////////////////////////////////////
void CBPersistMgr::Cleanup() {
- if (m_Buffer) {
- if (m_Saving) free(m_Buffer);
- else delete [] m_Buffer; // allocated by file manager
+ if (_buffer) {
+ if (_saving) free(_buffer);
+ else delete [] _buffer; // allocated by file manager
}
- m_Buffer = NULL;
+ _buffer = NULL;
- m_BufferSize = 0;
- m_Offset = 0;
+ _bufferSize = 0;
+ _offset = 0;
- delete[] m_RichBuffer;
- m_RichBuffer = NULL;
- m_RichBufferSize = 0;
+ delete[] _richBuffer;
+ _richBuffer = NULL;
+ _richBufferSize = 0;
- m_SavedDescription = NULL; // ref to buffer
- m_SavedTimestamp = 0;
- m_SavedVerMajor = m_SavedVerMinor = m_SavedVerBuild = 0;
- m_SavedExtMajor = m_SavedExtMinor = 0;
+ _savedDescription = NULL; // ref to buffer
+ _savedTimestamp = 0;
+ _savedVerMajor = _savedVerMinor = _savedVerBuild = 0;
+ _savedExtMajor = _savedExtMinor = 0;
- m_ThumbnailDataSize = 0;
- if (m_ThumbnailData) {
- delete [] m_ThumbnailData;
- m_ThumbnailData = NULL;
+ _thumbnailDataSize = 0;
+ if (_thumbnailData) {
+ delete [] _thumbnailData;
+ _thumbnailData = NULL;
}
}
@@ -113,22 +113,22 @@ HRESULT CBPersistMgr::InitSave(char *Desc) {
HRESULT res;
Cleanup();
- m_Saving = true;
+ _saving = true;
- m_Buffer = (byte *)malloc(SAVE_BUFFER_INIT_SIZE);
- if (m_Buffer) {
- m_BufferSize = SAVE_BUFFER_INIT_SIZE;
+ _buffer = (byte *)malloc(SAVE_BUFFER_INIT_SIZE);
+ if (_buffer) {
+ _bufferSize = SAVE_BUFFER_INIT_SIZE;
res = S_OK;
} else res = E_FAIL;
if (SUCCEEDED(res)) {
// get thumbnails
- if (!Game->m_CachedThumbnail) {
- Game->m_CachedThumbnail = new CBSaveThumbHelper(Game);
- if (FAILED(Game->m_CachedThumbnail->StoreThumbnail(true))) {
- delete Game->m_CachedThumbnail;
- Game->m_CachedThumbnail = NULL;
+ if (!Game->_cachedThumbnail) {
+ Game->_cachedThumbnail = new CBSaveThumbHelper(Game);
+ if (FAILED(Game->_cachedThumbnail->StoreThumbnail(true))) {
+ delete Game->_cachedThumbnail;
+ Game->_cachedThumbnail = NULL;
}
}
@@ -147,15 +147,15 @@ HRESULT CBPersistMgr::InitSave(char *Desc) {
// new in ver 2
PutDWORD((uint32)DCGF_VER_BUILD);
- PutString(Game->m_Name);
+ PutString(Game->_name);
// thumbnail data size
bool ThumbnailOK = false;
- if (Game->m_CachedThumbnail) {
- if (Game->m_CachedThumbnail->m_Thumbnail) {
+ if (Game->_cachedThumbnail) {
+ if (Game->_cachedThumbnail->_thumbnail) {
uint32 Size = 0;
- byte *Buffer = Game->m_CachedThumbnail->m_Thumbnail->CreateBMPBuffer(&Size);
+ byte *Buffer = Game->_cachedThumbnail->_thumbnail->CreateBMPBuffer(&Size);
PutDWORD(Size);
if (Size > 0) PutBytes(Buffer, Size);
@@ -167,10 +167,10 @@ HRESULT CBPersistMgr::InitSave(char *Desc) {
if (!ThumbnailOK) PutDWORD(0);
// in any case, destroy the cached thumbnail once used
- delete Game->m_CachedThumbnail;
- Game->m_CachedThumbnail = NULL;
+ delete Game->_cachedThumbnail;
+ Game->_cachedThumbnail = NULL;
- uint32 DataOffset = m_Offset +
+ uint32 DataOffset = _offset +
sizeof(uint32) + // data offset
sizeof(uint32) + strlen(Desc) + 1 + // description
sizeof(uint32); // timestamp
@@ -212,10 +212,10 @@ uint16 getHighWord(uint32 dword) {
HRESULT CBPersistMgr::InitLoad(char *Filename) {
Cleanup();
- m_Saving = false;
+ _saving = false;
- m_Buffer = Game->m_FileManager->ReadWholeFile(Filename, &m_BufferSize);
- if (m_Buffer) {
+ _buffer = Game->_fileManager->ReadWholeFile(Filename, &_bufferSize);
+ if (_buffer) {
uint32 Magic;
Magic = GetDWORD();
if (Magic != DCGF_MAGIC) goto init_fail;
@@ -224,50 +224,50 @@ HRESULT CBPersistMgr::InitLoad(char *Filename) {
if (Magic == SAVE_MAGIC || Magic == SAVE_MAGIC_2) {
uint32 Version = GetDWORD();
- m_SavedVerMajor = getLowByte(getLowWord(Version));
- m_SavedVerMinor = getHighByte(getLowWord(Version));
- m_SavedExtMajor = getLowByte(getHighWord(Version));
- m_SavedExtMinor = getHighByte(getHighWord(Version));
+ _savedVerMajor = getLowByte(getLowWord(Version));
+ _savedVerMinor = getHighByte(getLowWord(Version));
+ _savedExtMajor = getLowByte(getHighWord(Version));
+ _savedExtMinor = getHighByte(getHighWord(Version));
if (Magic == SAVE_MAGIC_2) {
- m_SavedVerBuild = (byte )GetDWORD();
+ _savedVerBuild = (byte )GetDWORD();
char *SavedName = GetString();
- if (SavedName == NULL || scumm_stricmp(SavedName, Game->m_Name) != 0) {
+ if (SavedName == NULL || scumm_stricmp(SavedName, Game->_name) != 0) {
Game->LOG(0, "ERROR: Saved game name doesn't match current game");
goto init_fail;
}
// load thumbnail
- m_ThumbnailDataSize = GetDWORD();
- if (m_ThumbnailDataSize > 0) {
- m_ThumbnailData = new byte[m_ThumbnailDataSize];
- if (m_ThumbnailData) {
- GetBytes(m_ThumbnailData, m_ThumbnailDataSize);
- } else m_ThumbnailDataSize = 0;
+ _thumbnailDataSize = GetDWORD();
+ if (_thumbnailDataSize > 0) {
+ _thumbnailData = new byte[_thumbnailDataSize];
+ if (_thumbnailData) {
+ GetBytes(_thumbnailData, _thumbnailDataSize);
+ } else _thumbnailDataSize = 0;
}
- } else m_SavedVerBuild = 35; // last build with ver1 savegames
+ } else _savedVerBuild = 35; // last build with ver1 savegames
// if save is newer version than we are, fail
- if (m_SavedVerMajor > DCGF_VER_MAJOR ||
- (m_SavedVerMajor == DCGF_VER_MAJOR && m_SavedVerMinor > DCGF_VER_MINOR) ||
- (m_SavedVerMajor == DCGF_VER_MAJOR && m_SavedVerMinor == DCGF_VER_MINOR && m_SavedVerBuild > DCGF_VER_BUILD)
+ if (_savedVerMajor > DCGF_VER_MAJOR ||
+ (_savedVerMajor == DCGF_VER_MAJOR && _savedVerMinor > DCGF_VER_MINOR) ||
+ (_savedVerMajor == DCGF_VER_MAJOR && _savedVerMinor == DCGF_VER_MINOR && _savedVerBuild > DCGF_VER_BUILD)
) {
Game->LOG(0, "ERROR: Saved game version is newer than current game");
goto init_fail;
}
// if save is older than the minimal version we support
- if (m_SavedVerMajor < SAVEGAME_VER_MAJOR ||
- (m_SavedVerMajor == SAVEGAME_VER_MAJOR && m_SavedVerMinor < SAVEGAME_VER_MINOR) ||
- (m_SavedVerMajor == SAVEGAME_VER_MAJOR && m_SavedVerMinor == SAVEGAME_VER_MINOR && m_SavedVerBuild < SAVEGAME_VER_BUILD)
+ if (_savedVerMajor < SAVEGAME_VER_MAJOR ||
+ (_savedVerMajor == SAVEGAME_VER_MAJOR && _savedVerMinor < SAVEGAME_VER_MINOR) ||
+ (_savedVerMajor == SAVEGAME_VER_MAJOR && _savedVerMinor == SAVEGAME_VER_MINOR && _savedVerBuild < SAVEGAME_VER_BUILD)
) {
Game->LOG(0, "ERROR: Saved game is too old and cannot be used by this version of game engine");
goto init_fail;
}
/*
- if( m_SavedVerMajor != DCGF_VER_MAJOR || m_SavedVerMinor != DCGF_VER_MINOR)
+ if( _savedVerMajor != DCGF_VER_MAJOR || _savedVerMinor != DCGF_VER_MINOR)
{
Game->LOG(0, "ERROR: Saved game is created by other WME version");
goto init_fail;
@@ -278,10 +278,10 @@ HRESULT CBPersistMgr::InitLoad(char *Filename) {
uint32 DataOffset = GetDWORD();
- m_SavedDescription = GetString();
- m_SavedTimestamp = (time_t)GetDWORD();
+ _savedDescription = GetString();
+ _savedTimestamp = (time_t)GetDWORD();
- m_Offset = DataOffset;
+ _offset = DataOffset;
return S_OK;
}
@@ -294,23 +294,23 @@ init_fail:
//////////////////////////////////////////////////////////////////////////
HRESULT CBPersistMgr::SaveFile(char *Filename) {
- return Game->m_FileManager->SaveFile(Filename, m_Buffer, m_Offset, Game->m_CompressedSavegames, m_RichBuffer, m_RichBufferSize);
+ return Game->_fileManager->SaveFile(Filename, _buffer, _offset, Game->_compressedSavegames, _richBuffer, _richBufferSize);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBPersistMgr::PutBytes(byte *Buffer, uint32 Size) {
- while (m_Offset + Size > m_BufferSize) {
- m_BufferSize += SAVE_BUFFER_GROW_BY;
- m_Buffer = (byte *)realloc(m_Buffer, m_BufferSize);
- if (!m_Buffer) {
- Game->LOG(0, "Error reallocating save buffer to %d bytes", m_BufferSize);
+ while (_offset + Size > _bufferSize) {
+ _bufferSize += SAVE_BUFFER_GROW_BY;
+ _buffer = (byte *)realloc(_buffer, _bufferSize);
+ if (!_buffer) {
+ Game->LOG(0, "Error reallocating save buffer to %d bytes", _bufferSize);
return E_FAIL;
}
}
- memcpy(m_Buffer + m_Offset, Buffer, Size);
- m_Offset += Size;
+ memcpy(_buffer + _offset, Buffer, Size);
+ _offset += Size;
return S_OK;
}
@@ -318,13 +318,13 @@ HRESULT CBPersistMgr::PutBytes(byte *Buffer, uint32 Size) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBPersistMgr::GetBytes(byte *Buffer, uint32 Size) {
- if (m_Offset + Size > m_BufferSize) {
+ if (_offset + Size > _bufferSize) {
Game->LOG(0, "Fatal: Save buffer underflow");
return E_FAIL;
}
- memcpy(Buffer, m_Buffer + m_Offset, Size);
- m_Offset += Size;
+ memcpy(Buffer, _buffer + _offset, Size);
+ _offset += Size;
return S_OK;
}
@@ -357,8 +357,8 @@ void CBPersistMgr::PutString(const char *Val) {
//////////////////////////////////////////////////////////////////////////
char *CBPersistMgr::GetString() {
uint32 len = GetDWORD();
- char *ret = (char *)(m_Buffer + m_Offset);
- m_Offset += len;
+ char *ret = (char *)(_buffer + _offset);
+ _offset += len;
if (!strcmp(ret, "(null)")) return NULL;
else return ret;
@@ -367,7 +367,7 @@ char *CBPersistMgr::GetString() {
//////////////////////////////////////////////////////////////////////////
// bool
HRESULT CBPersistMgr::Transfer(const char *Name, bool *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(bool));
+ if (_saving) return PutBytes((byte *)Val, sizeof(bool));
else return GetBytes((byte *)Val, sizeof(bool));
}
@@ -375,7 +375,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, bool *Val) {
//////////////////////////////////////////////////////////////////////////
// int
HRESULT CBPersistMgr::Transfer(const char *Name, int *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(int));
+ if (_saving) return PutBytes((byte *)Val, sizeof(int));
else return GetBytes((byte *)Val, sizeof(int));
}
@@ -383,7 +383,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, int *Val) {
//////////////////////////////////////////////////////////////////////////
// DWORD
HRESULT CBPersistMgr::Transfer(const char *Name, uint32 *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(uint32));
+ if (_saving) return PutBytes((byte *)Val, sizeof(uint32));
else return GetBytes((byte *)Val, sizeof(uint32));
}
@@ -391,7 +391,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, uint32 *Val) {
//////////////////////////////////////////////////////////////////////////
// float
HRESULT CBPersistMgr::Transfer(const char *Name, float *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(float));
+ if (_saving) return PutBytes((byte *)Val, sizeof(float));
else return GetBytes((byte *)Val, sizeof(float));
}
@@ -399,7 +399,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, float *Val) {
//////////////////////////////////////////////////////////////////////////
// double
HRESULT CBPersistMgr::Transfer(const char *Name, double *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(double));
+ if (_saving) return PutBytes((byte *)Val, sizeof(double));
else return GetBytes((byte *)Val, sizeof(double));
}
@@ -407,7 +407,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, double *Val) {
//////////////////////////////////////////////////////////////////////////
// char*
HRESULT CBPersistMgr::Transfer(const char *Name, char **Val) {
- if (m_Saving) {
+ if (_saving) {
PutString(*Val);
return S_OK;
} else {
@@ -425,7 +425,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, char **Val) {
HRESULT CBPersistMgr::Transfer(const char *Name, AnsiStringArray &Val) {
size_t size;
- if (m_Saving) {
+ if (_saving) {
size = Val.size();
PutBytes((byte *)&size, sizeof(size_t));
@@ -448,7 +448,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, AnsiStringArray &Val) {
//////////////////////////////////////////////////////////////////////////
// BYTE
HRESULT CBPersistMgr::Transfer(const char *Name, byte *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(byte ));
+ if (_saving) return PutBytes((byte *)Val, sizeof(byte ));
else return GetBytes((byte *)Val, sizeof(byte ));
}
@@ -456,7 +456,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, byte *Val) {
//////////////////////////////////////////////////////////////////////////
// RECT
HRESULT CBPersistMgr::Transfer(const char *Name, RECT *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(RECT));
+ if (_saving) return PutBytes((byte *)Val, sizeof(RECT));
else return GetBytes((byte *)Val, sizeof(RECT));
}
@@ -464,7 +464,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, RECT *Val) {
//////////////////////////////////////////////////////////////////////////
// POINT
HRESULT CBPersistMgr::Transfer(const char *Name, POINT *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(POINT));
+ if (_saving) return PutBytes((byte *)Val, sizeof(POINT));
else return GetBytes((byte *)Val, sizeof(POINT));
}
@@ -472,7 +472,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, POINT *Val) {
//////////////////////////////////////////////////////////////////////////
// Vector2
HRESULT CBPersistMgr::Transfer(const char *Name, Vector2 *Val) {
- if (m_Saving) return PutBytes((byte *)Val, sizeof(Vector2));
+ if (_saving) return PutBytes((byte *)Val, sizeof(Vector2));
else return GetBytes((byte *)Val, sizeof(Vector2));
}
@@ -482,7 +482,7 @@ HRESULT CBPersistMgr::Transfer(const char *Name, Vector2 *Val) {
HRESULT CBPersistMgr::Transfer(const char *Name, void *Val) {
int ClassID = -1, InstanceID = -1;
- if (m_Saving) {
+ if (_saving) {
CSysClassRegistry::GetInstance()->GetPointerID(*(void **)Val, &ClassID, &InstanceID);
if (*(void **)Val != NULL && (ClassID == -1 || InstanceID == -1)) {
Game->LOG(0, "Warning: invalid instance '%s'", Name);
@@ -503,12 +503,12 @@ HRESULT CBPersistMgr::Transfer(const char *Name, void *Val) {
//////////////////////////////////////////////////////////////////////////
bool CBPersistMgr::CheckVersion(byte VerMajor, byte VerMinor, byte VerBuild) {
- if (m_Saving) return true;
+ if (_saving) return true;
// it's ok if we are same or newer than the saved game
- if (VerMajor > m_SavedVerMajor ||
- (VerMajor == m_SavedVerMajor && VerMinor > m_SavedVerMinor) ||
- (VerMajor == m_SavedVerMajor && VerMinor == m_SavedVerMinor && VerBuild > m_SavedVerBuild)
+ if (VerMajor > _savedVerMajor ||
+ (VerMajor == _savedVerMajor && VerMinor > _savedVerMinor) ||
+ (VerMajor == _savedVerMajor && VerMinor == _savedVerMinor && VerBuild > _savedVerBuild)
) return false;
return true;
diff --git a/engines/wintermute/BPersistMgr.h b/engines/wintermute/BPersistMgr.h
index 6a1e42da8a..381308bcac 100644
--- a/engines/wintermute/BPersistMgr.h
+++ b/engines/wintermute/BPersistMgr.h
@@ -38,13 +38,13 @@ class Vector2;
class CBPersistMgr : public CBBase {
public:
- char *m_SavedDescription;
- time_t m_SavedTimestamp;
- byte m_SavedVerMajor;
- byte m_SavedVerMinor;
- byte m_SavedVerBuild;
- byte m_SavedExtMajor;
- byte m_SavedExtMinor;
+ char *_savedDescription;
+ time_t _savedTimestamp;
+ byte _savedVerMajor;
+ byte _savedVerMinor;
+ byte _savedVerBuild;
+ byte _savedExtMajor;
+ byte _savedExtMinor;
HRESULT SaveFile(char *Filename);
uint32 GetDWORD();
void PutDWORD(uint32 Val);
@@ -55,13 +55,13 @@ public:
HRESULT InitSave(char *Desc);
HRESULT GetBytes(byte *Buffer, uint32 Size);
HRESULT PutBytes(byte *Buffer, uint32 Size);
- uint32 m_Offset;
- uint32 m_BufferSize;
- byte *m_Buffer;
- bool m_Saving;
+ uint32 _offset;
+ uint32 _bufferSize;
+ byte *_buffer;
+ bool _saving;
- uint32 m_RichBufferSize;
- byte *m_RichBuffer;
+ uint32 _richBufferSize;
+ byte *_richBuffer;
HRESULT Transfer(const char *Name, void *Val);
HRESULT Transfer(const char *Name, int *Val);
@@ -79,8 +79,8 @@ public:
virtual ~CBPersistMgr();
bool CheckVersion(byte VerMajor, byte VerMinor, byte VerBuild);
- uint32 m_ThumbnailDataSize;
- byte *m_ThumbnailData;
+ uint32 _thumbnailDataSize;
+ byte *_thumbnailData;
};
diff --git a/engines/wintermute/BPkgFile.cpp b/engines/wintermute/BPkgFile.cpp
index deac1c8817..b8bd760ced 100644
--- a/engines/wintermute/BPkgFile.cpp
+++ b/engines/wintermute/BPkgFile.cpp
@@ -48,15 +48,15 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBPkgFile::CBPkgFile(CBGame *inGame): CBFile(inGame) {
- m_FileEntry = NULL;
- m_File = NULL;
- m_Compressed = false;
+ _fileEntry = NULL;
+ _file = NULL;
+ _compressed = false;
- m_Stream.zalloc = (alloc_func)0;
- m_Stream.zfree = (free_func)0;
- m_Stream.opaque = (voidpf)0;
+ _stream.zalloc = (alloc_func)0;
+ _stream.zfree = (free_func)0;
+ _stream.opaque = (voidpf)0;
- m_InflateInit = false;
+ _inflateInit = false;
}
@@ -78,15 +78,15 @@ HRESULT CBPkgFile::Open(Common::String Filename) {
if (fileName[i] == '/') fileName[i] = '\\';
}
- m_FileEntry = Game->m_FileManager->GetPackageEntry(fileName);
- if (!m_FileEntry) return E_FAIL;
+ _fileEntry = Game->_fileManager->GetPackageEntry(fileName);
+ if (!_fileEntry) return E_FAIL;
- m_File = m_FileEntry->m_Package->GetFilePointer();
- if (!m_File) return E_FAIL;
+ _file = _fileEntry->_package->GetFilePointer();
+ if (!_file) return E_FAIL;
- m_Compressed = (m_FileEntry->m_CompressedLength != 0);
- m_Size = m_FileEntry->m_Length;
+ _compressed = (_fileEntry->_compressedLength != 0);
+ _size = _fileEntry->_length;
SeekToPos(0);
@@ -96,17 +96,17 @@ HRESULT CBPkgFile::Open(Common::String Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBPkgFile::Close() {
- if (m_FileEntry) {
- m_FileEntry->m_Package->CloseFilePointer(m_File);
- m_FileEntry = NULL;
+ if (_fileEntry) {
+ _fileEntry->_package->CloseFilePointer(_file);
+ _fileEntry = NULL;
}
- m_File = NULL;
+ _file = NULL;
- m_Pos = 0;
- m_Size = 0;
+ _pos = 0;
+ _size = 0;
- if (m_InflateInit) inflateEnd(&m_Stream);
- m_InflateInit = false;
+ if (_inflateInit) inflateEnd(&_stream);
+ _inflateInit = false;
return S_OK;
}
@@ -114,30 +114,30 @@ HRESULT CBPkgFile::Close() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBPkgFile::Read(void *Buffer, uint32 Size) {
- if (!m_FileEntry) return E_FAIL;
+ if (!_fileEntry) return E_FAIL;
HRESULT ret = S_OK;
- if (m_Pos + Size > m_Size) {
- Size = m_Size - m_Pos;
+ if (_pos + Size > _size) {
+ Size = _size - _pos;
if (Size == 0) return E_FAIL;
}
- if (m_Compressed) {
- uint32 InitOut = m_Stream.total_out;
+ if (_compressed) {
+ uint32 InitOut = _stream.total_out;
- m_Stream.avail_out = Size;
- m_Stream.next_out = (byte *)Buffer;
+ _stream.avail_out = Size;
+ _stream.next_out = (byte *)Buffer;
- while (m_Stream.total_out - InitOut < Size && m_Stream.total_in < m_FileEntry->m_CompressedLength) {
+ while (_stream.total_out - InitOut < Size && _stream.total_in < _fileEntry->_compressedLength) {
// needs to read more data?
- if (m_Stream.avail_in == 0) {
- m_Stream.avail_in = MIN((long unsigned int)COMPRESSED_BUFFER_SIZE, m_FileEntry->m_CompressedLength - m_Stream.total_in); // TODO: long unsigned int????
- m_FileEntry->m_Package->Read(m_File, m_FileEntry->m_Offset + m_Stream.total_in, m_CompBuffer, m_Stream.avail_in);
- m_Stream.next_in = m_CompBuffer;
+ if (_stream.avail_in == 0) {
+ _stream.avail_in = MIN((long unsigned int)COMPRESSED_BUFFER_SIZE, _fileEntry->_compressedLength - _stream.total_in); // TODO: long unsigned int????
+ _fileEntry->_package->Read(_file, _fileEntry->_offset + _stream.total_in, _compBuffer, _stream.avail_in);
+ _stream.next_in = _compBuffer;
}
- int res = inflate(&m_Stream, Z_SYNC_FLUSH);
+ int res = inflate(&_stream, Z_SYNC_FLUSH);
if (res != Z_OK && res != Z_STREAM_END) {
Game->LOG(0, "zlib error: %d", res);
ret = E_FAIL;
@@ -147,10 +147,10 @@ HRESULT CBPkgFile::Read(void *Buffer, uint32 Size) {
} else {
- ret = m_FileEntry->m_Package->Read(m_File, m_FileEntry->m_Offset + m_Pos, (byte *)Buffer, Size);
+ ret = _fileEntry->_package->Read(_file, _fileEntry->_offset + _pos, (byte *)Buffer, Size);
}
- m_Pos += Size;
+ _pos += Size;
return ret;
}
@@ -158,7 +158,7 @@ HRESULT CBPkgFile::Read(void *Buffer, uint32 Size) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBPkgFile::Seek(uint32 Pos, TSeek Origin) {
- if (!m_FileEntry) return E_FAIL;
+ if (!_fileEntry) return E_FAIL;
uint32 NewPos = 0;
@@ -167,14 +167,14 @@ HRESULT CBPkgFile::Seek(uint32 Pos, TSeek Origin) {
NewPos = Pos;
break;
case SEEK_TO_END:
- NewPos = m_Size + Pos;
+ NewPos = _size + Pos;
break;
case SEEK_TO_CURRENT:
- NewPos = m_Pos + Pos;
+ NewPos = _pos + Pos;
break;
}
- if (NewPos < 0 || NewPos > m_Size) return E_FAIL;
+ if (NewPos < 0 || NewPos > _size) return E_FAIL;
return SeekToPos(NewPos);
}
@@ -186,34 +186,34 @@ HRESULT CBPkgFile::SeekToPos(uint32 NewPos) {
HRESULT ret = S_OK;
// seek compressed stream to NewPos
- if (m_Compressed) {
+ if (_compressed) {
byte StreamBuffer[STREAM_BUFFER_SIZE];
- if (m_InflateInit) inflateEnd(&m_Stream);
- m_InflateInit = false;
+ if (_inflateInit) inflateEnd(&_stream);
+ _inflateInit = false;
- m_Stream.avail_in = 0;
- m_Stream.next_in = m_CompBuffer;
- m_Stream.avail_out = MIN((uint32)STREAM_BUFFER_SIZE, NewPos); //TODO: remove cast.
- m_Stream.next_out = StreamBuffer;
- inflateInit(&m_Stream);
- m_InflateInit = true;
+ _stream.avail_in = 0;
+ _stream.next_in = _compBuffer;
+ _stream.avail_out = MIN((uint32)STREAM_BUFFER_SIZE, NewPos); //TODO: remove cast.
+ _stream.next_out = StreamBuffer;
+ inflateInit(&_stream);
+ _inflateInit = true;
- while (m_Stream.total_out < NewPos && m_Stream.total_in < m_FileEntry->m_CompressedLength) {
+ while (_stream.total_out < NewPos && _stream.total_in < _fileEntry->_compressedLength) {
// needs to read more data?
- if (m_Stream.avail_in == 0) {
- m_Stream.avail_in = MIN((long unsigned int)COMPRESSED_BUFFER_SIZE, m_FileEntry->m_CompressedLength - m_Stream.total_in); // TODO: long unsigned int???
- m_FileEntry->m_Package->Read(m_File, m_FileEntry->m_Offset + m_Stream.total_in, m_CompBuffer, m_Stream.avail_in);
- m_Stream.next_in = m_CompBuffer;
+ if (_stream.avail_in == 0) {
+ _stream.avail_in = MIN((long unsigned int)COMPRESSED_BUFFER_SIZE, _fileEntry->_compressedLength - _stream.total_in); // TODO: long unsigned int???
+ _fileEntry->_package->Read(_file, _fileEntry->_offset + _stream.total_in, _compBuffer, _stream.avail_in);
+ _stream.next_in = _compBuffer;
}
// needs more space?
- if (m_Stream.avail_out == 0) {
- m_Stream.next_out = StreamBuffer;
- m_Stream.avail_out = MIN((long unsigned int)STREAM_BUFFER_SIZE, NewPos - m_Stream.total_out); // TODO: long unsigned int???.
+ if (_stream.avail_out == 0) {
+ _stream.next_out = StreamBuffer;
+ _stream.avail_out = MIN((long unsigned int)STREAM_BUFFER_SIZE, NewPos - _stream.total_out); // TODO: long unsigned int???.
}
// stream on!
- int res = inflate(&m_Stream, Z_SYNC_FLUSH);
+ int res = inflate(&_stream, Z_SYNC_FLUSH);
if (res != Z_OK && res != Z_STREAM_END) {
ret = E_FAIL;
break;
@@ -222,7 +222,7 @@ HRESULT CBPkgFile::SeekToPos(uint32 NewPos) {
}
- m_Pos = NewPos;
+ _pos = NewPos;
return ret;
}
diff --git a/engines/wintermute/BPkgFile.h b/engines/wintermute/BPkgFile.h
index d6aac57d1d..3d165c4097 100644
--- a/engines/wintermute/BPkgFile.h
+++ b/engines/wintermute/BPkgFile.h
@@ -51,13 +51,13 @@ public:
virtual HRESULT Close();
virtual HRESULT Open(Common::String Filename);
private:
- bool m_InflateInit;
+ bool _inflateInit;
HRESULT SeekToPos(uint32 NewPos);
- bool m_Compressed;
- CBFileEntry *m_FileEntry;
- z_stream m_Stream;
- byte m_CompBuffer[COMPRESSED_BUFFER_SIZE];
- Common::File *m_File;
+ bool _compressed;
+ CBFileEntry *_fileEntry;
+ z_stream _stream;
+ byte _compBuffer[COMPRESSED_BUFFER_SIZE];
+ Common::File *_file;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BQuickMsg.cpp b/engines/wintermute/BQuickMsg.cpp
index 0f8c54f030..1e406af1e8 100644
--- a/engines/wintermute/BQuickMsg.cpp
+++ b/engines/wintermute/BQuickMsg.cpp
@@ -34,21 +34,21 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBQuickMsg::CBQuickMsg(CBGame *inGame, char *Text): CBBase(inGame) {
- m_Text = new char [strlen(Text) + 1];
- if (m_Text) strcpy(m_Text, Text);
- m_StartTime = Game->m_CurrentTime;
+ _text = new char [strlen(Text) + 1];
+ if (_text) strcpy(_text, Text);
+ _startTime = Game->_currentTime;
}
//////////////////////////////////////////////////////////////////////////
CBQuickMsg::~CBQuickMsg() {
- if (m_Text) delete [] m_Text;
+ if (_text) delete [] _text;
}
//////////////////////////////////////////////////////////////////////////
char *CBQuickMsg::GetText() {
- return m_Text;
+ return _text;
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/BQuickMsg.h b/engines/wintermute/BQuickMsg.h
index 67bb8cf8bf..6349a6ae35 100644
--- a/engines/wintermute/BQuickMsg.h
+++ b/engines/wintermute/BQuickMsg.h
@@ -36,8 +36,8 @@ namespace WinterMute {
class CBQuickMsg : public CBBase {
public:
char *GetText();
- uint32 m_StartTime;
- char *m_Text;
+ uint32 _startTime;
+ char *_text;
CBQuickMsg(CBGame *inGame, char *Text);
virtual ~CBQuickMsg();
diff --git a/engines/wintermute/BRegion.cpp b/engines/wintermute/BRegion.cpp
index 699e60c60f..44df8dce44 100644
--- a/engines/wintermute/BRegion.cpp
+++ b/engines/wintermute/BRegion.cpp
@@ -43,12 +43,12 @@ IMPLEMENT_PERSISTENT(CBRegion, false)
//////////////////////////////////////////////////////////////////////////
CBRegion::CBRegion(CBGame *inGame): CBObject(inGame) {
- m_Active = true;
- m_EditorSelectedPoint = -1;
- m_LastMimicScale = -1;
- m_LastMimicX = m_LastMimicY = INT_MIN;
+ _active = true;
+ _editorSelectedPoint = -1;
+ _lastMimicScale = -1;
+ _lastMimicX = _lastMimicY = INT_MIN;
- CBPlatform::SetRectEmpty(&m_Rect);
+ CBPlatform::SetRectEmpty(&_rect);
}
@@ -60,23 +60,23 @@ CBRegion::~CBRegion() {
//////////////////////////////////////////////////////////////////////////
void CBRegion::Cleanup() {
- for (int i = 0; i < m_Points.GetSize(); i++) delete m_Points[i];
- m_Points.RemoveAll();
+ for (int i = 0; i < _points.GetSize(); i++) delete _points[i];
+ _points.RemoveAll();
- CBPlatform::SetRectEmpty(&m_Rect);
- m_EditorSelectedPoint = -1;
+ CBPlatform::SetRectEmpty(&_rect);
+ _editorSelectedPoint = -1;
}
//////////////////////////////////////////////////////////////////////////
bool CBRegion::CreateRegion() {
- return SUCCEEDED(GetBoundingRect(&m_Rect));
+ return SUCCEEDED(GetBoundingRect(&_rect));
}
//////////////////////////////////////////////////////////////////////////
bool CBRegion::PointInRegion(int X, int Y) {
- if (m_Points.GetSize() < 3) return false;
+ if (_points.GetSize() < 3) return false;
POINT pt;
pt.x = X;
@@ -88,14 +88,14 @@ bool CBRegion::PointInRegion(int X, int Y) {
rect.top = Y - 1;
rect.bottom = Y + 2;
- if (CBPlatform::PtInRect(&m_Rect, pt)) return PtInPolygon(X, Y);
+ if (CBPlatform::PtInRect(&_rect, pt)) return PtInPolygon(X, Y);
else return false;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBRegion::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CBRegion::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -103,8 +103,8 @@ HRESULT CBRegion::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -154,8 +154,8 @@ HRESULT CBRegion::LoadBuffer(byte *Buffer, bool Complete) {
int i;
- for (i = 0; i < m_Points.GetSize(); i++) delete m_Points[i];
- m_Points.RemoveAll();
+ for (i = 0; i < _points.GetSize(); i++) delete _points[i];
+ _points.RemoveAll();
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
@@ -172,13 +172,13 @@ HRESULT CBRegion::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_ACTIVE:
- parser.ScanStr((char *)params, "%b", &m_Active);
+ parser.ScanStr((char *)params, "%b", &_active);
break;
case TOKEN_POINT: {
int x, y;
parser.ScanStr((char *)params, "%d,%d", &x, &y);
- m_Points.Add(new CBPoint(x, y));
+ _points.Add(new CBPoint(x, y));
}
break;
@@ -187,7 +187,7 @@ HRESULT CBRegion::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_EDITOR_SELECTED_POINT:
- parser.ScanStr((char *)params, "%d", &m_EditorSelectedPoint);
+ parser.ScanStr((char *)params, "%d", &_editorSelectedPoint);
break;
case TOKEN_PROPERTY:
@@ -219,7 +219,7 @@ HRESULT CBRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
int X = Stack->Pop()->GetInt();
int Y = Stack->Pop()->GetInt();
- m_Points.Add(new CBPoint(X, Y));
+ _points.Add(new CBPoint(X, Y));
CreateRegion();
Stack->PushBool(true);
@@ -236,8 +236,8 @@ HRESULT CBRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
int X = Stack->Pop()->GetInt();
int Y = Stack->Pop()->GetInt();
- if (Index >= 0 && Index < m_Points.GetSize()) {
- m_Points.InsertAt(Index, new CBPoint(X, Y));
+ if (Index >= 0 && Index < _points.GetSize()) {
+ _points.InsertAt(Index, new CBPoint(X, Y));
CreateRegion();
Stack->PushBool(true);
@@ -255,9 +255,9 @@ HRESULT CBRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
int X = Stack->Pop()->GetInt();
int Y = Stack->Pop()->GetInt();
- if (Index >= 0 && Index < m_Points.GetSize()) {
- m_Points[Index]->x = X;
- m_Points[Index]->y = Y;
+ if (Index >= 0 && Index < _points.GetSize()) {
+ _points[Index]->x = X;
+ _points[Index]->y = Y;
CreateRegion();
Stack->PushBool(true);
@@ -273,11 +273,11 @@ HRESULT CBRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
Stack->CorrectParams(1);
int Index = Stack->Pop()->GetInt();
- if (Index >= 0 && Index < m_Points.GetSize()) {
- delete m_Points[Index];
- m_Points[Index] = NULL;
+ if (Index >= 0 && Index < _points.GetSize()) {
+ delete _points[Index];
+ _points[Index] = NULL;
- m_Points.RemoveAt(Index);
+ _points.RemoveAt(Index);
CreateRegion();
Stack->PushBool(true);
@@ -293,11 +293,11 @@ HRESULT CBRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
Stack->CorrectParams(1);
int Index = Stack->Pop()->GetInt();
- if (Index >= 0 && Index < m_Points.GetSize()) {
+ if (Index >= 0 && Index < _points.GetSize()) {
CScValue *Val = Stack->GetPushValue();
if (Val) {
- Val->SetProperty("X", m_Points[Index]->x);
- Val->SetProperty("Y", m_Points[Index]->y);
+ Val->SetProperty("X", _points[Index]->x);
+ Val->SetProperty("Y", _points[Index]->y);
}
} else Stack->PushNULL();
@@ -310,38 +310,38 @@ HRESULT CBRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
CScValue *CBRegion::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("region");
- return m_ScValue;
+ _scValue->SetString("region");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Name") == 0) {
- m_ScValue->SetString(m_Name);
- return m_ScValue;
+ _scValue->SetString(_name);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Active") == 0) {
- m_ScValue->SetBool(m_Active);
- return m_ScValue;
+ _scValue->SetBool(_active);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumPoints
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumPoints") == 0) {
- m_ScValue->SetInt(m_Points.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_points.GetSize());
+ return _scValue;
}
else return CBObject::ScGetProperty(Name);
@@ -362,7 +362,7 @@ HRESULT CBRegion::ScSetProperty(char *Name, CScValue *Value) {
// Active
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Active") == 0) {
- m_Active = Value->GetBool();
+ _active = Value->GetBool();
return S_OK;
}
@@ -381,22 +381,22 @@ HRESULT CBRegion::SaveAsText(CBDynBuffer *Buffer, int Indent, char *NameOverride
if (!NameOverride) Buffer->PutTextIndent(Indent, "REGION {\n");
else Buffer->PutTextIndent(Indent, "%s {\n", NameOverride);
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
- Buffer->PutTextIndent(Indent + 2, "ACTIVE=%s\n", m_Active ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED_POINT=%d\n", m_EditorSelectedPoint);
+ Buffer->PutTextIndent(Indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED_POINT=%d\n", _editorSelectedPoint);
int i;
- for (i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- for (i = 0; i < m_Points.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "POINT {%d,%d}\n", m_Points[i]->x, m_Points[i]->y);
+ for (i = 0; i < _points.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
}
- if (m_ScProp) m_ScProp->SaveAsText(Buffer, Indent + 2);
+ if (_scProp) _scProp->SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent, "}\n\n");
@@ -409,12 +409,12 @@ HRESULT CBRegion::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Active));
- PersistMgr->Transfer(TMEMBER(m_EditorSelectedPoint));
- PersistMgr->Transfer(TMEMBER(m_LastMimicScale));
- PersistMgr->Transfer(TMEMBER(m_LastMimicX));
- PersistMgr->Transfer(TMEMBER(m_LastMimicY));
- m_Points.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_active));
+ PersistMgr->Transfer(TMEMBER(_editorSelectedPoint));
+ PersistMgr->Transfer(TMEMBER(_lastMimicScale));
+ PersistMgr->Transfer(TMEMBER(_lastMimicX));
+ PersistMgr->Transfer(TMEMBER(_lastMimicY));
+ _points.Persist(PersistMgr);
return S_OK;
}
@@ -426,7 +426,7 @@ typedef struct {
//////////////////////////////////////////////////////////////////////////
bool CBRegion::PtInPolygon(int X, int Y) {
- if (m_Points.GetSize() < 3) return false;
+ if (_points.GetSize() < 3) return false;
int counter = 0;
int i;
@@ -436,12 +436,12 @@ bool CBRegion::PtInPolygon(int X, int Y) {
p.x = (double)X;
p.y = (double)Y;
- p1.x = (double)m_Points[0]->x;
- p1.y = (double)m_Points[0]->y;
+ p1.x = (double)_points[0]->x;
+ p1.y = (double)_points[0]->y;
- for (i = 1; i <= m_Points.GetSize(); i++) {
- p2.x = (double)m_Points[i % m_Points.GetSize()]->x;
- p2.y = (double)m_Points[i % m_Points.GetSize()]->y;
+ for (i = 1; i <= _points.GetSize(); i++) {
+ p2.x = (double)_points[i % _points.GetSize()]->x;
+ p2.y = (double)_points[i % _points.GetSize()]->y;
if (p.y > std::min(p1.y, p2.y)) {
if (p.y <= std::max(p1.y, p2.y)) {
@@ -466,16 +466,16 @@ bool CBRegion::PtInPolygon(int X, int Y) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRegion::GetBoundingRect(RECT *Rect) {
- if (m_Points.GetSize() == 0) CBPlatform::SetRectEmpty(Rect);
+ if (_points.GetSize() == 0) CBPlatform::SetRectEmpty(Rect);
else {
int MinX = INT_MAX, MinY = INT_MAX, MaxX = INT_MIN, MaxY = INT_MIN;
- for (int i = 0; i < m_Points.GetSize(); i++) {
- MinX = std::min(MinX, m_Points[i]->x);
- MinY = std::min(MinY, m_Points[i]->y);
+ for (int i = 0; i < _points.GetSize(); i++) {
+ MinX = std::min(MinX, _points[i]->x);
+ MinY = std::min(MinY, _points[i]->y);
- MaxX = std::max(MaxX, m_Points[i]->x);
- MaxY = std::max(MaxY, m_Points[i]->y);
+ MaxX = std::max(MaxX, _points[i]->x);
+ MaxY = std::max(MaxY, _points[i]->y);
}
CBPlatform::SetRect(Rect, MinX, MinY, MaxX, MaxY);
}
@@ -485,22 +485,22 @@ HRESULT CBRegion::GetBoundingRect(RECT *Rect) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRegion::Mimic(CBRegion *Region, float Scale, int X, int Y) {
- if (Scale == m_LastMimicScale && X == m_LastMimicX && Y == m_LastMimicY) return S_OK;
+ if (Scale == _lastMimicScale && X == _lastMimicX && Y == _lastMimicY) return S_OK;
Cleanup();
- for (int i = 0; i < Region->m_Points.GetSize(); i++) {
+ for (int i = 0; i < Region->_points.GetSize(); i++) {
int x, y;
- x = (int)((float)Region->m_Points[i]->x * Scale / 100.0f);
- y = (int)((float)Region->m_Points[i]->y * Scale / 100.0f);
+ x = (int)((float)Region->_points[i]->x * Scale / 100.0f);
+ y = (int)((float)Region->_points[i]->y * Scale / 100.0f);
- m_Points.Add(new CBPoint(x + X, y + Y));
+ _points.Add(new CBPoint(x + X, y + Y));
}
- m_LastMimicScale = Scale;
- m_LastMimicX = X;
- m_LastMimicY = Y;
+ _lastMimicScale = Scale;
+ _lastMimicX = X;
+ _lastMimicY = Y;
return CreateRegion() ? S_OK : E_FAIL;
}
diff --git a/engines/wintermute/BRegion.h b/engines/wintermute/BRegion.h
index a218e6874a..914f77f7ae 100644
--- a/engines/wintermute/BRegion.h
+++ b/engines/wintermute/BRegion.h
@@ -36,24 +36,24 @@ namespace WinterMute {
class CBRegion : public CBObject {
public:
- float m_LastMimicScale;
- int m_LastMimicX;
- int m_LastMimicY;
+ float _lastMimicScale;
+ int _lastMimicX;
+ int _lastMimicY;
void Cleanup();
HRESULT Mimic(CBRegion *Region, float Scale = 100.0f, int X = 0, int Y = 0);
HRESULT GetBoundingRect(RECT *Rect);
bool PtInPolygon(int X, int Y);
DECLARE_PERSISTENT(CBRegion, CBObject)
- bool m_Active;
- int m_EditorSelectedPoint;
+ bool _active;
+ int _editorSelectedPoint;
CBRegion(CBGame *inGame);
virtual ~CBRegion();
bool PointInRegion(int X, int Y);
bool CreateRegion();
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
- RECT m_Rect;
- CBArray<CBPoint *, CBPoint *> m_Points;
+ RECT _rect;
+ CBArray<CBPoint *, CBPoint *> _points;
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent, char *NameOverride = NULL);
// scripting interface
diff --git a/engines/wintermute/BRegistry.cpp b/engines/wintermute/BRegistry.cpp
index 75b621d90f..72f34ef061 100644
--- a/engines/wintermute/BRegistry.cpp
+++ b/engines/wintermute/BRegistry.cpp
@@ -38,7 +38,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBRegistry::CBRegistry(CBGame *inGame): CBBase(inGame) {
- m_IniName = NULL;
+ _iniName = NULL;
SetIniName("./wme.ini");
LoadValues(true);
@@ -48,8 +48,8 @@ CBRegistry::CBRegistry(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
CBRegistry::~CBRegistry() {
SaveValues();
- delete[] m_IniName;
- m_IniName = NULL;
+ delete[] _iniName;
+ _iniName = NULL;
}
@@ -61,15 +61,15 @@ AnsiString CBRegistry::ReadString(const AnsiString &subKey, const AnsiString &ke
#ifdef __WIN32__
// check ini file first (so what we can use project files on windows)
char buffer[32768];
- GetPrivateProfileString(subKey.c_str(), key.c_str(), init.c_str(), buffer, 32768, m_IniName);
+ GetPrivateProfileString(subKey.c_str(), key.c_str(), init.c_str(), buffer, 32768, _iniName);
ret = AnsiString(buffer);
if (buffer != init) return ret;
#endif
bool found = false;
- ret = GetValue(m_LocalValues, subKey, key, found);
- if (!found) ret = GetValue(m_Values, subKey, key, found);
+ ret = GetValue(_localValues, subKey, key, found);
+ if (!found) ret = GetValue(_values, subKey, key, found);
if (!found) ret = init;
return ret;
@@ -78,7 +78,7 @@ AnsiString CBRegistry::ReadString(const AnsiString &subKey, const AnsiString &ke
//////////////////////////////////////////////////////////////////////////
bool CBRegistry::WriteString(const AnsiString &subKey, const AnsiString &key, const AnsiString &value) {
- m_Values[subKey][key] = value;
+ _values[subKey][key] = value;
return true;
}
@@ -86,7 +86,7 @@ bool CBRegistry::WriteString(const AnsiString &subKey, const AnsiString &key, co
//////////////////////////////////////////////////////////////////////////
int CBRegistry::ReadInt(const AnsiString &subKey, const AnsiString &key, int init) {
#ifdef __WIN32__
- int ret = GetPrivateProfileInt(subKey.c_str(), key.c_str(), init, m_IniName);
+ int ret = GetPrivateProfileInt(subKey.c_str(), key.c_str(), init, _iniName);
if (ret != init) return ret;
#endif
@@ -117,38 +117,38 @@ bool CBRegistry::WriteBool(const AnsiString &subKey, const AnsiString &key, bool
//////////////////////////////////////////////////////////////////////////
void CBRegistry::SetIniName(char *Name) {
- delete[] m_IniName;
- m_IniName = NULL;
+ delete[] _iniName;
+ _iniName = NULL;
if (strchr(Name, '\\') == NULL && strchr(Name, '/') == NULL) {
- m_IniName = new char [strlen(Name) + 3];
- sprintf(m_IniName, "./%s", Name);
+ _iniName = new char [strlen(Name) + 3];
+ sprintf(_iniName, "./%s", Name);
} else {
- m_IniName = new char [strlen(Name) + 1];
- strcpy(m_IniName, Name);
+ _iniName = new char [strlen(Name) + 1];
+ strcpy(_iniName, Name);
}
}
//////////////////////////////////////////////////////////////////////////
char *CBRegistry::GetIniName() {
- return m_IniName;
+ return _iniName;
}
//////////////////////////////////////////////////////////////////////////
void CBRegistry::LoadValues(bool local) {
- if (local) LoadXml("settings.xml", m_LocalValues);
- else LoadXml(PathUtil::Combine(Game->GetDataDir(), "settings.xml"), m_Values);
+ if (local) LoadXml("settings.xml", _localValues);
+ else LoadXml(PathUtil::Combine(Game->GetDataDir(), "settings.xml"), _values);
}
//////////////////////////////////////////////////////////////////////////
void CBRegistry::SaveValues() {
- SaveXml(PathUtil::Combine(Game->GetDataDir(), "settings.xml"), m_Values);
+ SaveXml(PathUtil::Combine(Game->GetDataDir(), "settings.xml"), _values);
}
//////////////////////////////////////////////////////////////////////////
void CBRegistry::SetBasePath(const char *basePath) {
- m_BasePath = PathUtil::GetFileNameWithoutExtension(basePath);
+ _basePath = PathUtil::GetFileNameWithoutExtension(basePath);
LoadValues(false);
}
@@ -196,7 +196,7 @@ void CBRegistry::SaveXml(const AnsiString fileName, PathValueMap &values) {
doc.LinkEndChild(root);
PathValueMap::iterator pathIt;
- for (pathIt = m_Values.begin(); pathIt != m_Values.end(); ++pathIt) {
+ for (pathIt = _values.begin(); pathIt != _values.end(); ++pathIt) {
TiXmlElement *pathElem = new TiXmlElement((*pathIt)._key.c_str());
root->LinkEndChild(pathElem);
diff --git a/engines/wintermute/BRegistry.h b/engines/wintermute/BRegistry.h
index 2838d3794f..0729374783 100644
--- a/engines/wintermute/BRegistry.h
+++ b/engines/wintermute/BRegistry.h
@@ -48,22 +48,22 @@ public:
void SetBasePath(const char *basePath);
AnsiString GetBasePath() const {
- return m_BasePath;
+ return _basePath;
}
void LoadValues(bool local);
void SaveValues();
private:
- char *m_IniName;
+ char *_iniName;
typedef Common::HashMap<AnsiString, AnsiString> KeyValuePair;
typedef Common::HashMap<AnsiString, KeyValuePair> PathValueMap;
- PathValueMap m_LocalValues;
- PathValueMap m_Values;
+ PathValueMap _localValues;
+ PathValueMap _values;
- AnsiString m_BasePath;
+ AnsiString _basePath;
void LoadXml(const AnsiString fileName, PathValueMap &values);
void SaveXml(const AnsiString fileName, PathValueMap &values);
diff --git a/engines/wintermute/BRenderSDL.cpp b/engines/wintermute/BRenderSDL.cpp
index d28bbc477f..c6684ec348 100644
--- a/engines/wintermute/BRenderSDL.cpp
+++ b/engines/wintermute/BRenderSDL.cpp
@@ -42,18 +42,18 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBRenderSDL::CBRenderSDL(CBGame *inGame) : CBRenderer(inGame) {
- m_Renderer = NULL;
- m_Win = NULL;
+ _renderer = NULL;
+ _win = NULL;
- m_BorderLeft = m_BorderRight = m_BorderTop = m_BorderBottom = 0;
- m_RatioX = m_RatioY = 1.0f;
+ _borderLeft = _borderRight = _borderTop = _borderBottom = 0;
+ _ratioX = _ratioY = 1.0f;
}
//////////////////////////////////////////////////////////////////////////
CBRenderSDL::~CBRenderSDL() {
#if 0
- if (m_Renderer) SDL_DestroyRenderer(m_Renderer);
- if (m_Win) SDL_DestroyWindow(m_Win);
+ if (_renderer) SDL_DestroyRenderer(_renderer);
+ if (_win) SDL_DestroyWindow(_win);
#endif
SDL_Quit();
}
@@ -67,17 +67,17 @@ HRESULT CBRenderSDL::InitRenderer(int width, int height, bool windowed) {
SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1);
#endif
- m_Width = width;
- m_Height = height;
+ _width = width;
+ _height = height;
- m_RealWidth = width;
- m_RealHeight = height;
+ _realWidth = width;
+ _realHeight = height;
// find suitable resolution
#ifdef __IPHONEOS__
- m_RealWidth = 480;
- m_RealHeight = 320;
+ _realWidth = 480;
+ _realHeight = 320;
int numModes = SDL_GetNumDisplayModes(0);
for (int i = 0; i < numModes; i++) {
@@ -85,44 +85,44 @@ HRESULT CBRenderSDL::InitRenderer(int width, int height, bool windowed) {
SDL_GetDisplayMode(0, i, &mode);
if (mode.w > mode.h) {
- m_RealWidth = mode.w;
- m_RealHeight = mode.h;
+ _realWidth = mode.w;
+ _realHeight = mode.h;
break;
}
}
#else
- m_RealWidth = Game->m_Registry->ReadInt("Debug", "ForceResWidth", m_Width);
- m_RealHeight = Game->m_Registry->ReadInt("Debug", "ForceResHeight", m_Height);
+ _realWidth = Game->_registry->ReadInt("Debug", "ForceResWidth", _width);
+ _realHeight = Game->_registry->ReadInt("Debug", "ForceResHeight", _height);
#endif
/*
- m_RealWidth = 480;
- m_RealHeight = 320;
+ _realWidth = 480;
+ _realHeight = 320;
*/
- float origAspect = (float)m_Width / (float)m_Height;
- float realAspect = (float)m_RealWidth / (float)m_RealHeight;
+ float origAspect = (float)_width / (float)_height;
+ float realAspect = (float)_realWidth / (float)_realHeight;
float ratio;
if (origAspect < realAspect) {
// normal to wide
- ratio = (float)m_RealHeight / (float)m_Height;
+ ratio = (float)_realHeight / (float)_height;
} else {
// wide to normal
- ratio = (float)m_RealWidth / (float)m_Width;
+ ratio = (float)_realWidth / (float)_width;
}
- m_BorderLeft = (m_RealWidth - (m_Width * ratio)) / 2;
- m_BorderRight = m_RealWidth - (m_Width * ratio) - m_BorderLeft;
+ _borderLeft = (_realWidth - (_width * ratio)) / 2;
+ _borderRight = _realWidth - (_width * ratio) - _borderLeft;
- m_BorderTop = (m_RealHeight - (m_Height * ratio)) / 2;
- m_BorderBottom = m_RealHeight - (m_Height * ratio) - m_BorderTop;
+ _borderTop = (_realHeight - (_height * ratio)) / 2;
+ _borderBottom = _realHeight - (_height * ratio) - _borderTop;
- m_RatioX = (float)(m_RealWidth - m_BorderLeft - m_BorderRight) / (float)m_Width;
- m_RatioY = (float)(m_RealHeight - m_BorderTop - m_BorderBottom) / (float)m_Height;
+ _ratioX = (float)(_realWidth - _borderLeft - _borderRight) / (float)_width;
+ _ratioY = (float)(_realHeight - _borderTop - _borderBottom) / (float)_height;
#if 0
Uint32 flags = SDL_WINDOW_SHOWN;
@@ -131,17 +131,17 @@ HRESULT CBRenderSDL::InitRenderer(int width, int height, bool windowed) {
flags |= SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS;
#endif
- //m_Windowed = Game->m_Registry->ReadBool("Video", "Windowed", true);
+ //_windowed = Game->_registry->ReadBool("Video", "Windowed", true);
// if (!windowed) flags |= SDL_WINDOW_FULLSCREEN;
#if 0
- m_Win = SDL_CreateWindow("WME Lite",
+ _win = SDL_CreateWindow("WME Lite",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
- m_RealWidth, m_RealHeight,
+ _realWidth, _realHeight,
flags);
#endif
- if (!m_Win) return E_FAIL;
+ if (!_win) return E_FAIL;
SDL_ShowCursor(SDL_DISABLE);
@@ -152,11 +152,11 @@ HRESULT CBRenderSDL::InitRenderer(int width, int height, bool windowed) {
//SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
#endif
#if 0
- m_Renderer = SDL_CreateRenderer(m_Win, -1, 0);
+ _renderer = SDL_CreateRenderer(_win, -1, 0);
#endif
- if (!m_Renderer) return E_FAIL;
+ if (!_renderer) return E_FAIL;
- m_Active = true;
+ _active = true;
return S_OK;
@@ -167,54 +167,54 @@ HRESULT CBRenderSDL::Flip() {
#ifdef __IPHONEOS__
// hack: until viewports work correctly, we just paint black bars instead
- SDL_SetRenderDrawColor(m_Renderer, 0x00, 0x00, 0x00, 0xFF);
+ SDL_SetRenderDrawColor(_renderer, 0x00, 0x00, 0x00, 0xFF);
static bool firstRefresh = true; // prevents a weird color glitch
if (firstRefresh) {
firstRefresh = false;
} else {
SDL_Rect rect;
- if (m_BorderLeft > 0) {
+ if (_borderLeft > 0) {
rect.x = 0;
rect.y = 0;
- rect.w = m_BorderLeft;
- rect.h = m_RealHeight;
- SDL_RenderFillRect(m_Renderer, &rect);
+ rect.w = _borderLeft;
+ rect.h = _realHeight;
+ SDL_RenderFillRect(_renderer, &rect);
}
- if (m_BorderRight > 0) {
- rect.x = (m_RealWidth - m_BorderRight);
+ if (_borderRight > 0) {
+ rect.x = (_realWidth - _borderRight);
rect.y = 0;
- rect.w = m_BorderRight;
- rect.h = m_RealHeight;
- SDL_RenderFillRect(m_Renderer, &rect);
+ rect.w = _borderRight;
+ rect.h = _realHeight;
+ SDL_RenderFillRect(_renderer, &rect);
}
- if (m_BorderTop > 0) {
+ if (_borderTop > 0) {
rect.x = 0;
rect.y = 0;
- rect.w = m_RealWidth;
- rect.h = m_BorderTop;
- SDL_RenderFillRect(m_Renderer, &rect);
+ rect.w = _realWidth;
+ rect.h = _borderTop;
+ SDL_RenderFillRect(_renderer, &rect);
}
- if (m_BorderBottom > 0) {
+ if (_borderBottom > 0) {
rect.x = 0;
- rect.y = m_RealHeight - m_BorderBottom;
- rect.w = m_RealWidth;
- rect.h = m_BorderBottom;
- SDL_RenderFillRect(m_Renderer, &rect);
+ rect.y = _realHeight - _borderBottom;
+ rect.w = _realWidth;
+ rect.h = _borderBottom;
+ SDL_RenderFillRect(_renderer, &rect);
}
}
#endif
- //SDL_RenderPresent(m_Renderer);
+ //SDL_RenderPresent(_renderer);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderSDL::Fill(byte r, byte g, byte b, RECT *rect) {
- //SDL_SetRenderDrawColor(m_Renderer, r, g, b, 0xFF);
- //SDL_RenderClear(m_Renderer);
+ //SDL_SetRenderDrawColor(_renderer, r, g, b, 0xFF);
+ //SDL_RenderClear(_renderer);
return S_OK;
}
@@ -250,9 +250,9 @@ HRESULT CBRenderSDL::FadeToColor(uint32 Color, RECT *rect) {
byte b = D3DCOLGetB(Color);
byte a = D3DCOLGetA(Color);
- //SDL_SetRenderDrawColor(m_Renderer, r, g, b, a);
- //SDL_SetRenderDrawBlendMode(m_Renderer, SDL_BLENDMODE_BLEND);
- //SDL_RenderFillRect(m_Renderer, &fillRect);
+ //SDL_SetRenderDrawColor(_renderer, r, g, b, a);
+ //SDL_SetRenderDrawBlendMode(_renderer, SDL_BLENDMODE_BLEND);
+ //SDL_RenderFillRect(_renderer, &fillRect);
return S_OK;
}
@@ -264,8 +264,8 @@ HRESULT CBRenderSDL::DrawLine(int X1, int Y1, int X2, int Y2, uint32 Color) {
byte b = D3DCOLGetB(Color);
byte a = D3DCOLGetA(Color);
- //SDL_SetRenderDrawColor(m_Renderer, r, g, b, a);
- //SDL_SetRenderDrawBlendMode(m_Renderer, SDL_BLENDMODE_BLEND);
+ //SDL_SetRenderDrawColor(_renderer, r, g, b, a);
+ //SDL_SetRenderDrawBlendMode(_renderer, SDL_BLENDMODE_BLEND);
POINT point1, point2;
point1.x = X1;
@@ -277,7 +277,7 @@ HRESULT CBRenderSDL::DrawLine(int X1, int Y1, int X2, int Y2, uint32 Color) {
PointToScreen(&point2);
- //SDL_RenderDrawLine(m_Renderer, point1.x, point1.y, point2.x, point2.y);
+ //SDL_RenderDrawLine(_renderer, point1.x, point1.y, point2.x, point2.y);
return S_OK;
}
@@ -287,12 +287,12 @@ CBImage *CBRenderSDL::TakeScreenshot() {
#if 0
SDL_Rect viewport;
- SDL_RenderGetViewport(m_Renderer, &viewport);
+ SDL_RenderGetViewport(_renderer, &viewport);
SDL_Surface *surface = SDL_CreateRGBSurface(0, viewport.w, viewport.h, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, 0x00000000);
if (!surface) return NULL;
- if (SDL_RenderReadPixels(m_Renderer, NULL, surface->format->format, surface->pixels, surface->pitch) < 0) return NULL;
+ if (SDL_RenderReadPixels(_renderer, NULL, surface->format->format, surface->pixels, surface->pitch) < 0) return NULL;
FIBITMAP *dib = FreeImage_Allocate(viewport.w, viewport.h, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
@@ -311,37 +311,37 @@ CBImage *CBRenderSDL::TakeScreenshot() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderSDL::SwitchFullscreen() {
- /*if (m_Windowed) SDL_SetWindowFullscreen(m_Win, SDL_TRUE);
- else SDL_SetWindowFullscreen(m_Win, SDL_FALSE);
+ /*if (_windowed) SDL_SetWindowFullscreen(_win, SDL_TRUE);
+ else SDL_SetWindowFullscreen(_win, SDL_FALSE);
- m_Windowed = !m_Windowed;
+ _windowed = !_windowed;
*/
- Game->m_Registry->WriteBool("Video", "Windowed", m_Windowed);
+ Game->_registry->WriteBool("Video", "Windowed", _windowed);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
const char *CBRenderSDL::GetName() {
- if (m_Name.empty()) {
- if (m_Renderer) {
+ if (_name.empty()) {
+ if (_renderer) {
#if 0
SDL_RendererInfo info;
- SDL_GetRendererInfo(m_Renderer, &info);
- m_Name = AnsiString(info.name);
+ SDL_GetRendererInfo(_renderer, &info);
+ _name = AnsiString(info.name);
#endif
}
}
- return m_Name.c_str();
+ return _name.c_str();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderSDL::SetViewport(int left, int top, int right, int bottom) {
SDL_Rect rect;
- rect.x = left + m_BorderLeft;
- rect.y = top + m_BorderTop;
- rect.w = (right - left) * m_RatioX;
- rect.h = (bottom - top) * m_RatioY;
+ rect.x = left + _borderLeft;
+ rect.y = top + _borderTop;
+ rect.w = (right - left) * _ratioX;
+ rect.h = (bottom - top) * _ratioY;
// TODO fix this once viewports work correctly in SDL/landscape
#ifndef __IPHONEOS__
@@ -356,10 +356,10 @@ void CBRenderSDL::ModTargetRect(SDL_Rect *rect) {
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
- rect->x = MathUtil::Round(rect->x * m_RatioX + m_BorderLeft - viewportRect.x);
- rect->y = MathUtil::Round(rect->y * m_RatioY + m_BorderTop - viewportRect.y);
- rect->w = MathUtil::RoundUp(rect->w * m_RatioX);
- rect->h = MathUtil::RoundUp(rect->h * m_RatioY);
+ rect->x = MathUtil::Round(rect->x * _ratioX + _borderLeft - viewportRect.x);
+ rect->y = MathUtil::Round(rect->y * _ratioY + _borderTop - viewportRect.y);
+ rect->w = MathUtil::RoundUp(rect->w * _ratioX);
+ rect->h = MathUtil::RoundUp(rect->h * _ratioY);
#endif
}
@@ -369,8 +369,8 @@ void CBRenderSDL::PointFromScreen(POINT *point) {
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
- point->x = point->x / m_RatioX - m_BorderLeft / m_RatioX + viewportRect.x;
- point->y = point->y / m_RatioY - m_BorderTop / m_RatioY + viewportRect.y;
+ point->x = point->x / _ratioX - _borderLeft / _ratioX + viewportRect.x;
+ point->y = point->y / _ratioY - _borderTop / _ratioY + viewportRect.y;
#endif
}
@@ -381,8 +381,8 @@ void CBRenderSDL::PointToScreen(POINT *point) {
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
- point->x = MathUtil::RoundUp(point->x * m_RatioX) + m_BorderLeft - viewportRect.x;
- point->y = MathUtil::RoundUp(point->y * m_RatioY) + m_BorderTop - viewportRect.y;
+ point->x = MathUtil::RoundUp(point->x * _ratioX) + _borderLeft - viewportRect.x;
+ point->y = MathUtil::RoundUp(point->y * _ratioY) + _borderTop - viewportRect.y;
#endif
}
@@ -391,17 +391,17 @@ void CBRenderSDL::DumpData(char *Filename) {
FILE *f = fopen(Filename, "wt");
if (!f) return;
- CBSurfaceStorage *Mgr = Game->m_SurfaceStorage;
+ CBSurfaceStorage *Mgr = Game->_surfaceStorage;
int TotalKB = 0;
int TotalLoss = 0;
fprintf(f, "Filename;Usage;Size;KBytes\n");
- for (int i = 0; i < Mgr->m_Surfaces.GetSize(); i++) {
- CBSurfaceSDL *Surf = (CBSurfaceSDL *)Mgr->m_Surfaces[i];
- if (!Surf->m_Filename) continue;
- if (!Surf->m_Valid) continue;
+ for (int i = 0; i < Mgr->_surfaces.GetSize(); i++) {
+ CBSurfaceSDL *Surf = (CBSurfaceSDL *)Mgr->_surfaces[i];
+ if (!Surf->_filename) continue;
+ if (!Surf->_valid) continue;
- fprintf(f, "%s;%d;", Surf->m_Filename, Surf->m_ReferenceCount);
+ fprintf(f, "%s;%d;", Surf->_filename, Surf->_referenceCount);
fprintf(f, "%dx%d;", Surf->GetWidth(), Surf->GetHeight());
int kb = Surf->GetWidth() * Surf->GetHeight() * 4 / 1024;
@@ -410,7 +410,7 @@ void CBRenderSDL::DumpData(char *Filename) {
fprintf(f, "%d;", kb);
fprintf(f, "\n");
}
- fprintf(f, "Total %d;;;%d\n", Mgr->m_Surfaces.GetSize(), TotalKB);
+ fprintf(f, "Total %d;;;%d\n", Mgr->_surfaces.GetSize(), TotalKB);
fclose(f);
diff --git a/engines/wintermute/BRenderSDL.h b/engines/wintermute/BRenderSDL.h
index 11a969946e..edcafdff96 100644
--- a/engines/wintermute/BRenderSDL.h
+++ b/engines/wintermute/BRenderSDL.h
@@ -58,10 +58,10 @@ public:
CBImage *TakeScreenshot();
SDL_Renderer *GetSdlRenderer() const {
- return m_Renderer;
+ return _renderer;
}
SDL_Window *GetSdlWindow() const {
- return m_Win;
+ return _win;
}
HRESULT SetViewport(int left, int top, int right, int bottom);
@@ -73,24 +73,24 @@ public:
void DumpData(char *Filename);
float GetScaleRatioX() const {
- return m_RatioX;
+ return _ratioX;
}
float GetScaleRatioY() const {
- return m_RatioY;
+ return _ratioY;
}
private:
- SDL_Renderer *m_Renderer;
- SDL_Window *m_Win;
- AnsiString m_Name;
+ SDL_Renderer *_renderer;
+ SDL_Window *_win;
+ AnsiString _name;
- int m_BorderLeft;
- int m_BorderTop;
- int m_BorderRight;
- int m_BorderBottom;
+ int _borderLeft;
+ int _borderTop;
+ int _borderRight;
+ int _borderBottom;
- float m_RatioX;
- float m_RatioY;
+ float _ratioX;
+ float _ratioY;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BRenderer.cpp b/engines/wintermute/BRenderer.cpp
index aaaca902fa..a0ebcdd1d3 100644
--- a/engines/wintermute/BRenderer.cpp
+++ b/engines/wintermute/BRenderer.cpp
@@ -38,19 +38,19 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBRenderer::CBRenderer(CBGame *inGame): CBBase(inGame) {
- m_Instance = NULL;
- m_Window = NULL;
- m_ClipperWindow = NULL;
- m_Active = false;
- m_Ready = false;
- m_Windowed = true;
- m_ForceAlphaColor = 0x00;
-
- m_Width = m_Height = m_BPP = 0;
- CBPlatform::SetRectEmpty(&m_MonitorRect);
-
- m_RealWidth = m_RealHeight = 0;
- m_DrawOffsetX = m_DrawOffsetY = 0;
+ _instance = NULL;
+ _window = NULL;
+ _clipperWindow = NULL;
+ _active = false;
+ _ready = false;
+ _windowed = true;
+ _forceAlphaColor = 0x00;
+
+ _width = _height = _bPP = 0;
+ CBPlatform::SetRectEmpty(&_monitorRect);
+
+ _realWidth = _realHeight = 0;
+ _drawOffsetX = _drawOffsetY = 0;
}
@@ -73,31 +73,31 @@ CBObject *CBRenderer::GetObjectAt(int X, int Y) {
point.x = X;
point.y = Y;
- for (int i = m_RectList.GetSize() - 1; i >= 0; i--) {
- if (CBPlatform::PtInRect(&m_RectList[i]->m_Rect, point)) {
- if (m_RectList[i]->m_Precise) {
+ for (int i = _rectList.GetSize() - 1; i >= 0; i--) {
+ if (CBPlatform::PtInRect(&_rectList[i]->_rect, point)) {
+ if (_rectList[i]->_precise) {
// frame
- if (m_RectList[i]->m_Frame) {
- int XX = (int)((m_RectList[i]->m_Frame->m_Rect.left + X - m_RectList[i]->m_Rect.left + m_RectList[i]->m_OffsetX) / (float)((float)m_RectList[i]->m_ZoomX / (float)100));
- int YY = (int)((m_RectList[i]->m_Frame->m_Rect.top + Y - m_RectList[i]->m_Rect.top + m_RectList[i]->m_OffsetY) / (float)((float)m_RectList[i]->m_ZoomY / (float)100));
+ if (_rectList[i]->_frame) {
+ int XX = (int)((_rectList[i]->_frame->_rect.left + X - _rectList[i]->_rect.left + _rectList[i]->_offsetX) / (float)((float)_rectList[i]->_zoomX / (float)100));
+ int YY = (int)((_rectList[i]->_frame->_rect.top + Y - _rectList[i]->_rect.top + _rectList[i]->_offsetY) / (float)((float)_rectList[i]->_zoomY / (float)100));
- if (m_RectList[i]->m_Frame->m_MirrorX) {
- int Width = m_RectList[i]->m_Frame->m_Rect.right - m_RectList[i]->m_Frame->m_Rect.left;
+ if (_rectList[i]->_frame->_mirrorX) {
+ int Width = _rectList[i]->_frame->_rect.right - _rectList[i]->_frame->_rect.left;
XX = Width - XX;
}
- if (m_RectList[i]->m_Frame->m_MirrorY) {
- int Height = m_RectList[i]->m_Frame->m_Rect.bottom - m_RectList[i]->m_Frame->m_Rect.top;
+ if (_rectList[i]->_frame->_mirrorY) {
+ int Height = _rectList[i]->_frame->_rect.bottom - _rectList[i]->_frame->_rect.top;
YY = Height - YY;
}
- if (!m_RectList[i]->m_Frame->m_Surface->IsTransparentAt(XX, YY)) return m_RectList[i]->m_Owner;
+ if (!_rectList[i]->_frame->_surface->IsTransparentAt(XX, YY)) return _rectList[i]->_owner;
}
// region
- else if (m_RectList[i]->m_Region) {
- if (m_RectList[i]->m_Region->PointInRegion(X + m_RectList[i]->m_OffsetX, Y + m_RectList[i]->m_OffsetY)) return m_RectList[i]->m_Owner;
+ else if (_rectList[i]->_region) {
+ if (_rectList[i]->_region->PointInRegion(X + _rectList[i]->_offsetX, Y + _rectList[i]->_offsetY)) return _rectList[i]->_owner;
}
- } else return m_RectList[i]->m_Owner;
+ } else return _rectList[i]->_owner;
}
}
@@ -107,10 +107,10 @@ CBObject *CBRenderer::GetObjectAt(int X, int Y) {
//////////////////////////////////////////////////////////////////////////
void CBRenderer::DeleteRectList() {
- for (int i = 0; i < m_RectList.GetSize(); i++) {
- delete m_RectList[i];
+ for (int i = 0; i < _rectList.GetSize(); i++) {
+ delete _rectList[i];
}
- m_RectList.RemoveAll();
+ _rectList.RemoveAll();
}
@@ -199,16 +199,16 @@ HRESULT CBRenderer::SetViewport(int left, int top, int right, int bottom) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderer::SetScreenViewport() {
- return SetViewport(m_DrawOffsetX, m_DrawOffsetY, m_Width + m_DrawOffsetX, m_Height + m_DrawOffsetY);
+ return SetViewport(_drawOffsetX, _drawOffsetY, _width + _drawOffsetX, _height + _drawOffsetY);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderer::SetViewport(RECT *Rect) {
- return SetViewport(Rect->left + m_DrawOffsetX,
- Rect->top + m_DrawOffsetY,
- Rect->right + m_DrawOffsetX,
- Rect->bottom + m_DrawOffsetY);
+ return SetViewport(Rect->left + _drawOffsetX,
+ Rect->top + _drawOffsetY,
+ Rect->right + _drawOffsetX,
+ Rect->bottom + _drawOffsetY);
}
@@ -221,16 +221,16 @@ CBImage *CBRenderer::TakeScreenshot() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderer::ClipCursor() {
/*
- if(!m_Windowed)
+ if(!_windowed)
{
RECT rc;
- GetWindowRect(m_Window, &rc);
+ GetWindowRect(_window, &rc);
// if "maintain aspect ratio" is in effect, lock mouse to visible area
- rc.left = m_DrawOffsetX;
- rc.top = m_DrawOffsetY;
- rc.right = rc.left + m_Width;
- rc.bottom = rc.top + m_Height;
+ rc.left = _drawOffsetX;
+ rc.top = _drawOffsetY;
+ rc.right = rc.left + _width;
+ rc.bottom = rc.top + _height;
::ClipCursor(&rc);
}
@@ -241,17 +241,17 @@ HRESULT CBRenderer::ClipCursor() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderer::UnclipCursor() {
/*
- if(!m_Windowed) ::ClipCursor(NULL);
+ if(!_windowed) ::ClipCursor(NULL);
*/
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
bool CBRenderer::PointInViewport(POINT *P) {
- if (P->x < m_DrawOffsetX) return false;
- if (P->y < m_DrawOffsetY) return false;
- if (P->x > m_DrawOffsetX + m_Width) return false;
- if (P->y > m_DrawOffsetY + m_Height) return false;
+ if (P->x < _drawOffsetX) return false;
+ if (P->y < _drawOffsetY) return false;
+ if (P->x > _drawOffsetX + _width) return false;
+ if (P->y > _drawOffsetY + _height) return false;
return true;
}
diff --git a/engines/wintermute/BRenderer.h b/engines/wintermute/BRenderer.h
index c1180a5ef5..de7731a3ad 100644
--- a/engines/wintermute/BRenderer.h
+++ b/engines/wintermute/BRenderer.h
@@ -41,10 +41,10 @@ class CBObject;
class CBRenderer: public CBBase {
public:
- int m_RealWidth;
- int m_RealHeight;
- int m_DrawOffsetX;
- int m_DrawOffsetY;
+ int _realWidth;
+ int _realHeight;
+ int _drawOffsetX;
+ int _drawOffsetY;
virtual void DumpData(char *Filename) {};
virtual CBImage *TakeScreenshot();
@@ -101,22 +101,22 @@ public:
return S_OK;
};
bool PointInViewport(POINT *P);
- uint32 m_ForceAlphaColor;
- HINSTANCE m_Instance;
- HWND m_Window;
- HWND m_ClipperWindow;
- bool m_Active;
- bool m_Ready;
- bool m_Windowed;
- RECT m_WindowRect;
- RECT m_ViewportRect;
- RECT m_ScreenRect;
- RECT m_MonitorRect;
- int m_BPP;
- int m_Height;
- int m_Width;
-
- CBArray<CBActiveRect *, CBActiveRect *> m_RectList;
+ uint32 _forceAlphaColor;
+ HINSTANCE _instance;
+ HWND _window;
+ HWND _clipperWindow;
+ bool _active;
+ bool _ready;
+ bool _windowed;
+ RECT _windowRect;
+ RECT _viewportRect;
+ RECT _screenRect;
+ RECT _monitorRect;
+ int _bPP;
+ int _height;
+ int _width;
+
+ CBArray<CBActiveRect *, CBActiveRect *> _rectList;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BResourceFile.cpp b/engines/wintermute/BResourceFile.cpp
index 84811d0e73..c03868cde1 100644
--- a/engines/wintermute/BResourceFile.cpp
+++ b/engines/wintermute/BResourceFile.cpp
@@ -34,7 +34,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBResourceFile::CBResourceFile(CBGame *inGame): CBFile(inGame) {
- m_Data = NULL;
+ _data = NULL;
}
@@ -48,8 +48,8 @@ CBResourceFile::~CBResourceFile() {
HRESULT CBResourceFile::Open(Common::String Filename) {
Close();
- if (CBResources::GetFile(Filename.c_str(), m_Data, m_Size)) {
- m_Pos = 0;
+ if (CBResources::GetFile(Filename.c_str(), _data, _size)) {
+ _pos = 0;
return S_OK;
}
return E_FAIL;
@@ -57,9 +57,9 @@ HRESULT CBResourceFile::Open(Common::String Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBResourceFile::Close() {
- m_Data = NULL;
- m_Pos = 0;
- m_Size = 0;
+ _data = NULL;
+ _pos = 0;
+ _size = 0;
return S_OK;
}
@@ -67,10 +67,10 @@ HRESULT CBResourceFile::Close() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBResourceFile::Read(void *Buffer, uint32 Size) {
- if (!m_Data || m_Pos + Size > m_Size) return E_FAIL;
+ if (!_data || _pos + Size > _size) return E_FAIL;
- memcpy(Buffer, (byte *)m_Data + m_Pos, Size);
- m_Pos += Size;
+ memcpy(Buffer, (byte *)_data + _pos, Size);
+ _pos += Size;
return S_OK;
}
@@ -78,7 +78,7 @@ HRESULT CBResourceFile::Read(void *Buffer, uint32 Size) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBResourceFile::Seek(uint32 Pos, TSeek Origin) {
- if (!m_Data) return E_FAIL;
+ if (!_data) return E_FAIL;
uint32 NewPos = 0;
@@ -87,15 +87,15 @@ HRESULT CBResourceFile::Seek(uint32 Pos, TSeek Origin) {
NewPos = Pos;
break;
case SEEK_TO_END:
- NewPos = m_Size + Pos;
+ NewPos = _size + Pos;
break;
case SEEK_TO_CURRENT:
- NewPos = m_Pos + Pos;
+ NewPos = _pos + Pos;
break;
}
- if (NewPos < 0 || NewPos > m_Size) return E_FAIL;
- else m_Pos = NewPos;
+ if (NewPos < 0 || NewPos > _size) return E_FAIL;
+ else _pos = NewPos;
return S_OK;
}
diff --git a/engines/wintermute/BResourceFile.h b/engines/wintermute/BResourceFile.h
index 4d995d674d..110f320d60 100644
--- a/engines/wintermute/BResourceFile.h
+++ b/engines/wintermute/BResourceFile.h
@@ -42,7 +42,7 @@ public:
virtual HRESULT Close();
virtual HRESULT Open(Common::String Filename);
private:
- byte *m_Data;
+ byte *_data;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BResources.cpp b/engines/wintermute/BResources.cpp
index dceade0984..f387d1848b 100644
--- a/engines/wintermute/BResources.cpp
+++ b/engines/wintermute/BResources.cpp
@@ -2817,7 +2817,7 @@ bool CBResources::GetFile(const char *fileName, byte*& buffer, uint32 &size) {
buffer = invaliddebug;
size = sizeof(invaliddebug);
return true;
- } else if (scumm_stricmp(fileName, "system_font.bmp") == 0) {
+ } else if (scumm_stricmp(fileName, "syste_font.bmp") == 0) {
buffer = systemfont;
size = sizeof(systemfont);
return true;
diff --git a/engines/wintermute/BSaveThumbFile.cpp b/engines/wintermute/BSaveThumbFile.cpp
index aeba924684..4f698563d3 100644
--- a/engines/wintermute/BSaveThumbFile.cpp
+++ b/engines/wintermute/BSaveThumbFile.cpp
@@ -40,7 +40,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBSaveThumbFile::CBSaveThumbFile(CBGame *inGame): CBFile(inGame) {
- m_Data = NULL;
+ _data = NULL;
}
@@ -74,20 +74,20 @@ HRESULT CBSaveThumbFile::Open(Common::String Filename) {
CBPersistMgr *pm = new CBPersistMgr(Game);
if (!pm) return E_FAIL;
- Game->m_DEBUG_AbsolutePathWarning = false;
+ Game->_dEBUG_AbsolutePathWarning = false;
if (FAILED(pm->InitLoad(SlotFilename))) {
- Game->m_DEBUG_AbsolutePathWarning = true;
+ Game->_dEBUG_AbsolutePathWarning = true;
delete pm;
return E_FAIL;
}
- Game->m_DEBUG_AbsolutePathWarning = true;
+ Game->_dEBUG_AbsolutePathWarning = true;
HRESULT res;
- if (pm->m_ThumbnailDataSize != 0) {
- m_Data = new byte[pm->m_ThumbnailDataSize];
- memcpy(m_Data, pm->m_ThumbnailData, pm->m_ThumbnailDataSize);
- m_Size = pm->m_ThumbnailDataSize;
+ if (pm->_thumbnailDataSize != 0) {
+ _data = new byte[pm->_thumbnailDataSize];
+ memcpy(_data, pm->_thumbnailData, pm->_thumbnailDataSize);
+ _size = pm->_thumbnailDataSize;
res = S_OK;
} else res = E_FAIL;
delete pm;
@@ -98,11 +98,11 @@ HRESULT CBSaveThumbFile::Open(Common::String Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSaveThumbFile::Close() {
- delete[] m_Data;
- m_Data = NULL;
+ delete[] _data;
+ _data = NULL;
- m_Pos = 0;
- m_Size = 0;
+ _pos = 0;
+ _size = 0;
return S_OK;
}
@@ -110,10 +110,10 @@ HRESULT CBSaveThumbFile::Close() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSaveThumbFile::Read(void *Buffer, uint32 Size) {
- if (!m_Data || m_Pos + Size > m_Size) return E_FAIL;
+ if (!_data || _pos + Size > _size) return E_FAIL;
- memcpy(Buffer, (byte *)m_Data + m_Pos, Size);
- m_Pos += Size;
+ memcpy(Buffer, (byte *)_data + _pos, Size);
+ _pos += Size;
return S_OK;
}
@@ -121,7 +121,7 @@ HRESULT CBSaveThumbFile::Read(void *Buffer, uint32 Size) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSaveThumbFile::Seek(uint32 Pos, TSeek Origin) {
- if (!m_Data) return E_FAIL;
+ if (!_data) return E_FAIL;
uint32 NewPos = 0;
@@ -130,15 +130,15 @@ HRESULT CBSaveThumbFile::Seek(uint32 Pos, TSeek Origin) {
NewPos = Pos;
break;
case SEEK_TO_END:
- NewPos = m_Size + Pos;
+ NewPos = _size + Pos;
break;
case SEEK_TO_CURRENT:
- NewPos = m_Pos + Pos;
+ NewPos = _pos + Pos;
break;
}
- if (NewPos < 0 || NewPos > m_Size) return E_FAIL;
- else m_Pos = NewPos;
+ if (NewPos < 0 || NewPos > _size) return E_FAIL;
+ else _pos = NewPos;
return S_OK;
}
diff --git a/engines/wintermute/BSaveThumbFile.h b/engines/wintermute/BSaveThumbFile.h
index 7c22eda237..55596b7ecc 100644
--- a/engines/wintermute/BSaveThumbFile.h
+++ b/engines/wintermute/BSaveThumbFile.h
@@ -43,7 +43,7 @@ public:
virtual HRESULT Close();
virtual HRESULT Open(Common::String Filename);
private:
- byte *m_Data;
+ byte *_data;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BSaveThumbHelper.cpp b/engines/wintermute/BSaveThumbHelper.cpp
index 3342f7aa3a..ac8898c344 100644
--- a/engines/wintermute/BSaveThumbHelper.cpp
+++ b/engines/wintermute/BSaveThumbHelper.cpp
@@ -35,38 +35,38 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBSaveThumbHelper::CBSaveThumbHelper(CBGame *inGame): CBBase(inGame) {
- m_Thumbnail = NULL;
+ _thumbnail = NULL;
}
//////////////////////////////////////////////////////////////////////////
CBSaveThumbHelper::~CBSaveThumbHelper(void) {
- delete m_Thumbnail;
- m_Thumbnail = NULL;
+ delete _thumbnail;
+ _thumbnail = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSaveThumbHelper::StoreThumbnail(bool DoFlip) {
- delete m_Thumbnail;
- m_Thumbnail = NULL;
+ delete _thumbnail;
+ _thumbnail = NULL;
- if (Game->m_ThumbnailWidth > 0 && Game->m_ThumbnailHeight > 0) {
+ if (Game->_thumbnailWidth > 0 && Game->_thumbnailHeight > 0) {
if (DoFlip) {
// when using opengl on windows it seems to be necessary to do this twice
// works normally for direct3d
Game->DisplayContent(false);
- Game->m_Renderer->Flip();
+ Game->_renderer->Flip();
Game->DisplayContent(false);
- Game->m_Renderer->Flip();
+ Game->_renderer->Flip();
}
- CBImage *Screenshot = Game->m_Renderer->TakeScreenshot();
+ CBImage *Screenshot = Game->_renderer->TakeScreenshot();
if (!Screenshot) return E_FAIL;
// normal thumbnail
- if (Game->m_ThumbnailWidth > 0 && Game->m_ThumbnailHeight > 0) {
- m_Thumbnail = new CBImage(Game);
- m_Thumbnail->CopyFrom(Screenshot, Game->m_ThumbnailWidth, Game->m_ThumbnailHeight);
+ if (Game->_thumbnailWidth > 0 && Game->_thumbnailHeight > 0) {
+ _thumbnail = new CBImage(Game);
+ _thumbnail->CopyFrom(Screenshot, Game->_thumbnailWidth, Game->_thumbnailHeight);
}
diff --git a/engines/wintermute/BSaveThumbHelper.h b/engines/wintermute/BSaveThumbHelper.h
index 6c1e411f5f..fa42762367 100644
--- a/engines/wintermute/BSaveThumbHelper.h
+++ b/engines/wintermute/BSaveThumbHelper.h
@@ -41,8 +41,8 @@ public:
virtual ~CBSaveThumbHelper(void);
HRESULT StoreThumbnail(bool DoFlip = false);
- CBImage *m_Thumbnail;
- CBImage *m_RichThumbnail;
+ CBImage *_thumbnail;
+ CBImage *_richThumbnail;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BScriptHolder.cpp b/engines/wintermute/BScriptHolder.cpp
index 674df198cd..ed7db2507b 100644
--- a/engines/wintermute/BScriptHolder.cpp
+++ b/engines/wintermute/BScriptHolder.cpp
@@ -40,8 +40,8 @@ IMPLEMENT_PERSISTENT(CBScriptHolder, false)
CBScriptHolder::CBScriptHolder(CBGame *inGame): CBScriptable(inGame) {
SetName("<unnamed>");
- m_Freezable = true;
- m_Filename = NULL;
+ _freezable = true;
+ _filename = NULL;
}
@@ -53,26 +53,26 @@ CBScriptHolder::~CBScriptHolder() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBScriptHolder::Cleanup() {
- delete[] m_Filename;
- m_Filename = NULL;
+ delete[] _filename;
+ _filename = NULL;
int i;
- for (i = 0; i < m_Scripts.GetSize(); i++) {
- m_Scripts[i]->Finish(true);
- m_Scripts[i]->m_Owner = NULL;
+ for (i = 0; i < _scripts.GetSize(); i++) {
+ _scripts[i]->Finish(true);
+ _scripts[i]->_owner = NULL;
}
- m_Scripts.RemoveAll();
+ _scripts.RemoveAll();
return S_OK;
}
//////////////////////////////////////////////////////////////////////
void CBScriptHolder::SetFilename(char *Filename) {
- if (m_Filename != NULL) delete [] m_Filename;
+ if (_filename != NULL) delete [] _filename;
- m_Filename = new char [strlen(Filename) + 1];
- if (m_Filename != NULL) strcpy(m_Filename, Filename);
+ _filename = new char [strlen(Filename) + 1];
+ if (_filename != NULL) strcpy(_filename, Filename);
}
@@ -81,17 +81,17 @@ HRESULT CBScriptHolder::ApplyEvent(const char *EventName, bool Unbreakable) {
int NumHandlers = 0;
HRESULT ret = E_FAIL;
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (!m_Scripts[i]->m_Thread) {
- CScScript *handler = m_Scripts[i]->InvokeEventHandler(EventName, Unbreakable);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (!_scripts[i]->_thread) {
+ CScScript *handler = _scripts[i]->InvokeEventHandler(EventName, Unbreakable);
if (handler) {
- //m_Scripts.Add(handler);
+ //_scripts.Add(handler);
NumHandlers++;
ret = S_OK;
}
}
}
- if (NumHandlers > 0 && Unbreakable) Game->m_ScEngine->TickUnbreakable();
+ if (NumHandlers > 0 && Unbreakable) Game->_scEngine->TickUnbreakable();
return ret;
}
@@ -172,9 +172,9 @@ HRESULT CBScriptHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStac
char *Filename = Stack->Pop()->GetString();
bool KillThreads = Stack->Pop()->GetBool(false);
bool ret = false;
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (scumm_stricmp(m_Scripts[i]->m_Filename, Filename) == 0) {
- m_Scripts[i]->Finish(KillThreads);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (scumm_stricmp(_scripts[i]->_filename, Filename) == 0) {
+ _scripts[i]->Finish(KillThreads);
ret = true;
break;
}
@@ -191,8 +191,8 @@ HRESULT CBScriptHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStac
Stack->CorrectParams(1);
char *Filename = Stack->Pop()->GetString();
bool ret = false;
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (scumm_stricmp(m_Scripts[i]->m_Filename, Filename) == 0 && m_Scripts[i]->m_State != SCRIPT_FINISHED && m_Scripts[i]->m_State != SCRIPT_ERROR) {
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (scumm_stricmp(_scripts[i]->_filename, Filename) == 0 && _scripts[i]->_state != SCRIPT_FINISHED && _scripts[i]->_state != SCRIPT_ERROR) {
ret = true;
break;
}
@@ -206,30 +206,30 @@ HRESULT CBScriptHolder::ScCallMethod(CScScript *Script, CScStack *Stack, CScStac
//////////////////////////////////////////////////////////////////////////
CScValue *CBScriptHolder::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("script_holder");
- return m_ScValue;
+ _scValue->SetString("script_holder");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Name") == 0) {
- m_ScValue->SetString(m_Name);
- return m_ScValue;
+ _scValue->SetString(_name);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Filename (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Filename") == 0) {
- m_ScValue->SetString(m_Filename);
- return m_ScValue;
+ _scValue->SetString(_filename);
+ return _scValue;
}
else return CBScriptable::ScGetProperty(Name);
@@ -263,10 +263,10 @@ HRESULT CBScriptHolder::SaveAsText(CBDynBuffer *Buffer, int Indent) {
HRESULT CBScriptHolder::Persist(CBPersistMgr *PersistMgr) {
CBScriptable::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Filename));
- PersistMgr->Transfer(TMEMBER(m_Freezable));
- PersistMgr->Transfer(TMEMBER(m_Name));
- m_Scripts.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_filename));
+ PersistMgr->Transfer(TMEMBER(_freezable));
+ PersistMgr->Transfer(TMEMBER(_name));
+ _scripts.Persist(PersistMgr);
return S_OK;
}
@@ -274,34 +274,34 @@ HRESULT CBScriptHolder::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBScriptHolder::AddScript(char *Filename) {
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (scumm_stricmp(m_Scripts[i]->m_Filename, Filename) == 0) {
- if (m_Scripts[i]->m_State != SCRIPT_FINISHED) {
- Game->LOG(0, "CBScriptHolder::AddScript - trying to add script '%s' mutiple times (obj: '%s')", Filename, m_Name);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (scumm_stricmp(_scripts[i]->_filename, Filename) == 0) {
+ if (_scripts[i]->_state != SCRIPT_FINISHED) {
+ Game->LOG(0, "CBScriptHolder::AddScript - trying to add script '%s' mutiple times (obj: '%s')", Filename, _name);
return S_OK;
}
}
}
- CScScript *scr = Game->m_ScEngine->RunScript(Filename, this);
+ CScScript *scr = Game->_scEngine->RunScript(Filename, this);
if (!scr) {
- if (Game->m_EditorForceScripts) {
+ if (Game->_editorForceScripts) {
// editor hack
- scr = new CScScript(Game, Game->m_ScEngine);
- scr->m_Filename = new char[strlen(Filename) + 1];
- strcpy(scr->m_Filename, Filename);
- scr->m_State = SCRIPT_ERROR;
- scr->m_Owner = this;
- m_Scripts.Add(scr);
- Game->m_ScEngine->m_Scripts.Add(scr);
+ scr = new CScScript(Game, Game->_scEngine);
+ scr->_filename = new char[strlen(Filename) + 1];
+ strcpy(scr->_filename, Filename);
+ scr->_state = SCRIPT_ERROR;
+ scr->_owner = this;
+ _scripts.Add(scr);
+ Game->_scEngine->_scripts.Add(scr);
Game->GetDebugMgr()->OnScriptInit(scr);
return S_OK;
}
return E_FAIL;
} else {
- scr->m_Freezable = m_Freezable;
- m_Scripts.Add(scr);
+ scr->_freezable = _freezable;
+ _scripts.Add(scr);
return S_OK;
}
}
@@ -309,9 +309,9 @@ HRESULT CBScriptHolder::AddScript(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBScriptHolder::RemoveScript(CScScript *Script) {
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i] == Script) {
- m_Scripts.RemoveAt(i);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i] == Script) {
+ _scripts.RemoveAt(i);
break;
}
}
@@ -320,8 +320,8 @@ HRESULT CBScriptHolder::RemoveScript(CScScript *Script) {
//////////////////////////////////////////////////////////////////////////
bool CBScriptHolder::CanHandleEvent(char *EventName) {
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (!m_Scripts[i]->m_Thread && m_Scripts[i]->CanHandleEvent(EventName)) return true;
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (!_scripts[i]->_thread && _scripts[i]->CanHandleEvent(EventName)) return true;
}
return false;
}
@@ -329,8 +329,8 @@ bool CBScriptHolder::CanHandleEvent(char *EventName) {
//////////////////////////////////////////////////////////////////////////
bool CBScriptHolder::CanHandleMethod(char *MethodName) {
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (!m_Scripts[i]->m_Thread && m_Scripts[i]->CanHandleMethod(MethodName)) return true;
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (!_scripts[i]->_thread && _scripts[i]->CanHandleMethod(MethodName)) return true;
}
return false;
}
@@ -416,24 +416,24 @@ HRESULT CBScriptHolder::ParseProperty(byte *Buffer, bool Complete) {
//////////////////////////////////////////////////////////////////////////
void CBScriptHolder::MakeFreezable(bool Freezable) {
- m_Freezable = Freezable;
- for (int i = 0; i < m_Scripts.GetSize(); i++)
- m_Scripts[i]->m_Freezable = Freezable;
+ _freezable = Freezable;
+ for (int i = 0; i < _scripts.GetSize(); i++)
+ _scripts[i]->_freezable = Freezable;
}
//////////////////////////////////////////////////////////////////////////
CScScript *CBScriptHolder::InvokeMethodThread(char *MethodName) {
- for (int i = m_Scripts.GetSize() - 1; i >= 0; i--) {
- if (m_Scripts[i]->CanHandleMethod(MethodName)) {
+ for (int i = _scripts.GetSize() - 1; i >= 0; i--) {
+ if (_scripts[i]->CanHandleMethod(MethodName)) {
- CScScript *thread = new CScScript(Game, m_Scripts[i]->m_Engine);
+ CScScript *thread = new CScScript(Game, _scripts[i]->_engine);
if (thread) {
- HRESULT ret = thread->CreateMethodThread(m_Scripts[i], MethodName);
+ HRESULT ret = thread->CreateMethodThread(_scripts[i], MethodName);
if (SUCCEEDED(ret)) {
- m_Scripts[i]->m_Engine->m_Scripts.Add(thread);
- Game->GetDebugMgr()->OnScriptMethodThreadInit(thread, m_Scripts[i], MethodName);
+ _scripts[i]->_engine->_scripts.Add(thread);
+ Game->GetDebugMgr()->OnScriptMethodThreadInit(thread, _scripts[i], MethodName);
return thread;
} else {
@@ -449,13 +449,13 @@ CScScript *CBScriptHolder::InvokeMethodThread(char *MethodName) {
//////////////////////////////////////////////////////////////////////////
void CBScriptHolder::ScDebuggerDesc(char *Buf, int BufSize) {
strcpy(Buf, ScToString());
- if (m_Name && strcmp(m_Name, "<unnamed>") != 0) {
+ if (_name && strcmp(_name, "<unnamed>") != 0) {
strcat(Buf, " Name: ");
- strcat(Buf, m_Name);
+ strcat(Buf, _name);
}
- if (m_Filename) {
+ if (_filename) {
strcat(Buf, " File: ");
- strcat(Buf, m_Filename);
+ strcat(Buf, _filename);
}
}
diff --git a/engines/wintermute/BScriptHolder.h b/engines/wintermute/BScriptHolder.h
index e4a4c0f6f6..cc54a983c2 100644
--- a/engines/wintermute/BScriptHolder.h
+++ b/engines/wintermute/BScriptHolder.h
@@ -53,11 +53,11 @@ public:
HRESULT ApplyEvent(const char *EventName, bool Unbreakable = false);
void SetFilename(char *Filename);
HRESULT ParseProperty(byte *Buffer, bool Complete = true);
- char *m_Filename;
- bool m_Freezable;
- bool m_Ready;
+ char *_filename;
+ bool _freezable;
+ bool _ready;
- CBArray<CScScript *, CScScript *> m_Scripts;
+ CBArray<CScScript *, CScScript *> _scripts;
// scripting interface
virtual CScValue *ScGetProperty(char *Name);
virtual HRESULT ScSetProperty(char *Name, CScValue *Value);
diff --git a/engines/wintermute/BScriptable.cpp b/engines/wintermute/BScriptable.cpp
index 9b875eeffb..e38ee061d8 100644
--- a/engines/wintermute/BScriptable.cpp
+++ b/engines/wintermute/BScriptable.cpp
@@ -37,24 +37,24 @@ IMPLEMENT_PERSISTENT(CBScriptable, false)
//////////////////////////////////////////////////////////////////////////
CBScriptable::CBScriptable(CBGame *inGame, bool NoValue, bool Persistable): CBNamedObject(inGame) {
- m_RefCount = 0;
+ _refCount = 0;
- if (NoValue) m_ScValue = NULL;
- else m_ScValue = new CScValue(Game);
+ if (NoValue) _scValue = NULL;
+ else _scValue = new CScValue(Game);
- m_Persistable = Persistable;
+ _persistable = Persistable;
- m_ScProp = NULL;
+ _scProp = NULL;
}
//////////////////////////////////////////////////////////////////////////
CBScriptable::~CBScriptable() {
- //if(m_RefCount>0) Game->LOG(0, "Warning: Destroying object, m_RefCount=%d", m_RefCount);
- delete m_ScValue;
- delete m_ScProp;
- m_ScValue = NULL;
- m_ScProp = NULL;
+ //if(_refCount>0) Game->LOG(0, "Warning: Destroying object, _refCount=%d", _refCount);
+ delete _scValue;
+ delete _scProp;
+ _scValue = NULL;
+ _scProp = NULL;
}
@@ -75,16 +75,16 @@ HRESULT CBScriptable::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
//////////////////////////////////////////////////////////////////////////
CScValue *CBScriptable::ScGetProperty(char *Name) {
- if (!m_ScProp) m_ScProp = new CScValue(Game);
- if (m_ScProp) return m_ScProp->GetProp(Name);
+ if (!_scProp) _scProp = new CScValue(Game);
+ if (_scProp) return _scProp->GetProp(Name);
else return NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBScriptable::ScSetProperty(char *Name, CScValue *Value) {
- if (!m_ScProp) m_ScProp = new CScValue(Game);
- if (m_ScProp) return m_ScProp->SetProp(Name, Value);
+ if (!_scProp) _scProp = new CScValue(Game);
+ if (_scProp) return _scProp->SetProp(Name, Value);
else return E_FAIL;
}
@@ -141,9 +141,9 @@ void CBScriptable::ScSetBool(bool Val) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBScriptable::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_RefCount));
- PersistMgr->Transfer(TMEMBER(m_ScProp));
- PersistMgr->Transfer(TMEMBER(m_ScValue));
+ PersistMgr->Transfer(TMEMBER(_refCount));
+ PersistMgr->Transfer(TMEMBER(_scProp));
+ PersistMgr->Transfer(TMEMBER(_scValue));
return S_OK;
}
diff --git a/engines/wintermute/BScriptable.h b/engines/wintermute/BScriptable.h
index 2a87b9c305..71ce682a4b 100644
--- a/engines/wintermute/BScriptable.h
+++ b/engines/wintermute/BScriptable.h
@@ -64,9 +64,9 @@ public:
virtual void ScSetBool(bool Val);
virtual int ScCompare(CBScriptable *Val);
virtual void ScDebuggerDesc(char *Buf, int BufSize);
- int m_RefCount;
- CScValue *m_ScValue;
- CScValue *m_ScProp;
+ int _refCount;
+ CScValue *_scValue;
+ CScValue *_scProp;
public:
// IWmeDebugObject
diff --git a/engines/wintermute/BSound.cpp b/engines/wintermute/BSound.cpp
index b6261f8117..46f7c5ce45 100644
--- a/engines/wintermute/BSound.cpp
+++ b/engines/wintermute/BSound.cpp
@@ -36,50 +36,50 @@ IMPLEMENT_PERSISTENT(CBSound, false)
//////////////////////////////////////////////////////////////////////////
CBSound::CBSound(CBGame *inGame): CBBase(inGame) {
- m_Sound = NULL;
- m_SoundFilename = NULL;
-
- m_SoundType = SOUND_SFX;
- m_SoundStreamed = false;
- m_SoundLooping = false;
- m_SoundPlaying = false;
- m_SoundPaused = false;
- m_SoundFreezePaused = false;
- m_SoundPosition = 0;
- m_SoundPrivateVolume = 0;
- m_SoundLoopStart = 0;
-
- m_SFXType = SFX_NONE;
- m_SFXParam1 = m_SFXParam2 = m_SFXParam3 = m_SFXParam4 = 0;
+ _sound = NULL;
+ _soundFilename = NULL;
+
+ _soundType = SOUND_SFX;
+ _soundStreamed = false;
+ _soundLooping = false;
+ _soundPlaying = false;
+ _soundPaused = false;
+ _soundFreezePaused = false;
+ _soundPosition = 0;
+ _soundPrivateVolume = 0;
+ _soundLoopStart = 0;
+
+ _sFXType = SFX_NONE;
+ _sFXParam1 = _sFXParam2 = _sFXParam3 = _sFXParam4 = 0;
}
//////////////////////////////////////////////////////////////////////////
CBSound::~CBSound() {
- if (m_Sound) Game->m_SoundMgr->RemoveSound(m_Sound);
- m_Sound = NULL;
+ if (_sound) Game->_soundMgr->RemoveSound(_sound);
+ _sound = NULL;
- delete[] m_SoundFilename;
- m_SoundFilename = NULL;
+ delete[] _soundFilename;
+ _soundFilename = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::SetSound(char *Filename, TSoundType Type, bool Streamed) {
- if (m_Sound) {
- Game->m_SoundMgr->RemoveSound(m_Sound);
- m_Sound = NULL;
+ if (_sound) {
+ Game->_soundMgr->RemoveSound(_sound);
+ _sound = NULL;
}
- delete[] m_SoundFilename;
- m_SoundFilename = NULL;
+ delete[] _soundFilename;
+ _soundFilename = NULL;
- m_Sound = Game->m_SoundMgr->AddSound(Filename, Type, Streamed);
- if (m_Sound) {
- m_SoundFilename = new char[strlen(Filename) + 1];
- strcpy(m_SoundFilename, Filename);
+ _sound = Game->_soundMgr->AddSound(Filename, Type, Streamed);
+ if (_sound) {
+ _soundFilename = new char[strlen(Filename) + 1];
+ strcpy(_soundFilename, Filename);
- m_SoundType = Type;
- m_SoundStreamed = Streamed;
+ _soundType = Type;
+ _soundStreamed = Streamed;
return S_OK;
} else return E_FAIL;
@@ -88,14 +88,14 @@ HRESULT CBSound::SetSound(char *Filename, TSoundType Type, bool Streamed) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::SetSoundSimple() {
- m_Sound = Game->m_SoundMgr->AddSound(m_SoundFilename, m_SoundType, m_SoundStreamed);
- if (m_Sound) {
- if (m_SoundPosition) m_Sound->SetPosition(m_SoundPosition);
- m_Sound->SetLooping(m_SoundLooping);
- m_Sound->SetPrivateVolume(m_SoundPrivateVolume);
- m_Sound->SetLoopStart(m_SoundLoopStart);
- m_Sound->m_FreezePaused = m_SoundFreezePaused;
- if (m_SoundPlaying) return m_Sound->Resume();
+ _sound = Game->_soundMgr->AddSound(_soundFilename, _soundType, _soundStreamed);
+ if (_sound) {
+ if (_soundPosition) _sound->SetPosition(_soundPosition);
+ _sound->SetLooping(_soundLooping);
+ _sound->SetPrivateVolume(_soundPrivateVolume);
+ _sound->SetLoopStart(_soundLoopStart);
+ _sound->_freezePaused = _soundFreezePaused;
+ if (_soundPlaying) return _sound->Resume();
else return S_OK;
} else return E_FAIL;
}
@@ -104,76 +104,76 @@ HRESULT CBSound::SetSoundSimple() {
//////////////////////////////////////////////////////////////////////////
uint32 CBSound::GetLength() {
- if (m_Sound) return m_Sound->GetLength();
+ if (_sound) return _sound->GetLength();
else return 0;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::Play(bool Looping) {
- if (m_Sound) {
- m_SoundPaused = false;
- return m_Sound->Play(Looping, m_SoundPosition);
+ if (_sound) {
+ _soundPaused = false;
+ return _sound->Play(Looping, _soundPosition);
} else return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::Stop() {
- if (m_Sound) {
- m_SoundPaused = false;
- return m_Sound->Stop();
+ if (_sound) {
+ _soundPaused = false;
+ return _sound->Stop();
} else return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::Pause(bool FreezePaused) {
- if (m_Sound) {
- m_SoundPaused = true;
- if (FreezePaused) m_Sound->m_FreezePaused = true;
- return m_Sound->Pause();
+ if (_sound) {
+ _soundPaused = true;
+ if (FreezePaused) _sound->_freezePaused = true;
+ return _sound->Pause();
} else return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::Resume() {
- if (m_Sound && m_SoundPaused) {
- m_SoundPaused = false;
- return m_Sound->Resume();
+ if (_sound && _soundPaused) {
+ _soundPaused = false;
+ return _sound->Resume();
} else return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::Persist(CBPersistMgr *PersistMgr) {
- if (PersistMgr->m_Saving && m_Sound) {
- m_SoundPlaying = m_Sound->IsPlaying();
- m_SoundLooping = m_Sound->m_Looping;
- m_SoundPrivateVolume = m_Sound->m_PrivateVolume;
- if (m_SoundPlaying) m_SoundPosition = m_Sound->GetPosition();
- m_SoundLoopStart = m_Sound->m_LoopStart;
- m_SoundFreezePaused = m_Sound->m_FreezePaused;
+ if (PersistMgr->_saving && _sound) {
+ _soundPlaying = _sound->IsPlaying();
+ _soundLooping = _sound->_looping;
+ _soundPrivateVolume = _sound->_privateVolume;
+ if (_soundPlaying) _soundPosition = _sound->GetPosition();
+ _soundLoopStart = _sound->_loopStart;
+ _soundFreezePaused = _sound->_freezePaused;
}
- if (PersistMgr->m_Saving) {
- m_SFXType = SFX_NONE;
- m_SFXParam1 = m_SFXParam2 = m_SFXParam3 = m_SFXParam4 = 0;
+ if (PersistMgr->_saving) {
+ _sFXType = SFX_NONE;
+ _sFXParam1 = _sFXParam2 = _sFXParam3 = _sFXParam4 = 0;
}
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_SoundFilename));
- PersistMgr->Transfer(TMEMBER(m_SoundLooping));
- PersistMgr->Transfer(TMEMBER(m_SoundPaused));
- PersistMgr->Transfer(TMEMBER(m_SoundFreezePaused));
- PersistMgr->Transfer(TMEMBER(m_SoundPlaying));
- PersistMgr->Transfer(TMEMBER(m_SoundPosition));
- PersistMgr->Transfer(TMEMBER(m_SoundPrivateVolume));
- PersistMgr->Transfer(TMEMBER(m_SoundStreamed));
- PersistMgr->Transfer(TMEMBER_INT(m_SoundType));
- PersistMgr->Transfer(TMEMBER(m_SoundLoopStart));
+ PersistMgr->Transfer(TMEMBER(_soundFilename));
+ PersistMgr->Transfer(TMEMBER(_soundLooping));
+ PersistMgr->Transfer(TMEMBER(_soundPaused));
+ PersistMgr->Transfer(TMEMBER(_soundFreezePaused));
+ PersistMgr->Transfer(TMEMBER(_soundPlaying));
+ PersistMgr->Transfer(TMEMBER(_soundPosition));
+ PersistMgr->Transfer(TMEMBER(_soundPrivateVolume));
+ PersistMgr->Transfer(TMEMBER(_soundStreamed));
+ PersistMgr->Transfer(TMEMBER_INT(_soundType));
+ PersistMgr->Transfer(TMEMBER(_soundLoopStart));
return S_OK;
}
@@ -181,82 +181,82 @@ HRESULT CBSound::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
bool CBSound::IsPlaying() {
- return m_Sound && m_Sound->IsPlaying();
+ return _sound && _sound->IsPlaying();
}
//////////////////////////////////////////////////////////////////////////
bool CBSound::IsPaused() {
- return m_Sound && m_SoundPaused;
+ return _sound && _soundPaused;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::SetPositionTime(uint32 Time) {
- if (!m_Sound) return E_FAIL;
- m_SoundPosition = Time;
- HRESULT ret = m_Sound->SetPosition(m_SoundPosition);
- if (m_Sound->IsPlaying()) m_SoundPosition = 0;
+ if (!_sound) return E_FAIL;
+ _soundPosition = Time;
+ HRESULT ret = _sound->SetPosition(_soundPosition);
+ if (_sound->IsPlaying()) _soundPosition = 0;
return ret;
}
//////////////////////////////////////////////////////////////////////////
uint32 CBSound::GetPositionTime() {
- if (!m_Sound) return 0;
+ if (!_sound) return 0;
- if (!m_Sound->IsPlaying()) return 0;
- else return m_Sound->GetPosition();
+ if (!_sound->IsPlaying()) return 0;
+ else return _sound->GetPosition();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::SetVolume(int Volume) {
- if (!m_Sound) return E_FAIL;
- else return m_Sound->SetPrivateVolume(Volume);
+ if (!_sound) return E_FAIL;
+ else return _sound->SetPrivateVolume(Volume);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::SetPrivateVolume(int Volume) {
- if (!m_Sound) return E_FAIL;
- else return m_Sound->m_PrivateVolume = Volume;
+ if (!_sound) return E_FAIL;
+ else return _sound->_privateVolume = Volume;
}
//////////////////////////////////////////////////////////////////////////
int CBSound::GetVolume() {
- if (!m_Sound) return 0;
- else return m_Sound->m_PrivateVolume;
+ if (!_sound) return 0;
+ else return _sound->_privateVolume;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::SetLoopStart(uint32 Pos) {
- if (!m_Sound) return E_FAIL;
+ if (!_sound) return E_FAIL;
else {
- m_Sound->SetLoopStart(Pos);
+ _sound->SetLoopStart(Pos);
return S_OK;
}
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::SetPan(float Pan) {
- if (m_Sound) return m_Sound->SetPan(Pan);
+ if (_sound) return _sound->SetPan(Pan);
else return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSound::ApplyFX(TSFXType Type, float Param1, float Param2, float Param3, float Param4) {
- if (!m_Sound) return S_OK;
+ if (!_sound) return S_OK;
- if (Type != m_SFXType || Param1 != m_SFXParam1 || Param2 != m_SFXParam2 || Param3 != m_SFXParam3 || Param4 != m_SFXParam4) {
- HRESULT Ret = m_Sound->ApplyFX(Type, Param1, Param2, Param3, Param4);
+ if (Type != _sFXType || Param1 != _sFXParam1 || Param2 != _sFXParam2 || Param3 != _sFXParam3 || Param4 != _sFXParam4) {
+ HRESULT Ret = _sound->ApplyFX(Type, Param1, Param2, Param3, Param4);
- m_SFXType = Type;
- m_SFXParam1 = Param1;
- m_SFXParam2 = Param2;
- m_SFXParam3 = Param3;
- m_SFXParam4 = Param4;
+ _sFXType = Type;
+ _sFXParam1 = Param1;
+ _sFXParam2 = Param2;
+ _sFXParam3 = Param3;
+ _sFXParam4 = Param4;
return Ret;
}
diff --git a/engines/wintermute/BSound.h b/engines/wintermute/BSound.h
index 0320030c72..922992de7f 100644
--- a/engines/wintermute/BSound.h
+++ b/engines/wintermute/BSound.h
@@ -39,30 +39,30 @@ namespace WinterMute {
class CBSound : public CBBase {
public:
HRESULT SetPan(float Pan);
- int m_SoundPrivateVolume;
+ int _soundPrivateVolume;
int GetVolume();
HRESULT SetVolume(int Volume);
HRESULT SetPrivateVolume(int Volume);
HRESULT SetLoopStart(uint32 Pos);
uint32 GetPositionTime();
HRESULT SetPositionTime(uint32 Time);
- bool m_SoundPaused;
- bool m_SoundFreezePaused;
+ bool _soundPaused;
+ bool _soundFreezePaused;
bool IsPlaying();
bool IsPaused();
- bool m_SoundPlaying;
- bool m_SoundLooping;
- uint32 m_SoundLoopStart;
- uint32 m_SoundPosition;
+ bool _soundPlaying;
+ bool _soundLooping;
+ uint32 _soundLoopStart;
+ uint32 _soundPosition;
DECLARE_PERSISTENT(CBSound, CBBase)
HRESULT Resume();
HRESULT Pause(bool FreezePaused = false);
HRESULT Stop();
HRESULT Play(bool Looping = false);
uint32 GetLength();
- bool m_SoundStreamed;
- TSoundType m_SoundType;
- char *m_SoundFilename;
+ bool _soundStreamed;
+ TSoundType _soundType;
+ char *_soundFilename;
HRESULT SetSoundSimple();
HRESULT SetSound(char *Filename, TSoundType Type = SOUND_SFX, bool Streamed = false);
CBSound(CBGame *inGame);
@@ -71,12 +71,12 @@ public:
HRESULT ApplyFX(TSFXType Type = SFX_NONE, float Param1 = 0, float Param2 = 0, float Param3 = 0, float Param4 = 0);
private:
- TSFXType m_SFXType;
- float m_SFXParam1;
- float m_SFXParam2;
- float m_SFXParam3;
- float m_SFXParam4;
- CBSoundBuffer *m_Sound;
+ TSFXType _sFXType;
+ float _sFXParam1;
+ float _sFXParam2;
+ float _sFXParam3;
+ float _sFXParam4;
+ CBSoundBuffer *_sound;
};
diff --git a/engines/wintermute/BSoundBuffer.cpp b/engines/wintermute/BSoundBuffer.cpp
index 48c63bf4d9..7de8aec436 100644
--- a/engines/wintermute/BSoundBuffer.cpp
+++ b/engines/wintermute/BSoundBuffer.cpp
@@ -45,20 +45,20 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBSoundBuffer::CBSoundBuffer(CBGame *inGame): CBBase(inGame) {
#if 0
- m_Stream = NULL;
- m_Sync = NULL;
+ _stream = NULL;
+ _sync = NULL;
- m_Streamed = false;
- m_Filename = NULL;
- m_File = NULL;
- m_PrivateVolume = 100;
+ _streamed = false;
+ _filename = NULL;
+ _file = NULL;
+ _privateVolume = 100;
- m_Looping = false;
- m_LoopStart = 0;
+ _looping = false;
+ _loopStart = 0;
- m_Type = SOUND_SFX;
+ _type = SOUND_SFX;
- m_FreezePaused = false;
+ _freezePaused = false;
#endif
}
@@ -68,39 +68,39 @@ CBSoundBuffer::~CBSoundBuffer() {
#if 0
Stop();
- if (m_Stream) {
- BASS_StreamFree(m_Stream);
- m_Stream = NULL;
+ if (_stream) {
+ BASS_StreamFree(_stream);
+ _stream = NULL;
}
- if (m_File) {
- Game->m_FileManager->CloseFile(m_File);
- m_File = NULL;
+ if (_file) {
+ Game->_fileManager->CloseFile(_file);
+ _file = NULL;
}
- SAFE_DELETE_ARRAY(m_Filename);
+ SAFE_DELETE_ARRAY(_filename);
#endif
}
//////////////////////////////////////////////////////////////////////////
void CBSoundBuffer::SetStreaming(bool Streamed, uint32 NumBlocks, uint32 BlockSize) {
- m_Streamed = Streamed;
+ _streamed = Streamed;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::LoadFromFile(const char *Filename, bool ForceReload) {
#if 0
- if (m_Stream) {
- BASS_StreamFree(m_Stream);
- m_Stream = NULL;
+ if (_stream) {
+ BASS_StreamFree(_stream);
+ _stream = NULL;
}
- if (m_File) Game->m_FileManager->CloseFile(m_File);
+ if (_file) Game->_fileManager->CloseFile(_file);
- m_File = Game->m_FileManager->OpenFile(Filename);
- if (!m_File) {
+ _file = Game->_fileManager->OpenFile(Filename);
+ if (!_file) {
Game->LOG(0, "Error opening sound file '%s'", Filename);
return E_FAIL;
}
@@ -111,33 +111,33 @@ HRESULT CBSoundBuffer::LoadFromFile(const char *Filename, bool ForceReload) {
fileProc.seek = CBSoundBuffer::FileSeekProc;
fileProc.length = CBSoundBuffer::FileLenProc;
- m_Stream = BASS_StreamCreateFileUser(STREAMFILE_NOBUFFER, 0, &fileProc, (void *)m_File);
- if (!m_Stream) {
+ _stream = BASS_StreamCreateFileUser(STREAMFILE_NOBUFFER, 0, &fileProc, (void *)_file);
+ if (!_stream) {
Game->LOG(0, "BASS error: %d while loading '%s'", BASS_ErrorGetCode(), Filename);
return E_FAIL;
}
- CBUtils::SetString(&m_Filename, Filename);
+ CBUtils::SetString(&_filename, Filename);
/*
HRESULT res;
bool NewlyCreated = false;
- if(!m_SoundBuffer || ForceReload || m_Streamed){
- if(!m_File) m_File = Game->m_FileManager->OpenFile(Filename);
- if(!m_File){
+ if(!_soundBuffer || ForceReload || _streamed){
+ if(!_file) _file = Game->_fileManager->OpenFile(Filename);
+ if(!_file){
Game->LOG(0, "Error opening sound file '%s'", Filename);
return E_FAIL;
}
// switch to streamed for big files
- if(!m_Streamed && (m_File->GetSize() > MAX_NONSTREAMED_FILE_SIZE && !Game->m_ForceNonStreamedSounds)) SetStreaming(true);
+ if(!_streamed && (_file->GetSize() > MAX_NONSTREAMED_FILE_SIZE && !Game->_forceNonStreamedSounds)) SetStreaming(true);
}
// create buffer
- if(!m_SoundBuffer){
+ if(!_soundBuffer){
NewlyCreated = true;
- res = InitializeBuffer(m_File);
+ res = InitializeBuffer(_file);
if(FAILED(res)){
Game->LOG(res, "Error creating sound buffer for file '%s'", Filename);
return res;
@@ -147,15 +147,15 @@ HRESULT CBSoundBuffer::LoadFromFile(const char *Filename, bool ForceReload) {
// store filename
- if(!m_Filename){
- m_Filename = new char[strlen(Filename)+1];
- strcpy(m_Filename, Filename);
+ if(!_filename){
+ _filename = new char[strlen(Filename)+1];
+ strcpy(_filename, Filename);
}
// close file (if not streaming)
- if(!m_Streamed && m_File){
- Game->m_FileManager->CloseFile(m_File);
- m_File = NULL;
+ if(!_streamed && _file){
+ Game->_fileManager->CloseFile(_file);
+ _file = NULL;
}
*/
@@ -167,9 +167,9 @@ HRESULT CBSoundBuffer::LoadFromFile(const char *Filename, bool ForceReload) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::Play(bool Looping, uint32 StartSample) {
#if 0
- if (m_Stream) {
+ if (_stream) {
SetLooping(Looping);
- BASS_ChannelPlay(m_Stream, TRUE);
+ BASS_ChannelPlay(_stream, TRUE);
}
return S_OK;
#endif
@@ -178,10 +178,10 @@ HRESULT CBSoundBuffer::Play(bool Looping, uint32 StartSample) {
//////////////////////////////////////////////////////////////////////////
void CBSoundBuffer::SetLooping(bool looping) {
#if 0
- m_Looping = looping;
+ _looping = looping;
- if (m_Stream) {
- BASS_ChannelFlags(m_Stream, looping ? BASS_SAMPLE_LOOP : 0, BASS_SAMPLE_LOOP);
+ if (_stream) {
+ BASS_ChannelFlags(_stream, looping ? BASS_SAMPLE_LOOP : 0, BASS_SAMPLE_LOOP);
}
#endif
}
@@ -189,8 +189,8 @@ void CBSoundBuffer::SetLooping(bool looping) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::Resume() {
#if 0
- if (m_Stream) {
- BASS_ChannelPlay(m_Stream, FALSE);
+ if (_stream) {
+ BASS_ChannelPlay(_stream, FALSE);
}
return S_OK;
#endif
@@ -200,8 +200,8 @@ HRESULT CBSoundBuffer::Resume() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::Stop() {
#if 0
- if (m_Stream) {
- BASS_ChannelStop(m_Stream);
+ if (_stream) {
+ BASS_ChannelStop(_stream);
}
#endif
return S_OK;
@@ -211,8 +211,8 @@ HRESULT CBSoundBuffer::Stop() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::Pause() {
#if 0
- if (m_Stream) {
- BASS_ChannelPause(m_Stream);
+ if (_stream) {
+ BASS_ChannelPause(_stream);
}
#endif
return S_OK;
@@ -222,23 +222,23 @@ HRESULT CBSoundBuffer::Pause() {
//////////////////////////////////////////////////////////////////////////
uint32 CBSoundBuffer::GetLength() {
#if 0
- QWORD len = BASS_ChannelGetLength(m_Stream, BASS_POS_BYTE);
- return 1000 * BASS_ChannelBytes2Seconds(m_Stream, len);
+ QWORD len = BASS_ChannelGetLength(_stream, BASS_POS_BYTE);
+ return 1000 * BASS_ChannelBytes2Seconds(_stream, len);
#endif
}
//////////////////////////////////////////////////////////////////////////
void CBSoundBuffer::SetType(TSoundType Type) {
- m_Type = Type;
+ _type = Type;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::SetVolume(int Volume) {
#if 0
- if (m_Stream) {
- BASS_ChannelSetAttribute(m_Stream, BASS_ATTRIB_VOL, (float)Volume / 100.0f);
+ if (_stream) {
+ BASS_ChannelSetAttribute(_stream, BASS_ATTRIB_VOL, (float)Volume / 100.0f);
}
#endif
return S_OK;
@@ -248,17 +248,17 @@ HRESULT CBSoundBuffer::SetVolume(int Volume) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::SetPrivateVolume(int Volume) {
#if 0
- m_PrivateVolume = Volume;
+ _privateVolume = Volume;
- switch (m_Type) {
+ switch (_type) {
case SOUND_SFX:
- Volume = Game->m_SoundMgr->m_VolumeSFX;
+ Volume = Game->_soundMgr->_volumeSFX;
break;
case SOUND_SPEECH:
- Volume = Game->m_SoundMgr->m_VolumeSpeech;
+ Volume = Game->_soundMgr->_volumeSpeech;
break;
case SOUND_MUSIC:
- Volume = Game->m_SoundMgr->m_VolumeMusic;
+ Volume = Game->_soundMgr->_volumeMusic;
break;
}
#endif
@@ -269,7 +269,7 @@ HRESULT CBSoundBuffer::SetPrivateVolume(int Volume) {
//////////////////////////////////////////////////////////////////////////
bool CBSoundBuffer::IsPlaying() {
#if 0
- return m_FreezePaused || BASS_ChannelIsActive(m_Stream) == BASS_ACTIVE_PLAYING;
+ return _freezePaused || BASS_ChannelIsActive(_stream) == BASS_ACTIVE_PLAYING;
#endif
return false;
}
@@ -278,9 +278,9 @@ bool CBSoundBuffer::IsPlaying() {
//////////////////////////////////////////////////////////////////////////
uint32 CBSoundBuffer::GetPosition() {
#if 0
- if (m_Stream) {
- QWORD len = BASS_ChannelGetPosition(m_Stream, BASS_POS_BYTE);
- return 1000 * BASS_ChannelBytes2Seconds(m_Stream, len);
+ if (_stream) {
+ QWORD len = BASS_ChannelGetPosition(_stream, BASS_POS_BYTE);
+ return 1000 * BASS_ChannelBytes2Seconds(_stream, len);
} else return 0;
#endif
return 0;
@@ -290,9 +290,9 @@ uint32 CBSoundBuffer::GetPosition() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::SetPosition(uint32 Pos) {
#if 0
- if (m_Stream) {
- QWORD pos = BASS_ChannelSeconds2Bytes(m_Stream, (float)Pos / 1000.0f);
- BASS_ChannelSetPosition(m_Stream, pos, BASS_POS_BYTE);
+ if (_stream) {
+ QWORD pos = BASS_ChannelSeconds2Bytes(_stream, (float)Pos / 1000.0f);
+ BASS_ChannelSetPosition(_stream, pos, BASS_POS_BYTE);
}
#endif
return S_OK;
@@ -300,16 +300,16 @@ HRESULT CBSoundBuffer::SetPosition(uint32 Pos) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::SetLoopStart(uint32 Pos) {
- m_LoopStart = Pos;
+ _loopStart = Pos;
#if 0
- if (m_Stream) {
- if (m_Sync) {
- BASS_ChannelRemoveSync(m_Stream, m_Sync);
- m_Sync = NULL;
+ if (_stream) {
+ if (_sync) {
+ BASS_ChannelRemoveSync(_stream, _sync);
+ _sync = NULL;
}
- if (m_LoopStart > 0) {
- QWORD len = BASS_ChannelGetLength(m_Stream, BASS_POS_BYTE);
- m_Sync = BASS_ChannelSetSync(m_Stream, BASS_SYNC_POS | BASS_SYNC_MIXTIME, len, CBSoundBuffer::LoopSyncProc, (void *)this);
+ if (_loopStart > 0) {
+ QWORD len = BASS_ChannelGetLength(_stream, BASS_POS_BYTE);
+ _sync = BASS_ChannelSetSync(_stream, BASS_SYNC_POS | BASS_SYNC_MIXTIME, len, CBSoundBuffer::LoopSyncProc, (void *)this);
}
}
#endif
@@ -328,8 +328,8 @@ void CBSoundBuffer::LoopSyncProc(HSYNC handle, uint32 channel, uint32 data, void
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::SetPan(float Pan) {
#if 0
- if (m_Stream) {
- BASS_ChannelSetAttribute(m_Stream, BASS_ATTRIB_PAN, Pan);
+ if (_stream) {
+ BASS_ChannelSetAttribute(_stream, BASS_ATTRIB_PAN, Pan);
}
#endif
return S_OK;
@@ -357,7 +357,7 @@ HRESULT CBSoundBuffer::ApplyFX(TSFXType Type, float Param1, float Param2, float
void CBSoundBuffer::FileCloseProc(void *user) {
/*
CBFile* file = static_cast<CBFile*>(user);
- file->Game->m_FileManager->CloseFile(file);
+ file->Game->_fileManager->CloseFile(file);
*/
}
diff --git a/engines/wintermute/BSoundBuffer.h b/engines/wintermute/BSoundBuffer.h
index 4571612122..2a1016f7a9 100644
--- a/engines/wintermute/BSoundBuffer.h
+++ b/engines/wintermute/BSoundBuffer.h
@@ -57,7 +57,7 @@ public:
HRESULT SetLoopStart(uint32 Pos);
uint32 GetLoopStart() const {
- return m_LoopStart;
+ return _loopStart;
}
HRESULT SetPan(float Pan);
@@ -70,17 +70,17 @@ public:
void SetStreaming(bool Streamed, uint32 NumBlocks = 0, uint32 BlockSize = 0);
HRESULT ApplyFX(TSFXType Type, float Param1, float Param2, float Param3, float Param4);
- //HSTREAM m_Stream;
- //HSYNC m_Sync;
-
- bool m_FreezePaused;
- uint32 m_LoopStart;
- TSoundType m_Type;
- bool m_Looping;
- CBFile *m_File;
- char *m_Filename;
- bool m_Streamed;
- int m_PrivateVolume;
+ //HSTREAM _stream;
+ //HSYNC _sync;
+
+ bool _freezePaused;
+ uint32 _loopStart;
+ TSoundType _type;
+ bool _looping;
+ CBFile *_file;
+ char *_filename;
+ bool _streamed;
+ int _privateVolume;
/*static void CALLBACK LoopSyncProc(HSYNC handle, uint32 channel, uint32 data, void *user);
diff --git a/engines/wintermute/BSoundMgr.cpp b/engines/wintermute/BSoundMgr.cpp
index 894a586ee4..3f2837b1db 100644
--- a/engines/wintermute/BSoundMgr.cpp
+++ b/engines/wintermute/BSoundMgr.cpp
@@ -44,9 +44,9 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBSoundMgr::CBSoundMgr(CBGame *inGame): CBBase(inGame) {
- m_SoundAvailable = false;
+ _soundAvailable = false;
- m_VolumeSFX = m_VolumeSpeech = m_VolumeMusic = m_VolumeMaster = 100;
+ _volumeSFX = _volumeSpeech = _volumeMusic = _volumeMaster = 100;
}
@@ -60,8 +60,8 @@ CBSoundMgr::~CBSoundMgr() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundMgr::Cleanup() {
#if 0
- for (int i = 0; i < m_Sounds.GetSize(); i++) delete m_Sounds[i];
- m_Sounds.RemoveAll();
+ for (int i = 0; i < _sounds.GetSize(); i++) delete _sounds[i];
+ _sounds.RemoveAll();
BASS_Free();
#endif
@@ -70,18 +70,18 @@ HRESULT CBSoundMgr::Cleanup() {
//////////////////////////////////////////////////////////////////////////
void CBSoundMgr::SaveSettings() {
- if (m_SoundAvailable) {
- Game->m_Registry->WriteInt("Audio", "MasterVolume", m_VolumeMaster);
+ if (_soundAvailable) {
+ Game->_registry->WriteInt("Audio", "MasterVolume", _volumeMaster);
- Game->m_Registry->WriteInt("Audio", "SFXVolume", m_VolumeSFX);
- Game->m_Registry->WriteInt("Audio", "SpeechVolume", m_VolumeSpeech);
- Game->m_Registry->WriteInt("Audio", "MusicVolume", m_VolumeMusic);
+ Game->_registry->WriteInt("Audio", "SFXVolume", _volumeSFX);
+ Game->_registry->WriteInt("Audio", "SpeechVolume", _volumeSpeech);
+ Game->_registry->WriteInt("Audio", "MusicVolume", _volumeMusic);
}
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundMgr::Initialize() {
- m_SoundAvailable = false;
+ _soundAvailable = false;
#if 0
#ifdef __IPHONEOS__
@@ -101,15 +101,15 @@ HRESULT CBSoundMgr::Initialize() {
}
#endif
- m_VolumeMaster = Game->m_Registry->ReadInt("Audio", "MasterVolume", 100);
+ _volumeMaster = Game->_registry->ReadInt("Audio", "MasterVolume", 100);
- m_VolumeSFX = Game->m_Registry->ReadInt("Audio", "SFXVolume", 100);
- m_VolumeSpeech = Game->m_Registry->ReadInt("Audio", "SpeechVolume", 100);
- m_VolumeMusic = Game->m_Registry->ReadInt("Audio", "MusicVolume", 100);
+ _volumeSFX = Game->_registry->ReadInt("Audio", "SFXVolume", 100);
+ _volumeSpeech = Game->_registry->ReadInt("Audio", "SpeechVolume", 100);
+ _volumeMusic = Game->_registry->ReadInt("Audio", "MusicVolume", 100);
#if 0
- m_SoundAvailable = true;
- SetMasterVolumePercent(m_VolumeMaster);
+ _soundAvailable = true;
+ SetMasterVolumePercent(_volumeMaster);
#endif
return S_OK;
}
@@ -117,7 +117,7 @@ HRESULT CBSoundMgr::Initialize() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundMgr::InitLoop() {
- if (!m_SoundAvailable) return S_OK;
+ if (!_soundAvailable) return S_OK;
#if 0
BASS_Update(500);
@@ -128,7 +128,7 @@ HRESULT CBSoundMgr::InitLoop() {
//////////////////////////////////////////////////////////////////////////
CBSoundBuffer *CBSoundMgr::AddSound(const char *Filename, TSoundType Type, bool Streamed) {
- if (!m_SoundAvailable) return NULL;
+ if (!_soundAvailable) return NULL;
#if 0
CBSoundBuffer *sound;
@@ -140,10 +140,10 @@ CBSoundBuffer *CBSoundMgr::AddSound(const char *Filename, TSoundType Type, bool
AnsiString name = PathUtil::GetFileNameWithoutExtension(Filename);
AnsiString newFile = PathUtil::Combine(path, name + ".ogg");
- CBFile *file = Game->m_FileManager->OpenFile(newFile.c_str());
+ CBFile *file = Game->_fileManager->OpenFile(newFile.c_str());
if (file) {
Filename = newFile.c_str();
- Game->m_FileManager->CloseFile(file);
+ Game->_fileManager->CloseFile(file);
}
}
@@ -164,18 +164,18 @@ CBSoundBuffer *CBSoundMgr::AddSound(const char *Filename, TSoundType Type, bool
// set volume appropriately
switch (Type) {
case SOUND_SFX:
- sound->SetVolume(m_VolumeSFX);
+ sound->SetVolume(_volumeSFX);
break;
case SOUND_SPEECH:
- sound->SetVolume(m_VolumeSpeech);
+ sound->SetVolume(_volumeSpeech);
break;
case SOUND_MUSIC:
- sound->SetVolume(m_VolumeMusic);
+ sound->SetVolume(_volumeMusic);
break;
}
// register sound
- m_Sounds.Add(sound);
+ _sounds.Add(sound);
return sound;
#endif
@@ -189,18 +189,18 @@ HRESULT CBSoundMgr::AddSound(CBSoundBuffer *Sound, TSoundType Type) {
// set volume appropriately
switch (Type) {
case SOUND_SFX:
- Sound->SetVolume(m_VolumeSFX);
+ Sound->SetVolume(_volumeSFX);
break;
case SOUND_SPEECH:
- Sound->SetVolume(m_VolumeSpeech);
+ Sound->SetVolume(_volumeSpeech);
break;
case SOUND_MUSIC:
- Sound->SetVolume(m_VolumeMusic);
+ Sound->SetVolume(_volumeMusic);
break;
}
// register sound
- m_Sounds.Add(Sound);
+ _sounds.Add(Sound);
#endif
return S_OK;
}
@@ -208,10 +208,10 @@ HRESULT CBSoundMgr::AddSound(CBSoundBuffer *Sound, TSoundType Type) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundMgr::RemoveSound(CBSoundBuffer *Sound) {
#if 0
- for (int i = 0; i < m_Sounds.GetSize(); i++) {
- if (m_Sounds[i] == Sound) {
- delete m_Sounds[i];
- m_Sounds.RemoveAt(i);
+ for (int i = 0; i < _sounds.GetSize(); i++) {
+ if (_sounds[i] == Sound) {
+ delete _sounds[i];
+ _sounds.RemoveAt(i);
return S_OK;
}
}
@@ -222,22 +222,22 @@ HRESULT CBSoundMgr::RemoveSound(CBSoundBuffer *Sound) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundMgr::SetVolume(TSoundType Type, int Volume) {
- if (!m_SoundAvailable) return S_OK;
+ if (!_soundAvailable) return S_OK;
#if 0
switch (Type) {
case SOUND_SFX:
- m_VolumeSFX = Volume;
+ _volumeSFX = Volume;
break;
case SOUND_SPEECH:
- m_VolumeSpeech = Volume;
+ _volumeSpeech = Volume;
break;
case SOUND_MUSIC:
- m_VolumeMusic = Volume;
+ _volumeMusic = Volume;
break;
}
- for (int i = 0; i < m_Sounds.GetSize(); i++) {
- if (m_Sounds[i]->m_Type == Type) m_Sounds[i]->SetVolume(Volume);
+ for (int i = 0; i < _sounds.GetSize(); i++) {
+ if (_sounds[i]->_type == Type) _sounds[i]->SetVolume(Volume);
}
#endif
return S_OK;
@@ -254,13 +254,13 @@ byte CBSoundMgr::GetVolumePercent(TSoundType Type) {
int Volume;
switch (Type) {
case SOUND_SFX:
- Volume = m_VolumeSFX;
+ Volume = _volumeSFX;
break;
case SOUND_SPEECH:
- Volume = m_VolumeSpeech;
+ Volume = _volumeSpeech;
break;
case SOUND_MUSIC:
- Volume = m_VolumeMusic;
+ Volume = _volumeMusic;
break;
}
@@ -270,7 +270,7 @@ byte CBSoundMgr::GetVolumePercent(TSoundType Type) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundMgr::SetMasterVolumePercent(byte Percent) {
- m_VolumeMaster = Percent;
+ _volumeMaster = Percent;
#if 0
BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, (uint32)(10000.0f / 100.0f * (float)Percent));
#endif
@@ -292,10 +292,10 @@ byte CBSoundMgr::GetMasterVolumePercent() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundMgr::PauseAll(bool IncludingMusic) {
#if 0
- for (int i = 0; i < m_Sounds.GetSize(); i++) {
- if (m_Sounds[i]->IsPlaying() && (m_Sounds[i]->m_Type != SOUND_MUSIC || IncludingMusic)) {
- m_Sounds[i]->Pause();
- m_Sounds[i]->m_FreezePaused = true;
+ for (int i = 0; i < _sounds.GetSize(); i++) {
+ if (_sounds[i]->IsPlaying() && (_sounds[i]->_type != SOUND_MUSIC || IncludingMusic)) {
+ _sounds[i]->Pause();
+ _sounds[i]->_freezePaused = true;
}
}
#endif
@@ -306,10 +306,10 @@ HRESULT CBSoundMgr::PauseAll(bool IncludingMusic) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundMgr::ResumeAll() {
#if 0
- for (int i = 0; i < m_Sounds.GetSize(); i++) {
- if (m_Sounds[i]->m_FreezePaused) {
- m_Sounds[i]->Resume();
- m_Sounds[i]->m_FreezePaused = false;
+ for (int i = 0; i < _sounds.GetSize(); i++) {
+ if (_sounds[i]->_freezePaused) {
+ _sounds[i]->Resume();
+ _sounds[i]->_freezePaused = false;
}
}
#endif
@@ -319,7 +319,7 @@ HRESULT CBSoundMgr::ResumeAll() {
//////////////////////////////////////////////////////////////////////////
float CBSoundMgr::PosToPan(int X, int Y) {
- float relPos = (float)X / ((float)Game->m_Renderer->m_Width);
+ float relPos = (float)X / ((float)Game->_renderer->_width);
float minPan = -0.7f;
float maxPan = 0.7f;
diff --git a/engines/wintermute/BSoundMgr.h b/engines/wintermute/BSoundMgr.h
index 1ffc977211..de74f6c4df 100644
--- a/engines/wintermute/BSoundMgr.h
+++ b/engines/wintermute/BSoundMgr.h
@@ -48,20 +48,20 @@ public:
byte GetVolumePercent(TSoundType Type);
HRESULT SetVolumePercent(TSoundType Type, byte Percent);
HRESULT SetVolume(TSoundType Type, int Volume);
- uint32 m_VolumeOriginal;
- int m_VolumeMaster;
- int m_VolumeMusic;
- int m_VolumeSpeech;
- int m_VolumeSFX;
+ uint32 _volumeOriginal;
+ int _volumeMaster;
+ int _volumeMusic;
+ int _volumeSpeech;
+ int _volumeSFX;
HRESULT RemoveSound(CBSoundBuffer *Sound);
CBSoundBuffer *AddSound(const char *Filename, TSoundType Type = SOUND_SFX, bool Streamed = false);
HRESULT AddSound(CBSoundBuffer *Sound, TSoundType Type = SOUND_SFX);
HRESULT InitLoop();
HRESULT Initialize();
- bool m_SoundAvailable;
+ bool _soundAvailable;
CBSoundMgr(CBGame *inGame);
virtual ~CBSoundMgr();
- CBArray<CBSoundBuffer *, CBSoundBuffer *> m_Sounds;
+ CBArray<CBSoundBuffer *, CBSoundBuffer *> _sounds;
void SaveSettings();
};
diff --git a/engines/wintermute/BSprite.cpp b/engines/wintermute/BSprite.cpp
index 06ac69494b..d951f25461 100644
--- a/engines/wintermute/BSprite.cpp
+++ b/engines/wintermute/BSprite.cpp
@@ -49,8 +49,8 @@ IMPLEMENT_PERSISTENT(CBSprite, false)
//////////////////////////////////////////////////////////////////////
CBSprite::CBSprite(CBGame *inGame, CBObject *Owner): CBScriptHolder(inGame) {
- m_EditorAllFrames = false;
- m_Owner = Owner;
+ _editorAllFrames = false;
+ _owner = Owner;
SetDefaults();
}
@@ -63,26 +63,26 @@ CBSprite::~CBSprite() {
//////////////////////////////////////////////////////////////////////////
void CBSprite::SetDefaults() {
- m_CurrentFrame = -1;
- m_Looping = false;
- m_LastFrameTime = 0;
- m_Filename = NULL;
- m_Finished = false;
- m_Changed = false;
- m_Paused = false;
- m_Continuous = false;
- m_MoveX = m_MoveY = 0;
-
- m_EditorMuted = false;
- m_EditorBgFile = NULL;
- m_EditorBgOffsetX = m_EditorBgOffsetY = 0;
- m_EditorBgAlpha = 0xFF;
- m_Streamed = false;
- m_StreamedKeepLoaded = false;
+ _currentFrame = -1;
+ _looping = false;
+ _lastFrameTime = 0;
+ _filename = NULL;
+ _finished = false;
+ _changed = false;
+ _paused = false;
+ _continuous = false;
+ _moveX = _moveY = 0;
+
+ _editorMuted = false;
+ _editorBgFile = NULL;
+ _editorBgOffsetX = _editorBgOffsetY = 0;
+ _editorBgAlpha = 0xFF;
+ _streamed = false;
+ _streamedKeepLoaded = false;
SetName("");
- m_Precise = true;
+ _precise = true;
}
@@ -90,11 +90,11 @@ void CBSprite::SetDefaults() {
void CBSprite::Cleanup() {
CBScriptHolder::Cleanup();
- for (int i = 0; i < m_Frames.GetSize(); i++)
- delete m_Frames[i];
- m_Frames.RemoveAll();
+ for (int i = 0; i < _frames.GetSize(); i++)
+ delete _frames[i];
+ _frames.RemoveAll();
- SAFE_DELETE_ARRAY(m_EditorBgFile);
+ SAFE_DELETE_ARRAY(_editorBgFile);
SetDefaults();
}
@@ -103,16 +103,16 @@ void CBSprite::Cleanup() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSprite::Draw(int X, int Y, CBObject *Register, float ZoomX, float ZoomY, uint32 Alpha) {
GetCurrentFrame(ZoomX, ZoomY);
- if (m_CurrentFrame < 0 || m_CurrentFrame >= m_Frames.GetSize()) return S_OK;
+ if (_currentFrame < 0 || _currentFrame >= _frames.GetSize()) return S_OK;
// move owner if allowed to
- if (m_Changed && m_Owner && m_Owner->m_Movable) {
- m_Owner->m_PosX += m_MoveX;
- m_Owner->m_PosY += m_MoveY;
- m_Owner->AfterMove();
+ if (_changed && _owner && _owner->_movable) {
+ _owner->_posX += _moveX;
+ _owner->_posY += _moveY;
+ _owner->AfterMove();
- X = m_Owner->m_PosX;
- Y = m_Owner->m_PosY;
+ X = _owner->_posX;
+ Y = _owner->_posY;
}
// draw frame
@@ -122,13 +122,13 @@ HRESULT CBSprite::Draw(int X, int Y, CBObject *Register, float ZoomX, float Zoom
//////////////////////////////////////////////////////////////////////
HRESULT CBSprite::LoadFile(char *Filename, int LifeTime, TSpriteCacheType CacheType) {
- CBFile *File = Game->m_FileManager->OpenFile(Filename);
+ CBFile *File = Game->_fileManager->OpenFile(Filename);
if (!File) {
Game->LOG(0, "CBSprite::LoadFile failed for file '%s'", Filename);
- if (Game->m_DEBUG_DebugMode) return LoadFile("invalid_debug.bmp", LifeTime, CacheType);
+ if (Game->_dEBUG_DebugMode) return LoadFile("invalid_debug.bmp", LifeTime, CacheType);
else return LoadFile("invalid.bmp", LifeTime, CacheType);
} else {
- Game->m_FileManager->CloseFile(File);
+ Game->_fileManager->CloseFile(File);
File = NULL;
}
@@ -139,28 +139,28 @@ HRESULT CBSprite::LoadFile(char *Filename, int LifeTime, TSpriteCacheType CacheT
CBFrame *frame = new CBFrame(Game);
CBSubFrame *subframe = new CBSubFrame(Game);
subframe->SetSurface(Filename, true, 0, 0, 0, LifeTime, true);
- if (subframe->m_Surface == NULL) {
+ if (subframe->_surface == NULL) {
Game->LOG(0, "Error loading simple sprite '%s'", Filename);
ret = E_FAIL;
delete frame;
delete subframe;
} else {
- CBPlatform::SetRect(&subframe->m_Rect, 0, 0, subframe->m_Surface->GetWidth(), subframe->m_Surface->GetHeight());
- frame->m_Subframes.Add(subframe);
- m_Frames.Add(frame);
- m_CurrentFrame = 0;
+ CBPlatform::SetRect(&subframe->_rect, 0, 0, subframe->_surface->GetWidth(), subframe->_surface->GetHeight());
+ frame->_subframes.Add(subframe);
+ _frames.Add(frame);
+ _currentFrame = 0;
ret = S_OK;
}
} else {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ 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);
delete [] Buffer;
}
}
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, Filename);
+ _filename = new char [strlen(Filename) + 1];
+ strcpy(_filename, Filename);
return ret;
@@ -225,11 +225,11 @@ HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSprite
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
case TOKEN_CONTINUOUS:
- parser.ScanStr((char *)params, "%b", &m_Continuous);
+ parser.ScanStr((char *)params, "%b", &_continuous);
break;
case TOKEN_EDITOR_MUTED:
- parser.ScanStr((char *)params, "%b", &m_EditorMuted);
+ parser.ScanStr((char *)params, "%b", &_editorMuted);
break;
case TOKEN_SCRIPT:
@@ -237,23 +237,23 @@ HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSprite
break;
case TOKEN_LOOPING:
- parser.ScanStr((char *)params, "%b", &m_Looping);
+ parser.ScanStr((char *)params, "%b", &_looping);
break;
case TOKEN_PRECISE:
- parser.ScanStr((char *)params, "%b", &m_Precise);
+ parser.ScanStr((char *)params, "%b", &_precise);
break;
case TOKEN_STREAMED:
- parser.ScanStr((char *)params, "%b", &m_Streamed);
- if (m_Streamed && LifeTime == -1) {
+ parser.ScanStr((char *)params, "%b", &_streamed);
+ if (_streamed && LifeTime == -1) {
LifeTime = 500;
CacheType = CACHE_ALL;
}
break;
case TOKEN_STREAMED_KEEP_LOADED:
- parser.ScanStr((char *)params, "%b", &m_StreamedKeepLoaded);
+ parser.ScanStr((char *)params, "%b", &_streamedKeepLoaded);
break;
case TOKEN_NAME:
@@ -261,25 +261,25 @@ HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSprite
break;
case TOKEN_EDITOR_BG_FILE:
- if (Game->m_EditorMode) {
- SAFE_DELETE_ARRAY(m_EditorBgFile);
- m_EditorBgFile = new char[strlen((char *)params) + 1];
- if (m_EditorBgFile) strcpy(m_EditorBgFile, (char *)params);
+ if (Game->_editorMode) {
+ SAFE_DELETE_ARRAY(_editorBgFile);
+ _editorBgFile = new char[strlen((char *)params) + 1];
+ if (_editorBgFile) strcpy(_editorBgFile, (char *)params);
}
break;
case TOKEN_EDITOR_BG_OFFSET_X:
- parser.ScanStr((char *)params, "%d", &m_EditorBgOffsetX);
+ parser.ScanStr((char *)params, "%d", &_editorBgOffsetX);
break;
case TOKEN_EDITOR_BG_OFFSET_Y:
- parser.ScanStr((char *)params, "%d", &m_EditorBgOffsetY);
+ parser.ScanStr((char *)params, "%d", &_editorBgOffsetY);
break;
case TOKEN_EDITOR_BG_ALPHA:
- parser.ScanStr((char *)params, "%d", &m_EditorBgAlpha);
- m_EditorBgAlpha = std::min(m_EditorBgAlpha, 255);
- m_EditorBgAlpha = std::max(m_EditorBgAlpha, 0);
+ parser.ScanStr((char *)params, "%d", &_editorBgAlpha);
+ _editorBgAlpha = std::min(_editorBgAlpha, 255);
+ _editorBgAlpha = std::max(_editorBgAlpha, 0);
break;
case TOKEN_FRAME: {
@@ -288,15 +288,15 @@ HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSprite
frame = new CBFrame(Game);
- if (FAILED(frame->LoadBuffer(params, FrameLifeTime, m_StreamedKeepLoaded))) {
+ if (FAILED(frame->LoadBuffer(params, FrameLifeTime, _streamedKeepLoaded))) {
delete frame;
Game->LOG(0, "Error parsing frame %d", frame_count);
return E_FAIL;
}
- m_Frames.Add(frame);
+ _frames.Add(frame);
frame_count++;
- if (m_CurrentFrame == -1) m_CurrentFrame = 0;
+ if (_currentFrame == -1) _currentFrame = 0;
}
break;
@@ -310,7 +310,7 @@ HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSprite
Game->LOG(0, "Syntax error in SPRITE definition");
return E_FAIL;
}
- m_CanBreak = !m_Continuous;
+ _canBreak = !_continuous;
return S_OK;
}
@@ -318,95 +318,95 @@ HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSprite
//////////////////////////////////////////////////////////////////////
void CBSprite::Reset() {
- if (m_Frames.GetSize() > 0) m_CurrentFrame = 0;
- else m_CurrentFrame = -1;
+ if (_frames.GetSize() > 0) _currentFrame = 0;
+ else _currentFrame = -1;
KillAllSounds();
- m_LastFrameTime = 0;
- m_Finished = false;
- m_MoveX = m_MoveY = 0;
+ _lastFrameTime = 0;
+ _finished = false;
+ _moveX = _moveY = 0;
}
//////////////////////////////////////////////////////////////////////
bool CBSprite::GetCurrentFrame(float ZoomX, float ZoomY) {
- //if(m_Owner && m_Owner->m_Freezable && Game->m_State == GAME_FROZEN) return true;
+ //if(_owner && _owner->_freezable && Game->_state == GAME_FROZEN) return true;
- if (m_CurrentFrame == -1) return false;
+ if (_currentFrame == -1) return false;
uint32 timer;
- if (m_Owner && m_Owner->m_Freezable) timer = Game->m_Timer;
- else timer = Game->m_LiveTimer;
+ if (_owner && _owner->_freezable) timer = Game->_timer;
+ else timer = Game->_liveTimer;
- int LastFrame = m_CurrentFrame;
+ int LastFrame = _currentFrame;
// get current frame
- if (!m_Paused && !m_Finished && timer >= m_LastFrameTime + m_Frames[m_CurrentFrame]->m_Delay && m_LastFrameTime != 0) {
- if (m_CurrentFrame < m_Frames.GetSize() - 1) {
- m_CurrentFrame++;
- if (m_Continuous) m_CanBreak = (m_CurrentFrame == m_Frames.GetSize() - 1);
+ if (!_paused && !_finished && timer >= _lastFrameTime + _frames[_currentFrame]->_delay && _lastFrameTime != 0) {
+ if (_currentFrame < _frames.GetSize() - 1) {
+ _currentFrame++;
+ if (_continuous) _canBreak = (_currentFrame == _frames.GetSize() - 1);
} else {
- if (m_Looping) {
- m_CurrentFrame = 0;
- m_CanBreak = true;
+ if (_looping) {
+ _currentFrame = 0;
+ _canBreak = true;
} else {
- m_Finished = true;
- m_CanBreak = true;
+ _finished = true;
+ _canBreak = true;
}
}
- m_LastFrameTime = timer;
+ _lastFrameTime = timer;
}
- m_Changed = (LastFrame != m_CurrentFrame || (m_Looping && m_Frames.GetSize() == 1));
+ _changed = (LastFrame != _currentFrame || (_looping && _frames.GetSize() == 1));
- if (m_LastFrameTime == 0) {
- m_LastFrameTime = timer;
- m_Changed = true;
- if (m_Continuous) m_CanBreak = (m_CurrentFrame == m_Frames.GetSize() - 1);
+ if (_lastFrameTime == 0) {
+ _lastFrameTime = timer;
+ _changed = true;
+ if (_continuous) _canBreak = (_currentFrame == _frames.GetSize() - 1);
}
- if (m_Changed) {
- m_MoveX = m_Frames[m_CurrentFrame]->m_MoveX;
- m_MoveY = m_Frames[m_CurrentFrame]->m_MoveY;
+ if (_changed) {
+ _moveX = _frames[_currentFrame]->_moveX;
+ _moveY = _frames[_currentFrame]->_moveY;
if (ZoomX != 100 || ZoomY != 100) {
- m_MoveX = (int)((float)m_MoveX * (float)(ZoomX / 100.0f));
- m_MoveY = (int)((float)m_MoveY * (float)(ZoomY / 100.0f));
+ _moveX = (int)((float)_moveX * (float)(ZoomX / 100.0f));
+ _moveY = (int)((float)_moveY * (float)(ZoomY / 100.0f));
}
}
- return m_Changed;
+ return _changed;
}
//////////////////////////////////////////////////////////////////////
HRESULT CBSprite::Display(int X, int Y, CBObject *Register, float ZoomX, float ZoomY, uint32 Alpha, float Rotate, TSpriteBlendMode BlendMode) {
- if (m_CurrentFrame < 0 || m_CurrentFrame >= m_Frames.GetSize()) return S_OK;
+ if (_currentFrame < 0 || _currentFrame >= _frames.GetSize()) return S_OK;
// on change...
- if (m_Changed) {
- if (m_Frames[m_CurrentFrame]->m_KillSound) {
+ if (_changed) {
+ if (_frames[_currentFrame]->_killSound) {
KillAllSounds();
}
ApplyEvent("FrameChanged");
- m_Frames[m_CurrentFrame]->OneTimeDisplay(m_Owner, Game->m_EditorMode && m_EditorMuted);
+ _frames[_currentFrame]->OneTimeDisplay(_owner, Game->_editorMode && _editorMuted);
}
// draw frame
- return m_Frames[m_CurrentFrame]->Draw(X - Game->m_OffsetX, Y - Game->m_OffsetY, Register, ZoomX, ZoomY, m_Precise, Alpha, m_EditorAllFrames, Rotate, BlendMode);
+ return _frames[_currentFrame]->Draw(X - Game->_offsetX, Y - Game->_offsetY, Register, ZoomX, ZoomY, _precise, Alpha, _editorAllFrames, Rotate, BlendMode);
}
//////////////////////////////////////////////////////////////////////////
CBSurface *CBSprite::GetSurface() {
// only used for animated textures for 3D models
- if (m_CurrentFrame < 0 || m_CurrentFrame >= m_Frames.GetSize()) return NULL;
- CBFrame *Frame = m_Frames[m_CurrentFrame];
- if (Frame && Frame->m_Subframes.GetSize() > 0) {
- CBSubFrame *Subframe = Frame->m_Subframes[0];
- if (Subframe) return Subframe->m_Surface;
+ if (_currentFrame < 0 || _currentFrame >= _frames.GetSize()) return NULL;
+ CBFrame *Frame = _frames[_currentFrame];
+ if (Frame && Frame->_subframes.GetSize() > 0) {
+ CBSubFrame *Subframe = Frame->_subframes[0];
+ if (Subframe) return Subframe->_surface;
else return NULL;
} else return NULL;
}
@@ -416,11 +416,11 @@ bool CBSprite::GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float Sc
if (!Rect) return false;
CBPlatform::SetRectEmpty(Rect);
- for (int i = 0; i < m_Frames.GetSize(); i++) {
+ for (int i = 0; i < _frames.GetSize(); i++) {
RECT frame;
RECT temp;
CBPlatform::CopyRect(&temp, Rect);
- m_Frames[i]->GetBoundingRect(&frame, X, Y, ScaleX, ScaleY);
+ _frames[i]->GetBoundingRect(&frame, X, Y, ScaleX, ScaleY);
CBPlatform::UnionRect(Rect, &temp, &frame);
}
return true;
@@ -429,25 +429,25 @@ bool CBSprite::GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float Sc
//////////////////////////////////////////////////////////////////////////
HRESULT CBSprite::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "SPRITE {\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
- Buffer->PutTextIndent(Indent + 2, "LOOPING=%s\n", m_Looping ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "CONTINUOUS=%s\n", m_Continuous ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "PRECISE=%s\n", m_Precise ? "TRUE" : "FALSE");
- if (m_Streamed) {
- Buffer->PutTextIndent(Indent + 2, "STREAMED=%s\n", m_Streamed ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
+ Buffer->PutTextIndent(Indent + 2, "LOOPING=%s\n", _looping ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "CONTINUOUS=%s\n", _continuous ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "PRECISE=%s\n", _precise ? "TRUE" : "FALSE");
+ if (_streamed) {
+ Buffer->PutTextIndent(Indent + 2, "STREAMED=%s\n", _streamed ? "TRUE" : "FALSE");
- if (m_StreamedKeepLoaded)
- Buffer->PutTextIndent(Indent + 2, "STREAMED_KEEP_LOADED=%s\n", m_StreamedKeepLoaded ? "TRUE" : "FALSE");
+ if (_streamedKeepLoaded)
+ Buffer->PutTextIndent(Indent + 2, "STREAMED_KEEP_LOADED=%s\n", _streamedKeepLoaded ? "TRUE" : "FALSE");
}
- if (m_EditorMuted)
- Buffer->PutTextIndent(Indent + 2, "EDITOR_MUTED=%s\n", m_EditorMuted ? "TRUE" : "FALSE");
+ if (_editorMuted)
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_MUTED=%s\n", _editorMuted ? "TRUE" : "FALSE");
- if (m_EditorBgFile) {
- Buffer->PutTextIndent(Indent + 2, "EDITOR_BG_FILE=\"%s\"\n", m_EditorBgFile);
- Buffer->PutTextIndent(Indent + 2, "EDITOR_BG_OFFSET_X=%d\n", m_EditorBgOffsetX);
- Buffer->PutTextIndent(Indent + 2, "EDITOR_BG_OFFSET_Y=%d\n", m_EditorBgOffsetY);
- Buffer->PutTextIndent(Indent + 2, "EDITOR_BG_ALPHA=%d\n", m_EditorBgAlpha);
+ if (_editorBgFile) {
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_BG_FILE=\"%s\"\n", _editorBgFile);
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_BG_OFFSET_X=%d\n", _editorBgOffsetX);
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_BG_OFFSET_Y=%d\n", _editorBgOffsetY);
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_BG_ALPHA=%d\n", _editorBgAlpha);
}
CBScriptHolder::SaveAsText(Buffer, Indent + 2);
@@ -455,13 +455,13 @@ HRESULT CBSprite::SaveAsText(CBDynBuffer *Buffer, int Indent) {
int i;
// scripts
- for (i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- for (i = 0; i < m_Frames.GetSize(); i++) {
- m_Frames[i]->SaveAsText(Buffer, Indent + 2);
+ for (i = 0; i < _frames.GetSize(); i++) {
+ _frames[i]->SaveAsText(Buffer, Indent + 2);
}
Buffer->PutTextIndent(Indent, "}\n\n");
@@ -474,29 +474,29 @@ HRESULT CBSprite::SaveAsText(CBDynBuffer *Buffer, int Indent) {
HRESULT CBSprite::Persist(CBPersistMgr *PersistMgr) {
CBScriptHolder::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_CanBreak));
- PersistMgr->Transfer(TMEMBER(m_Changed));
- PersistMgr->Transfer(TMEMBER(m_Paused));
- PersistMgr->Transfer(TMEMBER(m_Continuous));
- PersistMgr->Transfer(TMEMBER(m_CurrentFrame));
- PersistMgr->Transfer(TMEMBER(m_EditorAllFrames));
- PersistMgr->Transfer(TMEMBER(m_EditorBgAlpha));
- PersistMgr->Transfer(TMEMBER(m_EditorBgFile));
- PersistMgr->Transfer(TMEMBER(m_EditorBgOffsetX));
- PersistMgr->Transfer(TMEMBER(m_EditorBgOffsetY));
- PersistMgr->Transfer(TMEMBER(m_EditorMuted));
- PersistMgr->Transfer(TMEMBER(m_Finished));
-
- m_Frames.Persist(PersistMgr);
-
- PersistMgr->Transfer(TMEMBER(m_LastFrameTime));
- PersistMgr->Transfer(TMEMBER(m_Looping));
- PersistMgr->Transfer(TMEMBER(m_MoveX));
- PersistMgr->Transfer(TMEMBER(m_MoveY));
- PersistMgr->Transfer(TMEMBER(m_Owner));
- PersistMgr->Transfer(TMEMBER(m_Precise));
- PersistMgr->Transfer(TMEMBER(m_Streamed));
- PersistMgr->Transfer(TMEMBER(m_StreamedKeepLoaded));
+ PersistMgr->Transfer(TMEMBER(_canBreak));
+ PersistMgr->Transfer(TMEMBER(_changed));
+ PersistMgr->Transfer(TMEMBER(_paused));
+ PersistMgr->Transfer(TMEMBER(_continuous));
+ PersistMgr->Transfer(TMEMBER(_currentFrame));
+ PersistMgr->Transfer(TMEMBER(_editorAllFrames));
+ PersistMgr->Transfer(TMEMBER(_editorBgAlpha));
+ PersistMgr->Transfer(TMEMBER(_editorBgFile));
+ PersistMgr->Transfer(TMEMBER(_editorBgOffsetX));
+ PersistMgr->Transfer(TMEMBER(_editorBgOffsetY));
+ PersistMgr->Transfer(TMEMBER(_editorMuted));
+ PersistMgr->Transfer(TMEMBER(_finished));
+
+ _frames.Persist(PersistMgr);
+
+ PersistMgr->Transfer(TMEMBER(_lastFrameTime));
+ PersistMgr->Transfer(TMEMBER(_looping));
+ PersistMgr->Transfer(TMEMBER(_moveX));
+ PersistMgr->Transfer(TMEMBER(_moveY));
+ PersistMgr->Transfer(TMEMBER(_owner));
+ PersistMgr->Transfer(TMEMBER(_precise));
+ PersistMgr->Transfer(TMEMBER(_streamed));
+ PersistMgr->Transfer(TMEMBER(_streamedKeepLoaded));
return S_OK;
@@ -513,10 +513,10 @@ HRESULT CBSprite::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
if (strcmp(Name, "GetFrame") == 0) {
Stack->CorrectParams(1);
int Index = Stack->Pop()->GetInt(-1);
- if (Index < 0 || Index >= m_Frames.GetSize()) {
+ if (Index < 0 || Index >= _frames.GetSize()) {
Script->RuntimeError("Sprite.GetFrame: Frame index %d is out of range.", Index);
Stack->PushNULL();
- } else Stack->PushNative(m_Frames[Index], true);
+ } else Stack->PushNative(_frames[Index], true);
return S_OK;
}
@@ -528,16 +528,16 @@ HRESULT CBSprite::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CScValue *Val = Stack->Pop();
if (Val->IsInt()) {
int Index = Val->GetInt(-1);
- if (Index < 0 || Index >= m_Frames.GetSize()) {
+ if (Index < 0 || Index >= _frames.GetSize()) {
Script->RuntimeError("Sprite.DeleteFrame: Frame index %d is out of range.", Index);
}
} else {
CBFrame *Frame = (CBFrame *)Val->GetNative();
- for (int i = 0; i < m_Frames.GetSize(); i++) {
- if (m_Frames[i] == Frame) {
- if (i == m_CurrentFrame) m_LastFrameTime = 0;
- delete m_Frames[i];
- m_Frames.RemoveAt(i);
+ for (int i = 0; i < _frames.GetSize(); i++) {
+ if (_frames[i] == Frame) {
+ if (i == _currentFrame) _lastFrameTime = 0;
+ delete _frames[i];
+ _frames.RemoveAt(i);
break;
}
}
@@ -570,10 +570,10 @@ HRESULT CBSprite::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CBSubFrame *Sub = new CBSubFrame(Game);
if (SUCCEEDED(Sub->SetSurface(Filename))) {
Sub->SetDefaultRect();
- Frame->m_Subframes.Add(Sub);
+ Frame->_subframes.Add(Sub);
} else delete Sub;
}
- m_Frames.Add(Frame);
+ _frames.Add(Frame);
Stack->PushNative(Frame, true);
return S_OK;
@@ -594,12 +594,12 @@ HRESULT CBSprite::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CBFrame *Frame = new CBFrame(Game);
if (Filename != NULL) {
CBSubFrame *Sub = new CBSubFrame(Game);
- if (SUCCEEDED(Sub->SetSurface(Filename))) Frame->m_Subframes.Add(Sub);
+ if (SUCCEEDED(Sub->SetSurface(Filename))) Frame->_subframes.Add(Sub);
else delete Sub;
}
- if (Index >= m_Frames.GetSize()) m_Frames.Add(Frame);
- else m_Frames.InsertAt(Index, Frame);
+ if (Index >= _frames.GetSize()) _frames.Add(Frame);
+ else _frames.InsertAt(Index, Frame);
Stack->PushNative(Frame, true);
return S_OK;
@@ -610,7 +610,7 @@ HRESULT CBSprite::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Pause") == 0) {
Stack->CorrectParams(0);
- m_Paused = true;
+ _paused = true;
Stack->PushNULL();
return S_OK;
}
@@ -620,7 +620,7 @@ HRESULT CBSprite::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Play") == 0) {
Stack->CorrectParams(0);
- m_Paused = false;
+ _paused = false;
Stack->PushNULL();
return S_OK;
}
@@ -631,71 +631,71 @@ HRESULT CBSprite::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
CScValue *CBSprite::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("sprite");
- return m_ScValue;
+ _scValue->SetString("sprite");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumFrames (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumFrames") == 0) {
- m_ScValue->SetInt(m_Frames.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_frames.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// CurrentFrame
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CurrentFrame") == 0) {
- m_ScValue->SetInt(m_CurrentFrame);
- return m_ScValue;
+ _scValue->SetInt(_currentFrame);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PixelPerfect") == 0) {
- m_ScValue->SetBool(m_Precise);
- return m_ScValue;
+ _scValue->SetBool(_precise);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Looping
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Looping") == 0) {
- m_ScValue->SetBool(m_Looping);
- return m_ScValue;
+ _scValue->SetBool(_looping);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Owner (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Owner") == 0) {
- if (m_Owner == NULL) m_ScValue->SetNULL();
- else m_ScValue->SetNative(m_Owner, true);
- return m_ScValue;
+ if (_owner == NULL) _scValue->SetNULL();
+ else _scValue->SetNative(_owner, true);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Finished (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Finished") == 0) {
- m_ScValue->SetBool(m_Finished);
- return m_ScValue;
+ _scValue->SetBool(_finished);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Paused (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Paused") == 0) {
- m_ScValue->SetBool(m_Paused);
- return m_ScValue;
+ _scValue->SetBool(_paused);
+ return _scValue;
}
else return CBScriptHolder::ScGetProperty(Name);
@@ -708,11 +708,11 @@ HRESULT CBSprite::ScSetProperty(char *Name, CScValue *Value) {
// CurrentFrame
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "CurrentFrame") == 0) {
- m_CurrentFrame = Value->GetInt(0);
- if (m_CurrentFrame >= m_Frames.GetSize() || m_CurrentFrame < 0) {
- m_CurrentFrame = -1;
+ _currentFrame = Value->GetInt(0);
+ if (_currentFrame >= _frames.GetSize() || _currentFrame < 0) {
+ _currentFrame = -1;
}
- m_LastFrameTime = 0;
+ _lastFrameTime = 0;
return S_OK;
}
@@ -720,7 +720,7 @@ HRESULT CBSprite::ScSetProperty(char *Name, CScValue *Value) {
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PixelPerfect") == 0) {
- m_Precise = Value->GetBool();
+ _precise = Value->GetBool();
return S_OK;
}
@@ -728,7 +728,7 @@ HRESULT CBSprite::ScSetProperty(char *Name, CScValue *Value) {
// Looping
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Looping") == 0) {
- m_Looping = Value->GetBool();
+ _looping = Value->GetBool();
return S_OK;
}
@@ -744,8 +744,8 @@ char *CBSprite::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSprite::KillAllSounds() {
- for (int i = 0; i < m_Frames.GetSize(); i++) {
- if (m_Frames[i]->m_Sound) m_Frames[i]->m_Sound->Stop();
+ for (int i = 0; i < _frames.GetSize(); i++) {
+ if (_frames[i]->_sound) _frames[i]->_sound->Stop();
}
return S_OK;
}
diff --git a/engines/wintermute/BSprite.h b/engines/wintermute/BSprite.h
index dd09fe0be1..973c263e8f 100644
--- a/engines/wintermute/BSprite.h
+++ b/engines/wintermute/BSprite.h
@@ -41,41 +41,41 @@ class CBSprite: public CBScriptHolder {
public:
HRESULT KillAllSounds();
CBSurface *GetSurface();
- char *m_EditorBgFile;
- int m_EditorBgOffsetX;
- int m_EditorBgOffsetY;
- int m_EditorBgAlpha;
- bool m_Streamed;
- bool m_StreamedKeepLoaded;
+ char *_editorBgFile;
+ int _editorBgOffsetX;
+ int _editorBgOffsetY;
+ int _editorBgAlpha;
+ bool _streamed;
+ bool _streamedKeepLoaded;
void Cleanup();
void SetDefaults();
- bool m_Precise;
+ bool _precise;
DECLARE_PERSISTENT(CBSprite, CBScriptHolder)
- bool m_EditorAllFrames;
+ bool _editorAllFrames;
bool GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX = 100, float ScaleY = 100);
- int m_MoveY;
- int m_MoveX;
+ int _moveY;
+ int _moveX;
HRESULT Display(int X, int Y, CBObject *Register = NULL, float ZoomX = 100, float ZoomY = 100, uint32 Alpha = 0xFFFFFFFF, float Rotate = 0.0f, TSpriteBlendMode BlendMode = BLEND_NORMAL);
bool GetCurrentFrame(float ZoomX = 100, float ZoomY = 100);
- bool m_CanBreak;
- bool m_EditorMuted;
- bool m_Continuous;
+ bool _canBreak;
+ bool _editorMuted;
+ bool _continuous;
void Reset();
- CBObject *m_Owner;
- bool m_Changed;
- bool m_Paused;
- bool m_Finished;
+ CBObject *_owner;
+ bool _changed;
+ bool _paused;
+ bool _finished;
HRESULT LoadBuffer(byte *Buffer, bool Compete = true, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
HRESULT LoadFile(char *Filename, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
- uint32 m_LastFrameTime;
+ uint32 _lastFrameTime;
HRESULT Draw(int X, int Y, CBObject *Register = NULL, float ZoomX = 100, float ZoomY = 100, uint32 Alpha = 0xFFFFFFFF);
- bool m_Looping;
- int m_CurrentFrame;
+ bool _looping;
+ int _currentFrame;
HRESULT AddFrame(char *Filename, uint32 Delay = 0, int HotspotX = 0, int HotspotY = 0, RECT *Rect = NULL);
CBSprite(CBGame *inGame, CBObject *Owner = NULL);
virtual ~CBSprite();
- CBArray<CBFrame *, CBFrame *> m_Frames;
+ CBArray<CBFrame *, CBFrame *> _frames;
HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
diff --git a/engines/wintermute/BStringTable.cpp b/engines/wintermute/BStringTable.cpp
index fda4853115..bebed9a38f 100644
--- a/engines/wintermute/BStringTable.cpp
+++ b/engines/wintermute/BStringTable.cpp
@@ -44,7 +44,7 @@ CBStringTable::CBStringTable(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
CBStringTable::~CBStringTable() {
// delete strings
- m_Strings.clear();
+ _strings.clear();
}
@@ -54,17 +54,17 @@ HRESULT CBStringTable::AddString(const char *Key, const char *Val, bool ReportDu
if (Key == NULL || Val == NULL) return E_FAIL;
if (scumm_stricmp(Key, "@right-to-left") == 0) {
- Game->m_TextRTL = true;
+ Game->_textRTL = true;
return S_OK;
}
Common::String final_key = Key;
StringUtil::ToLowerCase(final_key);
- m_StringsIter = m_Strings.find(final_key);
- if (m_StringsIter != m_Strings.end() && ReportDuplicities) Game->LOG(0, " Warning: Duplicate definition of string '%s'.", final_key.c_str());
+ _stringsIter = _strings.find(final_key);
+ if (_stringsIter != _strings.end() && ReportDuplicities) Game->LOG(0, " Warning: Duplicate definition of string '%s'.", final_key.c_str());
- m_Strings[final_key] = Val;
+ _strings[final_key] = Val;
return S_OK;
}
@@ -83,10 +83,10 @@ char *CBStringTable::GetKey(const char *Str) {
char *new_str;
- m_StringsIter = m_Strings.find(key);
- if (m_StringsIter != m_Strings.end()) {
- new_str = new char[m_StringsIter->_value.size() + 1];
- strcpy(new_str, m_StringsIter->_value.c_str());
+ _stringsIter = _strings.find(key);
+ if (_stringsIter != _strings.end()) {
+ new_str = new char[_stringsIter->_value.size() + 1];
+ strcpy(new_str, _stringsIter->_value.c_str());
if (strlen(new_str) > 0 && new_str[0] == '/' && strchr(new_str + 1, '/')) {
delete [] key;
char *Ret = GetKey(new_str);
@@ -103,7 +103,7 @@ char *CBStringTable::GetKey(const char *Str) {
//////////////////////////////////////////////////////////////////////////
void CBStringTable::Expand(char **Str, bool ForceExpand) {
- if (Game->m_DoNotExpandStrings && !ForceExpand) return;
+ if (Game->_doNotExpandStrings && !ForceExpand) return;
if (Str == NULL || *Str == NULL || *Str[0] != '/') return;
@@ -119,10 +119,10 @@ void CBStringTable::Expand(char **Str, bool ForceExpand) {
char *new_str;
- m_StringsIter = m_Strings.find(key);
- if (m_StringsIter != m_Strings.end()) {
- new_str = new char[m_StringsIter->_value.size() + 1];
- strcpy(new_str, m_StringsIter->_value.c_str());
+ _stringsIter = _strings.find(key);
+ if (_stringsIter != _strings.end()) {
+ new_str = new char[_stringsIter->_value.size() + 1];
+ strcpy(new_str, _stringsIter->_value.c_str());
} else {
new_str = new char[strlen(value) + 1];
strcpy(new_str, value);
@@ -138,7 +138,7 @@ void CBStringTable::Expand(char **Str, bool ForceExpand) {
//////////////////////////////////////////////////////////////////////////
const char *CBStringTable::ExpandStatic(const char *String, bool ForceExpand) {
- if (Game->m_DoNotExpandStrings && !ForceExpand) return String;
+ if (Game->_doNotExpandStrings && !ForceExpand) return String;
if (String == NULL || String[0] == '\0' || String[0] != '/') return String;
@@ -154,9 +154,9 @@ const char *CBStringTable::ExpandStatic(const char *String, bool ForceExpand) {
const char *new_str;
- m_StringsIter = m_Strings.find(key);
- if (m_StringsIter != m_Strings.end()) {
- new_str = m_StringsIter->_value.c_str();
+ _stringsIter = _strings.find(key);
+ if (_stringsIter != _strings.end()) {
+ new_str = _stringsIter->_value.c_str();
} else {
new_str = value;
}
@@ -172,10 +172,10 @@ const char *CBStringTable::ExpandStatic(const char *String, bool ForceExpand) {
HRESULT CBStringTable::LoadFile(char *Filename, bool ClearOld) {
Game->LOG(0, "Loading string table...");
- if (ClearOld) m_Strings.clear();
+ if (ClearOld) _strings.clear();
uint32 Size;
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename, &Size);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename, &Size);
if (Buffer == NULL) {
Game->LOG(0, "CBStringTable::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -185,12 +185,12 @@ HRESULT CBStringTable::LoadFile(char *Filename, bool ClearOld) {
if (Size > 3 && Buffer[0] == 0xEF && Buffer[1] == 0xBB && Buffer[2] == 0xBF) {
Pos += 3;
- if (Game->m_TextEncoding != TEXT_UTF8) {
- Game->m_TextEncoding = TEXT_UTF8;
- //Game->m_TextEncoding = TEXT_ANSI;
+ if (Game->_textEncoding != TEXT_UTF8) {
+ Game->_textEncoding = TEXT_UTF8;
+ //Game->_textEncoding = TEXT_ANSI;
Game->LOG(0, " UTF8 file detected, switching to UTF8 text encoding");
}
- } else Game->m_TextEncoding = TEXT_ANSI;
+ } else Game->_textEncoding = TEXT_ANSI;
int LineLength = 0;
while (Pos < Size) {
@@ -221,7 +221,7 @@ HRESULT CBStringTable::LoadFile(char *Filename, bool ClearOld) {
delete [] Buffer;
- Game->LOG(0, " %d strings loaded", m_Strings.size());
+ Game->LOG(0, " %d strings loaded", _strings.size());
return S_OK;
}
diff --git a/engines/wintermute/BStringTable.h b/engines/wintermute/BStringTable.h
index 28617c8593..abb455e3f5 100644
--- a/engines/wintermute/BStringTable.h
+++ b/engines/wintermute/BStringTable.h
@@ -43,10 +43,10 @@ public:
HRESULT AddString(const char *Key, const char *Val, bool ReportDuplicities = true);
CBStringTable(CBGame *inGame);
virtual ~CBStringTable();
- Common::HashMap<Common::String, Common::String> m_Strings;
+ Common::HashMap<Common::String, Common::String> _strings;
char *GetKey(const char *Str);
private:
- Common::HashMap<Common::String, Common::String>::iterator m_StringsIter;
+ Common::HashMap<Common::String, Common::String>::iterator _stringsIter;
};
diff --git a/engines/wintermute/BSubFrame.cpp b/engines/wintermute/BSubFrame.cpp
index 85f45156a0..d95fb824bd 100644
--- a/engines/wintermute/BSubFrame.cpp
+++ b/engines/wintermute/BSubFrame.cpp
@@ -44,33 +44,33 @@ IMPLEMENT_PERSISTENT(CBSubFrame, false)
//////////////////////////////////////////////////////////////////////////
CBSubFrame::CBSubFrame(CBGame *inGame): CBScriptable(inGame, true) {
- m_Surface = NULL;
- m_HotspotX = m_HotspotY = 0;
- m_Alpha = 0xFFFFFFFF;
- m_Transparent = 0xFFFF00FF;
+ _surface = NULL;
+ _hotspotX = _hotspotY = 0;
+ _alpha = 0xFFFFFFFF;
+ _transparent = 0xFFFF00FF;
- CBPlatform::SetRectEmpty(&m_Rect);
+ CBPlatform::SetRectEmpty(&_rect);
- m_EditorSelected = false;
+ _editorSelected = false;
- m_SurfaceFilename = NULL;
- m_CKDefault = true;
- m_CKRed = m_CKBlue = m_CKGreen = 0;
- m_LifeTime = -1;
- m_KeepLoaded = false;
+ _surfaceFilename = NULL;
+ _cKDefault = true;
+ _cKRed = _cKBlue = _cKGreen = 0;
+ _lifeTime = -1;
+ _keepLoaded = false;
- m_2DOnly = m_3DOnly = false;
- m_Decoration = false;
+ _2DOnly = _3DOnly = false;
+ _decoration = false;
- m_MirrorX = m_MirrorY = false;
+ _mirrorX = _mirrorY = false;
}
//////////////////////////////////////////////////////////////////////////
CBSubFrame::~CBSubFrame() {
- if (m_Surface) Game->m_SurfaceStorage->RemoveSurface(m_Surface);
- delete[] m_SurfaceFilename;
- m_SurfaceFilename = NULL;
+ if (_surface) Game->_surfaceStorage->RemoveSurface(_surface);
+ delete[] _surfaceFilename;
+ _surfaceFilename = NULL;
}
@@ -113,12 +113,12 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
RECT rect;
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
- bool custom_trans = false;
+ bool custo_trans = false;
CBPlatform::SetRectEmpty(&rect);
char *surface_file = NULL;
- delete m_Surface;
- m_Surface = NULL;
+ delete _surface;
+ _surface = NULL;
while ((cmd = parser.GetCommand((char **)&Buffer, commands, &params)) > 0) {
switch (cmd) {
@@ -128,7 +128,7 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
case TOKEN_TRANSPARENT:
parser.ScanStr(params, "%d,%d,%d", &r, &g, &b);
- custom_trans = true;
+ custo_trans = true;
break;
case TOKEN_RECT:
@@ -136,27 +136,27 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
break;
case TOKEN_HOTSPOT:
- parser.ScanStr(params, "%d,%d", &m_HotspotX, &m_HotspotY);
+ parser.ScanStr(params, "%d,%d", &_hotspotX, &_hotspotY);
break;
case TOKEN_2D_ONLY:
- parser.ScanStr(params, "%b", &m_2DOnly);
+ parser.ScanStr(params, "%b", &_2DOnly);
break;
case TOKEN_3D_ONLY:
- parser.ScanStr(params, "%b", &m_3DOnly);
+ parser.ScanStr(params, "%b", &_3DOnly);
break;
case TOKEN_MIRROR_X:
- parser.ScanStr(params, "%b", &m_MirrorX);
+ parser.ScanStr(params, "%b", &_mirrorX);
break;
case TOKEN_MIRROR_Y:
- parser.ScanStr(params, "%b", &m_MirrorY);
+ parser.ScanStr(params, "%b", &_mirrorY);
break;
case TOKEN_DECORATION:
- parser.ScanStr(params, "%b", &m_Decoration);
+ parser.ScanStr(params, "%b", &_decoration);
break;
case TOKEN_ALPHA_COLOR:
@@ -168,7 +168,7 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
break;
case TOKEN_EDITOR_SELECTED:
- parser.ScanStr(params, "%b", &m_EditorSelected);
+ parser.ScanStr(params, "%b", &_editorSelected);
break;
case TOKEN_EDITOR_PROPERTY:
@@ -182,22 +182,22 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
}
if (surface_file != NULL) {
- if (custom_trans) SetSurface(surface_file, false, r, g, b, LifeTime, KeepLoaded);
+ if (custo_trans) SetSurface(surface_file, false, r, g, b, LifeTime, KeepLoaded);
else SetSurface(surface_file, true, 0, 0, 0, LifeTime, KeepLoaded);
}
- m_Alpha = DRGBA(ar, ag, ab, alpha);
- if (custom_trans) m_Transparent = DRGBA(r, g, b, 0xFF);
+ _alpha = DRGBA(ar, ag, ab, alpha);
+ if (custo_trans) _transparent = DRGBA(r, g, b, 0xFF);
/*
- if(m_Surface == NULL)
+ if(_surface == NULL)
{
Game->LOG(0, "Error parsing sub-frame. Image not set.");
return E_FAIL;
}
*/
if (CBPlatform::IsRectEmpty(&rect)) SetDefaultRect();
- else m_Rect = rect;
+ else _rect = rect;
return S_OK;
}
@@ -205,27 +205,27 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
//////////////////////////////////////////////////////////////////////
HRESULT CBSubFrame::Draw(int X, int Y, CBObject *Register, float ZoomX, float ZoomY, bool Precise, uint32 Alpha, float Rotate, TSpriteBlendMode BlendMode) {
- if (!m_Surface) return S_OK;
+ if (!_surface) return S_OK;
- if (Register != NULL && !m_Decoration) {
+ if (Register != NULL && !_decoration) {
if (ZoomX == 100 && ZoomY == 100) {
- Game->m_Renderer->m_RectList.Add(new CBActiveRect(Game, Register, this, X - m_HotspotX + m_Rect.left, Y - m_HotspotY + m_Rect.top, m_Rect.right - m_Rect.left, m_Rect.bottom - m_Rect.top, ZoomX, ZoomY, Precise));
+ Game->_renderer->_rectList.Add(new CBActiveRect(Game, Register, this, X - _hotspotX + _rect.left, Y - _hotspotY + _rect.top, _rect.right - _rect.left, _rect.bottom - _rect.top, ZoomX, ZoomY, Precise));
} else {
- Game->m_Renderer->m_RectList.Add(new CBActiveRect(Game, Register, this, (int)(X - (m_HotspotX + m_Rect.left) * (ZoomX / 100)), (int)(Y - (m_HotspotY + m_Rect.top) * (ZoomY / 100)), (int)((m_Rect.right - m_Rect.left) * (ZoomX / 100)), (int)((m_Rect.bottom - m_Rect.top) * (ZoomY / 100)), ZoomX, ZoomY, Precise));
+ Game->_renderer->_rectList.Add(new CBActiveRect(Game, Register, this, (int)(X - (_hotspotX + _rect.left) * (ZoomX / 100)), (int)(Y - (_hotspotY + _rect.top) * (ZoomY / 100)), (int)((_rect.right - _rect.left) * (ZoomX / 100)), (int)((_rect.bottom - _rect.top) * (ZoomY / 100)), ZoomX, ZoomY, Precise));
}
}
- if (Game->m_SuspendedRendering) return S_OK;
+ if (Game->_suspendedRendering) return S_OK;
HRESULT res;
- //if(Alpha==0xFFFFFFFF) Alpha = m_Alpha; // TODO: better (combine owner's and self alpha)
- if (m_Alpha != 0xFFFFFFFF) Alpha = m_Alpha;
+ //if(Alpha==0xFFFFFFFF) Alpha = _alpha; // TODO: better (combine owner's and self alpha)
+ if (_alpha != 0xFFFFFFFF) Alpha = _alpha;
if (Rotate != 0.0f) {
- res = m_Surface->DisplayTransform((int)(X - m_HotspotX * (ZoomX / 100)), (int)(Y - m_HotspotY * (ZoomY / 100)), m_HotspotX, m_HotspotY, m_Rect, ZoomX, ZoomY, Alpha, Rotate, BlendMode, m_MirrorX, m_MirrorY);
+ res = _surface->DisplayTransform((int)(X - _hotspotX * (ZoomX / 100)), (int)(Y - _hotspotY * (ZoomY / 100)), _hotspotX, _hotspotY, _rect, ZoomX, ZoomY, Alpha, Rotate, BlendMode, _mirrorX, _mirrorY);
} else {
- if (ZoomX == 100 && ZoomY == 100) res = m_Surface->DisplayTrans(X - m_HotspotX, Y - m_HotspotY, m_Rect, Alpha, BlendMode, m_MirrorX, m_MirrorY);
- else res = m_Surface->DisplayTransZoom((int)(X - m_HotspotX * (ZoomX / 100)), (int)(Y - m_HotspotY * (ZoomY / 100)), m_Rect, ZoomX, ZoomY, Alpha, BlendMode, m_MirrorX, m_MirrorY);
+ if (ZoomX == 100 && ZoomY == 100) res = _surface->DisplayTrans(X - _hotspotX, Y - _hotspotY, _rect, Alpha, BlendMode, _mirrorX, _mirrorY);
+ else res = _surface->DisplayTransZoom((int)(X - _hotspotX * (ZoomX / 100)), (int)(Y - _hotspotY * (ZoomY / 100)), _rect, ZoomX, ZoomY, Alpha, BlendMode, _mirrorX, _mirrorY);
}
return res;
@@ -240,10 +240,10 @@ bool CBSubFrame::GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float
float RatioY = ScaleY / 100.0f;
CBPlatform::SetRect(Rect,
- X - m_HotspotX * RatioX,
- Y - m_HotspotY * RatioY,
- X - m_HotspotX * RatioX + (m_Rect.right - m_Rect.left)*RatioX,
- Y - m_HotspotY * RatioY + (m_Rect.bottom - m_Rect.top)*RatioY);
+ X - _hotspotX * RatioX,
+ Y - _hotspotY * RatioY,
+ X - _hotspotX * RatioX + (_rect.right - _rect.left)*RatioX,
+ Y - _hotspotY * RatioY + (_rect.bottom - _rect.top)*RatioY);
return true;
}
@@ -253,43 +253,43 @@ HRESULT CBSubFrame::SaveAsText(CBDynBuffer *Buffer, int Indent, bool Complete) {
if (Complete)
Buffer->PutTextIndent(Indent, "SUBFRAME {\n");
- if (m_Surface && m_Surface->m_Filename != NULL)
- Buffer->PutTextIndent(Indent + 2, "IMAGE = \"%s\"\n", m_Surface->m_Filename);
+ if (_surface && _surface->_filename != NULL)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE = \"%s\"\n", _surface->_filename);
- if (m_Transparent != 0xFFFF00FF)
- Buffer->PutTextIndent(Indent + 2, "TRANSPARENT { %d,%d,%d }\n", D3DCOLGetR(m_Transparent), D3DCOLGetG(m_Transparent), D3DCOLGetB(m_Transparent));
+ if (_transparent != 0xFFFF00FF)
+ Buffer->PutTextIndent(Indent + 2, "TRANSPARENT { %d,%d,%d }\n", D3DCOLGetR(_transparent), D3DCOLGetG(_transparent), D3DCOLGetB(_transparent));
RECT rect;
CBPlatform::SetRectEmpty(&rect);
- if (m_Surface) CBPlatform::SetRect(&rect, 0, 0, m_Surface->GetWidth(), m_Surface->GetHeight());
- if (!CBPlatform::EqualRect(&rect, &m_Rect))
- Buffer->PutTextIndent(Indent + 2, "RECT { %d,%d,%d,%d }\n", m_Rect.left, m_Rect.top, m_Rect.right, m_Rect.bottom);
+ if (_surface) CBPlatform::SetRect(&rect, 0, 0, _surface->GetWidth(), _surface->GetHeight());
+ if (!CBPlatform::EqualRect(&rect, &_rect))
+ Buffer->PutTextIndent(Indent + 2, "RECT { %d,%d,%d,%d }\n", _rect.left, _rect.top, _rect.right, _rect.bottom);
- if (m_HotspotX != 0 || m_HotspotY != 0)
- Buffer->PutTextIndent(Indent + 2, "HOTSPOT {%d, %d}\n", m_HotspotX, m_HotspotY);
+ if (_hotspotX != 0 || _hotspotY != 0)
+ Buffer->PutTextIndent(Indent + 2, "HOTSPOT {%d, %d}\n", _hotspotX, _hotspotY);
- if (m_Alpha != 0xFFFFFFFF) {
- Buffer->PutTextIndent(Indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(m_Alpha), D3DCOLGetG(m_Alpha), D3DCOLGetB(m_Alpha));
- Buffer->PutTextIndent(Indent + 2, "ALPHA = %d\n", D3DCOLGetA(m_Alpha));
+ if (_alpha != 0xFFFFFFFF) {
+ Buffer->PutTextIndent(Indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(_alpha), D3DCOLGetG(_alpha), D3DCOLGetB(_alpha));
+ Buffer->PutTextIndent(Indent + 2, "ALPHA = %d\n", D3DCOLGetA(_alpha));
}
- if (m_MirrorX)
- Buffer->PutTextIndent(Indent + 2, "MIRROR_X=%s\n", m_MirrorX ? "TRUE" : "FALSE");
+ if (_mirrorX)
+ Buffer->PutTextIndent(Indent + 2, "MIRROR_X=%s\n", _mirrorX ? "TRUE" : "FALSE");
- if (m_MirrorY)
- Buffer->PutTextIndent(Indent + 2, "MIRROR_Y=%s\n", m_MirrorY ? "TRUE" : "FALSE");
+ if (_mirrorY)
+ Buffer->PutTextIndent(Indent + 2, "MIRROR_Y=%s\n", _mirrorY ? "TRUE" : "FALSE");
- if (m_2DOnly)
- Buffer->PutTextIndent(Indent + 2, "2D_ONLY=%s\n", m_2DOnly ? "TRUE" : "FALSE");
+ if (_2DOnly)
+ Buffer->PutTextIndent(Indent + 2, "2D_ONLY=%s\n", _2DOnly ? "TRUE" : "FALSE");
- if (m_3DOnly)
- Buffer->PutTextIndent(Indent + 2, "3D_ONLY=%s\n", m_3DOnly ? "TRUE" : "FALSE");
+ if (_3DOnly)
+ Buffer->PutTextIndent(Indent + 2, "3D_ONLY=%s\n", _3DOnly ? "TRUE" : "FALSE");
- if (m_Decoration)
- Buffer->PutTextIndent(Indent + 2, "DECORATION=%s\n", m_Decoration ? "TRUE" : "FALSE");
+ if (_decoration)
+ Buffer->PutTextIndent(Indent + 2, "DECORATION=%s\n", _decoration ? "TRUE" : "FALSE");
- if (m_EditorSelected)
- Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", m_EditorSelected ? "TRUE" : "FALSE");
+ if (_editorSelected)
+ Buffer->PutTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
CBBase::SaveAsText(Buffer, Indent + 2);
@@ -303,9 +303,9 @@ HRESULT CBSubFrame::SaveAsText(CBDynBuffer *Buffer, int Indent, bool Complete) {
//////////////////////////////////////////////////////////////////////////
void CBSubFrame::SetDefaultRect() {
- if (m_Surface) {
- CBPlatform::SetRect(&m_Rect, 0, 0, m_Surface->GetWidth(), m_Surface->GetHeight());
- } else CBPlatform::SetRectEmpty(&m_Rect);
+ if (_surface) {
+ CBPlatform::SetRect(&_rect, 0, 0, _surface->GetWidth(), _surface->GetHeight());
+ } else CBPlatform::SetRectEmpty(&_rect);
}
@@ -314,26 +314,26 @@ HRESULT CBSubFrame::Persist(CBPersistMgr *PersistMgr) {
CBScriptable::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_2DOnly));
- PersistMgr->Transfer(TMEMBER(m_3DOnly));
- PersistMgr->Transfer(TMEMBER(m_Alpha));
- PersistMgr->Transfer(TMEMBER(m_Decoration));
- PersistMgr->Transfer(TMEMBER(m_EditorSelected));
- PersistMgr->Transfer(TMEMBER(m_HotspotX));
- PersistMgr->Transfer(TMEMBER(m_HotspotY));
- PersistMgr->Transfer(TMEMBER(m_Rect));
-
- PersistMgr->Transfer(TMEMBER(m_SurfaceFilename));
- PersistMgr->Transfer(TMEMBER(m_CKDefault));
- PersistMgr->Transfer(TMEMBER(m_CKRed));
- PersistMgr->Transfer(TMEMBER(m_CKGreen));
- PersistMgr->Transfer(TMEMBER(m_CKBlue));
- PersistMgr->Transfer(TMEMBER(m_LifeTime));
-
- PersistMgr->Transfer(TMEMBER(m_KeepLoaded));
- PersistMgr->Transfer(TMEMBER(m_MirrorX));
- PersistMgr->Transfer(TMEMBER(m_MirrorY));
- PersistMgr->Transfer(TMEMBER(m_Transparent));
+ PersistMgr->Transfer(TMEMBER(_2DOnly));
+ PersistMgr->Transfer(TMEMBER(_3DOnly));
+ PersistMgr->Transfer(TMEMBER(_alpha));
+ PersistMgr->Transfer(TMEMBER(_decoration));
+ PersistMgr->Transfer(TMEMBER(_editorSelected));
+ PersistMgr->Transfer(TMEMBER(_hotspotX));
+ PersistMgr->Transfer(TMEMBER(_hotspotY));
+ PersistMgr->Transfer(TMEMBER(_rect));
+
+ PersistMgr->Transfer(TMEMBER(_surfaceFilename));
+ PersistMgr->Transfer(TMEMBER(_cKDefault));
+ PersistMgr->Transfer(TMEMBER(_cKRed));
+ PersistMgr->Transfer(TMEMBER(_cKGreen));
+ PersistMgr->Transfer(TMEMBER(_cKBlue));
+ PersistMgr->Transfer(TMEMBER(_lifeTime));
+
+ PersistMgr->Transfer(TMEMBER(_keepLoaded));
+ PersistMgr->Transfer(TMEMBER(_mirrorX));
+ PersistMgr->Transfer(TMEMBER(_mirrorY));
+ PersistMgr->Transfer(TMEMBER(_transparent));
return S_OK;
}
@@ -350,8 +350,8 @@ HRESULT CBSubFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *T
if (strcmp(Name, "GetImage") == 0) {
Stack->CorrectParams(0);
- if (!m_SurfaceFilename) Stack->PushNULL();
- else Stack->PushString(m_SurfaceFilename);
+ if (!_surfaceFilename) Stack->PushNULL();
+ else Stack->PushString(_surfaceFilename);
return S_OK;
}
@@ -363,9 +363,9 @@ HRESULT CBSubFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *T
CScValue *Val = Stack->Pop();
if (Val->IsNULL()) {
- if (m_Surface) Game->m_SurfaceStorage->RemoveSurface(m_Surface);
- delete[] m_SurfaceFilename;
- m_SurfaceFilename = NULL;
+ if (_surface) Game->_surfaceStorage->RemoveSurface(_surface);
+ delete[] _surfaceFilename;
+ _surfaceFilename = NULL;
Stack->PushBool(true);
} else {
char *Filename = Val->GetString();
@@ -384,15 +384,15 @@ HRESULT CBSubFrame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *T
//////////////////////////////////////////////////////////////////////////
CScValue *CBSubFrame::ScGetProperty(char *Name) {
- if (!m_ScValue) m_ScValue = new CScValue(Game);
- m_ScValue->SetNULL();
+ if (!_scValue) _scValue = new CScValue(Game);
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("subframe");
- return m_ScValue;
+ _scValue->SetString("subframe");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -400,72 +400,72 @@ CScValue *CBSubFrame::ScGetProperty(char *Name) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AlphaColor") == 0) {
- m_ScValue->SetInt((int)m_Alpha);
- return m_ScValue;
+ _scValue->SetInt((int)_alpha);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TransparentColor (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TransparentColor") == 0) {
- m_ScValue->SetInt((int)m_Transparent);
- return m_ScValue;
+ _scValue->SetInt((int)_transparent);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Is2DOnly
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Is2DOnly") == 0) {
- m_ScValue->SetBool(m_2DOnly);
- return m_ScValue;
+ _scValue->SetBool(_2DOnly);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Is3DOnly
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Is3DOnly") == 0) {
- m_ScValue->SetBool(m_3DOnly);
- return m_ScValue;
+ _scValue->SetBool(_3DOnly);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MirrorX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MirrorX") == 0) {
- m_ScValue->SetBool(m_MirrorX);
- return m_ScValue;
+ _scValue->SetBool(_mirrorX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MirrorY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MirrorY") == 0) {
- m_ScValue->SetBool(m_MirrorY);
- return m_ScValue;
+ _scValue->SetBool(_mirrorY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Decoration
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Decoration") == 0) {
- m_ScValue->SetBool(m_Decoration);
- return m_ScValue;
+ _scValue->SetBool(_decoration);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// HotspotX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "HotspotX") == 0) {
- m_ScValue->SetInt(m_HotspotX);
- return m_ScValue;
+ _scValue->SetInt(_hotspotX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// HotspotY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "HotspotY") == 0) {
- m_ScValue->SetInt(m_HotspotY);
- return m_ScValue;
+ _scValue->SetInt(_hotspotY);
+ return _scValue;
}
else return CBScriptable::ScGetProperty(Name);
@@ -478,7 +478,7 @@ HRESULT CBSubFrame::ScSetProperty(char *Name, CScValue *Value) {
// AlphaColor
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "AlphaColor") == 0) {
- m_Alpha = (uint32)Value->GetInt();
+ _alpha = (uint32)Value->GetInt();
return S_OK;
}
@@ -486,7 +486,7 @@ HRESULT CBSubFrame::ScSetProperty(char *Name, CScValue *Value) {
// Is2DOnly
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Is2DOnly") == 0) {
- m_2DOnly = Value->GetBool();
+ _2DOnly = Value->GetBool();
return S_OK;
}
@@ -494,7 +494,7 @@ HRESULT CBSubFrame::ScSetProperty(char *Name, CScValue *Value) {
// Is3DOnly
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Is3DOnly") == 0) {
- m_3DOnly = Value->GetBool();
+ _3DOnly = Value->GetBool();
return S_OK;
}
@@ -502,7 +502,7 @@ HRESULT CBSubFrame::ScSetProperty(char *Name, CScValue *Value) {
// MirrorX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MirrorX") == 0) {
- m_MirrorX = Value->GetBool();
+ _mirrorX = Value->GetBool();
return S_OK;
}
@@ -510,7 +510,7 @@ HRESULT CBSubFrame::ScSetProperty(char *Name, CScValue *Value) {
// MirrorY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MirrorY") == 0) {
- m_MirrorY = Value->GetBool();
+ _mirrorY = Value->GetBool();
return S_OK;
}
@@ -518,7 +518,7 @@ HRESULT CBSubFrame::ScSetProperty(char *Name, CScValue *Value) {
// Decoration
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Decoration") == 0) {
- m_Decoration = Value->GetBool();
+ _decoration = Value->GetBool();
return S_OK;
}
@@ -526,7 +526,7 @@ HRESULT CBSubFrame::ScSetProperty(char *Name, CScValue *Value) {
// HotspotX
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "HotspotX") == 0) {
- m_HotspotX = Value->GetInt();
+ _hotspotX = Value->GetInt();
return S_OK;
}
@@ -534,7 +534,7 @@ HRESULT CBSubFrame::ScSetProperty(char *Name, CScValue *Value) {
// HotspotY
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "HotspotY") == 0) {
- m_HotspotY = Value->GetInt();
+ _hotspotY = Value->GetInt();
return S_OK;
}
@@ -550,25 +550,25 @@ char *CBSubFrame::ScToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSubFrame::SetSurface(char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
- if (m_Surface) {
- Game->m_SurfaceStorage->RemoveSurface(m_Surface);
- m_Surface = NULL;
+ if (_surface) {
+ Game->_surfaceStorage->RemoveSurface(_surface);
+ _surface = NULL;
}
- delete[] m_SurfaceFilename;
- m_SurfaceFilename = NULL;
+ delete[] _surfaceFilename;
+ _surfaceFilename = NULL;
- m_Surface = Game->m_SurfaceStorage->AddSurface(Filename, default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
- if (m_Surface) {
- m_SurfaceFilename = new char[strlen(Filename) + 1];
- strcpy(m_SurfaceFilename, Filename);
+ _surface = Game->_surfaceStorage->AddSurface(Filename, default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
+ if (_surface) {
+ _surfaceFilename = new char[strlen(Filename) + 1];
+ strcpy(_surfaceFilename, Filename);
- m_CKDefault = default_ck;
- m_CKRed = ck_red;
- m_CKGreen = ck_green;
- m_CKBlue = ck_blue;
- m_LifeTime = LifeTime;
- m_KeepLoaded = KeepLoaded;
+ _cKDefault = default_ck;
+ _cKRed = ck_red;
+ _cKGreen = ck_green;
+ _cKBlue = ck_blue;
+ _lifeTime = LifeTime;
+ _keepLoaded = KeepLoaded;
return S_OK;
} else return E_FAIL;
@@ -577,12 +577,12 @@ HRESULT CBSubFrame::SetSurface(char *Filename, bool default_ck, byte ck_red, byt
//////////////////////////////////////////////////////////////////////////
HRESULT CBSubFrame::SetSurfaceSimple() {
- if (!m_SurfaceFilename) {
- m_Surface = NULL;
+ if (!_surfaceFilename) {
+ _surface = NULL;
return S_OK;
}
- m_Surface = Game->m_SurfaceStorage->AddSurface(m_SurfaceFilename, m_CKDefault, m_CKRed, m_CKGreen, m_CKBlue, m_LifeTime, m_KeepLoaded);
- if (m_Surface) return S_OK;
+ _surface = Game->_surfaceStorage->AddSurface(_surfaceFilename, _cKDefault, _cKRed, _cKGreen, _cKBlue, _lifeTime, _keepLoaded);
+ if (_surface) return S_OK;
else return E_FAIL;
}
diff --git a/engines/wintermute/BSubFrame.h b/engines/wintermute/BSubFrame.h
index 6147b75811..9a8961df1b 100644
--- a/engines/wintermute/BSubFrame.h
+++ b/engines/wintermute/BSubFrame.h
@@ -38,39 +38,39 @@ class CBObject;
class CBSurface;
class CBSubFrame : public CBScriptable {
public:
- bool m_MirrorX;
- bool m_MirrorY;
- bool m_Decoration;
+ bool _mirrorX;
+ bool _mirrorY;
+ bool _decoration;
HRESULT SetSurface(char *Filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool KeepLoaded = false);
HRESULT SetSurfaceSimple();
DECLARE_PERSISTENT(CBSubFrame, CBScriptable)
void SetDefaultRect();
- uint32 m_Transparent;
+ uint32 _transparent;
HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent, bool Complete = true);
- bool m_EditorSelected;
+ bool _editorSelected;
CBSubFrame(CBGame *inGame);
virtual ~CBSubFrame();
HRESULT LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded);
HRESULT Draw(int X, int Y, CBObject *Register = NULL, float ZoomX = 100, float ZoomY = 100, bool Precise = true, uint32 Alpha = 0xFFFFFFFF, float Rotate = 0.0f, TSpriteBlendMode BlendMode = BLEND_NORMAL);
bool GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX = 100, float ScaleY = 100);
- int m_HotspotX;
- int m_HotspotY;
- uint32 m_Alpha;
- RECT m_Rect;
+ int _hotspotX;
+ int _hotspotY;
+ uint32 _alpha;
+ RECT _rect;
- bool m_CKDefault;
- byte m_CKRed;
- byte m_CKGreen;
- byte m_CKBlue;
- int m_LifeTime;
- bool m_KeepLoaded;
- char *m_SurfaceFilename;
+ bool _cKDefault;
+ byte _cKRed;
+ byte _cKGreen;
+ byte _cKBlue;
+ int _lifeTime;
+ bool _keepLoaded;
+ char *_surfaceFilename;
- bool m_2DOnly;
- bool m_3DOnly;
+ bool _2DOnly;
+ bool _3DOnly;
- CBSurface *m_Surface;
+ CBSurface *_surface;
// scripting interface
virtual CScValue *ScGetProperty(char *Name);
diff --git a/engines/wintermute/BSurface.cpp b/engines/wintermute/BSurface.cpp
index 16deda3c59..c51652e503 100644
--- a/engines/wintermute/BSurface.cpp
+++ b/engines/wintermute/BSurface.cpp
@@ -34,28 +34,28 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBSurface::CBSurface(CBGame *inGame): CBBase(inGame) {
- m_ReferenceCount = 0;
+ _referenceCount = 0;
- m_Width = m_Height = 0;
+ _width = _height = 0;
- m_Filename = NULL;
+ _filename = NULL;
- m_PixelOpReady = false;
+ _pixelOpReady = false;
- m_CKDefault = true;
- m_CKRed = m_CKGreen = m_CKBlue = 0;
- m_LifeTime = 0;
- m_KeepLoaded = false;
+ _cKDefault = true;
+ _cKRed = _cKGreen = _cKBlue = 0;
+ _lifeTime = 0;
+ _keepLoaded = false;
- m_LastUsedTime = 0;
- m_Valid = false;
+ _lastUsedTime = 0;
+ _valid = false;
}
//////////////////////////////////////////////////////////////////////
CBSurface::~CBSurface() {
- if (m_PixelOpReady) EndPixelOp();
- if (m_Filename) delete [] m_Filename;
+ if (_pixelOpReady) EndPixelOp();
+ if (_filename) delete [] _filename;
}
@@ -168,29 +168,29 @@ HRESULT CBSurface::Invalidate() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurface::PrepareToDraw() {
- m_LastUsedTime = Game->m_LiveTimer;
+ _lastUsedTime = Game->_liveTimer;
- if (!m_Valid) {
- //Game->LOG(0, "Reviving: %s", m_Filename);
- return Create(m_Filename, m_CKDefault, m_CKRed, m_CKGreen, m_CKBlue, m_LifeTime, m_KeepLoaded);
+ if (!_valid) {
+ //Game->LOG(0, "Reviving: %s", _filename);
+ return Create(_filename, _cKDefault, _cKRed, _cKGreen, _cKBlue, _lifeTime, _keepLoaded);
} else return S_OK;
}
//////////////////////////////////////////////////////////////////////////
void CBSurface::SetFilename(const char *Filename) {
- delete[] m_Filename;
- m_Filename = NULL;
+ delete[] _filename;
+ _filename = NULL;
if (!Filename) return;
- m_Filename = new char[strlen(Filename) + 1];
- if (m_Filename) strcpy(m_Filename, Filename);
+ _filename = new char[strlen(Filename) + 1];
+ if (_filename) strcpy(_filename, Filename);
}
//////////////////////////////////////////////////////////////////////////
void CBSurface::SetSize(int Width, int Height) {
- m_Width = Width;
- m_Height = Height;
+ _width = Width;
+ _height = Height;
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/BSurface.h b/engines/wintermute/BSurface.h
index 5fa355fcfa..53b9afa541 100644
--- a/engines/wintermute/BSurface.h
+++ b/engines/wintermute/BSurface.h
@@ -37,17 +37,17 @@ class CBSurface: public CBBase {
public:
virtual HRESULT Invalidate();
virtual HRESULT PrepareToDraw();
- bool m_CKDefault;
- byte m_CKRed;
- byte m_CKGreen;
- byte m_CKBlue;
+ bool _cKDefault;
+ byte _cKRed;
+ byte _cKGreen;
+ byte _cKBlue;
- uint32 m_LastUsedTime;
- bool m_Valid;
- int m_LifeTime;
- bool m_KeepLoaded;
+ uint32 _lastUsedTime;
+ bool _valid;
+ int _lifeTime;
+ bool _keepLoaded;
- bool m_PixelOpReady;
+ bool _pixelOpReady;
CBSurface(CBGame *inGame);
virtual ~CBSurface();
@@ -71,20 +71,20 @@ public:
void SetFilename(const char *Filename);
void SetSize(int Width, int Height);
- int m_ReferenceCount;
- char *m_Filename;
+ int _referenceCount;
+ char *_filename;
int GetWidth() {
- return m_Width;
+ return _width;
}
int GetHeight() {
- return m_Height;
+ return _height;
}
- //void SetWidth(int Width){ m_Width = Width; }
- //void SetHeight(int Height){ m_Height = Height; }
+ //void SetWidth(int Width){ _width = Width; }
+ //void SetHeight(int Height){ _height = Height; }
protected:
- int m_Height;
- int m_Width;
+ int _height;
+ int _width;
};
diff --git a/engines/wintermute/BSurfaceSDL.cpp b/engines/wintermute/BSurfaceSDL.cpp
index fccea082a5..e52bfb9561 100644
--- a/engines/wintermute/BSurfaceSDL.cpp
+++ b/engines/wintermute/BSurfaceSDL.cpp
@@ -44,28 +44,28 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBSurfaceSDL::CBSurfaceSDL(CBGame *inGame) : CBSurface(inGame) {
- m_Texture = NULL;
- m_AlphaMask = NULL;
+ _texture = NULL;
+ _alphaMask = NULL;
- m_LockPixels = NULL;
- m_LockPitch = 0;
+ _lockPixels = NULL;
+ _lockPitch = 0;
}
//////////////////////////////////////////////////////////////////////////
CBSurfaceSDL::~CBSurfaceSDL() {
//TODO
#if 0
- if (m_Texture) SDL_DestroyTexture(m_Texture);
- delete[] m_AlphaMask;
- m_AlphaMask = NULL;
+ if (_texture) SDL_DestroyTexture(_texture);
+ delete[] _alphaMask;
+ _alphaMask = NULL;
- Game->AddMem(-m_Width * m_Height * 4);
+ Game->AddMem(-_width * _height * 4);
#endif
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceSDL::Create(char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
- CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->m_Renderer);
+ CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
Common::String strFileName(Filename);
Graphics::ImageDecoder *imgDecoder;
@@ -78,12 +78,12 @@ HRESULT CBSurfaceSDL::Create(char *Filename, bool default_ck, byte ck_red, byte
error("CBSurfaceSDL::Create : Unsupported fileformat %s", Filename);
}
- CBFile *file = Game->m_FileManager->OpenFile(Filename);
+ CBFile *file = Game->_fileManager->OpenFile(Filename);
if (!file) return E_FAIL;
imgDecoder->loadStream(*file->getMemStream());
const Graphics::Surface *surface = imgDecoder->getSurface();
- Game->m_FileManager->CloseFile(file);
+ Game->_fileManager->CloseFile(file);
if (default_ck) {
ck_red = 255;
@@ -91,8 +91,8 @@ HRESULT CBSurfaceSDL::Create(char *Filename, bool default_ck, byte ck_red, byte
ck_blue = 255;
}
- m_Width = surface->w;
- m_Height = surface->h;
+ _width = surface->w;
+ _height = surface->h;
bool isSaveGameGrayscale = scumm_strnicmp(Filename, "savegame:", 9) == 0 && (Filename[strFileName.size() - 1] == 'g' || Filename[strFileName.size() - 1] == 'G');
if (isSaveGameGrayscale) {
@@ -124,18 +124,18 @@ HRESULT CBSurfaceSDL::Create(char *Filename, bool default_ck, byte ck_red, byte
uint32 bmask = surface->format.bMax() << surface->format.bShift;
uint32 amask = surface->format.aMax();
- SDL_Surface *surf = SDL_CreateRGBSurfaceFrom(surface->pixels, m_Width, m_Height, surface->format.bytesPerPixel * 8, surface->pitch, rmask, gmask, bmask, amask);
+ SDL_Surface *surf = SDL_CreateRGBSurfaceFrom(surface->pixels, _width, _height, surface->format.bytesPerPixel * 8, surface->pitch, rmask, gmask, bmask, amask);
// no alpha, set color key
if (surface->format.bytesPerPixel != 4)
SDL_SetColorKey(surf, SDL_TRUE, SDL_MapRGB(surf->format, ck_red, ck_green, ck_blue));
//SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "best"); //TODO
- //m_Texture = SdlUtil::CreateTextureFromSurface(renderer->GetSdlRenderer(), surf);
+ //_texture = SdlUtil::CreateTextureFromSurface(renderer->GetSdlRenderer(), surf);
warning("Surface-textures not fully ported yet");
#if 0
- m_Texture = SDL_CreateTextureFromSurface(renderer->GetSdlRenderer(), surf);
- if (!m_Texture) {
+ _texture = SDL_CreateTextureFromSurface(renderer->GetSdlRenderer(), surf);
+ if (!_texture) {
SDL_FreeSurface(surf);
delete imgDecoder;
return E_FAIL;
@@ -146,25 +146,25 @@ HRESULT CBSurfaceSDL::Create(char *Filename, bool default_ck, byte ck_red, byte
SDL_FreeSurface(surf);
delete imgDecoder; // TODO: Update this if ImageDecoder doesn't end up owning the surface.
- m_CKDefault = default_ck;
- m_CKRed = ck_red;
- m_CKGreen = ck_green;
- m_CKBlue = ck_blue;
+ _cKDefault = default_ck;
+ _cKRed = ck_red;
+ _cKGreen = ck_green;
+ _cKBlue = ck_blue;
- if (!m_Filename || scumm_stricmp(m_Filename, Filename) != 0) {
+ if (!_filename || scumm_stricmp(_filename, Filename) != 0) {
SetFilename(Filename);
}
- if (m_LifeTime == 0 || LifeTime == -1 || LifeTime > m_LifeTime)
- m_LifeTime = LifeTime;
+ if (_lifeTime == 0 || LifeTime == -1 || LifeTime > _lifeTime)
+ _lifeTime = LifeTime;
- m_KeepLoaded = KeepLoaded;
- if (m_KeepLoaded) m_LifeTime = -1;
+ _keepLoaded = KeepLoaded;
+ if (_keepLoaded) _lifeTime = -1;
- m_Valid = true;
+ _valid = true;
- Game->AddMem(m_Width * m_Height * 4);
+ Game->AddMem(_width * _height * 4);
#endif
return S_OK;
@@ -172,8 +172,8 @@ HRESULT CBSurfaceSDL::Create(char *Filename, bool default_ck, byte ck_red, byte
//////////////////////////////////////////////////////////////////////////
void CBSurfaceSDL::GenAlphaMask(SDL_Surface *surface) {
- delete[] m_AlphaMask;
- m_AlphaMask = NULL;
+ delete[] _alphaMask;
+ _alphaMask = NULL;
if (!surface) return;
SDL_LockSurface(surface);
@@ -186,7 +186,7 @@ void CBSurfaceSDL::GenAlphaMask(SDL_Surface *surface) {
SDL_GetRGB(colorKey, surface->format, &ckRed, &ckGreen, &ckBlue);
} else hasColorKey = false;
*/ //TODO
- m_AlphaMask = new byte[surface->w * surface->h];
+ _alphaMask = new byte[surface->w * surface->h];
bool hasTransparency = false;
for (int y = 0; y < surface->h; y++) {
@@ -199,7 +199,7 @@ void CBSurfaceSDL::GenAlphaMask(SDL_Surface *surface) {
if (hasColorKey && r == ckRed && g == ckGreen && b == ckBlue)
a = 0;
- m_AlphaMask[y * surface->w + x] = a;
+ _alphaMask[y * surface->w + x] = a;
if (a < 255) hasTransparency = true;
}
}
@@ -207,8 +207,8 @@ void CBSurfaceSDL::GenAlphaMask(SDL_Surface *surface) {
SDL_UnlockSurface(surface);
if (!hasTransparency) {
- delete[] m_AlphaMask;
- m_AlphaMask = NULL;
+ delete[] _alphaMask;
+ _alphaMask = NULL;
}
}
@@ -247,15 +247,15 @@ Uint32 CBSurfaceSDL::GetPixel(SDL_Surface *surface, int x, int y) {
HRESULT CBSurfaceSDL::Create(int Width, int Height) {
warning("SurfaceSDL::Create not ported yet"); //TODO
#if 0
- CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->m_Renderer);
- m_Texture = SDL_CreateTexture(renderer->GetSdlRenderer(), SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, Width, Height);
+ CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
+ _texture = SDL_CreateTexture(renderer->GetSdlRenderer(), SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, Width, Height);
- m_Width = Width;
- m_Height = Height;
+ _width = Width;
+ _height = Height;
- Game->AddMem(m_Width * m_Height * 4);
+ Game->AddMem(_width * _height * 4);
- m_Valid = true;
+ _valid = true;
#endif
return S_OK;
}
@@ -264,15 +264,15 @@ HRESULT CBSurfaceSDL::Create(int Width, int Height) {
HRESULT CBSurfaceSDL::CreateFromSDLSurface(SDL_Surface *surface) {
warning("CBSurfaceSDL::CreateFromSDLSurface not ported yet"); //TODO
#if 0
- CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->m_Renderer);
- m_Texture = SDL_CreateTextureFromSurface(renderer->GetSdlRenderer(), surface);
+ CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
+ _texture = SDL_CreateTextureFromSurface(renderer->GetSdlRenderer(), surface);
- m_Width = surface->w;
- m_Height = surface->h;
+ _width = surface->w;
+ _height = surface->h;
- Game->AddMem(m_Width * m_Height * 4);
+ Game->AddMem(_width * _height * 4);
- m_Valid = true;
+ _valid = true;
#endif
return S_OK;
}
@@ -282,7 +282,7 @@ bool CBSurfaceSDL::IsTransparentAt(int X, int Y) {
int access;
int width, height;
warning("CBSurfaceSDL::IsTransparentAt not ported yet");
- //SDL_QueryTexture(m_Texture, NULL, &access, &width, &height); //TODO
+ //SDL_QueryTexture(_texture, NULL, &access, &width, &height); //TODO
//if (access != SDL_TEXTUREACCESS_STREAMING) return false;
if (X < 0 || X >= width || Y < 0 || Y >= height) return true;
@@ -296,21 +296,21 @@ bool CBSurfaceSDL::IsTransparentAt(int X, int Y) {
//////////////////////////////////////////////////////////////////////////
bool CBSurfaceSDL::IsTransparentAtLite(int X, int Y) {
- //if (!m_LockPixels) return false;
+ //if (!_lockPixels) return false;
Uint32 format;
int access;
int width, height;
warning("CBSurfaceSDL::IsTransparentAtLite not ported yet");
- //SDL_QueryTexture(m_Texture, &format, &access, &width, &height);
+ //SDL_QueryTexture(_texture, &format, &access, &width, &height);
//if (access != SDL_TEXTUREACCESS_STREAMING) return false;
if (X < 0 || X >= width || Y < 0 || Y >= height) return true;
- if (!m_AlphaMask) return false;
- else return m_AlphaMask[Y * width + X] <= 128;
+ if (!_alphaMask) return false;
+ else return _alphaMask[Y * width + X] <= 128;
/*
- Uint32* dst = (Uint32*)((Uint8*)m_LockPixels + Y * m_LockPitch);
+ Uint32* dst = (Uint32*)((Uint8*)_lockPixels + Y * _lockPitch);
Uint32 pixel = dst[X];
SDL_PixelFormat* pixelFormat = SDL_AllocFormat(format);
@@ -324,13 +324,13 @@ bool CBSurfaceSDL::IsTransparentAtLite(int X, int Y) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceSDL::StartPixelOp() {
- //SDL_LockTexture(m_Texture, NULL, &m_LockPixels, &m_LockPitch);
+ //SDL_LockTexture(_texture, NULL, &_lockPixels, &_lockPitch);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceSDL::EndPixelOp() {
- //SDL_UnlockTexture(m_Texture);
+ //SDL_UnlockTexture(_texture);
return S_OK;
}
@@ -370,9 +370,9 @@ HRESULT CBSurfaceSDL::DisplayTransform(int X, int Y, int HotX, int HotY, RECT Re
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceSDL::DrawSprite(int X, int Y, RECT *Rect, float ZoomX, float ZoomY, uint32 Alpha, bool AlphaDisable, TSpriteBlendMode BlendMode, bool MirrorX, bool MirrorY, int offsetX, int offsetY) {
- CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->m_Renderer);
+ CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
- if (renderer->m_ForceAlphaColor != 0) Alpha = renderer->m_ForceAlphaColor;
+ if (renderer->_forceAlphaColor != 0) Alpha = renderer->_forceAlphaColor;
byte r = D3DCOLGetR(Alpha);
byte g = D3DCOLGetG(Alpha);
@@ -381,13 +381,13 @@ HRESULT CBSurfaceSDL::DrawSprite(int X, int Y, RECT *Rect, float ZoomX, float Zo
warning("CBSurfaceSDL::DrawSprite not ported yet"); // TODO.
#if 0
- SDL_SetTextureColorMod(m_Texture, r, g, b);
- SDL_SetTextureAlphaMod(m_Texture, a);
+ SDL_SetTextureColorMod(_texture, r, g, b);
+ SDL_SetTextureAlphaMod(_texture, a);
if (AlphaDisable)
- SDL_SetTextureBlendMode(m_Texture, SDL_BLENDMODE_NONE);
+ SDL_SetTextureBlendMode(_texture, SDL_BLENDMODE_NONE);
else
- SDL_SetTextureBlendMode(m_Texture, SDL_BLENDMODE_BLEND);
+ SDL_SetTextureBlendMode(_texture, SDL_BLENDMODE_BLEND);
SDL_Rect srcRect;
srcRect.x = Rect->left;
@@ -406,7 +406,7 @@ HRESULT CBSurfaceSDL::DrawSprite(int X, int Y, RECT *Rect, float ZoomX, float Zo
position.x += offsetX;
position.y += offsetY;
- SDL_RenderCopy(renderer->GetSdlRenderer(), m_Texture, &srcRect, &position);
+ SDL_RenderCopy(renderer->GetSdlRenderer(), _texture, &srcRect, &position);
#endif
return S_OK;
diff --git a/engines/wintermute/BSurfaceSDL.h b/engines/wintermute/BSurfaceSDL.h
index e32bec90b1..ae5fe154f6 100644
--- a/engines/wintermute/BSurfaceSDL.h
+++ b/engines/wintermute/BSurfaceSDL.h
@@ -63,15 +63,15 @@ public:
static long DLL_CALLCONV TellProc(fi_handle handle);*/
private:
- SDL_Texture *m_Texture;
+ SDL_Texture *_texture;
HRESULT DrawSprite(int X, int Y, RECT *Rect, float ZoomX, float ZoomY, uint32 Alpha, bool AlphaDisable, TSpriteBlendMode BlendMode, bool MirrorX, bool MirrorY, int offsetX = 0, int offsetY = 0);
void GenAlphaMask(SDL_Surface *surface);
uint32 GetPixel(SDL_Surface *surface, int x, int y);
- void *m_LockPixels;
- int m_LockPitch;
- byte *m_AlphaMask;
+ void *_lockPixels;
+ int _lockPitch;
+ byte *_alphaMask;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BSurfaceStorage.cpp b/engines/wintermute/BSurfaceStorage.cpp
index 45f70db8f6..a460ac83a6 100644
--- a/engines/wintermute/BSurfaceStorage.cpp
+++ b/engines/wintermute/BSurfaceStorage.cpp
@@ -40,7 +40,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBSurfaceStorage::CBSurfaceStorage(CBGame *inGame): CBBase(inGame) {
- m_LastCleanupTime = 0;
+ _lastCleanupTime = 0;
}
@@ -52,11 +52,11 @@ CBSurfaceStorage::~CBSurfaceStorage() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::Cleanup(bool Warn) {
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- if (Warn) Game->LOG(0, "CBSurfaceStorage warning: purging surface '%s', usage:%d", m_Surfaces[i]->m_Filename, m_Surfaces[i]->m_ReferenceCount);
- delete m_Surfaces[i];
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ if (Warn) Game->LOG(0, "CBSurfaceStorage warning: purging surface '%s', usage:%d", _surfaces[i]->_filename, _surfaces[i]->_referenceCount);
+ delete _surfaces[i];
}
- m_Surfaces.RemoveAll();
+ _surfaces.RemoveAll();
return S_OK;
}
@@ -64,15 +64,15 @@ HRESULT CBSurfaceStorage::Cleanup(bool Warn) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::InitLoop() {
- if (Game->m_SmartCache && Game->m_LiveTimer - m_LastCleanupTime >= Game->m_SurfaceGCCycleTime) {
- m_LastCleanupTime = Game->m_LiveTimer;
+ if (Game->_smartCache && Game->_liveTimer - _lastCleanupTime >= Game->_surfaceGCCycleTime) {
+ _lastCleanupTime = Game->_liveTimer;
SortSurfaces();
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- if (m_Surfaces[i]->m_LifeTime <= 0) break;
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ if (_surfaces[i]->_lifeTime <= 0) break;
- if (m_Surfaces[i]->m_LifeTime > 0 && m_Surfaces[i]->m_Valid && Game->m_LiveTimer - m_Surfaces[i]->m_LastUsedTime >= m_Surfaces[i]->m_LifeTime) {
- //Game->QuickMessageForm("Invalidating: %s", m_Surfaces[i]->m_Filename);
- m_Surfaces[i]->Invalidate();
+ if (_surfaces[i]->_lifeTime > 0 && _surfaces[i]->_valid && Game->_liveTimer - _surfaces[i]->_lastUsedTime >= _surfaces[i]->_lifeTime) {
+ //Game->QuickMessageForm("Invalidating: %s", _surfaces[i]->_filename);
+ _surfaces[i]->Invalidate();
}
}
}
@@ -82,12 +82,12 @@ HRESULT CBSurfaceStorage::InitLoop() {
//////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::RemoveSurface(CBSurface *surface) {
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- if (m_Surfaces[i] == surface) {
- m_Surfaces[i]->m_ReferenceCount--;
- if (m_Surfaces[i]->m_ReferenceCount <= 0) {
- delete m_Surfaces[i];
- m_Surfaces.RemoveAt(i);
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ if (_surfaces[i] == surface) {
+ _surfaces[i]->_referenceCount--;
+ if (_surfaces[i]->_referenceCount <= 0) {
+ delete _surfaces[i];
+ _surfaces.RemoveAt(i);
}
break;
}
@@ -98,21 +98,21 @@ HRESULT CBSurfaceStorage::RemoveSurface(CBSurface *surface) {
//////////////////////////////////////////////////////////////////////
CBSurface *CBSurfaceStorage::AddSurface(char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- if (scumm_stricmp(m_Surfaces[i]->m_Filename, Filename) == 0) {
- m_Surfaces[i]->m_ReferenceCount++;
- return m_Surfaces[i];
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ if (scumm_stricmp(_surfaces[i]->_filename, Filename) == 0) {
+ _surfaces[i]->_referenceCount++;
+ return _surfaces[i];
}
}
- CBFile *File = Game->m_FileManager->OpenFile(Filename);
+ CBFile *File = Game->_fileManager->OpenFile(Filename);
if (!File) {
if (Filename) Game->LOG(0, "Missing image: '%s'", Filename);
- if (Game->m_DEBUG_DebugMode)
+ if (Game->_dEBUG_DebugMode)
return AddSurface("invalid_debug.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
else
return AddSurface("invalid.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
- } else Game->m_FileManager->CloseFile(File);
+ } else Game->_fileManager->CloseFile(File);
CBSurface *surface;
@@ -125,8 +125,8 @@ CBSurface *CBSurfaceStorage::AddSurface(char *Filename, bool default_ck, byte ck
delete surface;
return NULL;
} else {
- surface->m_ReferenceCount = 1;
- m_Surfaces.Add(surface);
+ surface->_referenceCount = 1;
+ _surfaces.Add(surface);
return surface;
}
}
@@ -135,8 +135,8 @@ CBSurface *CBSurfaceStorage::AddSurface(char *Filename, bool default_ck, byte ck
//////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::RestoreAll() {
HRESULT ret;
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- ret = m_Surfaces[i]->Restore();
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ ret = _surfaces[i]->Restore();
if (ret != S_OK) {
Game->LOG(0, "CBSurfaceStorage::RestoreAll failed");
return ret;
@@ -151,11 +151,11 @@ HRESULT CBSurfaceStorage::RestoreAll() {
HRESULT CBSurfaceStorage::Persist(CBPersistMgr *PersistMgr)
{
- if(!PersistMgr->m_Saving) Cleanup(false);
+ if(!PersistMgr->_saving) Cleanup(false);
PersistMgr->Transfer(TMEMBER(Game));
- //m_Surfaces.Persist(PersistMgr);
+ //_surfaces.Persist(PersistMgr);
return S_OK;
}
@@ -164,7 +164,7 @@ HRESULT CBSurfaceStorage::Persist(CBPersistMgr *PersistMgr)
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::SortSurfaces() {
- qsort(m_Surfaces.GetData(), m_Surfaces.GetSize(), sizeof(CBSurface *), SurfaceSortCB);
+ qsort(_surfaces.GetData(), _surfaces.GetSize(), sizeof(CBSurface *), SurfaceSortCB);
return S_OK;
}
@@ -175,17 +175,17 @@ int CBSurfaceStorage::SurfaceSortCB(const void *arg1, const void *arg2) {
CBSurface *s2 = *((CBSurface **)arg2);
// sort by life time
- if (s1->m_LifeTime <= 0 && s2->m_LifeTime > 0) return 1;
- else if (s1->m_LifeTime > 0 && s2->m_LifeTime <= 0) return -1;
+ if (s1->_lifeTime <= 0 && s2->_lifeTime > 0) return 1;
+ else if (s1->_lifeTime > 0 && s2->_lifeTime <= 0) return -1;
// sort by validity
- if (s1->m_Valid && !s2->m_Valid) return -1;
- else if (!s1->m_Valid && s2->m_Valid) return 1;
+ if (s1->_valid && !s2->_valid) return -1;
+ else if (!s1->_valid && s2->_valid) return 1;
// sort by time
- else if (s1->m_LastUsedTime > s2->m_LastUsedTime) return 1;
- else if (s1->m_LastUsedTime < s2->m_LastUsedTime) return -1;
+ else if (s1->_lastUsedTime > s2->_lastUsedTime) return 1;
+ else if (s1->_lastUsedTime < s2->_lastUsedTime) return -1;
else return 0;
}
diff --git a/engines/wintermute/BSurfaceStorage.h b/engines/wintermute/BSurfaceStorage.h
index 5ebfe3c7d7..275c36b4a9 100644
--- a/engines/wintermute/BSurfaceStorage.h
+++ b/engines/wintermute/BSurfaceStorage.h
@@ -37,7 +37,7 @@ namespace WinterMute {
class CBSurface;
class CBSurfaceStorage : public CBBase {
public:
- uint32 m_LastCleanupTime;
+ uint32 _lastCleanupTime;
HRESULT InitLoop();
HRESULT SortSurfaces();
static int SurfaceSortCB(const void *arg1, const void *arg2);
@@ -50,7 +50,7 @@ public:
CBSurfaceStorage(CBGame *inGame);
virtual ~CBSurfaceStorage();
- CBArray<CBSurface *, CBSurface *> m_Surfaces;
+ CBArray<CBSurface *, CBSurface *> _surfaces;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BTransitionMgr.cpp b/engines/wintermute/BTransitionMgr.cpp
index 78fd43c545..1d71fb656d 100644
--- a/engines/wintermute/BTransitionMgr.cpp
+++ b/engines/wintermute/BTransitionMgr.cpp
@@ -35,12 +35,12 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CBTransitionMgr::CBTransitionMgr(CBGame *inGame): CBBase(inGame) {
- m_State = TRANS_MGR_READY;
- m_Type = TRANSITION_NONE;
- m_OrigInteractive = false;
- m_PreserveInteractive = false;
- m_LastTime = 0;
- m_Started = false;
+ _state = TRANS_MGR_READY;
+ _type = TRANSITION_NONE;
+ _origInteractive = false;
+ _preserveInteractive = false;
+ _lastTime = 0;
+ _started = false;
}
@@ -53,28 +53,28 @@ CBTransitionMgr::~CBTransitionMgr() {
//////////////////////////////////////////////////////////////////////////
bool CBTransitionMgr::IsReady() {
- return (m_State == TRANS_MGR_READY);
+ return (_state == TRANS_MGR_READY);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBTransitionMgr::Start(TTransitionType Type, bool NonInteractive) {
- if (m_State != TRANS_MGR_READY) return S_OK;
+ if (_state != TRANS_MGR_READY) return S_OK;
if (Type == TRANSITION_NONE || Type >= NUM_TRANSITION_TYPES) {
- m_State = TRANS_MGR_READY;
+ _state = TRANS_MGR_READY;
return S_OK;
}
if (NonInteractive) {
- m_PreserveInteractive = true;
- m_OrigInteractive = Game->m_Interactive;
- Game->m_Interactive = false;
- } else m_PreserveInteractive;
+ _preserveInteractive = true;
+ _origInteractive = Game->_interactive;
+ Game->_interactive = false;
+ } else _preserveInteractive;
- m_Type = Type;
- m_State = TRANS_MGR_RUNNING;
- m_Started = false;
+ _type = Type;
+ _state = TRANS_MGR_RUNNING;
+ _started = false;
return S_OK;
}
@@ -85,40 +85,40 @@ HRESULT CBTransitionMgr::Start(TTransitionType Type, bool NonInteractive) {
HRESULT CBTransitionMgr::Update() {
if (IsReady()) return S_OK;
- if (!m_Started) {
- m_Started = true;
- m_LastTime = CBPlatform::GetTime();
+ if (!_started) {
+ _started = true;
+ _lastTime = CBPlatform::GetTime();
}
- switch (m_Type) {
+ switch (_type) {
case TRANSITION_NONE:
- m_State = TRANS_MGR_READY;
+ _state = TRANS_MGR_READY;
break;
case TRANSITION_FADE_OUT: {
- uint32 time = CBPlatform::GetTime() - m_LastTime;
+ uint32 time = CBPlatform::GetTime() - _lastTime;
int Alpha = 255 - (float)time / (float)FADE_DURATION * 255;
Alpha = MIN(255, MAX(Alpha, 0));
- Game->m_Renderer->Fade((WORD)Alpha);
+ Game->_renderer->Fade((WORD)Alpha);
- if (time > FADE_DURATION) m_State = TRANS_MGR_READY;
+ if (time > FADE_DURATION) _state = TRANS_MGR_READY;
}
break;
case TRANSITION_FADE_IN: {
- uint32 time = CBPlatform::GetTime() - m_LastTime;
+ uint32 time = CBPlatform::GetTime() - _lastTime;
int Alpha = (float)time / (float)FADE_DURATION * 255;
Alpha = MIN(255, MAX(Alpha, 0));
- Game->m_Renderer->Fade((WORD)Alpha);
+ Game->_renderer->Fade((WORD)Alpha);
- if (time > FADE_DURATION) m_State = TRANS_MGR_READY;
+ if (time > FADE_DURATION) _state = TRANS_MGR_READY;
}
break;
}
if (IsReady()) {
- if (m_PreserveInteractive) Game->m_Interactive = m_OrigInteractive;
+ if (_preserveInteractive) Game->_interactive = _origInteractive;
}
return S_OK;
}
diff --git a/engines/wintermute/BTransitionMgr.h b/engines/wintermute/BTransitionMgr.h
index 6bcf3ea89b..a0d9afebc8 100644
--- a/engines/wintermute/BTransitionMgr.h
+++ b/engines/wintermute/BTransitionMgr.h
@@ -35,17 +35,17 @@ namespace WinterMute {
class CBTransitionMgr : public CBBase {
public:
- bool m_Started;
- uint32 m_LastTime;
- bool m_OrigInteractive;
- bool m_PreserveInteractive;
+ bool _started;
+ uint32 _lastTime;
+ bool _origInteractive;
+ bool _preserveInteractive;
HRESULT Update();
HRESULT Start(TTransitionType Type, bool NonInteractive = false);
bool IsReady();
- TTransMgrState m_State;
+ TTransMgrState _state;
CBTransitionMgr(CBGame *inGame);
virtual ~CBTransitionMgr();
- TTransitionType m_Type;
+ TTransitionType _type;
};
diff --git a/engines/wintermute/BViewport.cpp b/engines/wintermute/BViewport.cpp
index 57cb1bc02f..718f98c939 100644
--- a/engines/wintermute/BViewport.cpp
+++ b/engines/wintermute/BViewport.cpp
@@ -36,9 +36,9 @@ IMPLEMENT_PERSISTENT(CBViewport, false)
//////////////////////////////////////////////////////////////////////////
CBViewport::CBViewport(CBGame *inGame): CBBase(inGame) {
- CBPlatform::SetRectEmpty(&m_Rect);
- m_MainObject = NULL;
- m_OffsetX = m_OffsetY = 0;
+ CBPlatform::SetRectEmpty(&_rect);
+ _mainObject = NULL;
+ _offsetX = _offsetY = 0;
}
@@ -53,10 +53,10 @@ HRESULT CBViewport::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_MainObject));
- PersistMgr->Transfer(TMEMBER(m_OffsetX));
- PersistMgr->Transfer(TMEMBER(m_OffsetY));
- PersistMgr->Transfer(TMEMBER(m_Rect));
+ PersistMgr->Transfer(TMEMBER(_mainObject));
+ PersistMgr->Transfer(TMEMBER(_offsetX));
+ PersistMgr->Transfer(TMEMBER(_offsetY));
+ PersistMgr->Transfer(TMEMBER(_rect));
return S_OK;
}
@@ -67,32 +67,32 @@ HRESULT CBViewport::SetRect(int left, int top, int right, int bottom, bool NoChe
if (!NoCheck) {
left = MAX(left, 0);
top = MAX(top, 0);
- right = MIN(right, Game->m_Renderer->m_Width);
- bottom = MIN(bottom, Game->m_Renderer->m_Height);
+ right = MIN(right, Game->_renderer->_width);
+ bottom = MIN(bottom, Game->_renderer->_height);
}
- CBPlatform::SetRect(&m_Rect, left, top, right, bottom);
- m_OffsetX = left;
- m_OffsetY = top;
+ CBPlatform::SetRect(&_rect, left, top, right, bottom);
+ _offsetX = left;
+ _offsetY = top;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
RECT *CBViewport::GetRect() {
- return &m_Rect;
+ return &_rect;
}
//////////////////////////////////////////////////////////////////////////
int CBViewport::GetWidth() {
- return m_Rect.right - m_Rect.left;
+ return _rect.right - _rect.left;
}
//////////////////////////////////////////////////////////////////////////
int CBViewport::GetHeight() {
- return m_Rect.bottom - m_Rect.top;
+ return _rect.bottom - _rect.top;
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/BViewport.h b/engines/wintermute/BViewport.h
index 06a5a1952f..7c90b568fb 100644
--- a/engines/wintermute/BViewport.h
+++ b/engines/wintermute/BViewport.h
@@ -41,13 +41,13 @@ public:
RECT *GetRect();
HRESULT SetRect(int left, int top, int right, int bottom, bool NoCheck = false);
DECLARE_PERSISTENT(CBViewport, CBBase)
- int m_OffsetY;
- int m_OffsetX;
- CBObject *m_MainObject;
+ int _offsetY;
+ int _offsetX;
+ CBObject *_mainObject;
CBViewport(CBGame *inGame = NULL);
virtual ~CBViewport();
private:
- RECT m_Rect;
+ RECT _rect;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/FontGlyphCache.cpp b/engines/wintermute/FontGlyphCache.cpp
index 04c7095dd1..d161c749cf 100644
--- a/engines/wintermute/FontGlyphCache.cpp
+++ b/engines/wintermute/FontGlyphCache.cpp
@@ -35,7 +35,7 @@ FontGlyphCache::FontGlyphCache() {
FontGlyphCache::~FontGlyphCache() {
GlyphInfoMap::iterator it;
- for (it = m_Glyphs.begin(); it != m_Glyphs.end(); ++it) {
+ for (it = _glyphs.begin(); it != _glyphs.end(); ++it) {
delete it->_value;
it->_value = NULL;
}
@@ -43,7 +43,7 @@ FontGlyphCache::~FontGlyphCache() {
//////////////////////////////////////////////////////////////////////////
bool FontGlyphCache::HasGlyph(wchar_t ch) {
- return (m_Glyphs.find(ch) != m_Glyphs.end());
+ return (_glyphs.find(ch) != _glyphs.end());
}
//////////////////////////////////////////////////////////////////////////
@@ -53,8 +53,8 @@ void FontGlyphCache::Initialize() {
//////////////////////////////////////////////////////////////////////////
GlyphInfo *FontGlyphCache::GetGlyph(wchar_t ch) {
GlyphInfoMap::const_iterator it;
- it = m_Glyphs.find(ch);
- if (it == m_Glyphs.end()) return NULL;
+ it = _glyphs.find(ch);
+ if (it == _glyphs.end()) return NULL;
return it->_value;
}
@@ -63,34 +63,34 @@ GlyphInfo *FontGlyphCache::GetGlyph(wchar_t ch) {
void FontGlyphCache::AddGlyph(wchar_t ch, int glyphIndex, FT_GlyphSlot glyphSlot, size_t width, size_t height, byte *pixels, size_t stride) {
if (stride == 0) stride = width;
- m_Glyphs[ch] = new GlyphInfo(glyphIndex);
- m_Glyphs[ch]->SetGlyphInfo(glyphSlot->advance.x / 64.f, glyphSlot->advance.y / 64.f, glyphSlot->bitmap_left, glyphSlot->bitmap_top);
- m_Glyphs[ch]->SetGlyphImage(width, height, stride, pixels);
+ _glyphs[ch] = new GlyphInfo(glyphIndex);
+ _glyphs[ch]->SetGlyphInfo(glyphSlot->advance.x / 64.f, glyphSlot->advance.y / 64.f, glyphSlot->bitmap_left, glyphSlot->bitmap_top);
+ _glyphs[ch]->SetGlyphImage(width, height, stride, pixels);
}
//////////////////////////////////////////////////////////////////////////
void GlyphInfo::SetGlyphImage(size_t width, size_t height, size_t stride, byte *pixels) {
- if (m_Image) SDL_FreeSurface(m_Image);
+ if (_image) SDL_FreeSurface(_image);
- m_Image = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
- SDL_LockSurface(m_Image);
+ _image = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
+ SDL_LockSurface(_image);
- Uint8 *buf = (Uint8 *)m_Image->pixels;
+ Uint8 *buf = (Uint8 *)_image->pixels;
for (int y = 0; y < height; y++) {
Uint32 *buf32 = (Uint32 *)buf;
for (int x = 0; x < width; x++) {
byte alpha = pixels[y * stride + x];
- Uint32 color = SDL_MapRGBA(m_Image->format, 255, 255, 255, alpha);
+ Uint32 color = SDL_MapRGBA(_image->format, 255, 255, 255, alpha);
buf32[x] = color;
}
- buf += m_Image->pitch;
+ buf += _image->pitch;
}
- SDL_UnlockSurface(m_Image);
+ SDL_UnlockSurface(_image);
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/FontGlyphCache.h b/engines/wintermute/FontGlyphCache.h
index c30e0f92b8..6800ec996b 100644
--- a/engines/wintermute/FontGlyphCache.h
+++ b/engines/wintermute/FontGlyphCache.h
@@ -36,65 +36,65 @@ namespace WinterMute {
class GlyphInfo {
public:
GlyphInfo(int glyphIndex) {
- m_GlyphIndex = glyphIndex;
- m_AdvanceX = m_AdvanceY = 0;
- m_BearingX = m_BearingY = 0;
+ _glyphIndex = glyphIndex;
+ _advanceX = _advanceY = 0;
+ _bearingX = _bearingY = 0;
- m_Width = m_Height = 0;
+ _width = _height = 0;
- m_Image = NULL;
+ _image = NULL;
}
~GlyphInfo() {
- if (m_Image) SDL_FreeSurface(m_Image);
+ if (_image) SDL_FreeSurface(_image);
}
void SetGlyphInfo(float AdvanceX, float AdvanceY, int BearingX, int BearingY) {
- m_AdvanceX = AdvanceX;
- m_AdvanceY = AdvanceY;
- m_BearingX = BearingX;
- m_BearingY = BearingY;
+ _advanceX = AdvanceX;
+ _advanceY = AdvanceY;
+ _bearingX = BearingX;
+ _bearingY = BearingY;
}
void SetGlyphImage(size_t width, size_t height, size_t stride, byte *pixels);
int GetGlyphIndex() {
- return m_GlyphIndex;
+ return _glyphIndex;
}
int GetWidth() {
- return m_Width;
+ return _width;
}
int GetHeight() {
- return m_Height;
+ return _height;
}
float GetAdvanceX() {
- return m_AdvanceX;
+ return _advanceX;
}
float GetAdvanceY() {
- return m_AdvanceY;
+ return _advanceY;
}
int GetBearingX() {
- return m_BearingX;
+ return _bearingX;
}
int GetBearingY() {
- return m_BearingY;
+ return _bearingY;
}
SDL_Surface *GetImage() {
- return m_Image;
+ return _image;
}
private:
- int m_GlyphIndex;
+ int _glyphIndex;
- float m_AdvanceX;
- float m_AdvanceY;
- int m_BearingX;
- int m_BearingY;
+ float _advanceX;
+ float _advanceY;
+ int _bearingX;
+ int _bearingY;
- int m_Width;
- int m_Height;
+ int _width;
+ int _height;
- SDL_Surface *m_Image;
+ SDL_Surface *_image;
};
@@ -113,7 +113,7 @@ public:
private:
//typedef Common::HashMap<wchar_t, GlyphInfo *> GlyphInfoMap;
typedef Common::HashMap<char, GlyphInfo *> GlyphInfoMap; // TODO
- GlyphInfoMap m_Glyphs;
+ GlyphInfoMap _glyphs;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/PartEmitter.cpp b/engines/wintermute/PartEmitter.cpp
index 0e8f7ee1b7..6adfd4bbec 100644
--- a/engines/wintermute/PartEmitter.cpp
+++ b/engines/wintermute/PartEmitter.cpp
@@ -42,72 +42,72 @@ IMPLEMENT_PERSISTENT(CPartEmitter, false)
//////////////////////////////////////////////////////////////////////////
CPartEmitter::CPartEmitter(CBGame *inGame, CBScriptHolder *Owner) : CBObject(inGame) {
- m_Width = m_Height = 0;
+ _width = _height = 0;
- CBPlatform::SetRectEmpty(&m_Border);
- m_BorderThicknessLeft = m_BorderThicknessRight = m_BorderThicknessTop = m_BorderThicknessBottom = 0;
+ CBPlatform::SetRectEmpty(&_border);
+ _borderThicknessLeft = _borderThicknessRight = _borderThicknessTop = _borderThicknessBottom = 0;
- m_Angle1 = m_Angle2 = 0;
+ _angle1 = _angle2 = 0;
- m_Velocity1 = m_Velocity2 = 0.0f;
- m_VelocityZBased = false;
+ _velocity1 = _velocity2 = 0.0f;
+ _velocityZBased = false;
- m_Scale1 = m_Scale2 = 100.0f;
- m_ScaleZBased = false;
+ _scale1 = _scale2 = 100.0f;
+ _scaleZBased = false;
- m_MaxParticles = 100;
+ _maxParticles = 100;
- m_LifeTime1 = m_LifeTime2 = 1000;
- m_LifeTimeZBased = false;
+ _lifeTime1 = _lifeTime2 = 1000;
+ _lifeTimeZBased = false;
- m_LastGenTime = 0;
- m_GenInterval = 0;
- m_GenAmount = 1;
+ _lastGenTime = 0;
+ _genInterval = 0;
+ _genAmount = 1;
- m_OverheadTime = 0;
- m_Running = false;
+ _overheadTime = 0;
+ _running = false;
- m_MaxBatches = 0;
- m_BatchesGenerated = 0;
+ _maxBatches = 0;
+ _batchesGenerated = 0;
- m_FadeInTime = m_FadeOutTime = 0;
+ _fadeInTime = _fadeOutTime = 0;
- m_Alpha1 = m_Alpha2 = 255;
- m_AlphaTimeBased = false;
+ _alpha1 = _alpha2 = 255;
+ _alphaTimeBased = false;
- m_Rotation1 = m_Rotation2 = 0.0f;
- m_AngVelocity1 = m_AngVelocity2 = 0.0f;
+ _rotation1 = _rotation2 = 0.0f;
+ _angVelocity1 = _angVelocity2 = 0.0f;
- m_GrowthRate1 = m_GrowthRate2 = 0.0f;
- m_ExponentialGrowth = false;
+ _growthRate1 = _growthRate2 = 0.0f;
+ _exponentialGrowth = false;
- m_UseRegion = false;
+ _useRegion = false;
- m_EmitEvent = NULL;
- m_Owner = Owner;
+ _emitEvent = NULL;
+ _owner = Owner;
}
//////////////////////////////////////////////////////////////////////////
CPartEmitter::~CPartEmitter(void) {
- for (int i = 0; i < m_Particles.GetSize(); i++) {
- delete m_Particles[i];
+ for (int i = 0; i < _particles.GetSize(); i++) {
+ delete _particles[i];
}
- m_Particles.RemoveAll();
+ _particles.RemoveAll();
- for (int i = 0; i < m_Forces.GetSize(); i++) {
- delete m_Forces[i];
+ for (int i = 0; i < _forces.GetSize(); i++) {
+ delete _forces[i];
}
- m_Forces.RemoveAll();
+ _forces.RemoveAll();
- for (int i = 0; i < m_Sprites.GetSize(); i++) {
- delete [] m_Sprites[i];
+ for (int i = 0; i < _sprites.GetSize(); i++) {
+ delete [] _sprites[i];
}
- m_Sprites.RemoveAll();
+ _sprites.RemoveAll();
- delete[] m_EmitEvent;
- m_EmitEvent = NULL;
+ delete[] _emitEvent;
+ _emitEvent = NULL;
}
//////////////////////////////////////////////////////////////////////////
@@ -115,30 +115,30 @@ HRESULT CPartEmitter::AddSprite(char *Filename) {
if (!Filename) return E_FAIL;
// do we already have the file?
- for (int i = 0; i < m_Sprites.GetSize(); i++) {
- if (scumm_stricmp(Filename, m_Sprites[i]) == 0) return S_OK;
+ for (int i = 0; i < _sprites.GetSize(); i++) {
+ if (scumm_stricmp(Filename, _sprites[i]) == 0) return S_OK;
}
// check if file exists
- CBFile *File = Game->m_FileManager->OpenFile(Filename);
+ CBFile *File = Game->_fileManager->OpenFile(Filename);
if (!File) {
Game->LOG(0, "Sprite '%s' not found", Filename);
return E_FAIL;
- } else Game->m_FileManager->CloseFile(File);
+ } else Game->_fileManager->CloseFile(File);
char *Str = new char[strlen(Filename) + 1];
strcpy(Str, Filename);
- m_Sprites.Add(Str);
+ _sprites.Add(Str);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::RemoveSprite(char *Filename) {
- for (int i = 0; i < m_Sprites.GetSize(); i++) {
- if (scumm_stricmp(Filename, m_Sprites[i]) == 0) {
- delete [] m_Sprites[i];
- m_Sprites.RemoveAt(i);
+ for (int i = 0; i < _sprites.GetSize(); i++) {
+ if (scumm_stricmp(Filename, _sprites[i]) == 0) {
+ delete [] _sprites[i];
+ _sprites.RemoveAt(i);
return S_OK;
}
}
@@ -148,42 +148,42 @@ HRESULT CPartEmitter::RemoveSprite(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::InitParticle(CPartParticle *Particle, uint32 CurrentTime, uint32 TimerDelta) {
if (!Particle) return E_FAIL;
- if (m_Sprites.GetSize() == 0) return E_FAIL;
+ if (_sprites.GetSize() == 0) return E_FAIL;
- int PosX = CBUtils::RandomInt(m_PosX, m_PosX + m_Width);
- int PosY = CBUtils::RandomInt(m_PosY, m_PosY + m_Height);
+ int PosX = CBUtils::RandomInt(_posX, _posX + _width);
+ int PosY = CBUtils::RandomInt(_posY, _posY + _height);
float PosZ = CBUtils::RandomFloat(0.0f, 100.0f);
float Velocity;
- if (m_VelocityZBased) Velocity = m_Velocity1 + PosZ * (m_Velocity2 - m_Velocity1) / 100;
- else Velocity = CBUtils::RandomFloat(m_Velocity1, m_Velocity2);
+ if (_velocityZBased) Velocity = _velocity1 + PosZ * (_velocity2 - _velocity1) / 100;
+ else Velocity = CBUtils::RandomFloat(_velocity1, _velocity2);
float Scale;
- if (m_ScaleZBased) Scale = m_Scale1 + PosZ * (m_Scale2 - m_Scale1) / 100;
- else Scale = CBUtils::RandomFloat(m_Scale1, m_Scale2);
+ if (_scaleZBased) Scale = _scale1 + PosZ * (_scale2 - _scale1) / 100;
+ else Scale = CBUtils::RandomFloat(_scale1, _scale2);
int LifeTime;
- if (m_LifeTimeZBased) LifeTime = m_LifeTime2 - PosZ * (m_LifeTime2 - m_LifeTime1) / 100;
- else LifeTime = CBUtils::RandomInt(m_LifeTime1, m_LifeTime2);
+ if (_lifeTimeZBased) LifeTime = _lifeTime2 - PosZ * (_lifeTime2 - _lifeTime1) / 100;
+ else LifeTime = CBUtils::RandomInt(_lifeTime1, _lifeTime2);
- float Angle = CBUtils::RandomAngle(m_Angle1, m_Angle2);
- int SpriteIndex = CBUtils::RandomInt(0, m_Sprites.GetSize() - 1);
+ float Angle = CBUtils::RandomAngle(_angle1, _angle2);
+ int SpriteIndex = CBUtils::RandomInt(0, _sprites.GetSize() - 1);
- float Rotation = CBUtils::RandomAngle(m_Rotation1, m_Rotation2);
- float AngVelocity = CBUtils::RandomFloat(m_AngVelocity1, m_AngVelocity2);
- float GrowthRate = CBUtils::RandomFloat(m_GrowthRate1, m_GrowthRate2);
+ float Rotation = CBUtils::RandomAngle(_rotation1, _rotation2);
+ float AngVelocity = CBUtils::RandomFloat(_angVelocity1, _angVelocity2);
+ float GrowthRate = CBUtils::RandomFloat(_growthRate1, _growthRate2);
- if (!CBPlatform::IsRectEmpty(&m_Border)) {
- int ThicknessLeft = m_BorderThicknessLeft - (float)m_BorderThicknessLeft * PosZ / 100.0f;
- int ThicknessRight = m_BorderThicknessRight - (float)m_BorderThicknessRight * PosZ / 100.0f;
- int ThicknessTop = m_BorderThicknessTop - (float)m_BorderThicknessTop * PosZ / 100.0f;
- int ThicknessBottom = m_BorderThicknessBottom - (float)m_BorderThicknessBottom * PosZ / 100.0f;
+ if (!CBPlatform::IsRectEmpty(&_border)) {
+ int ThicknessLeft = _borderThicknessLeft - (float)_borderThicknessLeft * PosZ / 100.0f;
+ int ThicknessRight = _borderThicknessRight - (float)_borderThicknessRight * PosZ / 100.0f;
+ int ThicknessTop = _borderThicknessTop - (float)_borderThicknessTop * PosZ / 100.0f;
+ int ThicknessBottom = _borderThicknessBottom - (float)_borderThicknessBottom * PosZ / 100.0f;
- Particle->m_Border = m_Border;
- Particle->m_Border.left += ThicknessLeft;
- Particle->m_Border.right -= ThicknessRight;
- Particle->m_Border.top += ThicknessTop;
- Particle->m_Border.bottom -= ThicknessBottom;
+ Particle->_border = _border;
+ Particle->_border.left += ThicknessLeft;
+ Particle->_border.right -= ThicknessRight;
+ Particle->_border.top += ThicknessTop;
+ Particle->_border.bottom -= ThicknessBottom;
}
Vector2 VecPos((float)PosX, (float)PosY);
@@ -193,76 +193,76 @@ HRESULT CPartEmitter::InitParticle(CPartParticle *Particle, uint32 CurrentTime,
MatRot.RotationZ(DegToRad(CBUtils::NormalizeAngle(Angle - 180)));
MatRot.TransformVector2(VecVel);
- if (m_AlphaTimeBased) {
- Particle->m_Alpha1 = m_Alpha1;
- Particle->m_Alpha2 = m_Alpha2;
+ if (_alphaTimeBased) {
+ Particle->_alpha1 = _alpha1;
+ Particle->_alpha2 = _alpha2;
} else {
- int Alpha = CBUtils::RandomInt(m_Alpha1, m_Alpha2);
- Particle->m_Alpha1 = Alpha;
- Particle->m_Alpha2 = Alpha;
- }
-
- Particle->m_CreationTime = CurrentTime;
- Particle->m_Pos = VecPos;
- Particle->m_PosZ = PosZ;
- Particle->m_Velocity = VecVel;
- Particle->m_Scale = Scale;
- Particle->m_LifeTime = LifeTime;
- Particle->m_Rotation = Rotation;
- Particle->m_AngVelocity = AngVelocity;
- Particle->m_GrowthRate = GrowthRate;
- Particle->m_ExponentialGrowth = m_ExponentialGrowth;
- Particle->m_IsDead = FAILED(Particle->SetSprite(m_Sprites[SpriteIndex]));
- Particle->FadeIn(CurrentTime, m_FadeInTime);
-
-
- if (Particle->m_IsDead) return E_FAIL;
+ int Alpha = CBUtils::RandomInt(_alpha1, _alpha2);
+ Particle->_alpha1 = Alpha;
+ Particle->_alpha2 = Alpha;
+ }
+
+ Particle->_creationTime = CurrentTime;
+ Particle->_pos = VecPos;
+ Particle->_posZ = PosZ;
+ Particle->_velocity = VecVel;
+ Particle->_scale = Scale;
+ Particle->_lifeTime = LifeTime;
+ Particle->_rotation = Rotation;
+ Particle->_angVelocity = AngVelocity;
+ Particle->_growthRate = GrowthRate;
+ Particle->_exponentialGrowth = _exponentialGrowth;
+ Particle->_isDead = FAILED(Particle->SetSprite(_sprites[SpriteIndex]));
+ Particle->FadeIn(CurrentTime, _fadeInTime);
+
+
+ if (Particle->_isDead) return E_FAIL;
else return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::Update() {
- if (!m_Running) return S_OK;
- else return UpdateInternal(Game->m_Timer, Game->m_TimerDelta);
+ if (!_running) return S_OK;
+ else return UpdateInternal(Game->_timer, Game->_timerDelta);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::UpdateInternal(uint32 CurrentTime, uint32 TimerDelta) {
int NumLive = 0;
- for (int i = 0; i < m_Particles.GetSize(); i++) {
- m_Particles[i]->Update(this, CurrentTime, TimerDelta);
+ for (int i = 0; i < _particles.GetSize(); i++) {
+ _particles[i]->Update(this, CurrentTime, TimerDelta);
- if (!m_Particles[i]->m_IsDead) NumLive++;
+ if (!_particles[i]->_isDead) NumLive++;
}
// we're understaffed
- if (NumLive < m_MaxParticles) {
+ if (NumLive < _maxParticles) {
bool NeedsSort = false;
- if (CurrentTime - m_LastGenTime > m_GenInterval) {
- m_LastGenTime = CurrentTime;
- m_BatchesGenerated++;
+ if (CurrentTime - _lastGenTime > _genInterval) {
+ _lastGenTime = CurrentTime;
+ _batchesGenerated++;
- if (m_MaxBatches > 0 && m_BatchesGenerated > m_MaxBatches) {
+ if (_maxBatches > 0 && _batchesGenerated > _maxBatches) {
return S_OK;
}
- int ToGen = std::min(m_GenAmount, m_MaxParticles - NumLive);
+ int ToGen = std::min(_genAmount, _maxParticles - NumLive);
while (ToGen > 0) {
int FirstDeadIndex = -1;
- for (int i = 0; i < m_Particles.GetSize(); i++) {
- if (m_Particles[i]->m_IsDead) {
+ for (int i = 0; i < _particles.GetSize(); i++) {
+ if (_particles[i]->_isDead) {
FirstDeadIndex = i;
break;
}
}
CPartParticle *Particle;
- if (FirstDeadIndex >= 0) Particle = m_Particles[FirstDeadIndex];
+ if (FirstDeadIndex >= 0) Particle = _particles[FirstDeadIndex];
else {
Particle = new CPartParticle(Game);
- m_Particles.Add(Particle);
+ _particles.Add(Particle);
}
InitParticle(Particle, CurrentTime, TimerDelta);
NeedsSort = true;
@@ -270,12 +270,12 @@ HRESULT CPartEmitter::UpdateInternal(uint32 CurrentTime, uint32 TimerDelta) {
ToGen--;
}
}
- if (NeedsSort && (m_ScaleZBased || m_VelocityZBased || m_LifeTimeZBased))
+ if (NeedsSort && (_scaleZBased || _velocityZBased || _lifeTimeZBased))
SortParticlesByZ();
// we actually generated some particles and we're not in fast-forward mode
- if (NeedsSort && m_OverheadTime == 0) {
- if (m_Owner && m_EmitEvent) m_Owner->ApplyEvent(m_EmitEvent);
+ if (NeedsSort && _overheadTime == 0) {
+ if (_owner && _emitEvent) _owner->ApplyEvent(_emitEvent);
}
}
@@ -284,40 +284,40 @@ HRESULT CPartEmitter::UpdateInternal(uint32 CurrentTime, uint32 TimerDelta) {
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::Display(CBRegion *Region) {
- if (m_Sprites.GetSize() <= 1) Game->m_Renderer->StartSpriteBatch();
+ if (_sprites.GetSize() <= 1) Game->_renderer->StartSpriteBatch();
- for (int i = 0; i < m_Particles.GetSize(); i++) {
- if (Region != NULL && m_UseRegion) {
- if (!Region->PointInRegion(m_Particles[i]->m_Pos.x, m_Particles[i]->m_Pos.y)) continue;
+ for (int i = 0; i < _particles.GetSize(); i++) {
+ if (Region != NULL && _useRegion) {
+ if (!Region->PointInRegion(_particles[i]->_pos.x, _particles[i]->_pos.y)) continue;
}
- m_Particles[i]->Display(this);
+ _particles[i]->Display(this);
}
- if (m_Sprites.GetSize() <= 1) Game->m_Renderer->EndSpriteBatch();
+ if (_sprites.GetSize() <= 1) Game->_renderer->EndSpriteBatch();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::Start() {
- for (int i = 0; i < m_Particles.GetSize(); i++) {
- m_Particles[i]->m_IsDead = true;
+ for (int i = 0; i < _particles.GetSize(); i++) {
+ _particles[i]->_isDead = true;
}
- m_Running = true;
- m_BatchesGenerated = 0;
+ _running = true;
+ _batchesGenerated = 0;
- if (m_OverheadTime > 0) {
+ if (_overheadTime > 0) {
uint32 Delta = 500;
- int Steps = m_OverheadTime / Delta;
- uint32 CurrentTime = Game->m_Timer - m_OverheadTime;
+ int Steps = _overheadTime / Delta;
+ uint32 CurrentTime = Game->_timer - _overheadTime;
for (int i = 0; i < Steps; i++) {
UpdateInternal(CurrentTime, Delta);
CurrentTime += Delta;
}
- m_OverheadTime = 0;
+ _overheadTime = 0;
}
@@ -326,8 +326,8 @@ HRESULT CPartEmitter::Start() {
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::SortParticlesByZ() {
- // sort particles by m_PosY
- qsort(m_Particles.GetData(), m_Particles.GetSize(), sizeof(CPartParticle *), CPartEmitter::CompareZ);
+ // sort particles by _posY
+ qsort(_particles.GetData(), _particles.GetSize(), sizeof(CPartParticle *), CPartEmitter::CompareZ);
return S_OK;
}
@@ -336,24 +336,24 @@ int CPartEmitter::CompareZ(const void *Obj1, const void *Obj2) {
CPartParticle *P1 = *(CPartParticle **)Obj1;
CPartParticle *P2 = *(CPartParticle **)Obj2;
- if (P1->m_PosZ < P2->m_PosZ) return -1;
- else if (P1->m_PosZ > P2->m_PosZ) return 1;
+ if (P1->_posZ < P2->_posZ) return -1;
+ else if (P1->_posZ > P2->_posZ) return 1;
else return 0;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::SetBorder(int X, int Y, int Width, int Height) {
- CBPlatform::SetRect(&m_Border, X, Y, X + Width, Y + Height);
+ CBPlatform::SetRect(&_border, X, Y, X + Width, Y + Height);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::SetBorderThickness(int ThicknessLeft, int ThicknessRight, int ThicknessTop, int ThicknessBottom) {
- m_BorderThicknessLeft = ThicknessLeft;
- m_BorderThicknessRight = ThicknessRight;
- m_BorderThicknessTop = ThicknessTop;
- m_BorderThicknessBottom = ThicknessBottom;
+ _borderThicknessLeft = ThicknessLeft;
+ _borderThicknessRight = ThicknessRight;
+ _borderThicknessTop = ThicknessTop;
+ _borderThicknessBottom = ThicknessBottom;
return S_OK;
}
@@ -362,9 +362,9 @@ HRESULT CPartEmitter::SetBorderThickness(int ThicknessLeft, int ThicknessRight,
CPartForce *CPartEmitter::AddForceByName(char *Name) {
CPartForce *Force = NULL;
- for (int i = 0; i < m_Forces.GetSize(); i++) {
- if (scumm_stricmp(Name, m_Forces[i]->m_Name) == 0) {
- Force = m_Forces[i];
+ for (int i = 0; i < _forces.GetSize(); i++) {
+ if (scumm_stricmp(Name, _forces[i]->_name) == 0) {
+ Force = _forces[i];
break;
}
}
@@ -372,7 +372,7 @@ CPartForce *CPartEmitter::AddForceByName(char *Name) {
Force = new CPartForce(Game);
if (Force) {
Force->SetName(Name);
- m_Forces.Add(Force);
+ _forces.Add(Force);
}
}
return Force;
@@ -384,23 +384,23 @@ HRESULT CPartEmitter::AddForce(char *Name, CPartForce::TForceType Type, int PosX
CPartForce *Force = AddForceByName(Name);
if (!Force) return E_FAIL;
- Force->m_Type = Type;
- Force->m_Pos = Vector2(PosX, PosY);
+ Force->_type = Type;
+ Force->_pos = Vector2(PosX, PosY);
- Force->m_Direction = Vector2(0, Strength);
+ Force->_direction = Vector2(0, Strength);
Matrix4 MatRot;
MatRot.RotationZ(DegToRad(CBUtils::NormalizeAngle(Angle - 180)));
- MatRot.TransformVector2(Force->m_Direction);
+ MatRot.TransformVector2(Force->_direction);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::RemoveForce(char *Name) {
- for (int i = 0; i < m_Forces.GetSize(); i++) {
- if (scumm_stricmp(Name, m_Forces[i]->m_Name) == 0) {
- delete m_Forces[i];
- m_Forces.RemoveAt(i);
+ for (int i = 0; i < _forces.GetSize(); i++) {
+ if (scumm_stricmp(Name, _forces[i]->_name) == 0) {
+ delete _forces[i];
+ _forces.RemoveAt(i);
return S_OK;
}
}
@@ -466,7 +466,7 @@ HRESULT CPartEmitter::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Start") == 0) {
Stack->CorrectParams(1);
- m_OverheadTime = Stack->Pop()->GetInt();
+ _overheadTime = Stack->Pop()->GetInt();
Stack->PushBool(SUCCEEDED(Start()));
return S_OK;
@@ -478,12 +478,12 @@ HRESULT CPartEmitter::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
else if (strcmp(Name, "Stop") == 0) {
Stack->CorrectParams(0);
- for (int i = 0; i < m_Particles.GetSize(); i++) {
- delete m_Particles[i];
+ for (int i = 0; i < _particles.GetSize(); i++) {
+ delete _particles[i];
}
- m_Particles.RemoveAll();
+ _particles.RemoveAll();
- m_Running = false;
+ _running = false;
Stack->PushBool(true);
return S_OK;
@@ -494,7 +494,7 @@ HRESULT CPartEmitter::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Pause") == 0) {
Stack->CorrectParams(0);
- m_Running = false;
+ _running = false;
Stack->PushBool(true);
return S_OK;
@@ -505,7 +505,7 @@ HRESULT CPartEmitter::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Resume") == 0) {
Stack->CorrectParams(0);
- m_Running = true;
+ _running = true;
Stack->PushBool(true);
return S_OK;
@@ -558,270 +558,270 @@ HRESULT CPartEmitter::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
//////////////////////////////////////////////////////////////////////////
CScValue *CPartEmitter::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("particle-emitter");
- return m_ScValue;
+ _scValue->SetString("particle-emitter");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "X") == 0) {
- m_ScValue->SetInt(m_PosX);
- return m_ScValue;
+ _scValue->SetInt(_posX);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Y") == 0) {
- m_ScValue->SetInt(m_PosY);
- return m_ScValue;
+ _scValue->SetInt(_posY);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Width") == 0) {
- m_ScValue->SetInt(m_Width);
- return m_ScValue;
+ _scValue->SetInt(_width);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Height") == 0) {
- m_ScValue->SetInt(m_Height);
- return m_ScValue;
+ _scValue->SetInt(_height);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Scale1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scale1") == 0) {
- m_ScValue->SetFloat(m_Scale1);
- return m_ScValue;
+ _scValue->SetFloat(_scale1);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Scale2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scale2") == 0) {
- m_ScValue->SetFloat(m_Scale2);
- return m_ScValue;
+ _scValue->SetFloat(_scale2);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScaleZBased
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScaleZBased") == 0) {
- m_ScValue->SetBool(m_ScaleZBased);
- return m_ScValue;
+ _scValue->SetBool(_scaleZBased);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Velocity1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Velocity1") == 0) {
- m_ScValue->SetFloat(m_Velocity1);
- return m_ScValue;
+ _scValue->SetFloat(_velocity1);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Velocity2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Velocity2") == 0) {
- m_ScValue->SetFloat(m_Velocity2);
- return m_ScValue;
+ _scValue->SetFloat(_velocity2);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// VelocityZBased
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "VelocityZBased") == 0) {
- m_ScValue->SetBool(m_VelocityZBased);
- return m_ScValue;
+ _scValue->SetBool(_velocityZBased);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LifeTime1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LifeTime1") == 0) {
- m_ScValue->SetInt(m_LifeTime1);
- return m_ScValue;
+ _scValue->SetInt(_lifeTime1);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LifeTime2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LifeTime2") == 0) {
- m_ScValue->SetInt(m_LifeTime2);
- return m_ScValue;
+ _scValue->SetInt(_lifeTime2);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LifeTimeZBased
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LifeTimeZBased") == 0) {
- m_ScValue->SetBool(m_LifeTimeZBased);
- return m_ScValue;
+ _scValue->SetBool(_lifeTimeZBased);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Angle1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Angle1") == 0) {
- m_ScValue->SetInt(m_Angle1);
- return m_ScValue;
+ _scValue->SetInt(_angle1);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Angle2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Angle2") == 0) {
- m_ScValue->SetInt(m_Angle2);
- return m_ScValue;
+ _scValue->SetInt(_angle2);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AngVelocity1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AngVelocity1") == 0) {
- m_ScValue->SetFloat(m_AngVelocity1);
- return m_ScValue;
+ _scValue->SetFloat(_angVelocity1);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AngVelocity2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AngVelocity2") == 0) {
- m_ScValue->SetFloat(m_AngVelocity2);
- return m_ScValue;
+ _scValue->SetFloat(_angVelocity2);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Rotation1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Rotation1") == 0) {
- m_ScValue->SetFloat(m_Rotation1);
- return m_ScValue;
+ _scValue->SetFloat(_rotation1);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Rotation2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Rotation2") == 0) {
- m_ScValue->SetFloat(m_Rotation2);
- return m_ScValue;
+ _scValue->SetFloat(_rotation2);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Alpha1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Alpha1") == 0) {
- m_ScValue->SetInt(m_Alpha1);
- return m_ScValue;
+ _scValue->SetInt(_alpha1);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Alpha2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Alpha2") == 0) {
- m_ScValue->SetInt(m_Alpha2);
- return m_ScValue;
+ _scValue->SetInt(_alpha2);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AlphaTimeBased
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AlphaTimeBased") == 0) {
- m_ScValue->SetBool(m_AlphaTimeBased);
- return m_ScValue;
+ _scValue->SetBool(_alphaTimeBased);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MaxParticles
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MaxParticles") == 0) {
- m_ScValue->SetInt(m_MaxParticles);
- return m_ScValue;
+ _scValue->SetInt(_maxParticles);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumLiveParticles (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumLiveParticles") == 0) {
int NumAlive = 0;
- for (int i = 0; i < m_Particles.GetSize(); i++) {
- if (m_Particles[i] && !m_Particles[i]->m_IsDead) NumAlive++;
+ for (int i = 0; i < _particles.GetSize(); i++) {
+ if (_particles[i] && !_particles[i]->_isDead) NumAlive++;
}
- m_ScValue->SetInt(NumAlive);
- return m_ScValue;
+ _scValue->SetInt(NumAlive);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// GenerationInterval
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GenerationInterval") == 0) {
- m_ScValue->SetInt(m_GenInterval);
- return m_ScValue;
+ _scValue->SetInt(_genInterval);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// GenerationAmount
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GenerationAmount") == 0) {
- m_ScValue->SetInt(m_GenAmount);
- return m_ScValue;
+ _scValue->SetInt(_genAmount);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MaxBatches
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MaxBatches") == 0) {
- m_ScValue->SetInt(m_MaxBatches);
- return m_ScValue;
+ _scValue->SetInt(_maxBatches);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// FadeInTime
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FadeInTime") == 0) {
- m_ScValue->SetInt(m_FadeInTime);
- return m_ScValue;
+ _scValue->SetInt(_fadeInTime);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// FadeOutTime
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FadeOutTime") == 0) {
- m_ScValue->SetInt(m_FadeOutTime);
- return m_ScValue;
+ _scValue->SetInt(_fadeOutTime);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// GrowthRate1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GrowthRate1") == 0) {
- m_ScValue->SetFloat(m_GrowthRate1);
- return m_ScValue;
+ _scValue->SetFloat(_growthRate1);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// GrowthRate2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GrowthRate2") == 0) {
- m_ScValue->SetFloat(m_GrowthRate2);
- return m_ScValue;
+ _scValue->SetFloat(_growthRate2);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ExponentialGrowth
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ExponentialGrowth") == 0) {
- m_ScValue->SetBool(m_ExponentialGrowth);
- return m_ScValue;
+ _scValue->SetBool(_exponentialGrowth);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// UseRegion
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "UseRegion") == 0) {
- m_ScValue->SetBool(m_UseRegion);
- return m_ScValue;
+ _scValue->SetBool(_useRegion);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// EmitEvent
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "EmitEvent") == 0) {
- if (!m_EmitEvent) m_ScValue->SetNULL();
- else m_ScValue->SetString(m_EmitEvent);
- return m_ScValue;
+ if (!_emitEvent) _scValue->SetNULL();
+ else _scValue->SetString(_emitEvent);
+ return _scValue;
}
else return CBObject::ScGetProperty(Name);
@@ -834,28 +834,28 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// X
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "X") == 0) {
- m_PosX = Value->GetInt();
+ _posX = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Y") == 0) {
- m_PosY = Value->GetInt();
+ _posY = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Width") == 0) {
- m_Width = Value->GetInt();
+ _width = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Height") == 0) {
- m_Height = Value->GetInt();
+ _height = Value->GetInt();
return S_OK;
}
@@ -863,21 +863,21 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// Scale1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scale1") == 0) {
- m_Scale1 = Value->GetFloat();
+ _scale1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Scale2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Scale2") == 0) {
- m_Scale2 = Value->GetFloat();
+ _scale2 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ScaleZBased
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ScaleZBased") == 0) {
- m_ScaleZBased = Value->GetBool();
+ _scaleZBased = Value->GetBool();
return S_OK;
}
@@ -885,21 +885,21 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// Velocity1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Velocity1") == 0) {
- m_Velocity1 = Value->GetFloat();
+ _velocity1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Velocity2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Velocity2") == 0) {
- m_Velocity2 = Value->GetFloat();
+ _velocity2 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// VelocityZBased
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "VelocityZBased") == 0) {
- m_VelocityZBased = Value->GetBool();
+ _velocityZBased = Value->GetBool();
return S_OK;
}
@@ -907,21 +907,21 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// LifeTime1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LifeTime1") == 0) {
- m_LifeTime1 = Value->GetInt();
+ _lifeTime1 = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// LifeTime2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LifeTime2") == 0) {
- m_LifeTime2 = Value->GetInt();
+ _lifeTime2 = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// LifeTimeZBased
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "LifeTimeZBased") == 0) {
- m_LifeTimeZBased = Value->GetBool();
+ _lifeTimeZBased = Value->GetBool();
return S_OK;
}
@@ -929,14 +929,14 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// Angle1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Angle1") == 0) {
- m_Angle1 = Value->GetInt();
+ _angle1 = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Angle2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Angle2") == 0) {
- m_Angle2 = Value->GetInt();
+ _angle2 = Value->GetInt();
return S_OK;
}
@@ -944,14 +944,14 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// AngVelocity1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AngVelocity1") == 0) {
- m_AngVelocity1 = Value->GetFloat();
+ _angVelocity1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// AngVelocity2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AngVelocity2") == 0) {
- m_AngVelocity2 = Value->GetFloat();
+ _angVelocity2 = Value->GetFloat();
return S_OK;
}
@@ -959,14 +959,14 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// Rotation1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Rotation1") == 0) {
- m_Rotation1 = Value->GetFloat();
+ _rotation1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Rotation2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Rotation2") == 0) {
- m_Rotation2 = Value->GetFloat();
+ _rotation2 = Value->GetFloat();
return S_OK;
}
@@ -974,25 +974,25 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// Alpha1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Alpha1") == 0) {
- m_Alpha1 = Value->GetInt();
- if (m_Alpha1 < 0) m_Alpha1 = 0;
- if (m_Alpha1 > 255) m_Alpha1 = 255;
+ _alpha1 = Value->GetInt();
+ if (_alpha1 < 0) _alpha1 = 0;
+ if (_alpha1 > 255) _alpha1 = 255;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Alpha2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Alpha2") == 0) {
- m_Alpha2 = Value->GetInt();
- if (m_Alpha2 < 0) m_Alpha2 = 0;
- if (m_Alpha2 > 255) m_Alpha2 = 255;
+ _alpha2 = Value->GetInt();
+ if (_alpha2 < 0) _alpha2 = 0;
+ if (_alpha2 > 255) _alpha2 = 255;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// AlphaTimeBased
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AlphaTimeBased") == 0) {
- m_AlphaTimeBased = Value->GetBool();
+ _alphaTimeBased = Value->GetBool();
return S_OK;
}
@@ -1000,7 +1000,7 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// MaxParticles
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MaxParticles") == 0) {
- m_MaxParticles = Value->GetInt();
+ _maxParticles = Value->GetInt();
return S_OK;
}
@@ -1008,21 +1008,21 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// GenerationInterval
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GenerationInterval") == 0) {
- m_GenInterval = Value->GetInt();
+ _genInterval = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GenerationAmount
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GenerationAmount") == 0) {
- m_GenAmount = Value->GetInt();
+ _genAmount = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// MaxBatches
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MaxBatches") == 0) {
- m_MaxBatches = Value->GetInt();
+ _maxBatches = Value->GetInt();
return S_OK;
}
@@ -1030,14 +1030,14 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// FadeInTime
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FadeInTime") == 0) {
- m_FadeInTime = Value->GetInt();
+ _fadeInTime = Value->GetInt();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// FadeOutTime
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FadeOutTime") == 0) {
- m_FadeOutTime = Value->GetInt();
+ _fadeOutTime = Value->GetInt();
return S_OK;
}
@@ -1045,21 +1045,21 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// GrowthRate1
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GrowthRate1") == 0) {
- m_GrowthRate1 = Value->GetFloat();
+ _growthRate1 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// GrowthRate2
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GrowthRate2") == 0) {
- m_GrowthRate2 = Value->GetFloat();
+ _growthRate2 = Value->GetFloat();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// ExponentialGrowth
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ExponentialGrowth") == 0) {
- m_ExponentialGrowth = Value->GetBool();
+ _exponentialGrowth = Value->GetBool();
return S_OK;
}
@@ -1067,7 +1067,7 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// UseRegion
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "UseRegion") == 0) {
- m_UseRegion = Value->GetBool();
+ _useRegion = Value->GetBool();
return S_OK;
}
@@ -1075,8 +1075,8 @@ HRESULT CPartEmitter::ScSetProperty(char *Name, CScValue *Value) {
// EmitEvent
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "EmitEvent") == 0) {
- SAFE_DELETE_ARRAY(m_EmitEvent);
- if (!Value->IsNULL()) CBUtils::SetString(&m_EmitEvent, Value->GetString());
+ SAFE_DELETE_ARRAY(_emitEvent);
+ if (!Value->IsNULL()) CBUtils::SetString(&_emitEvent, Value->GetString());
return S_OK;
}
@@ -1096,95 +1096,95 @@ char *CPartEmitter::ScToString() {
HRESULT CPartEmitter::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Width));
- PersistMgr->Transfer(TMEMBER(m_Height));
+ PersistMgr->Transfer(TMEMBER(_width));
+ PersistMgr->Transfer(TMEMBER(_height));
- PersistMgr->Transfer(TMEMBER(m_Angle1));
- PersistMgr->Transfer(TMEMBER(m_Angle2));
+ PersistMgr->Transfer(TMEMBER(_angle1));
+ PersistMgr->Transfer(TMEMBER(_angle2));
- PersistMgr->Transfer(TMEMBER(m_Velocity1));
- PersistMgr->Transfer(TMEMBER(m_Velocity2));
- PersistMgr->Transfer(TMEMBER(m_VelocityZBased));
+ PersistMgr->Transfer(TMEMBER(_velocity1));
+ PersistMgr->Transfer(TMEMBER(_velocity2));
+ PersistMgr->Transfer(TMEMBER(_velocityZBased));
- PersistMgr->Transfer(TMEMBER(m_Scale1));
- PersistMgr->Transfer(TMEMBER(m_Scale2));
- PersistMgr->Transfer(TMEMBER(m_ScaleZBased));
+ PersistMgr->Transfer(TMEMBER(_scale1));
+ PersistMgr->Transfer(TMEMBER(_scale2));
+ PersistMgr->Transfer(TMEMBER(_scaleZBased));
- PersistMgr->Transfer(TMEMBER(m_MaxParticles));
+ PersistMgr->Transfer(TMEMBER(_maxParticles));
- PersistMgr->Transfer(TMEMBER(m_LifeTime1));
- PersistMgr->Transfer(TMEMBER(m_LifeTime2));
- PersistMgr->Transfer(TMEMBER(m_LifeTimeZBased));
+ PersistMgr->Transfer(TMEMBER(_lifeTime1));
+ PersistMgr->Transfer(TMEMBER(_lifeTime2));
+ PersistMgr->Transfer(TMEMBER(_lifeTimeZBased));
- PersistMgr->Transfer(TMEMBER(m_GenInterval));
- PersistMgr->Transfer(TMEMBER(m_GenAmount));
+ PersistMgr->Transfer(TMEMBER(_genInterval));
+ PersistMgr->Transfer(TMEMBER(_genAmount));
- PersistMgr->Transfer(TMEMBER(m_Running));
- PersistMgr->Transfer(TMEMBER(m_OverheadTime));
+ PersistMgr->Transfer(TMEMBER(_running));
+ PersistMgr->Transfer(TMEMBER(_overheadTime));
- PersistMgr->Transfer(TMEMBER(m_Border));
- PersistMgr->Transfer(TMEMBER(m_BorderThicknessLeft));
- PersistMgr->Transfer(TMEMBER(m_BorderThicknessRight));
- PersistMgr->Transfer(TMEMBER(m_BorderThicknessTop));
- PersistMgr->Transfer(TMEMBER(m_BorderThicknessBottom));
+ PersistMgr->Transfer(TMEMBER(_border));
+ PersistMgr->Transfer(TMEMBER(_borderThicknessLeft));
+ PersistMgr->Transfer(TMEMBER(_borderThicknessRight));
+ PersistMgr->Transfer(TMEMBER(_borderThicknessTop));
+ PersistMgr->Transfer(TMEMBER(_borderThicknessBottom));
- PersistMgr->Transfer(TMEMBER(m_FadeInTime));
- PersistMgr->Transfer(TMEMBER(m_FadeOutTime));
+ PersistMgr->Transfer(TMEMBER(_fadeInTime));
+ PersistMgr->Transfer(TMEMBER(_fadeOutTime));
- PersistMgr->Transfer(TMEMBER(m_Alpha1));
- PersistMgr->Transfer(TMEMBER(m_Alpha2));
- PersistMgr->Transfer(TMEMBER(m_AlphaTimeBased));
+ PersistMgr->Transfer(TMEMBER(_alpha1));
+ PersistMgr->Transfer(TMEMBER(_alpha2));
+ PersistMgr->Transfer(TMEMBER(_alphaTimeBased));
- PersistMgr->Transfer(TMEMBER(m_AngVelocity1));
- PersistMgr->Transfer(TMEMBER(m_AngVelocity2));
+ PersistMgr->Transfer(TMEMBER(_angVelocity1));
+ PersistMgr->Transfer(TMEMBER(_angVelocity2));
- PersistMgr->Transfer(TMEMBER(m_Rotation1));
- PersistMgr->Transfer(TMEMBER(m_Rotation2));
+ PersistMgr->Transfer(TMEMBER(_rotation1));
+ PersistMgr->Transfer(TMEMBER(_rotation2));
- PersistMgr->Transfer(TMEMBER(m_GrowthRate1));
- PersistMgr->Transfer(TMEMBER(m_GrowthRate2));
- PersistMgr->Transfer(TMEMBER(m_ExponentialGrowth));
+ PersistMgr->Transfer(TMEMBER(_growthRate1));
+ PersistMgr->Transfer(TMEMBER(_growthRate2));
+ PersistMgr->Transfer(TMEMBER(_exponentialGrowth));
- PersistMgr->Transfer(TMEMBER(m_UseRegion));
+ PersistMgr->Transfer(TMEMBER(_useRegion));
- PersistMgr->Transfer(TMEMBER_INT(m_MaxBatches));
- PersistMgr->Transfer(TMEMBER_INT(m_BatchesGenerated));
+ PersistMgr->Transfer(TMEMBER_INT(_maxBatches));
+ PersistMgr->Transfer(TMEMBER_INT(_batchesGenerated));
- PersistMgr->Transfer(TMEMBER(m_EmitEvent));
- PersistMgr->Transfer(TMEMBER(m_Owner));
+ PersistMgr->Transfer(TMEMBER(_emitEvent));
+ PersistMgr->Transfer(TMEMBER(_owner));
- m_Sprites.Persist(PersistMgr);
+ _sprites.Persist(PersistMgr);
int NumForces;
- if (PersistMgr->m_Saving) {
- NumForces = m_Forces.GetSize();
+ if (PersistMgr->_saving) {
+ NumForces = _forces.GetSize();
PersistMgr->Transfer(TMEMBER(NumForces));
- for (int i = 0; i < m_Forces.GetSize(); i++) {
- m_Forces[i]->Persist(PersistMgr);
+ for (int i = 0; i < _forces.GetSize(); i++) {
+ _forces[i]->Persist(PersistMgr);
}
} else {
PersistMgr->Transfer(TMEMBER(NumForces));
for (int i = 0; i < NumForces; i++) {
CPartForce *Force = new CPartForce(Game);
Force->Persist(PersistMgr);
- m_Forces.Add(Force);
+ _forces.Add(Force);
}
}
int NumParticles;
- if (PersistMgr->m_Saving) {
- NumParticles = m_Particles.GetSize();
+ if (PersistMgr->_saving) {
+ NumParticles = _particles.GetSize();
PersistMgr->Transfer(TMEMBER(NumParticles));
- for (int i = 0; i < m_Particles.GetSize(); i++) {
- m_Particles[i]->Persist(PersistMgr);
+ for (int i = 0; i < _particles.GetSize(); i++) {
+ _particles[i]->Persist(PersistMgr);
}
} else {
PersistMgr->Transfer(TMEMBER(NumParticles));
for (int i = 0; i < NumParticles; i++) {
CPartParticle *Particle = new CPartParticle(Game);
Particle->Persist(PersistMgr);
- m_Particles.Add(Particle);
+ _particles.Add(Particle);
}
}
diff --git a/engines/wintermute/PartEmitter.h b/engines/wintermute/PartEmitter.h
index d23b4db488..16257153bc 100644
--- a/engines/wintermute/PartEmitter.h
+++ b/engines/wintermute/PartEmitter.h
@@ -41,62 +41,62 @@ public:
CPartEmitter(CBGame *inGame, CBScriptHolder *Owner);
virtual ~CPartEmitter(void);
- int m_Width;
- int m_Height;
+ int _width;
+ int _height;
- int m_Angle1;
- int m_Angle2;
+ int _angle1;
+ int _angle2;
- float m_Rotation1;
- float m_Rotation2;
+ float _rotation1;
+ float _rotation2;
- float m_AngVelocity1;
- float m_AngVelocity2;
+ float _angVelocity1;
+ float _angVelocity2;
- float m_GrowthRate1;
- float m_GrowthRate2;
- bool m_ExponentialGrowth;
+ float _growthRate1;
+ float _growthRate2;
+ bool _exponentialGrowth;
- float m_Velocity1;
- float m_Velocity2;
- bool m_VelocityZBased;
+ float _velocity1;
+ float _velocity2;
+ bool _velocityZBased;
- float m_Scale1;
- float m_Scale2;
- bool m_ScaleZBased;
+ float _scale1;
+ float _scale2;
+ bool _scaleZBased;
- int m_MaxParticles;
+ int _maxParticles;
- int m_LifeTime1;
- int m_LifeTime2;
- bool m_LifeTimeZBased;
+ int _lifeTime1;
+ int _lifeTime2;
+ bool _lifeTimeZBased;
- int m_GenInterval;
- int m_GenAmount;
+ int _genInterval;
+ int _genAmount;
- bool m_Running;
- int m_OverheadTime;
+ bool _running;
+ int _overheadTime;
- int m_MaxBatches;
- int m_BatchesGenerated;
+ int _maxBatches;
+ int _batchesGenerated;
- RECT m_Border;
- int m_BorderThicknessLeft;
- int m_BorderThicknessRight;
- int m_BorderThicknessTop;
- int m_BorderThicknessBottom;
+ RECT _border;
+ int _borderThicknessLeft;
+ int _borderThicknessRight;
+ int _borderThicknessTop;
+ int _borderThicknessBottom;
- int m_FadeInTime;
- int m_FadeOutTime;
+ int _fadeInTime;
+ int _fadeOutTime;
- int m_Alpha1;
- int m_Alpha2;
- bool m_AlphaTimeBased;
+ int _alpha1;
+ int _alpha2;
+ bool _alphaTimeBased;
- bool m_UseRegion;
+ bool _useRegion;
- char *m_EmitEvent;
- CBScriptHolder *m_Owner;
+ char *_emitEvent;
+ CBScriptHolder *_owner;
HRESULT Start();
@@ -112,7 +112,7 @@ public:
HRESULT AddForce(char *Name, CPartForce::TForceType Type, int PosX, int PosY, float Angle, float Strength);
HRESULT RemoveForce(char *Name);
- CBArray<CPartForce *, CPartForce *> m_Forces;
+ CBArray<CPartForce *, CPartForce *> _forces;
// scripting interface
virtual CScValue *ScGetProperty(char *Name);
@@ -126,9 +126,9 @@ private:
int static CompareZ(const void *Obj1, const void *Obj2);
HRESULT InitParticle(CPartParticle *Particle, uint32 CurrentTime, uint32 TimerDelta);
HRESULT UpdateInternal(uint32 CurrentTime, uint32 TimerDelta);
- uint32 m_LastGenTime;
- CBArray<CPartParticle *, CPartParticle *> m_Particles;
- CBArray<char *, char *> m_Sprites;
+ uint32 _lastGenTime;
+ CBArray<CPartParticle *, CPartParticle *> _particles;
+ CBArray<char *, char *> _sprites;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/PartForce.cpp b/engines/wintermute/PartForce.cpp
index 06f5902ab6..874ffdda1f 100644
--- a/engines/wintermute/PartForce.cpp
+++ b/engines/wintermute/PartForce.cpp
@@ -32,9 +32,9 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CPartForce::CPartForce(CBGame *inGame) : CBNamedObject(inGame) {
- m_Pos = Vector2(0.0f, 0.0f);
- m_Direction = Vector2(0.0f, 0.0f);
- m_Type = FORCE_POINT;
+ _pos = Vector2(0.0f, 0.0f);
+ _direction = Vector2(0.0f, 0.0f);
+ _type = FORCE_POINT;
}
@@ -45,10 +45,10 @@ CPartForce::~CPartForce(void) {
//////////////////////////////////////////////////////////////////////////
HRESULT CPartForce::Persist(CBPersistMgr *PersistMgr) {
- PersistMgr->Transfer(TMEMBER(m_Name));
- PersistMgr->Transfer(TMEMBER(m_Pos));
- PersistMgr->Transfer(TMEMBER(m_Direction));
- PersistMgr->Transfer(TMEMBER_INT(m_Type));
+ PersistMgr->Transfer(TMEMBER(_name));
+ PersistMgr->Transfer(TMEMBER(_pos));
+ PersistMgr->Transfer(TMEMBER(_direction));
+ PersistMgr->Transfer(TMEMBER_INT(_type));
return S_OK;
}
diff --git a/engines/wintermute/PartForce.h b/engines/wintermute/PartForce.h
index 140174eb4f..6245b438db 100644
--- a/engines/wintermute/PartForce.h
+++ b/engines/wintermute/PartForce.h
@@ -42,9 +42,9 @@ public:
CPartForce(CBGame *inGame);
virtual ~CPartForce(void);
- Vector2 m_Pos;
- Vector2 m_Direction;
- TForceType m_Type;
+ Vector2 _pos;
+ Vector2 _direction;
+ TForceType _type;
HRESULT Persist(CBPersistMgr *PersistMgr);
};
diff --git a/engines/wintermute/PartParticle.cpp b/engines/wintermute/PartParticle.cpp
index d1a892645b..cc59e20c17 100644
--- a/engines/wintermute/PartParticle.cpp
+++ b/engines/wintermute/PartParticle.cpp
@@ -37,56 +37,56 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CPartParticle::CPartParticle(CBGame *inGame) : CBBase(inGame) {
- m_Pos = Vector2(0.0f, 0.0f);
- m_PosZ = 0.0f;
- m_Velocity = Vector2(0.0f, 0.0f);
- m_Scale = 100.0f;
- m_Sprite = NULL;
- m_CreationTime = 0;
- m_LifeTime = 0;
- m_IsDead = true;
- CBPlatform::SetRectEmpty(&m_Border);
-
- m_State = PARTICLE_NORMAL;
- m_FadeStart = 0;
- m_FadeTime = 0;
- m_CurrentAlpha = 255;
-
- m_Alpha1 = m_Alpha2 = 255;
-
- m_Rotation = 0.0f;
- m_AngVelocity = 0.0f;
-
- m_GrowthRate = 0.0f;
- m_ExponentialGrowth = false;
+ _pos = Vector2(0.0f, 0.0f);
+ _posZ = 0.0f;
+ _velocity = Vector2(0.0f, 0.0f);
+ _scale = 100.0f;
+ _sprite = NULL;
+ _creationTime = 0;
+ _lifeTime = 0;
+ _isDead = true;
+ CBPlatform::SetRectEmpty(&_border);
+
+ _state = PARTICLE_NORMAL;
+ _fadeStart = 0;
+ _fadeTime = 0;
+ _currentAlpha = 255;
+
+ _alpha1 = _alpha2 = 255;
+
+ _rotation = 0.0f;
+ _angVelocity = 0.0f;
+
+ _growthRate = 0.0f;
+ _exponentialGrowth = false;
}
//////////////////////////////////////////////////////////////////////////
CPartParticle::~CPartParticle(void) {
- delete m_Sprite;
- m_Sprite = NULL;
+ delete _sprite;
+ _sprite = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartParticle::SetSprite(char *Filename) {
- if (m_Sprite && m_Sprite->m_Filename && scumm_stricmp(Filename, m_Sprite->m_Filename) == 0) {
- m_Sprite->Reset();
+ if (_sprite && _sprite->_filename && scumm_stricmp(Filename, _sprite->_filename) == 0) {
+ _sprite->Reset();
return S_OK;
}
- delete m_Sprite;
- m_Sprite = NULL;
+ delete _sprite;
+ _sprite = NULL;
- CSysClassRegistry::GetInstance()->m_Disabled = true;
- m_Sprite = new CBSprite(Game, Game);
- if (m_Sprite && SUCCEEDED(m_Sprite->LoadFile(Filename))) {
- CSysClassRegistry::GetInstance()->m_Disabled = false;
+ CSysClassRegistry::GetInstance()->_disabled = true;
+ _sprite = new CBSprite(Game, Game);
+ if (_sprite && SUCCEEDED(_sprite->LoadFile(Filename))) {
+ CSysClassRegistry::GetInstance()->_disabled = false;
return S_OK;
} else {
- delete m_Sprite;
- m_Sprite = NULL;
- CSysClassRegistry::GetInstance()->m_Disabled = false;
+ delete _sprite;
+ _sprite = NULL;
+ CSysClassRegistry::GetInstance()->_disabled = false;
return E_FAIL;
}
@@ -94,82 +94,82 @@ HRESULT CPartParticle::SetSprite(char *Filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CPartParticle::Update(CPartEmitter *Emitter, uint32 CurrentTime, uint32 TimerDelta) {
- if (m_State == PARTICLE_FADEIN) {
- if (CurrentTime - m_FadeStart >= m_FadeTime) {
- m_State = PARTICLE_NORMAL;
- m_CurrentAlpha = m_Alpha1;
- } else m_CurrentAlpha = ((float)CurrentTime - (float)m_FadeStart) / (float)m_FadeTime * m_Alpha1;
+ if (_state == PARTICLE_FADEIN) {
+ if (CurrentTime - _fadeStart >= _fadeTime) {
+ _state = PARTICLE_NORMAL;
+ _currentAlpha = _alpha1;
+ } else _currentAlpha = ((float)CurrentTime - (float)_fadeStart) / (float)_fadeTime * _alpha1;
return S_OK;
- } else if (m_State == PARTICLE_FADEOUT) {
- if (CurrentTime - m_FadeStart >= m_FadeTime) {
- m_IsDead = true;
+ } else if (_state == PARTICLE_FADEOUT) {
+ if (CurrentTime - _fadeStart >= _fadeTime) {
+ _isDead = true;
return S_OK;
- } else m_CurrentAlpha = m_FadeStartAlpha - ((float)CurrentTime - (float)m_FadeStart) / (float)m_FadeTime * m_FadeStartAlpha;
+ } else _currentAlpha = _fadeStartAlpha - ((float)CurrentTime - (float)_fadeStart) / (float)_fadeTime * _fadeStartAlpha;
return S_OK;
} else {
// time is up
- if (m_LifeTime > 0) {
- if (CurrentTime - m_CreationTime >= m_LifeTime) {
- if (Emitter->m_FadeOutTime > 0)
- FadeOut(CurrentTime, Emitter->m_FadeOutTime);
+ if (_lifeTime > 0) {
+ if (CurrentTime - _creationTime >= _lifeTime) {
+ if (Emitter->_fadeOutTime > 0)
+ FadeOut(CurrentTime, Emitter->_fadeOutTime);
else
- m_IsDead = true;
+ _isDead = true;
}
}
// particle hit the border
- if (!m_IsDead && !CBPlatform::IsRectEmpty(&m_Border)) {
+ if (!_isDead && !CBPlatform::IsRectEmpty(&_border)) {
POINT p;
- p.x = m_Pos.x;
- p.y = m_Pos.y;
- if (!CBPlatform::PtInRect(&m_Border, p)) FadeOut(CurrentTime, Emitter->m_FadeOutTime);
+ p.x = _pos.x;
+ p.y = _pos.y;
+ if (!CBPlatform::PtInRect(&_border, p)) FadeOut(CurrentTime, Emitter->_fadeOutTime);
}
- if (m_State != PARTICLE_NORMAL) return S_OK;
+ if (_state != PARTICLE_NORMAL) return S_OK;
// update alpha
- if (m_LifeTime > 0) {
- int Age = CurrentTime - m_CreationTime;
- int AlphaDelta = m_Alpha2 - m_Alpha1;
+ if (_lifeTime > 0) {
+ int Age = CurrentTime - _creationTime;
+ int AlphaDelta = _alpha2 - _alpha1;
- m_CurrentAlpha = m_Alpha1 + ((float)AlphaDelta / (float)m_LifeTime * (float)Age);
+ _currentAlpha = _alpha1 + ((float)AlphaDelta / (float)_lifeTime * (float)Age);
}
// update position
float ElapsedTime = (float)TimerDelta / 1000.f;
- for (int i = 0; i < Emitter->m_Forces.GetSize(); i++) {
- CPartForce *Force = Emitter->m_Forces[i];
- switch (Force->m_Type) {
+ for (int i = 0; i < Emitter->_forces.GetSize(); i++) {
+ CPartForce *Force = Emitter->_forces[i];
+ switch (Force->_type) {
case CPartForce::FORCE_GLOBAL:
- m_Velocity += Force->m_Direction * ElapsedTime;
+ _velocity += Force->_direction * ElapsedTime;
break;
case CPartForce::FORCE_POINT: {
- Vector2 VecDist = Force->m_Pos - m_Pos;
+ Vector2 VecDist = Force->_pos - _pos;
float Dist = fabs(VecDist.Length());
Dist = 100.0f / Dist;
- m_Velocity += Force->m_Direction * Dist * ElapsedTime;
+ _velocity += Force->_direction * Dist * ElapsedTime;
}
break;
}
}
- m_Pos += m_Velocity * ElapsedTime;
+ _pos += _velocity * ElapsedTime;
// update rotation
- m_Rotation += m_AngVelocity * ElapsedTime;
- m_Rotation = CBUtils::NormalizeAngle(m_Rotation);
+ _rotation += _angVelocity * ElapsedTime;
+ _rotation = CBUtils::NormalizeAngle(_rotation);
// update scale
- if (m_ExponentialGrowth)
- m_Scale += m_Scale / 100.0f * m_GrowthRate * ElapsedTime;
+ if (_exponentialGrowth)
+ _scale += _scale / 100.0f * _growthRate * ElapsedTime;
else
- m_Scale += m_GrowthRate * ElapsedTime;
+ _scale += _growthRate * ElapsedTime;
- if (m_Scale <= 0.0f) m_IsDead = true;
+ if (_scale <= 0.0f) _isDead = true;
return S_OK;
@@ -178,70 +178,70 @@ HRESULT CPartParticle::Update(CPartEmitter *Emitter, uint32 CurrentTime, uint32
//////////////////////////////////////////////////////////////////////////
HRESULT CPartParticle::Display(CPartEmitter *Emitter) {
- if (!m_Sprite) return E_FAIL;
- if (m_IsDead) return S_OK;
+ if (!_sprite) return E_FAIL;
+ if (_isDead) return S_OK;
- m_Sprite->GetCurrentFrame();
- return m_Sprite->Display(m_Pos.x, m_Pos.y,
+ _sprite->GetCurrentFrame();
+ return _sprite->Display(_pos.x, _pos.y,
NULL,
- m_Scale, m_Scale,
- DRGBA(255, 255, 255, m_CurrentAlpha),
- m_Rotation,
- Emitter->m_BlendMode);
+ _scale, _scale,
+ DRGBA(255, 255, 255, _currentAlpha),
+ _rotation,
+ Emitter->_blendMode);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartParticle::FadeIn(uint32 CurrentTime, int FadeTime) {
- m_CurrentAlpha = 0;
- m_FadeStart = CurrentTime;
- m_FadeTime = FadeTime;
- m_State = PARTICLE_FADEIN;
+ _currentAlpha = 0;
+ _fadeStart = CurrentTime;
+ _fadeTime = FadeTime;
+ _state = PARTICLE_FADEIN;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartParticle::FadeOut(uint32 CurrentTime, int FadeTime) {
- //m_CurrentAlpha = 255;
- m_FadeStartAlpha = m_CurrentAlpha;
- m_FadeStart = CurrentTime;
- m_FadeTime = FadeTime;
- m_State = PARTICLE_FADEOUT;
+ //_currentAlpha = 255;
+ _fadeStartAlpha = _currentAlpha;
+ _fadeStart = CurrentTime;
+ _fadeTime = FadeTime;
+ _state = PARTICLE_FADEOUT;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CPartParticle::Persist(CBPersistMgr *PersistMgr) {
- PersistMgr->Transfer(TMEMBER(m_Alpha1));
- PersistMgr->Transfer(TMEMBER(m_Alpha2));
- PersistMgr->Transfer(TMEMBER(m_Border));
- PersistMgr->Transfer(TMEMBER(m_Pos));
- PersistMgr->Transfer(TMEMBER(m_PosZ));
- PersistMgr->Transfer(TMEMBER(m_Velocity));
- PersistMgr->Transfer(TMEMBER(m_Scale));
- PersistMgr->Transfer(TMEMBER(m_CreationTime));
- PersistMgr->Transfer(TMEMBER(m_LifeTime));
- PersistMgr->Transfer(TMEMBER(m_IsDead));
- PersistMgr->Transfer(TMEMBER_INT(m_State));
- PersistMgr->Transfer(TMEMBER(m_FadeStart));
- PersistMgr->Transfer(TMEMBER(m_FadeTime));
- PersistMgr->Transfer(TMEMBER(m_CurrentAlpha));
- PersistMgr->Transfer(TMEMBER(m_AngVelocity));
- PersistMgr->Transfer(TMEMBER(m_Rotation));
- PersistMgr->Transfer(TMEMBER(m_GrowthRate));
- PersistMgr->Transfer(TMEMBER(m_ExponentialGrowth));
- PersistMgr->Transfer(TMEMBER(m_FadeStartAlpha));
-
- if (PersistMgr->m_Saving) {
- PersistMgr->Transfer(TMEMBER(m_Sprite->m_Filename));
+ PersistMgr->Transfer(TMEMBER(_alpha1));
+ PersistMgr->Transfer(TMEMBER(_alpha2));
+ PersistMgr->Transfer(TMEMBER(_border));
+ PersistMgr->Transfer(TMEMBER(_pos));
+ PersistMgr->Transfer(TMEMBER(_posZ));
+ PersistMgr->Transfer(TMEMBER(_velocity));
+ PersistMgr->Transfer(TMEMBER(_scale));
+ PersistMgr->Transfer(TMEMBER(_creationTime));
+ PersistMgr->Transfer(TMEMBER(_lifeTime));
+ PersistMgr->Transfer(TMEMBER(_isDead));
+ PersistMgr->Transfer(TMEMBER_INT(_state));
+ PersistMgr->Transfer(TMEMBER(_fadeStart));
+ PersistMgr->Transfer(TMEMBER(_fadeTime));
+ PersistMgr->Transfer(TMEMBER(_currentAlpha));
+ PersistMgr->Transfer(TMEMBER(_angVelocity));
+ PersistMgr->Transfer(TMEMBER(_rotation));
+ PersistMgr->Transfer(TMEMBER(_growthRate));
+ PersistMgr->Transfer(TMEMBER(_exponentialGrowth));
+ PersistMgr->Transfer(TMEMBER(_fadeStartAlpha));
+
+ if (PersistMgr->_saving) {
+ PersistMgr->Transfer(TMEMBER(_sprite->_filename));
} else {
char *Filename;
PersistMgr->Transfer(TMEMBER(Filename));
- CSysClassRegistry::GetInstance()->m_Disabled = true;
+ CSysClassRegistry::GetInstance()->_disabled = true;
SetSprite(Filename);
- CSysClassRegistry::GetInstance()->m_Disabled = false;
+ CSysClassRegistry::GetInstance()->_disabled = false;
delete[] Filename;
Filename = NULL;
}
diff --git a/engines/wintermute/PartParticle.h b/engines/wintermute/PartParticle.h
index eec3862b72..9de4248d6d 100644
--- a/engines/wintermute/PartParticle.h
+++ b/engines/wintermute/PartParticle.h
@@ -45,25 +45,25 @@ public:
CPartParticle(CBGame *inGame);
virtual ~CPartParticle(void);
- float m_GrowthRate;
- bool m_ExponentialGrowth;
-
- float m_Rotation;
- float m_AngVelocity;
-
- int m_Alpha1;
- int m_Alpha2;
-
- RECT m_Border;
- Vector2 m_Pos;
- float m_PosZ;
- Vector2 m_Velocity;
- float m_Scale;
- CBSprite *m_Sprite;
- uint32 m_CreationTime;
- int m_LifeTime;
- bool m_IsDead;
- TParticleState m_State;
+ float _growthRate;
+ bool _exponentialGrowth;
+
+ float _rotation;
+ float _angVelocity;
+
+ int _alpha1;
+ int _alpha2;
+
+ RECT _border;
+ Vector2 _pos;
+ float _posZ;
+ Vector2 _velocity;
+ float _scale;
+ CBSprite *_sprite;
+ uint32 _creationTime;
+ int _lifeTime;
+ bool _isDead;
+ TParticleState _state;
HRESULT Update(CPartEmitter *Emitter, uint32 CurrentTime, uint32 TimerDelta);
HRESULT Display(CPartEmitter *Emitter);
@@ -75,10 +75,10 @@ public:
HRESULT Persist(CBPersistMgr *PersistMgr);
private:
- uint32 m_FadeStart;
- int m_FadeTime;
- int m_CurrentAlpha;
- int m_FadeStartAlpha;
+ uint32 _fadeStart;
+ int _fadeTime;
+ int _currentAlpha;
+ int _fadeStartAlpha;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/PlatformSDL.cpp b/engines/wintermute/PlatformSDL.cpp
index 1b55c1ca35..f1a295b443 100644
--- a/engines/wintermute/PlatformSDL.cpp
+++ b/engines/wintermute/PlatformSDL.cpp
@@ -78,7 +78,7 @@ int CBPlatform::Initialize(CBGame *inGame, int argc, char *argv[]) {
// set ini name
sprintf(param, "./%s", IniName);
- Game->m_Registry->SetIniName(param);
+ Game->_registry->SetIniName(param);
delete [] IniDir;
delete [] IniName;
@@ -87,16 +87,16 @@ int CBPlatform::Initialize(CBGame *inGame, int argc, char *argv[]) {
}
- if (Game->m_Registry->ReadBool("Debug", "DebugMode")) Game->DEBUG_DebugEnable("./wme.log");
+ if (Game->_registry->ReadBool("Debug", "DebugMode")) Game->DEBUG_DebugEnable("./wme.log");
- Game->m_DEBUG_ShowFPS = Game->m_Registry->ReadBool("Debug", "ShowFPS");
+ Game->_dEBUG_ShowFPS = Game->_registry->ReadBool("Debug", "ShowFPS");
- if (Game->m_Registry->ReadBool("Debug", "DisableSmartCache")) {
+ if (Game->_registry->ReadBool("Debug", "DisableSmartCache")) {
Game->LOG(0, "Smart cache is DISABLED");
- Game->m_SmartCache = false;
+ Game->_smartCache = false;
}
- bool AllowDirectDraw = Game->m_Registry->ReadBool("Debug", "AllowDirectDraw", false);
+ bool AllowDirectDraw = Game->_registry->ReadBool("Debug", "AllowDirectDraw", false);
// load general game settings
Game->Initialize1();
@@ -116,14 +116,14 @@ int CBPlatform::Initialize(CBGame *inGame, int argc, char *argv[]) {
Game->Initialize2();
Game->GetDebugMgr()->OnGameInit();
- Game->m_ScEngine->LoadBreakpoints();
+ Game->_scEngine->LoadBreakpoints();
HRESULT ret;
// initialize the renderer
- ret = Game->m_Renderer->InitRenderer(Game->m_SettingsResWidth, Game->m_SettingsResHeight, windowedMode);
+ ret = Game->_renderer->InitRenderer(Game->_settingsResWidth, Game->_settingsResHeight, windowedMode);
if (FAILED(ret)) {
Game->LOG(ret, "Error initializing renderer. Exiting.");
@@ -139,7 +139,7 @@ int CBPlatform::Initialize(CBGame *inGame, int argc, char *argv[]) {
#endif
// initialize sound manager (non-fatal if we fail)
- ret = Game->m_SoundMgr->Initialize();
+ ret = Game->_soundMgr->Initialize();
if (FAILED(ret)) {
Game->LOG(ret, "Sound is NOT available.");
}
@@ -148,15 +148,15 @@ int CBPlatform::Initialize(CBGame *inGame, int argc, char *argv[]) {
// load game
uint32 DataInitStart = GetTime();
- if (FAILED(Game->LoadFile(Game->m_SettingsGameFile ? Game->m_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;
return false;
}
Game->SetWindowTitle();
- Game->m_Renderer->m_Ready = true;
- Game->m_MiniUpdateEnabled = true;
+ Game->_renderer->_ready = true;
+ Game->_miniUpdateEnabled = true;
Game->LOG(0, "Engine initialized in %d ms", GetTime() - DataInitStart);
Game->LOG(0, "");
@@ -182,7 +182,7 @@ int CBPlatform::MessageLoop() {
HandleEvent(&event);
}
- if (Game && Game->m_Renderer->m_Active && Game->m_Renderer->m_Ready) {
+ if (Game && Game->_renderer->_active && Game->_renderer->_ready) {
Game->DisplayContent();
Game->DisplayQuickMsg();
@@ -190,27 +190,27 @@ int CBPlatform::MessageLoop() {
Game->DisplayDebugInfo();
// ***** flip
- if (!Game->m_SuspendedRendering) Game->m_Renderer->Flip();
- if (Game->m_Loading) Game->LoadGame(Game->m_ScheduledLoadSlot);
+ if (!Game->_suspendedRendering) Game->_renderer->Flip();
+ if (Game->_loading) Game->LoadGame(Game->_scheduledLoadSlot);
}
- if (Game->m_Quitting) break;
+ if (Game->_quitting) break;
}
if (Game) {
// remember previous window position
/*
- if(Game->m_Renderer && Game->m_Renderer->m_Windowed)
+ if(Game->_renderer && Game->_renderer->_windowed)
{
- if(!::IsIconic(Game->m_Renderer->m_Window))
+ if(!::IsIconic(Game->_renderer->_window))
{
- int PosX = Game->m_Renderer->m_WindowRect.left;
- int PosY = Game->m_Renderer->m_WindowRect.top;
- PosX -= Game->m_Renderer->m_MonitorRect.left;
- PosY -= Game->m_Renderer->m_MonitorRect.top;
+ int PosX = Game->_renderer->_windowRect.left;
+ int PosY = Game->_renderer->_windowRect.top;
+ PosX -= Game->_renderer->_monitorRect.left;
+ PosY -= Game->_renderer->_monitorRect.top;
- Game->m_Registry->WriteInt("Video", "WindowPosX", PosX);
- Game->m_Registry->WriteInt("Video", "WindowPosY", PosY);
+ Game->_registry->WriteInt("Video", "WindowPosX", PosX);
+ Game->_registry->WriteInt("Video", "WindowPosY", PosY);
}
}
*/
@@ -229,14 +229,14 @@ void CBPlatform::HandleEvent(SDL_Event *event) {
#ifdef __IPHONEOS__
{
- CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->m_Renderer);
+ CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
POINT p;
GetCursorPos(&p);
Game->SetActiveObject(renderer->GetObjectAt(p.x, p.y));
- if (Game->m_ActiveObject != NULL && strcmp(Game->m_ActiveObject->GetClassName(), "CUIButton") == 0) {
- CUIButton *btn = static_cast<CUIButton *>(Game->m_ActiveObject);
- if (btn->m_Visible && !btn->m_Disable) btn->m_Press = true;
+ if (Game->_activeObject != NULL && strcmp(Game->_activeObject->GetClassName(), "CUIButton") == 0) {
+ CUIButton *btn = static_cast<CUIButton *>(Game->_activeObject);
+ if (btn->_visible && !btn->_disable) btn->_press = true;
}
}
#endif
@@ -307,7 +307,7 @@ void CBPlatform::HandleEvent(SDL_Event *event) {
#ifdef __IPHONEOS__
if (Game) {
Game->AutoSaveOnExit();
- Game->m_Quitting = true;
+ Game->_quitting = true;
}
#else
if (Game) Game->OnWindowClose();
@@ -357,7 +357,7 @@ uint32 CBPlatform::GetTime() {
//////////////////////////////////////////////////////////////////////////
BOOL CBPlatform::GetCursorPos(LPPOINT lpPoint) {
- CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->m_Renderer);
+ CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
int x, y;
SDL_GetMouseState(&x, &y);
@@ -371,7 +371,7 @@ BOOL CBPlatform::GetCursorPos(LPPOINT lpPoint) {
//////////////////////////////////////////////////////////////////////////
BOOL CBPlatform::SetCursorPos(int X, int Y) {
- CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->m_Renderer);
+ CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
POINT p;
p.x = X;
diff --git a/engines/wintermute/SysClass.cpp b/engines/wintermute/SysClass.cpp
index ebde28cdb1..b20c3f934a 100644
--- a/engines/wintermute/SysClass.cpp
+++ b/engines/wintermute/SysClass.cpp
@@ -39,14 +39,14 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CSysClass::CSysClass(const AnsiString &name, PERSISTBUILD build, PERSISTLOAD load, bool persistent_class) {
- m_Name = name;
+ _name = name;
- m_Build = build;
- m_Load = load;
- m_Next = NULL;
- m_SavedID = -1;
- m_Persistent = persistent_class;
- m_NumInst = 0;
+ _build = build;
+ _load = load;
+ _next = NULL;
+ _savedID = -1;
+ _persistent = persistent_class;
+ _numInst = 0;
CSysClassRegistry::GetInstance()->RegisterClass(this);
}
@@ -61,11 +61,11 @@ CSysClass::~CSysClass() {
//////////////////////////////////////////////////////////////////////////
bool CSysClass::RemoveAllInstances() {
InstanceMap::iterator it;
- for (it = m_InstanceMap.begin(); it != m_InstanceMap.end(); ++it) {
+ for (it = _instanceMap.begin(); it != _instanceMap.end(); ++it) {
delete(it->_value);
}
- //m_Instances.clear();
- m_InstanceMap.clear();
+ //_instances.clear();
+ _instanceMap.clear();
return true;
}
@@ -74,9 +74,9 @@ bool CSysClass::RemoveAllInstances() {
CSysInstance *CSysClass::AddInstance(void *instance, int id, int savedId) {
CSysInstance *inst = new CSysInstance(instance, id, this);
inst->SetSavedID(savedId);
- //m_Instances.insert(inst);
+ //_instances.insert(inst);
- m_InstanceMap[instance] = inst;
+ _instanceMap[instance] = inst;
CSysClassRegistry::GetInstance()->AddInstanceToTable(inst, instance);
@@ -86,25 +86,25 @@ CSysInstance *CSysClass::AddInstance(void *instance, int id, int savedId) {
//////////////////////////////////////////////////////////////////////////
bool CSysClass::RemoveInstance(void *instance) {
- InstanceMap::iterator mapIt = m_InstanceMap.find(instance);
- if (mapIt == m_InstanceMap.end()) return false;
+ InstanceMap::iterator mapIt = _instanceMap.find(instance);
+ if (mapIt == _instanceMap.end()) return false;
/*
- Instances::iterator it = m_Instances.find((*mapIt).second);
- if (it != m_Instances.end()) {
+ Instances::iterator it = _instances.find((*mapIt).second);
+ if (it != _instances.end()) {
delete(*it);
- m_Instances.erase(it);
+ _instances.erase(it);
}*/
delete mapIt->_value;
- m_InstanceMap.erase(mapIt);
+ _instanceMap.erase(mapIt);
return false;
}
//////////////////////////////////////////////////////////////////////////
int CSysClass::GetInstanceID(void *pointer) {
- InstanceMap::iterator mapIt = m_InstanceMap.find(pointer);
- if (mapIt == m_InstanceMap.end()) return -1;
+ InstanceMap::iterator mapIt = _instanceMap.find(pointer);
+ if (mapIt == _instanceMap.end()) return -1;
else return (*mapIt)._value->GetID();
}
@@ -112,11 +112,11 @@ int CSysClass::GetInstanceID(void *pointer) {
void *CSysClass::IDToPointer(int savedID) {
//slow
/*Instances::iterator it;
- for (it = m_Instances.begin(); it != m_Instances.end(); ++it) {
+ for (it = _instances.begin(); it != _instances.end(); ++it) {
if ((*it)->GetSavedID() == savedID) return (*it)->GetInstance();
}*/
InstanceMap::iterator it;
- for (it = m_InstanceMap.begin(); it != m_InstanceMap.end(); ++it) {
+ for (it = _instanceMap.begin(); it != _instanceMap.end(); ++it) {
if ((it->_value)->GetSavedID() == savedID) return (it->_value)->GetInstance();
}
return NULL;
@@ -124,56 +124,56 @@ void *CSysClass::IDToPointer(int savedID) {
//////////////////////////////////////////////////////////////////////////
int CSysClass::GetNumInstances() {
- //return m_Instances.size();
- return m_InstanceMap.size(); // TODO: This might break, if we have multiple keys per value.
+ //return _instances.size();
+ return _instanceMap.size(); // TODO: This might break, if we have multiple keys per value.
}
//////////////////////////////////////////////////////////////////////////
void CSysClass::Dump(void *stream) {
- fprintf((FILE*)stream, "%03d %c %-20s instances: %d\n", m_ID, m_Persistent ? 'p' : ' ', m_Name.c_str(), GetNumInstances());
+ fprintf((FILE*)stream, "%03d %c %-20s instances: %d\n", _iD, _persistent ? 'p' : ' ', _name.c_str(), GetNumInstances());
}
//////////////////////////////////////////////////////////////////////////
void CSysClass::SaveTable(CBGame *Game, CBPersistMgr *PersistMgr) {
- PersistMgr->PutString(m_Name.c_str());
- PersistMgr->PutDWORD(m_ID);
- PersistMgr->PutDWORD(m_InstanceMap.size());
+ PersistMgr->PutString(_name.c_str());
+ PersistMgr->PutDWORD(_iD);
+ PersistMgr->PutDWORD(_instanceMap.size());
InstanceMap::iterator it;
- for (it = m_InstanceMap.begin(); it != m_InstanceMap.end(); ++it) {
+ for (it = _instanceMap.begin(); it != _instanceMap.end(); ++it) {
PersistMgr->PutDWORD((it->_value)->GetID());
}
/*
Instances::iterator it;
- for (it = m_Instances.begin(); it != m_Instances.end(); ++it) {
+ for (it = _instances.begin(); it != _instances.end(); ++it) {
PersistMgr->PutDWORD((*it)->GetID());
}*/
}
//////////////////////////////////////////////////////////////////////////
void CSysClass::LoadTable(CBGame *Game, CBPersistMgr *PersistMgr) {
- m_SavedID = PersistMgr->GetDWORD();
+ _savedID = PersistMgr->GetDWORD();
int numInstances = PersistMgr->GetDWORD();
for (int i = 0; i < numInstances; i++) {
- if (m_Persistent) {
+ if (_persistent) {
int instId = PersistMgr->GetDWORD();
if (i > 0) {
- Game->LOG(0, "Warning: attempting to load multiple instances of persistent class %s (%d)", m_Name.c_str(), numInstances);
+ Game->LOG(0, "Warning: attempting to load multiple instances of persistent class %s (%d)", _name.c_str(), numInstances);
continue;
}
- InstanceMap::iterator it = m_InstanceMap.begin();
-/* Instances::iterator it = m_Instances.begin();*/
- if (it != m_InstanceMap.end()) {
+ InstanceMap::iterator it = _instanceMap.begin();
+/* Instances::iterator it = _instances.begin();*/
+ if (it != _instanceMap.end()) {
(it->_value)->SetSavedID(instId);
CSysClassRegistry::GetInstance()->AddInstanceToTable((it->_value), (it->_value)->GetInstance());
- } else Game->LOG(0, "Warning: instance %d of persistent class %s not found", i, m_Name.c_str());
+ } else Game->LOG(0, "Warning: instance %d of persistent class %s not found", i, _name.c_str());
}
// normal instances, create empty objects
else {
- void *emptyObject = m_Build();
+ void *emptyObject = _build();
AddInstance(emptyObject, CSysClassRegistry::GetInstance()->GetNextID(), PersistMgr->GetDWORD());
}
@@ -183,25 +183,25 @@ void CSysClass::LoadTable(CBGame *Game, CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
void CSysClass::SaveInstances(CBGame *Game, CBPersistMgr *PersistMgr) {
InstanceMap::iterator it;
- for (it = m_InstanceMap.begin(); it != m_InstanceMap.end(); ++it) {
+ for (it = _instanceMap.begin(); it != _instanceMap.end(); ++it) {
// write instace header
- PersistMgr->PutDWORD(m_ID);
+ PersistMgr->PutDWORD(_iD);
PersistMgr->PutDWORD((it->_value)->GetID());
- m_Load((it->_value)->GetInstance(), PersistMgr);
+ _load((it->_value)->GetInstance(), PersistMgr);
}
}
//////////////////////////////////////////////////////////////////////////
void CSysClass::LoadInstance(void *instance, CBPersistMgr *PersistMgr) {
- m_Load(instance, PersistMgr);
+ _load(instance, PersistMgr);
}
//////////////////////////////////////////////////////////////////////////
void CSysClass::ResetSavedIDs() {
InstanceMap::iterator it;
- for (it = m_InstanceMap.begin(); it != m_InstanceMap.end(); ++it) {
+ for (it = _instanceMap.begin(); it != _instanceMap.end(); ++it) {
(it->_value)->SetSavedID(-1);
}
}
@@ -209,7 +209,7 @@ void CSysClass::ResetSavedIDs() {
//////////////////////////////////////////////////////////////////////////
void CSysClass::InstanceCallback(SYS_INSTANCE_CALLBACK lpCallback, void *lpData) {
InstanceMap::iterator it;
- for (it = m_InstanceMap.begin(); it != m_InstanceMap.end(); ++it) {
+ for (it = _instanceMap.begin(); it != _instanceMap.end(); ++it) {
lpCallback((it->_value)->GetInstance(), lpData);
}
}
diff --git a/engines/wintermute/SysClass.h b/engines/wintermute/SysClass.h
index bcd63cc5e4..ca9ffe0082 100644
--- a/engines/wintermute/SysClass.h
+++ b/engines/wintermute/SysClass.h
@@ -63,22 +63,22 @@ public:
void *IDToPointer(int savedID);
void SetID(int id) {
- m_ID = id;
+ _iD = id;
}
int GetID() const {
- return m_ID;
+ return _iD;
}
int GetSavedID() const {
- return m_SavedID;
+ return _savedID;
}
bool IsPersistent() const {
- return m_Persistent;
+ return _persistent;
}
AnsiString GetName() const {
- return m_Name;
+ return _name;
}
void SaveTable(CBGame *Game, CBPersistMgr *PersistMgr);
@@ -94,20 +94,20 @@ public:
void Dump(void *stream);
private:
- int m_NumInst;
- bool m_Persistent;
- CSysClass *m_Next;
- int m_ID;
- int m_SavedID;
- AnsiString m_Name;
- PERSISTBUILD m_Build;
- PERSISTLOAD m_Load;
+ int _numInst;
+ bool _persistent;
+ CSysClass *_next;
+ int _iD;
+ int _savedID;
+ AnsiString _name;
+ PERSISTBUILD _build;
+ PERSISTLOAD _load;
//typedef std::set<CSysInstance *> Instances;
- //Instances m_Instances;
+ //Instances _instances;
typedef Common::HashMap<void *, CSysInstance *> InstanceMap;
- InstanceMap m_InstanceMap;
+ InstanceMap _instanceMap;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/SysClassRegistry.cpp b/engines/wintermute/SysClassRegistry.cpp
index 1170921768..64dfa6a988 100644
--- a/engines/wintermute/SysClassRegistry.cpp
+++ b/engines/wintermute/SysClassRegistry.cpp
@@ -52,12 +52,12 @@ CSysClassRegistry *CSysClassRegistry::GetInstance() {
//////////////////////////////////////////////////////////////////////////
bool CSysClassRegistry::RegisterClass(CSysClass *classObj) {
- classObj->SetID(m_Count++);
- //m_Classes.insert(classObj);
- m_Classes[classObj] = classObj;
+ classObj->SetID(_count++);
+ //_classes.insert(classObj);
+ _classes[classObj] = classObj;
- m_NameMap[classObj->GetName()] = classObj;
- m_IdMap[classObj->GetID()] = classObj;
+ _nameMap[classObj->GetName()] = classObj;
+ _idMap[classObj->GetID()] = classObj;
return true;
}
@@ -66,21 +66,21 @@ bool CSysClassRegistry::RegisterClass(CSysClass *classObj) {
//////////////////////////////////////////////////////////////////////////
bool CSysClassRegistry::UnregisterClass(CSysClass *classObj) {
- Classes::iterator it = m_Classes.find(classObj);
- if (it == m_Classes.end()) return false;
+ Classes::iterator it = _classes.find(classObj);
+ if (it == _classes.end()) return false;
if (classObj->GetNumInstances() != 0) {
char str[MAX_PATH];
sprintf(str, "Memory leak@class %-20s: %d instance(s) left\n", classObj->GetName().c_str(), classObj->GetNumInstances());
CBPlatform::OutputDebugString(str);
}
- m_Classes.erase(it);
+ _classes.erase(it);
- NameMap::iterator mapIt = m_NameMap.find(classObj->GetName());
- if (mapIt != m_NameMap.end()) m_NameMap.erase(mapIt);
+ NameMap::iterator mapIt = _nameMap.find(classObj->GetName());
+ if (mapIt != _nameMap.end()) _nameMap.erase(mapIt);
- IdMap::iterator idIt = m_IdMap.find(classObj->GetID());
- if (idIt != m_IdMap.end()) m_IdMap.erase(idIt);
+ IdMap::iterator idIt = _idMap.find(classObj->GetID());
+ if (idIt != _idMap.end()) _idMap.erase(idIt);
return true;
@@ -89,37 +89,37 @@ bool CSysClassRegistry::UnregisterClass(CSysClass *classObj) {
//////////////////////////////////////////////////////////////////////////
bool CSysClassRegistry::RegisterInstance(const char *className, void *instance) {
- if (m_Disabled) return true;
+ if (_disabled) return true;
- NameMap::iterator mapIt = m_NameMap.find(className);
- if (mapIt == m_NameMap.end()) return false;
+ NameMap::iterator mapIt = _nameMap.find(className);
+ if (mapIt == _nameMap.end()) return false;
- CSysInstance *inst = (*mapIt)._value->AddInstance(instance, m_Count++);
+ CSysInstance *inst = (*mapIt)._value->AddInstance(instance, _count++);
return (inst != NULL);
}
//////////////////////////////////////////////////////////////////////////
void CSysClassRegistry::AddInstanceToTable(CSysInstance *instance, void *pointer) {
- m_InstanceMap[pointer] = instance;
+ _instanceMap[pointer] = instance;
if (instance->GetSavedID() >= 0)
- m_SavedInstanceMap[instance->GetSavedID()] = instance;
+ _savedInstanceMap[instance->GetSavedID()] = instance;
}
//////////////////////////////////////////////////////////////////////////
int CSysClassRegistry::GetNextID() {
- return m_Count++;
+ return _count++;
}
//////////////////////////////////////////////////////////////////////////
bool CSysClassRegistry::UnregisterInstance(const char *className, void *instance) {
- NameMap::iterator mapIt = m_NameMap.find(className);
- if (mapIt == m_NameMap.end()) return false;
+ NameMap::iterator mapIt = _nameMap.find(className);
+ if (mapIt == _nameMap.end()) return false;
(*mapIt)._value->RemoveInstance(instance);
- InstanceMap::iterator instIt = m_InstanceMap.find(instance);
- if (instIt != m_InstanceMap.end()) {
- m_InstanceMap.erase(instIt);
+ InstanceMap::iterator instIt = _instanceMap.find(instance);
+ if (instIt != _instanceMap.end()) {
+ _instanceMap.erase(instIt);
return true;
} else return false;
}
@@ -129,8 +129,8 @@ bool CSysClassRegistry::UnregisterInstance(const char *className, void *instance
bool CSysClassRegistry::GetPointerID(void *pointer, int *classID, int *instanceID) {
if (pointer == NULL) return true;
- InstanceMap::iterator it = m_InstanceMap.find(pointer);
- if (it == m_InstanceMap.end()) return false;
+ InstanceMap::iterator it = _instanceMap.find(pointer);
+ if (it == _instanceMap.end()) return false;
CSysInstance *inst = (*it)._value;
@@ -142,26 +142,26 @@ bool CSysClassRegistry::GetPointerID(void *pointer, int *classID, int *instanceI
//////////////////////////////////////////////////////////////////////////
void *CSysClassRegistry::IDToPointer(int classID, int instanceID) {
- SavedInstanceMap::iterator it = m_SavedInstanceMap.find(instanceID);
- if (it == m_SavedInstanceMap.end()) return NULL;
+ SavedInstanceMap::iterator it = _savedInstanceMap.find(instanceID);
+ if (it == _savedInstanceMap.end()) return NULL;
else return (*it)._value->GetInstance();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CSysClassRegistry::SaveTable(CBGame *Game, CBPersistMgr *PersistMgr, bool quickSave) {
- PersistMgr->PutDWORD(m_Classes.size());
+ PersistMgr->PutDWORD(_classes.size());
int counter = 0;
Classes::iterator it;
- for (it = m_Classes.begin(); it != m_Classes.end(); ++it) {
+ for (it = _classes.begin(); it != _classes.end(); ++it) {
counter++;
if (!quickSave) {
- Game->m_IndicatorProgress = 50.0f / (float)((float)m_Classes.size() / (float)counter);
+ Game->_indicatorProgress = 50.0f / (float)((float)_classes.size() / (float)counter);
Game->DisplayContent(false);
- Game->m_Renderer->Flip();
+ Game->_renderer->Flip();
}
(it->_value)->SaveTable(Game, PersistMgr);
@@ -176,28 +176,28 @@ HRESULT CSysClassRegistry::LoadTable(CBGame *Game, CBPersistMgr *PersistMgr) {
Classes::iterator it;
// reset SavedID of current instances
- for (it = m_Classes.begin(); it != m_Classes.end(); ++it) {
+ for (it = _classes.begin(); it != _classes.end(); ++it) {
(it->_value)->ResetSavedIDs();
}
- for (it = m_Classes.begin(); it != m_Classes.end(); ++it) {
+ for (it = _classes.begin(); it != _classes.end(); ++it) {
if ((it->_value)->IsPersistent()) continue;
(it->_value)->RemoveAllInstances();
}
- m_InstanceMap.clear();
+ _instanceMap.clear();
int numClasses = PersistMgr->GetDWORD();
for (int i = 0; i < numClasses; i++) {
- Game->m_IndicatorProgress = 50.0f / (float)((float)numClasses / (float)i);
+ Game->_indicatorProgress = 50.0f / (float)((float)numClasses / (float)i);
Game->DisplayContentSimple();
- Game->m_Renderer->Flip();
+ Game->_renderer->Flip();
char *className = PersistMgr->GetString();
- NameMap::iterator mapIt = m_NameMap.find(className);
- if (mapIt != m_NameMap.end())(*mapIt)._value->LoadTable(Game, PersistMgr);
+ NameMap::iterator mapIt = _nameMap.find(className);
+ if (mapIt != _nameMap.end())(*mapIt)._value->LoadTable(Game, PersistMgr);
}
return S_OK;
@@ -211,21 +211,21 @@ HRESULT CSysClassRegistry::SaveInstances(CBGame *Game, CBPersistMgr *PersistMgr,
// count total instances
int numInstances = 0;
- for (it = m_Classes.begin(); it != m_Classes.end(); ++it) {
+ for (it = _classes.begin(); it != _classes.end(); ++it) {
numInstances += (it->_value)->GetNumInstances();
}
PersistMgr->PutDWORD(numInstances);
int counter = 0;
- for (it = m_Classes.begin(); it != m_Classes.end(); ++it) {
+ for (it = _classes.begin(); it != _classes.end(); ++it) {
counter++;
if (!quickSave) {
if (counter % 20 == 0) {
- Game->m_IndicatorProgress = 50 + 50.0f / (float)((float)m_Classes.size() / (float)counter);
+ Game->_indicatorProgress = 50 + 50.0f / (float)((float)_classes.size() / (float)counter);
Game->DisplayContent(false);
- Game->m_Renderer->Flip();
+ Game->_renderer->Flip();
}
}
Game->MiniUpdate();
@@ -244,9 +244,9 @@ HRESULT CSysClassRegistry::LoadInstances(CBGame *Game, CBPersistMgr *PersistMgr)
for (int i = 0; i < numInstances; i++) {
if (i % 20 == 0) {
- Game->m_IndicatorProgress = 50 + 50.0f / (float)((float)numInstances / (float)i);
+ Game->_indicatorProgress = 50 + 50.0f / (float)((float)numInstances / (float)i);
Game->DisplayContentSimple();
- Game->m_Renderer->Flip();
+ Game->_renderer->Flip();
}
int classID = PersistMgr->GetDWORD();
@@ -255,14 +255,14 @@ HRESULT CSysClassRegistry::LoadInstances(CBGame *Game, CBPersistMgr *PersistMgr)
Classes::iterator it;
- for (it = m_Classes.begin(); it != m_Classes.end(); ++it) {
+ for (it = _classes.begin(); it != _classes.end(); ++it) {
if ((it->_value)->GetSavedID() == classID) {
(it->_value)->LoadInstance(instance, PersistMgr);
}
}
}
- m_SavedInstanceMap.clear();
+ _savedInstanceMap.clear();
return S_OK;
}
@@ -270,8 +270,8 @@ HRESULT CSysClassRegistry::LoadInstances(CBGame *Game, CBPersistMgr *PersistMgr)
//////////////////////////////////////////////////////////////////////////
HRESULT CSysClassRegistry::EnumInstances(SYS_INSTANCE_CALLBACK lpCallback, const char *className, void *lpData) {
- NameMap::iterator mapIt = m_NameMap.find(className);
- if (mapIt == m_NameMap.end()) return E_FAIL;
+ NameMap::iterator mapIt = _nameMap.find(className);
+ if (mapIt == _nameMap.end()) return E_FAIL;
(*mapIt)._value->InstanceCallback(lpCallback, lpData);
return S_OK;
@@ -281,7 +281,7 @@ HRESULT CSysClassRegistry::EnumInstances(SYS_INSTANCE_CALLBACK lpCallback, const
//////////////////////////////////////////////////////////////////////////
void CSysClassRegistry::DumpClasses(void *stream) {
Classes::iterator it;
- for (it = m_Classes.begin(); it != m_Classes.end(); ++it)
+ for (it = _classes.begin(); it != _classes.end(); ++it)
(it->_value)->Dump(stream);
}
diff --git a/engines/wintermute/SysClassRegistry.h b/engines/wintermute/SysClassRegistry.h
index 6d3367fc30..84c4053ee9 100644
--- a/engines/wintermute/SysClassRegistry.h
+++ b/engines/wintermute/SysClassRegistry.h
@@ -80,23 +80,23 @@ public:
CSysClassRegistry();
virtual ~CSysClassRegistry();
- bool m_Disabled;
- int m_Count;
+ bool _disabled;
+ int _count;
typedef Common::HashMap<CSysClass *, CSysClass *> Classes;
- Classes m_Classes;
+ Classes _classes;
typedef Common::HashMap<AnsiString, CSysClass *> NameMap;
- NameMap m_NameMap;
+ NameMap _nameMap;
typedef Common::HashMap<int, CSysClass *> IdMap;
- IdMap m_IdMap;
+ IdMap _idMap;
typedef Common::HashMap<void *, CSysInstance *> InstanceMap;
- InstanceMap m_InstanceMap;
+ InstanceMap _instanceMap;
typedef Common::HashMap<int, CSysInstance *> SavedInstanceMap;
- SavedInstanceMap m_SavedInstanceMap;
+ SavedInstanceMap _savedInstanceMap;
};
diff --git a/engines/wintermute/SysInstance.cpp b/engines/wintermute/SysInstance.cpp
index 857a857a45..fbbfea87cd 100644
--- a/engines/wintermute/SysInstance.cpp
+++ b/engines/wintermute/SysInstance.cpp
@@ -34,12 +34,12 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
CSysInstance::CSysInstance(void *Instance, int ID, CSysClass *sysClass) {
- m_Instance = Instance;
- m_ID = ID;
- m_SavedID = -1;
- m_Class = sysClass;
+ _instance = Instance;
+ _iD = ID;
+ _savedID = -1;
+ _class = sysClass;
- m_Used = false;
+ _used = false;
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/SysInstance.h b/engines/wintermute/SysInstance.h
index 0286204c8e..80221d13a9 100644
--- a/engines/wintermute/SysInstance.h
+++ b/engines/wintermute/SysInstance.h
@@ -39,28 +39,28 @@ public:
virtual ~CSysInstance();
int GetID() const {
- return m_ID;
+ return _iD;
}
int GetSavedID() const {
- return m_SavedID;
+ return _savedID;
}
void *GetInstance() const {
- return m_Instance;
+ return _instance;
}
CSysClass *GetClass() const {
- return m_Class;
+ return _class;
}
void SetSavedID(int id) {
- m_SavedID = id;
+ _savedID = id;
}
private:
- bool m_Used;
- int m_ID;
- int m_SavedID;
- void *m_Instance;
- CSysClass *m_Class;
+ bool _used;
+ int _iD;
+ int _savedID;
+ void *_instance;
+ CSysClass *_class;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/UIButton.cpp b/engines/wintermute/UIButton.cpp
index 1053cec166..ebb72cbe97 100644
--- a/engines/wintermute/UIButton.cpp
+++ b/engines/wintermute/UIButton.cpp
@@ -49,54 +49,54 @@ IMPLEMENT_PERSISTENT(CUIButton, false)
//////////////////////////////////////////////////////////////////////////
CUIButton::CUIButton(CBGame *inGame): CUIObject(inGame) {
- m_BackPress = m_BackHover = m_BackDisable = m_BackFocus = NULL;
+ _backPress = _backHover = _backDisable = _backFocus = NULL;
- m_FontHover = m_FontPress = m_FontDisable = m_FontFocus = NULL;
+ _fontHover = _fontPress = _fontDisable = _fontFocus = NULL;
- m_ImageDisable = m_ImagePress = m_ImageHover = m_ImageFocus = NULL;
+ _imageDisable = _imagePress = _imageHover = _imageFocus = NULL;
- m_Align = TAL_CENTER;
+ _align = TAL_CENTER;
- m_Hover = m_Press = false;
+ _hover = _press = false;
- m_Type = UI_BUTTON;
+ _type = UI_BUTTON;
- m_CanFocus = false;
- m_StayPressed = false;
+ _canFocus = false;
+ _stayPressed = false;
- m_OneTimePress = false;
- m_CenterImage = false;
+ _oneTimePress = false;
+ _centerImage = false;
- m_PixelPerfect = false;
+ _pixelPerfect = false;
}
//////////////////////////////////////////////////////////////////////////
CUIButton::~CUIButton() {
- if (m_BackPress) delete m_BackPress;
- if (m_BackHover) delete m_BackHover;
- if (m_BackDisable) delete m_BackDisable;
- if (m_BackFocus) delete m_BackFocus;
-
- if (!m_SharedFonts) {
- if (m_FontHover) Game->m_FontStorage->RemoveFont(m_FontHover);
- if (m_FontPress) Game->m_FontStorage->RemoveFont(m_FontPress);
- if (m_FontDisable) Game->m_FontStorage->RemoveFont(m_FontDisable);
- if (m_FontFocus) Game->m_FontStorage->RemoveFont(m_FontFocus);
+ if (_backPress) delete _backPress;
+ if (_backHover) delete _backHover;
+ if (_backDisable) delete _backDisable;
+ if (_backFocus) delete _backFocus;
+
+ if (!_sharedFonts) {
+ if (_fontHover) Game->_fontStorage->RemoveFont(_fontHover);
+ if (_fontPress) Game->_fontStorage->RemoveFont(_fontPress);
+ if (_fontDisable) Game->_fontStorage->RemoveFont(_fontDisable);
+ if (_fontFocus) Game->_fontStorage->RemoveFont(_fontFocus);
}
- if (!m_SharedImages) {
- if (m_ImageHover) delete m_ImageHover;
- if (m_ImagePress) delete m_ImagePress;
- if (m_ImageDisable) delete m_ImageDisable;
- if (m_ImageFocus) delete m_ImageFocus;
+ if (!_sharedImages) {
+ if (_imageHover) delete _imageHover;
+ if (_imagePress) delete _imagePress;
+ if (_imageDisable) delete _imageDisable;
+ if (_imageFocus) delete _imageFocus;
}
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUIButton::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CUIButton::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -104,8 +104,8 @@ HRESULT CUIButton::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -222,168 +222,168 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_BACK:
- delete m_Back;
- m_Back = new CUITiledImage(Game);
- if (!m_Back || FAILED(m_Back->LoadFile((char *)params))) {
- delete m_Back;
- m_Back = NULL;
+ delete _back;
+ _back = new CUITiledImage(Game);
+ if (!_back || FAILED(_back->LoadFile((char *)params))) {
+ delete _back;
+ _back = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_BACK_HOVER:
- delete m_BackHover;
- m_BackHover = new CUITiledImage(Game);
- if (!m_BackHover || FAILED(m_BackHover->LoadFile((char *)params))) {
- delete m_BackHover;
- m_BackHover = NULL;
+ delete _backHover;
+ _backHover = new CUITiledImage(Game);
+ if (!_backHover || FAILED(_backHover->LoadFile((char *)params))) {
+ delete _backHover;
+ _backHover = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_BACK_PRESS:
- delete m_BackPress;
- m_BackPress = new CUITiledImage(Game);
- if (!m_BackPress || FAILED(m_BackPress->LoadFile((char *)params))) {
- delete m_BackPress;
- m_BackPress = NULL;
+ delete _backPress;
+ _backPress = new CUITiledImage(Game);
+ if (!_backPress || FAILED(_backPress->LoadFile((char *)params))) {
+ delete _backPress;
+ _backPress = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_BACK_DISABLE:
- delete m_BackDisable;
- m_BackDisable = new CUITiledImage(Game);
- if (!m_BackDisable || FAILED(m_BackDisable->LoadFile((char *)params))) {
- delete m_BackDisable;
- m_BackDisable = NULL;
+ delete _backDisable;
+ _backDisable = new CUITiledImage(Game);
+ if (!_backDisable || FAILED(_backDisable->LoadFile((char *)params))) {
+ delete _backDisable;
+ _backDisable = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_BACK_FOCUS:
- delete m_BackFocus;
- m_BackFocus = new CUITiledImage(Game);
- if (!m_BackFocus || FAILED(m_BackFocus->LoadFile((char *)params))) {
- delete m_BackFocus;
- m_BackFocus = NULL;
+ delete _backFocus;
+ _backFocus = new CUITiledImage(Game);
+ if (!_backFocus || FAILED(_backFocus->LoadFile((char *)params))) {
+ delete _backFocus;
+ _backFocus = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE:
- delete m_Image;
- m_Image = new CBSprite(Game);
- if (!m_Image || FAILED(m_Image->LoadFile((char *)params))) {
- delete m_Image;
- m_Image = NULL;
+ delete _image;
+ _image = new CBSprite(Game);
+ if (!_image || FAILED(_image->LoadFile((char *)params))) {
+ delete _image;
+ _image = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE_HOVER:
- delete m_ImageHover;
- m_ImageHover = new CBSprite(Game);
- if (!m_ImageHover || FAILED(m_ImageHover->LoadFile((char *)params))) {
- delete m_ImageHover;
- m_ImageHover = NULL;
+ delete _imageHover;
+ _imageHover = new CBSprite(Game);
+ if (!_imageHover || FAILED(_imageHover->LoadFile((char *)params))) {
+ delete _imageHover;
+ _imageHover = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE_PRESS:
- delete m_ImagePress;
- m_ImagePress = new CBSprite(Game);
- if (!m_ImagePress || FAILED(m_ImagePress->LoadFile((char *)params))) {
- delete m_ImagePress;
- m_ImagePress = NULL;
+ delete _imagePress;
+ _imagePress = new CBSprite(Game);
+ if (!_imagePress || FAILED(_imagePress->LoadFile((char *)params))) {
+ delete _imagePress;
+ _imagePress = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE_DISABLE:
- delete m_ImageDisable;
- m_ImageDisable = new CBSprite(Game);
- if (!m_ImageDisable || FAILED(m_ImageDisable->LoadFile((char *)params))) {
- delete m_ImageDisable;
- m_ImageDisable = NULL;
+ delete _imageDisable;
+ _imageDisable = new CBSprite(Game);
+ if (!_imageDisable || FAILED(_imageDisable->LoadFile((char *)params))) {
+ delete _imageDisable;
+ _imageDisable = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE_FOCUS:
- delete m_ImageFocus;
- m_ImageFocus = new CBSprite(Game);
- if (!m_ImageFocus || FAILED(m_ImageFocus->LoadFile((char *)params))) {
- delete m_ImageFocus;
- m_ImageFocus = NULL;
+ delete _imageFocus;
+ _imageFocus = new CBSprite(Game);
+ if (!_imageFocus || FAILED(_imageFocus->LoadFile((char *)params))) {
+ delete _imageFocus;
+ _imageFocus = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_FONT:
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
- m_Font = Game->m_FontStorage->AddFont((char *)params);
- if (!m_Font) cmd = PARSERR_GENERIC;
+ if (_font) Game->_fontStorage->RemoveFont(_font);
+ _font = Game->_fontStorage->AddFont((char *)params);
+ if (!_font) cmd = PARSERR_GENERIC;
break;
case TOKEN_FONT_HOVER:
- if (m_FontHover) Game->m_FontStorage->RemoveFont(m_FontHover);
- m_FontHover = Game->m_FontStorage->AddFont((char *)params);
- if (!m_FontHover) cmd = PARSERR_GENERIC;
+ if (_fontHover) Game->_fontStorage->RemoveFont(_fontHover);
+ _fontHover = Game->_fontStorage->AddFont((char *)params);
+ if (!_fontHover) cmd = PARSERR_GENERIC;
break;
case TOKEN_FONT_PRESS:
- if (m_FontPress) Game->m_FontStorage->RemoveFont(m_FontPress);
- m_FontPress = Game->m_FontStorage->AddFont((char *)params);
- if (!m_FontPress) cmd = PARSERR_GENERIC;
+ if (_fontPress) Game->_fontStorage->RemoveFont(_fontPress);
+ _fontPress = Game->_fontStorage->AddFont((char *)params);
+ if (!_fontPress) cmd = PARSERR_GENERIC;
break;
case TOKEN_FONT_DISABLE:
- if (m_FontDisable) Game->m_FontStorage->RemoveFont(m_FontDisable);
- m_FontDisable = Game->m_FontStorage->AddFont((char *)params);
- if (!m_FontDisable) cmd = PARSERR_GENERIC;
+ if (_fontDisable) Game->_fontStorage->RemoveFont(_fontDisable);
+ _fontDisable = Game->_fontStorage->AddFont((char *)params);
+ if (!_fontDisable) cmd = PARSERR_GENERIC;
break;
case TOKEN_FONT_FOCUS:
- if (m_FontFocus) Game->m_FontStorage->RemoveFont(m_FontFocus);
- m_FontFocus = Game->m_FontStorage->AddFont((char *)params);
- if (!m_FontFocus) cmd = PARSERR_GENERIC;
+ if (_fontFocus) Game->_fontStorage->RemoveFont(_fontFocus);
+ _fontFocus = Game->_fontStorage->AddFont((char *)params);
+ if (!_fontFocus) cmd = PARSERR_GENERIC;
break;
case TOKEN_TEXT:
SetText((char *)params);
- Game->m_StringTable->Expand(&m_Text);
+ Game->_stringTable->Expand(&_text);
break;
case TOKEN_TEXT_ALIGN:
- if (scumm_stricmp((char *)params, "left") == 0) m_Align = TAL_LEFT;
- else if (scumm_stricmp((char *)params, "right") == 0) m_Align = TAL_RIGHT;
- else m_Align = TAL_CENTER;
+ if (scumm_stricmp((char *)params, "left") == 0) _align = TAL_LEFT;
+ else if (scumm_stricmp((char *)params, "right") == 0) _align = TAL_RIGHT;
+ else _align = TAL_CENTER;
break;
case TOKEN_X:
- parser.ScanStr((char *)params, "%d", &m_PosX);
+ parser.ScanStr((char *)params, "%d", &_posX);
break;
case TOKEN_Y:
- parser.ScanStr((char *)params, "%d", &m_PosY);
+ parser.ScanStr((char *)params, "%d", &_posY);
break;
case TOKEN_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_Width);
+ parser.ScanStr((char *)params, "%d", &_width);
break;
case TOKEN_HEIGHT:
- parser.ScanStr((char *)params, "%d", &m_Height);
+ parser.ScanStr((char *)params, "%d", &_height);
break;
case TOKEN_CURSOR:
- delete m_Cursor;
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- delete m_Cursor;
- m_Cursor = NULL;
+ delete _cursor;
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
@@ -393,31 +393,31 @@ HRESULT CUIButton::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_PARENT_NOTIFY:
- parser.ScanStr((char *)params, "%b", &m_ParentNotify);
+ parser.ScanStr((char *)params, "%b", &_parentNotify);
break;
case TOKEN_DISABLED:
- parser.ScanStr((char *)params, "%b", &m_Disable);
+ parser.ScanStr((char *)params, "%b", &_disable);
break;
case TOKEN_VISIBLE:
- parser.ScanStr((char *)params, "%b", &m_Visible);
+ parser.ScanStr((char *)params, "%b", &_visible);
break;
case TOKEN_FOCUSABLE:
- parser.ScanStr((char *)params, "%b", &m_CanFocus);
+ parser.ScanStr((char *)params, "%b", &_canFocus);
break;
case TOKEN_CENTER_IMAGE:
- parser.ScanStr((char *)params, "%b", &m_CenterImage);
+ parser.ScanStr((char *)params, "%b", &_centerImage);
break;
case TOKEN_PRESSED:
- parser.ScanStr((char *)params, "%b", &m_StayPressed);
+ parser.ScanStr((char *)params, "%b", &_stayPressed);
break;
case TOKEN_PIXEL_PERFECT:
- parser.ScanStr((char *)params, "%b", &m_PixelPerfect);
+ parser.ScanStr((char *)params, "%b", &_pixelPerfect);
break;
case TOKEN_EDITOR_PROPERTY:
@@ -444,54 +444,54 @@ HRESULT CUIButton::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "BUTTON\n");
Buffer->PutTextIndent(Indent, "{\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
Buffer->PutTextIndent(Indent + 2, "\n");
- if (m_Back && m_Back->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK=\"%s\"\n", m_Back->m_Filename);
- if (m_BackHover && m_BackHover->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK_HOVER=\"%s\"\n", m_BackHover->m_Filename);
- if (m_BackPress && m_BackPress->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK_PRESS=\"%s\"\n", m_BackPress->m_Filename);
- if (m_BackDisable && m_BackDisable->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK_DISABLE=\"%s\"\n", m_BackDisable->m_Filename);
- if (m_BackFocus && m_BackFocus->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK_FOCUS=\"%s\"\n", m_BackFocus->m_Filename);
-
- if (m_Image && m_Image->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", m_Image->m_Filename);
- if (m_ImageHover && m_ImageHover->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE_HOVER=\"%s\"\n", m_ImageHover->m_Filename);
- if (m_ImagePress && m_ImagePress->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE_PRESS=\"%s\"\n", m_ImagePress->m_Filename);
- if (m_ImageDisable && m_ImageDisable->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE_DISABLE=\"%s\"\n", m_ImageDisable->m_Filename);
- if (m_ImageFocus && m_ImageFocus->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE_FOCUS=\"%s\"\n", m_ImageFocus->m_Filename);
-
- if (m_Font && m_Font->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", m_Font->m_Filename);
- if (m_FontHover && m_FontHover->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT_HOVER=\"%s\"\n", m_FontHover->m_Filename);
- if (m_FontPress && m_FontPress->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT_PRESS=\"%s\"\n", m_FontPress->m_Filename);
- if (m_FontDisable && m_FontDisable->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT_DISABLE=\"%s\"\n", m_FontDisable->m_Filename);
- if (m_FontFocus && m_FontFocus->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT_FOCUS=\"%s\"\n", m_FontFocus->m_Filename);
-
- if (m_Cursor && m_Cursor->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", m_Cursor->m_Filename);
+ if (_back && _back->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
+ if (_backHover && _backHover->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK_HOVER=\"%s\"\n", _backHover->_filename);
+ if (_backPress && _backPress->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK_PRESS=\"%s\"\n", _backPress->_filename);
+ if (_backDisable && _backDisable->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK_DISABLE=\"%s\"\n", _backDisable->_filename);
+ if (_backFocus && _backFocus->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK_FOCUS=\"%s\"\n", _backFocus->_filename);
+
+ if (_image && _image->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
+ if (_imageHover && _imageHover->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE_HOVER=\"%s\"\n", _imageHover->_filename);
+ if (_imagePress && _imagePress->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE_PRESS=\"%s\"\n", _imagePress->_filename);
+ if (_imageDisable && _imageDisable->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE_DISABLE=\"%s\"\n", _imageDisable->_filename);
+ if (_imageFocus && _imageFocus->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE_FOCUS=\"%s\"\n", _imageFocus->_filename);
+
+ if (_font && _font->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
+ if (_fontHover && _fontHover->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT_HOVER=\"%s\"\n", _fontHover->_filename);
+ if (_fontPress && _fontPress->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT_PRESS=\"%s\"\n", _fontPress->_filename);
+ if (_fontDisable && _fontDisable->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT_DISABLE=\"%s\"\n", _fontDisable->_filename);
+ if (_fontFocus && _fontFocus->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT_FOCUS=\"%s\"\n", _fontFocus->_filename);
+
+ if (_cursor && _cursor->_filename)
+ Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
Buffer->PutTextIndent(Indent + 2, "\n");
- if (m_Text)
- Buffer->PutTextIndent(Indent + 2, "TEXT=\"%s\"\n", m_Text);
+ if (_text)
+ Buffer->PutTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
- switch (m_Align) {
+ switch (_align) {
case TAL_LEFT:
Buffer->PutTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
break;
@@ -505,25 +505,25 @@ HRESULT CUIButton::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent + 2, "\n");
- Buffer->PutTextIndent(Indent + 2, "X=%d\n", m_PosX);
- Buffer->PutTextIndent(Indent + 2, "Y=%d\n", m_PosY);
- Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", m_Width);
- Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", m_Height);
+ Buffer->PutTextIndent(Indent + 2, "X=%d\n", _posX);
+ Buffer->PutTextIndent(Indent + 2, "Y=%d\n", _posY);
+ Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", _width);
+ Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
- Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", m_Disable ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", m_Visible ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", m_ParentNotify ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "FOCUSABLE=%s\n", m_CanFocus ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "CENTER_IMAGE=%s\n", m_CenterImage ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "PRESSED=%s\n", m_StayPressed ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "PIXEL_PERFECT=%s\n", m_PixelPerfect ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "FOCUSABLE=%s\n", _canFocus ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "CENTER_IMAGE=%s\n", _centerImage ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "PRESSED=%s\n", _stayPressed ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "PIXEL_PERFECT=%s\n", _pixelPerfect ? "TRUE" : "FALSE");
Buffer->PutTextIndent(Indent + 2, "\n");
// scripts
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
Buffer->PutTextIndent(Indent + 2, "\n");
@@ -540,111 +540,111 @@ void CUIButton::CorrectSize() {
RECT rect;
CBSprite *img = NULL;
- if (m_Image) img = m_Image;
- else if (m_ImageDisable) img = m_ImageDisable;
- else if (m_ImageHover) img = m_ImageHover;
- else if (m_ImagePress) img = m_ImagePress;
- else if (m_ImageFocus) img = m_ImageFocus;
+ if (_image) img = _image;
+ else if (_imageDisable) img = _imageDisable;
+ else if (_imageHover) img = _imageHover;
+ else if (_imagePress) img = _imagePress;
+ else if (_imageFocus) img = _imageFocus;
- if (m_Width <= 0) {
+ if (_width <= 0) {
if (img) {
img->GetBoundingRect(&rect, 0, 0);
- m_Width = rect.right - rect.left;
- } else m_Width = 100;
+ _width = rect.right - rect.left;
+ } else _width = 100;
}
- if (m_Height <= 0) {
+ if (_height <= 0) {
if (img) {
img->GetBoundingRect(&rect, 0, 0);
- m_Height = rect.bottom - rect.top;
+ _height = rect.bottom - rect.top;
}
}
- if (m_Text) {
+ if (_text) {
int text_height;
- if (m_Font) text_height = m_Font->GetTextHeight((byte *)m_Text, m_Width);
- else text_height = Game->m_SystemFont->GetTextHeight((byte *)m_Text, m_Width);
+ if (_font) text_height = _font->GetTextHeight((byte *)_text, _width);
+ else text_height = Game->_systemFont->GetTextHeight((byte *)_text, _width);
- if (text_height > m_Height) m_Height = text_height;
+ if (text_height > _height) _height = text_height;
}
- if (m_Height <= 0) m_Height = 100;
+ if (_height <= 0) _height = 100;
- if (m_Back) m_Back->CorrectSize(&m_Width, &m_Height);
+ if (_back) _back->CorrectSize(&_width, &_height);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUIButton::Display(int OffsetX, int OffsetY) {
- if (!m_Visible) return S_OK;
+ if (!_visible) return S_OK;
CUITiledImage *back = NULL;
CBSprite *image = NULL;
CBFont *font = 0;
//RECT rect;
- //CBPlatform::SetRect(&rect, OffsetX + m_PosX, OffsetY + m_PosY, OffsetX+m_PosX+m_Width, OffsetY+m_PosY+m_Height);
- //m_Hover = (!m_Disable && CBPlatform::PtInRect(&rect, Game->m_MousePos)!=FALSE);
- m_Hover = (!m_Disable && Game->m_ActiveObject == this && (Game->m_Interactive || Game->m_State == GAME_SEMI_FROZEN));
-
- if ((m_Press && m_Hover && !Game->m_MouseLeftDown) ||
- m_OneTimePress && CBPlatform::GetTime() - m_OneTimePressTime >= 100) Press();
-
-
- if (m_Disable) {
- if (m_BackDisable) back = m_BackDisable;
- if (m_ImageDisable) image = m_ImageDisable;
- if (m_Text && m_FontDisable) font = m_FontDisable;
- } else if (m_Press || m_OneTimePress || m_StayPressed) {
- if (m_BackPress) back = m_BackPress;
- if (m_ImagePress) image = m_ImagePress;
- if (m_Text && m_FontPress) font = m_FontPress;
- } else if (m_Hover) {
- if (m_BackHover) back = m_BackHover;
- if (m_ImageHover) image = m_ImageHover;
- if (m_Text && m_FontHover) font = m_FontHover;
- } else if (m_CanFocus && IsFocused()) {
- if (m_BackFocus) back = m_BackFocus;
- if (m_ImageFocus) image = m_ImageFocus;
- if (m_Text && m_FontFocus) font = m_FontFocus;
+ //CBPlatform::SetRect(&rect, OffsetX + _posX, OffsetY + _posY, OffsetX+_posX+_width, OffsetY+_posY+_height);
+ //_hover = (!_disable && CBPlatform::PtInRect(&rect, Game->_mousePos)!=FALSE);
+ _hover = (!_disable && Game->_activeObject == this && (Game->_interactive || Game->_state == GAME_SEMI_FROZEN));
+
+ if ((_press && _hover && !Game->_mouseLeftDown) ||
+ _oneTimePress && CBPlatform::GetTime() - _oneTimePressTime >= 100) Press();
+
+
+ if (_disable) {
+ if (_backDisable) back = _backDisable;
+ if (_imageDisable) image = _imageDisable;
+ if (_text && _fontDisable) font = _fontDisable;
+ } else if (_press || _oneTimePress || _stayPressed) {
+ if (_backPress) back = _backPress;
+ if (_imagePress) image = _imagePress;
+ if (_text && _fontPress) font = _fontPress;
+ } else if (_hover) {
+ if (_backHover) back = _backHover;
+ if (_imageHover) image = _imageHover;
+ if (_text && _fontHover) font = _fontHover;
+ } else if (_canFocus && IsFocused()) {
+ if (_backFocus) back = _backFocus;
+ if (_imageFocus) image = _imageFocus;
+ if (_text && _fontFocus) font = _fontFocus;
}
- if (!back && m_Back) back = m_Back;
- if (!image && m_Image) image = m_Image;
- if (m_Text && !font) {
- if (m_Font) font = m_Font;
- else font = Game->m_SystemFont;
+ if (!back && _back) back = _back;
+ if (!image && _image) image = _image;
+ if (_text && !font) {
+ if (_font) font = _font;
+ else font = Game->_systemFont;
}
- int ImageX = OffsetX + m_PosX;
- int ImageY = OffsetY + m_PosY;
+ int ImageX = OffsetX + _posX;
+ int ImageY = OffsetY + _posY;
- if (image && m_CenterImage) {
+ if (image && _centerImage) {
RECT rc;
image->GetBoundingRect(&rc, 0, 0);
- ImageX += (m_Width - (rc.right - rc.left)) / 2;
- ImageY += (m_Height - (rc.bottom - rc.top)) / 2;
+ ImageX += (_width - (rc.right - rc.left)) / 2;
+ ImageY += (_height - (rc.bottom - rc.top)) / 2;
}
- if (back) back->Display(OffsetX + m_PosX, OffsetY + m_PosY, m_Width, m_Height);
- //if(image) image->Draw(ImageX +((m_Press||m_OneTimePress)&&back?1:0), ImageY +((m_Press||m_OneTimePress)&&back?1:0), NULL);
- if (image) image->Draw(ImageX + ((m_Press || m_OneTimePress) && back ? 1 : 0), ImageY + ((m_Press || m_OneTimePress) && back ? 1 : 0), m_PixelPerfect ? this : NULL);
+ if (back) back->Display(OffsetX + _posX, OffsetY + _posY, _width, _height);
+ //if(image) image->Draw(ImageX +((_press||_oneTimePress)&&back?1:0), ImageY +((_press||_oneTimePress)&&back?1:0), NULL);
+ if (image) image->Draw(ImageX + ((_press || _oneTimePress) && back ? 1 : 0), ImageY + ((_press || _oneTimePress) && back ? 1 : 0), _pixelPerfect ? this : NULL);
- if (font && m_Text) {
- int text_offset = (m_Height - font->GetTextHeight((byte *)m_Text, m_Width)) / 2;
- font->DrawText((byte *)m_Text, OffsetX + m_PosX + ((m_Press || m_OneTimePress) ? 1 : 0), OffsetY + m_PosY + text_offset + ((m_Press || m_OneTimePress) ? 1 : 0), m_Width, m_Align);
+ if (font && _text) {
+ int text_offset = (_height - font->GetTextHeight((byte *)_text, _width)) / 2;
+ font->DrawText((byte *)_text, OffsetX + _posX + ((_press || _oneTimePress) ? 1 : 0), OffsetY + _posY + text_offset + ((_press || _oneTimePress) ? 1 : 0), _width, _align);
}
- if (!m_PixelPerfect || !m_Image) Game->m_Renderer->m_RectList.Add(new CBActiveRect(Game, this, NULL, OffsetX + m_PosX, OffsetY + m_PosY, m_Width, m_Height, 100, 100, false));
+ if (!_pixelPerfect || !_image) Game->_renderer->_rectList.Add(new CBActiveRect(Game, this, NULL, OffsetX + _posX, OffsetY + _posY, _width, _height, 100, 100, false));
// reset unused sprites
- if (m_Image && m_Image != image) m_Image->Reset();
- if (m_ImageDisable && m_ImageDisable != image) m_ImageDisable->Reset();
- if (m_ImageFocus && m_ImageFocus != image) m_ImageFocus->Reset();
- if (m_ImagePress && m_ImagePress != image) m_ImagePress->Reset();
- if (m_ImageHover && m_ImageHover != image) m_ImageHover->Reset();
+ if (_image && _image != image) _image->Reset();
+ if (_imageDisable && _imageDisable != image) _imageDisable->Reset();
+ if (_imageFocus && _imageFocus != image) _imageFocus->Reset();
+ if (_imagePress && _imagePress != image) _imagePress->Reset();
+ if (_imageHover && _imageHover != image) _imageHover->Reset();
- m_Press = m_Hover && Game->m_MouseLeftDown && Game->m_CapturedObject == this;
+ _press = _hover && Game->_mouseLeftDown && Game->_capturedObject == this;
return S_OK;
}
@@ -653,10 +653,10 @@ HRESULT CUIButton::Display(int OffsetX, int OffsetY) {
//////////////////////////////////////////////////////////////////////////
void CUIButton::Press() {
ApplyEvent("Press");
- if (m_ListenerObject) m_ListenerObject->Listen(m_ListenerParamObject, m_ListenerParamDWORD);
- if (m_ParentNotify && m_Parent) m_Parent->ApplyEvent(m_Name);
+ if (_listenerObject) _listenerObject->Listen(_listenerParamObject, _listenerParamDWORD);
+ if (_parentNotify && _parent) _parent->ApplyEvent(_name);
- m_OneTimePress = false;
+ _oneTimePress = false;
}
@@ -671,13 +671,13 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
Stack->CorrectParams(1);
CScValue *Val = Stack->Pop();
- if (m_FontDisable) Game->m_FontStorage->RemoveFont(m_FontDisable);
+ if (_fontDisable) Game->_fontStorage->RemoveFont(_fontDisable);
if (Val->IsNULL()) {
- m_FontDisable = NULL;
+ _fontDisable = NULL;
Stack->PushBool(true);
} else {
- m_FontDisable = Game->m_FontStorage->AddFont(Val->GetString());
- Stack->PushBool(m_FontDisable != NULL);
+ _fontDisable = Game->_fontStorage->AddFont(Val->GetString());
+ Stack->PushBool(_fontDisable != NULL);
}
return S_OK;
}
@@ -689,13 +689,13 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
Stack->CorrectParams(1);
CScValue *Val = Stack->Pop();
- if (m_FontHover) Game->m_FontStorage->RemoveFont(m_FontHover);
+ if (_fontHover) Game->_fontStorage->RemoveFont(_fontHover);
if (Val->IsNULL()) {
- m_FontHover = NULL;
+ _fontHover = NULL;
Stack->PushBool(true);
} else {
- m_FontHover = Game->m_FontStorage->AddFont(Val->GetString());
- Stack->PushBool(m_FontHover != NULL);
+ _fontHover = Game->_fontStorage->AddFont(Val->GetString());
+ Stack->PushBool(_fontHover != NULL);
}
return S_OK;
}
@@ -707,13 +707,13 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
Stack->CorrectParams(1);
CScValue *Val = Stack->Pop();
- if (m_FontPress) Game->m_FontStorage->RemoveFont(m_FontPress);
+ if (_fontPress) Game->_fontStorage->RemoveFont(_fontPress);
if (Val->IsNULL()) {
- m_FontPress = NULL;
+ _fontPress = NULL;
Stack->PushBool(true);
} else {
- m_FontPress = Game->m_FontStorage->AddFont(Val->GetString());
- Stack->PushBool(m_FontPress != NULL);
+ _fontPress = Game->_fontStorage->AddFont(Val->GetString());
+ Stack->PushBool(_fontPress != NULL);
}
return S_OK;
}
@@ -725,13 +725,13 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
Stack->CorrectParams(1);
CScValue *Val = Stack->Pop();
- if (m_FontFocus) Game->m_FontStorage->RemoveFont(m_FontFocus);
+ if (_fontFocus) Game->_fontStorage->RemoveFont(_fontFocus);
if (Val->IsNULL()) {
- m_FontFocus = NULL;
+ _fontFocus = NULL;
Stack->PushBool(true);
} else {
- m_FontFocus = Game->m_FontStorage->AddFont(Val->GetString());
- Stack->PushBool(m_FontFocus != NULL);
+ _fontFocus = Game->_fontStorage->AddFont(Val->GetString());
+ Stack->PushBool(_fontFocus != NULL);
}
return S_OK;
}
@@ -742,12 +742,12 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "SetDisabledImage") == 0) {
Stack->CorrectParams(1);
- delete m_ImageDisable;
- m_ImageDisable = new CBSprite(Game);
+ delete _imageDisable;
+ _imageDisable = new CBSprite(Game);
char *Filename = Stack->Pop()->GetString();
- if (!m_ImageDisable || FAILED(m_ImageDisable->LoadFile(Filename))) {
- delete m_ImageDisable;
- m_ImageDisable = NULL;
+ if (!_imageDisable || FAILED(_imageDisable->LoadFile(Filename))) {
+ delete _imageDisable;
+ _imageDisable = NULL;
Stack->PushBool(false);
} else Stack->PushBool(true);
@@ -759,8 +759,8 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetDisabledImage") == 0) {
Stack->CorrectParams(0);
- if (!m_ImageDisable || !m_ImageDisable->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_ImageDisable->m_Filename);
+ if (!_imageDisable || !_imageDisable->_filename) Stack->PushNULL();
+ else Stack->PushString(_imageDisable->_filename);
return S_OK;
}
@@ -770,8 +770,8 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetDisabledImageObject") == 0) {
Stack->CorrectParams(0);
- if (!m_ImageDisable) Stack->PushNULL();
- else Stack->PushNative(m_ImageDisable, true);
+ if (!_imageDisable) Stack->PushNULL();
+ else Stack->PushNative(_imageDisable, true);
return S_OK;
}
@@ -783,12 +783,12 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "SetHoverImage") == 0) {
Stack->CorrectParams(1);
- delete m_ImageHover;
- m_ImageHover = new CBSprite(Game);
+ delete _imageHover;
+ _imageHover = new CBSprite(Game);
char *Filename = Stack->Pop()->GetString();
- if (!m_ImageHover || FAILED(m_ImageHover->LoadFile(Filename))) {
- delete m_ImageHover;
- m_ImageHover = NULL;
+ if (!_imageHover || FAILED(_imageHover->LoadFile(Filename))) {
+ delete _imageHover;
+ _imageHover = NULL;
Stack->PushBool(false);
} else Stack->PushBool(true);
@@ -800,8 +800,8 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetHoverImage") == 0) {
Stack->CorrectParams(0);
- if (!m_ImageHover || !m_ImageHover->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_ImageHover->m_Filename);
+ if (!_imageHover || !_imageHover->_filename) Stack->PushNULL();
+ else Stack->PushString(_imageHover->_filename);
return S_OK;
}
@@ -811,8 +811,8 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetHoverImageObject") == 0) {
Stack->CorrectParams(0);
- if (!m_ImageHover) Stack->PushNULL();
- else Stack->PushNative(m_ImageHover, true);
+ if (!_imageHover) Stack->PushNULL();
+ else Stack->PushNative(_imageHover, true);
return S_OK;
}
@@ -823,12 +823,12 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "SetPressedImage") == 0) {
Stack->CorrectParams(1);
- delete m_ImagePress;
- m_ImagePress = new CBSprite(Game);
+ delete _imagePress;
+ _imagePress = new CBSprite(Game);
char *Filename = Stack->Pop()->GetString();
- if (!m_ImagePress || FAILED(m_ImagePress->LoadFile(Filename))) {
- delete m_ImagePress;
- m_ImagePress = NULL;
+ if (!_imagePress || FAILED(_imagePress->LoadFile(Filename))) {
+ delete _imagePress;
+ _imagePress = NULL;
Stack->PushBool(false);
} else Stack->PushBool(true);
@@ -840,8 +840,8 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetPressedImage") == 0) {
Stack->CorrectParams(0);
- if (!m_ImagePress || !m_ImagePress->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_ImagePress->m_Filename);
+ if (!_imagePress || !_imagePress->_filename) Stack->PushNULL();
+ else Stack->PushString(_imagePress->_filename);
return S_OK;
}
@@ -851,8 +851,8 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetPressedImageObject") == 0) {
Stack->CorrectParams(0);
- if (!m_ImagePress) Stack->PushNULL();
- else Stack->PushNative(m_ImagePress, true);
+ if (!_imagePress) Stack->PushNULL();
+ else Stack->PushNative(_imagePress, true);
return S_OK;
}
@@ -863,12 +863,12 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "SetFocusedImage") == 0) {
Stack->CorrectParams(1);
- delete m_ImageFocus;
- m_ImageFocus = new CBSprite(Game);
+ delete _imageFocus;
+ _imageFocus = new CBSprite(Game);
char *Filename = Stack->Pop()->GetString();
- if (!m_ImageFocus || FAILED(m_ImageFocus->LoadFile(Filename))) {
- delete m_ImageFocus;
- m_ImageFocus = NULL;
+ if (!_imageFocus || FAILED(_imageFocus->LoadFile(Filename))) {
+ delete _imageFocus;
+ _imageFocus = NULL;
Stack->PushBool(false);
} else Stack->PushBool(true);
@@ -880,8 +880,8 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetFocusedImage") == 0) {
Stack->CorrectParams(0);
- if (!m_ImageFocus || !m_ImageFocus->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_ImageFocus->m_Filename);
+ if (!_imageFocus || !_imageFocus->_filename) Stack->PushNULL();
+ else Stack->PushString(_imageFocus->_filename);
return S_OK;
}
@@ -891,8 +891,8 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetFocusedImageObject") == 0) {
Stack->CorrectParams(0);
- if (!m_ImageFocus) Stack->PushNULL();
- else Stack->PushNative(m_ImageFocus, true);
+ if (!_imageFocus) Stack->PushNULL();
+ else Stack->PushNative(_imageFocus, true);
return S_OK;
}
@@ -903,9 +903,9 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "Press") == 0) {
Stack->CorrectParams(0);
- if (m_Visible && !m_Disable) {
- m_OneTimePress = true;
- m_OneTimePressTime = CBPlatform::GetTime();
+ if (_visible && !_disable) {
+ _oneTimePress = true;
+ _oneTimePressTime = CBPlatform::GetTime();
}
Stack->PushNULL();
@@ -919,44 +919,44 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
CScValue *CUIButton::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("button");
- return m_ScValue;
+ _scValue->SetString("button");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TextAlign
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TextAlign") == 0) {
- m_ScValue->SetInt(m_Align);
- return m_ScValue;
+ _scValue->SetInt(_align);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Focusable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Focusable") == 0) {
- m_ScValue->SetBool(m_CanFocus);
- return m_ScValue;
+ _scValue->SetBool(_canFocus);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Pressed
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Pressed") == 0) {
- m_ScValue->SetBool(m_StayPressed);
- return m_ScValue;
+ _scValue->SetBool(_stayPressed);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PixelPerfect") == 0) {
- m_ScValue->SetBool(m_PixelPerfect);
- return m_ScValue;
+ _scValue->SetBool(_pixelPerfect);
+ return _scValue;
}
else return CUIObject::ScGetProperty(Name);
@@ -971,7 +971,7 @@ HRESULT CUIButton::ScSetProperty(char *Name, CScValue *Value) {
if (strcmp(Name, "TextAlign") == 0) {
int i = Value->GetInt();
if (i < 0 || i >= NUM_TEXT_ALIGN) i = 0;
- m_Align = (TTextAlign)i;
+ _align = (TTextAlign)i;
return S_OK;
}
@@ -979,21 +979,21 @@ HRESULT CUIButton::ScSetProperty(char *Name, CScValue *Value) {
// Focusable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Focusable") == 0) {
- m_CanFocus = Value->GetBool();
+ _canFocus = Value->GetBool();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// Pressed
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Pressed") == 0) {
- m_StayPressed = Value->GetBool();
+ _stayPressed = Value->GetBool();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PixelPerfect") == 0) {
- m_PixelPerfect = Value->GetBool();
+ _pixelPerfect = Value->GetBool();
return S_OK;
}
@@ -1012,29 +1012,29 @@ HRESULT CUIButton::Persist(CBPersistMgr *PersistMgr) {
CUIObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER_INT(m_Align));
- PersistMgr->Transfer(TMEMBER(m_BackDisable));
- PersistMgr->Transfer(TMEMBER(m_BackFocus));
- PersistMgr->Transfer(TMEMBER(m_BackHover));
- PersistMgr->Transfer(TMEMBER(m_BackPress));
- PersistMgr->Transfer(TMEMBER(m_CenterImage));
- PersistMgr->Transfer(TMEMBER(m_FontDisable));
- PersistMgr->Transfer(TMEMBER(m_FontFocus));
- PersistMgr->Transfer(TMEMBER(m_FontHover));
- PersistMgr->Transfer(TMEMBER(m_FontPress));
- PersistMgr->Transfer(TMEMBER(m_Hover));
- PersistMgr->Transfer(TMEMBER(m_Image));
- PersistMgr->Transfer(TMEMBER(m_ImageDisable));
- PersistMgr->Transfer(TMEMBER(m_ImageFocus));
- PersistMgr->Transfer(TMEMBER(m_ImageHover));
- PersistMgr->Transfer(TMEMBER(m_ImagePress));
- PersistMgr->Transfer(TMEMBER(m_PixelPerfect));
- PersistMgr->Transfer(TMEMBER(m_Press));
- PersistMgr->Transfer(TMEMBER(m_StayPressed));
-
- if (!PersistMgr->m_Saving) {
- m_OneTimePress = false;
- m_OneTimePressTime = 0;
+ PersistMgr->Transfer(TMEMBER_INT(_align));
+ PersistMgr->Transfer(TMEMBER(_backDisable));
+ PersistMgr->Transfer(TMEMBER(_backFocus));
+ PersistMgr->Transfer(TMEMBER(_backHover));
+ PersistMgr->Transfer(TMEMBER(_backPress));
+ PersistMgr->Transfer(TMEMBER(_centerImage));
+ PersistMgr->Transfer(TMEMBER(_fontDisable));
+ PersistMgr->Transfer(TMEMBER(_fontFocus));
+ PersistMgr->Transfer(TMEMBER(_fontHover));
+ PersistMgr->Transfer(TMEMBER(_fontPress));
+ PersistMgr->Transfer(TMEMBER(_hover));
+ PersistMgr->Transfer(TMEMBER(_image));
+ PersistMgr->Transfer(TMEMBER(_imageDisable));
+ PersistMgr->Transfer(TMEMBER(_imageFocus));
+ PersistMgr->Transfer(TMEMBER(_imageHover));
+ PersistMgr->Transfer(TMEMBER(_imagePress));
+ PersistMgr->Transfer(TMEMBER(_pixelPerfect));
+ PersistMgr->Transfer(TMEMBER(_press));
+ PersistMgr->Transfer(TMEMBER(_stayPressed));
+
+ if (!PersistMgr->_saving) {
+ _oneTimePress = false;
+ _oneTimePressTime = 0;
}
return S_OK;
diff --git a/engines/wintermute/UIButton.h b/engines/wintermute/UIButton.h
index aa4b7f8b78..aa2ac4d66d 100644
--- a/engines/wintermute/UIButton.h
+++ b/engines/wintermute/UIButton.h
@@ -37,30 +37,30 @@ namespace WinterMute {
class CUIButton : public CUIObject {
public:
- bool m_PixelPerfect;
- bool m_StayPressed;
- bool m_CenterImage;
- bool m_OneTimePress;
- uint32 m_OneTimePressTime;
+ bool _pixelPerfect;
+ bool _stayPressed;
+ bool _centerImage;
+ bool _oneTimePress;
+ uint32 _oneTimePressTime;
DECLARE_PERSISTENT(CUIButton, CUIObject)
void Press();
virtual HRESULT Display(int OffsetX = 0, int OffsetY = 0);
- bool m_Press;
- bool m_Hover;
+ bool _press;
+ bool _hover;
void CorrectSize();
- TTextAlign m_Align;
- CBSprite *m_ImageHover;
- CBSprite *m_ImagePress;
- CBSprite *m_ImageDisable;
- CBSprite *m_ImageFocus;
- CBFont *m_FontDisable;
- CBFont *m_FontPress;
- CBFont *m_FontHover;
- CBFont *m_FontFocus;
- CUITiledImage *m_BackPress;
- CUITiledImage *m_BackHover;
- CUITiledImage *m_BackDisable;
- CUITiledImage *m_BackFocus;
+ TTextAlign _align;
+ CBSprite *_imageHover;
+ CBSprite *_imagePress;
+ CBSprite *_imageDisable;
+ CBSprite *_imageFocus;
+ CBFont *_fontDisable;
+ CBFont *_fontPress;
+ CBFont *_fontHover;
+ CBFont *_fontFocus;
+ CUITiledImage *_backPress;
+ CUITiledImage *_backHover;
+ CUITiledImage *_backDisable;
+ CUITiledImage *_backFocus;
CUIButton(CBGame *inGame = NULL);
virtual ~CUIButton();
HRESULT LoadFile(char *Filename);
diff --git a/engines/wintermute/UIEdit.cpp b/engines/wintermute/UIEdit.cpp
index 6d1018ec0a..2cb79935df 100644
--- a/engines/wintermute/UIEdit.cpp
+++ b/engines/wintermute/UIEdit.cpp
@@ -53,48 +53,48 @@ IMPLEMENT_PERSISTENT(CUIEdit, false)
//////////////////////////////////////////////////////////////////////////
CUIEdit::CUIEdit(CBGame *inGame): CUIObject(inGame) {
- m_Type = UI_EDIT;
+ _type = UI_EDIT;
- m_FontSelected = NULL;
+ _fontSelected = NULL;
- m_SelStart = m_SelEnd = 10000;
- m_ScrollOffset = 0;
+ _selStart = _selEnd = 10000;
+ _scrollOffset = 0;
- m_CursorChar = NULL;
+ _cursorChar = NULL;
SetCursorChar("|");
#ifdef __WIN32__
- m_CursorBlinkRate = GetCaretBlinkTime();
+ _cursorBlinkRate = GetCaretBlinkTime();
#else
- m_CursorBlinkRate = 600;
+ _cursorBlinkRate = 600;
#endif
- m_FrameWidth = 0;
+ _frameWidth = 0;
SetText("");
- m_LastBlinkTime = 0;
- m_CursorVisible = true;
+ _lastBlinkTime = 0;
+ _cursorVisible = true;
- m_MaxLength = -1;
+ _maxLength = -1;
- m_CanFocus = true;
+ _canFocus = true;
}
//////////////////////////////////////////////////////////////////////////
CUIEdit::~CUIEdit() {
- if (!m_SharedFonts) {
- if (m_FontSelected) Game->m_FontStorage->RemoveFont(m_FontSelected);
+ if (!_sharedFonts) {
+ if (_fontSelected) Game->_fontStorage->RemoveFont(_fontSelected);
}
- delete[] m_CursorChar;
- m_CursorChar = NULL;
+ delete[] _cursorChar;
+ _cursorChar = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUIEdit::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CUIEdit::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -102,8 +102,8 @@ HRESULT CUIEdit::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -187,60 +187,60 @@ HRESULT CUIEdit::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_BACK:
- delete m_Back;
- m_Back = new CUITiledImage(Game);
- if (!m_Back || FAILED(m_Back->LoadFile((char *)params))) {
- delete m_Back;
- m_Back = NULL;
+ delete _back;
+ _back = new CUITiledImage(Game);
+ if (!_back || FAILED(_back->LoadFile((char *)params))) {
+ delete _back;
+ _back = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE:
- delete m_Image;
- m_Image = new CBSprite(Game);
- if (!m_Image || FAILED(m_Image->LoadFile((char *)params))) {
- delete m_Image;
- m_Image = NULL;
+ delete _image;
+ _image = new CBSprite(Game);
+ if (!_image || FAILED(_image->LoadFile((char *)params))) {
+ delete _image;
+ _image = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_FONT:
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
- m_Font = Game->m_FontStorage->AddFont((char *)params);
- if (!m_Font) cmd = PARSERR_GENERIC;
+ if (_font) Game->_fontStorage->RemoveFont(_font);
+ _font = Game->_fontStorage->AddFont((char *)params);
+ if (!_font) cmd = PARSERR_GENERIC;
break;
case TOKEN_FONT_SELECTED:
- if (m_FontSelected) Game->m_FontStorage->RemoveFont(m_FontSelected);
- m_FontSelected = Game->m_FontStorage->AddFont((char *)params);
- if (!m_FontSelected) cmd = PARSERR_GENERIC;
+ if (_fontSelected) Game->_fontStorage->RemoveFont(_fontSelected);
+ _fontSelected = Game->_fontStorage->AddFont((char *)params);
+ if (!_fontSelected) cmd = PARSERR_GENERIC;
break;
case TOKEN_TEXT:
SetText((char *)params);
- Game->m_StringTable->Expand(&m_Text);
+ Game->_stringTable->Expand(&_text);
break;
case TOKEN_X:
- parser.ScanStr((char *)params, "%d", &m_PosX);
+ parser.ScanStr((char *)params, "%d", &_posX);
break;
case TOKEN_Y:
- parser.ScanStr((char *)params, "%d", &m_PosY);
+ parser.ScanStr((char *)params, "%d", &_posY);
break;
case TOKEN_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_Width);
+ parser.ScanStr((char *)params, "%d", &_width);
break;
case TOKEN_HEIGHT:
- parser.ScanStr((char *)params, "%d", &m_Height);
+ parser.ScanStr((char *)params, "%d", &_height);
break;
case TOKEN_MAX_LENGTH:
- parser.ScanStr((char *)params, "%d", &m_MaxLength);
+ parser.ScanStr((char *)params, "%d", &_maxLength);
break;
case TOKEN_CAPTION:
@@ -248,21 +248,21 @@ HRESULT CUIEdit::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_CURSOR:
- delete m_Cursor;
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- delete m_Cursor;
- m_Cursor = NULL;
+ delete _cursor;
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_CURSOR_BLINK_RATE:
- parser.ScanStr((char *)params, "%d", &m_CursorBlinkRate);
+ parser.ScanStr((char *)params, "%d", &_cursorBlinkRate);
break;
case TOKEN_FRAME_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_FrameWidth);
+ parser.ScanStr((char *)params, "%d", &_frameWidth);
break;
case TOKEN_SCRIPT:
@@ -270,15 +270,15 @@ HRESULT CUIEdit::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_PARENT_NOTIFY:
- parser.ScanStr((char *)params, "%b", &m_ParentNotify);
+ parser.ScanStr((char *)params, "%b", &_parentNotify);
break;
case TOKEN_DISABLED:
- parser.ScanStr((char *)params, "%b", &m_Disable);
+ parser.ScanStr((char *)params, "%b", &_disable);
break;
case TOKEN_VISIBLE:
- parser.ScanStr((char *)params, "%b", &m_Visible);
+ parser.ScanStr((char *)params, "%b", &_visible);
break;
case TOKEN_EDITOR_PROPERTY:
@@ -305,47 +305,47 @@ HRESULT CUIEdit::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "EDIT\n");
Buffer->PutTextIndent(Indent, "{\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
Buffer->PutTextIndent(Indent + 2, "\n");
- if (m_Back && m_Back->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK=\"%s\"\n", m_Back->m_Filename);
+ if (_back && _back->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
- if (m_Image && m_Image->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", m_Image->m_Filename);
+ if (_image && _image->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
- if (m_Font && m_Font->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", m_Font->m_Filename);
- if (m_FontSelected && m_FontSelected->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT_SELECTED=\"%s\"\n", m_FontSelected->m_Filename);
+ if (_font && _font->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
+ if (_fontSelected && _fontSelected->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT_SELECTED=\"%s\"\n", _fontSelected->_filename);
- if (m_Cursor && m_Cursor->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", m_Cursor->m_Filename);
+ if (_cursor && _cursor->_filename)
+ Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
Buffer->PutTextIndent(Indent + 2, "\n");
- if (m_Text)
- Buffer->PutTextIndent(Indent + 2, "TEXT=\"%s\"\n", m_Text);
+ if (_text)
+ Buffer->PutTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
Buffer->PutTextIndent(Indent + 2, "\n");
- Buffer->PutTextIndent(Indent + 2, "X=%d\n", m_PosX);
- Buffer->PutTextIndent(Indent + 2, "Y=%d\n", m_PosY);
- Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", m_Width);
- Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", m_Height);
- Buffer->PutTextIndent(Indent + 2, "MAX_LENGTH=%d\n", m_MaxLength);
- Buffer->PutTextIndent(Indent + 2, "CURSOR_BLINK_RATE=%d\n", m_CursorBlinkRate);
- Buffer->PutTextIndent(Indent + 2, "FRAME_WIDTH=%d\n", m_FrameWidth);
+ Buffer->PutTextIndent(Indent + 2, "X=%d\n", _posX);
+ Buffer->PutTextIndent(Indent + 2, "Y=%d\n", _posY);
+ Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", _width);
+ Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
+ Buffer->PutTextIndent(Indent + 2, "MAX_LENGTH=%d\n", _maxLength);
+ Buffer->PutTextIndent(Indent + 2, "CURSOR_BLINK_RATE=%d\n", _cursorBlinkRate);
+ Buffer->PutTextIndent(Indent + 2, "FRAME_WIDTH=%d\n", _frameWidth);
- Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", m_Disable ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", m_Visible ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", m_ParentNotify ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
// scripts
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
Buffer->PutTextIndent(Indent + 2, "\n");
@@ -367,9 +367,9 @@ HRESULT CUIEdit::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
if (strcmp(Name, "SetSelectedFont") == 0) {
Stack->CorrectParams(1);
- if (m_FontSelected) Game->m_FontStorage->RemoveFont(m_FontSelected);
- m_FontSelected = Game->m_FontStorage->AddFont(Stack->Pop()->GetString());
- Stack->PushBool(m_FontSelected != NULL);
+ if (_fontSelected) Game->_fontStorage->RemoveFont(_fontSelected);
+ _fontSelected = Game->_fontStorage->AddFont(Stack->Pop()->GetString());
+ Stack->PushBool(_fontSelected != NULL);
return S_OK;
}
@@ -380,75 +380,75 @@ HRESULT CUIEdit::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
CScValue *CUIEdit::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("editor");
- return m_ScValue;
+ _scValue->SetString("editor");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SelStart
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SelStart") == 0) {
- m_ScValue->SetInt(m_SelStart);
- return m_ScValue;
+ _scValue->SetInt(_selStart);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SelEnd
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SelEnd") == 0) {
- m_ScValue->SetInt(m_SelEnd);
- return m_ScValue;
+ _scValue->SetInt(_selEnd);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// CursorBlinkRate
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CursorBlinkRate") == 0) {
- m_ScValue->SetInt(m_CursorBlinkRate);
- return m_ScValue;
+ _scValue->SetInt(_cursorBlinkRate);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// CursorChar
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CursorChar") == 0) {
- m_ScValue->SetString(m_CursorChar);
- return m_ScValue;
+ _scValue->SetString(_cursorChar);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// FrameWidth
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FrameWidth") == 0) {
- m_ScValue->SetInt(m_FrameWidth);
- return m_ScValue;
+ _scValue->SetInt(_frameWidth);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MaxLength
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MaxLength") == 0) {
- m_ScValue->SetInt(m_MaxLength);
- return m_ScValue;
+ _scValue->SetInt(_maxLength);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Text
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Text") == 0) {
- if (Game->m_TextEncoding == TEXT_UTF8) {
- WideString wstr = StringUtil::AnsiToWide(m_Text);
- m_ScValue->SetString(StringUtil::WideToUtf8(wstr).c_str());
+ if (Game->_textEncoding == TEXT_UTF8) {
+ WideString wstr = StringUtil::AnsiToWide(_text);
+ _scValue->SetString(StringUtil::WideToUtf8(wstr).c_str());
} else {
- m_ScValue->SetString(m_Text);
+ _scValue->SetString(_text);
}
- return m_ScValue;
+ return _scValue;
}
else return CUIObject::ScGetProperty(Name);
@@ -461,9 +461,9 @@ HRESULT CUIEdit::ScSetProperty(char *Name, CScValue *Value) {
// SelStart
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "SelStart") == 0) {
- m_SelStart = Value->GetInt();
- m_SelStart = MAX(m_SelStart, 0);
- m_SelStart = MIN((size_t)m_SelStart, strlen(m_Text));
+ _selStart = Value->GetInt();
+ _selStart = MAX(_selStart, 0);
+ _selStart = MIN((size_t)_selStart, strlen(_text));
return S_OK;
}
@@ -471,9 +471,9 @@ HRESULT CUIEdit::ScSetProperty(char *Name, CScValue *Value) {
// SelEnd
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SelEnd") == 0) {
- m_SelEnd = Value->GetInt();
- m_SelEnd = MAX(m_SelEnd, 0);
- m_SelEnd = MIN((size_t)m_SelEnd, strlen(m_Text));
+ _selEnd = Value->GetInt();
+ _selEnd = MAX(_selEnd, 0);
+ _selEnd = MIN((size_t)_selEnd, strlen(_text));
return S_OK;
}
@@ -481,7 +481,7 @@ HRESULT CUIEdit::ScSetProperty(char *Name, CScValue *Value) {
// CursorBlinkRate
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "CursorBlinkRate") == 0) {
- m_CursorBlinkRate = Value->GetInt();
+ _cursorBlinkRate = Value->GetInt();
return S_OK;
}
@@ -497,7 +497,7 @@ HRESULT CUIEdit::ScSetProperty(char *Name, CScValue *Value) {
// FrameWidth
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FrameWidth") == 0) {
- m_FrameWidth = Value->GetInt();
+ _frameWidth = Value->GetInt();
return S_OK;
}
@@ -505,7 +505,7 @@ HRESULT CUIEdit::ScSetProperty(char *Name, CScValue *Value) {
// MaxLength
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "MaxLength") == 0) {
- m_MaxLength = Value->GetInt();
+ _maxLength = Value->GetInt();
return S_OK;
}
@@ -513,7 +513,7 @@ HRESULT CUIEdit::ScSetProperty(char *Name, CScValue *Value) {
// Text
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Text") == 0) {
- if (Game->m_TextEncoding == TEXT_UTF8) {
+ if (Game->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::Utf8ToWide(Value->GetString());
SetText(StringUtil::WideToAnsi(wstr).c_str());
} else {
@@ -535,72 +535,72 @@ char *CUIEdit::ScToString() {
//////////////////////////////////////////////////////////////////////////
void CUIEdit::SetCursorChar(char *Char) {
if (!Char) return;
- delete[] m_CursorChar;
- m_CursorChar = new char [strlen(Char) + 1];
- if (m_CursorChar) strcpy(m_CursorChar, Char);
+ delete[] _cursorChar;
+ _cursorChar = new char [strlen(Char) + 1];
+ if (_cursorChar) strcpy(_cursorChar, Char);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUIEdit::Display(int OffsetX, int OffsetY) {
- if (!m_Visible) return S_OK;
+ if (!_visible) return S_OK;
// hack!
- TTextEncoding OrigEncoding = Game->m_TextEncoding;
- Game->m_TextEncoding = TEXT_ANSI;
+ TTextEncoding OrigEncoding = Game->_textEncoding;
+ Game->_textEncoding = TEXT_ANSI;
- if (m_Back) m_Back->Display(OffsetX + m_PosX, OffsetY + m_PosY, m_Width, m_Height);
- if (m_Image) m_Image->Draw(OffsetX + m_PosX, OffsetY + m_PosY, NULL);
+ if (_back) _back->Display(OffsetX + _posX, OffsetY + _posY, _width, _height);
+ if (_image) _image->Draw(OffsetX + _posX, OffsetY + _posY, NULL);
// prepare fonts
CBFont *font;
CBFont *sfont;
- if (m_Font) font = m_Font;
- else font = Game->m_SystemFont;
+ if (_font) font = _font;
+ else font = Game->_systemFont;
- if (m_FontSelected) sfont = m_FontSelected;
+ if (_fontSelected) sfont = _fontSelected;
else sfont = font;
bool focused = IsFocused();
- m_SelStart = MAX(m_SelStart, 0);
- m_SelEnd = MAX(m_SelEnd, 0);
+ _selStart = MAX(_selStart, 0);
+ _selEnd = MAX(_selEnd, 0);
- m_SelStart = MIN((size_t)m_SelStart, strlen(m_Text));
- m_SelEnd = MIN((size_t)m_SelEnd, strlen(m_Text));
+ _selStart = MIN((size_t)_selStart, strlen(_text));
+ _selEnd = MIN((size_t)_selEnd, strlen(_text));
- //int CursorWidth = font->GetCharWidth(m_CursorChar[0]);
- int CursorWidth = font->GetTextWidth((byte *)m_CursorChar);
+ //int CursorWidth = font->GetCharWidth(_cursorChar[0]);
+ int CursorWidth = font->GetTextWidth((byte *)_cursorChar);
int s1, s2;
bool CurFirst;
// modify scroll offset
- if (m_SelStart >= m_SelEnd) {
- while (font->GetTextWidth((byte *)m_Text + m_ScrollOffset, std::max(0, m_SelEnd - m_ScrollOffset)) > m_Width - CursorWidth - 2 * m_FrameWidth) {
- m_ScrollOffset++;
- if (m_ScrollOffset >= strlen(m_Text)) break;
+ if (_selStart >= _selEnd) {
+ while (font->GetTextWidth((byte *)_text + _scrollOffset, std::max(0, _selEnd - _scrollOffset)) > _width - CursorWidth - 2 * _frameWidth) {
+ _scrollOffset++;
+ if (_scrollOffset >= strlen(_text)) break;
}
- m_ScrollOffset = std::min(m_ScrollOffset, m_SelEnd);
+ _scrollOffset = std::min(_scrollOffset, _selEnd);
- s1 = m_SelEnd;
- s2 = m_SelStart;
+ s1 = _selEnd;
+ s2 = _selStart;
CurFirst = true;
} else {
- while (font->GetTextWidth((byte *)m_Text + m_ScrollOffset, std::max(0, m_SelStart - m_ScrollOffset)) +
- sfont->GetTextWidth((byte *)(m_Text + std::max(m_ScrollOffset, m_SelStart)), m_SelEnd - std::max(m_ScrollOffset, m_SelStart))
+ while (font->GetTextWidth((byte *)_text + _scrollOffset, std::max(0, _selStart - _scrollOffset)) +
+ sfont->GetTextWidth((byte *)(_text + std::max(_scrollOffset, _selStart)), _selEnd - std::max(_scrollOffset, _selStart))
- > m_Width - CursorWidth - 2 * m_FrameWidth) {
- m_ScrollOffset++;
- if (m_ScrollOffset >= strlen(m_Text)) break;
+ > _width - CursorWidth - 2 * _frameWidth) {
+ _scrollOffset++;
+ if (_scrollOffset >= strlen(_text)) break;
}
- m_ScrollOffset = std::min(m_ScrollOffset, m_SelEnd);
+ _scrollOffset = std::min(_scrollOffset, _selEnd);
- s1 = m_SelStart;
- s2 = m_SelEnd;
+ s1 = _selStart;
+ s2 = _selEnd;
CurFirst = false;
}
@@ -611,74 +611,74 @@ HRESULT CUIEdit::Display(int OffsetX, int OffsetY) {
// draw text
int xxx, yyy, width, height;
- xxx = m_PosX + m_FrameWidth + OffsetX;
- yyy = m_PosY + m_FrameWidth + OffsetY;
+ xxx = _posX + _frameWidth + OffsetX;
+ yyy = _posY + _frameWidth + OffsetY;
- width = m_PosX + m_Width + OffsetX - m_FrameWidth;
+ width = _posX + _width + OffsetX - _frameWidth;
height = std::max(font->GetLetterHeight(), sfont->GetLetterHeight());
- if (Game->m_TextRTL) xxx += AlignOffset;
+ if (Game->_textRTL) xxx += AlignOffset;
TTextAlign Align = TAL_LEFT;
// unselected 1
- if (s1 > m_ScrollOffset) {
- if (Count) font->DrawText((byte *)m_Text + m_ScrollOffset, xxx, yyy, width - xxx, Align, height, s1 - m_ScrollOffset);
- xxx += font->GetTextWidth((byte *)m_Text + m_ScrollOffset, s1 - m_ScrollOffset);
- AlignOffset += font->GetTextWidth((byte *)m_Text + m_ScrollOffset, s1 - m_ScrollOffset);
+ if (s1 > _scrollOffset) {
+ if (Count) font->DrawText((byte *)_text + _scrollOffset, xxx, yyy, width - xxx, Align, height, s1 - _scrollOffset);
+ xxx += font->GetTextWidth((byte *)_text + _scrollOffset, s1 - _scrollOffset);
+ AlignOffset += font->GetTextWidth((byte *)_text + _scrollOffset, s1 - _scrollOffset);
}
// cursor
if (focused && CurFirst) {
if (Count) {
- if (CBPlatform::GetTime() - m_LastBlinkTime >= m_CursorBlinkRate) {
- m_LastBlinkTime = CBPlatform::GetTime();
- m_CursorVisible = !m_CursorVisible;
+ if (CBPlatform::GetTime() - _lastBlinkTime >= _cursorBlinkRate) {
+ _lastBlinkTime = CBPlatform::GetTime();
+ _cursorVisible = !_cursorVisible;
}
- if (m_CursorVisible)
- font->DrawText((byte *)m_CursorChar, xxx, yyy, width - xxx, Align, height, 1);
+ if (_cursorVisible)
+ font->DrawText((byte *)_cursorChar, xxx, yyy, width - xxx, Align, height, 1);
}
xxx += CursorWidth;
AlignOffset += CursorWidth;
}
// selected
- int s3 = std::max(s1, m_ScrollOffset);
+ int s3 = std::max(s1, _scrollOffset);
if (s2 - s3 > 0) {
- if (Count) sfont->DrawText((byte *)m_Text + s3, xxx, yyy, width - xxx, Align, height, s2 - s3);
- xxx += sfont->GetTextWidth((byte *)m_Text + s3, s2 - s3);
- AlignOffset += sfont->GetTextWidth((byte *)m_Text + s3, s2 - s3);
+ if (Count) sfont->DrawText((byte *)_text + s3, xxx, yyy, width - xxx, Align, height, s2 - s3);
+ xxx += sfont->GetTextWidth((byte *)_text + s3, s2 - s3);
+ AlignOffset += sfont->GetTextWidth((byte *)_text + s3, s2 - s3);
}
// cursor
if (focused && !CurFirst) {
if (Count) {
- if (CBPlatform::GetTime() - m_LastBlinkTime >= m_CursorBlinkRate) {
- m_LastBlinkTime = CBPlatform::GetTime();
- m_CursorVisible = !m_CursorVisible;
+ if (CBPlatform::GetTime() - _lastBlinkTime >= _cursorBlinkRate) {
+ _lastBlinkTime = CBPlatform::GetTime();
+ _cursorVisible = !_cursorVisible;
}
- if (m_CursorVisible)
- font->DrawText((byte *)m_CursorChar, xxx, yyy, width - xxx, Align, height, 1);
+ if (_cursorVisible)
+ font->DrawText((byte *)_cursorChar, xxx, yyy, width - xxx, Align, height, 1);
}
xxx += CursorWidth;
AlignOffset += CursorWidth;
}
// unselected 2
- if (Count) font->DrawText((byte *)m_Text + s2, xxx, yyy, width - xxx, Align, height);
- AlignOffset += font->GetTextWidth((byte *)m_Text + s2);
+ if (Count) font->DrawText((byte *)_text + s2, xxx, yyy, width - xxx, Align, height);
+ AlignOffset += font->GetTextWidth((byte *)_text + s2);
- AlignOffset = (m_Width - 2 * m_FrameWidth) - AlignOffset;
+ AlignOffset = (_width - 2 * _frameWidth) - AlignOffset;
if (AlignOffset < 0) AlignOffset = 0;
}
- Game->m_Renderer->m_RectList.Add(new CBActiveRect(Game, this, NULL, OffsetX + m_PosX, OffsetY + m_PosY, m_Width, m_Height, 100, 100, false));
+ Game->_renderer->_rectList.Add(new CBActiveRect(Game, this, NULL, OffsetX + _posX, OffsetY + _posY, _width, _height, 100, 100, false));
- Game->m_TextEncoding = OrigEncoding;
+ Game->_textEncoding = OrigEncoding;
return S_OK;
}
@@ -698,70 +698,70 @@ bool CUIEdit::HandleKeypress(SDL_Event *event) {
// ctrl+A
case SDLK_a:
if (CBKeyboardState::IsControlDown()) {
- m_SelStart = 0;
- m_SelEnd = strlen(m_Text);
+ _selStart = 0;
+ _selEnd = strlen(_text);
Handled = true;
}
break;
case SDLK_BACKSPACE:
- if (m_SelStart == m_SelEnd) {
- if (Game->m_TextRTL) DeleteChars(m_SelStart, m_SelStart + 1);
- else DeleteChars(m_SelStart - 1, m_SelStart);
- } else DeleteChars(m_SelStart, m_SelEnd);
- if (m_SelEnd >= m_SelStart) m_SelEnd -= std::max(1, m_SelEnd - m_SelStart);
- m_SelStart = m_SelEnd;
+ if (_selStart == _selEnd) {
+ if (Game->_textRTL) DeleteChars(_selStart, _selStart + 1);
+ else DeleteChars(_selStart - 1, _selStart);
+ } else DeleteChars(_selStart, _selEnd);
+ if (_selEnd >= _selStart) _selEnd -= std::max(1, _selEnd - _selStart);
+ _selStart = _selEnd;
Handled = true;
break;
case SDLK_LEFT:
case SDLK_UP:
- m_SelEnd--;
- if (!CBKeyboardState::IsShiftDown()) m_SelStart = m_SelEnd;
+ _selEnd--;
+ if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
Handled = true;
break;
case SDLK_RIGHT:
case SDLK_DOWN:
- m_SelEnd++;
- if (!CBKeyboardState::IsShiftDown()) m_SelStart = m_SelEnd;
+ _selEnd++;
+ if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
Handled = true;
break;
case SDLK_HOME:
- if (Game->m_TextRTL) {
- m_SelEnd = strlen(m_Text);
- if (!CBKeyboardState::IsShiftDown()) m_SelStart = m_SelEnd;
+ if (Game->_textRTL) {
+ _selEnd = strlen(_text);
+ if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
} else {
- m_SelEnd = 0;
- if (!CBKeyboardState::IsShiftDown()) m_SelStart = m_SelEnd;
+ _selEnd = 0;
+ if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
}
Handled = true;
break;
case SDLK_END:
- if (Game->m_TextRTL) {
- m_SelEnd = 0;
- if (!CBKeyboardState::IsShiftDown()) m_SelStart = m_SelEnd;
+ if (Game->_textRTL) {
+ _selEnd = 0;
+ if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
} else {
- m_SelEnd = strlen(m_Text);
- if (!CBKeyboardState::IsShiftDown()) m_SelStart = m_SelEnd;
+ _selEnd = strlen(_text);
+ if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
}
Handled = true;
break;
case SDLK_DELETE:
- if (m_SelStart == m_SelEnd) {
- if (Game->m_TextRTL) {
- DeleteChars(m_SelStart - 1, m_SelStart);
- m_SelEnd--;
- if (m_SelEnd < 0) m_SelEnd = 0;
- } else DeleteChars(m_SelStart, m_SelStart + 1);
- } else DeleteChars(m_SelStart, m_SelEnd);
- if (m_SelEnd > m_SelStart) m_SelEnd -= (m_SelEnd - m_SelStart);
-
- m_SelStart = m_SelEnd;
+ if (_selStart == _selEnd) {
+ if (Game->_textRTL) {
+ DeleteChars(_selStart - 1, _selStart);
+ _selEnd--;
+ if (_selEnd < 0) _selEnd = 0;
+ } else DeleteChars(_selStart, _selStart + 1);
+ } else DeleteChars(_selStart, _selEnd);
+ if (_selEnd > _selStart) _selEnd -= (_selEnd - _selStart);
+
+ _selStart = _selEnd;
Handled = true;
break;
}
@@ -769,13 +769,13 @@ bool CUIEdit::HandleKeypress(SDL_Event *event) {
}
#if 0
else if (event->type == SDL_TEXTINPUT) {
- if (m_SelStart != m_SelEnd) DeleteChars(m_SelStart, m_SelEnd);
+ if (_selStart != _selEnd) DeleteChars(_selStart, _selEnd);
WideString wstr = StringUtil::Utf8ToWide(event->text.text);
- m_SelEnd += InsertChars(m_SelEnd, (byte *)StringUtil::WideToAnsi(wstr).c_str(), 1);
+ _selEnd += InsertChars(_selEnd, (byte *)StringUtil::WideToAnsi(wstr).c_str(), 1);
- if (Game->m_TextRTL) m_SelEnd = m_SelStart;
- else m_SelStart = m_SelEnd;
+ if (Game->_textRTL) _selEnd = _selStart;
+ else _selStart = _selEnd;
return true;
}
@@ -790,17 +790,17 @@ int CUIEdit::DeleteChars(int Start, int End) {
if (Start > End) CBUtils::Swap(&Start, &End);
Start = MAX(Start, (int)0);
- End = MIN((size_t)End, strlen(m_Text));
+ End = MIN((size_t)End, strlen(_text));
- char *str = new char[strlen(m_Text) - (End - Start) + 1];
+ char *str = new char[strlen(_text) - (End - Start) + 1];
if (str) {
- if (Start > 0) memcpy(str, m_Text, Start);
- memcpy(str + std::max(0, Start), m_Text + End, strlen(m_Text) - End + 1);
+ if (Start > 0) memcpy(str, _text, Start);
+ memcpy(str + std::max(0, Start), _text + End, strlen(_text) - End + 1);
- delete[] m_Text;
- m_Text = str;
+ delete[] _text;
+ _text = str;
}
- if (m_ParentNotify && m_Parent) m_Parent->ApplyEvent(m_Name);
+ if (_parentNotify && _parent) _parent->ApplyEvent(_name);
return End - Start;
}
@@ -808,24 +808,24 @@ int CUIEdit::DeleteChars(int Start, int End) {
//////////////////////////////////////////////////////////////////////////
int CUIEdit::InsertChars(int Pos, byte *Chars, int Num) {
- if (strlen(m_Text) + Num > m_MaxLength) {
- Num -= (strlen(m_Text) + Num - m_MaxLength);
+ if (strlen(_text) + Num > _maxLength) {
+ Num -= (strlen(_text) + Num - _maxLength);
}
Pos = MAX(Pos, (int)0);
- Pos = MIN((size_t)Pos, strlen(m_Text));
+ Pos = MIN((size_t)Pos, strlen(_text));
- char *str = new char[strlen(m_Text) + Num + 1];
+ char *str = new char[strlen(_text) + Num + 1];
if (str) {
- if (Pos > 0) memcpy(str, m_Text, Pos);
- memcpy(str + Pos + Num, m_Text + Pos, strlen(m_Text) - Pos + 1);
+ if (Pos > 0) memcpy(str, _text, Pos);
+ memcpy(str + Pos + Num, _text + Pos, strlen(_text) - Pos + 1);
memcpy(str + Pos, Chars, Num);
- delete[] m_Text;
- m_Text = str;
+ delete[] _text;
+ _text = str;
}
- if (m_ParentNotify && m_Parent) m_Parent->ApplyEvent(m_Name);
+ if (_parentNotify && _parent) _parent->ApplyEvent(_name);
return Num;
}
@@ -837,18 +837,18 @@ HRESULT CUIEdit::Persist(CBPersistMgr *PersistMgr) {
CUIObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_CursorBlinkRate));
- PersistMgr->Transfer(TMEMBER(m_CursorChar));
- PersistMgr->Transfer(TMEMBER(m_FontSelected));
- PersistMgr->Transfer(TMEMBER(m_FrameWidth));
- PersistMgr->Transfer(TMEMBER(m_MaxLength));
- PersistMgr->Transfer(TMEMBER(m_ScrollOffset));
- PersistMgr->Transfer(TMEMBER(m_SelEnd));
- PersistMgr->Transfer(TMEMBER(m_SelStart));
-
- if (!PersistMgr->m_Saving) {
- m_CursorVisible = false;
- m_LastBlinkTime = 0;
+ PersistMgr->Transfer(TMEMBER(_cursorBlinkRate));
+ PersistMgr->Transfer(TMEMBER(_cursorChar));
+ PersistMgr->Transfer(TMEMBER(_fontSelected));
+ PersistMgr->Transfer(TMEMBER(_frameWidth));
+ PersistMgr->Transfer(TMEMBER(_maxLength));
+ PersistMgr->Transfer(TMEMBER(_scrollOffset));
+ PersistMgr->Transfer(TMEMBER(_selEnd));
+ PersistMgr->Transfer(TMEMBER(_selStart));
+
+ if (!PersistMgr->_saving) {
+ _cursorVisible = false;
+ _lastBlinkTime = 0;
}
return S_OK;
diff --git a/engines/wintermute/UIEdit.h b/engines/wintermute/UIEdit.h
index 134218c877..ccaca4473d 100644
--- a/engines/wintermute/UIEdit.h
+++ b/engines/wintermute/UIEdit.h
@@ -37,21 +37,21 @@ class CBFont;
class CUIEdit : public CUIObject {
public:
DECLARE_PERSISTENT(CUIEdit, CUIObject)
- int m_MaxLength;
+ int _maxLength;
int InsertChars(int Pos, byte *Chars, int Num);
int DeleteChars(int Start, int End);
- bool m_CursorVisible;
- uint32 m_LastBlinkTime;
+ bool _cursorVisible;
+ uint32 _lastBlinkTime;
virtual HRESULT Display(int OffsetX, int OffsetY);
virtual bool HandleKeypress(SDL_Event *event);
- int m_ScrollOffset;
- int m_FrameWidth;
- uint32 m_CursorBlinkRate;
+ int _scrollOffset;
+ int _frameWidth;
+ uint32 _cursorBlinkRate;
void SetCursorChar(char *Char);
- char *m_CursorChar;
- int m_SelEnd;
- int m_SelStart;
- CBFont *m_FontSelected;
+ char *_cursorChar;
+ int _selEnd;
+ int _selStart;
+ CBFont *_fontSelected;
CUIEdit(CBGame *inGame);
virtual ~CUIEdit();
diff --git a/engines/wintermute/UIEntity.cpp b/engines/wintermute/UIEntity.cpp
index 2cf7a3096f..b91e226a3e 100644
--- a/engines/wintermute/UIEntity.cpp
+++ b/engines/wintermute/UIEntity.cpp
@@ -42,21 +42,21 @@ IMPLEMENT_PERSISTENT(CUIEntity, false)
//////////////////////////////////////////////////////////////////////////
CUIEntity::CUIEntity(CBGame *inGame): CUIObject(inGame) {
- m_Type = UI_CUSTOM;
- m_Entity = NULL;
+ _type = UI_CUSTOM;
+ _entity = NULL;
}
//////////////////////////////////////////////////////////////////////////
CUIEntity::~CUIEntity() {
- if (m_Entity) Game->UnregisterObject(m_Entity);
- m_Entity = NULL;
+ if (_entity) Game->UnregisterObject(_entity);
+ _entity = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUIEntity::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CUIEntity::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -64,8 +64,8 @@ HRESULT CUIEntity::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -126,19 +126,19 @@ HRESULT CUIEntity::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_X:
- parser.ScanStr((char *)params, "%d", &m_PosX);
+ parser.ScanStr((char *)params, "%d", &_posX);
break;
case TOKEN_Y:
- parser.ScanStr((char *)params, "%d", &m_PosY);
+ parser.ScanStr((char *)params, "%d", &_posY);
break;
case TOKEN_DISABLED:
- parser.ScanStr((char *)params, "%b", &m_Disable);
+ parser.ScanStr((char *)params, "%b", &_disable);
break;
case TOKEN_VISIBLE:
- parser.ScanStr((char *)params, "%b", &m_Visible);
+ parser.ScanStr((char *)params, "%b", &_visible);
break;
case TOKEN_ENTITY:
@@ -165,9 +165,9 @@ HRESULT CUIEntity::LoadBuffer(byte *Buffer, bool Complete) {
CorrectSize();
- if (Game->m_EditorMode) {
- m_Width = 50;
- m_Height = 50;
+ if (Game->_editorMode) {
+ _width = 50;
+ _height = 50;
}
return S_OK;
@@ -178,24 +178,24 @@ HRESULT CUIEntity::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "ENTITY_CONTAINER\n");
Buffer->PutTextIndent(Indent, "{\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "\n");
- Buffer->PutTextIndent(Indent + 2, "X=%d\n", m_PosX);
- Buffer->PutTextIndent(Indent + 2, "Y=%d\n", m_PosY);
+ Buffer->PutTextIndent(Indent + 2, "X=%d\n", _posX);
+ Buffer->PutTextIndent(Indent + 2, "Y=%d\n", _posY);
- Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", m_Disable ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", m_Visible ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
- if (m_Entity && m_Entity->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "ENTITY=\"%s\"\n", m_Entity->m_Filename);
+ if (_entity && _entity->_filename)
+ Buffer->PutTextIndent(Indent + 2, "ENTITY=\"%s\"\n", _entity->_filename);
Buffer->PutTextIndent(Indent + 2, "\n");
// scripts
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
Buffer->PutTextIndent(Indent + 2, "\n");
@@ -209,39 +209,39 @@ HRESULT CUIEntity::SaveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIEntity::SetEntity(char *Filename) {
- if (m_Entity) Game->UnregisterObject(m_Entity);
- m_Entity = new CAdEntity(Game);
- if (!m_Entity || FAILED(m_Entity->LoadFile(Filename))) {
- delete m_Entity;
- m_Entity = NULL;
+ if (_entity) Game->UnregisterObject(_entity);
+ _entity = new CAdEntity(Game);
+ if (!_entity || FAILED(_entity->LoadFile(Filename))) {
+ delete _entity;
+ _entity = NULL;
return E_FAIL;
} else {
- m_Entity->m_NonIntMouseEvents = true;
- m_Entity->m_SceneIndependent = true;
- m_Entity->MakeFreezable(false);
- Game->RegisterObject(m_Entity);
+ _entity->_nonIntMouseEvents = true;
+ _entity->_sceneIndependent = true;
+ _entity->MakeFreezable(false);
+ Game->RegisterObject(_entity);
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUIEntity::Display(int OffsetX, int OffsetY) {
- if (!m_Visible) return S_OK;
+ if (!_visible) return S_OK;
- if (m_Entity) {
- m_Entity->m_PosX = OffsetX + m_PosX;
- m_Entity->m_PosY = OffsetY + m_PosY;
- if (m_Entity->m_Scale < 0) m_Entity->m_Zoomable = false;
- m_Entity->m_Shadowable = false;
+ if (_entity) {
+ _entity->_posX = OffsetX + _posX;
+ _entity->_posY = OffsetY + _posY;
+ if (_entity->_scale < 0) _entity->_zoomable = false;
+ _entity->_shadowable = false;
- m_Entity->Update();
+ _entity->Update();
- bool OrigReg = m_Entity->m_Registrable;
+ bool OrigReg = _entity->_registrable;
- if (m_Entity->m_Registrable && m_Disable) m_Entity->m_Registrable = false;
+ if (_entity->_registrable && _disable) _entity->_registrable = false;
- m_Entity->Display();
- m_Entity->m_Registrable = OrigReg;
+ _entity->Display();
+ _entity->_registrable = OrigReg;
}
return S_OK;
@@ -258,7 +258,7 @@ HRESULT CUIEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
if (strcmp(Name, "GetEntity") == 0) {
Stack->CorrectParams(0);
- if (m_Entity) Stack->PushNative(m_Entity, true);
+ if (_entity) Stack->PushNative(_entity, true);
else Stack->PushNULL();
return S_OK;
@@ -286,23 +286,23 @@ HRESULT CUIEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
CScValue *CUIEntity::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("entity container");
- return m_ScValue;
+ _scValue->SetString("entity container");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Freezable
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Freezable") == 0) {
- if (m_Entity) m_ScValue->SetBool(m_Entity->m_Freezable);
- else m_ScValue->SetBool(false);
- return m_ScValue;
+ if (_entity) _scValue->SetBool(_entity->_freezable);
+ else _scValue->SetBool(false);
+ return _scValue;
}
else return CUIObject::ScGetProperty(Name);
@@ -315,7 +315,7 @@ HRESULT CUIEntity::ScSetProperty(char *Name, CScValue *Value) {
// Freezable
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Freezable") == 0) {
- if (m_Entity) m_Entity->MakeFreezable(Value->GetBool());
+ if (_entity) _entity->MakeFreezable(Value->GetBool());
return S_OK;
} else return CUIObject::ScSetProperty(Name, Value);
}
@@ -332,7 +332,7 @@ HRESULT CUIEntity::Persist(CBPersistMgr *PersistMgr) {
CUIObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Entity));
+ PersistMgr->Transfer(TMEMBER(_entity));
return S_OK;
}
diff --git a/engines/wintermute/UIEntity.h b/engines/wintermute/UIEntity.h
index f3c9385b7b..3f4b8c9ee2 100644
--- a/engines/wintermute/UIEntity.h
+++ b/engines/wintermute/UIEntity.h
@@ -43,7 +43,7 @@ public:
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
virtual HRESULT Display(int OffsetX = 0, int OffsetY = 0);
- CAdEntity *m_Entity;
+ CAdEntity *_entity;
HRESULT SetEntity(char *Filename);
// scripting interface
diff --git a/engines/wintermute/UIObject.cpp b/engines/wintermute/UIObject.cpp
index 4ff0952bd7..bf0cad25b9 100644
--- a/engines/wintermute/UIObject.cpp
+++ b/engines/wintermute/UIObject.cpp
@@ -42,56 +42,56 @@ IMPLEMENT_PERSISTENT(CUIObject, false)
//////////////////////////////////////////////////////////////////////////
CUIObject::CUIObject(CBGame *inGame): CBObject(inGame) {
- m_Back = NULL;
- m_Image = NULL;
- m_Font = NULL;
- m_Text = NULL;
- m_SharedFonts = m_SharedImages = false;
+ _back = NULL;
+ _image = NULL;
+ _font = NULL;
+ _text = NULL;
+ _sharedFonts = _sharedImages = false;
- m_Width = m_Height = 0;
+ _width = _height = 0;
- m_ListenerObject = NULL;
- m_ListenerParamObject = NULL;
- m_ListenerParamDWORD = 0;
+ _listenerObject = NULL;
+ _listenerParamObject = NULL;
+ _listenerParamDWORD = 0;
- m_Disable = false;
- m_Visible = true;
+ _disable = false;
+ _visible = true;
- m_Type = UI_UNKNOWN;
- m_Parent = NULL;
+ _type = UI_UNKNOWN;
+ _parent = NULL;
- m_ParentNotify = false;
+ _parentNotify = false;
- m_FocusedWidget = NULL;
+ _focusedWidget = NULL;
- m_CanFocus = false;
- m_NonIntMouseEvents = true;
+ _canFocus = false;
+ _nonIntMouseEvents = true;
}
//////////////////////////////////////////////////////////////////////////
CUIObject::~CUIObject() {
- if (!Game->m_LoadInProgress) CSysClassRegistry::GetInstance()->EnumInstances(CBGame::InvalidateValues, "CScValue", (void *)this);
+ if (!Game->_loadInProgress) CSysClassRegistry::GetInstance()->EnumInstances(CBGame::InvalidateValues, "CScValue", (void *)this);
- if (m_Back) delete m_Back;
- if (m_Font && !m_SharedFonts) Game->m_FontStorage->RemoveFont(m_Font);
+ if (_back) delete _back;
+ if (_font && !_sharedFonts) Game->_fontStorage->RemoveFont(_font);
- if (m_Image && !m_SharedImages) delete m_Image;
+ if (_image && !_sharedImages) delete _image;
- if (m_Text) delete [] m_Text;
+ if (_text) delete [] _text;
- m_FocusedWidget = NULL; // ref only
+ _focusedWidget = NULL; // ref only
}
//////////////////////////////////////////////////////////////////////////
void CUIObject::SetText(const char *Text) {
- if (m_Text) delete [] m_Text;
- m_Text = new char [strlen(Text) + 1];
- if (m_Text) {
- strcpy(m_Text, Text);
- for (int i = 0; i < strlen(m_Text); i++) {
- if (m_Text[i] == '|') m_Text[i] = '\n';
+ if (_text) delete [] _text;
+ _text = new char [strlen(Text) + 1];
+ if (_text) {
+ strcpy(_text, Text);
+ for (int i = 0; i < strlen(_text); i++) {
+ if (_text[i] == '|') _text[i] = '\n';
}
}
}
@@ -105,9 +105,9 @@ HRESULT CUIObject::Display(int OffsetX, int OffsetY) {
//////////////////////////////////////////////////////////////////////////
void CUIObject::SetListener(CBScriptHolder *Object, CBScriptHolder *ListenerObject, uint32 ListenerParam) {
- m_ListenerObject = Object;
- m_ListenerParamObject = ListenerObject;
- m_ListenerParamDWORD = ListenerParam;
+ _listenerObject = Object;
+ _listenerParamObject = ListenerObject;
+ _listenerParamDWORD = ListenerParam;
}
@@ -115,21 +115,21 @@ void CUIObject::SetListener(CBScriptHolder *Object, CBScriptHolder *ListenerObje
void CUIObject::CorrectSize() {
RECT rect;
- if (m_Width <= 0) {
- if (m_Image) {
- m_Image->GetBoundingRect(&rect, 0, 0);
- m_Width = rect.right - rect.left;
- } else m_Width = 100;
+ if (_width <= 0) {
+ if (_image) {
+ _image->GetBoundingRect(&rect, 0, 0);
+ _width = rect.right - rect.left;
+ } else _width = 100;
}
- if (m_Height <= 0) {
- if (m_Image) {
- m_Image->GetBoundingRect(&rect, 0, 0);
- m_Height = rect.bottom - rect.top;
+ if (_height <= 0) {
+ if (_image) {
+ _image->GetBoundingRect(&rect, 0, 0);
+ _height = rect.bottom - rect.top;
}
}
- if (m_Back) m_Back->CorrectSize(&m_Width, &m_Height);
+ if (_back) _back->CorrectSize(&_width, &_height);
}
@@ -145,13 +145,13 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
Stack->CorrectParams(1);
CScValue *Val = Stack->Pop();
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
+ if (_font) Game->_fontStorage->RemoveFont(_font);
if (Val->IsNULL()) {
- m_Font = NULL;
+ _font = NULL;
Stack->PushBool(true);
} else {
- m_Font = Game->m_FontStorage->AddFont(Val->GetString());
- Stack->PushBool(m_Font != NULL);
+ _font = Game->_fontStorage->AddFont(Val->GetString());
+ Stack->PushBool(_font != NULL);
}
return S_OK;
}
@@ -165,17 +165,17 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
char *Filename = Val->GetString();
- delete m_Image;
- m_Image = NULL;
+ delete _image;
+ _image = NULL;
if (Val->IsNULL()) {
Stack->PushBool(true);
return S_OK;
}
- m_Image = new CBSprite(Game);
- if (!m_Image || FAILED(m_Image->LoadFile(Val->GetString()))) {
- delete m_Image;
- m_Image = NULL;
+ _image = new CBSprite(Game);
+ if (!_image || FAILED(_image->LoadFile(Val->GetString()))) {
+ delete _image;
+ _image = NULL;
Stack->PushBool(false);
} else Stack->PushBool(true);
@@ -187,8 +187,8 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetImage") == 0) {
Stack->CorrectParams(0);
- if (!m_Image || !m_Image->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_Image->m_Filename);
+ if (!_image || !_image->_filename) Stack->PushNULL();
+ else Stack->PushString(_image->_filename);
return S_OK;
}
@@ -198,8 +198,8 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetImageObject") == 0) {
Stack->CorrectParams(0);
- if (!m_Image) Stack->PushNULL();
- else Stack->PushNative(m_Image, true);
+ if (!_image) Stack->PushNULL();
+ else Stack->PushNative(_image, true);
return S_OK;
}
@@ -220,8 +220,8 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "MoveAfter") == 0 || strcmp(Name, "MoveBefore") == 0) {
Stack->CorrectParams(1);
- if (m_Parent && m_Parent->m_Type == UI_WINDOW) {
- CUIWindow *win = (CUIWindow *)m_Parent;
+ if (_parent && _parent->_type == UI_WINDOW) {
+ CUIWindow *win = (CUIWindow *)_parent;
int i;
bool found = false;
@@ -229,8 +229,8 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
// find directly
if (val->IsNative()) {
CUIObject *widget = (CUIObject *)val->GetNative();
- for (i = 0; i < win->m_Widgets.GetSize(); i++) {
- if (win->m_Widgets[i] == widget) {
+ for (i = 0; i < win->_widgets.GetSize(); i++) {
+ if (win->_widgets[i] == widget) {
found = true;
break;
}
@@ -239,8 +239,8 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
// find by name
else {
char *name = val->GetString();
- for (i = 0; i < win->m_Widgets.GetSize(); i++) {
- if (scumm_stricmp(win->m_Widgets[i]->m_Name, name) == 0) {
+ for (i = 0; i < win->_widgets.GetSize(); i++) {
+ if (scumm_stricmp(win->_widgets[i]->_name, name) == 0) {
found = true;
break;
}
@@ -249,13 +249,13 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
if (found) {
bool done = false;
- for (int j = 0; j < win->m_Widgets.GetSize(); j++) {
- if (win->m_Widgets[j] == this) {
+ for (int j = 0; j < win->_widgets.GetSize(); j++) {
+ if (win->_widgets[j] == this) {
if (strcmp(Name, "MoveAfter") == 0) i++;
if (j >= i) j++;
- win->m_Widgets.InsertAt(i, this);
- win->m_Widgets.RemoveAt(j);
+ win->_widgets.InsertAt(i, this);
+ win->_widgets.RemoveAt(j);
done = true;
Stack->PushBool(true);
@@ -276,12 +276,12 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "MoveToBottom") == 0) {
Stack->CorrectParams(0);
- if (m_Parent && m_Parent->m_Type == UI_WINDOW) {
- CUIWindow *win = (CUIWindow *)m_Parent;
- for (int i = 0; i < win->m_Widgets.GetSize(); i++) {
- if (win->m_Widgets[i] == this) {
- win->m_Widgets.RemoveAt(i);
- win->m_Widgets.InsertAt(0, this);
+ if (_parent && _parent->_type == UI_WINDOW) {
+ CUIWindow *win = (CUIWindow *)_parent;
+ for (int i = 0; i < win->_widgets.GetSize(); i++) {
+ if (win->_widgets[i] == this) {
+ win->_widgets.RemoveAt(i);
+ win->_widgets.InsertAt(0, this);
break;
}
}
@@ -297,12 +297,12 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "MoveToTop") == 0) {
Stack->CorrectParams(0);
- if (m_Parent && m_Parent->m_Type == UI_WINDOW) {
- CUIWindow *win = (CUIWindow *)m_Parent;
- for (int i = 0; i < win->m_Widgets.GetSize(); i++) {
- if (win->m_Widgets[i] == this) {
- win->m_Widgets.RemoveAt(i);
- win->m_Widgets.Add(this);
+ if (_parent && _parent->_type == UI_WINDOW) {
+ CUIWindow *win = (CUIWindow *)_parent;
+ for (int i = 0; i < win->_widgets.GetSize(); i++) {
+ if (win->_widgets[i] == this) {
+ win->_widgets.RemoveAt(i);
+ win->_widgets.Add(this);
break;
}
}
@@ -318,99 +318,99 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
CScValue *CUIObject::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("ui_object");
- return m_ScValue;
+ _scValue->SetString("ui_object");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Name") == 0) {
- m_ScValue->SetString(m_Name);
- return m_ScValue;
+ _scValue->SetString(_name);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Parent (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Parent") == 0) {
- m_ScValue->SetNative(m_Parent, true);
- return m_ScValue;
+ _scValue->SetNative(_parent, true);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ParentNotify
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ParentNotify") == 0) {
- m_ScValue->SetBool(m_ParentNotify);
- return m_ScValue;
+ _scValue->SetBool(_parentNotify);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Width") == 0) {
- m_ScValue->SetInt(m_Width);
- return m_ScValue;
+ _scValue->SetInt(_width);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Height") == 0) {
- m_ScValue->SetInt(m_Height);
- return m_ScValue;
+ _scValue->SetInt(_height);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Visible
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Visible") == 0) {
- m_ScValue->SetBool(m_Visible);
- return m_ScValue;
+ _scValue->SetBool(_visible);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Disabled
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Disabled") == 0) {
- m_ScValue->SetBool(m_Disable);
- return m_ScValue;
+ _scValue->SetBool(_disable);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Text
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Text") == 0) {
- m_ScValue->SetString(m_Text);
- return m_ScValue;
+ _scValue->SetString(_text);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NextSibling (RO) / PrevSibling (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NextSibling") == 0 || strcmp(Name, "PrevSibling") == 0) {
- m_ScValue->SetNULL();
- if (m_Parent && m_Parent->m_Type == UI_WINDOW) {
- CUIWindow *win = (CUIWindow *)m_Parent;
- for (int i = 0; i < win->m_Widgets.GetSize(); i++) {
- if (win->m_Widgets[i] == this) {
+ _scValue->SetNULL();
+ if (_parent && _parent->_type == UI_WINDOW) {
+ CUIWindow *win = (CUIWindow *)_parent;
+ for (int i = 0; i < win->_widgets.GetSize(); i++) {
+ if (win->_widgets[i] == this) {
if (strcmp(Name, "NextSibling") == 0) {
- if (i < win->m_Widgets.GetSize() - 1) m_ScValue->SetNative(win->m_Widgets[i + 1], true);
+ if (i < win->_widgets.GetSize() - 1) _scValue->SetNative(win->_widgets[i + 1], true);
} else {
- if (i > 0) m_ScValue->SetNative(win->m_Widgets[i - 1], true);
+ if (i > 0) _scValue->SetNative(win->_widgets[i - 1], true);
}
break;
}
}
}
- return m_ScValue;
+ return _scValue;
}
else return CBObject::ScGetProperty(Name);
@@ -431,7 +431,7 @@ HRESULT CUIObject::ScSetProperty(char *Name, CScValue *Value) {
// ParentNotify
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ParentNotify") == 0) {
- m_ParentNotify = Value->GetBool();
+ _parentNotify = Value->GetBool();
return S_OK;
}
@@ -439,7 +439,7 @@ HRESULT CUIObject::ScSetProperty(char *Name, CScValue *Value) {
// Width
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Width") == 0) {
- m_Width = Value->GetInt();
+ _width = Value->GetInt();
return S_OK;
}
@@ -447,7 +447,7 @@ HRESULT CUIObject::ScSetProperty(char *Name, CScValue *Value) {
// Height
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Height") == 0) {
- m_Height = Value->GetInt();
+ _height = Value->GetInt();
return S_OK;
}
@@ -455,7 +455,7 @@ HRESULT CUIObject::ScSetProperty(char *Name, CScValue *Value) {
// Visible
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Visible") == 0) {
- m_Visible = Value->GetBool();
+ _visible = Value->GetBool();
return S_OK;
}
@@ -463,7 +463,7 @@ HRESULT CUIObject::ScSetProperty(char *Name, CScValue *Value) {
// Disabled
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Disabled") == 0) {
- m_Disable = Value->GetBool();
+ _disable = Value->GetBool();
return S_OK;
}
@@ -487,13 +487,13 @@ char *CUIObject::ScToString() {
//////////////////////////////////////////////////////////////////////////
bool CUIObject::IsFocused() {
- if (!Game->m_FocusedWindow) return false;
- if (Game->m_FocusedWindow == this) return true;
+ if (!Game->_focusedWindow) return false;
+ if (Game->_focusedWindow == this) return true;
- CUIObject *obj = Game->m_FocusedWindow;
+ CUIObject *obj = Game->_focusedWindow;
while (obj) {
if (obj == this) return true;
- else obj = obj->m_FocusedWidget;
+ else obj = obj->_focusedWidget;
}
return false;
}
@@ -514,22 +514,22 @@ HRESULT CUIObject::Focus() {
CUIObject *obj = this;
bool disabled = false;
while (obj) {
- if (obj->m_Disable && obj->m_Type == UI_WINDOW) {
+ if (obj->_disable && obj->_type == UI_WINDOW) {
disabled = true;
break;
}
- obj = obj->m_Parent;
+ obj = obj->_parent;
}
if (!disabled) {
obj = this;
while (obj) {
- if (obj->m_Parent) {
- if (!obj->m_Disable && obj->m_CanFocus) obj->m_Parent->m_FocusedWidget = obj;
+ if (obj->_parent) {
+ if (!obj->_disable && obj->_canFocus) obj->_parent->_focusedWidget = obj;
} else {
- if (obj->m_Type == UI_WINDOW) Game->FocusWindow((CUIWindow *)obj);
+ if (obj->_type == UI_WINDOW) Game->FocusWindow((CUIWindow *)obj);
}
- obj = obj->m_Parent;
+ obj = obj->_parent;
}
}
return S_OK;
@@ -540,12 +540,12 @@ HRESULT CUIObject::Focus() {
HRESULT CUIObject::GetTotalOffset(int *OffsetX, int *OffsetY) {
int OffX = 0, OffY = 0;
- CUIObject *obj = m_Parent;
+ CUIObject *obj = _parent;
while (obj) {
- OffX += obj->m_PosX;
- OffY += obj->m_PosY;
+ OffX += obj->_posX;
+ OffY += obj->_posY;
- obj = obj->m_Parent;
+ obj = obj->_parent;
}
if (OffsetX) *OffsetX = OffX;
if (OffsetY) *OffsetY = OffY;
@@ -559,24 +559,24 @@ HRESULT CUIObject::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Back));
- PersistMgr->Transfer(TMEMBER(m_CanFocus));
- PersistMgr->Transfer(TMEMBER(m_Disable));
- PersistMgr->Transfer(TMEMBER(m_FocusedWidget));
- PersistMgr->Transfer(TMEMBER(m_Font));
- PersistMgr->Transfer(TMEMBER(m_Height));
- PersistMgr->Transfer(TMEMBER(m_Image));
- PersistMgr->Transfer(TMEMBER(m_ListenerObject));
- PersistMgr->Transfer(TMEMBER(m_ListenerParamObject));
- PersistMgr->Transfer(TMEMBER(m_ListenerParamDWORD));
- PersistMgr->Transfer(TMEMBER(m_Parent));
- PersistMgr->Transfer(TMEMBER(m_ParentNotify));
- PersistMgr->Transfer(TMEMBER(m_SharedFonts));
- PersistMgr->Transfer(TMEMBER(m_SharedImages));
- PersistMgr->Transfer(TMEMBER(m_Text));
- PersistMgr->Transfer(TMEMBER_INT(m_Type));
- PersistMgr->Transfer(TMEMBER(m_Visible));
- PersistMgr->Transfer(TMEMBER(m_Width));
+ PersistMgr->Transfer(TMEMBER(_back));
+ PersistMgr->Transfer(TMEMBER(_canFocus));
+ PersistMgr->Transfer(TMEMBER(_disable));
+ PersistMgr->Transfer(TMEMBER(_focusedWidget));
+ PersistMgr->Transfer(TMEMBER(_font));
+ PersistMgr->Transfer(TMEMBER(_height));
+ PersistMgr->Transfer(TMEMBER(_image));
+ PersistMgr->Transfer(TMEMBER(_listenerObject));
+ PersistMgr->Transfer(TMEMBER(_listenerParamObject));
+ PersistMgr->Transfer(TMEMBER(_listenerParamDWORD));
+ PersistMgr->Transfer(TMEMBER(_parent));
+ PersistMgr->Transfer(TMEMBER(_parentNotify));
+ PersistMgr->Transfer(TMEMBER(_sharedFonts));
+ PersistMgr->Transfer(TMEMBER(_sharedImages));
+ PersistMgr->Transfer(TMEMBER(_text));
+ PersistMgr->Transfer(TMEMBER_INT(_type));
+ PersistMgr->Transfer(TMEMBER(_visible));
+ PersistMgr->Transfer(TMEMBER(_width));
return S_OK;
}
diff --git a/engines/wintermute/UIObject.h b/engines/wintermute/UIObject.h
index 9742307504..bf6b1b079a 100644
--- a/engines/wintermute/UIObject.h
+++ b/engines/wintermute/UIObject.h
@@ -41,34 +41,34 @@ class CUIObject : public CBObject {
public:
HRESULT GetTotalOffset(int *OffsetX, int *OffsetY);
- bool m_CanFocus;
+ bool _canFocus;
HRESULT Focus();
virtual HRESULT HandleMouse(TMouseEvent Event, TMouseButton Button);
bool IsFocused();
- bool m_ParentNotify;
+ bool _parentNotify;
DECLARE_PERSISTENT(CUIObject, CBObject)
- CUIObject *m_Parent;
+ CUIObject *_parent;
virtual HRESULT Display(int OffsetX = 0, int OffsetY = 0);
virtual void CorrectSize();
- bool m_SharedFonts;
- bool m_SharedImages;
+ bool _sharedFonts;
+ bool _sharedImages;
void SetText(const char *Text);
- char *m_Text;
- CBFont *m_Font;
- bool m_Visible;
- CUITiledImage *m_Back;
- bool m_Disable;
+ char *_text;
+ CBFont *_font;
+ bool _visible;
+ CUITiledImage *_back;
+ bool _disable;
CUIObject(CBGame *inGame = NULL);
virtual ~CUIObject();
- int m_Width;
- int m_Height;
- TUIObjectType m_Type;
- CBSprite *m_Image;
+ int _width;
+ int _height;
+ TUIObjectType _type;
+ CBSprite *_image;
void SetListener(CBScriptHolder *Object, CBScriptHolder *ListenerObject, uint32 ListenerParam);
- CBScriptHolder *m_ListenerParamObject;
- uint32 m_ListenerParamDWORD;
- CBScriptHolder *m_ListenerObject;
- CUIObject *m_FocusedWidget;
+ CBScriptHolder *_listenerParamObject;
+ uint32 _listenerParamDWORD;
+ CBScriptHolder *_listenerObject;
+ CUIObject *_focusedWidget;
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
// scripting interface
diff --git a/engines/wintermute/UIText.cpp b/engines/wintermute/UIText.cpp
index 524d1eec91..c0ecc60eac 100644
--- a/engines/wintermute/UIText.cpp
+++ b/engines/wintermute/UIText.cpp
@@ -48,10 +48,10 @@ IMPLEMENT_PERSISTENT(CUIText, false)
//////////////////////////////////////////////////////////////////////////
CUIText::CUIText(CBGame *inGame): CUIObject(inGame) {
- m_TextAlign = TAL_LEFT;
- m_VerticalAlign = VAL_CENTER;
- m_Type = UI_STATIC;
- m_CanFocus = false;
+ _textAlign = TAL_LEFT;
+ _verticalAlign = VAL_CENTER;
+ _type = UI_STATIC;
+ _canFocus = false;
}
@@ -63,31 +63,31 @@ CUIText::~CUIText() {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIText::Display(int OffsetX, int OffsetY) {
- if (!m_Visible) return S_OK;
+ if (!_visible) return S_OK;
- CBFont *font = m_Font;
- if (!font) font = Game->m_SystemFont;
+ CBFont *font = _font;
+ if (!font) font = Game->_systemFont;
- if (m_Back) m_Back->Display(OffsetX + m_PosX, OffsetY + m_PosY, m_Width, m_Height);
- if (m_Image) m_Image->Draw(OffsetX + m_PosX, OffsetY + m_PosY, NULL);
+ if (_back) _back->Display(OffsetX + _posX, OffsetY + _posY, _width, _height);
+ if (_image) _image->Draw(OffsetX + _posX, OffsetY + _posY, NULL);
- if (font && m_Text) {
+ if (font && _text) {
int text_offset;
- switch (m_VerticalAlign) {
+ switch (_verticalAlign) {
case VAL_TOP:
text_offset = 0;
break;
case VAL_BOTTOM:
- text_offset = m_Height - font->GetTextHeight((byte *)m_Text, m_Width);
+ text_offset = _height - font->GetTextHeight((byte *)_text, _width);
break;
default:
- text_offset = (m_Height - font->GetTextHeight((byte *)m_Text, m_Width)) / 2;
+ text_offset = (_height - font->GetTextHeight((byte *)_text, _width)) / 2;
}
- font->DrawText((byte *)m_Text, OffsetX + m_PosX, OffsetY + m_PosY + text_offset, m_Width, m_TextAlign, m_Height);
+ font->DrawText((byte *)_text, OffsetX + _posX, OffsetY + _posY + text_offset, _width, _textAlign, _height);
}
- //Game->m_Renderer->m_RectList.Add(new CBActiveRect(Game, this, NULL, OffsetX + m_PosX, OffsetY + m_PosY, m_Width, m_Height, 100, 100, false));
+ //Game->_renderer->_rectList.Add(new CBActiveRect(Game, this, NULL, OffsetX + _posX, OffsetY + _posY, _width, _height, 100, 100, false));
return S_OK;
}
@@ -96,7 +96,7 @@ HRESULT CUIText::Display(int OffsetX, int OffsetY) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIText::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CUIText::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -104,8 +104,8 @@ HRESULT CUIText::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -189,70 +189,70 @@ HRESULT CUIText::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_BACK:
- delete m_Back;
- m_Back = new CUITiledImage(Game);
- if (!m_Back || FAILED(m_Back->LoadFile((char *)params))) {
- delete m_Back;
- m_Back = NULL;
+ delete _back;
+ _back = new CUITiledImage(Game);
+ if (!_back || FAILED(_back->LoadFile((char *)params))) {
+ delete _back;
+ _back = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE:
- delete m_Image;
- m_Image = new CBSprite(Game);
- if (!m_Image || FAILED(m_Image->LoadFile((char *)params))) {
- delete m_Image;
- m_Image = NULL;
+ delete _image;
+ _image = new CBSprite(Game);
+ if (!_image || FAILED(_image->LoadFile((char *)params))) {
+ delete _image;
+ _image = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_FONT:
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
- m_Font = Game->m_FontStorage->AddFont((char *)params);
- if (!m_Font) cmd = PARSERR_GENERIC;
+ if (_font) Game->_fontStorage->RemoveFont(_font);
+ _font = Game->_fontStorage->AddFont((char *)params);
+ if (!_font) cmd = PARSERR_GENERIC;
break;
case TOKEN_TEXT:
SetText((char *)params);
- Game->m_StringTable->Expand(&m_Text);
+ Game->_stringTable->Expand(&_text);
break;
case TOKEN_TEXT_ALIGN:
- if (scumm_stricmp((char *)params, "left") == 0) m_TextAlign = TAL_LEFT;
- else if (scumm_stricmp((char *)params, "right") == 0) m_TextAlign = TAL_RIGHT;
- else m_TextAlign = TAL_CENTER;
+ if (scumm_stricmp((char *)params, "left") == 0) _textAlign = TAL_LEFT;
+ else if (scumm_stricmp((char *)params, "right") == 0) _textAlign = TAL_RIGHT;
+ else _textAlign = TAL_CENTER;
break;
case TOKEN_VERTICAL_ALIGN:
- if (scumm_stricmp((char *)params, "top") == 0) m_VerticalAlign = VAL_TOP;
- else if (scumm_stricmp((char *)params, "bottom") == 0) m_VerticalAlign = VAL_BOTTOM;
- else m_VerticalAlign = VAL_CENTER;
+ if (scumm_stricmp((char *)params, "top") == 0) _verticalAlign = VAL_TOP;
+ else if (scumm_stricmp((char *)params, "bottom") == 0) _verticalAlign = VAL_BOTTOM;
+ else _verticalAlign = VAL_CENTER;
break;
case TOKEN_X:
- parser.ScanStr((char *)params, "%d", &m_PosX);
+ parser.ScanStr((char *)params, "%d", &_posX);
break;
case TOKEN_Y:
- parser.ScanStr((char *)params, "%d", &m_PosY);
+ parser.ScanStr((char *)params, "%d", &_posY);
break;
case TOKEN_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_Width);
+ parser.ScanStr((char *)params, "%d", &_width);
break;
case TOKEN_HEIGHT:
- parser.ScanStr((char *)params, "%d", &m_Height);
+ parser.ScanStr((char *)params, "%d", &_height);
break;
case TOKEN_CURSOR:
- delete m_Cursor;
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- delete m_Cursor;
- m_Cursor = NULL;
+ delete _cursor;
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
@@ -262,15 +262,15 @@ HRESULT CUIText::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_PARENT_NOTIFY:
- parser.ScanStr((char *)params, "%b", &m_ParentNotify);
+ parser.ScanStr((char *)params, "%b", &_parentNotify);
break;
case TOKEN_DISABLED:
- parser.ScanStr((char *)params, "%b", &m_Disable);
+ parser.ScanStr((char *)params, "%b", &_disable);
break;
case TOKEN_VISIBLE:
- parser.ScanStr((char *)params, "%b", &m_Visible);
+ parser.ScanStr((char *)params, "%b", &_visible);
break;
case TOKEN_EDITOR_PROPERTY:
@@ -297,27 +297,27 @@ HRESULT CUIText::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "STATIC\n");
Buffer->PutTextIndent(Indent, "{\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
Buffer->PutTextIndent(Indent + 2, "\n");
- if (m_Back && m_Back->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK=\"%s\"\n", m_Back->m_Filename);
+ if (_back && _back->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
- if (m_Image && m_Image->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", m_Image->m_Filename);
+ if (_image && _image->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
- if (m_Font && m_Font->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", m_Font->m_Filename);
+ if (_font && _font->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
- if (m_Cursor && m_Cursor->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", m_Cursor->m_Filename);
+ if (_cursor && _cursor->_filename)
+ Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
- if (m_Text)
- Buffer->PutTextIndent(Indent + 2, "TEXT=\"%s\"\n", m_Text);
+ if (_text)
+ Buffer->PutTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
- switch (m_TextAlign) {
+ switch (_textAlign) {
case TAL_LEFT:
Buffer->PutTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
break;
@@ -329,7 +329,7 @@ HRESULT CUIText::SaveAsText(CBDynBuffer *Buffer, int Indent) {
break;
}
- switch (m_VerticalAlign) {
+ switch (_verticalAlign) {
case VAL_TOP:
Buffer->PutTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "top");
break;
@@ -343,20 +343,20 @@ HRESULT CUIText::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent + 2, "\n");
- Buffer->PutTextIndent(Indent + 2, "X=%d\n", m_PosX);
- Buffer->PutTextIndent(Indent + 2, "Y=%d\n", m_PosY);
- Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", m_Width);
- Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", m_Height);
+ Buffer->PutTextIndent(Indent + 2, "X=%d\n", _posX);
+ Buffer->PutTextIndent(Indent + 2, "Y=%d\n", _posY);
+ Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", _width);
+ Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
- Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", m_Disable ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", m_Visible ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", m_ParentNotify ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
Buffer->PutTextIndent(Indent + 2, "\n");
// scripts
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
Buffer->PutTextIndent(Indent + 2, "\n");
@@ -387,7 +387,7 @@ HRESULT CUIText::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "HeightToFit") == 0) {
Stack->CorrectParams(0);
- if (m_Font && m_Text) m_Height = m_Font->GetTextHeight((byte *)m_Text, m_Width);
+ if (_font && _text) _height = _font->GetTextHeight((byte *)_text, _width);
Stack->PushNULL();
return S_OK;
}
@@ -398,30 +398,30 @@ HRESULT CUIText::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
CScValue *CUIText::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("static");
- return m_ScValue;
+ _scValue->SetString("static");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TextAlign
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TextAlign") == 0) {
- m_ScValue->SetInt(m_TextAlign);
- return m_ScValue;
+ _scValue->SetInt(_textAlign);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// VerticalAlign
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "VerticalAlign") == 0) {
- m_ScValue->SetInt(m_VerticalAlign);
- return m_ScValue;
+ _scValue->SetInt(_verticalAlign);
+ return _scValue;
}
else return CUIObject::ScGetProperty(Name);
@@ -436,7 +436,7 @@ HRESULT CUIText::ScSetProperty(char *Name, CScValue *Value) {
if (strcmp(Name, "TextAlign") == 0) {
int i = Value->GetInt();
if (i < 0 || i >= NUM_TEXT_ALIGN) i = 0;
- m_TextAlign = (TTextAlign)i;
+ _textAlign = (TTextAlign)i;
return S_OK;
}
@@ -446,7 +446,7 @@ HRESULT CUIText::ScSetProperty(char *Name, CScValue *Value) {
else if (strcmp(Name, "VerticalAlign") == 0) {
int i = Value->GetInt();
if (i < 0 || i >= NUM_VERTICAL_ALIGN) i = 0;
- m_VerticalAlign = (TVerticalAlign)i;
+ _verticalAlign = (TVerticalAlign)i;
return S_OK;
}
@@ -465,8 +465,8 @@ char *CUIText::ScToString() {
HRESULT CUIText::Persist(CBPersistMgr *PersistMgr) {
CUIObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER_INT(m_TextAlign));
- PersistMgr->Transfer(TMEMBER_INT(m_VerticalAlign));
+ PersistMgr->Transfer(TMEMBER_INT(_textAlign));
+ PersistMgr->Transfer(TMEMBER_INT(_verticalAlign));
return S_OK;
}
@@ -474,9 +474,9 @@ HRESULT CUIText::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIText::SizeToFit() {
- if (m_Font && m_Text) {
- m_Width = m_Font->GetTextWidth((byte *)m_Text);
- m_Height = m_Font->GetTextHeight((byte *)m_Text, m_Width);
+ if (_font && _text) {
+ _width = _font->GetTextWidth((byte *)_text);
+ _height = _font->GetTextHeight((byte *)_text, _width);
}
return S_OK;
}
diff --git a/engines/wintermute/UIText.h b/engines/wintermute/UIText.h
index 74158cb636..cdd0acbc48 100644
--- a/engines/wintermute/UIText.h
+++ b/engines/wintermute/UIText.h
@@ -41,8 +41,8 @@ public:
DECLARE_PERSISTENT(CUIText, CUIObject)
CUIText(CBGame *inGame = NULL);
virtual ~CUIText();
- TTextAlign m_TextAlign;
- TVerticalAlign m_VerticalAlign;
+ TTextAlign _textAlign;
+ TVerticalAlign _verticalAlign;
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/UITiledImage.cpp b/engines/wintermute/UITiledImage.cpp
index c85ea38a5e..44d78845a3 100644
--- a/engines/wintermute/UITiledImage.cpp
+++ b/engines/wintermute/UITiledImage.cpp
@@ -42,77 +42,77 @@ IMPLEMENT_PERSISTENT(CUITiledImage, false)
//////////////////////////////////////////////////////////////////////////
CUITiledImage::CUITiledImage(CBGame *inGame): CBObject(inGame) {
- m_Image = NULL;
-
- CBPlatform::SetRectEmpty(&m_UpLeft);
- CBPlatform::SetRectEmpty(&m_UpMiddle);
- CBPlatform::SetRectEmpty(&m_UpRight);
- CBPlatform::SetRectEmpty(&m_MiddleLeft);
- CBPlatform::SetRectEmpty(&m_MiddleMiddle);
- CBPlatform::SetRectEmpty(&m_MiddleRight);
- CBPlatform::SetRectEmpty(&m_DownLeft);
- CBPlatform::SetRectEmpty(&m_DownMiddle);
- CBPlatform::SetRectEmpty(&m_DownRight);
+ _image = NULL;
+
+ CBPlatform::SetRectEmpty(&_upLeft);
+ CBPlatform::SetRectEmpty(&_upMiddle);
+ CBPlatform::SetRectEmpty(&_upRight);
+ CBPlatform::SetRectEmpty(&_middleLeft);
+ CBPlatform::SetRectEmpty(&_middleMiddle);
+ CBPlatform::SetRectEmpty(&_middleRight);
+ CBPlatform::SetRectEmpty(&_downLeft);
+ CBPlatform::SetRectEmpty(&_downMiddle);
+ CBPlatform::SetRectEmpty(&_downRight);
}
//////////////////////////////////////////////////////////////////////////
CUITiledImage::~CUITiledImage() {
- delete m_Image;
- m_Image = NULL;
+ delete _image;
+ _image = NULL;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUITiledImage::Display(int X, int Y, int Width, int Height) {
- if (!m_Image) return E_FAIL;
+ if (!_image) return E_FAIL;
- int tile_width = m_MiddleMiddle.right - m_MiddleMiddle.left;
- int tile_height = m_MiddleMiddle.bottom - m_MiddleMiddle.top;
+ int tile_width = _middleMiddle.right - _middleMiddle.left;
+ int tile_height = _middleMiddle.bottom - _middleMiddle.top;
- int num_columns = (Width - (m_MiddleLeft.right - m_MiddleLeft.left) - (m_MiddleRight.right - m_MiddleRight.left)) / tile_width;
- int num_rows = (Height - (m_UpMiddle.bottom - m_UpMiddle.top) - (m_DownMiddle.bottom - m_DownMiddle.top)) / tile_height;
+ int nu_columns = (Width - (_middleLeft.right - _middleLeft.left) - (_middleRight.right - _middleRight.left)) / tile_width;
+ int nu_rows = (Height - (_upMiddle.bottom - _upMiddle.top) - (_downMiddle.bottom - _downMiddle.top)) / tile_height;
int col, row;
- Game->m_Renderer->StartSpriteBatch();
+ Game->_renderer->StartSpriteBatch();
// top left/right
- m_Image->m_Surface->DisplayTrans(X, Y, m_UpLeft);
- m_Image->m_Surface->DisplayTrans(X + (m_UpLeft.right - m_UpLeft.left) + num_columns * tile_width, Y, m_UpRight);
+ _image->_surface->DisplayTrans(X, Y, _upLeft);
+ _image->_surface->DisplayTrans(X + (_upLeft.right - _upLeft.left) + nu_columns * tile_width, Y, _upRight);
// bottom left/right
- m_Image->m_Surface->DisplayTrans(X, Y + (m_UpMiddle.bottom - m_UpMiddle.top) + num_rows * tile_height, m_DownLeft);
- m_Image->m_Surface->DisplayTrans(X + (m_UpLeft.right - m_UpLeft.left) + num_columns * tile_width, Y + (m_UpMiddle.bottom - m_UpMiddle.top) + num_rows * tile_height, m_DownRight);
+ _image->_surface->DisplayTrans(X, Y + (_upMiddle.bottom - _upMiddle.top) + nu_rows * tile_height, _downLeft);
+ _image->_surface->DisplayTrans(X + (_upLeft.right - _upLeft.left) + nu_columns * tile_width, Y + (_upMiddle.bottom - _upMiddle.top) + nu_rows * tile_height, _downRight);
// left/right
- int yyy = Y + (m_UpMiddle.bottom - m_UpMiddle.top);
- for (row = 0; row < num_rows; row++) {
- m_Image->m_Surface->DisplayTrans(X, yyy, m_MiddleLeft);
- m_Image->m_Surface->DisplayTrans(X + (m_MiddleLeft.right - m_MiddleLeft.left) + num_columns * tile_width, yyy, m_MiddleRight);
+ int yyy = Y + (_upMiddle.bottom - _upMiddle.top);
+ for (row = 0; row < nu_rows; row++) {
+ _image->_surface->DisplayTrans(X, yyy, _middleLeft);
+ _image->_surface->DisplayTrans(X + (_middleLeft.right - _middleLeft.left) + nu_columns * tile_width, yyy, _middleRight);
yyy += tile_width;
}
// top/bottom
- int xxx = X + (m_UpLeft.right - m_UpLeft.left);
- for (col = 0; col < num_columns; col++) {
- m_Image->m_Surface->DisplayTrans(xxx, Y, m_UpMiddle);
- m_Image->m_Surface->DisplayTrans(xxx, Y + (m_UpMiddle.bottom - m_UpMiddle.top) + num_rows * tile_height, m_DownMiddle);
+ int xxx = X + (_upLeft.right - _upLeft.left);
+ for (col = 0; col < nu_columns; col++) {
+ _image->_surface->DisplayTrans(xxx, Y, _upMiddle);
+ _image->_surface->DisplayTrans(xxx, Y + (_upMiddle.bottom - _upMiddle.top) + nu_rows * tile_height, _downMiddle);
xxx += tile_width;
}
// tiles
- yyy = Y + (m_UpMiddle.bottom - m_UpMiddle.top);
- for (row = 0; row < num_rows; row++) {
- xxx = X + (m_UpLeft.right - m_UpLeft.left);
- for (col = 0; col < num_columns; col++) {
- m_Image->m_Surface->DisplayTrans(xxx, yyy, m_MiddleMiddle);
+ yyy = Y + (_upMiddle.bottom - _upMiddle.top);
+ for (row = 0; row < nu_rows; row++) {
+ xxx = X + (_upLeft.right - _upLeft.left);
+ for (col = 0; col < nu_columns; col++) {
+ _image->_surface->DisplayTrans(xxx, yyy, _middleMiddle);
xxx += tile_width;
}
yyy += tile_width;
}
- Game->m_Renderer->EndSpriteBatch();
+ Game->_renderer->EndSpriteBatch();
return S_OK;
}
@@ -120,7 +120,7 @@ HRESULT CUITiledImage::Display(int X, int Y, int Width, int Height) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUITiledImage::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CUITiledImage::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -128,8 +128,8 @@ HRESULT CUITiledImage::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -199,49 +199,49 @@ HRESULT CUITiledImage::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_IMAGE:
- delete m_Image;
- m_Image = new CBSubFrame(Game);
- if (!m_Image || FAILED(m_Image->SetSurface((char *)params))) {
- delete m_Image;
- m_Image = NULL;
+ delete _image;
+ _image = new CBSubFrame(Game);
+ if (!_image || FAILED(_image->SetSurface((char *)params))) {
+ delete _image;
+ _image = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_UP_LEFT:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_UpLeft.left, &m_UpLeft.top, &m_UpLeft.right, &m_UpLeft.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_upLeft.left, &_upLeft.top, &_upLeft.right, &_upLeft.bottom);
break;
case TOKEN_UP_RIGHT:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_UpRight.left, &m_UpRight.top, &m_UpRight.right, &m_UpRight.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_upRight.left, &_upRight.top, &_upRight.right, &_upRight.bottom);
break;
case TOKEN_UP_MIDDLE:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_UpMiddle.left, &m_UpMiddle.top, &m_UpMiddle.right, &m_UpMiddle.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_upMiddle.left, &_upMiddle.top, &_upMiddle.right, &_upMiddle.bottom);
break;
case TOKEN_DOWN_LEFT:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_DownLeft.left, &m_DownLeft.top, &m_DownLeft.right, &m_DownLeft.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_downLeft.left, &_downLeft.top, &_downLeft.right, &_downLeft.bottom);
break;
case TOKEN_DOWN_RIGHT:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_DownRight.left, &m_DownRight.top, &m_DownRight.right, &m_DownRight.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_downRight.left, &_downRight.top, &_downRight.right, &_downRight.bottom);
break;
case TOKEN_DOWN_MIDDLE:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_DownMiddle.left, &m_DownMiddle.top, &m_DownMiddle.right, &m_DownMiddle.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_downMiddle.left, &_downMiddle.top, &_downMiddle.right, &_downMiddle.bottom);
break;
case TOKEN_MIDDLE_LEFT:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_MiddleLeft.left, &m_MiddleLeft.top, &m_MiddleLeft.right, &m_MiddleLeft.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_middleLeft.left, &_middleLeft.top, &_middleLeft.right, &_middleLeft.bottom);
break;
case TOKEN_MIDDLE_RIGHT:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_MiddleRight.left, &m_MiddleRight.top, &m_MiddleRight.right, &m_MiddleRight.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_middleRight.left, &_middleRight.top, &_middleRight.right, &_middleRight.bottom);
break;
case TOKEN_MIDDLE_MIDDLE:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_MiddleMiddle.left, &m_MiddleMiddle.top, &m_MiddleMiddle.right, &m_MiddleMiddle.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_middleMiddle.left, &_middleMiddle.top, &_middleMiddle.right, &_middleMiddle.bottom);
break;
case TOKEN_HORIZONTAL_TILES:
@@ -270,37 +270,37 @@ HRESULT CUITiledImage::LoadBuffer(byte *Buffer, bool Complete) {
if (VTiles && HTiles) {
// up row
- CBPlatform::SetRect(&m_UpLeft, 0, 0, H1, V1);
- CBPlatform::SetRect(&m_UpMiddle, H1, 0, H1 + H2, V1);
- CBPlatform::SetRect(&m_UpRight, H1 + H2, 0, H1 + H2 + H3, V1);
+ CBPlatform::SetRect(&_upLeft, 0, 0, H1, V1);
+ CBPlatform::SetRect(&_upMiddle, H1, 0, H1 + H2, V1);
+ CBPlatform::SetRect(&_upRight, H1 + H2, 0, H1 + H2 + H3, V1);
// middle row
- CBPlatform::SetRect(&m_MiddleLeft, 0, V1, H1, V1 + V2);
- CBPlatform::SetRect(&m_MiddleMiddle, H1, V1, H1 + H2, V1 + V2);
- CBPlatform::SetRect(&m_MiddleRight, H1 + H2, V1, H1 + H2 + H3, V1 + V2);
+ CBPlatform::SetRect(&_middleLeft, 0, V1, H1, V1 + V2);
+ CBPlatform::SetRect(&_middleMiddle, H1, V1, H1 + H2, V1 + V2);
+ CBPlatform::SetRect(&_middleRight, H1 + H2, V1, H1 + H2 + H3, V1 + V2);
// down row
- CBPlatform::SetRect(&m_DownLeft, 0, V1 + V2, H1, V1 + V2 + V3);
- CBPlatform::SetRect(&m_DownMiddle, H1, V1 + V2, H1 + H2, V1 + V2 + V3);
- CBPlatform::SetRect(&m_DownRight, H1 + H2, V1 + V2, H1 + H2 + H3, V1 + V2 + V3);
+ CBPlatform::SetRect(&_downLeft, 0, V1 + V2, H1, V1 + V2 + V3);
+ CBPlatform::SetRect(&_downMiddle, H1, V1 + V2, H1 + H2, V1 + V2 + V3);
+ CBPlatform::SetRect(&_downRight, H1 + H2, V1 + V2, H1 + H2 + H3, V1 + V2 + V3);
}
// default
- if (m_Image && m_Image->m_Surface) {
- int Width = m_Image->m_Surface->GetWidth() / 3;
- int Height = m_Image->m_Surface->GetHeight() / 3;
+ if (_image && _image->_surface) {
+ int Width = _image->_surface->GetWidth() / 3;
+ int Height = _image->_surface->GetHeight() / 3;
- if (CBPlatform::IsRectEmpty(&m_UpLeft)) CBPlatform::SetRect(&m_UpLeft, 0, 0, Width, Height);
- if (CBPlatform::IsRectEmpty(&m_UpMiddle)) CBPlatform::SetRect(&m_UpMiddle, Width, 0, 2 * Width, Height);
- if (CBPlatform::IsRectEmpty(&m_UpRight)) CBPlatform::SetRect(&m_UpRight, 2 * Width, 0, 3 * Width, Height);
+ if (CBPlatform::IsRectEmpty(&_upLeft)) CBPlatform::SetRect(&_upLeft, 0, 0, Width, Height);
+ if (CBPlatform::IsRectEmpty(&_upMiddle)) CBPlatform::SetRect(&_upMiddle, Width, 0, 2 * Width, Height);
+ if (CBPlatform::IsRectEmpty(&_upRight)) CBPlatform::SetRect(&_upRight, 2 * Width, 0, 3 * Width, Height);
- if (CBPlatform::IsRectEmpty(&m_MiddleLeft)) CBPlatform::SetRect(&m_MiddleLeft, 0, Height, Width, 2 * Height);
- if (CBPlatform::IsRectEmpty(&m_MiddleMiddle)) CBPlatform::SetRect(&m_MiddleMiddle, Width, Height, 2 * Width, 2 * Height);
- if (CBPlatform::IsRectEmpty(&m_MiddleRight)) CBPlatform::SetRect(&m_MiddleRight, 2 * Width, Height, 3 * Width, 2 * Height);
+ if (CBPlatform::IsRectEmpty(&_middleLeft)) CBPlatform::SetRect(&_middleLeft, 0, Height, Width, 2 * Height);
+ if (CBPlatform::IsRectEmpty(&_middleMiddle)) CBPlatform::SetRect(&_middleMiddle, Width, Height, 2 * Width, 2 * Height);
+ if (CBPlatform::IsRectEmpty(&_middleRight)) CBPlatform::SetRect(&_middleRight, 2 * Width, Height, 3 * Width, 2 * Height);
- if (CBPlatform::IsRectEmpty(&m_DownLeft)) CBPlatform::SetRect(&m_DownLeft, 0, 2 * Height, Width, 3 * Height);
- if (CBPlatform::IsRectEmpty(&m_DownMiddle)) CBPlatform::SetRect(&m_DownMiddle, Width, 2 * Height, 2 * Width, 3 * Height);
- if (CBPlatform::IsRectEmpty(&m_DownRight)) CBPlatform::SetRect(&m_DownRight, 2 * Width, 2 * Height, 3 * Width, 3 * Height);
+ if (CBPlatform::IsRectEmpty(&_downLeft)) CBPlatform::SetRect(&_downLeft, 0, 2 * Height, Width, 3 * Height);
+ if (CBPlatform::IsRectEmpty(&_downMiddle)) CBPlatform::SetRect(&_downMiddle, Width, 2 * Height, 2 * Width, 3 * Height);
+ if (CBPlatform::IsRectEmpty(&_downRight)) CBPlatform::SetRect(&_downRight, 2 * Width, 2 * Height, 3 * Width, 3 * Height);
}
return S_OK;
@@ -311,19 +311,19 @@ HRESULT CUITiledImage::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "TILED_IMAGE\n");
Buffer->PutTextIndent(Indent, "{\n");
- if (m_Image && m_Image->m_SurfaceFilename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", m_Image->m_SurfaceFilename);
+ if (_image && _image->_surfaceFilename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_surfaceFilename);
int H1, H2, H3;
int V1, V2, V3;
- H1 = m_UpLeft.right;
- H2 = m_UpMiddle.right - m_UpMiddle.left;
- H3 = m_UpRight.right - m_UpRight.left;
+ H1 = _upLeft.right;
+ H2 = _upMiddle.right - _upMiddle.left;
+ H3 = _upRight.right - _upRight.left;
- V1 = m_UpLeft.bottom;
- V2 = m_MiddleLeft.bottom - m_MiddleLeft.top;
- V3 = m_DownLeft.bottom - m_DownLeft.top;
+ V1 = _upLeft.bottom;
+ V2 = _middleLeft.bottom - _middleLeft.top;
+ V3 = _downLeft.bottom - _downLeft.top;
Buffer->PutTextIndent(Indent + 2, "VERTICAL_TILES { %d, %d, %d }\n", V1, V2, V3);
@@ -338,14 +338,14 @@ HRESULT CUITiledImage::SaveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
void CUITiledImage::CorrectSize(int *Width, int *Height) {
- int tile_width = m_MiddleMiddle.right - m_MiddleMiddle.left;
- int tile_height = m_MiddleMiddle.bottom - m_MiddleMiddle.top;
+ int tile_width = _middleMiddle.right - _middleMiddle.left;
+ int tile_height = _middleMiddle.bottom - _middleMiddle.top;
- int num_columns = (*Width - (m_MiddleLeft.right - m_MiddleLeft.left) - (m_MiddleRight.right - m_MiddleRight.left)) / tile_width;
- int num_rows = (*Height - (m_UpMiddle.bottom - m_UpMiddle.top) - (m_DownMiddle.bottom - m_DownMiddle.top)) / tile_height;
+ int nu_columns = (*Width - (_middleLeft.right - _middleLeft.left) - (_middleRight.right - _middleRight.left)) / tile_width;
+ int nu_rows = (*Height - (_upMiddle.bottom - _upMiddle.top) - (_downMiddle.bottom - _downMiddle.top)) / tile_height;
- *Width = (m_MiddleLeft.right - m_MiddleLeft.left) + (m_MiddleRight.right - m_MiddleRight.left) + num_columns * tile_width;
- *Height = (m_UpMiddle.bottom - m_UpMiddle.top) + (m_DownMiddle.bottom - m_DownMiddle.top) + num_rows * tile_height;
+ *Width = (_middleLeft.right - _middleLeft.left) + (_middleRight.right - _middleRight.left) + nu_columns * tile_width;
+ *Height = (_upMiddle.bottom - _upMiddle.top) + (_downMiddle.bottom - _downMiddle.top) + nu_rows * tile_height;
}
@@ -353,16 +353,16 @@ void CUITiledImage::CorrectSize(int *Width, int *Height) {
HRESULT CUITiledImage::Persist(CBPersistMgr *PersistMgr) {
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_DownLeft));
- PersistMgr->Transfer(TMEMBER(m_DownMiddle));
- PersistMgr->Transfer(TMEMBER(m_DownRight));
- PersistMgr->Transfer(TMEMBER(m_Image));
- PersistMgr->Transfer(TMEMBER(m_MiddleLeft));
- PersistMgr->Transfer(TMEMBER(m_MiddleMiddle));
- PersistMgr->Transfer(TMEMBER(m_MiddleRight));
- PersistMgr->Transfer(TMEMBER(m_UpLeft));
- PersistMgr->Transfer(TMEMBER(m_UpMiddle));
- PersistMgr->Transfer(TMEMBER(m_UpRight));
+ PersistMgr->Transfer(TMEMBER(_downLeft));
+ PersistMgr->Transfer(TMEMBER(_downMiddle));
+ PersistMgr->Transfer(TMEMBER(_downRight));
+ PersistMgr->Transfer(TMEMBER(_image));
+ PersistMgr->Transfer(TMEMBER(_middleLeft));
+ PersistMgr->Transfer(TMEMBER(_middleMiddle));
+ PersistMgr->Transfer(TMEMBER(_middleRight));
+ PersistMgr->Transfer(TMEMBER(_upLeft));
+ PersistMgr->Transfer(TMEMBER(_upMiddle));
+ PersistMgr->Transfer(TMEMBER(_upRight));
return S_OK;
}
diff --git a/engines/wintermute/UITiledImage.h b/engines/wintermute/UITiledImage.h
index e97b27f59e..6cee8ae6cc 100644
--- a/engines/wintermute/UITiledImage.h
+++ b/engines/wintermute/UITiledImage.h
@@ -45,16 +45,16 @@ public:
HRESULT Display(int X, int Y, int Width, int Height);
CUITiledImage(CBGame *inGame = NULL);
virtual ~CUITiledImage();
- CBSubFrame *m_Image;
- RECT m_UpLeft;
- RECT m_UpMiddle;
- RECT m_UpRight;
- RECT m_MiddleLeft;
- RECT m_MiddleMiddle;
- RECT m_MiddleRight;
- RECT m_DownLeft;
- RECT m_DownMiddle;
- RECT m_DownRight;
+ CBSubFrame *_image;
+ RECT _upLeft;
+ RECT _upMiddle;
+ RECT _upRight;
+ RECT _middleLeft;
+ RECT _middleMiddle;
+ RECT _middleRight;
+ RECT _downLeft;
+ RECT _downMiddle;
+ RECT _downRight;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/UIWindow.cpp b/engines/wintermute/UIWindow.cpp
index 86e3eada49..a6ab142238 100644
--- a/engines/wintermute/UIWindow.cpp
+++ b/engines/wintermute/UIWindow.cpp
@@ -54,36 +54,36 @@ IMPLEMENT_PERSISTENT(CUIWindow, false)
//////////////////////////////////////////////////////////////////////////
CUIWindow::CUIWindow(CBGame *inGame): CUIObject(inGame) {
- CBPlatform::SetRectEmpty(&m_TitleRect);
- CBPlatform::SetRectEmpty(&m_DragRect);
- m_TitleAlign = TAL_LEFT;
- m_Transparent = false;
+ CBPlatform::SetRectEmpty(&_titleRect);
+ CBPlatform::SetRectEmpty(&_dragRect);
+ _titleAlign = TAL_LEFT;
+ _transparent = false;
- m_BackInactive = NULL;
- m_FontInactive = NULL;
- m_ImageInactive = NULL;
+ _backInactive = NULL;
+ _fontInactive = NULL;
+ _imageInactive = NULL;
- m_Type = UI_WINDOW;
- m_CanFocus = true;
+ _type = UI_WINDOW;
+ _canFocus = true;
- m_Dragging = false;
- m_DragFrom.x = m_DragFrom.y = 0;
+ _dragging = false;
+ _dragFrom.x = _dragFrom.y = 0;
- m_Mode = WINDOW_NORMAL;
- m_ShieldWindow = NULL;
- m_ShieldButton = NULL;
+ _mode = WINDOW_NORMAL;
+ _shieldWindow = NULL;
+ _shieldButton = NULL;
- m_FadeColor = 0x00000000;
- m_FadeBackground = false;
+ _fadeColor = 0x00000000;
+ _fadeBackground = false;
- m_Ready = true;
- m_IsMenu = false;
- m_InGame = false;
+ _ready = true;
+ _isMenu = false;
+ _inGame = false;
- m_ClipContents = false;
- m_Viewport = NULL;
+ _clipContents = false;
+ _viewport = NULL;
- m_PauseMusic = true;
+ _pauseMusic = true;
}
@@ -96,102 +96,102 @@ CUIWindow::~CUIWindow() {
//////////////////////////////////////////////////////////////////////////
void CUIWindow::Cleanup() {
- delete m_ShieldWindow;
- delete m_ShieldButton;
- delete m_Viewport;
- m_ShieldWindow = NULL;
- m_ShieldButton = NULL;
- m_Viewport = NULL;
-
- if (m_BackInactive) delete m_BackInactive;
- if (!m_SharedFonts && m_FontInactive) Game->m_FontStorage->RemoveFont(m_FontInactive);
- if (!m_SharedImages && m_ImageInactive) delete m_ImageInactive;
-
- for (int i = 0; i < m_Widgets.GetSize(); i++) delete m_Widgets[i];
- m_Widgets.RemoveAll();
+ delete _shieldWindow;
+ delete _shieldButton;
+ delete _viewport;
+ _shieldWindow = NULL;
+ _shieldButton = NULL;
+ _viewport = NULL;
+
+ if (_backInactive) delete _backInactive;
+ if (!_sharedFonts && _fontInactive) Game->_fontStorage->RemoveFont(_fontInactive);
+ if (!_sharedImages && _imageInactive) delete _imageInactive;
+
+ for (int i = 0; i < _widgets.GetSize(); i++) delete _widgets[i];
+ _widgets.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::Display(int OffsetX, int OffsetY) {
// go exclusive
- if (m_Mode == WINDOW_EXCLUSIVE || m_Mode == WINDOW_SYSTEM_EXCLUSIVE) {
- if (!m_ShieldWindow) m_ShieldWindow = new CUIWindow(Game);
- if (m_ShieldWindow) {
- m_ShieldWindow->m_PosX = m_ShieldWindow->m_PosY = 0;
- m_ShieldWindow->m_Width = Game->m_Renderer->m_Width;
- m_ShieldWindow->m_Height = Game->m_Renderer->m_Height;
-
- m_ShieldWindow->Display();
+ if (_mode == WINDOW_EXCLUSIVE || _mode == WINDOW_SYSTEM_EXCLUSIVE) {
+ if (!_shieldWindow) _shieldWindow = new CUIWindow(Game);
+ if (_shieldWindow) {
+ _shieldWindow->_posX = _shieldWindow->_posY = 0;
+ _shieldWindow->_width = Game->_renderer->_width;
+ _shieldWindow->_height = Game->_renderer->_height;
+
+ _shieldWindow->Display();
}
- } else if (m_IsMenu) {
- if (!m_ShieldButton) {
- m_ShieldButton = new CUIButton(Game);
- m_ShieldButton->SetName("close");
- m_ShieldButton->SetListener(this, m_ShieldButton, 0);
- m_ShieldButton->m_Parent = this;
+ } else if (_isMenu) {
+ if (!_shieldButton) {
+ _shieldButton = new CUIButton(Game);
+ _shieldButton->SetName("close");
+ _shieldButton->SetListener(this, _shieldButton, 0);
+ _shieldButton->_parent = this;
}
- if (m_ShieldButton) {
- m_ShieldButton->m_PosX = m_ShieldButton->m_PosY = 0;
- m_ShieldButton->m_Width = Game->m_Renderer->m_Width;
- m_ShieldButton->m_Height = Game->m_Renderer->m_Height;
+ if (_shieldButton) {
+ _shieldButton->_posX = _shieldButton->_posY = 0;
+ _shieldButton->_width = Game->_renderer->_width;
+ _shieldButton->_height = Game->_renderer->_height;
- m_ShieldButton->Display();
+ _shieldButton->Display();
}
}
- if (!m_Visible) return S_OK;
+ if (!_visible) return S_OK;
- if (m_FadeBackground) Game->m_Renderer->FadeToColor(m_FadeColor);
+ if (_fadeBackground) Game->_renderer->FadeToColor(_fadeColor);
- if (m_Dragging) {
- m_PosX += (Game->m_MousePos.x - m_DragFrom.x);
- m_PosY += (Game->m_MousePos.y - m_DragFrom.y);
+ if (_dragging) {
+ _posX += (Game->_mousePos.x - _dragFrom.x);
+ _posY += (Game->_mousePos.y - _dragFrom.y);
- m_DragFrom.x = Game->m_MousePos.x;
- m_DragFrom.y = Game->m_MousePos.y;
+ _dragFrom.x = Game->_mousePos.x;
+ _dragFrom.y = Game->_mousePos.y;
}
- if (!m_FocusedWidget || (!m_FocusedWidget->m_CanFocus || m_FocusedWidget->m_Disable || !m_FocusedWidget->m_Visible)) {
+ if (!_focusedWidget || (!_focusedWidget->_canFocus || _focusedWidget->_disable || !_focusedWidget->_visible)) {
MoveFocus();
}
bool PopViewport = false;
- if (m_ClipContents) {
- if (!m_Viewport) m_Viewport = new CBViewport(Game);
- if (m_Viewport) {
- m_Viewport->SetRect(m_PosX + OffsetX, m_PosY + OffsetY, m_PosX + m_Width + OffsetX, m_PosY + m_Height + OffsetY);
- Game->PushViewport(m_Viewport);
+ if (_clipContents) {
+ if (!_viewport) _viewport = new CBViewport(Game);
+ if (_viewport) {
+ _viewport->SetRect(_posX + OffsetX, _posY + OffsetY, _posX + _width + OffsetX, _posY + _height + OffsetY);
+ Game->PushViewport(_viewport);
PopViewport = true;
}
}
- CUITiledImage *back = m_Back;
- CBSprite *image = m_Image;
- CBFont *font = m_Font;
+ CUITiledImage *back = _back;
+ CBSprite *image = _image;
+ CBFont *font = _font;
if (!IsFocused()) {
- if (m_BackInactive) back = m_BackInactive;
- if (m_ImageInactive) image = m_ImageInactive;
- if (m_FontInactive) font = m_FontInactive;
+ if (_backInactive) back = _backInactive;
+ if (_imageInactive) image = _imageInactive;
+ if (_fontInactive) font = _fontInactive;
}
- if (m_AlphaColor != 0) Game->m_Renderer->m_ForceAlphaColor = m_AlphaColor;
- if (back) back->Display(m_PosX + OffsetX, m_PosY + OffsetY, m_Width, m_Height);
- if (image) image->Draw(m_PosX + OffsetX, m_PosY + OffsetY, m_Transparent ? NULL : this);
+ if (_alphaColor != 0) Game->_renderer->_forceAlphaColor = _alphaColor;
+ if (back) back->Display(_posX + OffsetX, _posY + OffsetY, _width, _height);
+ if (image) image->Draw(_posX + OffsetX, _posY + OffsetY, _transparent ? NULL : this);
- if (!CBPlatform::IsRectEmpty(&m_TitleRect) && font && m_Text) {
- font->DrawText((byte *)m_Text, m_PosX + OffsetX + m_TitleRect.left, m_PosY + OffsetY + m_TitleRect.top, m_TitleRect.right - m_TitleRect.left, m_TitleAlign, m_TitleRect.bottom - m_TitleRect.top);
+ if (!CBPlatform::IsRectEmpty(&_titleRect) && font && _text) {
+ font->DrawText((byte *)_text, _posX + OffsetX + _titleRect.left, _posY + OffsetY + _titleRect.top, _titleRect.right - _titleRect.left, _titleAlign, _titleRect.bottom - _titleRect.top);
}
- if (!m_Transparent && !image) Game->m_Renderer->m_RectList.Add(new CBActiveRect(Game, this, NULL, m_PosX + OffsetX, m_PosY + OffsetY, m_Width, m_Height, 100, 100, false));
+ if (!_transparent && !image) Game->_renderer->_rectList.Add(new CBActiveRect(Game, this, NULL, _posX + OffsetX, _posY + OffsetY, _width, _height, 100, 100, false));
- for (int i = 0; i < m_Widgets.GetSize(); i++) {
- m_Widgets[i]->Display(m_PosX + OffsetX, m_PosY + OffsetY);
+ for (int i = 0; i < _widgets.GetSize(); i++) {
+ _widgets[i]->Display(_posX + OffsetX, _posY + OffsetY);
}
- if (m_AlphaColor != 0) Game->m_Renderer->m_ForceAlphaColor = 0;
+ if (_alphaColor != 0) Game->_renderer->_forceAlphaColor = 0;
if (PopViewport) Game->PopViewport();
@@ -201,7 +201,7 @@ HRESULT CUIWindow::Display(int OffsetX, int OffsetY) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::LoadFile(char *Filename) {
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
if (Buffer == NULL) {
Game->LOG(0, "CUIWindow::LoadFile failed for file '%s'", Filename);
return E_FAIL;
@@ -209,8 +209,8 @@ HRESULT CUIWindow::LoadFile(char *Filename) {
HRESULT ret;
- m_Filename = new char [strlen(Filename) + 1];
- strcpy(m_Filename, 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);
@@ -329,98 +329,98 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_BACK:
- delete m_Back;
- m_Back = new CUITiledImage(Game);
- if (!m_Back || FAILED(m_Back->LoadFile((char *)params))) {
- delete m_Back;
- m_Back = NULL;
+ delete _back;
+ _back = new CUITiledImage(Game);
+ if (!_back || FAILED(_back->LoadFile((char *)params))) {
+ delete _back;
+ _back = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_BACK_INACTIVE:
- delete m_BackInactive;
- m_BackInactive = new CUITiledImage(Game);
- if (!m_BackInactive || FAILED(m_BackInactive->LoadFile((char *)params))) {
- delete m_BackInactive;
- m_BackInactive = NULL;
+ delete _backInactive;
+ _backInactive = new CUITiledImage(Game);
+ if (!_backInactive || FAILED(_backInactive->LoadFile((char *)params))) {
+ delete _backInactive;
+ _backInactive = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE:
- delete m_Image;
- m_Image = new CBSprite(Game);
- if (!m_Image || FAILED(m_Image->LoadFile((char *)params))) {
- delete m_Image;
- m_Image = NULL;
+ delete _image;
+ _image = new CBSprite(Game);
+ if (!_image || FAILED(_image->LoadFile((char *)params))) {
+ delete _image;
+ _image = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE_INACTIVE:
- delete m_ImageInactive,
- m_ImageInactive = new CBSprite(Game);
- if (!m_ImageInactive || FAILED(m_ImageInactive->LoadFile((char *)params))) {
- delete m_ImageInactive;
- m_ImageInactive = NULL;
+ delete _imageInactive,
+ _imageInactive = new CBSprite(Game);
+ if (!_imageInactive || FAILED(_imageInactive->LoadFile((char *)params))) {
+ delete _imageInactive;
+ _imageInactive = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_FONT:
- if (m_Font) Game->m_FontStorage->RemoveFont(m_Font);
- m_Font = Game->m_FontStorage->AddFont((char *)params);
- if (!m_Font) cmd = PARSERR_GENERIC;
+ if (_font) Game->_fontStorage->RemoveFont(_font);
+ _font = Game->_fontStorage->AddFont((char *)params);
+ if (!_font) cmd = PARSERR_GENERIC;
break;
case TOKEN_FONT_INACTIVE:
- if (m_FontInactive) Game->m_FontStorage->RemoveFont(m_FontInactive);
- m_FontInactive = Game->m_FontStorage->AddFont((char *)params);
- if (!m_FontInactive) cmd = PARSERR_GENERIC;
+ if (_fontInactive) Game->_fontStorage->RemoveFont(_fontInactive);
+ _fontInactive = Game->_fontStorage->AddFont((char *)params);
+ if (!_fontInactive) cmd = PARSERR_GENERIC;
break;
case TOKEN_TITLE:
SetText((char *)params);
- Game->m_StringTable->Expand(&m_Text);
+ Game->_stringTable->Expand(&_text);
break;
case TOKEN_TITLE_ALIGN:
- if (scumm_stricmp((char *)params, "left") == 0) m_TitleAlign = TAL_LEFT;
- else if (scumm_stricmp((char *)params, "right") == 0) m_TitleAlign = TAL_RIGHT;
- else m_TitleAlign = TAL_CENTER;
+ if (scumm_stricmp((char *)params, "left") == 0) _titleAlign = TAL_LEFT;
+ else if (scumm_stricmp((char *)params, "right") == 0) _titleAlign = TAL_RIGHT;
+ else _titleAlign = TAL_CENTER;
break;
case TOKEN_TITLE_RECT:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_TitleRect.left, &m_TitleRect.top, &m_TitleRect.right, &m_TitleRect.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_titleRect.left, &_titleRect.top, &_titleRect.right, &_titleRect.bottom);
break;
case TOKEN_DRAG_RECT:
- parser.ScanStr((char *)params, "%d,%d,%d,%d", &m_DragRect.left, &m_DragRect.top, &m_DragRect.right, &m_DragRect.bottom);
+ parser.ScanStr((char *)params, "%d,%d,%d,%d", &_dragRect.left, &_dragRect.top, &_dragRect.right, &_dragRect.bottom);
break;
case TOKEN_X:
- parser.ScanStr((char *)params, "%d", &m_PosX);
+ parser.ScanStr((char *)params, "%d", &_posX);
break;
case TOKEN_Y:
- parser.ScanStr((char *)params, "%d", &m_PosY);
+ parser.ScanStr((char *)params, "%d", &_posY);
break;
case TOKEN_WIDTH:
- parser.ScanStr((char *)params, "%d", &m_Width);
+ parser.ScanStr((char *)params, "%d", &_width);
break;
case TOKEN_HEIGHT:
- parser.ScanStr((char *)params, "%d", &m_Height);
+ parser.ScanStr((char *)params, "%d", &_height);
break;
case TOKEN_CURSOR:
- delete m_Cursor;
- m_Cursor = new CBSprite(Game);
- if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- delete m_Cursor;
- m_Cursor = NULL;
+ delete _cursor;
+ _cursor = new CBSprite(Game);
+ if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
@@ -432,8 +432,8 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
btn = NULL;
cmd = PARSERR_GENERIC;
} else {
- btn->m_Parent = this;
- m_Widgets.Add(btn);
+ btn->_parent = this;
+ _widgets.Add(btn);
}
}
break;
@@ -445,8 +445,8 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
text = NULL;
cmd = PARSERR_GENERIC;
} else {
- text->m_Parent = this;
- m_Widgets.Add(text);
+ text->_parent = this;
+ _widgets.Add(text);
}
}
break;
@@ -458,8 +458,8 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
edit = NULL;
cmd = PARSERR_GENERIC;
} else {
- edit->m_Parent = this;
- m_Widgets.Add(edit);
+ edit->_parent = this;
+ _widgets.Add(edit);
}
}
break;
@@ -471,15 +471,15 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
win = NULL;
cmd = PARSERR_GENERIC;
} else {
- win->m_Parent = this;
- m_Widgets.Add(win);
+ win->_parent = this;
+ _widgets.Add(win);
}
}
break;
case TOKEN_TRANSPARENT:
- parser.ScanStr((char *)params, "%b", &m_Transparent);
+ parser.ScanStr((char *)params, "%b", &_transparent);
break;
case TOKEN_SCRIPT:
@@ -487,41 +487,41 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_PARENT_NOTIFY:
- parser.ScanStr((char *)params, "%b", &m_ParentNotify);
+ parser.ScanStr((char *)params, "%b", &_parentNotify);
break;
case TOKEN_PAUSE_MUSIC:
- parser.ScanStr((char *)params, "%b", &m_PauseMusic);
+ parser.ScanStr((char *)params, "%b", &_pauseMusic);
break;
case TOKEN_DISABLED:
- parser.ScanStr((char *)params, "%b", &m_Disable);
+ parser.ScanStr((char *)params, "%b", &_disable);
break;
case TOKEN_VISIBLE:
- parser.ScanStr((char *)params, "%b", &m_Visible);
+ parser.ScanStr((char *)params, "%b", &_visible);
break;
case TOKEN_MENU:
- parser.ScanStr((char *)params, "%b", &m_IsMenu);
+ parser.ScanStr((char *)params, "%b", &_isMenu);
break;
case TOKEN_IN_GAME:
- parser.ScanStr((char *)params, "%b", &m_InGame);
+ parser.ScanStr((char *)params, "%b", &_inGame);
break;
case TOKEN_CLIP_CONTENTS:
- parser.ScanStr((char *)params, "%b", &m_ClipContents);
+ parser.ScanStr((char *)params, "%b", &_clipContents);
break;
case TOKEN_FADE_COLOR:
parser.ScanStr((char *)params, "%d,%d,%d", &FadeR, &FadeG, &FadeB);
- m_FadeBackground = true;
+ _fadeBackground = true;
break;
case TOKEN_FADE_ALPHA:
parser.ScanStr((char *)params, "%d", &FadeA);
- m_FadeBackground = true;
+ _fadeBackground = true;
break;
case TOKEN_EDITOR_PROPERTY:
@@ -557,11 +557,11 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) {
if (alpha != 0 && ar == 0 && ag == 0 && ab == 0) {
ar = ag = ab = 255;
}
- m_AlphaColor = DRGBA(ar, ag, ab, alpha);
+ _alphaColor = DRGBA(ar, ag, ab, alpha);
- if (m_FadeBackground) m_FadeColor = DRGBA(FadeR, FadeG, FadeB, FadeA);
+ if (_fadeBackground) _fadeColor = DRGBA(FadeR, FadeG, FadeB, FadeA);
- m_FocusedWidget = NULL;
+ _focusedWidget = NULL;
return S_OK;
}
@@ -571,35 +571,35 @@ HRESULT CUIWindow::SaveAsText(CBDynBuffer *Buffer, int Indent) {
Buffer->PutTextIndent(Indent, "WINDOW\n");
Buffer->PutTextIndent(Indent, "{\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", m_Name);
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
Buffer->PutTextIndent(Indent + 2, "CAPTION=\"%s\"\n", GetCaption());
Buffer->PutTextIndent(Indent + 2, "\n");
- if (m_Back && m_Back->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK=\"%s\"\n", m_Back->m_Filename);
- if (m_BackInactive && m_BackInactive->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "BACK_INACTIVE=\"%s\"\n", m_BackInactive->m_Filename);
+ if (_back && _back->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
+ if (_backInactive && _backInactive->_filename)
+ Buffer->PutTextIndent(Indent + 2, "BACK_INACTIVE=\"%s\"\n", _backInactive->_filename);
- if (m_Image && m_Image->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", m_Image->m_Filename);
- if (m_ImageInactive && m_ImageInactive->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "IMAGE_INACTIVE=\"%s\"\n", m_ImageInactive->m_Filename);
+ if (_image && _image->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
+ if (_imageInactive && _imageInactive->_filename)
+ Buffer->PutTextIndent(Indent + 2, "IMAGE_INACTIVE=\"%s\"\n", _imageInactive->_filename);
- if (m_Font && m_Font->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", m_Font->m_Filename);
- if (m_FontInactive && m_FontInactive->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "FONT_INACTIVE=\"%s\"\n", m_FontInactive->m_Filename);
+ if (_font && _font->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
+ if (_fontInactive && _fontInactive->_filename)
+ Buffer->PutTextIndent(Indent + 2, "FONT_INACTIVE=\"%s\"\n", _fontInactive->_filename);
- if (m_Cursor && m_Cursor->m_Filename)
- Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", m_Cursor->m_Filename);
+ if (_cursor && _cursor->_filename)
+ Buffer->PutTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
Buffer->PutTextIndent(Indent + 2, "\n");
- if (m_Text)
- Buffer->PutTextIndent(Indent + 2, "TITLE=\"%s\"\n", m_Text);
+ if (_text)
+ Buffer->PutTextIndent(Indent + 2, "TITLE=\"%s\"\n", _text);
- switch (m_TitleAlign) {
+ switch (_titleAlign) {
case TAL_LEFT:
Buffer->PutTextIndent(Indent + 2, "TITLE_ALIGN=\"%s\"\n", "left");
break;
@@ -611,46 +611,46 @@ HRESULT CUIWindow::SaveAsText(CBDynBuffer *Buffer, int Indent) {
break;
}
- if (!CBPlatform::IsRectEmpty(&m_TitleRect)) {
- Buffer->PutTextIndent(Indent + 2, "TITLE_RECT { %d, %d, %d, %d }\n", m_TitleRect.left, m_TitleRect.top, m_TitleRect.right, m_TitleRect.bottom);
+ if (!CBPlatform::IsRectEmpty(&_titleRect)) {
+ Buffer->PutTextIndent(Indent + 2, "TITLE_RECT { %d, %d, %d, %d }\n", _titleRect.left, _titleRect.top, _titleRect.right, _titleRect.bottom);
}
- if (!CBPlatform::IsRectEmpty(&m_DragRect)) {
- Buffer->PutTextIndent(Indent + 2, "DRAG_RECT { %d, %d, %d, %d }\n", m_DragRect.left, m_DragRect.top, m_DragRect.right, m_DragRect.bottom);
+ if (!CBPlatform::IsRectEmpty(&_dragRect)) {
+ Buffer->PutTextIndent(Indent + 2, "DRAG_RECT { %d, %d, %d, %d }\n", _dragRect.left, _dragRect.top, _dragRect.right, _dragRect.bottom);
}
Buffer->PutTextIndent(Indent + 2, "\n");
- Buffer->PutTextIndent(Indent + 2, "X=%d\n", m_PosX);
- Buffer->PutTextIndent(Indent + 2, "Y=%d\n", m_PosY);
- Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", m_Width);
- Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", m_Height);
+ Buffer->PutTextIndent(Indent + 2, "X=%d\n", _posX);
+ Buffer->PutTextIndent(Indent + 2, "Y=%d\n", _posY);
+ Buffer->PutTextIndent(Indent + 2, "WIDTH=%d\n", _width);
+ Buffer->PutTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
- Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", m_Disable ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", m_Visible ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", m_ParentNotify ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "TRANSPARENT=%s\n", m_Transparent ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "PAUSE_MUSIC=%s\n", m_PauseMusic ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "MENU=%s\n", m_IsMenu ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "IN_GAME=%s\n", m_InGame ? "TRUE" : "FALSE");
- Buffer->PutTextIndent(Indent + 2, "CLIP_CONTENTS=%s\n", m_ClipContents ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "TRANSPARENT=%s\n", _transparent ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "PAUSE_MUSIC=%s\n", _pauseMusic ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "MENU=%s\n", _isMenu ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "IN_GAME=%s\n", _inGame ? "TRUE" : "FALSE");
+ Buffer->PutTextIndent(Indent + 2, "CLIP_CONTENTS=%s\n", _clipContents ? "TRUE" : "FALSE");
Buffer->PutTextIndent(Indent + 2, "\n");
- if (m_FadeBackground) {
- Buffer->PutTextIndent(Indent + 2, "FADE_COLOR { %d, %d, %d }\n", D3DCOLGetR(m_FadeColor), D3DCOLGetG(m_FadeColor), D3DCOLGetB(m_FadeColor));
- Buffer->PutTextIndent(Indent + 2, "FADE_ALPHA=%d\n", D3DCOLGetA(m_FadeColor));
+ if (_fadeBackground) {
+ Buffer->PutTextIndent(Indent + 2, "FADE_COLOR { %d, %d, %d }\n", D3DCOLGetR(_fadeColor), D3DCOLGetG(_fadeColor), D3DCOLGetB(_fadeColor));
+ Buffer->PutTextIndent(Indent + 2, "FADE_ALPHA=%d\n", D3DCOLGetA(_fadeColor));
}
- Buffer->PutTextIndent(Indent + 2, "ALPHA_COLOR { %d, %d, %d }\n", D3DCOLGetR(m_AlphaColor), D3DCOLGetG(m_AlphaColor), D3DCOLGetB(m_AlphaColor));
- Buffer->PutTextIndent(Indent + 2, "ALPHA=%d\n", D3DCOLGetA(m_AlphaColor));
+ Buffer->PutTextIndent(Indent + 2, "ALPHA_COLOR { %d, %d, %d }\n", D3DCOLGetR(_alphaColor), D3DCOLGetG(_alphaColor), D3DCOLGetB(_alphaColor));
+ Buffer->PutTextIndent(Indent + 2, "ALPHA=%d\n", D3DCOLGetA(_alphaColor));
Buffer->PutTextIndent(Indent + 2, "\n");
// scripts
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", m_Scripts[i]->m_Filename);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ Buffer->PutTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
Buffer->PutTextIndent(Indent + 2, "\n");
@@ -659,8 +659,8 @@ HRESULT CUIWindow::SaveAsText(CBDynBuffer *Buffer, int Indent) {
CBBase::SaveAsText(Buffer, Indent + 2);
// controls
- for (int i = 0; i < m_Widgets.GetSize(); i++)
- m_Widgets[i]->SaveAsText(Buffer, Indent + 2);
+ for (int i = 0; i < _widgets.GetSize(); i++)
+ _widgets[i]->SaveAsText(Buffer, Indent + 2);
Buffer->PutTextIndent(Indent, "}\n");
@@ -669,8 +669,8 @@ HRESULT CUIWindow::SaveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::EnableWidget(char *Name, bool Enable) {
- for (int i = 0; i < m_Widgets.GetSize(); i++) {
- if (scumm_stricmp(m_Widgets[i]->m_Name, Name) == 0) m_Widgets[i]->m_Disable = !Enable;
+ for (int i = 0; i < _widgets.GetSize(); i++) {
+ if (scumm_stricmp(_widgets[i]->_name, Name) == 0) _widgets[i]->_disable = !Enable;
}
return S_OK;
}
@@ -678,8 +678,8 @@ HRESULT CUIWindow::EnableWidget(char *Name, bool Enable) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::ShowWidget(char *Name, bool Visible) {
- for (int i = 0; i < m_Widgets.GetSize(); i++) {
- if (scumm_stricmp(m_Widgets[i]->m_Name, Name) == 0) m_Widgets[i]->m_Visible = Visible;
+ for (int i = 0; i < _widgets.GetSize(); i++) {
+ if (scumm_stricmp(_widgets[i]->_name, Name) == 0) _widgets[i]->_visible = Visible;
}
return S_OK;
}
@@ -697,12 +697,12 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
CScValue *val = Stack->Pop();
if (val->GetType() == VAL_INT) {
int widget = val->GetInt();
- if (widget < 0 || widget >= m_Widgets.GetSize()) Stack->PushNULL();
- else Stack->PushNative(m_Widgets[widget], true);
+ if (widget < 0 || widget >= _widgets.GetSize()) Stack->PushNULL();
+ else Stack->PushNative(_widgets[widget], true);
} else {
- for (int i = 0; i < m_Widgets.GetSize(); i++) {
- if (scumm_stricmp(m_Widgets[i]->m_Name, val->GetString()) == 0) {
- Stack->PushNative(m_Widgets[i], true);
+ for (int i = 0; i < _widgets.GetSize(); i++) {
+ if (scumm_stricmp(_widgets[i]->_name, val->GetString()) == 0) {
+ Stack->PushNative(_widgets[i], true);
return S_OK;
}
}
@@ -718,9 +718,9 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "SetInactiveFont") == 0) {
Stack->CorrectParams(1);
- if (m_FontInactive) Game->m_FontStorage->RemoveFont(m_FontInactive);
- m_FontInactive = Game->m_FontStorage->AddFont(Stack->Pop()->GetString());
- Stack->PushBool(m_FontInactive != NULL);
+ if (_fontInactive) Game->_fontStorage->RemoveFont(_fontInactive);
+ _fontInactive = Game->_fontStorage->AddFont(Stack->Pop()->GetString());
+ Stack->PushBool(_fontInactive != NULL);
return S_OK;
}
@@ -731,12 +731,12 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
else if (strcmp(Name, "SetInactiveImage") == 0) {
Stack->CorrectParams(1);
- delete m_ImageInactive;
- m_ImageInactive = new CBSprite(Game);
+ delete _imageInactive;
+ _imageInactive = new CBSprite(Game);
char *Filename = Stack->Pop()->GetString();
- if (!m_ImageInactive || FAILED(m_ImageInactive->LoadFile(Filename))) {
- delete m_ImageInactive;
- m_ImageInactive = NULL;
+ if (!_imageInactive || FAILED(_imageInactive->LoadFile(Filename))) {
+ delete _imageInactive;
+ _imageInactive = NULL;
Stack->PushBool(false);
} else Stack->PushBool(true);
@@ -748,8 +748,8 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetInactiveImage") == 0) {
Stack->CorrectParams(0);
- if (!m_ImageInactive || !m_ImageInactive->m_Filename) Stack->PushNULL();
- else Stack->PushString(m_ImageInactive->m_Filename);
+ if (!_imageInactive || !_imageInactive->_filename) Stack->PushNULL();
+ else Stack->PushString(_imageInactive->_filename);
return S_OK;
}
@@ -759,8 +759,8 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetInactiveImageObject") == 0) {
Stack->CorrectParams(0);
- if (!m_ImageInactive) Stack->PushNULL();
- else Stack->PushNative(m_ImageInactive, true);
+ if (!_imageInactive) Stack->PushNULL();
+ else Stack->PushNative(_imageInactive, true);
return S_OK;
}
@@ -802,8 +802,8 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Center") == 0) {
Stack->CorrectParams(0);
- m_PosX = (Game->m_Renderer->m_Width - m_Width) / 2;
- m_PosY = (Game->m_Renderer->m_Height - m_Height) / 2;
+ _posX = (Game->_renderer->_width - _width) / 2;
+ _posY = (Game->_renderer->_height - _height) / 2;
Stack->PushNULL();
return S_OK;
}
@@ -834,8 +834,8 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
if (!Val->IsNULL()) Btn->SetName(Val->GetString());
Stack->PushNative(Btn, true);
- Btn->m_Parent = this;
- m_Widgets.Add(Btn);
+ Btn->_parent = this;
+ _widgets.Add(Btn);
return S_OK;
}
@@ -851,8 +851,8 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
if (!Val->IsNULL()) Sta->SetName(Val->GetString());
Stack->PushNative(Sta, true);
- Sta->m_Parent = this;
- m_Widgets.Add(Sta);
+ Sta->_parent = this;
+ _widgets.Add(Sta);
return S_OK;
}
@@ -868,8 +868,8 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
if (!Val->IsNULL()) Edi->SetName(Val->GetString());
Stack->PushNative(Edi, true);
- Edi->m_Parent = this;
- m_Widgets.Add(Edi);
+ Edi->_parent = this;
+ _widgets.Add(Edi);
return S_OK;
}
@@ -885,8 +885,8 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
if (!Val->IsNULL()) Win->SetName(Val->GetString());
Stack->PushNative(Win, true);
- Win->m_Parent = this;
- m_Widgets.Add(Win);
+ Win->_parent = this;
+ _widgets.Add(Win);
return S_OK;
}
@@ -899,10 +899,10 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
CScValue *val = Stack->Pop();
CUIObject *obj = (CUIObject *)val->GetNative();
- for (int i = 0; i < m_Widgets.GetSize(); i++) {
- if (m_Widgets[i] == obj) {
- delete m_Widgets[i];
- m_Widgets.RemoveAt(i);
+ for (int i = 0; i < _widgets.GetSize(); i++) {
+ if (_widgets[i] == obj) {
+ delete _widgets[i];
+ _widgets.RemoveAt(i);
if (val->GetType() == VAL_VARIABLE_REF) val->SetNULL();
}
}
@@ -916,86 +916,86 @@ HRESULT CUIWindow::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
CScValue *CUIWindow::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("window");
- return m_ScValue;
+ _scValue->SetString("window");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumWidgets / NumControls (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "NumWidgets") == 0 || strcmp(Name, "NumControls") == 0) {
- m_ScValue->SetInt(m_Widgets.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_widgets.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Exclusive
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Exclusive") == 0) {
- m_ScValue->SetBool(m_Mode == WINDOW_EXCLUSIVE);
- return m_ScValue;
+ _scValue->SetBool(_mode == WINDOW_EXCLUSIVE);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SystemExclusive
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SystemExclusive") == 0) {
- m_ScValue->SetBool(m_Mode == WINDOW_SYSTEM_EXCLUSIVE);
- return m_ScValue;
+ _scValue->SetBool(_mode == WINDOW_SYSTEM_EXCLUSIVE);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Menu
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Menu") == 0) {
- m_ScValue->SetBool(m_IsMenu);
- return m_ScValue;
+ _scValue->SetBool(_isMenu);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// InGame
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "InGame") == 0) {
- m_ScValue->SetBool(m_InGame);
- return m_ScValue;
+ _scValue->SetBool(_inGame);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PauseMusic
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PauseMusic") == 0) {
- m_ScValue->SetBool(m_PauseMusic);
- return m_ScValue;
+ _scValue->SetBool(_pauseMusic);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ClipContents
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ClipContents") == 0) {
- m_ScValue->SetBool(m_ClipContents);
- return m_ScValue;
+ _scValue->SetBool(_clipContents);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Transparent
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Transparent") == 0) {
- m_ScValue->SetBool(m_Transparent);
- return m_ScValue;
+ _scValue->SetBool(_transparent);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// FadeColor
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FadeColor") == 0) {
- m_ScValue->SetInt((int)m_FadeColor);
- return m_ScValue;
+ _scValue->SetInt((int)_fadeColor);
+ return _scValue;
}
else return CUIObject::ScGetProperty(Name);
@@ -1016,7 +1016,7 @@ HRESULT CUIWindow::ScSetProperty(char *Name, CScValue *Value) {
// Menu
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Menu") == 0) {
- m_IsMenu = Value->GetBool();
+ _isMenu = Value->GetBool();
return S_OK;
}
@@ -1024,7 +1024,7 @@ HRESULT CUIWindow::ScSetProperty(char *Name, CScValue *Value) {
// InGame
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "InGame") == 0) {
- m_InGame = Value->GetBool();
+ _inGame = Value->GetBool();
return S_OK;
}
@@ -1032,7 +1032,7 @@ HRESULT CUIWindow::ScSetProperty(char *Name, CScValue *Value) {
// PauseMusic
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PauseMusic") == 0) {
- m_PauseMusic = Value->GetBool();
+ _pauseMusic = Value->GetBool();
return S_OK;
}
@@ -1040,7 +1040,7 @@ HRESULT CUIWindow::ScSetProperty(char *Name, CScValue *Value) {
// ClipContents
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ClipContents") == 0) {
- m_ClipContents = Value->GetBool();
+ _clipContents = Value->GetBool();
return S_OK;
}
@@ -1048,7 +1048,7 @@ HRESULT CUIWindow::ScSetProperty(char *Name, CScValue *Value) {
// Transparent
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Transparent") == 0) {
- m_Transparent = Value->GetBool();
+ _transparent = Value->GetBool();
return S_OK;
}
@@ -1056,8 +1056,8 @@ HRESULT CUIWindow::ScSetProperty(char *Name, CScValue *Value) {
// FadeColor
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "FadeColor") == 0) {
- m_FadeColor = (uint32)Value->GetInt();
- m_FadeBackground = (m_FadeColor != 0);
+ _fadeColor = (uint32)Value->GetInt();
+ _fadeBackground = (_fadeColor != 0);
return S_OK;
}
@@ -1069,7 +1069,7 @@ HRESULT CUIWindow::ScSetProperty(char *Name, CScValue *Value) {
GoExclusive();
else {
Close();
- m_Visible = true;
+ _visible = true;
}
return S_OK;
}
@@ -1082,7 +1082,7 @@ HRESULT CUIWindow::ScSetProperty(char *Name, CScValue *Value) {
GoSystemExclusive();
else {
Close();
- m_Visible = true;
+ _visible = true;
}
return S_OK;
}
@@ -1104,7 +1104,7 @@ bool CUIWindow::HandleKeypress(SDL_Event *event) {
if (event->type == SDL_KEYDOWN && event->key.keysym.scancode == SDL_SCANCODE_TAB) {
return SUCCEEDED(MoveFocus(!CBKeyboardState::IsShiftDown()));
} else {
- if (m_FocusedWidget) return m_FocusedWidget->HandleKeypress(event);
+ if (_focusedWidget) return _focusedWidget->HandleKeypress(event);
else return false;
}
#endif
@@ -1114,7 +1114,7 @@ bool CUIWindow::HandleKeypress(SDL_Event *event) {
//////////////////////////////////////////////////////////////////////////
bool CUIWindow::HandleMouseWheel(int Delta) {
- if (m_FocusedWidget) return m_FocusedWidget->HandleMouseWheel(Delta);
+ if (_focusedWidget) return _focusedWidget->HandleMouseWheel(Delta);
else return false;
}
@@ -1124,23 +1124,23 @@ HRESULT CUIWindow::HandleMouse(TMouseEvent Event, TMouseButton Button) {
HRESULT res = CUIObject::HandleMouse(Event, Button);
// handle window dragging
- if (!CBPlatform::IsRectEmpty(&m_DragRect)) {
+ if (!CBPlatform::IsRectEmpty(&_dragRect)) {
// start drag
if (Event == MOUSE_CLICK && Button == MOUSE_BUTTON_LEFT) {
- RECT DragRect = m_DragRect;
+ RECT DragRect = _dragRect;
int OffsetX, OffsetY;
GetTotalOffset(&OffsetX, &OffsetY);
- CBPlatform::OffsetRect(&DragRect, m_PosX + OffsetX, m_PosY + OffsetY);
+ CBPlatform::OffsetRect(&DragRect, _posX + OffsetX, _posY + OffsetY);
- if (CBPlatform::PtInRect(&DragRect, Game->m_MousePos)) {
- m_DragFrom.x = Game->m_MousePos.x;
- m_DragFrom.y = Game->m_MousePos.y;
- m_Dragging = true;
+ if (CBPlatform::PtInRect(&DragRect, Game->_mousePos)) {
+ _dragFrom.x = Game->_mousePos.x;
+ _dragFrom.y = Game->_mousePos.y;
+ _dragging = true;
}
}
// end drag
- else if (m_Dragging && Event == MOUSE_RELEASE && Button == MOUSE_BUTTON_LEFT) {
- m_Dragging = false;
+ else if (_dragging && Event == MOUSE_RELEASE && Button == MOUSE_BUTTON_LEFT) {
+ _dragging = false;
}
}
@@ -1154,27 +1154,27 @@ HRESULT CUIWindow::Persist(CBPersistMgr *PersistMgr) {
CUIObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_BackInactive));
- PersistMgr->Transfer(TMEMBER(m_ClipContents));
- PersistMgr->Transfer(TMEMBER(m_DragFrom));
- PersistMgr->Transfer(TMEMBER(m_Dragging));
- PersistMgr->Transfer(TMEMBER(m_DragRect));
- PersistMgr->Transfer(TMEMBER(m_FadeBackground));
- PersistMgr->Transfer(TMEMBER(m_FadeColor));
- PersistMgr->Transfer(TMEMBER(m_FontInactive));
- PersistMgr->Transfer(TMEMBER(m_ImageInactive));
- PersistMgr->Transfer(TMEMBER(m_InGame));
- PersistMgr->Transfer(TMEMBER(m_IsMenu));
- PersistMgr->Transfer(TMEMBER_INT(m_Mode));
- PersistMgr->Transfer(TMEMBER(m_ShieldButton));
- PersistMgr->Transfer(TMEMBER(m_ShieldWindow));
- PersistMgr->Transfer(TMEMBER_INT(m_TitleAlign));
- PersistMgr->Transfer(TMEMBER(m_TitleRect));
- PersistMgr->Transfer(TMEMBER(m_Transparent));
- PersistMgr->Transfer(TMEMBER(m_Viewport));
- PersistMgr->Transfer(TMEMBER(m_PauseMusic));
-
- m_Widgets.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_backInactive));
+ PersistMgr->Transfer(TMEMBER(_clipContents));
+ PersistMgr->Transfer(TMEMBER(_dragFrom));
+ PersistMgr->Transfer(TMEMBER(_dragging));
+ PersistMgr->Transfer(TMEMBER(_dragRect));
+ PersistMgr->Transfer(TMEMBER(_fadeBackground));
+ PersistMgr->Transfer(TMEMBER(_fadeColor));
+ PersistMgr->Transfer(TMEMBER(_fontInactive));
+ PersistMgr->Transfer(TMEMBER(_imageInactive));
+ PersistMgr->Transfer(TMEMBER(_inGame));
+ PersistMgr->Transfer(TMEMBER(_isMenu));
+ PersistMgr->Transfer(TMEMBER_INT(_mode));
+ PersistMgr->Transfer(TMEMBER(_shieldButton));
+ PersistMgr->Transfer(TMEMBER(_shieldWindow));
+ PersistMgr->Transfer(TMEMBER_INT(_titleAlign));
+ PersistMgr->Transfer(TMEMBER(_titleRect));
+ PersistMgr->Transfer(TMEMBER(_transparent));
+ PersistMgr->Transfer(TMEMBER(_viewport));
+ PersistMgr->Transfer(TMEMBER(_pauseMusic));
+
+ _widgets.Persist(PersistMgr);
return S_OK;
}
@@ -1184,35 +1184,35 @@ HRESULT CUIWindow::Persist(CBPersistMgr *PersistMgr) {
HRESULT CUIWindow::MoveFocus(bool Forward) {
int i;
bool found = false;
- for (i = 0; i < m_Widgets.GetSize(); i++) {
- if (m_Widgets[i] == m_FocusedWidget) {
+ for (i = 0; i < _widgets.GetSize(); i++) {
+ if (_widgets[i] == _focusedWidget) {
found = true;
break;
}
}
- if (!found) m_FocusedWidget = NULL;
+ if (!found) _focusedWidget = NULL;
- if (!m_FocusedWidget) {
- if (m_Widgets.GetSize() > 0) i = 0;
+ if (!_focusedWidget) {
+ if (_widgets.GetSize() > 0) i = 0;
else return S_OK;
}
int NumTries = 0;
bool done = false;
- while (NumTries <= m_Widgets.GetSize()) {
- if (m_Widgets[i] != m_FocusedWidget && m_Widgets[i]->m_CanFocus && m_Widgets[i]->m_Visible && !m_Widgets[i]->m_Disable) {
- m_FocusedWidget = m_Widgets[i];
+ while (NumTries <= _widgets.GetSize()) {
+ if (_widgets[i] != _focusedWidget && _widgets[i]->_canFocus && _widgets[i]->_visible && !_widgets[i]->_disable) {
+ _focusedWidget = _widgets[i];
done = true;
break;
}
if (Forward) {
i++;
- if (i >= m_Widgets.GetSize()) i = 0;
+ if (i >= _widgets.GetSize()) i = 0;
} else {
i--;
- if (i < 0) i = m_Widgets.GetSize() - 1;
+ if (i < 0) i = _widgets.GetSize() - 1;
}
NumTries++;
}
@@ -1223,13 +1223,13 @@ HRESULT CUIWindow::MoveFocus(bool Forward) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::GoExclusive() {
- if (m_Mode == WINDOW_EXCLUSIVE) return S_OK;
+ if (_mode == WINDOW_EXCLUSIVE) return S_OK;
- if (m_Mode == WINDOW_NORMAL) {
- m_Ready = false;
- m_Mode = WINDOW_EXCLUSIVE;
- m_Visible = true;
- m_Disable = false;
+ if (_mode == WINDOW_NORMAL) {
+ _ready = false;
+ _mode = WINDOW_EXCLUSIVE;
+ _visible = true;
+ _disable = false;
Game->FocusWindow(this);
return S_OK;
} else return E_FAIL;
@@ -1238,30 +1238,30 @@ HRESULT CUIWindow::GoExclusive() {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::GoSystemExclusive() {
- if (m_Mode == WINDOW_SYSTEM_EXCLUSIVE) return S_OK;
+ if (_mode == WINDOW_SYSTEM_EXCLUSIVE) return S_OK;
MakeFreezable(false);
- m_Mode = WINDOW_SYSTEM_EXCLUSIVE;
- m_Ready = false;
- m_Visible = true;
- m_Disable = false;
+ _mode = WINDOW_SYSTEM_EXCLUSIVE;
+ _ready = false;
+ _visible = true;
+ _disable = false;
Game->FocusWindow(this);
- Game->Freeze(m_PauseMusic);
+ Game->Freeze(_pauseMusic);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::Close() {
- if (m_Mode == WINDOW_SYSTEM_EXCLUSIVE) {
+ if (_mode == WINDOW_SYSTEM_EXCLUSIVE) {
Game->Unfreeze();
}
- m_Mode = WINDOW_NORMAL;
- m_Visible = false;
- m_Ready = true;
+ _mode = WINDOW_NORMAL;
+ _visible = false;
+ _ready = true;
return S_OK;
}
@@ -1271,9 +1271,9 @@ HRESULT CUIWindow::Close() {
HRESULT CUIWindow::Listen(CBScriptHolder *param1, uint32 param2) {
CUIObject *obj = (CUIObject *)param1;
- switch (obj->m_Type) {
+ switch (obj->_type) {
case UI_BUTTON:
- if (scumm_stricmp(obj->m_Name, "close") == 0) Close();
+ if (scumm_stricmp(obj->_name, "close") == 0) Close();
else return CBObject::Listen(param1, param2);
break;
default:
@@ -1286,8 +1286,8 @@ HRESULT CUIWindow::Listen(CBScriptHolder *param1, uint32 param2) {
//////////////////////////////////////////////////////////////////////////
void CUIWindow::MakeFreezable(bool Freezable) {
- for (int i = 0; i < m_Widgets.GetSize(); i++)
- m_Widgets[i]->MakeFreezable(Freezable);
+ for (int i = 0; i < _widgets.GetSize(); i++)
+ _widgets[i]->MakeFreezable(Freezable);
CBObject::MakeFreezable(Freezable);
}
@@ -1295,11 +1295,11 @@ void CUIWindow::MakeFreezable(bool Freezable) {
//////////////////////////////////////////////////////////////////////////
HRESULT CUIWindow::GetWindowObjects(CBArray<CUIObject *, CUIObject *>& Objects, bool InteractiveOnly) {
- for (int i = 0; i < m_Widgets.GetSize(); i++) {
- CUIObject *Control = m_Widgets[i];
- if (Control->m_Disable && InteractiveOnly) continue;
+ for (int i = 0; i < _widgets.GetSize(); i++) {
+ CUIObject *Control = _widgets[i];
+ if (Control->_disable && InteractiveOnly) continue;
- switch (Control->m_Type) {
+ switch (Control->_type) {
case UI_WINDOW:
((CUIWindow *)Control)->GetWindowObjects(Objects, InteractiveOnly);
break;
diff --git a/engines/wintermute/UIWindow.h b/engines/wintermute/UIWindow.h
index b8adc2f27f..dc4c83ee1f 100644
--- a/engines/wintermute/UIWindow.h
+++ b/engines/wintermute/UIWindow.h
@@ -40,43 +40,43 @@ class CUIWindow : public CUIObject {
public:
HRESULT GetWindowObjects(CBArray<CUIObject *, CUIObject *>& Objects, bool InteractiveOnly);
- bool m_PauseMusic;
+ bool _pauseMusic;
void Cleanup();
virtual void MakeFreezable(bool Freezable);
- CBViewport *m_Viewport;
- bool m_ClipContents;
- bool m_InGame;
- bool m_IsMenu;
- bool m_FadeBackground;
- uint32 m_FadeColor;
+ CBViewport *_viewport;
+ bool _clipContents;
+ bool _inGame;
+ bool _isMenu;
+ bool _fadeBackground;
+ uint32 _fadeColor;
virtual bool HandleMouseWheel(int Delta);
- CUIWindow *m_ShieldWindow;
- CUIButton *m_ShieldButton;
+ CUIWindow *_shieldWindow;
+ CUIButton *_shieldButton;
HRESULT Close();
HRESULT GoSystemExclusive();
HRESULT GoExclusive();
- TWindowMode m_Mode;
+ TWindowMode _mode;
HRESULT MoveFocus(bool Forward = true);
virtual HRESULT HandleMouse(TMouseEvent Event, TMouseButton Button);
- POINT m_DragFrom;
- bool m_Dragging;
+ POINT _dragFrom;
+ bool _dragging;
DECLARE_PERSISTENT(CUIWindow, CUIObject)
- bool m_Transparent;
+ bool _transparent;
HRESULT ShowWidget(char *Name, bool Visible = true);
HRESULT EnableWidget(char *Name, bool Enable = true);
- RECT m_TitleRect;
- RECT m_DragRect;
+ RECT _titleRect;
+ RECT _dragRect;
virtual HRESULT Display(int OffsetX = 0, int OffsetY = 0);
CUIWindow(CBGame *inGame);
virtual ~CUIWindow();
virtual bool HandleKeypress(SDL_Event *event);
- CBArray<CUIObject *, CUIObject *> m_Widgets;
- TTextAlign m_TitleAlign;
+ CBArray<CUIObject *, CUIObject *> _widgets;
+ TTextAlign _titleAlign;
HRESULT LoadFile(char *Filename);
HRESULT LoadBuffer(byte *Buffer, bool Complete = true);
- CUITiledImage *m_BackInactive;
- CBFont *m_FontInactive;
- CBSprite *m_ImageInactive;
+ CUITiledImage *_backInactive;
+ CBFont *_fontInactive;
+ CBSprite *_imageInactive;
virtual HRESULT Listen(CBScriptHolder *param1, uint32 param2);
virtual HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/coll_templ.h b/engines/wintermute/coll_templ.h
index bcd11126a9..6bbadd6787 100644
--- a/engines/wintermute/coll_templ.h
+++ b/engines/wintermute/coll_templ.h
@@ -116,10 +116,10 @@ public:
// Implementation
protected:
- TYPE *m_pData; // the actual array of data
- int m_nSize; // # of elements (upperBound - 1)
- int m_nMaxSize; // max allocated
- int m_nGrowBy; // grow amount
+ TYPE *_pData; // the actual array of data
+ int _nSize; // # of elements (upperBound - 1)
+ int _nMaxSize; // max allocated
+ int _nGrowBy; // grow amount
public:
~CBArray();
@@ -130,11 +130,11 @@ public:
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
inline int CBArray<TYPE, ARG_TYPE>::GetSize() const {
- return m_nSize;
+ return _nSize;
}
template<class TYPE, class ARG_TYPE>
inline int CBArray<TYPE, ARG_TYPE>::GetUpperBound() const {
- return m_nSize - 1;
+ return _nSize - 1;
}
template<class TYPE, class ARG_TYPE>
inline void CBArray<TYPE, ARG_TYPE>::RemoveAll() {
@@ -142,27 +142,27 @@ inline void CBArray<TYPE, ARG_TYPE>::RemoveAll() {
}
template<class TYPE, class ARG_TYPE>
inline TYPE CBArray<TYPE, ARG_TYPE>::GetAt(int nIndex) const {
- return m_pData[nIndex];
+ return _pData[nIndex];
}
template<class TYPE, class ARG_TYPE>
inline void CBArray<TYPE, ARG_TYPE>::SetAt(int nIndex, ARG_TYPE newElement) {
- m_pData[nIndex] = newElement;
+ _pData[nIndex] = newElement;
}
template<class TYPE, class ARG_TYPE>
inline TYPE &CBArray<TYPE, ARG_TYPE>::ElementAt(int nIndex) {
- return m_pData[nIndex];
+ return _pData[nIndex];
}
template<class TYPE, class ARG_TYPE>
inline const TYPE *CBArray<TYPE, ARG_TYPE>::GetData() const {
- return (const TYPE *)m_pData;
+ return (const TYPE *)_pData;
}
template<class TYPE, class ARG_TYPE>
inline TYPE *CBArray<TYPE, ARG_TYPE>::GetData() {
- return (TYPE *)m_pData;
+ return (TYPE *)_pData;
}
template<class TYPE, class ARG_TYPE>
inline int CBArray<TYPE, ARG_TYPE>::Add(ARG_TYPE newElement) {
- int nIndex = m_nSize;
+ int nIndex = _nSize;
SetAtGrow(nIndex, newElement);
return nIndex;
}
@@ -180,16 +180,16 @@ inline TYPE &CBArray<TYPE, ARG_TYPE>::operator[](int nIndex) {
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
CBArray<TYPE, ARG_TYPE>::CBArray() {
- m_pData = NULL;
- m_nSize = m_nMaxSize = m_nGrowBy = 0;
+ _pData = NULL;
+ _nSize = _nMaxSize = _nGrowBy = 0;
}
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
CBArray<TYPE, ARG_TYPE>::~CBArray() {
- if (m_pData != NULL) {
- DCDestructElements<TYPE>(m_pData, m_nSize);
- delete[](byte *)m_pData;
+ if (_pData != NULL) {
+ DCDestructElements<TYPE>(_pData, _nSize);
+ delete[](byte *)_pData;
}
}
@@ -197,140 +197,140 @@ CBArray<TYPE, ARG_TYPE>::~CBArray() {
template<class TYPE, class ARG_TYPE>
void CBArray<TYPE, ARG_TYPE>::SetSize(int nNewSize, int nGrowBy) {
if (nGrowBy != -1)
- m_nGrowBy = nGrowBy; // set new size
+ _nGrowBy = nGrowBy; // set new size
if (nNewSize == 0) {
// shrink to nothing
- if (m_pData != NULL) {
- DCDestructElements<TYPE>(m_pData, m_nSize);
- delete[](byte *)m_pData;
- m_pData = NULL;
+ if (_pData != NULL) {
+ DCDestructElements<TYPE>(_pData, _nSize);
+ delete[](byte *)_pData;
+ _pData = NULL;
}
- m_nSize = m_nMaxSize = 0;
- } else if (m_pData == NULL) {
+ _nSize = _nMaxSize = 0;
+ } else if (_pData == NULL) {
// create one with exact size
- m_pData = (TYPE *) new byte[nNewSize * sizeof(TYPE)];
- DCConstructElements<TYPE>(m_pData, nNewSize);
- m_nSize = m_nMaxSize = nNewSize;
- } else if (nNewSize <= m_nMaxSize) {
+ _pData = (TYPE *) new byte[nNewSize * sizeof(TYPE)];
+ DCConstructElements<TYPE>(_pData, nNewSize);
+ _nSize = _nMaxSize = nNewSize;
+ } else if (nNewSize <= _nMaxSize) {
// it fits
- if (nNewSize > m_nSize) {
+ if (nNewSize > _nSize) {
// initialize the new elements
- DCConstructElements<TYPE>(&m_pData[m_nSize], nNewSize - m_nSize);
- } else if (m_nSize > nNewSize) {
+ DCConstructElements<TYPE>(&_pData[_nSize], nNewSize - _nSize);
+ } else if (_nSize > nNewSize) {
// destroy the old elements
- DCDestructElements<TYPE>(&m_pData[nNewSize], m_nSize - nNewSize);
+ DCDestructElements<TYPE>(&_pData[nNewSize], _nSize - nNewSize);
}
- m_nSize = nNewSize;
+ _nSize = nNewSize;
} else {
// otherwise, grow array
- int nGrowBy = m_nGrowBy;
+ int nGrowBy = _nGrowBy;
if (nGrowBy == 0) {
// heuristically determine growth when nGrowBy == 0
// (this avoids heap fragmentation in many situations)
- nGrowBy = m_nSize / 8;
+ nGrowBy = _nSize / 8;
nGrowBy = (nGrowBy < 4) ? 4 : ((nGrowBy > 1024) ? 1024 : nGrowBy);
}
int nNewMax;
- if (nNewSize < m_nMaxSize + nGrowBy)
- nNewMax = m_nMaxSize + nGrowBy; // granularity
+ if (nNewSize < _nMaxSize + nGrowBy)
+ nNewMax = _nMaxSize + nGrowBy; // granularity
else
nNewMax = nNewSize; // no slush
TYPE *pNewData = (TYPE *) new byte[nNewMax * sizeof(TYPE)];
// copy new data from old
- memcpy(pNewData, m_pData, m_nSize * sizeof(TYPE));
+ memcpy(pNewData, _pData, _nSize * sizeof(TYPE));
// construct remaining elements
- DCConstructElements<TYPE>(&pNewData[m_nSize], nNewSize - m_nSize);
+ DCConstructElements<TYPE>(&pNewData[_nSize], nNewSize - _nSize);
// get rid of old stuff (note: no destructors called)
- delete[](byte *)m_pData;
- m_pData = pNewData;
- m_nSize = nNewSize;
- m_nMaxSize = nNewMax;
+ delete[](byte *)_pData;
+ _pData = pNewData;
+ _nSize = nNewSize;
+ _nMaxSize = nNewMax;
}
}
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
int CBArray<TYPE, ARG_TYPE>::Append(const CBArray &src) {
- int nOldSize = m_nSize;
- SetSize(m_nSize + src.m_nSize);
- DCCopyElements<TYPE>(m_pData + nOldSize, src.m_pData, src.m_nSize);
+ int nOldSize = _nSize;
+ SetSize(_nSize + src._nSize);
+ DCCopyElements<TYPE>(_pData + nOldSize, src._pData, src._nSize);
return nOldSize;
}
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
void CBArray<TYPE, ARG_TYPE>::Copy(const CBArray &src) {
- SetSize(src.m_nSize);
- DCCopyElements<TYPE>(m_pData, src.m_pData, src.m_nSize);
+ SetSize(src._nSize);
+ DCCopyElements<TYPE>(_pData, src._pData, src._nSize);
}
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
void CBArray<TYPE, ARG_TYPE>::FreeExtra() {
- if (m_nSize != m_nMaxSize) {
+ if (_nSize != _nMaxSize) {
// shrink to desired size
TYPE *pNewData = NULL;
- if (m_nSize != 0) {
- pNewData = (TYPE *) new byte[m_nSize * sizeof(TYPE)];
+ if (_nSize != 0) {
+ pNewData = (TYPE *) new byte[_nSize * sizeof(TYPE)];
// copy new data from old
- memcpy(pNewData, m_pData, m_nSize * sizeof(TYPE));
+ memcpy(pNewData, _pData, _nSize * sizeof(TYPE));
}
// get rid of old stuff (note: no destructors called)
- delete[](byte *)m_pData;
- m_pData = pNewData;
- m_nMaxSize = m_nSize;
+ delete[](byte *)_pData;
+ _pData = pNewData;
+ _nMaxSize = _nSize;
}
}
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
void CBArray<TYPE, ARG_TYPE>::SetAtGrow(int nIndex, ARG_TYPE newElement) {
- if (nIndex >= m_nSize)
+ if (nIndex >= _nSize)
SetSize(nIndex + 1, -1);
- m_pData[nIndex] = newElement;
+ _pData[nIndex] = newElement;
}
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
void CBArray<TYPE, ARG_TYPE>::InsertAt(int nIndex, ARG_TYPE newElement, int nCount /*=1*/) {
- if (nIndex >= m_nSize) {
+ if (nIndex >= _nSize) {
// adding after the end of the array
SetSize(nIndex + nCount, -1); // grow so nIndex is valid
} else {
// inserting in the middle of the array
- int nOldSize = m_nSize;
- SetSize(m_nSize + nCount, -1); // grow it to new size
+ int nOldSize = _nSize;
+ SetSize(_nSize + nCount, -1); // grow it to new size
// destroy intial data before copying over it
- DCDestructElements<TYPE>(&m_pData[nOldSize], nCount);
+ DCDestructElements<TYPE>(&_pData[nOldSize], nCount);
// shift old data up to fill gap
- memmove(&m_pData[nIndex + nCount], &m_pData[nIndex],
+ memmove(&_pData[nIndex + nCount], &_pData[nIndex],
(nOldSize - nIndex) * sizeof(TYPE));
// re-init slots we copied from
- DCConstructElements<TYPE>(&m_pData[nIndex], nCount);
+ DCConstructElements<TYPE>(&_pData[nIndex], nCount);
}
// insert new value in the gap
while (nCount--)
- m_pData[nIndex++] = newElement;
+ _pData[nIndex++] = newElement;
}
/////////////////////////////////////////////////////////////////////////////
template<class TYPE, class ARG_TYPE>
void CBArray<TYPE, ARG_TYPE>::RemoveAt(int nIndex, int nCount) {
// just remove a range
- int nMoveCount = m_nSize - (nIndex + nCount);
- DCDestructElements<TYPE>(&m_pData[nIndex], nCount);
+ int nMoveCount = _nSize - (nIndex + nCount);
+ DCDestructElements<TYPE>(&_pData[nIndex], nCount);
if (nMoveCount)
- memcpy(&m_pData[nIndex], &m_pData[nIndex + nCount],
+ memcpy(&_pData[nIndex], &_pData[nIndex + nCount],
nMoveCount * sizeof(TYPE));
- m_nSize -= nCount;
+ _nSize -= nCount;
}
/////////////////////////////////////////////////////////////////////////////
@@ -348,7 +348,7 @@ void CBArray<TYPE, ARG_TYPE>::InsertAt(int nStartIndex, CBArray *pNewArray) {
template<class TYPE, class ARG_TYPE>
HRESULT CBArray<TYPE, ARG_TYPE>::Persist(CBPersistMgr *PersistMgr) {
int i, j;
- if (PersistMgr->m_Saving) {
+ if (PersistMgr->_saving) {
j = GetSize();
PersistMgr->Transfer("ArraySize", &j);
for (i = 0; i < j; i++) {
diff --git a/engines/wintermute/persistent.h b/engines/wintermute/persistent.h
index 130e080e79..4b528c7947 100644
--- a/engines/wintermute/persistent.h
+++ b/engines/wintermute/persistent.h
@@ -47,7 +47,7 @@ namespace WinterMute {
#define DECLARE_PERSISTENT(class_name, parent_class)\
-static const char m_ClassName[];\
+static const char _className[];\
static void* WINAPI PersistBuild(void);\
virtual const char* GetClassName();\
static HRESULT WINAPI PersistLoad(void* Instance, CBPersistMgr* PersistMgr);\
@@ -58,7 +58,7 @@ void operator delete(void* p);\
#define IMPLEMENT_PERSISTENT(class_name, persistent_class)\
-const char class_name::m_ClassName[] = #class_name;\
+const char class_name::_className[] = #class_name;\
void* class_name::PersistBuild(){\
return ::new class_name(DYNAMIC_CONSTRUCTOR, DYNAMIC_CONSTRUCTOR);\
}\
@@ -71,7 +71,7 @@ const char* class_name::GetClassName(){\
return #class_name;\
}\
\
-CSysClass Register##class_name(class_name::m_ClassName, class_name::PersistBuild, class_name::PersistLoad, persistent_class);\
+CSysClass Register##class_name(class_name::_className, class_name::PersistBuild, class_name::PersistLoad, persistent_class);\
\
void* class_name::operator new (size_t size){\
void* ret = ::operator new(size);\
diff --git a/engines/wintermute/scriptables/SXArray.cpp b/engines/wintermute/scriptables/SXArray.cpp
index 5203945053..978de4ae52 100644
--- a/engines/wintermute/scriptables/SXArray.cpp
+++ b/engines/wintermute/scriptables/SXArray.cpp
@@ -38,33 +38,33 @@ IMPLEMENT_PERSISTENT(CSXArray, false)
//////////////////////////////////////////////////////////////////////////
CSXArray::CSXArray(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
- m_Length = 0;
- m_Values = new CScValue(Game);
+ _length = 0;
+ _values = new CScValue(Game);
int NumParams = Stack->Pop()->GetInt(0);
- if (NumParams == 1) m_Length = Stack->Pop()->GetInt(0);
+ if (NumParams == 1) _length = Stack->Pop()->GetInt(0);
else if (NumParams > 1) {
- m_Length = NumParams;
+ _length = NumParams;
char ParamName[20];
for (int i = 0; i < NumParams; i++) {
sprintf(ParamName, "%d", i);
- m_Values->SetProp(ParamName, Stack->Pop());
+ _values->SetProp(ParamName, Stack->Pop());
}
}
}
//////////////////////////////////////////////////////////////////////////
CSXArray::CSXArray(CBGame *inGame): CBScriptable(inGame) {
- m_Length = 0;
- m_Values = new CScValue(Game);
+ _length = 0;
+ _values = new CScValue(Game);
}
//////////////////////////////////////////////////////////////////////////
CSXArray::~CSXArray() {
- delete m_Values;
- m_Values = NULL;
+ delete _values;
+ _values = NULL;
}
@@ -73,16 +73,16 @@ char *CSXArray::ScToString() {
static char Dummy[32768];
strcpy(Dummy, "");
char PropName[20];
- for (int i = 0; i < m_Length; i++) {
+ for (int i = 0; i < _length; i++) {
sprintf(PropName, "%d", i);
- CScValue *val = m_Values->GetProp(PropName);
+ CScValue *val = _values->GetProp(PropName);
if (val) {
if (strlen(Dummy) + strlen(val->GetString()) < 32768) {
strcat(Dummy, val->GetString());
}
}
- if (i < m_Length - 1 && strlen(Dummy) + 1 < 32768) strcat(Dummy, ",");
+ if (i < _length - 1 && strlen(Dummy) + 1 < 32768) strcat(Dummy, ",");
}
return Dummy;
}
@@ -98,11 +98,11 @@ HRESULT CSXArray::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
char ParamName[20];
for (int i = 0; i < NumParams; i++) {
- m_Length++;
- sprintf(ParamName, "%d", m_Length - 1);
- m_Values->SetProp(ParamName, Stack->Pop(), true);
+ _length++;
+ sprintf(ParamName, "%d", _length - 1);
+ _values->SetProp(ParamName, Stack->Pop(), true);
}
- Stack->PushInt(m_Length);
+ Stack->PushInt(_length);
return S_OK;
}
@@ -114,12 +114,12 @@ HRESULT CSXArray::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
Stack->CorrectParams(0);
- if (m_Length > 0) {
+ if (_length > 0) {
char ParamName[20];
- sprintf(ParamName, "%d", m_Length - 1);
- Stack->Push(m_Values->GetProp(ParamName));
- m_Values->DeleteProp(ParamName);
- m_Length--;
+ sprintf(ParamName, "%d", _length - 1);
+ Stack->Push(_values->GetProp(ParamName));
+ _values->DeleteProp(ParamName);
+ _length--;
} else Stack->PushNULL();
return S_OK;
@@ -131,22 +131,22 @@ HRESULT CSXArray::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
//////////////////////////////////////////////////////////////////////////
CScValue *CSXArray::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("array");
- return m_ScValue;
+ _scValue->SetString("array");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Length") == 0) {
- m_ScValue->SetInt(m_Length);
- return m_ScValue;
+ _scValue->SetInt(_length);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -155,8 +155,8 @@ CScValue *CSXArray::ScGetProperty(char *Name) {
else {
char ParamName[20];
if (ValidNumber(Name, ParamName)) {
- return m_Values->GetProp(ParamName);
- } else return m_ScValue;
+ return _values->GetProp(ParamName);
+ } else return _scValue;
}
}
@@ -167,14 +167,14 @@ HRESULT CSXArray::ScSetProperty(char *Name, CScValue *Value) {
// Length
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Length") == 0) {
- int OrigLength = m_Length;
- m_Length = MAX(Value->GetInt(0), 0);
+ int OrigLength = _length;
+ _length = MAX(Value->GetInt(0), 0);
char PropName[20];
- if (m_Length < OrigLength) {
- for (int i = m_Length; i < OrigLength; i++) {
+ if (_length < OrigLength) {
+ for (int i = _length; i < OrigLength; i++) {
sprintf(PropName, "%d", i);
- m_Values->DeleteProp(PropName);
+ _values->DeleteProp(PropName);
}
}
return S_OK;
@@ -187,8 +187,8 @@ HRESULT CSXArray::ScSetProperty(char *Name, CScValue *Value) {
char ParamName[20];
if (ValidNumber(Name, ParamName)) {
int Index = atoi(ParamName);
- if (Index >= m_Length) m_Length = Index + 1;
- return m_Values->SetProp(ParamName, Value);
+ if (Index >= _length) _length = Index + 1;
+ return _values->SetProp(ParamName, Value);
} else return E_FAIL;
}
}
@@ -198,8 +198,8 @@ HRESULT CSXArray::ScSetProperty(char *Name, CScValue *Value) {
HRESULT CSXArray::Persist(CBPersistMgr *PersistMgr) {
CBScriptable::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Length));
- PersistMgr->Transfer(TMEMBER(m_Values));
+ PersistMgr->Transfer(TMEMBER(_length));
+ PersistMgr->Transfer(TMEMBER(_values));
return S_OK;
}
@@ -225,9 +225,9 @@ bool CSXArray::ValidNumber(const char *OrigStr, char *OutStr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CSXArray::Push(CScValue *Val) {
char ParamName[20];
- m_Length++;
- sprintf(ParamName, "%d", m_Length - 1);
- m_Values->SetProp(ParamName, Val, true);
+ _length++;
+ sprintf(ParamName, "%d", _length - 1);
+ _values->SetProp(ParamName, Val, true);
return S_OK;
}
diff --git a/engines/wintermute/scriptables/SXArray.h b/engines/wintermute/scriptables/SXArray.h
index 5283db2efb..0605d6c4f8 100644
--- a/engines/wintermute/scriptables/SXArray.h
+++ b/engines/wintermute/scriptables/SXArray.h
@@ -45,8 +45,8 @@ public:
HRESULT ScSetProperty(char *Name, CScValue *Value);
HRESULT ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name);
char *ScToString();
- int m_Length;
- CScValue *m_Values;
+ int _length;
+ CScValue *_values;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/scriptables/SXDate.cpp b/engines/wintermute/scriptables/SXDate.cpp
index 232f2beefd..65e6a43782 100644
--- a/engines/wintermute/scriptables/SXDate.cpp
+++ b/engines/wintermute/scriptables/SXDate.cpp
@@ -35,23 +35,23 @@ IMPLEMENT_PERSISTENT(CSXDate, false)
CSXDate::CSXDate(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
Stack->CorrectParams(6);
#if 0
- memset(&m_tm, 0, sizeof(m_tm));
+ memset(&_tm, 0, sizeof(_tm));
CScValue *valYear = Stack->Pop();
- m_tm.tm_year = valYear->GetInt() - 1900;
- m_tm.tm_mon = Stack->Pop()->GetInt() - 1;
- m_tm.tm_mday = Stack->Pop()->GetInt();
- m_tm.tm_hour = Stack->Pop()->GetInt();
- m_tm.tm_min = Stack->Pop()->GetInt();
- m_tm.tm_sec = Stack->Pop()->GetInt();
+ _tm.t_year = valYear->GetInt() - 1900;
+ _tm.t_mon = Stack->Pop()->GetInt() - 1;
+ _tm.t_mday = Stack->Pop()->GetInt();
+ _tm.t_hour = Stack->Pop()->GetInt();
+ _tm.t_min = Stack->Pop()->GetInt();
+ _tm.t_sec = Stack->Pop()->GetInt();
if (valYear->IsNULL()) {
time_t TimeNow;
time(&TimeNow);
- memcpy(&m_tm, localtime(&TimeNow), sizeof(m_tm));
+ memcpy(&_tm, localtime(&TimeNow), sizeof(_tm));
}
- mktime(&m_tm);
+ mktime(&_tm);
#endif
}
@@ -65,7 +65,7 @@ CSXDate::~CSXDate() {
//////////////////////////////////////////////////////////////////////////
char *CSXDate::ScToString() {
#if 0
- return asctime(&m_tm);
+ return asctime(&_tm);
#endif
return "";
}
@@ -79,7 +79,7 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "GetYear") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_tm.tm_year + 1900);
+ Stack->PushInt(_tm.t_year + 1900);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
@@ -87,7 +87,7 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetMonth") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_tm.tm_mon + 1);
+ Stack->PushInt(_tm.t_mon + 1);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
@@ -95,7 +95,7 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetDate") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_tm.tm_mday);
+ Stack->PushInt(_tm.t_mday);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
@@ -103,7 +103,7 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetHours") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_tm.tm_hour);
+ Stack->PushInt(_tm.t_hour);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
@@ -111,7 +111,7 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetMinutes") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_tm.tm_min);
+ Stack->PushInt(_tm.t_min);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
@@ -119,7 +119,7 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetSeconds") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_tm.tm_sec);
+ Stack->PushInt(_tm.t_sec);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
@@ -127,7 +127,7 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "GetWeekday") == 0) {
Stack->CorrectParams(0);
- Stack->PushInt(m_tm.tm_wday);
+ Stack->PushInt(_tm.t_wday);
return S_OK;
}
@@ -137,8 +137,8 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetYear") == 0) {
Stack->CorrectParams(1);
- m_tm.tm_year = Stack->Pop()->GetInt() - 1900;
- mktime(&m_tm);
+ _tm.t_year = Stack->Pop()->GetInt() - 1900;
+ mktime(&_tm);
Stack->PushNULL();
return S_OK;
}
@@ -147,8 +147,8 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetMonth") == 0) {
Stack->CorrectParams(1);
- m_tm.tm_mon = Stack->Pop()->GetInt() - 1;
- mktime(&m_tm);
+ _tm.t_mon = Stack->Pop()->GetInt() - 1;
+ mktime(&_tm);
Stack->PushNULL();
return S_OK;
}
@@ -157,8 +157,8 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetDate") == 0) {
Stack->CorrectParams(1);
- m_tm.tm_mday = Stack->Pop()->GetInt();
- mktime(&m_tm);
+ _tm.t_mday = Stack->Pop()->GetInt();
+ mktime(&_tm);
Stack->PushNULL();
return S_OK;
}
@@ -167,8 +167,8 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetHours") == 0) {
Stack->CorrectParams(1);
- m_tm.tm_hour = Stack->Pop()->GetInt();
- mktime(&m_tm);
+ _tm.t_hour = Stack->Pop()->GetInt();
+ mktime(&_tm);
Stack->PushNULL();
return S_OK;
}
@@ -177,8 +177,8 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetMinutes") == 0) {
Stack->CorrectParams(1);
- m_tm.tm_min = Stack->Pop()->GetInt();
- mktime(&m_tm);
+ _tm.t_min = Stack->Pop()->GetInt();
+ mktime(&_tm);
Stack->PushNULL();
return S_OK;
}
@@ -187,8 +187,8 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetSeconds") == 0) {
Stack->CorrectParams(1);
- m_tm.tm_sec = Stack->Pop()->GetInt();
- mktime(&m_tm);
+ _tm.t_sec = Stack->Pop()->GetInt();
+ mktime(&_tm);
Stack->PushNULL();
return S_OK;
}
@@ -201,8 +201,8 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(0);
time_t TimeNow;
time(&TimeNow);
- memcpy(&m_tm, localtime(&TimeNow), sizeof(m_tm));
- mktime(&m_tm);
+ memcpy(&_tm, localtime(&TimeNow), sizeof(_tm));
+ mktime(&_tm);
Stack->PushNULL();
return S_OK;
}
@@ -215,17 +215,17 @@ HRESULT CSXDate::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
CScValue *CSXDate::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("date");
- return m_ScValue;
+ _scValue->SetString("date");
+ return _scValue;
}
- else return m_ScValue;
+ else return _scValue;
}
@@ -249,10 +249,10 @@ HRESULT CSXDate::Persist(CBPersistMgr *PersistMgr) {
CBScriptable::Persist(PersistMgr);
#if 0
- if (PersistMgr->m_Saving)
- PersistMgr->PutBytes((byte *)&m_tm, sizeof(m_tm));
+ if (PersistMgr->_saving)
+ PersistMgr->PutBytes((byte *)&_tm, sizeof(_tm));
else
- PersistMgr->GetBytes((byte *)&m_tm, sizeof(m_tm));
+ PersistMgr->GetBytes((byte *)&_tm, sizeof(_tm));
#endif
return S_OK;
}
@@ -261,8 +261,8 @@ HRESULT CSXDate::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
int CSXDate::ScCompare(CBScriptable *Value) {
#if 0
- time_t time1 = mktime(&m_tm);
- time_t time2 = mktime(&((CSXDate *)Value)->m_tm);
+ time_t time1 = mktime(&_tm);
+ time_t time2 = mktime(&((CSXDate *)Value)->_tm);
if (time1 < time2) return -1;
else if (time1 > time2) return 1;
diff --git a/engines/wintermute/scriptables/SXDate.h b/engines/wintermute/scriptables/SXDate.h
index 638816b6d1..677b7e7dd1 100644
--- a/engines/wintermute/scriptables/SXDate.h
+++ b/engines/wintermute/scriptables/SXDate.h
@@ -44,8 +44,8 @@ public:
HRESULT ScSetProperty(char *Name, CScValue *Value);
HRESULT ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisStack, char *Name);
char *ScToString();
- char *m_String;
- //struct tm m_tm; // TODO!
+ char *_string;
+ //struct tm _tm; // TODO!
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/scriptables/SXFile.cpp b/engines/wintermute/scriptables/SXFile.cpp
index 8e38e2608a..19b60043da 100644
--- a/engines/wintermute/scriptables/SXFile.cpp
+++ b/engines/wintermute/scriptables/SXFile.cpp
@@ -44,14 +44,14 @@ CSXFile::CSXFile(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
Stack->CorrectParams(1);
CScValue *Val = Stack->Pop();
- m_Filename = NULL;
- if (!Val->IsNULL()) CBUtils::SetString(&m_Filename, Val->GetString());
+ _filename = NULL;
+ if (!Val->IsNULL()) CBUtils::SetString(&_filename, Val->GetString());
- m_ReadFile = NULL;
- m_WriteFile = NULL;
+ _readFile = NULL;
+ _writeFile = NULL;
- m_Mode = 0;
- m_TextMode = false;
+ _mode = 0;
+ _textMode = false;
}
@@ -62,29 +62,29 @@ CSXFile::~CSXFile() {
//////////////////////////////////////////////////////////////////////////
void CSXFile::Cleanup() {
- delete[] m_Filename;
- m_Filename = NULL;
+ delete[] _filename;
+ _filename = NULL;
Close();
}
//////////////////////////////////////////////////////////////////////////
void CSXFile::Close() {
- if (m_ReadFile) {
- Game->m_FileManager->CloseFile(m_ReadFile);
- m_ReadFile = NULL;
+ if (_readFile) {
+ Game->_fileManager->CloseFile(_readFile);
+ _readFile = NULL;
}
- if (m_WriteFile) {
- fclose(m_WriteFile);
- m_WriteFile = NULL;
+ if (_writeFile) {
+ fclose(_writeFile);
+ _writeFile = NULL;
}
- m_Mode = 0;
- m_TextMode = false;
+ _mode = 0;
+ _textMode = false;
}
//////////////////////////////////////////////////////////////////////////
char *CSXFile::ScToString() {
- if (m_Filename) return m_Filename;
+ if (_filename) return _filename;
else return "[file object]";
}
@@ -98,7 +98,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
char *Filename = Stack->Pop()->GetString();
Cleanup();
- CBUtils::SetString(&m_Filename, Filename);
+ CBUtils::SetString(&_filename, Filename);
Stack->PushNULL();
return S_OK;
}
@@ -109,33 +109,33 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "OpenAsText") == 0 || strcmp(Name, "OpenAsBinary") == 0) {
Stack->CorrectParams(1);
Close();
- m_Mode = Stack->Pop()->GetInt(1);
- if (m_Mode < 1 || m_Mode > 3) {
+ _mode = Stack->Pop()->GetInt(1);
+ if (_mode < 1 || _mode > 3) {
Script->RuntimeError("File.%s: invalid access mode. Setting read mode.", Name);
- m_Mode = 1;
+ _mode = 1;
}
- if (m_Mode == 1) {
- m_ReadFile = Game->m_FileManager->OpenFile(m_Filename);
- if (!m_ReadFile) {
- //Script->RuntimeError("File.%s: Error opening file '%s' for reading.", Name, m_Filename);
+ if (_mode == 1) {
+ _readFile = Game->_fileManager->OpenFile(_filename);
+ if (!_readFile) {
+ //Script->RuntimeError("File.%s: Error opening file '%s' for reading.", Name, _filename);
Close();
- } else m_TextMode = strcmp(Name, "OpenAsText") == 0;
+ } else _textMode = strcmp(Name, "OpenAsText") == 0;
} else {
if (strcmp(Name, "OpenAsText") == 0) {
- if (m_Mode == 2) m_WriteFile = fopen(m_Filename, "w+");
- else m_WriteFile = fopen(m_Filename, "a+");
+ if (_mode == 2) _writeFile = fopen(_filename, "w+");
+ else _writeFile = fopen(_filename, "a+");
} else {
- if (m_Mode == 2) m_WriteFile = fopen(m_Filename, "wb+");
- else m_WriteFile = fopen(m_Filename, "ab+");
+ if (_mode == 2) _writeFile = fopen(_filename, "wb+");
+ else _writeFile = fopen(_filename, "ab+");
}
- if (!m_WriteFile) {
- //Script->RuntimeError("File.%s: Error opening file '%s' for writing.", Name, m_Filename);
+ if (!_writeFile) {
+ //Script->RuntimeError("File.%s: Error opening file '%s' for writing.", Name, _filename);
Close();
- } else m_TextMode = strcmp(Name, "OpenAsText") == 0;
+ } else _textMode = strcmp(Name, "OpenAsText") == 0;
}
- if (m_ReadFile || m_WriteFile) Stack->PushBool(true);
+ if (_readFile || _writeFile) Stack->PushBool(true);
else Stack->PushBool(false);
return S_OK;
@@ -156,7 +156,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "SetPosition") == 0) {
Stack->CorrectParams(1);
- if (m_Mode == 0) {
+ if (_mode == 0) {
Script->RuntimeError("File.%s: File is not open", Name);
Stack->PushBool(false);
} else {
@@ -172,7 +172,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "Delete") == 0) {
Stack->CorrectParams(0);
Close();
- Stack->PushBool(CBPlatform::DeleteFile(m_Filename) != FALSE);
+ Stack->PushBool(CBPlatform::DeleteFile(_filename) != FALSE);
return S_OK;
}
@@ -185,7 +185,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
bool Overwrite = Stack->Pop()->GetBool(true);
Close();
- Stack->PushBool(CBPlatform::CopyFile(m_Filename, Dest, !Overwrite) != FALSE);
+ Stack->PushBool(CBPlatform::CopyFile(_filename, Dest, !Overwrite) != FALSE);
return S_OK;
}
@@ -194,7 +194,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ReadLine") == 0) {
Stack->CorrectParams(0);
- if (!m_TextMode || !m_ReadFile) {
+ if (!_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open in text mode.", Name);
Stack->PushNULL();
return S_OK;
@@ -206,7 +206,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
bool FoundNewLine = false;
HRESULT Ret = E_FAIL;
do {
- Ret = m_ReadFile->Read(&b, 1);
+ Ret = _readFile->Read(&b, 1);
if (FAILED(Ret)) break;
if (Counter > BufSize) {
@@ -245,7 +245,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
int TextLen = Stack->Pop()->GetInt();
- if (!m_TextMode || !m_ReadFile) {
+ if (!_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open in text mode.", Name);
Stack->PushNULL();
return S_OK;
@@ -257,7 +257,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
HRESULT Ret = E_FAIL;
while (Counter < TextLen) {
- Ret = m_ReadFile->Read(&b, 1);
+ Ret = _readFile->Read(&b, 1);
if (FAILED(Ret)) break;
if (Counter > BufSize) {
@@ -291,15 +291,15 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
else if (strcmp(Name, "WriteLine") == 0 || strcmp(Name, "WriteText") == 0) {
Stack->CorrectParams(1);
char *Line = Stack->Pop()->GetString();
- if (!m_TextMode || !m_WriteFile) {
+ if (!_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in text mode.", Name);
Stack->PushBool(false);
return S_OK;
}
if (strcmp(Name, "WriteLine") == 0)
- fprintf(m_WriteFile, "%s\n", Line);
+ fprintf(_writeFile, "%s\n", Line);
else
- fprintf(m_WriteFile, "%s", Line);
+ fprintf(_writeFile, "%s", Line);
Stack->PushBool(true);
@@ -312,13 +312,13 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ReadBool") == 0) {
Stack->CorrectParams(0);
- if (m_TextMode || !m_ReadFile) {
+ if (_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
Stack->PushNULL();
return S_OK;
}
bool Val;
- if (SUCCEEDED(m_ReadFile->Read(&Val, sizeof(bool)))) Stack->PushBool(Val);
+ if (SUCCEEDED(_readFile->Read(&Val, sizeof(bool)))) Stack->PushBool(Val);
else Stack->PushNULL();
return S_OK;
@@ -329,13 +329,13 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ReadByte") == 0) {
Stack->CorrectParams(0);
- if (m_TextMode || !m_ReadFile) {
+ if (_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
Stack->PushNULL();
return S_OK;
}
byte Val;
- if (SUCCEEDED(m_ReadFile->Read(&Val, sizeof(byte )))) Stack->PushInt(Val);
+ if (SUCCEEDED(_readFile->Read(&Val, sizeof(byte )))) Stack->PushInt(Val);
else Stack->PushNULL();
return S_OK;
@@ -346,13 +346,13 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ReadShort") == 0) {
Stack->CorrectParams(0);
- if (m_TextMode || !m_ReadFile) {
+ if (_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
Stack->PushNULL();
return S_OK;
}
short Val;
- if (SUCCEEDED(m_ReadFile->Read(&Val, sizeof(short)))) Stack->PushInt(65536 + Val);
+ if (SUCCEEDED(_readFile->Read(&Val, sizeof(short)))) Stack->PushInt(65536 + Val);
else Stack->PushNULL();
return S_OK;
@@ -363,13 +363,13 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ReadInt") == 0 || strcmp(Name, "ReadLong") == 0) {
Stack->CorrectParams(0);
- if (m_TextMode || !m_ReadFile) {
+ if (_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
Stack->PushNULL();
return S_OK;
}
int Val;
- if (SUCCEEDED(m_ReadFile->Read(&Val, sizeof(int)))) Stack->PushInt(Val);
+ if (SUCCEEDED(_readFile->Read(&Val, sizeof(int)))) Stack->PushInt(Val);
else Stack->PushNULL();
return S_OK;
@@ -380,13 +380,13 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ReadFloat") == 0) {
Stack->CorrectParams(0);
- if (m_TextMode || !m_ReadFile) {
+ if (_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
Stack->PushNULL();
return S_OK;
}
float Val;
- if (SUCCEEDED(m_ReadFile->Read(&Val, sizeof(float)))) Stack->PushFloat(Val);
+ if (SUCCEEDED(_readFile->Read(&Val, sizeof(float)))) Stack->PushFloat(Val);
else Stack->PushNULL();
return S_OK;
@@ -397,13 +397,13 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ReadDouble") == 0) {
Stack->CorrectParams(0);
- if (m_TextMode || !m_ReadFile) {
+ if (_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
Stack->PushNULL();
return S_OK;
}
double Val;
- if (SUCCEEDED(m_ReadFile->Read(&Val, sizeof(double)))) Stack->PushFloat(Val);
+ if (SUCCEEDED(_readFile->Read(&Val, sizeof(double)))) Stack->PushFloat(Val);
else Stack->PushNULL();
return S_OK;
@@ -414,16 +414,16 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ReadString") == 0) {
Stack->CorrectParams(0);
- if (m_TextMode || !m_ReadFile) {
+ if (_textMode || !_readFile) {
Script->RuntimeError("File.%s: File must be open for reading in binary mode.", Name);
Stack->PushNULL();
return S_OK;
}
uint32 Size;
- if (SUCCEEDED(m_ReadFile->Read(&Size, sizeof(uint32)))) {
+ if (SUCCEEDED(_readFile->Read(&Size, sizeof(uint32)))) {
byte *Str = new byte[Size + 1];
if (Str) {
- if (SUCCEEDED(m_ReadFile->Read(Str, Size))) {
+ if (SUCCEEDED(_readFile->Read(Str, Size))) {
Str[Size] = '\0';
Stack->PushString((char *)Str);
}
@@ -441,12 +441,12 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
bool Val = Stack->Pop()->GetBool();
- if (m_TextMode || !m_WriteFile) {
+ if (_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, m_WriteFile);
+ fwrite(&Val, sizeof(Val), 1, _writeFile);
Stack->PushBool(true);
return S_OK;
@@ -459,12 +459,12 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
byte Val = Stack->Pop()->GetInt();
- if (m_TextMode || !m_WriteFile) {
+ if (_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, m_WriteFile);
+ fwrite(&Val, sizeof(Val), 1, _writeFile);
Stack->PushBool(true);
return S_OK;
@@ -477,12 +477,12 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
short Val = Stack->Pop()->GetInt();
- if (m_TextMode || !m_WriteFile) {
+ if (_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, m_WriteFile);
+ fwrite(&Val, sizeof(Val), 1, _writeFile);
Stack->PushBool(true);
return S_OK;
@@ -495,12 +495,12 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
int Val = Stack->Pop()->GetInt();
- if (m_TextMode || !m_WriteFile) {
+ if (_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, m_WriteFile);
+ fwrite(&Val, sizeof(Val), 1, _writeFile);
Stack->PushBool(true);
return S_OK;
@@ -513,12 +513,12 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
float Val = Stack->Pop()->GetFloat();
- if (m_TextMode || !m_WriteFile) {
+ if (_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, m_WriteFile);
+ fwrite(&Val, sizeof(Val), 1, _writeFile);
Stack->PushBool(true);
return S_OK;
@@ -531,12 +531,12 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
double Val = Stack->Pop()->GetFloat();
- if (m_TextMode || !m_WriteFile) {
+ if (_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, m_WriteFile);
+ fwrite(&Val, sizeof(Val), 1, _writeFile);
Stack->PushBool(true);
return S_OK;
@@ -549,15 +549,15 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
Stack->CorrectParams(1);
char *Val = Stack->Pop()->GetString();
- if (m_TextMode || !m_WriteFile) {
+ if (_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
Stack->PushBool(false);
return S_OK;
}
uint32 Size = strlen(Val);
- fwrite(&Size, sizeof(Size), 1, m_WriteFile);
- fwrite(Val, Size, 1, m_WriteFile);
+ fwrite(&Size, sizeof(Size), 1, _writeFile);
+ fwrite(Val, Size, 1, _writeFile);
Stack->PushBool(true);
@@ -571,54 +571,54 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
CScValue *CSXFile::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("file");
- return m_ScValue;
+ _scValue->SetString("file");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Filename (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Filename") == 0) {
- m_ScValue->SetString(m_Filename);
- return m_ScValue;
+ _scValue->SetString(_filename);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Position (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Position") == 0) {
- m_ScValue->SetInt(GetPos());
- return m_ScValue;
+ _scValue->SetInt(GetPos());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Length (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Length") == 0) {
- m_ScValue->SetInt(GetLength());
- return m_ScValue;
+ _scValue->SetInt(GetLength());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// TextMode (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "TextMode") == 0) {
- m_ScValue->SetBool(m_TextMode);
- return m_ScValue;
+ _scValue->SetBool(_textMode);
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AccessMode (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AccessMode") == 0) {
- m_ScValue->SetInt(m_Mode);
- return m_ScValue;
+ _scValue->SetInt(_mode);
+ return _scValue;
}
else return CBScriptable::ScGetProperty(Name);
@@ -632,14 +632,14 @@ HRESULT CSXFile::ScSetProperty(char *Name, CScValue *Value) {
// Length
//////////////////////////////////////////////////////////////////////////
if(strcmp(Name, "Length")==0){
- int OrigLength = m_Length;
- m_Length = max(Value->GetInt(0), 0);
+ int OrigLength = _length;
+ _length = max(Value->GetInt(0), 0);
char PropName[20];
- if(m_Length < OrigLength){
- for(int i=m_Length; i<OrigLength; i++){
+ if(_length < OrigLength){
+ for(int i=_length; i<OrigLength; i++){
sprintf(PropName, "%d", i);
- m_Values->DeleteProp(PropName);
+ _values->DeleteProp(PropName);
}
}
return S_OK;
@@ -649,26 +649,26 @@ HRESULT CSXFile::ScSetProperty(char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
uint32 CSXFile::GetPos() {
- if (m_Mode == 1 && m_ReadFile) return m_ReadFile->GetPos();
- else if ((m_Mode == 2 || m_Mode == 3) && m_WriteFile) return ftell(m_WriteFile);
+ if (_mode == 1 && _readFile) return _readFile->GetPos();
+ else if ((_mode == 2 || _mode == 3) && _writeFile) return ftell(_writeFile);
else return 0;
}
//////////////////////////////////////////////////////////////////////////
bool CSXFile::SetPos(uint32 Pos, TSeek Origin) {
- if (m_Mode == 1 && m_ReadFile) return SUCCEEDED(m_ReadFile->Seek(Pos, Origin));
- else if ((m_Mode == 2 || m_Mode == 3) && m_WriteFile) return fseek(m_WriteFile, Pos, (int)Origin) == 0;
+ if (_mode == 1 && _readFile) return SUCCEEDED(_readFile->Seek(Pos, Origin));
+ else if ((_mode == 2 || _mode == 3) && _writeFile) return fseek(_writeFile, Pos, (int)Origin) == 0;
else return false;
}
//////////////////////////////////////////////////////////////////////////
uint32 CSXFile::GetLength() {
- if (m_Mode == 1 && m_ReadFile) return m_ReadFile->GetSize();
- else if ((m_Mode == 2 || m_Mode == 3) && m_WriteFile) {
- uint32 CurrentPos = ftell(m_WriteFile);
- fseek(m_WriteFile, 0, SEEK_END);
- int Ret = ftell(m_WriteFile);
- fseek(m_WriteFile, CurrentPos, SEEK_SET);
+ if (_mode == 1 && _readFile) return _readFile->GetSize();
+ else if ((_mode == 2 || _mode == 3) && _writeFile) {
+ uint32 CurrentPos = ftell(_writeFile);
+ fseek(_writeFile, 0, SEEK_END);
+ int Ret = ftell(_writeFile);
+ fseek(_writeFile, CurrentPos, SEEK_SET);
return Ret;
} else return 0;
}
@@ -678,37 +678,37 @@ HRESULT CSXFile::Persist(CBPersistMgr *PersistMgr) {
CBScriptable::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Filename));
- PersistMgr->Transfer(TMEMBER(m_Mode));
- PersistMgr->Transfer(TMEMBER(m_TextMode));
+ PersistMgr->Transfer(TMEMBER(_filename));
+ PersistMgr->Transfer(TMEMBER(_mode));
+ PersistMgr->Transfer(TMEMBER(_textMode));
uint32 Pos = 0;
- if (PersistMgr->m_Saving) {
+ if (PersistMgr->_saving) {
Pos = GetPos();
PersistMgr->Transfer(TMEMBER(Pos));
} else {
PersistMgr->Transfer(TMEMBER(Pos));
// try to re-open file if needed
- m_WriteFile = NULL;
- m_ReadFile = NULL;
+ _writeFile = NULL;
+ _readFile = NULL;
- if (m_Mode != 0) {
+ if (_mode != 0) {
// open for reading
- if (m_Mode == 1) {
- m_ReadFile = Game->m_FileManager->OpenFile(m_Filename);
- if (!m_ReadFile) Close();
+ if (_mode == 1) {
+ _readFile = Game->_fileManager->OpenFile(_filename);
+ if (!_readFile) Close();
}
// open for writing / appending
else {
- if (m_TextMode) {
- if (m_Mode == 2) m_WriteFile = fopen(m_Filename, "w+");
- else m_WriteFile = fopen(m_Filename, "a+");
+ if (_textMode) {
+ if (_mode == 2) _writeFile = fopen(_filename, "w+");
+ else _writeFile = fopen(_filename, "a+");
} else {
- if (m_Mode == 2) m_WriteFile = fopen(m_Filename, "wb+");
- else m_WriteFile = fopen(m_Filename, "ab+");
+ if (_mode == 2) _writeFile = fopen(_filename, "wb+");
+ else _writeFile = fopen(_filename, "ab+");
}
- if (m_WriteFile) Close();
+ if (_writeFile) Close();
}
SetPos(Pos);
}
diff --git a/engines/wintermute/scriptables/SXFile.h b/engines/wintermute/scriptables/SXFile.h
index 0ab1acb32c..085700d0e1 100644
--- a/engines/wintermute/scriptables/SXFile.h
+++ b/engines/wintermute/scriptables/SXFile.h
@@ -43,16 +43,16 @@ public:
CSXFile(CBGame *inGame, CScStack *Stack);
virtual ~CSXFile();
private:
- CBFile *m_ReadFile;
- FILE *m_WriteFile;
- int m_Mode; // 0..none, 1..read, 2..write, 3..append
- bool m_TextMode;
+ CBFile *_readFile;
+ FILE *_writeFile;
+ int _mode; // 0..none, 1..read, 2..write, 3..append
+ bool _textMode;
void Close();
void Cleanup();
uint32 GetPos();
uint32 GetLength();
bool SetPos(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN);
- char *m_Filename;
+ char *_filename;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/scriptables/SXMath.cpp b/engines/wintermute/scriptables/SXMath.cpp
index 48e722a02c..fcc85d527c 100644
--- a/engines/wintermute/scriptables/SXMath.cpp
+++ b/engines/wintermute/scriptables/SXMath.cpp
@@ -246,25 +246,25 @@ HRESULT CSXMath::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
//////////////////////////////////////////////////////////////////////////
CScValue *CSXMath::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("math");
- return m_ScValue;
+ _scValue->SetString("math");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PI
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PI") == 0) {
- m_ScValue->SetFloat(PI);
- return m_ScValue;
+ _scValue->SetFloat(PI);
+ return _scValue;
}
- else return m_ScValue;
+ else return _scValue;
}
diff --git a/engines/wintermute/scriptables/SXMemBuffer.cpp b/engines/wintermute/scriptables/SXMemBuffer.cpp
index 874aa2c9d1..6215d9c4e3 100644
--- a/engines/wintermute/scriptables/SXMemBuffer.cpp
+++ b/engines/wintermute/scriptables/SXMemBuffer.cpp
@@ -39,8 +39,8 @@ IMPLEMENT_PERSISTENT(CSXMemBuffer, false)
//////////////////////////////////////////////////////////////////////////
CSXMemBuffer::CSXMemBuffer(CBGame *inGame, CScStack *Stack): CBScriptable(inGame) {
Stack->CorrectParams(1);
- m_Buffer = NULL;
- m_Size = 0;
+ _buffer = NULL;
+ _size = 0;
int NewSize = Stack->Pop()->GetInt();
Resize(MAX(0, NewSize));
@@ -48,8 +48,8 @@ CSXMemBuffer::CSXMemBuffer(CBGame *inGame, CScStack *Stack): CBScriptable(inGame
//////////////////////////////////////////////////////////////////////////
CSXMemBuffer::CSXMemBuffer(CBGame *inGame, void *Buffer): CBScriptable(inGame) {
- m_Size = NULL;
- m_Buffer = Buffer;
+ _size = NULL;
+ _buffer = Buffer;
}
@@ -60,51 +60,51 @@ CSXMemBuffer::~CSXMemBuffer() {
//////////////////////////////////////////////////////////////////////////
void *CSXMemBuffer::ScToMemBuffer() {
- return m_Buffer;
+ return _buffer;
}
//////////////////////////////////////////////////////////////////////////
void CSXMemBuffer::Cleanup() {
- if (m_Size) free(m_Buffer);
- m_Buffer = NULL;
- m_Size = 0;
+ if (_size) free(_buffer);
+ _buffer = NULL;
+ _size = 0;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CSXMemBuffer::Resize(int NewSize) {
- int OldSize = m_Size;
+ int OldSize = _size;
- if (m_Size == 0) {
- m_Buffer = malloc(NewSize);
- if (m_Buffer) m_Size = NewSize;
+ if (_size == 0) {
+ _buffer = malloc(NewSize);
+ if (_buffer) _size = NewSize;
} else {
- void *NewBuf = realloc(m_Buffer, NewSize);
+ void *NewBuf = realloc(_buffer, NewSize);
if (!NewBuf) {
if (NewSize == 0) {
- m_Buffer = NewBuf;
- m_Size = NewSize;
+ _buffer = NewBuf;
+ _size = NewSize;
} else return E_FAIL;
} else {
- m_Buffer = NewBuf;
- m_Size = NewSize;
+ _buffer = NewBuf;
+ _size = NewSize;
}
}
- if (m_Buffer && m_Size > OldSize) {
- memset((byte *)m_Buffer + OldSize, 0, m_Size - OldSize);
+ if (_buffer && _size > OldSize) {
+ memset((byte *)_buffer + OldSize, 0, _size - OldSize);
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
bool CSXMemBuffer::CheckBounds(CScScript *Script, int Start, int Length) {
- if (m_Buffer == NULL) {
+ if (_buffer == NULL) {
Script->RuntimeError("Cannot use Set/Get methods on an uninitialized memory buffer");
return false;
}
- if (m_Size == 0) return true;
+ if (_size == 0) return true;
- if (Start < 0 || Length == 0 || Start + Length > m_Size) {
+ if (Start < 0 || Length == 0 || Start + Length > _size) {
Script->RuntimeError("Set/Get method call is out of bounds");
return false;
} else return true;
@@ -138,7 +138,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
Stack->CorrectParams(1);
int Start = Stack->Pop()->GetInt();
if (!CheckBounds(Script, Start, sizeof(bool))) Stack->PushNULL();
- else Stack->PushBool(*(bool *)((byte *)m_Buffer + Start));
+ else Stack->PushBool(*(bool *)((byte *)_buffer + Start));
return S_OK;
}
@@ -150,7 +150,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
Stack->CorrectParams(1);
int Start = Stack->Pop()->GetInt();
if (!CheckBounds(Script, Start, sizeof(byte ))) Stack->PushNULL();
- else Stack->PushInt(*(byte *)((byte *)m_Buffer + Start));
+ else Stack->PushInt(*(byte *)((byte *)_buffer + Start));
return S_OK;
}
@@ -162,7 +162,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
Stack->CorrectParams(1);
int Start = Stack->Pop()->GetInt();
if (!CheckBounds(Script, Start, sizeof(short))) Stack->PushNULL();
- else Stack->PushInt(65536 + * (short *)((byte *)m_Buffer + Start));
+ else Stack->PushInt(65536 + * (short *)((byte *)_buffer + Start));
return S_OK;
}
@@ -174,7 +174,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
Stack->CorrectParams(1);
int Start = Stack->Pop()->GetInt();
if (!CheckBounds(Script, Start, sizeof(int))) Stack->PushNULL();
- else Stack->PushInt(*(int *)((byte *)m_Buffer + Start));
+ else Stack->PushInt(*(int *)((byte *)_buffer + Start));
return S_OK;
}
@@ -186,7 +186,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
Stack->CorrectParams(1);
int Start = Stack->Pop()->GetInt();
if (!CheckBounds(Script, Start, sizeof(float))) Stack->PushNULL();
- else Stack->PushFloat(*(float *)((byte *)m_Buffer + Start));
+ else Stack->PushFloat(*(float *)((byte *)_buffer + Start));
return S_OK;
}
@@ -198,7 +198,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
Stack->CorrectParams(1);
int Start = Stack->Pop()->GetInt();
if (!CheckBounds(Script, Start, sizeof(double))) Stack->PushNULL();
- else Stack->PushFloat(*(double *)((byte *)m_Buffer + Start));
+ else Stack->PushFloat(*(double *)((byte *)_buffer + Start));
return S_OK;
}
@@ -212,9 +212,9 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
int Length = Stack->Pop()->GetInt();
// find end of string
- if (Length == 0 && Start >= 0 && Start < m_Size) {
- for (int i = Start; i < m_Size; i++) {
- if (((char *)m_Buffer)[i] == '\0') {
+ if (Length == 0 && Start >= 0 && Start < _size) {
+ for (int i = Start; i < _size; i++) {
+ if (((char *)_buffer)[i] == '\0') {
Length = i - Start;
break;
}
@@ -224,7 +224,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
if (!CheckBounds(Script, Start, Length)) Stack->PushNULL();
else {
char *Str = new char[Length + 1];
- strncpy(Str, (const char *)m_Buffer + Start, Length);
+ strncpy(Str, (const char *)_buffer + Start, Length);
Str[Length] = '\0';
Stack->PushString(Str);
delete [] Str;
@@ -240,7 +240,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
int Start = Stack->Pop()->GetInt();
if (!CheckBounds(Script, Start, sizeof(void *))) Stack->PushNULL();
else {
- void *Pointer = *(void **)((byte *)m_Buffer + Start);
+ void *Pointer = *(void **)((byte *)_buffer + Start);
CSXMemBuffer *Buf = new CSXMemBuffer(Game, Pointer);
Stack->PushNative(Buf, false);
}
@@ -257,7 +257,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
if (!CheckBounds(Script, Start, sizeof(bool))) Stack->PushBool(false);
else {
- *(bool *)((byte *)m_Buffer + Start) = Val;
+ *(bool *)((byte *)_buffer + Start) = Val;
Stack->PushBool(true);
}
return S_OK;
@@ -273,7 +273,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
if (!CheckBounds(Script, Start, sizeof(byte ))) Stack->PushBool(false);
else {
- *(byte *)((byte *)m_Buffer + Start) = Val;
+ *(byte *)((byte *)_buffer + Start) = Val;
Stack->PushBool(true);
}
return S_OK;
@@ -289,7 +289,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
if (!CheckBounds(Script, Start, sizeof(short))) Stack->PushBool(false);
else {
- *(short *)((byte *)m_Buffer + Start) = Val;
+ *(short *)((byte *)_buffer + Start) = Val;
Stack->PushBool(true);
}
return S_OK;
@@ -305,7 +305,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
if (!CheckBounds(Script, Start, sizeof(int))) Stack->PushBool(false);
else {
- *(int *)((byte *)m_Buffer + Start) = Val;
+ *(int *)((byte *)_buffer + Start) = Val;
Stack->PushBool(true);
}
return S_OK;
@@ -321,7 +321,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
if (!CheckBounds(Script, Start, sizeof(float))) Stack->PushBool(false);
else {
- *(float *)((byte *)m_Buffer + Start) = Val;
+ *(float *)((byte *)_buffer + Start) = Val;
Stack->PushBool(true);
}
return S_OK;
@@ -337,7 +337,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
if (!CheckBounds(Script, Start, sizeof(double))) Stack->PushBool(false);
else {
- *(double *)((byte *)m_Buffer + Start) = Val;
+ *(double *)((byte *)_buffer + Start) = Val;
Stack->PushBool(true);
}
return S_OK;
@@ -353,7 +353,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
if (!CheckBounds(Script, Start, strlen(Val) + 1)) Stack->PushBool(false);
else {
- memcpy((byte *)m_Buffer + Start, Val, strlen(Val) + 1);
+ memcpy((byte *)_buffer + Start, Val, strlen(Val) + 1);
Stack->PushBool(true);
}
return S_OK;
@@ -371,7 +371,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
else {
/*
int Pointer = (int)Val->GetMemBuffer();
- memcpy((byte *)m_Buffer+Start, &Pointer, sizeof(void*));
+ memcpy((byte *)_buffer+Start, &Pointer, sizeof(void*));
Stack->PushBool(true);
*/
// TODO fix
@@ -386,9 +386,9 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "DEBUG_Dump") == 0) {
Stack->CorrectParams(0);
- if (m_Buffer && m_Size) {
+ if (_buffer && _size) {
FILE *f = fopen("c:\\!!buffer.bin", "wb");
- fwrite(m_Buffer, m_Size, 1, f);
+ fwrite(_buffer, _size, 1, f);
fclose(f);
}
Stack->PushNULL();
@@ -401,22 +401,22 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack
//////////////////////////////////////////////////////////////////////////
CScValue *CSXMemBuffer::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("membuffer");
- return m_ScValue;
+ _scValue->SetString("membuffer");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Size (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Size") == 0) {
- m_ScValue->SetInt(m_Size);
- return m_ScValue;
+ _scValue->SetInt(_size);
+ return _scValue;
}
else return CBScriptable::ScGetProperty(Name);
@@ -430,14 +430,14 @@ HRESULT CSXMemBuffer::ScSetProperty(char *Name, CScValue *Value) {
// Length
//////////////////////////////////////////////////////////////////////////
if(strcmp(Name, "Length")==0){
- int OrigLength = m_Length;
- m_Length = max(Value->GetInt(0), 0);
+ int OrigLength = _length;
+ _length = max(Value->GetInt(0), 0);
char PropName[20];
- if(m_Length < OrigLength){
- for(int i=m_Length; i<OrigLength; i++){
+ if(_length < OrigLength){
+ for(int i=_length; i<OrigLength; i++){
sprintf(PropName, "%d", i);
- m_Values->DeleteProp(PropName);
+ _values->DeleteProp(PropName);
}
}
return S_OK;
@@ -451,15 +451,15 @@ HRESULT CSXMemBuffer::Persist(CBPersistMgr *PersistMgr) {
CBScriptable::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_Size));
+ PersistMgr->Transfer(TMEMBER(_size));
- if (PersistMgr->m_Saving) {
- if (m_Size > 0) PersistMgr->PutBytes((byte *)m_Buffer, m_Size);
+ if (PersistMgr->_saving) {
+ if (_size > 0) PersistMgr->PutBytes((byte *)_buffer, _size);
} else {
- if (m_Size > 0) {
- m_Buffer = malloc(m_Size);
- PersistMgr->GetBytes((byte *)m_Buffer, m_Size);
- } else m_Buffer = NULL;
+ if (_size > 0) {
+ _buffer = malloc(_size);
+ PersistMgr->GetBytes((byte *)_buffer, _size);
+ } else _buffer = NULL;
}
return S_OK;
@@ -468,7 +468,7 @@ HRESULT CSXMemBuffer::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
int CSXMemBuffer::ScCompare(CBScriptable *Val) {
- if (m_Buffer == Val->ScToMemBuffer()) return 0;
+ if (_buffer == Val->ScToMemBuffer()) return 0;
else return 1;
}
diff --git a/engines/wintermute/scriptables/SXMemBuffer.h b/engines/wintermute/scriptables/SXMemBuffer.h
index e44761b723..715d860302 100644
--- a/engines/wintermute/scriptables/SXMemBuffer.h
+++ b/engines/wintermute/scriptables/SXMemBuffer.h
@@ -46,10 +46,10 @@ public:
CSXMemBuffer(CBGame *inGame, void *Buffer);
virtual ~CSXMemBuffer();
virtual void *ScToMemBuffer();
- int m_Size;
+ int _size;
private:
HRESULT Resize(int NewSize);
- void *m_Buffer;
+ void *_buffer;
void Cleanup();
bool CheckBounds(CScScript *Script, int Start, int Length);
};
diff --git a/engines/wintermute/scriptables/SXStore.cpp b/engines/wintermute/scriptables/SXStore.cpp
index cdd62599d4..74217b9907 100644
--- a/engines/wintermute/scriptables/SXStore.cpp
+++ b/engines/wintermute/scriptables/SXStore.cpp
@@ -45,10 +45,10 @@ CSXStore::CSXStore(CBGame *inGame) : CBObject(inGame) {
StoreKit_SetExternalData((void *)this);
#endif
- m_EventsEnabled = false;
- m_LastProductRequestOwner = NULL;
- m_LastPurchaseOwner = NULL;
- m_LastRestoreOwner = NULL;
+ _eventsEnabled = false;
+ _lastProductRequestOwner = NULL;
+ _lastPurchaseOwner = NULL;
+ _lastRestoreOwner = NULL;
}
@@ -61,19 +61,19 @@ CSXStore::~CSXStore() {
void CSXStore::Cleanup() {
SetEventsEnabled(NULL, false);
- for (int i = 0; i < m_ValidProducts.GetSize(); i++) {
- delete m_ValidProducts[i];
+ for (int i = 0; i < _validProducts.GetSize(); i++) {
+ delete _validProducts[i];
}
- m_ValidProducts.RemoveAll();
+ _validProducts.RemoveAll();
- for (int i = 0; i < m_Transactions.GetSize(); i++) {
- delete m_Transactions[i];
+ for (int i = 0; i < _transactions.GetSize(); i++) {
+ delete _transactions[i];
}
- m_Transactions.RemoveAll();
+ _transactions.RemoveAll();
- m_LastProductRequestOwner = m_LastPurchaseOwner = m_LastRestoreOwner = NULL;
+ _lastProductRequestOwner = _lastPurchaseOwner = _lastRestoreOwner = NULL;
}
//////////////////////////////////////////////////////////////////////////
@@ -102,7 +102,7 @@ HRESULT CSXStore::ScCallMethod(CScScript *script, CScStack *stack, CScStack *thi
else if (strcmp(name, "ValidateProducts") == 0) {
stack->CorrectParams(1);
char *prodIdList = stack->Pop()->GetString();
- m_LastProductRequestOwner = script->m_Owner;
+ _lastProductRequestOwner = script->_owner;
ValidateProducts(prodIdList);
stack->PushNULL();
return S_OK;
@@ -113,13 +113,13 @@ HRESULT CSXStore::ScCallMethod(CScScript *script, CScStack *stack, CScStack *thi
else if (strcmp(name, "GetValidProduct") == 0) {
stack->CorrectParams(1);
int index = stack->Pop()->GetInt();
- if (index >= 0 && index < m_ValidProducts.GetSize()) {
+ if (index >= 0 && index < _validProducts.GetSize()) {
CScValue *prod = stack->GetPushValue();
if (prod) {
- prod->SetProperty("Id", m_ValidProducts[index]->GetId());
- prod->SetProperty("Name", m_ValidProducts[index]->GetName());
- prod->SetProperty("Description", m_ValidProducts[index]->GetDesc());
- prod->SetProperty("Price", m_ValidProducts[index]->GetPrice());
+ prod->SetProperty("Id", _validProducts[index]->GetId());
+ prod->SetProperty("Name", _validProducts[index]->GetName());
+ prod->SetProperty("Description", _validProducts[index]->GetDesc());
+ prod->SetProperty("Price", _validProducts[index]->GetPrice());
}
} else
stack->PushNULL();
@@ -132,8 +132,8 @@ HRESULT CSXStore::ScCallMethod(CScScript *script, CScStack *stack, CScStack *thi
else if (strcmp(name, "GetInvalidProduct") == 0) {
stack->CorrectParams(1);
int index = stack->Pop()->GetInt();
- if (index >= 0 && index < m_InvalidProducts.size())
- stack->PushString(m_InvalidProducts[index].c_str());
+ if (index >= 0 && index < _invalidProducts.size())
+ stack->PushString(_invalidProducts[index].c_str());
else
stack->PushNULL();
@@ -145,12 +145,12 @@ HRESULT CSXStore::ScCallMethod(CScScript *script, CScStack *stack, CScStack *thi
else if (strcmp(name, "GetTransaction") == 0) {
stack->CorrectParams(1);
int index = stack->Pop()->GetInt();
- if (index >= 0 && index < m_Transactions.GetSize()) {
+ if (index >= 0 && index < _transactions.GetSize()) {
CScValue *trans = stack->GetPushValue();
if (trans) {
- trans->SetProperty("Id", m_Transactions[index]->GetId());
- trans->SetProperty("ProductId", m_Transactions[index]->GetProductId());
- trans->SetProperty("State", m_Transactions[index]->GetState());
+ trans->SetProperty("Id", _transactions[index]->GetId());
+ trans->SetProperty("ProductId", _transactions[index]->GetProductId());
+ trans->SetProperty("State", _transactions[index]->GetState());
}
} else
stack->PushNULL();
@@ -195,8 +195,8 @@ HRESULT CSXStore::ScCallMethod(CScScript *script, CScStack *stack, CScStack *thi
stack->CorrectParams(1);
char *prodId = stack->Pop()->GetString();
- Game->m_Registry->WriteBool("Purchases", prodId, true);
- Game->m_Registry->SaveValues();
+ Game->_registry->WriteBool("Purchases", prodId, true);
+ Game->_registry->SaveValues();
stack->PushBool(true);
@@ -210,7 +210,7 @@ HRESULT CSXStore::ScCallMethod(CScScript *script, CScStack *stack, CScStack *thi
stack->CorrectParams(1);
char *prodId = stack->Pop()->GetString();
- stack->PushBool(Game->m_Registry->ReadBool("Purchases", prodId, false));
+ stack->PushBool(Game->_registry->ReadBool("Purchases", prodId, false));
return S_OK;
}
@@ -221,80 +221,80 @@ HRESULT CSXStore::ScCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
CScValue *CSXStore::ScGetProperty(char *name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Type") == 0) {
- m_ScValue->SetString("store");
- return m_ScValue;
+ _scValue->SetString("store");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Available (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Available") == 0) {
- m_ScValue->SetBool(IsAvailable());
- return m_ScValue;
+ _scValue->SetBool(IsAvailable());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// EventsEnabled (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "EventsEnabled") == 0) {
- m_ScValue->SetBool(GetEventsEnabled());
- return m_ScValue;
+ _scValue->SetBool(GetEventsEnabled());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumValidProducts (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumValidProducts") == 0) {
- m_ScValue->SetInt(m_ValidProducts.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_validProducts.GetSize());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumInvalidProducts (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumInvalidProducts") == 0) {
- m_ScValue->SetInt(m_InvalidProducts.size());
- return m_ScValue;
+ _scValue->SetInt(_invalidProducts.size());
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumTransactions (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumTransactions") == 0) {
- m_ScValue->SetInt(m_Transactions.GetSize());
- return m_ScValue;
+ _scValue->SetInt(_transactions.GetSize());
+ return _scValue;
}
- else return m_ScValue;
+ else return _scValue;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CSXStore::Persist(CBPersistMgr *PersistMgr) {
- if (!PersistMgr->m_Saving) Cleanup();
+ if (!PersistMgr->_saving) Cleanup();
CBObject::Persist(PersistMgr);
- PersistMgr->Transfer(TMEMBER(m_EventsEnabled));
- PersistMgr->Transfer(TMEMBER(m_LastProductRequestOwner));
- PersistMgr->Transfer(TMEMBER(m_LastPurchaseOwner));
- PersistMgr->Transfer(TMEMBER(m_LastRestoreOwner));
- PersistMgr->Transfer(TMEMBER(m_InvalidProducts));
+ PersistMgr->Transfer(TMEMBER(_eventsEnabled));
+ PersistMgr->Transfer(TMEMBER(_lastProductRequestOwner));
+ PersistMgr->Transfer(TMEMBER(_lastPurchaseOwner));
+ PersistMgr->Transfer(TMEMBER(_lastRestoreOwner));
+ PersistMgr->Transfer(TMEMBER(_invalidProducts));
// persist valid products
int numProducts;
- if (PersistMgr->m_Saving) {
- numProducts = m_ValidProducts.GetSize();
+ if (PersistMgr->_saving) {
+ numProducts = _validProducts.GetSize();
PersistMgr->Transfer(TMEMBER(numProducts));
- for (int i = 0; i < numProducts; i++) m_ValidProducts[i]->Persist(PersistMgr);
+ for (int i = 0; i < numProducts; i++) _validProducts[i]->Persist(PersistMgr);
} else {
- numProducts = m_ValidProducts.GetSize();
+ numProducts = _validProducts.GetSize();
PersistMgr->Transfer(TMEMBER(numProducts));
for (int i = 0; i < numProducts; i++) {
CBStoreProduct *prod = new CBStoreProduct;
prod->Persist(PersistMgr);
- m_ValidProducts.Add(prod);
+ _validProducts.Add(prod);
}
}
@@ -304,7 +304,7 @@ HRESULT CSXStore::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
void CSXStore::AfterLoad() {
- if (m_EventsEnabled) {
+ if (_eventsEnabled) {
SetEventsEnabled(NULL, true);
}
#ifdef __IPHONEOS__
@@ -314,22 +314,22 @@ void CSXStore::AfterLoad() {
//////////////////////////////////////////////////////////////////////////
void CSXStore::OnObjectDestroyed(CBScriptHolder *obj) {
- if (m_LastProductRequestOwner == obj) m_LastProductRequestOwner = NULL;
- if (m_LastPurchaseOwner == obj) m_LastPurchaseOwner = NULL;
- if (m_LastRestoreOwner == obj) m_LastRestoreOwner = NULL;
+ if (_lastProductRequestOwner == obj) _lastProductRequestOwner = NULL;
+ if (_lastPurchaseOwner == obj) _lastPurchaseOwner = NULL;
+ if (_lastRestoreOwner == obj) _lastRestoreOwner = NULL;
}
//////////////////////////////////////////////////////////////////////////
void CSXStore::SetEventsEnabled(CScScript *script, bool val) {
- m_EventsEnabled = val;
+ _eventsEnabled = val;
if (val) {
- if (script) m_LastPurchaseOwner = script->m_Owner;
+ if (script) _lastPurchaseOwner = script->_owner;
#ifdef __IPHONEOS__
StoreKit_EnableEvents();
#endif
} else {
- m_LastPurchaseOwner = NULL;
+ _lastPurchaseOwner = NULL;
#ifdef __IPHONEOS__
StoreKit_DisableEvents();
#endif
@@ -354,48 +354,48 @@ bool CSXStore::IsAvailable() {
//////////////////////////////////////////////////////////////////////////
void CSXStore::ReceiveProductsStart() {
- for (int i = 0; i < m_ValidProducts.GetSize(); i++) {
- delete m_ValidProducts[i];
+ for (int i = 0; i < _validProducts.GetSize(); i++) {
+ delete _validProducts[i];
}
- m_ValidProducts.RemoveAll();
+ _validProducts.RemoveAll();
- m_InvalidProducts.clear();
+ _invalidProducts.clear();
}
//////////////////////////////////////////////////////////////////////////
void CSXStore::ReceiveProductsEnd() {
- if (m_LastProductRequestOwner) m_LastProductRequestOwner->ApplyEvent("ProductsValidated");
+ if (_lastProductRequestOwner) _lastProductRequestOwner->ApplyEvent("ProductsValidated");
}
//////////////////////////////////////////////////////////////////////////
void CSXStore::AddValidProduct(const char *id, const char *name, const char *desc, const char *price) {
CBStoreProduct *prod = new CBStoreProduct(id, name, desc, price);
- m_ValidProducts.Add(prod);
+ _validProducts.Add(prod);
}
//////////////////////////////////////////////////////////////////////////
void CSXStore::AddInvalidProduct(const char *id) {
- m_InvalidProducts.push_back(id);
+ _invalidProducts.push_back(id);
}
//////////////////////////////////////////////////////////////////////////
void CSXStore::ReceiveTransactionsStart() {
- for (int i = 0; i < m_Transactions.GetSize(); i++) {
- delete m_Transactions[i];
+ for (int i = 0; i < _transactions.GetSize(); i++) {
+ delete _transactions[i];
}
- m_Transactions.RemoveAll();
+ _transactions.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
void CSXStore::ReceiveTransactionsEnd() {
- if (m_LastPurchaseOwner) m_LastPurchaseOwner->ApplyEvent("TransactionsUpdated");
+ if (_lastPurchaseOwner) _lastPurchaseOwner->ApplyEvent("TransactionsUpdated");
else Game->ApplyEvent("TransactionsUpdated");
}
//////////////////////////////////////////////////////////////////////////
void CSXStore::AddTransaction(const char *id, const char *productId, const char *state) {
CBStoreTransaction *trans = new CBStoreTransaction(id, productId, state);
- m_Transactions.Add(trans);
+ _transactions.Add(trans);
}
//////////////////////////////////////////////////////////////////////////
@@ -403,9 +403,9 @@ bool CSXStore::Purchase(CScScript *script, const char *productId) {
if (!productId) return false;
#ifdef __IPHONEOS__
- for (int i = 0; i < m_ValidProducts.GetSize(); i++) {
- if (strcmp(productId, m_ValidProducts[i]->GetId()) == 0) {
- m_LastPurchaseOwner = script->m_Owner;
+ for (int i = 0; i < _validProducts.GetSize(); i++) {
+ if (strcmp(productId, _validProducts[i]->GetId()) == 0) {
+ _lastPurchaseOwner = script->_owner;
StoreKit_Purchase(productId);
return true;
@@ -420,11 +420,11 @@ bool CSXStore::Purchase(CScScript *script, const char *productId) {
bool CSXStore::FinishTransaction(CScScript *script, const char *transId) {
if (!transId) return false;
#ifdef __IPHONEOS__
- for (int i = 0; i < m_Transactions.GetSize(); i++) {
- if (strcmp(transId, m_Transactions[i]->GetId()) == 0) {
+ for (int i = 0; i < _transactions.GetSize(); i++) {
+ if (strcmp(transId, _transactions[i]->GetId()) == 0) {
if (StoreKit_FinishTransaction(transId) > 0) {
- SAFE_DELETE(m_Transactions[i]);
- m_Transactions.RemoveAt(i);
+ SAFE_DELETE(_transactions[i]);
+ _transactions.RemoveAt(i);
return true;
} else return false;
}
@@ -436,7 +436,7 @@ bool CSXStore::FinishTransaction(CScScript *script, const char *transId) {
//////////////////////////////////////////////////////////////////////////
void CSXStore::RestoreTransactions(CScScript *script) {
- m_LastRestoreOwner = script->m_Owner;
+ _lastRestoreOwner = script->_owner;
#ifdef __IPHONEOS__
StoreKit_RestoreTransactions();
#endif
@@ -444,9 +444,9 @@ void CSXStore::RestoreTransactions(CScScript *script) {
//////////////////////////////////////////////////////////////////////////
void CSXStore::OnRestoreFinished(bool error) {
- if (m_LastRestoreOwner) {
- if (error) m_LastRestoreOwner->ApplyEvent("TransactionsRestoreFailed");
- else m_LastRestoreOwner->ApplyEvent("TransactionsRestoreFinished");
+ if (_lastRestoreOwner) {
+ if (error) _lastRestoreOwner->ApplyEvent("TransactionsRestoreFailed");
+ else _lastRestoreOwner->ApplyEvent("TransactionsRestoreFinished");
}
}
diff --git a/engines/wintermute/scriptables/SXStore.h b/engines/wintermute/scriptables/SXStore.h
index f6a13e9eeb..dd11416a0f 100644
--- a/engines/wintermute/scriptables/SXStore.h
+++ b/engines/wintermute/scriptables/SXStore.h
@@ -38,88 +38,88 @@ public:
class CBStoreProduct {
public:
CBStoreProduct() {
- m_Id = m_Name = m_Desc = m_Price = NULL;
+ _id = _name = _desc = _price = NULL;
}
CBStoreProduct(const char *id, const char *name, const char *desc, const char *price) {
- m_Id = m_Name = m_Desc = m_Price = NULL;
+ _id = _name = _desc = _price = NULL;
- CBUtils::SetString(&m_Id, id);
- CBUtils::SetString(&m_Name, name);
- CBUtils::SetString(&m_Desc, desc);
- CBUtils::SetString(&m_Price, price);
+ CBUtils::SetString(&_id, id);
+ CBUtils::SetString(&_name, name);
+ CBUtils::SetString(&_desc, desc);
+ CBUtils::SetString(&_price, price);
}
~CBStoreProduct() {
- delete [] m_Id;
- delete [] m_Name;
- delete [] m_Desc;
- delete [] m_Price;
+ delete [] _id;
+ delete [] _name;
+ delete [] _desc;
+ delete [] _price;
}
HRESULT Persist(CBPersistMgr *PersistMgr) {
- PersistMgr->Transfer(TMEMBER(m_Id));
- PersistMgr->Transfer(TMEMBER(m_Name));
- PersistMgr->Transfer(TMEMBER(m_Desc));
- PersistMgr->Transfer(TMEMBER(m_Price));
+ PersistMgr->Transfer(TMEMBER(_id));
+ PersistMgr->Transfer(TMEMBER(_name));
+ PersistMgr->Transfer(TMEMBER(_desc));
+ PersistMgr->Transfer(TMEMBER(_price));
return S_OK;
}
const char *GetId() {
- return m_Id;
+ return _id;
}
const char *GetName() {
- return m_Name;
+ return _name;
}
const char *GetDesc() {
- return m_Desc;
+ return _desc;
}
const char *GetPrice() {
- return m_Price;
+ return _price;
}
private:
- char *m_Id;
- char *m_Name;
- char *m_Desc;
- char *m_Price;
+ char *_id;
+ char *_name;
+ char *_desc;
+ char *_price;
};
//////////////////////////////////////////////////////////////////////////
class CBStoreTransaction {
public:
CBStoreTransaction() {
- m_Id = m_ProductId = m_State = NULL;
+ _id = _productId = _state = NULL;
}
CBStoreTransaction(const char *id, const char *productId, const char *state) {
- m_Id = m_ProductId = m_State = NULL;
+ _id = _productId = _state = NULL;
- CBUtils::SetString(&m_Id, id);
- CBUtils::SetString(&m_ProductId, productId);
- CBUtils::SetString(&m_State, state);
+ CBUtils::SetString(&_id, id);
+ CBUtils::SetString(&_productId, productId);
+ CBUtils::SetString(&_state, state);
}
~CBStoreTransaction() {
- delete [] m_Id;
- delete [] m_ProductId;
- delete [] m_State;
+ delete [] _id;
+ delete [] _productId;
+ delete [] _state;
}
const char *GetId() {
- return m_Id;
+ return _id;
}
const char *GetProductId() {
- return m_ProductId;
+ return _productId;
}
const char *GetState() {
- return m_State;
+ return _state;
}
private:
- char *m_Id;
- char *m_ProductId;
- char *m_State;
+ char *_id;
+ char *_productId;
+ char *_state;
};
@@ -135,7 +135,7 @@ public:
bool IsAvailable();
void SetEventsEnabled(CScScript *script, bool val);
bool GetEventsEnabled() const {
- return m_EventsEnabled;
+ return _eventsEnabled;
}
void ValidateProducts(const char *prodIdList);
@@ -156,14 +156,14 @@ private:
bool FinishTransaction(CScScript *script, const char *transId);
void RestoreTransactions(CScScript *script);
- bool m_EventsEnabled;
- CBArray<CBStoreProduct *, CBStoreProduct *> m_ValidProducts;
- AnsiStringArray m_InvalidProducts;
- CBScriptHolder *m_LastProductRequestOwner;
- CBScriptHolder *m_LastPurchaseOwner;
- CBScriptHolder *m_LastRestoreOwner;
+ bool _eventsEnabled;
+ CBArray<CBStoreProduct *, CBStoreProduct *> _validProducts;
+ AnsiStringArray _invalidProducts;
+ CBScriptHolder *_lastProductRequestOwner;
+ CBScriptHolder *_lastPurchaseOwner;
+ CBScriptHolder *_lastRestoreOwner;
- CBArray<CBStoreTransaction *, CBStoreTransaction *> m_Transactions;
+ CBArray<CBStoreTransaction *, CBStoreTransaction *> _transactions;
};
diff --git a/engines/wintermute/scriptables/SXString.cpp b/engines/wintermute/scriptables/SXString.cpp
index 0e4daf02aa..4c9f4db146 100644
--- a/engines/wintermute/scriptables/SXString.cpp
+++ b/engines/wintermute/scriptables/SXString.cpp
@@ -104,7 +104,7 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//try {
WideString str;
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
str = StringUtil::Utf8ToWide(_string);
else
str = StringUtil::AnsiToWide(_string);
@@ -112,7 +112,7 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//WideString subStr = str.substr(start, end - start + 1);
WideString subStr(str.c_str() + start, end - start + 1);
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
Stack->PushString(StringUtil::WideToUtf8(subStr).c_str());
else
Stack->PushString(StringUtil::WideToAnsi(subStr).c_str());
@@ -142,7 +142,7 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
// try {
WideString str;
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
str = StringUtil::Utf8ToWide(_string);
else
str = StringUtil::AnsiToWide(_string);
@@ -150,7 +150,7 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
// WideString subStr = str.substr(start, len);
WideString subStr(str.c_str() + start, len);
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
Stack->PushString(StringUtil::WideToUtf8(subStr).c_str());
else
Stack->PushString(StringUtil::WideToAnsi(subStr).c_str());
@@ -168,14 +168,14 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
Stack->CorrectParams(0);
WideString str;
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
str = StringUtil::Utf8ToWide(_string);
else
str = StringUtil::AnsiToWide(_string);
StringUtil::ToUpperCase(str);
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
Stack->PushString(StringUtil::WideToUtf8(str).c_str());
else
Stack->PushString(StringUtil::WideToAnsi(str).c_str());
@@ -190,14 +190,14 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
Stack->CorrectParams(0);
WideString str;
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
str = StringUtil::Utf8ToWide(_string);
else
str = StringUtil::AnsiToWide(_string);
StringUtil::ToLowerCase(str);
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
Stack->PushString(StringUtil::WideToUtf8(str).c_str());
else
Stack->PushString(StringUtil::WideToAnsi(str).c_str());
@@ -215,13 +215,13 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
int index = Stack->Pop()->GetInt();
WideString str;
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
str = StringUtil::Utf8ToWide(_string);
else
str = StringUtil::AnsiToWide(_string);
WideString toFind;
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
toFind = StringUtil::Utf8ToWide(strToFind);
else
toFind = StringUtil::AnsiToWide(strToFind);
@@ -249,13 +249,13 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
WideString str;
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
str = StringUtil::Utf8ToWide(_string);
else
str = StringUtil::AnsiToWide(_string);
WideString delims;
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
delims = StringUtil::Utf8ToWide(Separators);
else
delims = StringUtil::AnsiToWide(Separators);
@@ -285,7 +285,7 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
for (Common::Array<WideString>::iterator it = parts.begin(); it != parts.end(); ++it) {
WideString &part = (*it);
- if (Game->m_TextEncoding == TEXT_UTF8)
+ if (Game->_textEncoding == TEXT_UTF8)
Val = new CScValue(Game, StringUtil::WideToUtf8(part).c_str());
else
Val = new CScValue(Game, StringUtil::WideToAnsi(part).c_str());
@@ -305,36 +305,36 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
CScValue *CSXString::ScGetProperty(char *Name) {
- m_ScValue->SetNULL();
+ _scValue->SetNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "Type") == 0) {
- m_ScValue->SetString("string");
- return m_ScValue;
+ _scValue->SetString("string");
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Length (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Length") == 0) {
- if (Game->m_TextEncoding == TEXT_UTF8) {
+ if (Game->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::Utf8ToWide(_string);
- m_ScValue->SetInt(wstr.size());
+ _scValue->SetInt(wstr.size());
} else
- m_ScValue->SetInt(strlen(_string));
+ _scValue->SetInt(strlen(_string));
- return m_ScValue;
+ return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Capacity
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Capacity") == 0) {
- m_ScValue->SetInt(_capacity);
- return m_ScValue;
+ _scValue->SetInt(_capacity);
+ return _scValue;
}
- else return m_ScValue;
+ else return _scValue;
}
@@ -370,7 +370,7 @@ HRESULT CSXString::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(_capacity));
- if (PersistMgr->m_Saving) {
+ if (PersistMgr->_saving) {
if (_capacity > 0) PersistMgr->PutBytes((byte *)_string, _capacity);
} else {
if (_capacity > 0) {
diff --git a/engines/wintermute/scriptables/ScEngine.cpp b/engines/wintermute/scriptables/ScEngine.cpp
index 24272766c2..20716cfd04 100644
--- a/engines/wintermute/scriptables/ScEngine.cpp
+++ b/engines/wintermute/scriptables/ScEngine.cpp
@@ -54,31 +54,31 @@ CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) {
char CompilerPath[MAX_PATH];
strcpy(CompilerPath, COMPILER_DLL);
- m_CompilerDLL = ::LoadLibrary(CompilerPath);
- if (m_CompilerDLL == NULL) {
+ _compilerDLL = ::LoadLibrary(CompilerPath);
+ if (_compilerDLL == NULL) {
char ModuleName[MAX_PATH];
::GetModuleFileName(NULL, ModuleName, MAX_PATH);
// switch to exe's dir
char *ExeDir = CBUtils::GetPath(ModuleName);
sprintf(CompilerPath, "%s%s", ExeDir, COMPILER_DLL);
- m_CompilerDLL = ::LoadLibrary(CompilerPath);
+ _compilerDLL = ::LoadLibrary(CompilerPath);
delete [] ExeDir;
}
- if (m_CompilerDLL != NULL) {
+ if (_compilerDLL != NULL) {
// bind compiler's functionality
- ExtCompileBuffer = (DLL_COMPILE_BUFFER) ::GetProcAddress(m_CompilerDLL, "CompileBuffer");
- ExtCompileFile = (DLL_COMPILE_FILE) ::GetProcAddress(m_CompilerDLL, "CompileFile");
- ExtReleaseBuffer = (DLL_RELEASE_BUFFER) ::GetProcAddress(m_CompilerDLL, "ReleaseBuffer");
- ExtSetCallbacks = (DLL_SET_CALLBACKS) ::GetProcAddress(m_CompilerDLL, "SetCallbacks");
- ExtDefineFunction = (DLL_DEFINE_FUNCTION)::GetProcAddress(m_CompilerDLL, "DefineFunction");
- ExtDefineVariable = (DLL_DEFINE_VARIABLE)::GetProcAddress(m_CompilerDLL, "DefineVariable");
+ ExtCompileBuffer = (DLL_COMPILE_BUFFER) ::GetProcAddress(_compilerDLL, "CompileBuffer");
+ ExtCompileFile = (DLL_COMPILE_FILE) ::GetProcAddress(_compilerDLL, "CompileFile");
+ ExtReleaseBuffer = (DLL_RELEASE_BUFFER) ::GetProcAddress(_compilerDLL, "ReleaseBuffer");
+ ExtSetCallbacks = (DLL_SET_CALLBACKS) ::GetProcAddress(_compilerDLL, "SetCallbacks");
+ ExtDefineFunction = (DLL_DEFINE_FUNCTION)::GetProcAddress(_compilerDLL, "DefineFunction");
+ ExtDefineVariable = (DLL_DEFINE_VARIABLE)::GetProcAddress(_compilerDLL, "DefineVariable");
if (!ExtCompileBuffer || !ExtCompileFile || !ExtReleaseBuffer || !ExtSetCallbacks || !ExtDefineFunction || !ExtDefineVariable) {
- m_CompilerAvailable = false;
- ::FreeLibrary(m_CompilerDLL);
- m_CompilerDLL = NULL;
+ _compilerAvailable = false;
+ ::FreeLibrary(_compilerDLL);
+ _compilerDLL = NULL;
} else {
/*
// publish external methods to the compiler
@@ -89,50 +89,50 @@ CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) {
ExtSetCallbacks(&c, Game);
*/
- m_CompilerAvailable = true;
+ _compilerAvailable = true;
}
- } else m_CompilerAvailable = false;
+ } else _compilerAvailable = false;
#else
- m_CompilerAvailable = false;
- m_CompilerDLL = NULL;
+ _compilerAvailable = false;
+ _compilerDLL = NULL;
#endif
- if (m_CompilerAvailable) Game->LOG(0, " Script compiler bound successfuly");
+ if (_compilerAvailable) Game->LOG(0, " Script compiler bound successfuly");
else Game->LOG(0, " Script compiler is NOT available");
- m_Globals = new CScValue(Game);
+ _globals = new CScValue(Game);
// register 'Game' as global variable
- if (!m_Globals->PropExists("Game")) {
+ if (!_globals->PropExists("Game")) {
CScValue val(Game);
val.SetNative(Game, true);
- m_Globals->SetProp("Game", &val);
+ _globals->SetProp("Game", &val);
}
// register 'Math' as global variable
- if (!m_Globals->PropExists("Math")) {
+ if (!_globals->PropExists("Math")) {
CScValue val(Game);
- val.SetNative(Game->m_MathClass, true);
- m_Globals->SetProp("Math", &val);
+ val.SetNative(Game->_mathClass, true);
+ _globals->SetProp("Math", &val);
}
// prepare script cache
- for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) m_CachedScripts[i] = NULL;
+ for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) _cachedScripts[i] = NULL;
- m_CurrentScript = NULL;
+ _currentScript = NULL;
- m_FileToCompile = NULL;
+ _fileToCompile = NULL;
- m_CompileErrorCallback = NULL;
- m_CompileErrorCallbackData = NULL;
+ _compileErrorCallback = NULL;
+ _compileErrorCallbackData = NULL;
- m_ParseElementCallback = NULL;
- m_ParseElementCallbackData = NULL;
+ _parseElementCallback = NULL;
+ _parseElementCallbackData = NULL;
- m_IsProfiling = false;
- m_ProfilingStartTime = 0;
+ _isProfiling = false;
+ _profilingStartTime = 0;
//EnableProfiling();
}
@@ -145,44 +145,44 @@ CScEngine::~CScEngine() {
DisableProfiling();
#ifdef __WIN32__
- if (m_CompilerAvailable && m_CompilerDLL) ::FreeLibrary(m_CompilerDLL);
+ if (_compilerAvailable && _compilerDLL) ::FreeLibrary(_compilerDLL);
#endif
Cleanup();
- for (int i = 0; i < m_Breakpoints.GetSize(); i++) {
- delete m_Breakpoints[i];
- m_Breakpoints[i] = NULL;
+ for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ delete _breakpoints[i];
+ _breakpoints[i] = NULL;
}
- m_Breakpoints.RemoveAll();
+ _breakpoints.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::Cleanup() {
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (!m_Scripts[i]->m_Thread && m_Scripts[i]->m_Owner) m_Scripts[i]->m_Owner->RemoveScript(m_Scripts[i]);
- delete m_Scripts[i];
- m_Scripts.RemoveAt(i);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (!_scripts[i]->_thread && _scripts[i]->_owner) _scripts[i]->_owner->RemoveScript(_scripts[i]);
+ delete _scripts[i];
+ _scripts.RemoveAt(i);
i--;
}
- m_Scripts.RemoveAll();
+ _scripts.RemoveAll();
- delete m_Globals;
- m_Globals = NULL;
+ delete _globals;
+ _globals = NULL;
EmptyScriptCache();
- m_CurrentScript = NULL; // ref only
+ _currentScript = NULL; // ref only
- delete[] m_FileToCompile;
- m_FileToCompile = NULL;
+ delete[] _fileToCompile;
+ _fileToCompile = NULL;
- m_CompileErrorCallback = NULL;
- m_CompileErrorCallbackData = NULL;
+ _compileErrorCallback = NULL;
+ _compileErrorCallbackData = NULL;
- m_ParseElementCallback = NULL;
- m_ParseElementCallbackData = NULL;
+ _parseElementCallback = NULL;
+ _parseElementCallbackData = NULL;
return S_OK;
}
@@ -191,7 +191,7 @@ HRESULT CScEngine::Cleanup() {
//////////////////////////////////////////////////////////////////////////
byte *WINAPI CScEngine::LoadFile(void *Data, char *Filename, uint32 *Size) {
CBGame *Game = (CBGame *)Data;
- return Game->m_FileManager->ReadWholeFile(Filename, Size);
+ return Game->_fileManager->ReadWholeFile(Filename, Size);
}
@@ -205,14 +205,14 @@ void WINAPI CScEngine::AddError(void *Data, int Line, char *Text) {
CBGame *Game = (CBGame *)Data;
if (Game) {
- if (Game->m_ScEngine && Game->m_ScEngine->m_FileToCompile)
- Game->LOG(0, "Compiling script '%s'...", Game->m_ScEngine->m_FileToCompile);
+ if (Game->_scEngine && Game->_scEngine->_fileToCompile)
+ Game->LOG(0, "Compiling script '%s'...", Game->_scEngine->_fileToCompile);
Game->LOG(0, " Error@line %d: %s", Line, Text);
// redirect to an engine's own callback
- if (Game->m_ScEngine && Game->m_ScEngine->m_CompileErrorCallback) {
- Game->m_ScEngine->m_CompileErrorCallback(Line, Text, Game->m_ScEngine->m_CompileErrorCallbackData);
+ if (Game->_scEngine && Game->_scEngine->_compileErrorCallback) {
+ Game->_scEngine->_compileErrorCallback(Line, Text, Game->_scEngine->_compileErrorCallbackData);
}
}
}
@@ -224,8 +224,8 @@ void WINAPI CScEngine::ParseElement(void *Data, int Line, int Type, void *Elemen
if (Game) {
// redirect to an engine's own callback
- if (Game->m_ScEngine && Game->m_ScEngine->m_ParseElementCallback) {
- Game->m_ScEngine->m_ParseElementCallback(Line, Type, ElementData, Game->m_ScEngine->m_CompileErrorCallbackData);
+ if (Game->_scEngine && Game->_scEngine->_parseElementCallback) {
+ Game->_scEngine->_parseElementCallback(Line, Type, ElementData, Game->_scEngine->_compileErrorCallbackData);
}
}
}
@@ -253,10 +253,10 @@ CScScript *CScEngine::RunScript(char *Filename, CBScriptHolder *Owner) {
if (Owner)val.SetNative(Owner, true);
else val.SetNULL();
- script->m_Globals->SetProp("self", &val);
- script->m_Globals->SetProp("this", &val);
+ script->_globals->SetProp("self", &val);
+ script->_globals->SetProp("this", &val);
- m_Scripts.Add(script);
+ _scripts.Add(script);
Game->GetDebugMgr()->OnScriptInit(script);
return script;
@@ -271,10 +271,10 @@ byte *CScEngine::GetCompiledScript(char *Filename, uint32 *OutSize, bool IgnoreC
// is script in cache?
if (!IgnoreCache) {
for (i = 0; i < MAX_CACHED_SCRIPTS; i++) {
- if (m_CachedScripts[i] && scumm_stricmp(m_CachedScripts[i]->m_Filename, Filename) == 0) {
- m_CachedScripts[i]->m_Timestamp = CBPlatform::GetTime();
- *OutSize = m_CachedScripts[i]->m_Size;
- return m_CachedScripts[i]->m_Buffer;
+ if (_cachedScripts[i] && scumm_stricmp(_cachedScripts[i]->_filename, Filename) == 0) {
+ _cachedScripts[i]->_timestamp = CBPlatform::GetTime();
+ *OutSize = _cachedScripts[i]->_size;
+ return _cachedScripts[i]->_buffer;
}
}
}
@@ -286,7 +286,7 @@ byte *CScEngine::GetCompiledScript(char *Filename, uint32 *OutSize, bool IgnoreC
uint32 Size;
- byte *Buffer = Game->m_FileManager->ReadWholeFile(Filename, &Size);
+ byte *Buffer = Game->_fileManager->ReadWholeFile(Filename, &Size);
if (!Buffer) {
Game->LOG(0, "CScEngine::GetCompiledScript - error opening script '%s'", Filename);
return NULL;
@@ -297,7 +297,7 @@ byte *CScEngine::GetCompiledScript(char *Filename, uint32 *OutSize, bool IgnoreC
CompBuffer = Buffer;
CompSize = Size;
} else {
- if (!m_CompilerAvailable) {
+ if (!_compilerAvailable) {
Game->LOG(0, "CScEngine::GetCompiledScript - script '%s' needs to be compiled but compiler is not available", Filename);
delete [] Buffer;
return NULL;
@@ -333,20 +333,20 @@ byte *CScEngine::GetCompiledScript(char *Filename, uint32 *OutSize, bool IgnoreC
int index;
uint32 MinTime = CBPlatform::GetTime();
for (i = 0; i < MAX_CACHED_SCRIPTS; i++) {
- if (m_CachedScripts[i] == NULL) {
+ if (_cachedScripts[i] == NULL) {
index = i;
break;
- } else if (m_CachedScripts[i]->m_Timestamp <= MinTime) {
- MinTime = m_CachedScripts[i]->m_Timestamp;
+ } else if (_cachedScripts[i]->_timestamp <= MinTime) {
+ MinTime = _cachedScripts[i]->_timestamp;
index = i;
}
}
- if (m_CachedScripts[index] != NULL) delete m_CachedScripts[index];
- m_CachedScripts[index] = CachedScript;
+ if (_cachedScripts[index] != NULL) delete _cachedScripts[index];
+ _cachedScripts[index] = CachedScript;
- ret = CachedScript->m_Buffer;
- *OutSize = CachedScript->m_Size;
+ ret = CachedScript->_buffer;
+ *OutSize = CachedScript->_size;
}
@@ -363,55 +363,55 @@ byte *CScEngine::GetCompiledScript(char *Filename, uint32 *OutSize, bool IgnoreC
HRESULT CScEngine::Tick() {
int i;
- if (m_Scripts.GetSize() == 0) return S_OK;
+ if (_scripts.GetSize() == 0) return S_OK;
// resolve waiting scripts
- for (i = 0; i < m_Scripts.GetSize(); i++) {
+ for (i = 0; i < _scripts.GetSize(); i++) {
- switch (m_Scripts[i]->m_State) {
+ switch (_scripts[i]->_state) {
case SCRIPT_WAITING: {
/*
bool obj_found=false;
- for(int j=0; j<Game->m_RegObjects.GetSize(); j++)
+ for(int j=0; j<Game->_regObjects.GetSize(); j++)
{
- if(Game->m_RegObjects[j] == m_Scripts[i]->m_WaitObject)
+ if(Game->_regObjects[j] == _scripts[i]->_waitObject)
{
- if(Game->m_RegObjects[j]->IsReady()) m_Scripts[i]->Run();
+ if(Game->_regObjects[j]->IsReady()) _scripts[i]->Run();
obj_found = true;
break;
}
}
- if(!obj_found) m_Scripts[i]->Finish(); // m_WaitObject no longer exists
+ if(!obj_found) _scripts[i]->Finish(); // _waitObject no longer exists
*/
- if (Game->ValidObject(m_Scripts[i]->m_WaitObject)) {
- if (m_Scripts[i]->m_WaitObject->IsReady()) m_Scripts[i]->Run();
- } else m_Scripts[i]->Finish();
+ if (Game->ValidObject(_scripts[i]->_waitObject)) {
+ if (_scripts[i]->_waitObject->IsReady()) _scripts[i]->Run();
+ } else _scripts[i]->Finish();
break;
}
case SCRIPT_SLEEPING: {
- if (m_Scripts[i]->m_WaitFrozen) {
- if (m_Scripts[i]->m_WaitTime <= CBPlatform::GetTime()) m_Scripts[i]->Run();
+ if (_scripts[i]->_waitFrozen) {
+ if (_scripts[i]->_waitTime <= CBPlatform::GetTime()) _scripts[i]->Run();
} else {
- if (m_Scripts[i]->m_WaitTime <= Game->m_Timer) m_Scripts[i]->Run();
+ if (_scripts[i]->_waitTime <= Game->_timer) _scripts[i]->Run();
}
break;
}
case SCRIPT_WAITING_SCRIPT: {
- if (!IsValidScript(m_Scripts[i]->m_WaitScript) || m_Scripts[i]->m_WaitScript->m_State == SCRIPT_ERROR) {
+ if (!IsValidScript(_scripts[i]->_waitScript) || _scripts[i]->_waitScript->_state == SCRIPT_ERROR) {
// fake return value
- m_Scripts[i]->m_Stack->PushNULL();
- m_Scripts[i]->m_WaitScript = NULL;
- m_Scripts[i]->Run();
+ _scripts[i]->_stack->PushNULL();
+ _scripts[i]->_waitScript = NULL;
+ _scripts[i]->Run();
} else {
- if (m_Scripts[i]->m_WaitScript->m_State == SCRIPT_THREAD_FINISHED) {
+ if (_scripts[i]->_waitScript->_state == SCRIPT_THREAD_FINISHED) {
// copy return value
- m_Scripts[i]->m_Stack->Push(m_Scripts[i]->m_WaitScript->m_Stack->Pop());
- m_Scripts[i]->Run();
- m_Scripts[i]->m_WaitScript->Finish();
- m_Scripts[i]->m_WaitScript = NULL;
+ _scripts[i]->_stack->Push(_scripts[i]->_waitScript->_stack->Pop());
+ _scripts[i]->Run();
+ _scripts[i]->_waitScript->Finish();
+ _scripts[i]->_waitScript = NULL;
}
}
break;
@@ -421,34 +421,34 @@ HRESULT CScEngine::Tick() {
// execute scripts
- for (i = 0; i < m_Scripts.GetSize(); i++) {
+ for (i = 0; i < _scripts.GetSize(); i++) {
// skip paused scripts
- if (m_Scripts[i]->m_State == SCRIPT_PAUSED) continue;
+ if (_scripts[i]->_state == SCRIPT_PAUSED) continue;
// time sliced script
- if (m_Scripts[i]->m_TimeSlice > 0) {
+ if (_scripts[i]->_timeSlice > 0) {
uint32 StartTime = CBPlatform::GetTime();
- while (m_Scripts[i]->m_State == SCRIPT_RUNNING && CBPlatform::GetTime() - StartTime < m_Scripts[i]->m_TimeSlice) {
- m_CurrentScript = m_Scripts[i];
- m_Scripts[i]->ExecuteInstruction();
+ while (_scripts[i]->_state == SCRIPT_RUNNING && CBPlatform::GetTime() - StartTime < _scripts[i]->_timeSlice) {
+ _currentScript = _scripts[i];
+ _scripts[i]->ExecuteInstruction();
}
- if (m_IsProfiling && m_Scripts[i]->m_Filename) AddScriptTime(m_Scripts[i]->m_Filename, CBPlatform::GetTime() - StartTime);
+ if (_isProfiling && _scripts[i]->_filename) AddScriptTime(_scripts[i]->_filename, CBPlatform::GetTime() - StartTime);
}
// normal script
else {
uint32 StartTime;
- bool isProfiling = m_IsProfiling;
+ bool isProfiling = _isProfiling;
if (isProfiling) StartTime = CBPlatform::GetTime();
- while (m_Scripts[i]->m_State == SCRIPT_RUNNING) {
- m_CurrentScript = m_Scripts[i];
- m_Scripts[i]->ExecuteInstruction();
+ while (_scripts[i]->_state == SCRIPT_RUNNING) {
+ _currentScript = _scripts[i];
+ _scripts[i]->ExecuteInstruction();
}
- if (isProfiling && m_Scripts[i]->m_Filename) AddScriptTime(m_Scripts[i]->m_Filename, CBPlatform::GetTime() - StartTime);
+ if (isProfiling && _scripts[i]->_filename) AddScriptTime(_scripts[i]->_filename, CBPlatform::GetTime() - StartTime);
}
- m_CurrentScript = NULL;
+ _currentScript = NULL;
}
RemoveFinishedScripts();
@@ -460,15 +460,15 @@ HRESULT CScEngine::Tick() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::TickUnbreakable() {
// execute unbreakable scripts
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (!m_Scripts[i]->m_Unbreakable) continue;
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (!_scripts[i]->_unbreakable) continue;
- while (m_Scripts[i]->m_State == SCRIPT_RUNNING) {
- m_CurrentScript = m_Scripts[i];
- m_Scripts[i]->ExecuteInstruction();
+ while (_scripts[i]->_state == SCRIPT_RUNNING) {
+ _currentScript = _scripts[i];
+ _scripts[i]->ExecuteInstruction();
}
- m_Scripts[i]->Finish();
- m_CurrentScript = NULL;
+ _scripts[i]->Finish();
+ _currentScript = NULL;
}
RemoveFinishedScripts();
@@ -479,12 +479,12 @@ HRESULT CScEngine::TickUnbreakable() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::RemoveFinishedScripts() {
// remove finished scripts
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i]->m_State == SCRIPT_FINISHED || m_Scripts[i]->m_State == SCRIPT_ERROR) {
- if (!m_Scripts[i]->m_Thread && m_Scripts[i]->m_Owner) m_Scripts[i]->m_Owner->RemoveScript(m_Scripts[i]);
- Game->GetDebugMgr()->OnScriptShutdown(m_Scripts[i]);
- delete m_Scripts[i];
- m_Scripts.RemoveAt(i);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i]->_state == SCRIPT_FINISHED || _scripts[i]->_state == SCRIPT_ERROR) {
+ if (!_scripts[i]->_thread && _scripts[i]->_owner) _scripts[i]->_owner->RemoveScript(_scripts[i]);
+ Game->GetDebugMgr()->OnScriptShutdown(_scripts[i]);
+ delete _scripts[i];
+ _scripts.RemoveAt(i);
i--;
}
}
@@ -496,9 +496,9 @@ HRESULT CScEngine::RemoveFinishedScripts() {
int CScEngine::GetNumScripts(int *Running, int *Waiting, int *Persistent) {
int running = 0, waiting = 0, persistent = 0, total = 0;
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i]->m_State == SCRIPT_FINISHED) continue;
- switch (m_Scripts[i]->m_State) {
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i]->_state == SCRIPT_FINISHED) continue;
+ switch (_scripts[i]->_state) {
case SCRIPT_RUNNING:
case SCRIPT_SLEEPING:
case SCRIPT_PAUSED:
@@ -524,9 +524,9 @@ int CScEngine::GetNumScripts(int *Running, int *Waiting, int *Persistent) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::EmptyScriptCache() {
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
- if (m_CachedScripts[i]) {
- delete m_CachedScripts[i];
- m_CachedScripts[i] = NULL;
+ if (_cachedScripts[i]) {
+ delete _cachedScripts[i];
+ _cachedScripts[i] = NULL;
}
}
return S_OK;
@@ -536,12 +536,12 @@ HRESULT CScEngine::EmptyScriptCache() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::ResetObject(CBObject *Object) {
// terminate all scripts waiting for this object
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i]->m_State == SCRIPT_WAITING && m_Scripts[i]->m_WaitObject == Object) {
- if (!Game->m_CompatKillMethodThreads) ResetScript(m_Scripts[i]);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i]->_state == SCRIPT_WAITING && _scripts[i]->_waitObject == Object) {
+ if (!Game->_compatKillMethodThreads) ResetScript(_scripts[i]);
- bool IsThread = m_Scripts[i]->m_MethodThread || m_Scripts[i]->m_Thread;
- m_Scripts[i]->Finish(!IsThread); // 1.9b1 - top-level script kills its threads as well
+ bool IsThread = _scripts[i]->_methodThread || _scripts[i]->_thread;
+ _scripts[i]->Finish(!IsThread); // 1.9b1 - top-level script kills its threads as well
}
}
return S_OK;
@@ -550,9 +550,9 @@ HRESULT CScEngine::ResetObject(CBObject *Object) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::ResetScript(CScScript *Script) {
// terminate all scripts waiting for this script
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i]->m_State == SCRIPT_WAITING_SCRIPT && m_Scripts[i]->m_WaitScript == Script) {
- m_Scripts[i]->Finish();
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i]->_state == SCRIPT_WAITING_SCRIPT && _scripts[i]->_waitScript == Script) {
+ _scripts[i]->Finish();
}
}
return S_OK;
@@ -560,13 +560,13 @@ HRESULT CScEngine::ResetScript(CScScript *Script) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::Persist(CBPersistMgr *PersistMgr) {
- if (!PersistMgr->m_Saving) Cleanup();
+ if (!PersistMgr->_saving) Cleanup();
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_CurrentScript));
- PersistMgr->Transfer(TMEMBER(m_FileToCompile));
- PersistMgr->Transfer(TMEMBER(m_Globals));
- m_Scripts.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_currentScript));
+ PersistMgr->Transfer(TMEMBER(_fileToCompile));
+ PersistMgr->Transfer(TMEMBER(_globals));
+ _scripts.Persist(PersistMgr);
return S_OK;
}
@@ -574,10 +574,10 @@ HRESULT CScEngine::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
void CScEngine::EditorCleanup() {
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i]->m_Owner == NULL && (m_Scripts[i]->m_State == SCRIPT_FINISHED || m_Scripts[i]->m_State == SCRIPT_ERROR)) {
- delete m_Scripts[i];
- m_Scripts.RemoveAt(i);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i]->_owner == NULL && (_scripts[i]->_state == SCRIPT_FINISHED || _scripts[i]->_state == SCRIPT_ERROR)) {
+ delete _scripts[i];
+ _scripts.RemoveAt(i);
i--;
}
}
@@ -586,8 +586,8 @@ void CScEngine::EditorCleanup() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::PauseAll() {
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i] != m_CurrentScript) m_Scripts[i]->Pause();
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i] != _currentScript) _scripts[i]->Pause();
}
return S_OK;
@@ -596,8 +596,8 @@ HRESULT CScEngine::PauseAll() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::ResumeAll() {
- for (int i = 0; i < m_Scripts.GetSize(); i++)
- m_Scripts[i]->Resume();
+ for (int i = 0; i < _scripts.GetSize(); i++)
+ _scripts[i]->Resume();
return S_OK;
}
@@ -605,10 +605,10 @@ HRESULT CScEngine::ResumeAll() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::SetFileToCompile(char *Filename) {
- delete[] m_FileToCompile;
- m_FileToCompile = new char[strlen(Filename) + 1];
- if (m_FileToCompile) {
- strcpy(m_FileToCompile, Filename);
+ delete[] _fileToCompile;
+ _fileToCompile = new char[strlen(Filename) + 1];
+ if (_fileToCompile) {
+ strcpy(_fileToCompile, Filename);
return S_OK;
} else return E_FAIL;
}
@@ -616,46 +616,46 @@ HRESULT CScEngine::SetFileToCompile(char *Filename) {
//////////////////////////////////////////////////////////////////////////
void CScEngine::SetCompileErrorCallback(COMPILE_ERROR_CALLBACK Callback, void *Data) {
- m_CompileErrorCallback = Callback;
- m_CompileErrorCallbackData = Data;
+ _compileErrorCallback = Callback;
+ _compileErrorCallbackData = Data;
}
//////////////////////////////////////////////////////////////////////////
void CScEngine::SetParseElementCallback(PARSE_ELEMENT_CALLBACK Callback, void *Data) {
- m_ParseElementCallback = Callback;
- m_ParseElementCallbackData = Data;
+ _parseElementCallback = Callback;
+ _parseElementCallbackData = Data;
}
//////////////////////////////////////////////////////////////////////////
bool CScEngine::IsValidScript(CScScript *Script) {
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i] == Script) return true;
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i] == Script) return true;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::ClearGlobals(bool IncludingNatives) {
- m_Globals->CleanProps(IncludingNatives);
+ _globals->CleanProps(IncludingNatives);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::DbgSendScripts(IWmeDebugClient *Client) {
// send global variables
- m_Globals->DbgSendVariables(Client, WME_DBGVAR_GLOBAL, NULL, 0);
+ _globals->DbgSendVariables(Client, WME_DBGVAR_GLOBAL, NULL, 0);
// process normal scripts first
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i]->m_Thread || m_Scripts[i]->m_MethodThread) continue;
- m_Scripts[i]->DbgSendScript(Client);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i]->_thread || _scripts[i]->_methodThread) continue;
+ _scripts[i]->DbgSendScript(Client);
}
// and threads later
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- if (m_Scripts[i]->m_Thread || m_Scripts[i]->m_MethodThread)
- m_Scripts[i]->DbgSendScript(Client);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ if (_scripts[i]->_thread || _scripts[i]->_methodThread)
+ _scripts[i]->DbgSendScript(Client);
}
return S_OK;
@@ -663,24 +663,24 @@ HRESULT CScEngine::DbgSendScripts(IWmeDebugClient *Client) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::AddBreakpoint(char *ScriptFilename, int Line) {
- if (!Game->GetDebugMgr()->m_Enabled) return S_OK;
+ if (!Game->GetDebugMgr()->_enabled) return S_OK;
CScBreakpoint *Bp = NULL;
- for (int i = 0; i < m_Breakpoints.GetSize(); i++) {
- if (scumm_stricmp(m_Breakpoints[i]->m_Filename, ScriptFilename) == 0) {
- Bp = m_Breakpoints[i];
+ for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ if (scumm_stricmp(_breakpoints[i]->_filename, ScriptFilename) == 0) {
+ Bp = _breakpoints[i];
break;
}
}
if (Bp == NULL) {
Bp = new CScBreakpoint(ScriptFilename);
- m_Breakpoints.Add(Bp);
+ _breakpoints.Add(Bp);
}
bool Found = false;
- for (int i = 0; i < Bp->m_Lines.GetSize(); i++) {
- if (Bp->m_Lines[i] == Line) return S_OK;
+ for (int i = 0; i < Bp->_lines.GetSize(); i++) {
+ if (Bp->_lines[i] == Line) return S_OK;
}
- Bp->m_Lines.Add(Line);
+ Bp->_lines.Add(Line);
// refresh changes
RefreshScriptBreakpoints();
@@ -690,16 +690,16 @@ HRESULT CScEngine::AddBreakpoint(char *ScriptFilename, int Line) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::RemoveBreakpoint(char *ScriptFilename, int Line) {
- if (!Game->GetDebugMgr()->m_Enabled) return S_OK;
-
- for (int i = 0; i < m_Breakpoints.GetSize(); i++) {
- if (scumm_stricmp(m_Breakpoints[i]->m_Filename, ScriptFilename) == 0) {
- for (int j = 0; j < m_Breakpoints[i]->m_Lines.GetSize(); j++) {
- if (m_Breakpoints[i]->m_Lines[j] == Line) {
- m_Breakpoints[i]->m_Lines.RemoveAt(j);
- if (m_Breakpoints[i]->m_Lines.GetSize() == 0) {
- delete m_Breakpoints[i];
- m_Breakpoints.RemoveAt(i);
+ if (!Game->GetDebugMgr()->_enabled) return S_OK;
+
+ for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ if (scumm_stricmp(_breakpoints[i]->_filename, ScriptFilename) == 0) {
+ for (int j = 0; j < _breakpoints[i]->_lines.GetSize(); j++) {
+ if (_breakpoints[i]->_lines[j] == Line) {
+ _breakpoints[i]->_lines.RemoveAt(j);
+ if (_breakpoints[i]->_lines.GetSize() == 0) {
+ delete _breakpoints[i];
+ _breakpoints.RemoveAt(i);
}
// refresh changes
RefreshScriptBreakpoints();
@@ -715,65 +715,65 @@ HRESULT CScEngine::RemoveBreakpoint(char *ScriptFilename, int Line) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::RefreshScriptBreakpoints() {
- if (!Game->GetDebugMgr()->m_Enabled) return S_OK;
+ if (!Game->GetDebugMgr()->_enabled) return S_OK;
- for (int i = 0; i < m_Scripts.GetSize(); i++) {
- RefreshScriptBreakpoints(m_Scripts[i]);
+ for (int i = 0; i < _scripts.GetSize(); i++) {
+ RefreshScriptBreakpoints(_scripts[i]);
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::RefreshScriptBreakpoints(CScScript *Script) {
- if (!Game->GetDebugMgr()->m_Enabled) return S_OK;
+ if (!Game->GetDebugMgr()->_enabled) return S_OK;
- if (!Script || !Script->m_Filename) return E_FAIL;
+ if (!Script || !Script->_filename) return E_FAIL;
- for (int i = 0; i < m_Breakpoints.GetSize(); i++) {
- if (scumm_stricmp(m_Breakpoints[i]->m_Filename, Script->m_Filename) == 0) {
- Script->m_Breakpoints.Copy(m_Breakpoints[i]->m_Lines);
+ for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ if (scumm_stricmp(_breakpoints[i]->_filename, Script->_filename) == 0) {
+ Script->_breakpoints.Copy(_breakpoints[i]->_lines);
return S_OK;
}
}
- if (Script->m_Breakpoints.GetSize() > 0) Script->m_Breakpoints.RemoveAll();
+ if (Script->_breakpoints.GetSize() > 0) Script->_breakpoints.RemoveAll();
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::SaveBreakpoints() {
- if (!Game->GetDebugMgr()->m_Enabled) return S_OK;
+ if (!Game->GetDebugMgr()->_enabled) return S_OK;
char Text[512];
char Key[100];
int Count = 0;
- for (int i = 0; i < m_Breakpoints.GetSize(); i++) {
- for (int j = 0; j < m_Breakpoints[i]->m_Lines.GetSize(); j++) {
+ for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ for (int j = 0; j < _breakpoints[i]->_lines.GetSize(); j++) {
Count++;
sprintf(Key, "Breakpoint%d", Count);
- sprintf(Text, "%s:%d", m_Breakpoints[i]->m_Filename, m_Breakpoints[i]->m_Lines[j]);
+ sprintf(Text, "%s:%d", _breakpoints[i]->_filename, _breakpoints[i]->_lines[j]);
- Game->m_Registry->WriteString("Debug", Key, Text);
+ Game->_registry->WriteString("Debug", Key, Text);
}
}
- Game->m_Registry->WriteInt("Debug", "NumBreakpoints", Count);
+ Game->_registry->WriteInt("Debug", "NumBreakpoints", Count);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::LoadBreakpoints() {
- if (!Game->GetDebugMgr()->m_Enabled) return S_OK;
+ if (!Game->GetDebugMgr()->_enabled) return S_OK;
char Key[100];
- int Count = Game->m_Registry->ReadInt("Debug", "NumBreakpoints", 0);
+ int Count = Game->_registry->ReadInt("Debug", "NumBreakpoints", 0);
for (int i = 1; i <= Count; i++) {
uint32 BufSize = 512;
sprintf(Key, "Breakpoint%d", i);
- AnsiString breakpoint = Game->m_Registry->ReadString("Debug", Key, "");
+ AnsiString breakpoint = Game->_registry->ReadString("Debug", Key, "");
char *Path = CBUtils::StrEntry(0, breakpoint.c_str(), ':');
char *Line = CBUtils::StrEntry(1, breakpoint.c_str(), ':');
@@ -791,45 +791,45 @@ HRESULT CScEngine::LoadBreakpoints() {
//////////////////////////////////////////////////////////////////////////
void CScEngine::AddScriptTime(const char *Filename, uint32 Time) {
- if (!m_IsProfiling) return;
+ if (!_isProfiling) return;
AnsiString fileName = Filename;
StringUtil::ToLowerCase(fileName);
- m_ScriptTimes[fileName] += Time;
+ _scriptTimes[fileName] += Time;
}
//////////////////////////////////////////////////////////////////////////
void CScEngine::EnableProfiling() {
- if (m_IsProfiling) return;
+ if (_isProfiling) return;
// destroy old data, if any
- m_ScriptTimes.clear();
+ _scriptTimes.clear();
- m_ProfilingStartTime = CBPlatform::GetTime();
- m_IsProfiling = true;
+ _profilingStartTime = CBPlatform::GetTime();
+ _isProfiling = true;
}
//////////////////////////////////////////////////////////////////////////
void CScEngine::DisableProfiling() {
- if (!m_IsProfiling) return;
+ if (!_isProfiling) return;
DumpStats();
- m_IsProfiling = false;
+ _isProfiling = false;
}
//////////////////////////////////////////////////////////////////////////
void CScEngine::DumpStats() {
error("DumpStats not ported to ScummVM yet");
-/* uint32 totalTime = CBPlatform::GetTime() - m_ProfilingStartTime;
+/* uint32 totalTime = CBPlatform::GetTime() - _profilingStartTime;
typedef std::vector <std::pair<uint32, std::string> > TimeVector;
TimeVector times;
ScriptTimes::iterator it;
- for (it = m_ScriptTimes.begin(); it != m_ScriptTimes.end(); it++) {
+ for (it = _scriptTimes.begin(); it != _scriptTimes.end(); it++) {
times.push_back(std::pair<uint32, std::string> (it->_value, it->_key));
}
std::sort(times.begin(), times.end());
diff --git a/engines/wintermute/scriptables/ScEngine.h b/engines/wintermute/scriptables/ScEngine.h
index 13103f6d3c..7be147b39e 100644
--- a/engines/wintermute/scriptables/ScEngine.h
+++ b/engines/wintermute/scriptables/ScEngine.h
@@ -58,39 +58,39 @@ public:
class CScCachedScript {
public:
CScCachedScript(char *Filename, byte *Buffer, uint32 Size) {
- m_Timestamp = CBPlatform::GetTime();
- m_Buffer = new byte[Size];
- if (m_Buffer) memcpy(m_Buffer, Buffer, Size);
- m_Size = Size;
- m_Filename = new char[strlen(Filename) + 1];
- if (m_Filename) strcpy(m_Filename, Filename);
+ _timestamp = CBPlatform::GetTime();
+ _buffer = new byte[Size];
+ if (_buffer) memcpy(_buffer, Buffer, Size);
+ _size = Size;
+ _filename = new char[strlen(Filename) + 1];
+ if (_filename) strcpy(_filename, Filename);
};
~CScCachedScript() {
- if (m_Buffer) delete [] m_Buffer;
- if (m_Filename) delete [] m_Filename;
+ if (_buffer) delete [] _buffer;
+ if (_filename) delete [] _filename;
};
- uint32 m_Timestamp;
- byte *m_Buffer;
- uint32 m_Size;
- char *m_Filename;
+ uint32 _timestamp;
+ byte *_buffer;
+ uint32 _size;
+ char *_filename;
};
class CScBreakpoint {
public:
CScBreakpoint(const char *Filename) {
- m_Filename = NULL;
- CBUtils::SetString(&m_Filename, Filename);
+ _filename = NULL;
+ CBUtils::SetString(&_filename, Filename);
}
~CScBreakpoint() {
- if (m_Filename) delete [] m_Filename;
- m_Lines.RemoveAll();
+ if (_filename) delete [] _filename;
+ _lines.RemoveAll();
}
- char *m_Filename;
- CBArray<int, int> m_Lines;
+ char *_filename;
+ CBArray<int, int> _lines;
};
@@ -99,7 +99,7 @@ public:
public:
HRESULT DbgSendScripts(IWmeDebugClient *Client);
- CBArray<CScBreakpoint *, CScBreakpoint *> m_Breakpoints;
+ CBArray<CScBreakpoint *, CScBreakpoint *> _breakpoints;
HRESULT AddBreakpoint(char *ScriptFilename, int Line);
HRESULT RemoveBreakpoint(char *ScriptFilename, int Line);
HRESULT RefreshScriptBreakpoints();
@@ -114,15 +114,15 @@ public:
void SetCompileErrorCallback(COMPILE_ERROR_CALLBACK Callback, void *Data);
void SetParseElementCallback(PARSE_ELEMENT_CALLBACK Callback, void *Data);
- COMPILE_ERROR_CALLBACK m_CompileErrorCallback;
- void *m_CompileErrorCallbackData;
+ COMPILE_ERROR_CALLBACK _compileErrorCallback;
+ void *_compileErrorCallbackData;
- PARSE_ELEMENT_CALLBACK m_ParseElementCallback;
- void *m_ParseElementCallbackData;
+ PARSE_ELEMENT_CALLBACK _parseElementCallback;
+ void *_parseElementCallbackData;
HRESULT SetFileToCompile(char *Filename);
- char *m_FileToCompile;
- CScScript *m_CurrentScript;
+ char *_fileToCompile;
+ CScScript *_currentScript;
HRESULT ResumeAll();
HRESULT PauseAll();
void EditorCleanup();
@@ -134,10 +134,10 @@ public:
HRESULT Cleanup();
int GetNumScripts(int *Running = NULL, int *Waiting = NULL, int *Persistent = NULL);
HRESULT Tick();
- CScValue *m_Globals;
+ CScValue *_globals;
CScScript *RunScript(char *Filename, CBScriptHolder *Owner = NULL);
- bool m_CompilerAvailable;
- HINSTANCE m_CompilerDLL;
+ bool _compilerAvailable;
+ HINSTANCE _compilerDLL;
CScEngine(CBGame *inGame);
virtual ~CScEngine();
static void WINAPI AddError(void *Data, int Line, char *Text);
@@ -151,12 +151,12 @@ public:
DLL_DEFINE_FUNCTION ExtDefineFunction;
DLL_DEFINE_VARIABLE ExtDefineVariable;
- CBArray<CScScript *, CScScript *> m_Scripts;
+ CBArray<CScScript *, CScScript *> _scripts;
void EnableProfiling();
void DisableProfiling();
bool IsProfiling() {
- return m_IsProfiling;
+ return _isProfiling;
}
void AddScriptTime(const char *Filename, uint32 Time);
@@ -164,12 +164,12 @@ public:
private:
- CScCachedScript *m_CachedScripts[MAX_CACHED_SCRIPTS];
- bool m_IsProfiling;
- uint32 m_ProfilingStartTime;
+ CScCachedScript *_cachedScripts[MAX_CACHED_SCRIPTS];
+ bool _isProfiling;
+ uint32 _profilingStartTime;
typedef Common::HashMap<Common::String, uint32> ScriptTimes;
- ScriptTimes m_ScriptTimes;
+ ScriptTimes _scriptTimes;
};
diff --git a/engines/wintermute/scriptables/ScScript.cpp b/engines/wintermute/scriptables/ScScript.cpp
index e954fe9d9f..4d9edf9db4 100644
--- a/engines/wintermute/scriptables/ScScript.cpp
+++ b/engines/wintermute/scriptables/ScScript.cpp
@@ -39,59 +39,59 @@ IMPLEMENT_PERSISTENT(CScScript, false)
//////////////////////////////////////////////////////////////////////////
CScScript::CScScript(CBGame *inGame, CScEngine *Engine): CBBase(inGame) {
- m_Buffer = NULL;
- m_BufferSize = m_IP = 0;
- m_Filename = NULL;
- m_CurrentLine = 0;
+ _buffer = NULL;
+ _bufferSize = _iP = 0;
+ _filename = NULL;
+ _currentLine = 0;
- m_Symbols = NULL;
- m_NumSymbols = 0;
+ _symbols = NULL;
+ _numSymbols = 0;
- m_Engine = Engine;
+ _engine = Engine;
- m_Globals = NULL;
+ _globals = NULL;
- m_ScopeStack = NULL;
- m_CallStack = NULL;
- m_ThisStack = NULL;
- m_Stack = NULL;
+ _scopeStack = NULL;
+ _callStack = NULL;
+ _thisStack = NULL;
+ _stack = NULL;
- m_Operand = NULL;
- m_Reg1 = NULL;
+ _operand = NULL;
+ _reg1 = NULL;
- m_Functions = NULL;
- m_NumFunctions = 0;
+ _functions = NULL;
+ _numFunctions = 0;
- m_Methods = NULL;
- m_NumMethods = 0;
+ _methods = NULL;
+ _numMethods = 0;
- m_Events = NULL;
- m_NumEvents = 0;
+ _events = NULL;
+ _numEvents = 0;
- m_Externals = NULL;
- m_NumExternals = 0;
+ _externals = NULL;
+ _numExternals = 0;
- m_State = SCRIPT_FINISHED;
- m_OrigState = SCRIPT_FINISHED;
+ _state = SCRIPT_FINISHED;
+ _origState = SCRIPT_FINISHED;
- m_WaitObject = NULL;
- m_WaitTime = 0;
- m_WaitFrozen = false;
- m_WaitScript = NULL;
+ _waitObject = NULL;
+ _waitTime = 0;
+ _waitFrozen = false;
+ _waitScript = NULL;
- m_TimeSlice = 0;
+ _timeSlice = 0;
- m_Thread = false;
- m_MethodThread = false;
- m_ThreadEvent = NULL;
+ _thread = false;
+ _methodThread = false;
+ _threadEvent = NULL;
- m_Freezable = true;
- m_Owner = NULL;
+ _freezable = true;
+ _owner = NULL;
- m_Unbreakable = false;
- m_ParentScript = NULL;
+ _unbreakable = false;
+ _parentScript = NULL;
- m_TracingMode = false;
+ _tracingMode = false;
}
@@ -104,15 +104,15 @@ CScScript::~CScScript() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::InitScript() {
- TScriptHeader *Header = (TScriptHeader *)m_Buffer;
+ TScriptHeader *Header = (TScriptHeader *)_buffer;
if (Header->magic != SCRIPT_MAGIC) {
- Game->LOG(0, "File '%s' is not a valid compiled script", m_Filename);
+ Game->LOG(0, "File '%s' is not a valid compiled script", _filename);
Cleanup();
return E_FAIL;
}
if (Header->version > SCRIPT_VERSION) {
- Game->LOG(0, "Script '%s' has a wrong version %d.%d (expected %d.%d)", m_Filename, Header->version / 256, Header->version % 256, SCRIPT_VERSION / 256, SCRIPT_VERSION % 256);
+ Game->LOG(0, "Script '%s' has a wrong version %d.%d (expected %d.%d)", _filename, Header->version / 256, Header->version % 256, SCRIPT_VERSION / 256, SCRIPT_VERSION % 256);
Cleanup();
return E_FAIL;
}
@@ -120,25 +120,25 @@ HRESULT CScScript::InitScript() {
InitTables();
// init stacks
- m_ScopeStack = new CScStack(Game);
- m_CallStack = new CScStack(Game);
- m_ThisStack = new CScStack(Game);
- m_Stack = new CScStack(Game);
+ _scopeStack = new CScStack(Game);
+ _callStack = new CScStack(Game);
+ _thisStack = new CScStack(Game);
+ _stack = new CScStack(Game);
- m_Operand = new CScValue(Game);
- m_Reg1 = new CScValue(Game);
+ _operand = new CScValue(Game);
+ _reg1 = new CScValue(Game);
// skip to the beginning
- m_IP = Header->code_start;
- m_CurrentLine = 0;
+ _iP = Header->code_start;
+ _currentLine = 0;
// init breakpoints
- m_Engine->RefreshScriptBreakpoints(this);
+ _engine->RefreshScriptBreakpoints(this);
// ready to rumble...
- m_State = SCRIPT_RUNNING;
+ _state = SCRIPT_RUNNING;
return S_OK;
}
@@ -146,77 +146,77 @@ HRESULT CScScript::InitScript() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::InitTables() {
- uint32 OrigIP = m_IP;
+ uint32 OrigIP = _iP;
- TScriptHeader *Header = (TScriptHeader *)m_Buffer;
+ TScriptHeader *Header = (TScriptHeader *)_buffer;
uint32 i;
// load symbol table
- m_IP = Header->symbol_table;
+ _iP = Header->symbol_table;
- m_NumSymbols = GetDWORD();
- m_Symbols = new char*[m_NumSymbols];
- for (i = 0; i < m_NumSymbols; i++) {
+ _numSymbols = GetDWORD();
+ _symbols = new char*[_numSymbols];
+ for (i = 0; i < _numSymbols; i++) {
uint32 index = GetDWORD();
- m_Symbols[index] = GetString();
+ _symbols[index] = GetString();
}
// load functions table
- m_IP = Header->func_table;
+ _iP = Header->func_table;
- m_NumFunctions = GetDWORD();
- m_Functions = new TFunctionPos[m_NumFunctions];
- for (i = 0; i < m_NumFunctions; i++) {
- m_Functions[i].pos = GetDWORD();
- m_Functions[i].name = GetString();
+ _numFunctions = GetDWORD();
+ _functions = new TFunctionPos[_numFunctions];
+ for (i = 0; i < _numFunctions; i++) {
+ _functions[i].pos = GetDWORD();
+ _functions[i].name = GetString();
}
// load events table
- m_IP = Header->event_table;
+ _iP = Header->event_table;
- m_NumEvents = GetDWORD();
- m_Events = new TEventPos[m_NumEvents];
- for (i = 0; i < m_NumEvents; i++) {
- m_Events[i].pos = GetDWORD();
- m_Events[i].name = GetString();
+ _numEvents = GetDWORD();
+ _events = new TEventPos[_numEvents];
+ for (i = 0; i < _numEvents; i++) {
+ _events[i].pos = GetDWORD();
+ _events[i].name = GetString();
}
// load externals
if (Header->version >= 0x0101) {
- m_IP = Header->externals_table;
-
- m_NumExternals = GetDWORD();
- m_Externals = new TExternalFunction[m_NumExternals];
- for (i = 0; i < m_NumExternals; i++) {
- m_Externals[i].dll_name = GetString();
- m_Externals[i].name = GetString();
- m_Externals[i].call_type = (TCallType)GetDWORD();
- m_Externals[i].returns = (TExternalType)GetDWORD();
- m_Externals[i].num_params = GetDWORD();
- if (m_Externals[i].num_params > 0) {
- m_Externals[i].params = new TExternalType[m_Externals[i].num_params];
- for (int j = 0; j < m_Externals[i].num_params; j++) {
- m_Externals[i].params[j] = (TExternalType)GetDWORD();
+ _iP = Header->externals_table;
+
+ _numExternals = GetDWORD();
+ _externals = new TExternalFunction[_numExternals];
+ for (i = 0; i < _numExternals; i++) {
+ _externals[i].dll_name = GetString();
+ _externals[i].name = GetString();
+ _externals[i].call_type = (TCallType)GetDWORD();
+ _externals[i].returns = (TExternalType)GetDWORD();
+ _externals[i].nu_params = GetDWORD();
+ if (_externals[i].nu_params > 0) {
+ _externals[i].params = new TExternalType[_externals[i].nu_params];
+ for (int j = 0; j < _externals[i].nu_params; j++) {
+ _externals[i].params[j] = (TExternalType)GetDWORD();
}
}
}
}
// load method table
- m_IP = Header->method_table;
+ _iP = Header->method_table;
- m_NumMethods = GetDWORD();
- m_Methods = new TMethodPos[m_NumMethods];
- for (i = 0; i < m_NumMethods; i++) {
- m_Methods[i].pos = GetDWORD();
- m_Methods[i].name = GetString();
+ _numMethods = GetDWORD();
+ _methods = new TMethodPos[_numMethods];
+ for (i = 0; i < _numMethods; i++) {
+ _methods[i].pos = GetDWORD();
+ _methods[i].name = GetString();
}
- m_IP = OrigIP;
+ _iP = OrigIP;
return S_OK;
}
@@ -226,29 +226,29 @@ HRESULT CScScript::InitTables() {
HRESULT CScScript::Create(char *Filename, byte *Buffer, uint32 Size, CBScriptHolder *Owner) {
Cleanup();
- m_Thread = false;
- m_MethodThread = false;
+ _thread = false;
+ _methodThread = false;
- delete[] m_ThreadEvent;
- m_ThreadEvent = NULL;
+ delete[] _threadEvent;
+ _threadEvent = NULL;
- m_Filename = new char[strlen(Filename) + 1];
- if (m_Filename) strcpy(m_Filename, Filename);
+ _filename = new char[strlen(Filename) + 1];
+ if (_filename) strcpy(_filename, Filename);
- m_Buffer = new byte [Size];
- if (!m_Buffer) return E_FAIL;
+ _buffer = new byte [Size];
+ if (!_buffer) return E_FAIL;
- memcpy(m_Buffer, Buffer, Size);
+ memcpy(_buffer, Buffer, Size);
- m_BufferSize = Size;
+ _bufferSize = Size;
HRESULT res = InitScript();
if (FAILED(res)) return res;
// establish global variables table
- m_Globals = new CScValue(Game);
+ _globals = new CScValue(Game);
- m_Owner = Owner;
+ _owner = Owner;
return S_OK;
}
@@ -258,38 +258,38 @@ HRESULT CScScript::Create(char *Filename, byte *Buffer, uint32 Size, CBScriptHol
HRESULT CScScript::CreateThread(CScScript *Original, uint32 InitIP, const char *EventName) {
Cleanup();
- m_Thread = true;
- m_MethodThread = false;
- m_ThreadEvent = new char[strlen(EventName) + 1];
- if (m_ThreadEvent) strcpy(m_ThreadEvent, EventName);
+ _thread = true;
+ _methodThread = false;
+ _threadEvent = new char[strlen(EventName) + 1];
+ if (_threadEvent) strcpy(_threadEvent, EventName);
// copy filename
- m_Filename = new char[strlen(Original->m_Filename) + 1];
- if (m_Filename) strcpy(m_Filename, Original->m_Filename);
+ _filename = new char[strlen(Original->_filename) + 1];
+ if (_filename) strcpy(_filename, Original->_filename);
// copy buffer
- m_Buffer = new byte [Original->m_BufferSize];
- if (!m_Buffer) return E_FAIL;
+ _buffer = new byte [Original->_bufferSize];
+ if (!_buffer) return E_FAIL;
- memcpy(m_Buffer, Original->m_Buffer, Original->m_BufferSize);
- m_BufferSize = Original->m_BufferSize;
+ memcpy(_buffer, Original->_buffer, Original->_bufferSize);
+ _bufferSize = Original->_bufferSize;
// initialize
HRESULT res = InitScript();
if (FAILED(res)) return res;
// copy globals
- m_Globals = Original->m_Globals;
+ _globals = Original->_globals;
// skip to the beginning of the event
- m_IP = InitIP;
+ _iP = InitIP;
- m_TimeSlice = Original->m_TimeSlice;
- m_Freezable = Original->m_Freezable;
- m_Owner = Original->m_Owner;
+ _timeSlice = Original->_timeSlice;
+ _freezable = Original->_freezable;
+ _owner = Original->_owner;
- m_Engine = Original->m_Engine;
- m_ParentScript = Original;
+ _engine = Original->_engine;
+ _parentScript = Original;
return S_OK;
}
@@ -304,38 +304,38 @@ HRESULT CScScript::CreateMethodThread(CScScript *Original, const char *MethodNam
Cleanup();
- m_Thread = true;
- m_MethodThread = true;
- m_ThreadEvent = new char[strlen(MethodName) + 1];
- if (m_ThreadEvent) strcpy(m_ThreadEvent, MethodName);
+ _thread = true;
+ _methodThread = true;
+ _threadEvent = new char[strlen(MethodName) + 1];
+ if (_threadEvent) strcpy(_threadEvent, MethodName);
// copy filename
- m_Filename = new char[strlen(Original->m_Filename) + 1];
- if (m_Filename) strcpy(m_Filename, Original->m_Filename);
+ _filename = new char[strlen(Original->_filename) + 1];
+ if (_filename) strcpy(_filename, Original->_filename);
// copy buffer
- m_Buffer = new byte [Original->m_BufferSize];
- if (!m_Buffer) return E_FAIL;
+ _buffer = new byte [Original->_bufferSize];
+ if (!_buffer) return E_FAIL;
- memcpy(m_Buffer, Original->m_Buffer, Original->m_BufferSize);
- m_BufferSize = Original->m_BufferSize;
+ memcpy(_buffer, Original->_buffer, Original->_bufferSize);
+ _bufferSize = Original->_bufferSize;
// initialize
HRESULT res = InitScript();
if (FAILED(res)) return res;
// copy globals
- m_Globals = Original->m_Globals;
+ _globals = Original->_globals;
// skip to the beginning of the event
- m_IP = IP;
+ _iP = IP;
- m_TimeSlice = Original->m_TimeSlice;
- m_Freezable = Original->m_Freezable;
- m_Owner = Original->m_Owner;
+ _timeSlice = Original->_timeSlice;
+ _freezable = Original->_freezable;
+ _owner = Original->_owner;
- m_Engine = Original->m_Engine;
- m_ParentScript = Original;
+ _engine = Original->_engine;
+ _parentScript = Original;
return S_OK;
}
@@ -343,76 +343,76 @@ HRESULT CScScript::CreateMethodThread(CScScript *Original, const char *MethodNam
//////////////////////////////////////////////////////////////////////////
void CScScript::Cleanup() {
- if (m_Buffer) delete [] m_Buffer;
- m_Buffer = NULL;
+ if (_buffer) delete [] _buffer;
+ _buffer = NULL;
- if (m_Filename) delete [] m_Filename;
- m_Filename = NULL;
+ if (_filename) delete [] _filename;
+ _filename = NULL;
- if (m_Symbols) delete [] m_Symbols;
- m_Symbols = NULL;
- m_NumSymbols = 0;
+ if (_symbols) delete [] _symbols;
+ _symbols = NULL;
+ _numSymbols = 0;
- if (m_Globals && !m_Thread) delete m_Globals;
- m_Globals = NULL;
+ if (_globals && !_thread) delete _globals;
+ _globals = NULL;
- if (m_ScopeStack) delete m_ScopeStack;
- m_ScopeStack = NULL;
+ if (_scopeStack) delete _scopeStack;
+ _scopeStack = NULL;
- if (m_CallStack) delete m_CallStack;
- m_CallStack = NULL;
+ if (_callStack) delete _callStack;
+ _callStack = NULL;
- if (m_ThisStack) delete m_ThisStack;
- m_ThisStack = NULL;
+ if (_thisStack) delete _thisStack;
+ _thisStack = NULL;
- if (m_Stack) delete m_Stack;
- m_Stack = NULL;
+ if (_stack) delete _stack;
+ _stack = NULL;
- if (m_Functions) delete [] m_Functions;
- m_Functions = NULL;
- m_NumFunctions = 0;
+ if (_functions) delete [] _functions;
+ _functions = NULL;
+ _numFunctions = 0;
- if (m_Methods) delete [] m_Methods;
- m_Methods = NULL;
- m_NumMethods = 0;
+ if (_methods) delete [] _methods;
+ _methods = NULL;
+ _numMethods = 0;
- if (m_Events) delete [] m_Events;
- m_Events = NULL;
- m_NumEvents = 0;
+ if (_events) delete [] _events;
+ _events = NULL;
+ _numEvents = 0;
- if (m_Externals) {
- for (int i = 0; i < m_NumExternals; i++) {
- if (m_Externals[i].num_params > 0) delete [] m_Externals[i].params;
+ if (_externals) {
+ for (int i = 0; i < _numExternals; i++) {
+ if (_externals[i].nu_params > 0) delete [] _externals[i].params;
}
- delete [] m_Externals;
+ delete [] _externals;
}
- m_Externals = NULL;
- m_NumExternals = 0;
+ _externals = NULL;
+ _numExternals = 0;
- delete m_Operand;
- delete m_Reg1;
- m_Operand = NULL;
- m_Reg1 = NULL;
+ delete _operand;
+ delete _reg1;
+ _operand = NULL;
+ _reg1 = NULL;
- delete[] m_ThreadEvent;
- m_ThreadEvent = NULL;
+ delete[] _threadEvent;
+ _threadEvent = NULL;
- m_State = SCRIPT_FINISHED;
+ _state = SCRIPT_FINISHED;
- m_WaitObject = NULL;
- m_WaitTime = 0;
- m_WaitFrozen = false;
- m_WaitScript = NULL;
+ _waitObject = NULL;
+ _waitTime = 0;
+ _waitFrozen = false;
+ _waitScript = NULL;
- m_ParentScript = NULL; // ref only
+ _parentScript = NULL; // ref only
}
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::GetDWORD() {
- uint32 ret = *(uint32 *)(m_Buffer + m_IP);
- m_IP += sizeof(uint32);
+ uint32 ret = *(uint32 *)(_buffer + _iP);
+ _iP += sizeof(uint32);
return ret;
}
@@ -420,8 +420,8 @@ uint32 CScScript::GetDWORD() {
//////////////////////////////////////////////////////////////////////////
double CScScript::GetFloat() {
- double ret = *(double *)(m_Buffer + m_IP);
- m_IP += sizeof(double);
+ double ret = *(double *)(_buffer + _iP);
+ _iP += sizeof(double);
return ret;
}
@@ -429,9 +429,9 @@ double CScScript::GetFloat() {
//////////////////////////////////////////////////////////////////////////
char *CScScript::GetString() {
- char *ret = (char *)(m_Buffer + m_IP);
- while (*(char *)(m_Buffer + m_IP) != '\0') m_IP++;
- m_IP++; // string terminator
+ char *ret = (char *)(_buffer + _iP);
+ while (*(char *)(_buffer + _iP) != '\0') _iP++;
+ _iP++; // string terminator
return ret;
}
@@ -445,7 +445,7 @@ HRESULT CScScript::ExecuteInstruction() {
char *str;
//CScValue* op = new CScValue(Game);
- m_Operand->Cleanup();
+ _operand->Cleanup();
CScValue *op1;
CScValue *op2;
@@ -454,16 +454,16 @@ HRESULT CScScript::ExecuteInstruction() {
switch (inst) {
case II_DEF_VAR:
- m_Operand->SetNULL();
+ _operand->SetNULL();
dw = GetDWORD();
- if (m_ScopeStack->m_SP < 0) {
- m_Globals->SetProp(m_Symbols[dw], m_Operand);
- if (Game->GetDebugMgr()->m_Enabled)
- Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_SCRIPT, this, NULL, m_Globals->GetProp(m_Symbols[dw]), m_Symbols[dw]);
+ if (_scopeStack->_sP < 0) {
+ _globals->SetProp(_symbols[dw], _operand);
+ if (Game->GetDebugMgr()->_enabled)
+ Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_SCRIPT, this, NULL, _globals->GetProp(_symbols[dw]), _symbols[dw]);
} else {
- m_ScopeStack->GetTop()->SetProp(m_Symbols[dw], m_Operand);
- if (Game->GetDebugMgr()->m_Enabled)
- Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_SCOPE, this, m_ScopeStack->GetTop(), m_ScopeStack->GetTop()->GetProp(m_Symbols[dw]), m_Symbols[dw]);
+ _scopeStack->GetTop()->SetProp(_symbols[dw], _operand);
+ if (Game->GetDebugMgr()->_enabled)
+ Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_SCOPE, this, _scopeStack->GetTop(), _scopeStack->GetTop()->GetProp(_symbols[dw]), _symbols[dw]);
}
break;
@@ -471,89 +471,89 @@ HRESULT CScScript::ExecuteInstruction() {
case II_DEF_GLOB_VAR:
case II_DEF_CONST_VAR: {
dw = GetDWORD();
- char *Temp = m_Symbols[dw]; // TODO delete
+ char *Temp = _symbols[dw]; // TODO delete
// only create global var if it doesn't exist
- if (!m_Engine->m_Globals->PropExists(m_Symbols[dw])) {
- m_Operand->SetNULL();
- m_Engine->m_Globals->SetProp(m_Symbols[dw], m_Operand, false, inst == II_DEF_CONST_VAR);
+ if (!_engine->_globals->PropExists(_symbols[dw])) {
+ _operand->SetNULL();
+ _engine->_globals->SetProp(_symbols[dw], _operand, false, inst == II_DEF_CONST_VAR);
- if (Game->GetDebugMgr()->m_Enabled)
- Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_GLOBAL, this, NULL, m_Engine->m_Globals->GetProp(m_Symbols[dw]), m_Symbols[dw]);
+ if (Game->GetDebugMgr()->_enabled)
+ Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_GLOBAL, this, NULL, _engine->_globals->GetProp(_symbols[dw]), _symbols[dw]);
}
break;
}
case II_RET:
- if (m_ScopeStack->m_SP >= 0 && m_CallStack->m_SP >= 0) {
- Game->GetDebugMgr()->OnScriptShutdownScope(this, m_ScopeStack->GetTop());
+ if (_scopeStack->_sP >= 0 && _callStack->_sP >= 0) {
+ Game->GetDebugMgr()->OnScriptShutdownScope(this, _scopeStack->GetTop());
- m_ScopeStack->Pop();
- m_IP = (uint32)m_CallStack->Pop()->GetInt();
+ _scopeStack->Pop();
+ _iP = (uint32)_callStack->Pop()->GetInt();
- if (m_ScopeStack->m_SP < 0) Game->GetDebugMgr()->OnScriptChangeScope(this, NULL);
- else Game->GetDebugMgr()->OnScriptChangeScope(this, m_ScopeStack->GetTop());
+ if (_scopeStack->_sP < 0) Game->GetDebugMgr()->OnScriptChangeScope(this, NULL);
+ else Game->GetDebugMgr()->OnScriptChangeScope(this, _scopeStack->GetTop());
} else {
- if (m_Thread) {
- m_State = SCRIPT_THREAD_FINISHED;
+ if (_thread) {
+ _state = SCRIPT_THREAD_FINISHED;
} else {
- if (m_NumEvents == 0 && m_NumMethods == 0) m_State = SCRIPT_FINISHED;
- else m_State = SCRIPT_PERSISTENT;
+ if (_numEvents == 0 && _numMethods == 0) _state = SCRIPT_FINISHED;
+ else _state = SCRIPT_PERSISTENT;
}
}
break;
case II_RET_EVENT:
- m_State = SCRIPT_FINISHED;
+ _state = SCRIPT_FINISHED;
break;
case II_CALL:
dw = GetDWORD();
- m_Operand->SetInt(m_IP);
- m_CallStack->Push(m_Operand);
+ _operand->SetInt(_iP);
+ _callStack->Push(_operand);
- m_IP = dw;
+ _iP = dw;
break;
case II_CALL_BY_EXP: {
// push var
// push string
- str = m_Stack->Pop()->GetString();
+ str = _stack->Pop()->GetString();
char *MethodName = new char[strlen(str) + 1];
strcpy(MethodName, str);
- CScValue *var = m_Stack->Pop();
- if (var->m_Type == VAL_VARIABLE_REF) var = var->m_ValRef;
+ CScValue *var = _stack->Pop();
+ if (var->_type == VAL_VARIABLE_REF) var = var->_valRef;
HRESULT res = E_FAIL;
bool TriedNative = false;
// we are already calling this method, try native
- if (m_Thread && m_MethodThread && strcmp(MethodName, m_ThreadEvent) == 0 && var->m_Type == VAL_NATIVE && m_Owner == var->GetNative()) {
+ if (_thread && _methodThread && strcmp(MethodName, _threadEvent) == 0 && var->_type == VAL_NATIVE && _owner == var->GetNative()) {
TriedNative = true;
- res = var->m_ValNative->ScCallMethod(this, m_Stack, m_ThisStack, MethodName);
+ res = var->_valNative->ScCallMethod(this, _stack, _thisStack, MethodName);
}
if (FAILED(res)) {
if (var->IsNative() && var->GetNative()->CanHandleMethod(MethodName)) {
- if (!m_Unbreakable) {
- m_WaitScript = var->GetNative()->InvokeMethodThread(MethodName);
- if (!m_WaitScript) {
- m_Stack->CorrectParams(0);
+ if (!_unbreakable) {
+ _waitScript = var->GetNative()->InvokeMethodThread(MethodName);
+ if (!_waitScript) {
+ _stack->CorrectParams(0);
RuntimeError("Error invoking method '%s'.", MethodName);
- m_Stack->PushNULL();
+ _stack->PushNULL();
} else {
- m_State = SCRIPT_WAITING_SCRIPT;
- m_WaitScript->CopyParameters(m_Stack);
+ _state = SCRIPT_WAITING_SCRIPT;
+ _waitScript->CopyParameters(_stack);
}
} else {
// can call methods in unbreakable mode
- m_Stack->CorrectParams(0);
+ _stack->CorrectParams(0);
RuntimeError("Cannot call method '%s'. Ignored.", MethodName);
- m_Stack->PushNULL();
+ _stack->PushNULL();
}
delete [] MethodName;
break;
@@ -565,28 +565,28 @@ HRESULT CScScript::ExecuteInstruction() {
if(dw==0){
TExternalFunction* f = GetExternal(val->GetString());
if(f){
- ExternalCall(m_Stack, m_ThisStack, f);
+ ExternalCall(_stack, _thisStack, f);
}
else{
// not an internal nor external, try for native function
- Game->ExternalCall(this, m_Stack, m_ThisStack, val->GetString());
+ Game->ExternalCall(this, _stack, _thisStack, val->GetString());
}
}
else{
- m_Operand->SetInt(m_IP);
- m_CallStack->Push(m_Operand);
- m_IP = dw;
+ _operand->SetInt(_iP);
+ _callStack->Push(_operand);
+ _iP = dw;
}
}
*/
else {
res = E_FAIL;
- if (var->m_Type == VAL_NATIVE && !TriedNative) res = var->m_ValNative->ScCallMethod(this, m_Stack, m_ThisStack, MethodName);
+ if (var->_type == VAL_NATIVE && !TriedNative) res = var->_valNative->ScCallMethod(this, _stack, _thisStack, MethodName);
if (FAILED(res)) {
- m_Stack->CorrectParams(0);
+ _stack->CorrectParams(0);
RuntimeError("Call to undefined method '%s'. Ignored.", MethodName);
- m_Stack->PushNULL();
+ _stack->PushNULL();
}
}
}
@@ -597,69 +597,69 @@ HRESULT CScScript::ExecuteInstruction() {
case II_EXTERNAL_CALL: {
uint32 SymbolIndex = GetDWORD();
- TExternalFunction *f = GetExternal(m_Symbols[SymbolIndex]);
+ TExternalFunction *f = GetExternal(_symbols[SymbolIndex]);
if (f) {
- ExternalCall(m_Stack, m_ThisStack, f);
- } else Game->ExternalCall(this, m_Stack, m_ThisStack, m_Symbols[SymbolIndex]);
+ ExternalCall(_stack, _thisStack, f);
+ } else Game->ExternalCall(this, _stack, _thisStack, _symbols[SymbolIndex]);
break;
}
case II_SCOPE:
- m_Operand->SetNULL();
- m_ScopeStack->Push(m_Operand);
+ _operand->SetNULL();
+ _scopeStack->Push(_operand);
- if (m_ScopeStack->m_SP < 0) Game->GetDebugMgr()->OnScriptChangeScope(this, NULL);
- else Game->GetDebugMgr()->OnScriptChangeScope(this, m_ScopeStack->GetTop());
+ if (_scopeStack->_sP < 0) Game->GetDebugMgr()->OnScriptChangeScope(this, NULL);
+ else Game->GetDebugMgr()->OnScriptChangeScope(this, _scopeStack->GetTop());
break;
case II_CORRECT_STACK:
dw = GetDWORD(); // params expected
- m_Stack->CorrectParams(dw);
+ _stack->CorrectParams(dw);
break;
case II_CREATE_OBJECT:
- m_Operand->SetObject();
- m_Stack->Push(m_Operand);
+ _operand->SetObject();
+ _stack->Push(_operand);
break;
case II_POP_EMPTY:
- m_Stack->Pop();
+ _stack->Pop();
break;
case II_PUSH_VAR: {
- CScValue *var = GetVar(m_Symbols[GetDWORD()]);
- if (false && /*var->m_Type==VAL_OBJECT ||*/ var->m_Type == VAL_NATIVE) {
- m_Operand->SetReference(var);
- m_Stack->Push(m_Operand);
- } else m_Stack->Push(var);
+ CScValue *var = GetVar(_symbols[GetDWORD()]);
+ if (false && /*var->_type==VAL_OBJECT ||*/ var->_type == VAL_NATIVE) {
+ _operand->SetReference(var);
+ _stack->Push(_operand);
+ } else _stack->Push(var);
break;
}
case II_PUSH_VAR_REF: {
- CScValue *var = GetVar(m_Symbols[GetDWORD()]);
- m_Operand->SetReference(var);
- m_Stack->Push(m_Operand);
+ CScValue *var = GetVar(_symbols[GetDWORD()]);
+ _operand->SetReference(var);
+ _stack->Push(_operand);
break;
}
case II_POP_VAR: {
- char *VarName = m_Symbols[GetDWORD()];
+ char *VarName = _symbols[GetDWORD()];
CScValue *var = GetVar(VarName);
if (var) {
- CScValue *val = m_Stack->Pop();
+ CScValue *val = _stack->Pop();
if (!val) {
RuntimeError("Script stack corruption detected. Please report this script at WME bug reports forum.");
var->SetNULL();
} else {
- if (val->GetType() == VAL_VARIABLE_REF) val = val->m_ValRef;
- if (val->m_Type == VAL_NATIVE) var->SetValue(val);
+ if (val->GetType() == VAL_VARIABLE_REF) val = val->_valRef;
+ if (val->_type == VAL_NATIVE) var->SetValue(val);
else {
var->Copy(val);
}
}
- if (Game->GetDebugMgr()->m_Enabled)
+ if (Game->GetDebugMgr()->_enabled)
Game->GetDebugMgr()->OnVariableChangeValue(var, val);
}
@@ -667,339 +667,339 @@ HRESULT CScScript::ExecuteInstruction() {
}
case II_PUSH_VAR_THIS:
- m_Stack->Push(m_ThisStack->GetTop());
+ _stack->Push(_thisStack->GetTop());
break;
case II_PUSH_INT:
- m_Stack->PushInt((int)GetDWORD());
+ _stack->PushInt((int)GetDWORD());
break;
case II_PUSH_FLOAT:
- m_Stack->PushFloat(GetFloat());
+ _stack->PushFloat(GetFloat());
break;
case II_PUSH_BOOL:
- m_Stack->PushBool(GetDWORD() != 0);
+ _stack->PushBool(GetDWORD() != 0);
break;
case II_PUSH_STRING:
- m_Stack->PushString(GetString());
+ _stack->PushString(GetString());
break;
case II_PUSH_NULL:
- m_Stack->PushNULL();
+ _stack->PushNULL();
break;
case II_PUSH_THIS_FROM_STACK:
- m_Operand->SetReference(m_Stack->GetTop());
- m_ThisStack->Push(m_Operand);
+ _operand->SetReference(_stack->GetTop());
+ _thisStack->Push(_operand);
break;
case II_PUSH_THIS:
- m_Operand->SetReference(GetVar(m_Symbols[GetDWORD()]));
- m_ThisStack->Push(m_Operand);
+ _operand->SetReference(GetVar(_symbols[GetDWORD()]));
+ _thisStack->Push(_operand);
break;
case II_POP_THIS:
- m_ThisStack->Pop();
+ _thisStack->Pop();
break;
case II_PUSH_BY_EXP: {
- str = m_Stack->Pop()->GetString();
- CScValue *val = m_Stack->Pop()->GetProp(str);
- if (val) m_Stack->Push(val);
- else m_Stack->PushNULL();
+ str = _stack->Pop()->GetString();
+ CScValue *val = _stack->Pop()->GetProp(str);
+ if (val) _stack->Push(val);
+ else _stack->PushNULL();
break;
}
case II_POP_BY_EXP: {
- str = m_Stack->Pop()->GetString();
- CScValue *var = m_Stack->Pop();
- CScValue *val = m_Stack->Pop();
+ str = _stack->Pop()->GetString();
+ CScValue *var = _stack->Pop();
+ CScValue *val = _stack->Pop();
if (val == NULL) {
RuntimeError("Script stack corruption detected. Please report this script at WME bug reports forum.");
var->SetNULL();
} else var->SetProp(str, val);
- if (Game->GetDebugMgr()->m_Enabled)
+ if (Game->GetDebugMgr()->_enabled)
Game->GetDebugMgr()->OnVariableChangeValue(var, NULL);
break;
}
case II_PUSH_REG1:
- m_Stack->Push(m_Reg1);
+ _stack->Push(_reg1);
break;
case II_POP_REG1:
- m_Reg1->Copy(m_Stack->Pop());
+ _reg1->Copy(_stack->Pop());
break;
case II_JMP:
- m_IP = GetDWORD();
+ _iP = GetDWORD();
break;
case II_JMP_FALSE: {
dw = GetDWORD();
- //if(!m_Stack->Pop()->GetBool()) m_IP = dw;
- CScValue *Val = m_Stack->Pop();
+ //if(!_stack->Pop()->GetBool()) _iP = dw;
+ CScValue *Val = _stack->Pop();
if (!Val) {
RuntimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
} else {
- if (!Val->GetBool()) m_IP = dw;
+ if (!Val->GetBool()) _iP = dw;
}
break;
}
case II_ADD:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
- if (op1->IsNULL() || op2->IsNULL()) m_Operand->SetNULL();
+ if (op1->IsNULL() || op2->IsNULL()) _operand->SetNULL();
else if (op1->GetType() == VAL_STRING || op2->GetType() == VAL_STRING) {
str = new char [strlen(op1->GetString()) + strlen(op2->GetString()) + 1];
strcpy(str, op1->GetString());
strcat(str, op2->GetString());
- m_Operand->SetString(str);
+ _operand->SetString(str);
delete [] str;
} else if (op1->GetType() == VAL_INT && op2->GetType() == VAL_INT)
- m_Operand->SetInt(op1->GetInt() + op2->GetInt());
- else m_Operand->SetFloat(op1->GetFloat() + op2->GetFloat());
+ _operand->SetInt(op1->GetInt() + op2->GetInt());
+ else _operand->SetFloat(op1->GetFloat() + op2->GetFloat());
- m_Stack->Push(m_Operand);
+ _stack->Push(_operand);
break;
case II_SUB:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
- if (op1->IsNULL() || op2->IsNULL()) m_Operand->SetNULL();
+ if (op1->IsNULL() || op2->IsNULL()) _operand->SetNULL();
else if (op1->GetType() == VAL_INT && op2->GetType() == VAL_INT)
- m_Operand->SetInt(op1->GetInt() - op2->GetInt());
- else m_Operand->SetFloat(op1->GetFloat() - op2->GetFloat());
+ _operand->SetInt(op1->GetInt() - op2->GetInt());
+ else _operand->SetFloat(op1->GetFloat() - op2->GetFloat());
- m_Stack->Push(m_Operand);
+ _stack->Push(_operand);
break;
case II_MUL:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
- if (op1->IsNULL() || op2->IsNULL()) m_Operand->SetNULL();
+ if (op1->IsNULL() || op2->IsNULL()) _operand->SetNULL();
else if (op1->GetType() == VAL_INT && op2->GetType() == VAL_INT)
- m_Operand->SetInt(op1->GetInt() * op2->GetInt());
- else m_Operand->SetFloat(op1->GetFloat() * op2->GetFloat());
+ _operand->SetInt(op1->GetInt() * op2->GetInt());
+ else _operand->SetFloat(op1->GetFloat() * op2->GetFloat());
- m_Stack->Push(m_Operand);
+ _stack->Push(_operand);
break;
case II_DIV:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
if (op2->GetFloat() == 0.0f) RuntimeError("Division by zero.");
- if (op1->IsNULL() || op2->IsNULL() || op2->GetFloat() == 0.0f) m_Operand->SetNULL();
- else m_Operand->SetFloat(op1->GetFloat() / op2->GetFloat());
+ if (op1->IsNULL() || op2->IsNULL() || op2->GetFloat() == 0.0f) _operand->SetNULL();
+ else _operand->SetFloat(op1->GetFloat() / op2->GetFloat());
- m_Stack->Push(m_Operand);
+ _stack->Push(_operand);
break;
case II_MODULO:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
if (op2->GetInt() == 0) RuntimeError("Division by zero.");
- if (op1->IsNULL() || op2->IsNULL() || op2->GetInt() == 0) m_Operand->SetNULL();
- else m_Operand->SetInt(op1->GetInt() % op2->GetInt());
+ if (op1->IsNULL() || op2->IsNULL() || op2->GetInt() == 0) _operand->SetNULL();
+ else _operand->SetInt(op1->GetInt() % op2->GetInt());
- m_Stack->Push(m_Operand);
+ _stack->Push(_operand);
break;
case II_NOT:
- op1 = m_Stack->Pop();
- //if(op1->IsNULL()) m_Operand->SetNULL();
- if (op1->IsNULL()) m_Operand->SetBool(true);
- else m_Operand->SetBool(!op1->GetBool());
- m_Stack->Push(m_Operand);
+ op1 = _stack->Pop();
+ //if(op1->IsNULL()) _operand->SetNULL();
+ if (op1->IsNULL()) _operand->SetBool(true);
+ else _operand->SetBool(!op1->GetBool());
+ _stack->Push(_operand);
break;
case II_AND:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
if (op1 == NULL || op2 == NULL) {
RuntimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
- m_Operand->SetBool(false);
+ _operand->SetBool(false);
} else {
- m_Operand->SetBool(op1->GetBool() && op2->GetBool());
+ _operand->SetBool(op1->GetBool() && op2->GetBool());
}
- m_Stack->Push(m_Operand);
+ _stack->Push(_operand);
break;
case II_OR:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
if (op1 == NULL || op2 == NULL) {
RuntimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
- m_Operand->SetBool(false);
+ _operand->SetBool(false);
} else {
- m_Operand->SetBool(op1->GetBool() || op2->GetBool());
+ _operand->SetBool(op1->GetBool() || op2->GetBool());
}
- m_Stack->Push(m_Operand);
+ _stack->Push(_operand);
break;
case II_CMP_EQ:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
/*
- if((op1->IsNULL() && !op2->IsNULL()) || (!op1->IsNULL() && op2->IsNULL())) m_Operand->SetBool(false);
+ if((op1->IsNULL() && !op2->IsNULL()) || (!op1->IsNULL() && op2->IsNULL())) _operand->SetBool(false);
else if(op1->IsNative() && op2->IsNative()){
- m_Operand->SetBool(op1->GetNative() == op2->GetNative());
+ _operand->SetBool(op1->GetNative() == op2->GetNative());
}
else if(op1->GetType()==VAL_STRING || op2->GetType()==VAL_STRING){
- m_Operand->SetBool(scumm_stricmp(op1->GetString(), op2->GetString())==0);
+ _operand->SetBool(scumm_stricmp(op1->GetString(), op2->GetString())==0);
}
else if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- m_Operand->SetBool(op1->GetFloat() == op2->GetFloat());
+ _operand->SetBool(op1->GetFloat() == op2->GetFloat());
}
else{
- m_Operand->SetBool(op1->GetInt() == op2->GetInt());
+ _operand->SetBool(op1->GetInt() == op2->GetInt());
}
*/
- m_Operand->SetBool(CScValue::Compare(op1, op2) == 0);
- m_Stack->Push(m_Operand);
+ _operand->SetBool(CScValue::Compare(op1, op2) == 0);
+ _stack->Push(_operand);
break;
case II_CMP_NE:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
/*
- if((op1->IsNULL() && !op2->IsNULL()) || (!op1->IsNULL() && op2->IsNULL())) m_Operand->SetBool(true);
+ if((op1->IsNULL() && !op2->IsNULL()) || (!op1->IsNULL() && op2->IsNULL())) _operand->SetBool(true);
else if(op1->IsNative() && op2->IsNative()){
- m_Operand->SetBool(op1->GetNative() != op2->GetNative());
+ _operand->SetBool(op1->GetNative() != op2->GetNative());
}
else if(op1->GetType()==VAL_STRING || op2->GetType()==VAL_STRING){
- m_Operand->SetBool(scumm_stricmp(op1->GetString(), op2->GetString())!=0);
+ _operand->SetBool(scumm_stricmp(op1->GetString(), op2->GetString())!=0);
}
else if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- m_Operand->SetBool(op1->GetFloat() != op2->GetFloat());
+ _operand->SetBool(op1->GetFloat() != op2->GetFloat());
}
else{
- m_Operand->SetBool(op1->GetInt() != op2->GetInt());
+ _operand->SetBool(op1->GetInt() != op2->GetInt());
}
*/
- m_Operand->SetBool(CScValue::Compare(op1, op2) != 0);
- m_Stack->Push(m_Operand);
+ _operand->SetBool(CScValue::Compare(op1, op2) != 0);
+ _stack->Push(_operand);
break;
case II_CMP_L:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
/*
if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- m_Operand->SetBool(op1->GetFloat() < op2->GetFloat());
+ _operand->SetBool(op1->GetFloat() < op2->GetFloat());
}
- else m_Operand->SetBool(op1->GetInt() < op2->GetInt());
+ else _operand->SetBool(op1->GetInt() < op2->GetInt());
*/
- m_Operand->SetBool(CScValue::Compare(op1, op2) < 0);
- m_Stack->Push(m_Operand);
+ _operand->SetBool(CScValue::Compare(op1, op2) < 0);
+ _stack->Push(_operand);
break;
case II_CMP_G:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
/*
if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- m_Operand->SetBool(op1->GetFloat() > op2->GetFloat());
+ _operand->SetBool(op1->GetFloat() > op2->GetFloat());
}
- else m_Operand->SetBool(op1->GetInt() > op2->GetInt());
+ else _operand->SetBool(op1->GetInt() > op2->GetInt());
*/
- m_Operand->SetBool(CScValue::Compare(op1, op2) > 0);
- m_Stack->Push(m_Operand);
+ _operand->SetBool(CScValue::Compare(op1, op2) > 0);
+ _stack->Push(_operand);
break;
case II_CMP_LE:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
/*
if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- m_Operand->SetBool(op1->GetFloat() <= op2->GetFloat());
+ _operand->SetBool(op1->GetFloat() <= op2->GetFloat());
}
- else m_Operand->SetBool(op1->GetInt() <= op2->GetInt());
+ else _operand->SetBool(op1->GetInt() <= op2->GetInt());
*/
- m_Operand->SetBool(CScValue::Compare(op1, op2) <= 0);
- m_Stack->Push(m_Operand);
+ _operand->SetBool(CScValue::Compare(op1, op2) <= 0);
+ _stack->Push(_operand);
break;
case II_CMP_GE:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
/*
if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- m_Operand->SetBool(op1->GetFloat() >= op2->GetFloat());
+ _operand->SetBool(op1->GetFloat() >= op2->GetFloat());
}
- else m_Operand->SetBool(op1->GetInt() >= op2->GetInt());
+ else _operand->SetBool(op1->GetInt() >= op2->GetInt());
*/
- m_Operand->SetBool(CScValue::Compare(op1, op2) >= 0);
- m_Stack->Push(m_Operand);
+ _operand->SetBool(CScValue::Compare(op1, op2) >= 0);
+ _stack->Push(_operand);
break;
case II_CMP_STRICT_EQ:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
- //m_Operand->SetBool(op1->GetType()==op2->GetType() && op1->GetFloat()==op2->GetFloat());
- m_Operand->SetBool(CScValue::CompareStrict(op1, op2) == 0);
- m_Stack->Push(m_Operand);
+ //_operand->SetBool(op1->GetType()==op2->GetType() && op1->GetFloat()==op2->GetFloat());
+ _operand->SetBool(CScValue::CompareStrict(op1, op2) == 0);
+ _stack->Push(_operand);
break;
case II_CMP_STRICT_NE:
- op2 = m_Stack->Pop();
- op1 = m_Stack->Pop();
+ op2 = _stack->Pop();
+ op1 = _stack->Pop();
- //m_Operand->SetBool(op1->GetType()!=op2->GetType() || op1->GetFloat()!=op2->GetFloat());
- m_Operand->SetBool(CScValue::CompareStrict(op1, op2) != 0);
- m_Stack->Push(m_Operand);
+ //_operand->SetBool(op1->GetType()!=op2->GetType() || op1->GetFloat()!=op2->GetFloat());
+ _operand->SetBool(CScValue::CompareStrict(op1, op2) != 0);
+ _stack->Push(_operand);
break;
case II_DBG_LINE: {
int NewLine = GetDWORD();
- if (NewLine != m_CurrentLine) {
- m_CurrentLine = NewLine;
- if (Game->GetDebugMgr()->m_Enabled) {
- Game->GetDebugMgr()->OnScriptChangeLine(this, m_CurrentLine);
- for (int i = 0; i < m_Breakpoints.GetSize(); i++) {
- if (m_Breakpoints[i] == m_CurrentLine) {
+ if (NewLine != _currentLine) {
+ _currentLine = NewLine;
+ if (Game->GetDebugMgr()->_enabled) {
+ Game->GetDebugMgr()->OnScriptChangeLine(this, _currentLine);
+ for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ if (_breakpoints[i] == _currentLine) {
Game->GetDebugMgr()->OnScriptHitBreakpoint(this);
Sleep(0);
break;
}
}
- if (m_TracingMode) {
+ if (_tracingMode) {
Game->GetDebugMgr()->OnScriptHitBreakpoint(this);
Sleep(0);
break;
@@ -1010,8 +1010,8 @@ HRESULT CScScript::ExecuteInstruction() {
}
default:
- Game->LOG(0, "Fatal: Invalid instruction %d ('%s', line %d, IP:0x%x)\n", inst, m_Filename, m_CurrentLine, m_IP - sizeof(uint32));
- m_State = SCRIPT_FINISHED;
+ Game->LOG(0, "Fatal: Invalid instruction %d ('%s', line %d, IP:0x%x)\n", inst, _filename, _currentLine, _iP - sizeof(uint32));
+ _state = SCRIPT_FINISHED;
ret = E_FAIL;
} // switch(instruction)
@@ -1023,8 +1023,8 @@ HRESULT CScScript::ExecuteInstruction() {
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::GetFuncPos(const char *Name) {
- for (int i = 0; i < m_NumFunctions; i++) {
- if (strcmp(Name, m_Functions[i].name) == 0) return m_Functions[i].pos;
+ for (int i = 0; i < _numFunctions; i++) {
+ if (strcmp(Name, _functions[i].name) == 0) return _functions[i].pos;
}
return 0;
}
@@ -1032,8 +1032,8 @@ uint32 CScScript::GetFuncPos(const char *Name) {
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::GetMethodPos(const char *Name) {
- for (int i = 0; i < m_NumMethods; i++) {
- if (strcmp(Name, m_Methods[i].name) == 0) return m_Methods[i].pos;
+ for (int i = 0; i < _numMethods; i++) {
+ if (strcmp(Name, _methods[i].name) == 0) return _methods[i].pos;
}
return 0;
}
@@ -1044,31 +1044,31 @@ CScValue *CScScript::GetVar(char *Name) {
CScValue *ret = NULL;
// scope locals
- if (m_ScopeStack->m_SP >= 0) {
- if (m_ScopeStack->GetTop()->PropExists(Name)) ret = m_ScopeStack->GetTop()->GetProp(Name);
+ if (_scopeStack->_sP >= 0) {
+ if (_scopeStack->GetTop()->PropExists(Name)) ret = _scopeStack->GetTop()->GetProp(Name);
}
// script globals
if (ret == NULL) {
- if (m_Globals->PropExists(Name)) ret = m_Globals->GetProp(Name);
+ if (_globals->PropExists(Name)) ret = _globals->GetProp(Name);
}
// engine globals
if (ret == NULL) {
- if (m_Engine->m_Globals->PropExists(Name)) ret = m_Engine->m_Globals->GetProp(Name);
+ if (_engine->_globals->PropExists(Name)) ret = _engine->_globals->GetProp(Name);
}
if (ret == NULL) {
//RuntimeError("Variable '%s' is inaccessible in the current block. Consider changing the script.", Name);
- Game->LOG(0, "Warning: variable '%s' is inaccessible in the current block. Consider changing the script (script:%s, line:%d)", Name, m_Filename, m_CurrentLine);
+ Game->LOG(0, "Warning: variable '%s' is inaccessible in the current block. Consider changing the script (script:%s, line:%d)", Name, _filename, _currentLine);
CScValue *Val = new CScValue(Game);
- CScValue *Scope = m_ScopeStack->GetTop();
+ CScValue *Scope = _scopeStack->GetTop();
if (Scope) {
Scope->SetProp(Name, Val);
- ret = m_ScopeStack->GetTop()->GetProp(Name);
+ ret = _scopeStack->GetTop()->GetProp(Name);
} else {
- m_Globals->SetProp(Name, Val);
- ret = m_Globals->GetProp(Name);
+ _globals->SetProp(Name, Val);
+ ret = _globals->GetProp(Name);
}
delete Val;
}
@@ -1079,38 +1079,38 @@ CScValue *CScScript::GetVar(char *Name) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::WaitFor(CBObject *Object) {
- if (m_Unbreakable) {
+ if (_unbreakable) {
RuntimeError("Script cannot be interrupted.");
return S_OK;
}
- m_State = SCRIPT_WAITING;
- m_WaitObject = Object;
+ _state = SCRIPT_WAITING;
+ _waitObject = Object;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::WaitForExclusive(CBObject *Object) {
- m_Engine->ResetObject(Object);
+ _engine->ResetObject(Object);
return WaitFor(Object);
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::Sleep(uint32 Duration) {
- if (m_Unbreakable) {
+ if (_unbreakable) {
RuntimeError("Script cannot be interrupted.");
return S_OK;
}
- m_State = SCRIPT_SLEEPING;
- if (Game->m_State == GAME_FROZEN) {
- m_WaitTime = CBPlatform::GetTime() + Duration;
- m_WaitFrozen = true;
+ _state = SCRIPT_SLEEPING;
+ if (Game->_state == GAME_FROZEN) {
+ _waitTime = CBPlatform::GetTime() + Duration;
+ _waitFrozen = true;
} else {
- m_WaitTime = Game->m_Timer + Duration;
- m_WaitFrozen = false;
+ _waitTime = Game->_timer + Duration;
+ _waitFrozen = false;
}
return S_OK;
}
@@ -1118,10 +1118,10 @@ HRESULT CScScript::Sleep(uint32 Duration) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::Finish(bool IncludingThreads) {
- if (m_State != SCRIPT_FINISHED && IncludingThreads) {
- m_State = SCRIPT_FINISHED;
+ if (_state != SCRIPT_FINISHED && IncludingThreads) {
+ _state = SCRIPT_FINISHED;
FinishThreads();
- } else m_State = SCRIPT_FINISHED;
+ } else _state = SCRIPT_FINISHED;
return S_OK;
@@ -1130,7 +1130,7 @@ HRESULT CScScript::Finish(bool IncludingThreads) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::Run() {
- m_State = SCRIPT_RUNNING;
+ _state = SCRIPT_RUNNING;
return S_OK;
}
@@ -1144,10 +1144,10 @@ void CScScript::RuntimeError(LPCSTR fmt, ...) {
vsprintf(buff, fmt, va);
va_end(va);
- Game->LOG(0, "Runtime error. Script '%s', line %d", m_Filename, m_CurrentLine);
+ Game->LOG(0, "Runtime error. Script '%s', line %d", _filename, _currentLine);
Game->LOG(0, " %s", buff);
- if (!Game->m_SuppressScriptErrors)
+ if (!Game->_suppressScriptErrors)
Game->QuickMessage("Script runtime error. View log for details.");
}
@@ -1158,53 +1158,53 @@ HRESULT CScScript::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
// buffer
- if (PersistMgr->m_Saving) {
- if (m_State != SCRIPT_PERSISTENT && m_State != SCRIPT_FINISHED && m_State != SCRIPT_THREAD_FINISHED) {
- PersistMgr->Transfer(TMEMBER(m_BufferSize));
- PersistMgr->PutBytes(m_Buffer, m_BufferSize);
+ if (PersistMgr->_saving) {
+ if (_state != SCRIPT_PERSISTENT && _state != SCRIPT_FINISHED && _state != SCRIPT_THREAD_FINISHED) {
+ PersistMgr->Transfer(TMEMBER(_bufferSize));
+ PersistMgr->PutBytes(_buffer, _bufferSize);
} else {
// don't save idle/finished scripts
int bufferSize = 0;
PersistMgr->Transfer(TMEMBER(bufferSize));
}
} else {
- PersistMgr->Transfer(TMEMBER(m_BufferSize));
- if (m_BufferSize > 0) {
- m_Buffer = new byte[m_BufferSize];
- PersistMgr->GetBytes(m_Buffer, m_BufferSize);
+ PersistMgr->Transfer(TMEMBER(_bufferSize));
+ if (_bufferSize > 0) {
+ _buffer = new byte[_bufferSize];
+ PersistMgr->GetBytes(_buffer, _bufferSize);
InitTables();
- } else m_Buffer = NULL;
+ } else _buffer = NULL;
}
- PersistMgr->Transfer(TMEMBER(m_CallStack));
- PersistMgr->Transfer(TMEMBER(m_CurrentLine));
- PersistMgr->Transfer(TMEMBER(m_Engine));
- PersistMgr->Transfer(TMEMBER(m_Filename));
- PersistMgr->Transfer(TMEMBER(m_Freezable));
- PersistMgr->Transfer(TMEMBER(m_Globals));
- PersistMgr->Transfer(TMEMBER(m_IP));
- PersistMgr->Transfer(TMEMBER(m_ScopeStack));
- PersistMgr->Transfer(TMEMBER(m_Stack));
- PersistMgr->Transfer(TMEMBER_INT(m_State));
- PersistMgr->Transfer(TMEMBER(m_Operand));
- PersistMgr->Transfer(TMEMBER_INT(m_OrigState));
- PersistMgr->Transfer(TMEMBER(m_Owner));
- PersistMgr->Transfer(TMEMBER(m_Reg1));
- PersistMgr->Transfer(TMEMBER(m_Thread));
- PersistMgr->Transfer(TMEMBER(m_ThreadEvent));
- PersistMgr->Transfer(TMEMBER(m_ThisStack));
- PersistMgr->Transfer(TMEMBER(m_TimeSlice));
- PersistMgr->Transfer(TMEMBER(m_WaitObject));
- PersistMgr->Transfer(TMEMBER(m_WaitScript));
- PersistMgr->Transfer(TMEMBER(m_WaitTime));
- PersistMgr->Transfer(TMEMBER(m_WaitFrozen));
-
- PersistMgr->Transfer(TMEMBER(m_MethodThread));
- PersistMgr->Transfer(TMEMBER(m_MethodThread));
- PersistMgr->Transfer(TMEMBER(m_Unbreakable));
- PersistMgr->Transfer(TMEMBER(m_ParentScript));
-
- if (!PersistMgr->m_Saving) m_TracingMode = false;
+ PersistMgr->Transfer(TMEMBER(_callStack));
+ PersistMgr->Transfer(TMEMBER(_currentLine));
+ PersistMgr->Transfer(TMEMBER(_engine));
+ PersistMgr->Transfer(TMEMBER(_filename));
+ PersistMgr->Transfer(TMEMBER(_freezable));
+ PersistMgr->Transfer(TMEMBER(_globals));
+ PersistMgr->Transfer(TMEMBER(_iP));
+ PersistMgr->Transfer(TMEMBER(_scopeStack));
+ PersistMgr->Transfer(TMEMBER(_stack));
+ PersistMgr->Transfer(TMEMBER_INT(_state));
+ PersistMgr->Transfer(TMEMBER(_operand));
+ PersistMgr->Transfer(TMEMBER_INT(_origState));
+ PersistMgr->Transfer(TMEMBER(_owner));
+ PersistMgr->Transfer(TMEMBER(_reg1));
+ PersistMgr->Transfer(TMEMBER(_thread));
+ PersistMgr->Transfer(TMEMBER(_threadEvent));
+ PersistMgr->Transfer(TMEMBER(_thisStack));
+ PersistMgr->Transfer(TMEMBER(_timeSlice));
+ PersistMgr->Transfer(TMEMBER(_waitObject));
+ PersistMgr->Transfer(TMEMBER(_waitScript));
+ PersistMgr->Transfer(TMEMBER(_waitTime));
+ PersistMgr->Transfer(TMEMBER(_waitFrozen));
+
+ PersistMgr->Transfer(TMEMBER(_methodThread));
+ PersistMgr->Transfer(TMEMBER(_methodThread));
+ PersistMgr->Transfer(TMEMBER(_unbreakable));
+ PersistMgr->Transfer(TMEMBER(_parentScript));
+
+ if (!PersistMgr->_saving) _tracingMode = false;
return S_OK;
}
@@ -1212,17 +1212,17 @@ HRESULT CScScript::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
CScScript *CScScript::InvokeEventHandler(const char *EventName, bool Unbreakable) {
- //if(m_State!=SCRIPT_PERSISTENT) return NULL;
+ //if(_state!=SCRIPT_PERSISTENT) return NULL;
uint32 pos = GetEventPos(EventName);
if (!pos) return NULL;
- CScScript *thread = new CScScript(Game, m_Engine);
+ CScScript *thread = new CScScript(Game, _engine);
if (thread) {
HRESULT ret = thread->CreateThread(this, pos, EventName);
if (SUCCEEDED(ret)) {
- thread->m_Unbreakable = Unbreakable;
- m_Engine->m_Scripts.Add(thread);
+ thread->_unbreakable = Unbreakable;
+ _engine->_scripts.Add(thread);
Game->GetDebugMgr()->OnScriptEventThreadInit(thread, this, EventName);
return thread;
} else {
@@ -1236,8 +1236,8 @@ CScScript *CScScript::InvokeEventHandler(const char *EventName, bool Unbreakable
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::GetEventPos(const char *Name) {
- for (int i = m_NumEvents - 1; i >= 0; i--) {
- if (scumm_stricmp(Name, m_Events[i].name) == 0) return m_Events[i].pos;
+ for (int i = _numEvents - 1; i >= 0; i--) {
+ if (scumm_stricmp(Name, _events[i].name) == 0) return _events[i].pos;
}
return 0;
}
@@ -1257,15 +1257,15 @@ bool CScScript::CanHandleMethod(char *MethodName) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::Pause() {
- if (m_State == SCRIPT_PAUSED) {
- Game->LOG(0, "Attempting to pause a paused script ('%s', line %d)", m_Filename, m_CurrentLine);
+ if (_state == SCRIPT_PAUSED) {
+ Game->LOG(0, "Attempting to pause a paused script ('%s', line %d)", _filename, _currentLine);
return E_FAIL;
}
- if (!m_Freezable || m_State == SCRIPT_PERSISTENT) return S_OK;
+ if (!_freezable || _state == SCRIPT_PERSISTENT) return S_OK;
- m_OrigState = m_State;
- m_State = SCRIPT_PAUSED;
+ _origState = _state;
+ _state = SCRIPT_PAUSED;
return S_OK;
}
@@ -1273,17 +1273,17 @@ HRESULT CScScript::Pause() {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::Resume() {
- if (m_State != SCRIPT_PAUSED) return S_OK;
+ if (_state != SCRIPT_PAUSED) return S_OK;
- m_State = m_OrigState;
+ _state = _origState;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
CScScript::TExternalFunction *CScScript::GetExternal(char *Name) {
- for (int i = 0; i < m_NumExternals; i++) {
- if (strcmp(Name, m_Externals[i].name) == 0) return &m_Externals[i];
+ for (int i = 0; i < _numExternals; i++) {
+ if (strcmp(Name, _externals[i].name) == 0) return &_externals[i];
}
return NULL;
}
@@ -1309,10 +1309,10 @@ HRESULT CScScript::ExternalCall(CScStack *Stack, CScStack *ThisStack, CScScript:
if (pFunc) {
int i;
Success = true;
- Stack->CorrectParams(Function->num_params);
+ Stack->CorrectParams(Function->nu_params);
CBDynBuffer *Buffer = new CBDynBuffer(Game, 20 * sizeof(uint32));
- for (i = 0; i < Function->num_params; i++) {
+ for (i = 0; i < Function->nu_params; i++) {
CScValue *Val = Stack->Pop();
switch (Function->params[i]) {
case TYPE_BOOL:
@@ -1353,10 +1353,10 @@ HRESULT CScScript::ExternalCall(CScStack *Stack, CScStack *ThisStack, CScScript:
bool StackCorrupted = false;
switch (Function->call_type) {
case CALL_CDECL:
- ret = Call_cdecl(Buffer->m_Buffer, Buffer->GetSize(), (uint32)pFunc, &StackCorrupted);
+ ret = Call_cdecl(Buffer->_buffer, Buffer->GetSize(), (uint32)pFunc, &StackCorrupted);
break;
default:
- ret = Call_stdcall(Buffer->m_Buffer, Buffer->GetSize(), (uint32)pFunc, &StackCorrupted);
+ ret = Call_stdcall(Buffer->_buffer, Buffer->GetSize(), (uint32)pFunc, &StackCorrupted);
}
delete Buffer;
@@ -1493,9 +1493,9 @@ HRESULT CScScript::CopyParameters(CScStack *Stack) {
int i;
int NumParams = Stack->Pop()->GetInt();
for (i = NumParams - 1; i >= 0; i--) {
- m_Stack->Push(Stack->GetAt(i));
+ _stack->Push(Stack->GetAt(i));
}
- m_Stack->PushInt(NumParams);
+ _stack->PushInt(NumParams);
for (i = 0; i < NumParams; i++) Stack->Pop();
@@ -1505,9 +1505,9 @@ HRESULT CScScript::CopyParameters(CScStack *Stack) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::FinishThreads() {
- for (int i = 0; i < m_Engine->m_Scripts.GetSize(); i++) {
- CScScript *Scr = m_Engine->m_Scripts[i];
- if (Scr->m_Thread && Scr->m_State != SCRIPT_FINISHED && Scr->m_Owner == m_Owner && scumm_stricmp(Scr->m_Filename, m_Filename) == 0)
+ 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);
}
return S_OK;
@@ -1517,19 +1517,19 @@ HRESULT CScScript::FinishThreads() {
//////////////////////////////////////////////////////////////////////////
// IWmeDebugScript interface implementation
int CScScript::DbgGetLine() {
- return m_CurrentLine;
+ return _currentLine;
}
//////////////////////////////////////////////////////////////////////////
const char *CScScript::DbgGetFilename() {
- return m_Filename;
+ return _filename;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::DbgSendScript(IWmeDebugClient *Client) {
- if (m_MethodThread) Client->OnScriptMethodThreadInit(this, m_ParentScript, m_ThreadEvent);
- else if (m_Thread) Client->OnScriptEventThreadInit(this, m_ParentScript, m_ThreadEvent);
+ if (_methodThread) Client->OnScriptMethodThreadInit(this, _parentScript, _threadEvent);
+ else if (_thread) Client->OnScriptEventThreadInit(this, _parentScript, _threadEvent);
else Client->OnScriptInit(this);
return DbgSendVariables(Client);
@@ -1539,12 +1539,12 @@ HRESULT CScScript::DbgSendScript(IWmeDebugClient *Client) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::DbgSendVariables(IWmeDebugClient *Client) {
// send script globals
- m_Globals->DbgSendVariables(Client, WME_DBGVAR_SCRIPT, this, 0);
+ _globals->DbgSendVariables(Client, WME_DBGVAR_SCRIPT, this, 0);
// send scope variables
- if (m_ScopeStack->m_SP >= 0) {
- for (int i = 0; i <= m_ScopeStack->m_SP; i++) {
- CScValue *Scope = m_ScopeStack->GetAt(i);
+ if (_scopeStack->_sP >= 0) {
+ for (int i = 0; i <= _scopeStack->_sP; i++) {
+ CScValue *Scope = _scopeStack->GetAt(i);
//Scope->DbgSendVariables(Client, WME_DBGVAR_SCOPE, this, (unsigned int)Scope);
}
}
@@ -1554,44 +1554,44 @@ HRESULT CScScript::DbgSendVariables(IWmeDebugClient *Client) {
//////////////////////////////////////////////////////////////////////////
TScriptState CScScript::DbgGetState() {
- return m_State;
+ return _state;
}
//////////////////////////////////////////////////////////////////////////
int CScScript::DbgGetNumBreakpoints() {
- return m_Breakpoints.GetSize();
+ return _breakpoints.GetSize();
}
//////////////////////////////////////////////////////////////////////////
int CScScript::DbgGetBreakpoint(int Index) {
- if (Index >= 0 && Index < m_Breakpoints.GetSize()) return m_Breakpoints[Index];
+ if (Index >= 0 && Index < _breakpoints.GetSize()) return _breakpoints[Index];
else return -1;
}
//////////////////////////////////////////////////////////////////////////
bool CScScript::DbgSetTracingMode(bool IsTracing) {
- m_TracingMode = IsTracing;
+ _tracingMode = IsTracing;
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CScScript::DbgGetTracingMode() {
- return m_TracingMode;
+ return _tracingMode;
}
//////////////////////////////////////////////////////////////////////////
void CScScript::AfterLoad() {
- if (m_Buffer == NULL) {
- byte *buffer = m_Engine->GetCompiledScript(m_Filename, &m_BufferSize);
+ if (_buffer == NULL) {
+ byte *buffer = _engine->GetCompiledScript(_filename, &_bufferSize);
if (!buffer) {
- Game->LOG(0, "Error reinitializing script '%s' after load. Script will be terminated.", m_Filename);
- m_State = SCRIPT_ERROR;
+ Game->LOG(0, "Error reinitializing script '%s' after load. Script will be terminated.", _filename);
+ _state = SCRIPT_ERROR;
return;
}
- m_Buffer = new byte [m_BufferSize];
- memcpy(m_Buffer, buffer, m_BufferSize);
+ _buffer = new byte [_bufferSize];
+ memcpy(_buffer, buffer, _bufferSize);
InitTables();
}
diff --git a/engines/wintermute/scriptables/ScScript.h b/engines/wintermute/scriptables/ScScript.h
index 6f467437da..57baf8d92a 100644
--- a/engines/wintermute/scriptables/ScScript.h
+++ b/engines/wintermute/scriptables/ScScript.h
@@ -46,11 +46,11 @@ public:
HRESULT DbgSendScript(IWmeDebugClient *Client);
HRESULT DbgSendVariables(IWmeDebugClient *Client);
- CBArray<int, int> m_Breakpoints;
- bool m_TracingMode;
+ CBArray<int, int> _breakpoints;
+ bool _tracingMode;
- CScScript *m_ParentScript;
- bool m_Unbreakable;
+ CScScript *_parentScript;
+ bool _unbreakable;
HRESULT FinishThreads();
HRESULT CopyParameters(CScStack *Stack);
@@ -63,9 +63,9 @@ public:
static double GetST0Double(void);
#endif
- CScValue *m_Operand;
- CScValue *m_Reg1;
- bool m_Freezable;
+ CScValue *_operand;
+ CScValue *_reg1;
+ bool _freezable;
HRESULT Resume();
HRESULT Pause();
bool CanHandleEvent(char *EventName);
@@ -73,7 +73,7 @@ public:
HRESULT CreateThread(CScScript *Original, uint32 InitIP, const char *EventName);
HRESULT CreateMethodThread(CScScript *Original, const char *MethodName);
CScScript *InvokeEventHandler(const char *EventName, bool Unbreakable = false);
- uint32 m_TimeSlice;
+ uint32 _timeSlice;
DECLARE_PERSISTENT(CScScript, CBBase)
void RuntimeError(LPCSTR fmt, ...);
HRESULT Run();
@@ -81,12 +81,12 @@ public:
HRESULT Sleep(uint32 Duration);
HRESULT WaitForExclusive(CBObject *Object);
HRESULT WaitFor(CBObject *Object);
- uint32 m_WaitTime;
- bool m_WaitFrozen;
- CBObject *m_WaitObject;
- CScScript *m_WaitScript;
- TScriptState m_State;
- TScriptState m_OrigState;
+ uint32 _waitTime;
+ bool _waitFrozen;
+ CBObject *_waitObject;
+ CScScript *_waitScript;
+ TScriptState _state;
+ TScriptState _origState;
CScValue *GetVar(char *Name);
uint32 GetFuncPos(const char *Name);
uint32 GetEventPos(const char *Name);
@@ -123,44 +123,44 @@ public:
char *dll_name;
TCallType call_type;
TExternalType returns;
- int num_params;
+ int nu_params;
TExternalType *params;
} TExternalFunction;
- CScStack *m_CallStack;
- CScStack *m_ThisStack;
- CScStack *m_ScopeStack;
- CScStack *m_Stack;
- CScValue *m_Globals;
- CScEngine *m_Engine;
- int m_CurrentLine;
+ CScStack *_callStack;
+ CScStack *_thisStack;
+ CScStack *_scopeStack;
+ CScStack *_stack;
+ CScValue *_globals;
+ CScEngine *_engine;
+ int _currentLine;
HRESULT ExecuteInstruction();
char *GetString();
uint32 GetDWORD();
double GetFloat();
void Cleanup();
HRESULT Create(char *Filename, byte *Buffer, uint32 Size, CBScriptHolder *Owner);
- uint32 m_IP;
- uint32 m_BufferSize;
- byte *m_Buffer;
+ uint32 _iP;
+ uint32 _bufferSize;
+ byte *_buffer;
CScScript(CBGame *inGame, CScEngine *Engine);
virtual ~CScScript();
- char *m_Filename;
- char **m_Symbols;
- int m_NumSymbols;
- TFunctionPos *m_Functions;
- TMethodPos *m_Methods;
- TEventPos *m_Events;
- int m_NumExternals;
- TExternalFunction *m_Externals;
- int m_NumFunctions;
- int m_NumMethods;
- int m_NumEvents;
- bool m_Thread;
- bool m_MethodThread;
- char *m_ThreadEvent;
- CBScriptHolder *m_Owner;
+ char *_filename;
+ char **_symbols;
+ int _numSymbols;
+ TFunctionPos *_functions;
+ TMethodPos *_methods;
+ TEventPos *_events;
+ int _numExternals;
+ TExternalFunction *_externals;
+ int _numFunctions;
+ int _numMethods;
+ int _numEvents;
+ bool _thread;
+ bool _methodThread;
+ char *_threadEvent;
+ CBScriptHolder *_owner;
CScScript::TExternalFunction *GetExternal(char *Name);
HRESULT ExternalCall(CScStack *Stack, CScStack *ThisStack, CScScript::TExternalFunction *Function);
private:
diff --git a/engines/wintermute/scriptables/ScStack.cpp b/engines/wintermute/scriptables/ScStack.cpp
index 7975223516..c7b724e9b2 100644
--- a/engines/wintermute/scriptables/ScStack.cpp
+++ b/engines/wintermute/scriptables/ScStack.cpp
@@ -36,7 +36,7 @@ IMPLEMENT_PERSISTENT(CScStack, false)
//////////////////////////////////////////////////////////////////////////
CScStack::CScStack(CBGame *inGame): CBBase(inGame) {
- m_SP = -1;
+ _sP = -1;
}
@@ -44,95 +44,95 @@ CScStack::CScStack(CBGame *inGame): CBBase(inGame) {
CScStack::~CScStack() {
#if _DEBUG
- //Game->LOG(0, "STAT: Stack size: %d, SP=%d", m_Values.GetSize(), m_SP);
+ //Game->LOG(0, "STAT: Stack size: %d, SP=%d", _values.GetSize(), _sP);
#endif
- for (int i = 0; i < m_Values.GetSize(); i++) {
- delete m_Values[i];
+ for (int i = 0; i < _values.GetSize(); i++) {
+ delete _values[i];
}
- m_Values.RemoveAll();
+ _values.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
CScValue *CScStack::Pop() {
- if (m_SP < 0) {
+ if (_sP < 0) {
Game->LOG(0, "Fatal: Stack underflow");
return NULL;
}
- return m_Values[m_SP--];
+ return _values[_sP--];
}
//////////////////////////////////////////////////////////////////////////
void CScStack::Push(CScValue *Val) {
- m_SP++;
+ _sP++;
- if (m_SP < m_Values.GetSize()) {
- m_Values[m_SP]->Cleanup();
- m_Values[m_SP]->Copy(Val);
+ if (_sP < _values.GetSize()) {
+ _values[_sP]->Cleanup();
+ _values[_sP]->Copy(Val);
} else {
CScValue *val = new CScValue(Game);
val->Copy(Val);
- m_Values.Add(val);
+ _values.Add(val);
}
}
//////////////////////////////////////////////////////////////////////////
CScValue *CScStack::GetPushValue() {
- m_SP++;
+ _sP++;
- if (m_SP >= m_Values.GetSize()) {
+ if (_sP >= _values.GetSize()) {
CScValue *val = new CScValue(Game);
- m_Values.Add(val);
+ _values.Add(val);
}
- m_Values[m_SP]->Cleanup();
- return m_Values[m_SP];
+ _values[_sP]->Cleanup();
+ return _values[_sP];
}
//////////////////////////////////////////////////////////////////////////
CScValue *CScStack::GetTop() {
- if (m_SP < 0 || m_SP >= m_Values.GetSize()) return NULL;
- else return m_Values[m_SP];
+ if (_sP < 0 || _sP >= _values.GetSize()) return NULL;
+ else return _values[_sP];
}
//////////////////////////////////////////////////////////////////////////
CScValue *CScStack::GetAt(int Index) {
- Index = m_SP - Index;
- if (Index < 0 || Index >= m_Values.GetSize()) return NULL;
- else return m_Values[Index];
+ Index = _sP - Index;
+ if (Index < 0 || Index >= _values.GetSize()) return NULL;
+ else return _values[Index];
}
//////////////////////////////////////////////////////////////////////////
void CScStack::CorrectParams(uint32 expected_params) {
- int num_params = Pop()->GetInt();
+ int nu_params = Pop()->GetInt();
- if (expected_params < num_params) { // too many params
- while (expected_params < num_params) {
+ if (expected_params < nu_params) { // too many params
+ while (expected_params < nu_params) {
//Pop();
- delete m_Values[m_SP - expected_params];
- m_Values.RemoveAt(m_SP - expected_params);
- num_params--;
- m_SP--;
+ delete _values[_sP - expected_params];
+ _values.RemoveAt(_sP - expected_params);
+ nu_params--;
+ _sP--;
}
- } else if (expected_params > num_params) { // need more params
- while (expected_params > num_params) {
+ } else if (expected_params > nu_params) { // need more params
+ while (expected_params > nu_params) {
//Push(null_val);
CScValue *null_val = new CScValue(Game);
null_val->SetNULL();
- m_Values.InsertAt(m_SP - num_params + 1, null_val);
- num_params++;
- m_SP++;
+ _values.InsertAt(_sP - nu_params + 1, null_val);
+ nu_params++;
+ _sP++;
- if (m_Values.GetSize() > m_SP + 1) {
- delete m_Values[m_Values.GetSize() - 1];
- m_Values.RemoveAt(m_Values.GetSize() - 1);
+ if (_values.GetSize() > _sP + 1) {
+ delete _values[_values.GetSize() - 1];
+ _values.RemoveAt(_values.GetSize() - 1);
}
}
}
@@ -217,8 +217,8 @@ HRESULT CScStack::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_SP));
- m_Values.Persist(PersistMgr);
+ PersistMgr->Transfer(TMEMBER(_sP));
+ _values.Persist(PersistMgr);
return S_OK;
}
diff --git a/engines/wintermute/scriptables/ScStack.h b/engines/wintermute/scriptables/ScStack.h
index 70d54cbbe4..113fb4c19f 100644
--- a/engines/wintermute/scriptables/ScStack.h
+++ b/engines/wintermute/scriptables/ScStack.h
@@ -56,8 +56,8 @@ public:
CScValue *Pop();
CScStack(CBGame *inGame);
virtual ~CScStack();
- CBArray<CScValue *, CScValue *> m_Values;
- int m_SP;
+ CBArray<CScValue *, CScValue *> _values;
+ int _sP;
};
diff --git a/engines/wintermute/scriptables/ScValue.cpp b/engines/wintermute/scriptables/ScValue.cpp
index b843e2032c..055f9830ad 100644
--- a/engines/wintermute/scriptables/ScValue.cpp
+++ b/engines/wintermute/scriptables/ScValue.cpp
@@ -44,77 +44,77 @@ IMPLEMENT_PERSISTENT(CScValue, false)
//////////////////////////////////////////////////////////////////////////
CScValue::CScValue(CBGame *inGame): CBBase(inGame) {
- m_Type = VAL_NULL;
-
- m_ValBool = false;
- m_ValInt = 0;
- m_ValFloat = 0.0f;
- m_ValNative = NULL;
- m_ValString = NULL;
- m_ValRef = NULL;
- m_Persistent = false;
- m_IsConstVar = false;
+ _type = VAL_NULL;
+
+ _valBool = false;
+ _valInt = 0;
+ _valFloat = 0.0f;
+ _valNative = NULL;
+ _valString = NULL;
+ _valRef = NULL;
+ _persistent = false;
+ _isConstVar = false;
}
//////////////////////////////////////////////////////////////////////////
CScValue::CScValue(CBGame *inGame, bool Val): CBBase(inGame) {
- m_Type = VAL_BOOL;
- m_ValBool = Val;
-
- m_ValInt = 0;
- m_ValFloat = 0.0f;
- m_ValNative = NULL;
- m_ValString = NULL;
- m_ValRef = NULL;
- m_Persistent = false;
- m_IsConstVar = false;
+ _type = VAL_BOOL;
+ _valBool = Val;
+
+ _valInt = 0;
+ _valFloat = 0.0f;
+ _valNative = NULL;
+ _valString = NULL;
+ _valRef = NULL;
+ _persistent = false;
+ _isConstVar = false;
}
//////////////////////////////////////////////////////////////////////////
CScValue::CScValue(CBGame *inGame, int Val): CBBase(inGame) {
- m_Type = VAL_INT;
- m_ValInt = Val;
-
- m_ValFloat = 0.0f;
- m_ValBool = false;
- m_ValNative = NULL;
- m_ValString = NULL;
- m_ValRef = NULL;
- m_Persistent = false;
- m_IsConstVar = false;
+ _type = VAL_INT;
+ _valInt = Val;
+
+ _valFloat = 0.0f;
+ _valBool = false;
+ _valNative = NULL;
+ _valString = NULL;
+ _valRef = NULL;
+ _persistent = false;
+ _isConstVar = false;
}
//////////////////////////////////////////////////////////////////////////
CScValue::CScValue(CBGame *inGame, double Val): CBBase(inGame) {
- m_Type = VAL_FLOAT;
- m_ValFloat = Val;
-
- m_ValInt = 0;
- m_ValBool = false;
- m_ValNative = NULL;
- m_ValString = NULL;
- m_ValRef = NULL;
- m_Persistent = false;
- m_IsConstVar = false;
+ _type = VAL_FLOAT;
+ _valFloat = Val;
+
+ _valInt = 0;
+ _valBool = false;
+ _valNative = NULL;
+ _valString = NULL;
+ _valRef = NULL;
+ _persistent = false;
+ _isConstVar = false;
}
//////////////////////////////////////////////////////////////////////////
CScValue::CScValue(CBGame *inGame, const char *Val): CBBase(inGame) {
- m_Type = VAL_STRING;
- m_ValString = NULL;
+ _type = VAL_STRING;
+ _valString = NULL;
SetStringVal(Val);
- m_ValBool = false;
- m_ValInt = 0;
- m_ValFloat = 0.0f;
- m_ValNative = NULL;
- m_ValRef = NULL;
- m_Persistent = false;
- m_IsConstVar = false;
+ _valBool = false;
+ _valInt = 0;
+ _valFloat = 0.0f;
+ _valNative = NULL;
+ _valRef = NULL;
+ _persistent = false;
+ _isConstVar = false;
}
@@ -122,29 +122,29 @@ CScValue::CScValue(CBGame *inGame, const char *Val): CBBase(inGame) {
void CScValue::Cleanup(bool IgnoreNatives) {
DeleteProps();
- if (m_ValString) delete [] m_ValString;
+ if (_valString) delete [] _valString;
if (!IgnoreNatives) {
- if (m_ValNative && !m_Persistent) {
- m_ValNative->m_RefCount--;
- if (m_ValNative->m_RefCount <= 0) {
- delete m_ValNative;
- m_ValNative = NULL;
+ if (_valNative && !_persistent) {
+ _valNative->_refCount--;
+ if (_valNative->_refCount <= 0) {
+ delete _valNative;
+ _valNative = NULL;
}
}
}
- m_Type = VAL_NULL;
+ _type = VAL_NULL;
- m_ValBool = false;
- m_ValInt = 0;
- m_ValFloat = 0.0f;
- m_ValNative = NULL;
- m_ValString = NULL;
- m_ValRef = NULL;
- m_Persistent = false;
- m_IsConstVar = false;
+ _valBool = false;
+ _valInt = 0;
+ _valFloat = 0.0f;
+ _valNative = NULL;
+ _valString = NULL;
+ _valRef = NULL;
+ _persistent = false;
+ _isConstVar = false;
}
@@ -157,44 +157,44 @@ CScValue::~CScValue() {
//////////////////////////////////////////////////////////////////////////
CScValue *CScValue::GetProp(char *Name) {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->GetProp(Name);
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetProp(Name);
- if (m_Type == VAL_STRING && strcmp(Name, "Length") == 0) {
- Game->m_ScValue->m_Type = VAL_INT;
+ if (_type == VAL_STRING && strcmp(Name, "Length") == 0) {
+ Game->_scValue->_type = VAL_INT;
#if 0 // TODO: Remove FreeType-dependency
- if (Game->m_TextEncoding == TEXT_ANSI) {
+ if (Game->_textEncoding == TEXT_ANSI) {
#else
if (true) {
#endif
- Game->m_ScValue->SetInt(strlen(m_ValString));
+ Game->_scValue->SetInt(strlen(_valString));
} else {
- WideString wstr = StringUtil::Utf8ToWide(m_ValString);
- Game->m_ScValue->SetInt(wstr.size());
+ WideString wstr = StringUtil::Utf8ToWide(_valString);
+ Game->_scValue->SetInt(wstr.size());
}
- return Game->m_ScValue;
+ return Game->_scValue;
}
CScValue *ret = NULL;
- if (m_Type == VAL_NATIVE && m_ValNative) ret = m_ValNative->ScGetProperty(Name);
+ if (_type == VAL_NATIVE && _valNative) ret = _valNative->ScGetProperty(Name);
if (ret == NULL) {
- m_ValIter = m_ValObject.find(Name);
- if (m_ValIter != m_ValObject.end()) ret = m_ValIter->_value;
+ _valIter = _valObject.find(Name);
+ if (_valIter != _valObject.end()) ret = _valIter->_value;
}
return ret;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CScValue::DeleteProp(char *Name) {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->DeleteProp(Name);
+ if (_type == VAL_VARIABLE_REF) return _valRef->DeleteProp(Name);
- m_ValIter = m_ValObject.find(Name);
- if (m_ValIter != m_ValObject.end()) {
- delete m_ValIter->_value;
- m_ValIter->_value = NULL;
+ _valIter = _valObject.find(Name);
+ if (_valIter != _valObject.end()) {
+ delete _valIter->_value;
+ _valIter->_value = NULL;
}
return S_OK;
@@ -204,41 +204,41 @@ HRESULT CScValue::DeleteProp(char *Name) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScValue::SetProp(char *Name, CScValue *Val, bool CopyWhole, bool SetAsConst) {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->SetProp(Name, Val);
+ if (_type == VAL_VARIABLE_REF) return _valRef->SetProp(Name, Val);
HRESULT ret = E_FAIL;
- if (m_Type == VAL_NATIVE && m_ValNative) {
- ret = m_ValNative->ScSetProperty(Name, Val);
+ if (_type == VAL_NATIVE && _valNative) {
+ ret = _valNative->ScSetProperty(Name, Val);
}
if (FAILED(ret)) {
CScValue *val = NULL;
- m_ValIter = m_ValObject.find(Name);
- if (m_ValIter != m_ValObject.end()) {
- val = m_ValIter->_value;
+ _valIter = _valObject.find(Name);
+ if (_valIter != _valObject.end()) {
+ val = _valIter->_value;
}
if (!val) val = new CScValue(Game);
else val->Cleanup();
val->Copy(Val, CopyWhole);
- val->m_IsConstVar = SetAsConst;
- m_ValObject[Name] = val;
+ val->_isConstVar = SetAsConst;
+ _valObject[Name] = val;
- if (m_Type != VAL_NATIVE) m_Type = VAL_OBJECT;
+ if (_type != VAL_NATIVE) _type = VAL_OBJECT;
/*
- m_ValIter = m_ValObject.find(Name);
- if (m_ValIter != m_ValObject.end()){
- delete m_ValIter->_value;
- m_ValIter->_value = NULL;
+ _valIter = _valObject.find(Name);
+ if (_valIter != _valObject.end()){
+ delete _valIter->_value;
+ _valIter->_value = NULL;
}
CScValue* val = new CScValue(Game);
val->Copy(Val, CopyWhole);
- val->m_IsConstVar = SetAsConst;
- m_ValObject[Name] = val;
+ val->_isConstVar = SetAsConst;
+ _valObject[Name] = val;
- if(m_Type!=VAL_NATIVE) m_Type = VAL_OBJECT;
+ if(_type!=VAL_NATIVE) _type = VAL_OBJECT;
*/
}
@@ -248,265 +248,265 @@ HRESULT CScValue::SetProp(char *Name, CScValue *Val, bool CopyWhole, bool SetAsC
//////////////////////////////////////////////////////////////////////////
bool CScValue::PropExists(char *Name) {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->PropExists(Name);
- m_ValIter = m_ValObject.find(Name);
+ if (_type == VAL_VARIABLE_REF) return _valRef->PropExists(Name);
+ _valIter = _valObject.find(Name);
- return (m_ValIter != m_ValObject.end());
+ return (_valIter != _valObject.end());
}
//////////////////////////////////////////////////////////////////////////
void CScValue::DeleteProps() {
- m_ValIter = m_ValObject.begin();
- while (m_ValIter != m_ValObject.end()) {
- delete(CScValue *)m_ValIter->_value;
- m_ValIter++;
+ _valIter = _valObject.begin();
+ while (_valIter != _valObject.end()) {
+ delete(CScValue *)_valIter->_value;
+ _valIter++;
}
- m_ValObject.clear();
+ _valObject.clear();
}
//////////////////////////////////////////////////////////////////////////
void CScValue::CleanProps(bool IncludingNatives) {
- m_ValIter = m_ValObject.begin();
- while (m_ValIter != m_ValObject.end()) {
- if (!m_ValIter->_value->m_IsConstVar && (!m_ValIter->_value->IsNative() || IncludingNatives)) m_ValIter->_value->SetNULL();
- m_ValIter++;
+ _valIter = _valObject.begin();
+ while (_valIter != _valObject.end()) {
+ if (!_valIter->_value->_isConstVar && (!_valIter->_value->IsNative() || IncludingNatives)) _valIter->_value->SetNULL();
+ _valIter++;
}
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::IsNULL() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->IsNULL();
+ if (_type == VAL_VARIABLE_REF) return _valRef->IsNULL();
- return (m_Type == VAL_NULL);
+ return (_type == VAL_NULL);
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::IsNative() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->IsNative();
+ if (_type == VAL_VARIABLE_REF) return _valRef->IsNative();
- return (m_Type == VAL_NATIVE);
+ return (_type == VAL_NATIVE);
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::IsString() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->IsString();
+ if (_type == VAL_VARIABLE_REF) return _valRef->IsString();
- return (m_Type == VAL_STRING);
+ return (_type == VAL_STRING);
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::IsFloat() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->IsFloat();
+ if (_type == VAL_VARIABLE_REF) return _valRef->IsFloat();
- return (m_Type == VAL_FLOAT);
+ return (_type == VAL_FLOAT);
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::IsInt() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->IsInt();
+ if (_type == VAL_VARIABLE_REF) return _valRef->IsInt();
- return (m_Type == VAL_INT);
+ return (_type == VAL_INT);
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::IsBool() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->IsBool();
+ if (_type == VAL_VARIABLE_REF) return _valRef->IsBool();
- return (m_Type == VAL_BOOL);
+ return (_type == VAL_BOOL);
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::IsObject() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->IsObject();
+ if (_type == VAL_VARIABLE_REF) return _valRef->IsObject();
- return (m_Type == VAL_OBJECT);
+ return (_type == VAL_OBJECT);
}
//////////////////////////////////////////////////////////////////////////
TValType CScValue::GetTypeTolerant() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->GetType();
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetType();
- return m_Type;
+ return _type;
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetBool(bool Val) {
- if (m_Type == VAL_VARIABLE_REF) {
- m_ValRef->SetBool(Val);
+ if (_type == VAL_VARIABLE_REF) {
+ _valRef->SetBool(Val);
return;
}
- if (m_Type == VAL_NATIVE) {
- m_ValNative->ScSetBool(Val);
+ if (_type == VAL_NATIVE) {
+ _valNative->ScSetBool(Val);
return;
}
- m_ValBool = Val;
- m_Type = VAL_BOOL;
+ _valBool = Val;
+ _type = VAL_BOOL;
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetInt(int Val) {
- if (m_Type == VAL_VARIABLE_REF) {
- m_ValRef->SetInt(Val);
+ if (_type == VAL_VARIABLE_REF) {
+ _valRef->SetInt(Val);
return;
}
- if (m_Type == VAL_NATIVE) {
- m_ValNative->ScSetInt(Val);
+ if (_type == VAL_NATIVE) {
+ _valNative->ScSetInt(Val);
return;
}
- m_ValInt = Val;
- m_Type = VAL_INT;
+ _valInt = Val;
+ _type = VAL_INT;
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetFloat(double Val) {
- if (m_Type == VAL_VARIABLE_REF) {
- m_ValRef->SetFloat(Val);
+ if (_type == VAL_VARIABLE_REF) {
+ _valRef->SetFloat(Val);
return;
}
- if (m_Type == VAL_NATIVE) {
- m_ValNative->ScSetFloat(Val);
+ if (_type == VAL_NATIVE) {
+ _valNative->ScSetFloat(Val);
return;
}
- m_ValFloat = Val;
- m_Type = VAL_FLOAT;
+ _valFloat = Val;
+ _type = VAL_FLOAT;
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetString(const char *Val) {
- if (m_Type == VAL_VARIABLE_REF) {
- m_ValRef->SetString(Val);
+ if (_type == VAL_VARIABLE_REF) {
+ _valRef->SetString(Val);
return;
}
- if (m_Type == VAL_NATIVE) {
- m_ValNative->ScSetString(Val);
+ if (_type == VAL_NATIVE) {
+ _valNative->ScSetString(Val);
return;
}
SetStringVal(Val);
- if (m_ValString) m_Type = VAL_STRING;
- else m_Type = VAL_NULL;
+ if (_valString) _type = VAL_STRING;
+ else _type = VAL_NULL;
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetStringVal(const char *Val) {
- if (m_ValString) delete [] m_ValString;
+ if (_valString) delete [] _valString;
if (Val == NULL) {
- m_ValString = NULL;
+ _valString = NULL;
return;
}
- m_ValString = new char [strlen(Val) + 1];
- if (m_ValString) {
- strcpy(m_ValString, Val);
+ _valString = new char [strlen(Val) + 1];
+ if (_valString) {
+ strcpy(_valString, Val);
}
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetNULL() {
- if (m_Type == VAL_VARIABLE_REF) {
- m_ValRef->SetNULL();
+ if (_type == VAL_VARIABLE_REF) {
+ _valRef->SetNULL();
return;
}
- if (m_ValNative && !m_Persistent) {
- m_ValNative->m_RefCount--;
- if (m_ValNative->m_RefCount <= 0) delete m_ValNative;
+ if (_valNative && !_persistent) {
+ _valNative->_refCount--;
+ if (_valNative->_refCount <= 0) delete _valNative;
}
- m_ValNative = NULL;
+ _valNative = NULL;
DeleteProps();
- m_Type = VAL_NULL;
+ _type = VAL_NULL;
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetNative(CBScriptable *Val, bool Persistent) {
- if (m_Type == VAL_VARIABLE_REF) {
- m_ValRef->SetNative(Val, Persistent);
+ if (_type == VAL_VARIABLE_REF) {
+ _valRef->SetNative(Val, Persistent);
return;
}
if (Val == NULL) {
SetNULL();
} else {
- if (m_ValNative && !m_Persistent) {
- m_ValNative->m_RefCount--;
- if (m_ValNative->m_RefCount <= 0) {
- if (m_ValNative != Val) delete m_ValNative;
- m_ValNative = NULL;
+ if (_valNative && !_persistent) {
+ _valNative->_refCount--;
+ if (_valNative->_refCount <= 0) {
+ if (_valNative != Val) delete _valNative;
+ _valNative = NULL;
}
}
- m_Type = VAL_NATIVE;
- m_Persistent = Persistent;
+ _type = VAL_NATIVE;
+ _persistent = Persistent;
- m_ValNative = Val;
- if (m_ValNative && !m_Persistent) m_ValNative->m_RefCount++;
+ _valNative = Val;
+ if (_valNative && !_persistent) _valNative->_refCount++;
}
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetObject() {
- if (m_Type == VAL_VARIABLE_REF) {
- m_ValRef->SetObject();
+ if (_type == VAL_VARIABLE_REF) {
+ _valRef->SetObject();
return;
}
DeleteProps();
- m_Type = VAL_OBJECT;
+ _type = VAL_OBJECT;
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetReference(CScValue *Val) {
- m_ValRef = Val;
- m_Type = VAL_VARIABLE_REF;
+ _valRef = Val;
+ _type = VAL_VARIABLE_REF;
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::GetBool(bool Default) {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->GetBool();
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetBool();
- switch (m_Type) {
+ switch (_type) {
case VAL_BOOL:
- return m_ValBool;
+ return _valBool;
case VAL_NATIVE:
- return m_ValNative->ScToBool();
+ return _valNative->ScToBool();
case VAL_INT:
- return (m_ValInt != 0);
+ return (_valInt != 0);
case VAL_FLOAT:
- return (m_ValFloat != 0.0f);
+ return (_valFloat != 0.0f);
case VAL_STRING:
- return (scumm_stricmp(m_ValString, "1") == 0 || scumm_stricmp(m_ValString, "yes") == 0 || scumm_stricmp(m_ValString, "true") == 0);
+ return (scumm_stricmp(_valString, "1") == 0 || scumm_stricmp(_valString, "yes") == 0 || scumm_stricmp(_valString, "true") == 0);
default:
return Default;
@@ -516,23 +516,23 @@ bool CScValue::GetBool(bool Default) {
//////////////////////////////////////////////////////////////////////////
int CScValue::GetInt(int Default) {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->GetInt();
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetInt();
- switch (m_Type) {
+ switch (_type) {
case VAL_BOOL:
- return m_ValBool ? 1 : 0;
+ return _valBool ? 1 : 0;
case VAL_NATIVE:
- return m_ValNative->ScToInt();
+ return _valNative->ScToInt();
case VAL_INT:
- return m_ValInt;
+ return _valInt;
case VAL_FLOAT:
- return (int)m_ValFloat;
+ return (int)_valFloat;
case VAL_STRING:
- return atoi(m_ValString);
+ return atoi(_valString);
default:
return Default;
@@ -542,23 +542,23 @@ int CScValue::GetInt(int Default) {
//////////////////////////////////////////////////////////////////////////
double CScValue::GetFloat(double Default) {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->GetFloat();
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetFloat();
- switch (m_Type) {
+ switch (_type) {
case VAL_BOOL:
- return m_ValBool ? 1.0f : 0.0f;
+ return _valBool ? 1.0f : 0.0f;
case VAL_NATIVE:
- return m_ValNative->ScToFloat();
+ return _valNative->ScToFloat();
case VAL_INT:
- return (double)m_ValInt;
+ return (double)_valInt;
case VAL_FLOAT:
- return m_ValFloat;
+ return _valFloat;
case VAL_STRING:
- return atof(m_ValString);
+ return atof(_valString);
default:
return Default;
@@ -567,18 +567,18 @@ double CScValue::GetFloat(double Default) {
//////////////////////////////////////////////////////////////////////////
void *CScValue::GetMemBuffer() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->GetMemBuffer();
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetMemBuffer();
- if (m_Type == VAL_NATIVE) return m_ValNative->ScToMemBuffer();
+ if (_type == VAL_NATIVE) return _valNative->ScToMemBuffer();
else return (void *)NULL;
}
//////////////////////////////////////////////////////////////////////////
char *CScValue::GetString() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->GetString();
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetString();
- switch (m_Type) {
+ switch (_type) {
case VAL_OBJECT:
SetStringVal("[object]");
break;
@@ -588,26 +588,26 @@ char *CScValue::GetString() {
break;
case VAL_NATIVE: {
- char *StrVal = m_ValNative->ScToString();
+ char *StrVal = _valNative->ScToString();
SetStringVal(StrVal);
return StrVal;
break;
}
case VAL_BOOL:
- SetStringVal(m_ValBool ? "yes" : "no");
+ SetStringVal(_valBool ? "yes" : "no");
break;
case VAL_INT: {
char dummy[50];
- sprintf(dummy, "%d", m_ValInt);
+ sprintf(dummy, "%d", _valInt);
SetStringVal(dummy);
break;
}
case VAL_FLOAT: {
char dummy[50];
- sprintf(dummy, "%f", m_ValFloat);
+ sprintf(dummy, "%f", _valFloat);
SetStringVal(dummy);
break;
}
@@ -619,22 +619,22 @@ char *CScValue::GetString() {
SetStringVal("");
}
- return m_ValString;
+ return _valString;
}
//////////////////////////////////////////////////////////////////////////
CBScriptable *CScValue::GetNative() {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->GetNative();
+ if (_type == VAL_VARIABLE_REF) return _valRef->GetNative();
- if (m_Type == VAL_NATIVE) return m_ValNative;
+ if (_type == VAL_NATIVE) return _valNative;
else return NULL;
}
//////////////////////////////////////////////////////////////////////////
TValType CScValue::GetType() {
- return m_Type;
+ return _type;
}
@@ -642,64 +642,64 @@ TValType CScValue::GetType() {
void CScValue::Copy(CScValue *orig, bool CopyWhole) {
Game = orig->Game;
- if (m_ValNative && !m_Persistent) {
- m_ValNative->m_RefCount--;
- if (m_ValNative->m_RefCount <= 0) {
- if (m_ValNative != orig->m_ValNative) delete m_ValNative;
- m_ValNative = NULL;
+ if (_valNative && !_persistent) {
+ _valNative->_refCount--;
+ if (_valNative->_refCount <= 0) {
+ if (_valNative != orig->_valNative) delete _valNative;
+ _valNative = NULL;
}
}
- if (orig->m_Type == VAL_VARIABLE_REF && orig->m_ValRef && CopyWhole) orig = orig->m_ValRef;
+ if (orig->_type == VAL_VARIABLE_REF && orig->_valRef && CopyWhole) orig = orig->_valRef;
Cleanup(true);
- m_Type = orig->m_Type;
- m_ValBool = orig->m_ValBool;
- m_ValInt = orig->m_ValInt;
- m_ValFloat = orig->m_ValFloat;
- SetStringVal(orig->m_ValString);
+ _type = orig->_type;
+ _valBool = orig->_valBool;
+ _valInt = orig->_valInt;
+ _valFloat = orig->_valFloat;
+ SetStringVal(orig->_valString);
- m_ValRef = orig->m_ValRef;
- m_Persistent = orig->m_Persistent;
+ _valRef = orig->_valRef;
+ _persistent = orig->_persistent;
- m_ValNative = orig->m_ValNative;
- if (m_ValNative && !m_Persistent) m_ValNative->m_RefCount++;
+ _valNative = orig->_valNative;
+ if (_valNative && !_persistent) _valNative->_refCount++;
//!!!! ref->native++
// copy properties
- if (orig->m_Type == VAL_OBJECT && orig->m_ValObject.size() > 0) {
- orig->m_ValIter = orig->m_ValObject.begin();
- while (orig->m_ValIter != orig->m_ValObject.end()) {
- m_ValObject[orig->m_ValIter->_key] = new CScValue(Game);
- m_ValObject[orig->m_ValIter->_key]->Copy(orig->m_ValIter->_value);
- orig->m_ValIter++;
+ if (orig->_type == VAL_OBJECT && orig->_valObject.size() > 0) {
+ orig->_valIter = orig->_valObject.begin();
+ while (orig->_valIter != orig->_valObject.end()) {
+ _valObject[orig->_valIter->_key] = new CScValue(Game);
+ _valObject[orig->_valIter->_key]->Copy(orig->_valIter->_value);
+ orig->_valIter++;
}
- } else m_ValObject.clear();
+ } else _valObject.clear();
}
//////////////////////////////////////////////////////////////////////////
void CScValue::SetValue(CScValue *Val) {
- if (Val->m_Type == VAL_VARIABLE_REF) {
- SetValue(Val->m_ValRef);
+ if (Val->_type == VAL_VARIABLE_REF) {
+ SetValue(Val->_valRef);
return;
}
// if being assigned a simple type, preserve native state
- if (m_Type == VAL_NATIVE && (Val->m_Type == VAL_INT || Val->m_Type == VAL_STRING || Val->m_Type == VAL_BOOL)) {
- switch (Val->m_Type) {
+ if (_type == VAL_NATIVE && (Val->_type == VAL_INT || Val->_type == VAL_STRING || Val->_type == VAL_BOOL)) {
+ switch (Val->_type) {
case VAL_INT:
- m_ValNative->ScSetInt(Val->GetInt());
+ _valNative->ScSetInt(Val->GetInt());
break;
case VAL_FLOAT:
- m_ValNative->ScSetFloat(Val->GetFloat());
+ _valNative->ScSetFloat(Val->GetFloat());
break;
case VAL_BOOL:
- m_ValNative->ScSetBool(Val->GetBool());
+ _valNative->ScSetBool(Val->GetBool());
break;
case VAL_STRING:
- m_ValNative->ScSetString(Val->GetString());
+ _valNative->ScSetString(Val->GetString());
break;
}
}
@@ -712,26 +712,26 @@ void CScValue::SetValue(CScValue *Val) {
HRESULT CScValue::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer(TMEMBER(Game));
- PersistMgr->Transfer(TMEMBER(m_Persistent));
- PersistMgr->Transfer(TMEMBER(m_IsConstVar));
- PersistMgr->Transfer(TMEMBER_INT(m_Type));
- PersistMgr->Transfer(TMEMBER(m_ValBool));
- PersistMgr->Transfer(TMEMBER(m_ValFloat));
- PersistMgr->Transfer(TMEMBER(m_ValInt));
- PersistMgr->Transfer(TMEMBER(m_ValNative));
+ PersistMgr->Transfer(TMEMBER(_persistent));
+ PersistMgr->Transfer(TMEMBER(_isConstVar));
+ PersistMgr->Transfer(TMEMBER_INT(_type));
+ PersistMgr->Transfer(TMEMBER(_valBool));
+ PersistMgr->Transfer(TMEMBER(_valFloat));
+ PersistMgr->Transfer(TMEMBER(_valInt));
+ PersistMgr->Transfer(TMEMBER(_valNative));
int size;
char *str;
- if (PersistMgr->m_Saving) {
- size = m_ValObject.size();
+ if (PersistMgr->_saving) {
+ size = _valObject.size();
PersistMgr->Transfer("", &size);
- m_ValIter = m_ValObject.begin();
- while (m_ValIter != m_ValObject.end()) {
- str = (char *)m_ValIter->_key.c_str();
+ _valIter = _valObject.begin();
+ while (_valIter != _valObject.end()) {
+ str = (char *)_valIter->_key.c_str();
PersistMgr->Transfer("", &str);
- PersistMgr->Transfer("", &m_ValIter->_value);
+ PersistMgr->Transfer("", &_valIter->_value);
- m_ValIter++;
+ _valIter++;
}
} else {
CScValue *val;
@@ -740,28 +740,28 @@ HRESULT CScValue::Persist(CBPersistMgr *PersistMgr) {
PersistMgr->Transfer("", &str);
PersistMgr->Transfer("", &val);
- m_ValObject[str] = val;
+ _valObject[str] = val;
delete [] str;
}
}
- PersistMgr->Transfer(TMEMBER(m_ValRef));
- PersistMgr->Transfer(TMEMBER(m_ValString));
+ PersistMgr->Transfer(TMEMBER(_valRef));
+ PersistMgr->Transfer(TMEMBER(_valString));
/*
FILE* f = fopen("c:\\val.log", "a+");
- switch(m_Type)
+ switch(_type)
{
case VAL_STRING:
- fprintf(f, "str %s\n", m_ValString);
+ fprintf(f, "str %s\n", _valString);
break;
case VAL_INT:
- fprintf(f, "int %d\n", m_ValInt);
+ fprintf(f, "int %d\n", _valInt);
break;
case VAL_BOOL:
- fprintf(f, "bool %d\n", m_ValBool);
+ fprintf(f, "bool %d\n", _valBool);
break;
case VAL_NULL:
@@ -794,14 +794,14 @@ HRESULT CScValue::Persist(CBPersistMgr *PersistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScValue::SaveAsText(CBDynBuffer *Buffer, int Indent) {
- m_ValIter = m_ValObject.begin();
- while (m_ValIter != m_ValObject.end()) {
+ _valIter = _valObject.begin();
+ while (_valIter != _valObject.end()) {
Buffer->PutTextIndent(Indent, "PROPERTY {\n");
- Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", (char *)m_ValIter->_key.c_str());
- Buffer->PutTextIndent(Indent + 2, "VALUE=\"%s\"\n", m_ValIter->_value->GetString());
+ Buffer->PutTextIndent(Indent + 2, "NAME=\"%s\"\n", (char *)_valIter->_key.c_str());
+ Buffer->PutTextIndent(Indent + 2, "VALUE=\"%s\"\n", _valIter->_value->GetString());
Buffer->PutTextIndent(Indent, "}\n\n");
- m_ValIter++;
+ _valIter++;
}
return S_OK;
}
@@ -853,10 +853,10 @@ int CScValue::CompareStrict(CScValue *Val1, CScValue *Val2) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScValue::DbgSendVariables(IWmeDebugClient *Client, EWmeDebuggerVariableType Type, CScScript *Script, unsigned int ScopeID) {
- m_ValIter = m_ValObject.begin();
- while (m_ValIter != m_ValObject.end()) {
- Client->OnVariableInit(Type, Script, ScopeID, m_ValIter->_value, m_ValIter->_key.c_str());
- m_ValIter++;
+ _valIter = _valObject.begin();
+ while (_valIter != _valObject.end()) {
+ Client->OnVariableInit(Type, Script, ScopeID, _valIter->_value, _valIter->_key.c_str());
+ _valIter++;
}
return S_OK;
}
@@ -987,23 +987,23 @@ bool CScValue::DbgSetVal() {
//////////////////////////////////////////////////////////////////////////
int CScValue::DbgGetNumProperties() {
- if (m_ValNative && m_ValNative->m_ScProp) return m_ValNative->m_ScProp->DbgGetNumProperties();
- else return m_ValObject.size();
+ if (_valNative && _valNative->_scProp) return _valNative->_scProp->DbgGetNumProperties();
+ else return _valObject.size();
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::DbgGetProperty(int Index, const char **Name, IWmeDebugProp **Value) {
- if (m_ValNative && m_ValNative->m_ScProp) return m_ValNative->m_ScProp->DbgGetProperty(Index, Name, Value);
+ if (_valNative && _valNative->_scProp) return _valNative->_scProp->DbgGetProperty(Index, Name, Value);
else {
int Count = 0;
- m_ValIter = m_ValObject.begin();
- while (m_ValIter != m_ValObject.end()) {
+ _valIter = _valObject.begin();
+ while (_valIter != _valObject.end()) {
if (Count == Index) {
- *Name = m_ValIter->_key.c_str();
- *Value = m_ValIter->_value;
+ *Name = _valIter->_key.c_str();
+ *Value = _valIter->_value;
return true;
}
- m_ValIter++;
+ _valIter++;
Count++;
}
return false;
@@ -1012,10 +1012,10 @@ bool CScValue::DbgGetProperty(int Index, const char **Name, IWmeDebugProp **Valu
//////////////////////////////////////////////////////////////////////////
bool CScValue::DbgGetDescription(char *Buf, int BufSize) {
- if (m_Type == VAL_VARIABLE_REF) return m_ValRef->DbgGetDescription(Buf, BufSize);
+ if (_type == VAL_VARIABLE_REF) return _valRef->DbgGetDescription(Buf, BufSize);
- if (m_Type == VAL_NATIVE) {
- m_ValNative->ScDebuggerDesc(Buf, BufSize);
+ if (_type == VAL_NATIVE) {
+ _valNative->ScDebuggerDesc(Buf, BufSize);
} else {
strncpy(Buf, GetString(), BufSize);
}
diff --git a/engines/wintermute/scriptables/ScValue.h b/engines/wintermute/scriptables/ScValue.h
index 3d0c69d3f7..992a220622 100644
--- a/engines/wintermute/scriptables/ScValue.h
+++ b/engines/wintermute/scriptables/ScValue.h
@@ -53,10 +53,10 @@ public:
void Cleanup(bool IgnoreNatives = false);
DECLARE_PERSISTENT(CScValue, CBBase)
- bool m_IsConstVar;
+ bool _isConstVar;
HRESULT SaveAsText(CBDynBuffer *Buffer, int Indent);
void SetValue(CScValue *Val);
- bool m_Persistent;
+ bool _persistent;
bool PropExists(char *Name);
void Copy(CScValue *orig, bool CopyWhole = false);
void SetStringVal(const char *Val);
@@ -87,21 +87,21 @@ public:
bool IsObject();
HRESULT SetProp(char *Name, CScValue *Val, bool CopyWhole = false, bool SetAsConst = false);
CScValue *GetProp(char *Name);
- CBScriptable *m_ValNative;
- CScValue *m_ValRef;
- bool m_ValBool;
- int m_ValInt;
- double m_ValFloat;
- char *m_ValString;
- TValType m_Type;
+ CBScriptable *_valNative;
+ CScValue *_valRef;
+ bool _valBool;
+ int _valInt;
+ double _valFloat;
+ char *_valString;
+ TValType _type;
CScValue(CBGame *inGame);
CScValue(CBGame *inGame, bool Val);
CScValue(CBGame *inGame, int Val);
CScValue(CBGame *inGame, double Val);
CScValue(CBGame *inGame, const char *Val);
virtual ~CScValue();
- Common::HashMap<Common::String, CScValue *> m_ValObject;
- Common::HashMap<Common::String, CScValue *>::iterator m_ValIter;
+ Common::HashMap<Common::String, CScValue *> _valObject;
+ Common::HashMap<Common::String, CScValue *>::iterator _valIter;
bool SetProperty(const char *PropName, int Value);
bool SetProperty(const char *PropName, const char *Value);
diff --git a/engines/wintermute/utils.cpp b/engines/wintermute/utils.cpp
index 6c5ddb5d40..5a7588e765 100644
--- a/engines/wintermute/utils.cpp
+++ b/engines/wintermute/utils.cpp
@@ -235,7 +235,7 @@ bool CBUtils::MatchesPattern(const char *Pattern, const char *String) {
//////////////////////////////////////////////////////////////////////////
char *CBUtils::GetPath(char *Filename) {
AnsiString path = PathUtil::GetDirectoryName(Filename);
- //path = boost::filesystem::system_complete(path).string();
+ //path = boost::filesystem::syste_complete(path).string();
warning("CBUtils::GetPath: (%s), not implemented", Filename);
return Filename;
char *ret = new char[path.size() + 1];