diff options
author | Einar Johan Trøan Sømåen | 2012-07-26 04:12:58 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-26 04:12:58 +0200 |
commit | 38507fa9895620639d8733dbb4e085dfb2282a33 (patch) | |
tree | 2b246fa93ce4ec173ac3db77e8cbacc562c6bb20 /engines/wintermute/ad/ad_node_state.cpp | |
parent | 1ad859a468415cc7fd93adaa84beba02aae29ad8 (diff) | |
download | scummvm-rg350-38507fa9895620639d8733dbb4e085dfb2282a33.tar.gz scummvm-rg350-38507fa9895620639d8733dbb4e085dfb2282a33.tar.bz2 scummvm-rg350-38507fa9895620639d8733dbb4e085dfb2282a33.zip |
WINTERMUTE: AStyle-formatting.
Diffstat (limited to 'engines/wintermute/ad/ad_node_state.cpp')
-rw-r--r-- | engines/wintermute/ad/ad_node_state.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/engines/wintermute/ad/ad_node_state.cpp b/engines/wintermute/ad/ad_node_state.cpp index 6212274d03..444373ea75 100644 --- a/engines/wintermute/ad/ad_node_state.cpp +++ b/engines/wintermute/ad/ad_node_state.cpp @@ -44,7 +44,8 @@ IMPLEMENT_PERSISTENT(AdNodeState, false) AdNodeState::AdNodeState(BaseGame *inGame): BaseClass(inGame) {
_name = NULL;
_active = false;
- for (int i = 0; i < 7; i++) _caption[i] = NULL;
+ for (int i = 0; i < 7; i++)
+ _caption[i] = NULL;
_alphaColor = 0;
_filename = NULL;
_cursor = NULL;
@@ -99,7 +100,8 @@ bool AdNodeState::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_filename));
persistMgr->transfer(TMEMBER(_cursor));
persistMgr->transfer(TMEMBER(_alphaColor));
- for (int i = 0; i < 7; i++) persistMgr->transfer(TMEMBER(_caption[i]));
+ for (int i = 0; i < 7; i++)
+ persistMgr->transfer(TMEMBER(_caption[i]));
return STATUS_OK;
}
@@ -107,23 +109,27 @@ bool AdNodeState::persist(BasePersistenceManager *persistMgr) { //////////////////////////////////////////////////////////////////////////
void AdNodeState::setCaption(const char *caption, int caseVal) {
- if (caseVal== 0) caseVal= 1;
- if (caseVal< 1 || caseVal> 7) return;
-
- delete[] _caption[caseVal- 1];
- _caption[caseVal- 1] = new char[strlen(caption) + 1];
- if (_caption[caseVal- 1]) {
- strcpy(_caption[caseVal- 1], caption);
- _gameRef->_stringTable->expand(&_caption[caseVal- 1]);
+ if (caseVal == 0)
+ caseVal = 1;
+ if (caseVal < 1 || caseVal > 7)
+ return;
+
+ delete[] _caption[caseVal - 1];
+ _caption[caseVal - 1] = new char[strlen(caption) + 1];
+ if (_caption[caseVal - 1]) {
+ strcpy(_caption[caseVal - 1], caption);
+ _gameRef->_stringTable->expand(&_caption[caseVal - 1]);
}
}
//////////////////////////////////////////////////////////////////////////
char *AdNodeState::getCaption(int caseVal) {
- if (caseVal== 0) caseVal= 1;
- if (caseVal< 1 || caseVal> 7 || _caption[caseVal- 1] == NULL) return "";
- else return _caption[caseVal- 1];
+ if (caseVal == 0) caseVal = 1;
+ if (caseVal < 1 || caseVal > 7 || _caption[caseVal - 1] == NULL)
+ return "";
+ else
+ return _caption[caseVal - 1];
}
@@ -132,7 +138,8 @@ bool AdNodeState::transferEntity(AdEntity *entity, bool includingSprites, bool s if (!entity) return STATUS_FAILED;
// HACK!
- if (this->_gameRef != entity->_gameRef) this->_gameRef = entity->_gameRef;
+ if (this->_gameRef != entity->_gameRef)
+ this->_gameRef = entity->_gameRef;
if (saving) {
for (int i = 0; i < 7; i++) {
|