aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/logic.cpp
diff options
context:
space:
mode:
authorPaweł Kołodziejski2007-01-16 12:40:51 +0000
committerPaweł Kołodziejski2007-01-16 12:40:51 +0000
commitb47eb953160883221f02c7455cb55ca66f75198f (patch)
tree1060caa6495c20970d35dc3abb42ae7f9e513af3 /engines/agi/logic.cpp
parent994604527b15dbe129b5c91f26da8840f3519199 (diff)
downloadscummvm-rg350-b47eb953160883221f02c7455cb55ca66f75198f.tar.gz
scummvm-rg350-b47eb953160883221f02c7455cb55ca66f75198f.tar.bz2
scummvm-rg350-b47eb953160883221f02c7455cb55ca66f75198f.zip
Formating names in source code
svn-id: r25101
Diffstat (limited to 'engines/agi/logic.cpp')
-rw-r--r--engines/agi/logic.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/engines/agi/logic.cpp b/engines/agi/logic.cpp
index 28d8b694f4..21a560427e 100644
--- a/engines/agi/logic.cpp
+++ b/engines/agi/logic.cpp
@@ -34,15 +34,15 @@ namespace Agi {
* into a message list.
* @param n The number of the logic resource to decode.
*/
-int AgiEngine::decode_logic(int n) {
- int ec = err_OK;
+int AgiEngine::decodeLogic(int n) {
+ int ec = errOK;
int mstart, mend, mc;
uint8 *m0;
/* decrypt messages at end of logic + build message list */
/* report ("decoding logic #%d\n", n); */
- m0 = game.logics[n].data;
+ m0 = _game.logics[n].data;
mstart = READ_LE_UINT16(m0) + 2;
mc = *(m0 + mstart);
@@ -53,41 +53,41 @@ int AgiEngine::decode_logic(int n) {
/* if the logic was not compressed, decrypt the text messages
* only if there are more than 0 messages
*/
- if ((~game.dir_logic[n].flags & RES_COMPRESSED) && mc > 0)
+ if ((~_game.dirLogic[n].flags & RES_COMPRESSED) && mc > 0)
decrypt(m0 + mstart, mend - mstart); /* decrypt messages */
/* build message list */
- m0 = game.logics[n].data;
+ m0 = _game.logics[n].data;
mstart = READ_LE_UINT16(m0) + 2; /* +2 covers pointer */
- game.logics[n].num_texts = *(m0 + mstart);
+ _game.logics[n].numTexts = *(m0 + mstart);
/* resetp logic pointers */
- game.logics[n].sIP = 2;
- game.logics[n].cIP = 2;
- game.logics[n].size = READ_LE_UINT16(m0) + 2; /* logic end pointer */
+ _game.logics[n].sIP = 2;
+ _game.logics[n].cIP = 2;
+ _game.logics[n].size = READ_LE_UINT16(m0) + 2; /* logic end pointer */
/* allocate list of pointers to point into our data */
- game.logics[n].texts = (const char **)calloc(1 + game.logics[n].num_texts, sizeof(char *));
+ _game.logics[n].texts = (const char **)calloc(1 + _game.logics[n].numTexts, sizeof(char *));
/* cover header info */
m0 += mstart + 3;
- if (game.logics[n].texts != NULL) {
+ if (_game.logics[n].texts != NULL) {
/* move list of strings into list to make real pointers */
- for (mc = 0; mc < game.logics[n].num_texts; mc++) {
+ for (mc = 0; mc < _game.logics[n].numTexts; mc++) {
mend = READ_LE_UINT16(m0 + mc * 2);
- game.logics[n].texts[mc] = mend ? (const char *)m0 + mend - 2 : (const char *)"";
+ _game.logics[n].texts[mc] = mend ? (const char *)m0 + mend - 2 : (const char *)"";
}
/* set loaded flag now its all completly loaded */
- game.dir_logic[n].flags |= RES_LOADED;
+ _game.dirLogic[n].flags |= RES_LOADED;
} else {
/* unload data
* blah DF YA WANKER!!@!@# frag. i'm so dumb. not every logic
* has text
*/
- free(game.logics[n].data);
- ec = err_NotEnoughMemory;
+ free(_game.logics[n].data);
+ ec = errNotEnoughMemory;
}
return ec;
@@ -99,18 +99,18 @@ int AgiEngine::decode_logic(int n) {
* memory chunks allocated for this resource.
* @param n The number of the logic resource to unload
*/
-void AgiEngine::unload_logic(int n) {
- if (game.dir_logic[n].flags & RES_LOADED) {
- free(game.logics[n].data);
- if (game.logics[n].num_texts)
- free(game.logics[n].texts);
- game.logics[n].num_texts = 0;
- game.dir_logic[n].flags &= ~RES_LOADED;
+void AgiEngine::unloadLogic(int n) {
+ if (_game.dirLogic[n].flags & RES_LOADED) {
+ free(_game.logics[n].data);
+ if (_game.logics[n].numTexts)
+ free(_game.logics[n].texts);
+ _game.logics[n].numTexts = 0;
+ _game.dirLogic[n].flags &= ~RES_LOADED;
}
/* if cached, we end up here */
- game.logics[n].sIP = 2;
- game.logics[n].cIP = 2;
+ _game.logics[n].sIP = 2;
+ _game.logics[n].cIP = 2;
}
-} // End of namespace Agi
+} // End of namespace Agi