aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/mpal
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tony/mpal')
-rw-r--r--engines/tony/mpal/expr.cpp4
-rw-r--r--engines/tony/mpal/expr.h12
-rw-r--r--engines/tony/mpal/loadmpc.cpp11
-rw-r--r--engines/tony/mpal/lzo.cpp622
-rw-r--r--engines/tony/mpal/memory.cpp1
-rw-r--r--engines/tony/mpal/mpal.cpp49
-rw-r--r--engines/tony/mpal/mpal.h101
-rw-r--r--engines/tony/mpal/mpaldll.h63
-rw-r--r--engines/tony/mpal/mpalutils.h12
9 files changed, 414 insertions, 461 deletions
diff --git a/engines/tony/mpal/expr.cpp b/engines/tony/mpal/expr.cpp
index 824cd91651..7dc640ba7c 100644
--- a/engines/tony/mpal/expr.cpp
+++ b/engines/tony/mpal/expr.cpp
@@ -35,7 +35,6 @@ namespace Tony {
namespace MPAL {
-
/**
* Duplicate a mathematical expression.
*
@@ -140,7 +139,6 @@ static void solve(LpExpression one, int num) {
}
}
-
/**
* Calculates the result of a mathematical expression, replacing the current
* value of any variable.
@@ -178,7 +176,6 @@ static int evaluateAndFreeExpression(byte *expr) {
return val;
}
-
/**
* Parses a mathematical expression from the MPC file
*
@@ -249,7 +246,6 @@ const byte *parseExpression(const byte *lpBuf, MpalHandle *h) {
return lpBuf;
}
-
/**
* Calculate the value of a mathamatical expression
*
diff --git a/engines/tony/mpal/expr.h b/engines/tony/mpal/expr.h
index 405624b4fe..256d09bb9b 100644
--- a/engines/tony/mpal/expr.h
+++ b/engines/tony/mpal/expr.h
@@ -70,16 +70,16 @@ namespace MPAL {
* Mathamatical framework to manage operations
*/
typedef struct {
- byte _type; // Object Type (see enum ExprListTypes)
+ byte _type; // Object Type (see enum ExprListTypes)
union {
- int _num; // Identifier (if type == ELT_NUMBER)
- char *_name; // Variable name (if type == ELT_VAR)
- MpalHandle _son; // Handle expressions (if type == ELT_PARENTH)
- byte *_pson; // Handle lockato (if type == ELT_PARENTH2)
+ int _num; // Identifier (if type == ELT_NUMBER)
+ char *_name; // Variable name (if type == ELT_VAR)
+ MpalHandle _son; // Handle expressions (if type == ELT_PARENTH)
+ byte *_pson; // Handle lockato (if type == ELT_PARENTH2)
} _val;
- byte _symbol; // Mathematic symbols (see #define OP_*)
+ byte _symbol; // Mathematic symbols (see #define OP_*)
} Expression;
typedef Expression *LpExpression;
diff --git a/engines/tony/mpal/loadmpc.cpp b/engines/tony/mpal/loadmpc.cpp
index 9c45cdf982..4eb84d1406 100644
--- a/engines/tony/mpal/loadmpc.cpp
+++ b/engines/tony/mpal/loadmpc.cpp
@@ -90,7 +90,7 @@ static const byte *ParseScript(const byte *lpBuf, LpMpalScript lpmsScript) {
lpBuf += 4;
break;
- case 2: { // Variable assign
+ case 2: { // Variable assign
int len = *lpBuf;
lpBuf++;
lpmsScript->_command[curCmd]._lpszVarName = (char *)globalAlloc(GMEM_FIXED | GMEM_ZEROINIT, len + 1);
@@ -216,6 +216,7 @@ static const byte *parseDialog(const byte *lpBuf, LpMpalDialog lpmdDialog) {
return NULL;
break;
}
+
// Do Choice
case 3:
lpmdDialog->_command[curCmd]._nChoice = READ_LE_UINT16(lpBuf);
@@ -317,7 +318,6 @@ static const byte *parseDialog(const byte *lpBuf, LpMpalDialog lpmdDialog) {
return lpBuf;
}
-
/**
* Parses an item from the MPC file, and inserts its data into a structure
*
@@ -384,7 +384,7 @@ static const byte *parseItem(const byte *lpBuf, LpMpalItem lpmiItem) {
lpmiItem->_command[curCmd]._type = *lpBuf;
lpBuf++;
switch (lpmiItem->_command[curCmd]._type) {
- case 1: // Call custom function
+ case 1: // Call custom function
lpmiItem->_command[curCmd]._nCf = READ_LE_UINT16(lpBuf);
lpBuf += 2;
lpmiItem->_command[curCmd]._arg1 = (int32)READ_LE_UINT32(lpBuf);
@@ -397,7 +397,7 @@ static const byte *parseItem(const byte *lpBuf, LpMpalItem lpmiItem) {
lpBuf += 4;
break;
- case 2: // Variable assign
+ case 2: // Variable assign
len = *lpBuf;
lpBuf++;
lpmiItem->_command[curCmd]._lpszVarName = (char *)globalAlloc(GMEM_FIXED | GMEM_ZEROINIT, len + 1);
@@ -498,7 +498,6 @@ static const byte *ParseLocation(const byte *lpBuf, LpMpalLocation lpmlLocation)
return lpBuf;
}
-
/****************************************************************************\
* Exported functions
\****************************************************************************/
@@ -539,7 +538,7 @@ bool parseMpc(const byte *lpBuf) {
GLOBALS._lpmvVars->_dwVal = READ_LE_UINT32(lpBuf);
lpBuf += 4;
- lpBuf++; // Skip 'ext'
+ lpBuf++; // Skip 'ext'
GLOBALS._lpmvVars++;
}
diff --git a/engines/tony/mpal/lzo.cpp b/engines/tony/mpal/lzo.cpp
index 3d0751a5ca..a04a769528 100644
--- a/engines/tony/mpal/lzo.cpp
+++ b/engines/tony/mpal/lzo.cpp
@@ -69,440 +69,440 @@ namespace Tony {
namespace MPAL {
-#define pd(a, b) ((uint32) ((a) - (b)))
+#define pd(a, b) ((uint32) ((a) - (b)))
-#define TEST_IP (ip < ip_end)
-#define TEST_OP 1
-#define NEED_IP(x) ((void) 0)
-#define NEED_OP(x) ((void) 0)
-#define TEST_LB(m_pos) ((void) 0)
+#define TEST_IP (ip < ip_end)
+#define TEST_OP 1
+#define NEED_IP(x) ((void) 0)
+#define NEED_OP(x) ((void) 0)
+#define TEST_LB(m_pos) ((void) 0)
-#define M2_MAX_OFFSET 0x0800
+#define M2_MAX_OFFSET 0x0800
#define LZO1X
/**
* Decompresses an LZO compressed resource
*/
int lzo1x_decompress(const byte *in, uint32 in_len, byte *out, uint32 *out_len) {
- register byte *op;
- register const byte *ip;
- register uint32 t = 0;
+ register byte *op;
+ register const byte *ip;
+ register uint32 t = 0;
#if defined(COPY_DICT)
- uint32 m_off;
- const byte *dict_end;
+ uint32 m_off;
+ const byte *dict_end;
#else
- register const byte *m_pos;
+ register const byte *m_pos;
#endif
- const byte * const ip_end = in + in_len;
+ const byte * const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
- byte * const op_end = out + *out_len;
+ byte * const op_end = out + *out_len;
#endif
#if defined(LZO1Z)
- uint32 last_m_off = 0;
+ uint32 last_m_off = 0;
#endif
#if defined(COPY_DICT)
- if (dict)
- {
- if (dict_len > M4_MAX_OFFSET)
- {
- dict += dict_len - M4_MAX_OFFSET;
- dict_len = M4_MAX_OFFSET;
- }
- dict_end = dict + dict_len;
- }
- else
- {
- dict_len = 0;
- dict_end = NULL;
- }
-#endif
-
- *out_len = 0;
-
- op = out;
- ip = in;
-
- if (*ip > 17)
- {
- t = *ip++ - 17;
- if (t < 4)
- goto match_next;
- assert(t > 0); NEED_OP(t); NEED_IP(t+1);
- do *op++ = *ip++; while (--t > 0);
- goto first_literal_run;
- }
-
- while (TEST_IP && TEST_OP)
- {
- t = *ip++;
- if (t >= 16)
- goto match;
- if (t == 0)
- {
- NEED_IP(1);
- while (*ip == 0)
- {
- t += 255;
- ip++;
- NEED_IP(1);
- }
- t += 15 + *ip++;
- }
- assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
+ if (dict)
+ {
+ if (dict_len > M4_MAX_OFFSET)
+ {
+ dict += dict_len - M4_MAX_OFFSET;
+ dict_len = M4_MAX_OFFSET;
+ }
+ dict_end = dict + dict_len;
+ }
+ else
+ {
+ dict_len = 0;
+ dict_end = NULL;
+ }
+#endif
+
+ *out_len = 0;
+
+ op = out;
+ ip = in;
+
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ do *op++ = *ip++; while (--t > 0);
+ goto first_literal_run;
+ }
+
+ while (TEST_IP && TEST_OP)
+ {
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 15 + *ip++;
+ }
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
- t += 3;
- if (t >= 8) do
- {
- UA_COPY64(op, ip);
- op += 8; ip += 8; t -= 8;
- } while (t >= 8);
- if (t >= 4)
- {
- UA_COPY32(op, ip);
- op += 4; ip += 4; t -= 4;
- }
- if (t > 0)
- {
- *op++ = *ip++;
- if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
- }
+ t += 3;
+ if (t >= 8) do
+ {
+ UA_COPY64(op, ip);
+ op += 8; ip += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY32(op, ip);
+ op += 4; ip += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+ }
#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
- if (PTR_ALIGNED2_4(op, ip))
- {
-#endif
- UA_COPY32(op, ip);
- op += 4; ip += 4;
- if (--t > 0)
- {
- if (t >= 4)
- {
- do {
- UA_COPY32(op, ip);
- op += 4; ip += 4; t -= 4;
- } while (t >= 4);
- if (t > 0) do *op++ = *ip++; while (--t > 0);
- }
- else
- do *op++ = *ip++; while (--t > 0);
- }
+ if (PTR_ALIGNED2_4(op, ip))
+ {
+#endif
+ UA_COPY32(op, ip);
+ op += 4; ip += 4;
+ if (--t > 0)
+ {
+ if (t >= 4)
+ {
+ do {
+ UA_COPY32(op, ip);
+ op += 4; ip += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *ip++; while (--t > 0);
+ }
+ else
+ do *op++ = *ip++; while (--t > 0);
+ }
#if !defined(LZO_UNALIGNED_OK_4)
- }
- else
+ }
+ else
#endif
#endif
#if !defined(LZO_UNALIGNED_OK_4) && !defined(LZO_UNALIGNED_OK_8)
- {
- *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
- do *op++ = *ip++; while (--t > 0);
- }
+ {
+ *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
+ do *op++ = *ip++; while (--t > 0);
+ }
#endif
first_literal_run:
- t = *ip++;
- if (t >= 16)
- goto match;
+ t = *ip++;
+ if (t >= 16)
+ goto match;
#if defined(COPY_DICT)
#if defined(LZO1Z)
- m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
- last_m_off = m_off;
+ m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
#else
- m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
+ m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
#endif
- NEED_OP(3);
- t = 3; COPY_DICT(t, m_off)
+ NEED_OP(3);
+ t = 3; COPY_DICT(t, m_off)
#else
#if defined(LZO1Z)
- t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
- m_pos = op - t;
- last_m_off = t;
+ t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
#else
- m_pos = op - (1 + M2_MAX_OFFSET);
- m_pos -= t >> 2;
- m_pos -= *ip++ << 2;
+ m_pos = op - (1 + M2_MAX_OFFSET);
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
#endif
- TEST_LB(m_pos); NEED_OP(3);
- *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
+ TEST_LB(m_pos); NEED_OP(3);
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
#endif
- goto match_done;
+ goto match_done;
- do {
+ do {
match:
- if (t >= 64)
- {
+ if (t >= 64)
+ {
#if defined(COPY_DICT)
#if defined(LZO1X)
- m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
- t = (t >> 5) - 1;
+ m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
+ t = (t >> 5) - 1;
#elif defined(LZO1Y)
- m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
- t = (t >> 4) - 3;
+ m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
+ t = (t >> 4) - 3;
#elif defined(LZO1Z)
- m_off = t & 0x1f;
- if (m_off >= 0x1c)
- m_off = last_m_off;
- else
- {
- m_off = 1 + (m_off << 6) + (*ip++ >> 2);
- last_m_off = m_off;
- }
- t = (t >> 5) - 1;
+ m_off = t & 0x1f;
+ if (m_off >= 0x1c)
+ m_off = last_m_off;
+ else
+ {
+ m_off = 1 + (m_off << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+ }
+ t = (t >> 5) - 1;
#endif
#else
#if defined(LZO1X)
- m_pos = op - 1;
- m_pos -= (t >> 2) & 7;
- m_pos -= *ip++ << 3;
- t = (t >> 5) - 1;
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 7;
+ m_pos -= *ip++ << 3;
+ t = (t >> 5) - 1;
#elif defined(LZO1Y)
- m_pos = op - 1;
- m_pos -= (t >> 2) & 3;
- m_pos -= *ip++ << 2;
- t = (t >> 4) - 3;
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 3;
+ m_pos -= *ip++ << 2;
+ t = (t >> 4) - 3;
#elif defined(LZO1Z)
- {
- uint32 off = t & 0x1f;
- m_pos = op;
- if (off >= 0x1c)
- {
- assert(last_m_off > 0);
- m_pos -= last_m_off;
- }
- else
- {
- off = 1 + (off << 6) + (*ip++ >> 2);
- m_pos -= off;
- last_m_off = off;
- }
- }
- t = (t >> 5) - 1;
-#endif
- TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
- goto copy_match;
-#endif
- }
- else if (t >= 32)
- {
- t &= 31;
- if (t == 0)
- {
- NEED_IP(1);
- while (*ip == 0)
- {
- t += 255;
- ip++;
- NEED_IP(1);
- }
- t += 31 + *ip++;
- }
+ {
+ uint32 off = t & 0x1f;
+ m_pos = op;
+ if (off >= 0x1c)
+ {
+ assert(last_m_off > 0);
+ m_pos -= last_m_off;
+ }
+ else
+ {
+ off = 1 + (off << 6) + (*ip++ >> 2);
+ m_pos -= off;
+ last_m_off = off;
+ }
+ }
+ t = (t >> 5) - 1;
+#endif
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+ goto copy_match;
+#endif
+ }
+ else if (t >= 32)
+ {
+ t &= 31;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ }
#if defined(COPY_DICT)
#if defined(LZO1Z)
- m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
- last_m_off = m_off;
+ m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ last_m_off = m_off;
#else
- m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
+ m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
#endif
#else
#if defined(LZO1Z)
- {
- uint32 off = 1 + (ip[0] << 6) + (ip[1] >> 2);
- m_pos = op - off;
- last_m_off = off;
- }
+ {
+ uint32 off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ m_pos = op - off;
+ last_m_off = off;
+ }
#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
- m_pos = op - 1;
- m_pos -= UA_GET16(ip) >> 2;
+ m_pos = op - 1;
+ m_pos -= UA_GET16(ip) >> 2;
#else
- m_pos = op - 1;
- m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+ m_pos = op - 1;
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
#endif
- ip += 2;
- }
- else if (t >= 16)
- {
+ ip += 2;
+ }
+ else if (t >= 16)
+ {
#if defined(COPY_DICT)
- m_off = (t & 8) << 11;
+ m_off = (t & 8) << 11;
#else
- m_pos = op;
- m_pos -= (t & 8) << 11;
-#endif
- t &= 7;
- if (t == 0)
- {
- NEED_IP(1);
- while (*ip == 0)
- {
- t += 255;
- ip++;
- NEED_IP(1);
- }
- t += 7 + *ip++;
- }
+ m_pos = op;
+ m_pos -= (t & 8) << 11;
+#endif
+ t &= 7;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 7 + *ip++;
+ }
#if defined(COPY_DICT)
#if defined(LZO1Z)
- m_off += (ip[0] << 6) + (ip[1] >> 2);
+ m_off += (ip[0] << 6) + (ip[1] >> 2);
#else
- m_off += (ip[0] >> 2) + (ip[1] << 6);
+ m_off += (ip[0] >> 2) + (ip[1] << 6);
#endif
- ip += 2;
- if (m_off == 0)
- goto eof_found;
- m_off += 0x4000;
+ ip += 2;
+ if (m_off == 0)
+ goto eof_found;
+ m_off += 0x4000;
#if defined(LZO1Z)
- last_m_off = m_off;
+ last_m_off = m_off;
#endif
#else
#if defined(LZO1Z)
- m_pos -= (ip[0] << 6) + (ip[1] >> 2);
+ m_pos -= (ip[0] << 6) + (ip[1] >> 2);
#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
- m_pos -= UA_GET16(ip) >> 2;
+ m_pos -= UA_GET16(ip) >> 2;
#else
- m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
- ip += 2;
- if (m_pos == op)
- goto eof_found;
- m_pos -= 0x4000;
+ ip += 2;
+ if (m_pos == op)
+ goto eof_found;
+ m_pos -= 0x4000;
#if defined(LZO1Z)
- last_m_off = pd((const byte *)op, m_pos);
+ last_m_off = pd((const byte *)op, m_pos);
#endif
#endif
- }
- else
- {
+ }
+ else
+ {
#if defined(COPY_DICT)
#if defined(LZO1Z)
- m_off = 1 + (t << 6) + (*ip++ >> 2);
- last_m_off = m_off;
+ m_off = 1 + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
#else
- m_off = 1 + (t >> 2) + (*ip++ << 2);
+ m_off = 1 + (t >> 2) + (*ip++ << 2);
#endif
- NEED_OP(2);
- t = 2; COPY_DICT(t, m_off)
+ NEED_OP(2);
+ t = 2; COPY_DICT(t, m_off)
#else
#if defined(LZO1Z)
- t = 1 + (t << 6) + (*ip++ >> 2);
- m_pos = op - t;
- last_m_off = t;
+ t = 1 + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
#else
- m_pos = op - 1;
- m_pos -= t >> 2;
- m_pos -= *ip++ << 2;
+ m_pos = op - 1;
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
#endif
- TEST_LB(m_pos); NEED_OP(2);
- *op++ = *m_pos++; *op++ = *m_pos;
+ TEST_LB(m_pos); NEED_OP(2);
+ *op++ = *m_pos++; *op++ = *m_pos;
#endif
- goto match_done;
- }
+ goto match_done;
+ }
#if defined(COPY_DICT)
- NEED_OP(t+3-1);
- t += 3-1; COPY_DICT(t, m_off)
+ NEED_OP(t+3-1);
+ t += 3-1; COPY_DICT(t, m_off)
#else
- TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
- if (op - m_pos >= 8)
- {
- t += (3 - 1);
- if (t >= 8) do
- {
- UA_COPY64(op, m_pos);
- op += 8; m_pos += 8; t -= 8;
- } while (t >= 8);
- if (t >= 4)
- {
- UA_COPY32(op, m_pos);
- op += 4; m_pos += 4; t -= 4;
- }
- if (t > 0)
- {
- *op++ = m_pos[0];
- if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
- }
- }
- else
+ if (op - m_pos >= 8)
+ {
+ t += (3 - 1);
+ if (t >= 8) do
+ {
+ UA_COPY64(op, m_pos);
+ op += 8; m_pos += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY32(op, m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = m_pos[0];
+ if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
+ }
+ }
+ else
#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
- if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op, m_pos))
- {
- assert((op - m_pos) >= 4);
+ if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op, m_pos))
+ {
+ assert((op - m_pos) >= 4);
#else
- if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
- {
-#endif
- UA_COPY32(op, m_pos);
- op += 4; m_pos += 4; t -= 4 - (3 - 1);
- do {
- UA_COPY32(op, m_pos);
- op += 4; m_pos += 4; t -= 4;
- } while (t >= 4);
- if (t > 0) do *op++ = *m_pos++; while (--t > 0);
- }
- else
-#endif
- {
+ if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
+ {
+#endif
+ UA_COPY32(op, m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ UA_COPY32(op, m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *m_pos++; while (--t > 0);
+ }
+ else
+#endif
+ {
copy_match:
- *op++ = *m_pos++; *op++ = *m_pos++;
- do *op++ = *m_pos++; while (--t > 0);
- }
+ *op++ = *m_pos++; *op++ = *m_pos++;
+ do *op++ = *m_pos++; while (--t > 0);
+ }
#endif
match_done:
#if defined(LZO1Z)
- t = ip[-1] & 3;
+ t = ip[-1] & 3;
#else
- t = ip[-2] & 3;
+ t = ip[-2] & 3;
#endif
- if (t == 0)
- break;
+ if (t == 0)
+ break;
match_next:
- assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
#if 0
- do *op++ = *ip++; while (--t > 0);
+ do *op++ = *ip++; while (--t > 0);
#else
- *op++ = *ip++;
- if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
#endif
- t = *ip++;
- } while (TEST_IP && TEST_OP);
- }
+ t = *ip++;
+ } while (TEST_IP && TEST_OP);
+ }
#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
- *out_len = pd(op, out);
- return LZO_E_EOF_NOT_FOUND;
+ *out_len = pd(op, out);
+ return LZO_E_EOF_NOT_FOUND;
#endif
eof_found:
- assert(t == 1);
- *out_len = pd(op, out);
- return (ip == ip_end ? LZO_E_OK :
- (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
+ assert(t == 1);
+ *out_len = pd(op, out);
+ return (ip == ip_end ? LZO_E_OK :
+ (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
#if defined(HAVE_NEED_IP)
input_overrun:
- *out_len = pd(op, out);
- return LZO_E_INPUT_OVERRUN;
+ *out_len = pd(op, out);
+ return LZO_E_INPUT_OVERRUN;
#endif
#if defined(HAVE_NEED_OP)
output_overrun:
- *out_len = pd(op, out);
- return LZO_E_OUTPUT_OVERRUN;
+ *out_len = pd(op, out);
+ return LZO_E_OUTPUT_OVERRUN;
#endif
#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
lookbehind_overrun:
- *out_len = pd(op, out);
- return LZO_E_LOOKBEHIND_OVERRUN;
+ *out_len = pd(op, out);
+ return LZO_E_LOOKBEHIND_OVERRUN;
#endif
}
diff --git a/engines/tony/mpal/memory.cpp b/engines/tony/mpal/memory.cpp
index dfbf16e789..9737fe0abf 100644
--- a/engines/tony/mpal/memory.cpp
+++ b/engines/tony/mpal/memory.cpp
@@ -121,7 +121,6 @@ void MemoryManager::unlockItem(MpalHandle handle) {
--item->_lockCount;
}
-
} // end of namespace MPAL
} // end of namespace Tony
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index 8d83363c24..1bb288edaf 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -196,7 +196,6 @@ static int locGetOrderFromNum(uint32 nLoc) {
return -1;
}
-
/**
* Find the index of a message within the messages array
* @param nMsg Message number to search for
@@ -233,7 +232,6 @@ static int itemGetOrderFromNum(uint32 nItem) {
return -1;
}
-
/**
* Find the index of a script within the scripts array
* @param nScript Script number to search for
@@ -252,7 +250,6 @@ static int scriptGetOrderFromNum(uint32 nScript) {
return -1;
}
-
/**
* Find the index of a dialog within the dialogs array
* @param nDialog Dialog number to search for
@@ -271,7 +268,6 @@ static int dialogGetOrderFromNum(uint32 nDialog) {
return -1;
}
-
/**
* Duplicates a message
* @param nMsgOrd Index of the message inside the messages array
@@ -302,7 +298,6 @@ static char *DuplicateMessage(uint32 nMsgOrd) {
return clonemsg;
}
-
/**
* Duplicate a sentence of a dialog
* @param nDlgOrd Index of the dialog in the dialogs array
@@ -340,7 +335,6 @@ static char *duplicateDialogPeriod(uint32 nPeriod) {
return NULL;
}
-
/**
* Load a resource from the MPR file
*
@@ -461,16 +455,16 @@ static LpItem getItemData(uint32 nOrdItem) {
dat = (char *)globalLock(hDat);
if (dat[0] == 'D' && dat[1] == 'A' && dat[2] == 'T') {
- int i = dat[3]; // For version 1.0!!
+ int i = dat[3]; // For version 1.0!!
dat += 4;
- if (i >= 0x10) { // From 1.0, there's a destination point for each object
+ if (i >= 0x10) { // From 1.0, there's a destination point for each object
ret->_destX = (int16)READ_LE_UINT16(dat);
ret->_destY = (int16)READ_LE_UINT16(dat + 2);
dat += 4;
}
- if (i >= 0x11) { // From 1.1, there's animation speed
+ if (i >= 0x11) { // From 1.1, there's animation speed
ret->_speed = READ_LE_UINT16(dat);
dat += 2;
} else
@@ -511,7 +505,7 @@ static LpItem getItemData(uint32 nOrdItem) {
for (int i = 1; i < ret->_numpattern; i++) {
for (int j = 0; j < patlength[i]; j++)
ret->_pattern[i][j] = dat[j];
- ret->_pattern[i][(int)patlength[i]] = 255; // Terminate pattern
+ ret->_pattern[i][(int)patlength[i]] = 255; // Terminate pattern
dat += patlength[i];
}
@@ -538,7 +532,6 @@ static LpItem getItemData(uint32 nOrdItem) {
return ret;
}
-
/**
* Thread that calls a custom function. It is used in scripts, so that each script
* function is executed without delaying the others.
@@ -562,7 +555,6 @@ void CustomThread(CORO_PARAM, const void *param) {
CORO_END_CODE;
}
-
/**
* Main process for running a script.
*
@@ -587,7 +579,7 @@ void ScriptThread(CORO_PARAM, const void *param) {
_ctx->dwStartTime = g_vm->getTime();
_ctx->numHandles = 0;
-// debugC(DEBUG_BASIC, kTonyDebugMPAL, "PlayScript(): Moments: %u\n", s->_nMoments);
+ //debugC(DEBUG_BASIC, kTonyDebugMPAL, "PlayScript(): Moments: %u\n", s->_nMoments);
for (_ctx->i = 0; _ctx->i < s->_nMoments; _ctx->i++) {
// Sleep for the required time
if (s->_moment[_ctx->i]._dwTime == -1) {
@@ -596,7 +588,7 @@ void ScriptThread(CORO_PARAM, const void *param) {
} else {
_ctx->dwCurTime = g_vm->getTime();
if (_ctx->dwCurTime < _ctx->dwStartTime + (s->_moment[_ctx->i]._dwTime * 100)) {
- // debugC(DEBUG_BASIC, kTonyDebugMPAL, "PlayScript(): Sleeping %lums\n",_ctx->dwStartTime + (s->_moment[_ctx->i]._dwTime*100) - _ctx->dwCurTime);
+ //debugC(DEBUG_BASIC, kTonyDebugMPAL, "PlayScript(): Sleeping %lums\n",_ctx->dwStartTime + (s->_moment[_ctx->i]._dwTime*100) - _ctx->dwCurTime);
CORO_INVOKE_1(CoroScheduler.sleep, _ctx->dwStartTime + (s->_moment[_ctx->i]._dwTime * 100) - _ctx->dwCurTime);
}
}
@@ -655,7 +647,6 @@ void ScriptThread(CORO_PARAM, const void *param) {
CORO_END_CODE;
}
-
/**
* Thread that performs an action on an item. the thread always executes the action,
* so it should create a new item in which the action is the one required.
@@ -752,11 +743,9 @@ void ShutUpActionThread(CORO_PARAM, const void *param) {
CORO_INVOKE_1(g_vm->loadState, _ctx->slotNumber);
}
-
CORO_END_CODE;
}
-
/**
* Polls one location (starting point of a process)
*
@@ -764,14 +753,14 @@ void ShutUpActionThread(CORO_PARAM, const void *param) {
*/
void LocationPollThread(CORO_PARAM, const void *param) {
typedef struct {
- uint32 _nItem, _nAction;
+ uint32 _nItem, _nAction;
- uint16 _wTime;
- byte _perc;
+ uint16 _wTime;
+ byte _perc;
MpalHandle _when;
- byte _nCmds;
- uint16 _cmdNum[MAX_COMMANDS_PER_ACTION];
- uint32 _dwLastTime;
+ byte _nCmds;
+ uint16 _cmdNum[MAX_COMMANDS_PER_ACTION];
+ uint32 _dwLastTime;
} MYACTION;
typedef struct {
@@ -862,7 +851,6 @@ void LocationPollThread(CORO_PARAM, const void *param) {
return;
}
-
// We have established that there is at least one item that contains idle actions.
// Now we created the mirrored copies of the idle actions.
_ctx->myActions = (MYACTION *)globalAlloc(GMEM_FIXED | GMEM_ZEROINIT, _ctx->nIdleActions * sizeof(MYACTION));
@@ -905,7 +893,6 @@ void LocationPollThread(CORO_PARAM, const void *param) {
// We don't need the item list anymore
globalDestroy(_ctx->il);
-
// Here's the main loop
while (1) {
// Searching for idle actions requiring time to execute
@@ -944,7 +931,7 @@ void LocationPollThread(CORO_PARAM, const void *param) {
if (_ctx->curTime >= _ctx->myActions[_ctx->k]._dwLastTime + _ctx->myActions[_ctx->k]._wTime) {
_ctx->myActions[_ctx->k]._dwLastTime += _ctx->myActions[_ctx->k]._wTime;
- // It's time to check to see if fortune is on the side of the idle action
+ // It's time to check to see if fortune is on the side of the idle action
byte randomVal = (byte)g_vm->_randomSource.getRandomNumber(99);
if (randomVal < _ctx->myActions[_ctx->k]._perc) {
// Check if there is an action running on the item
@@ -1016,7 +1003,6 @@ void LocationPollThread(CORO_PARAM, const void *param) {
}
}
-
// Set idle skip on
CORO_INVOKE_4(GLOBALS._lplpFunctions[200], 0, 0, 0, 0);
@@ -1038,7 +1024,6 @@ void LocationPollThread(CORO_PARAM, const void *param) {
CORO_END_CODE;
}
-
/**
* Wait for the end of the dialog execution thread, and then restore global
* variables indicating that the dialogue has finished.
@@ -1071,7 +1056,6 @@ void ShutUpDialogThread(CORO_PARAM, const void *param) {
void doChoice(CORO_PARAM, uint32 nChoice);
-
/**
* Executes a group of the current dialog. Can 'be the Starting point of a process.
* @parm nGroup Number of the group to perform
@@ -1149,7 +1133,6 @@ void GroupThread(CORO_PARAM, const void *param) {
CORO_END_CODE;
}
-
/**
* Make a choice in the current dialog.
*
@@ -1247,7 +1230,6 @@ void doChoice(CORO_PARAM, uint32 nChoice) {
CORO_END_CODE;
}
-
/**
* Perform an action on a certain item.
*
@@ -1353,7 +1335,6 @@ static uint32 doDialog(uint32 nDlgOrd, uint32 nGroup) {
return h;
}
-
/**
* Takes note of the selection chosen by the user, and warns the process that was running
* the box that it can continue.
@@ -1379,7 +1360,6 @@ bool doSelection(uint32 i, uint32 dwData) {
return true;
}
-
/**
* @defgroup Exported functions
*/
@@ -1884,7 +1864,6 @@ MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...) {
return hRet;
}
-
/**
* This is a general function to communicate with the library, to request information
* about what is in the .MPC file
@@ -2005,7 +1984,6 @@ bool mpalStartIdlePoll(int nLoc) {
return false;
}
-
/**
* Stop processing the idle actions of the items on one location.
*
@@ -2063,7 +2041,6 @@ void mpalSaveState(byte *buf) {
unlockVar();
}
-
/**
* Load a save state from a buffer.
*
diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h
index 5e1b02b3fc..779bdd6188 100644
--- a/engines/tony/mpal/mpal.h
+++ b/engines/tony/mpal/mpal.h
@@ -26,7 +26,6 @@
* Copyright (c) 1997-2003 Nayma Software
*/
-
/****************************************************************************\
* General Introduction
\****************************************************************************/
@@ -56,7 +55,6 @@
*
*/
-
/****************************************************************************\
* Custom Functions
\****************************************************************************/
@@ -96,11 +94,11 @@ namespace MPAL {
\****************************************************************************/
// OK value for the error codes
-#define OK 0
+#define OK 0
-#define MAXFRAMES 400 // frame animation of an object
-#define MAXPATTERN 40 // pattern of animation of an object
-#define MAXPOLLINGLOCATIONS 64
+#define MAXFRAMES 400 // frame animation of an object
+#define MAXPATTERN 40 // pattern of animation of an object
+#define MAXPOLLINGLOCATIONS 64
#define GETARG(type) va_arg(v, type)
@@ -108,8 +106,8 @@ namespace MPAL {
* Macro for use with queries that may refer to X and Y co-ordinates
*/
enum QueryCoordinates {
- MPQ_X,
- MPQ_Y
+ MPQ_X,
+ MPQ_Y
};
/**
@@ -117,55 +115,54 @@ enum QueryCoordinates {
* that can do at the library
*/
enum QueryTypes {
- // General Query
- MPQ_VERSION = 10,
-
- MPQ_GLOBAL_VAR = 50,
- MPQ_RESOURCE,
- MPQ_MESSAGE,
-
- // Query on leases
- MPQ_LOCATION_IMAGE = 100,
- MPQ_LOCATION_SIZE,
-
- // Queries about items
- MPQ_ITEM_LIST = 200,
- MPQ_ITEM_DATA,
- MPQ_ITEM_PATTERN,
- MPQ_ITEM_NAME,
+ // General Query
+ MPQ_VERSION = 10,
+
+ MPQ_GLOBAL_VAR = 50,
+ MPQ_RESOURCE,
+ MPQ_MESSAGE,
+
+ // Query on leases
+ MPQ_LOCATION_IMAGE = 100,
+ MPQ_LOCATION_SIZE,
+
+ // Queries about items
+ MPQ_ITEM_LIST = 200,
+ MPQ_ITEM_DATA,
+ MPQ_ITEM_PATTERN,
+ MPQ_ITEM_NAME,
MPQ_ITEM_IS_ACTIVE,
- // Query dialog
- MPQ_DIALOG_PERIOD = 300,
- MPQ_DIALOG_WAITFORCHOICE,
- MPQ_DIALOG_SELECTLIST,
- MPQ_DIALOG_SELECTION,
+ // Query dialog
+ MPQ_DIALOG_PERIOD = 300,
+ MPQ_DIALOG_WAITFORCHOICE,
+ MPQ_DIALOG_SELECTLIST,
+ MPQ_DIALOG_SELECTION,
- // Query execution
- MPQ_DO_ACTION = 400,
- MPQ_DO_DIALOG
+ // Query execution
+ MPQ_DO_ACTION = 400,
+ MPQ_DO_DIALOG
};
/**
* Framework to manage the animation of an item
*/
typedef struct {
- char *_frames[MAXFRAMES];
- Common::Rect _frameslocations[MAXFRAMES];
- Common::Rect _bbox[MAXFRAMES];
- short _pattern[MAXPATTERN][MAXFRAMES];
- short _speed;
- char _numframe;
- char _numpattern;
- char _curframe;
- char _curpattern;
- short _destX, _destY;
- signed char _destZ;
- short _objectID;
+ char *_frames[MAXFRAMES];
+ Common::Rect _frameslocations[MAXFRAMES];
+ Common::Rect _bbox[MAXFRAMES];
+ short _pattern[MAXPATTERN][MAXFRAMES];
+ short _speed;
+ char _numframe;
+ char _numpattern;
+ char _curframe;
+ char _curpattern;
+ short _destX, _destY;
+ signed char _destZ;
+ short _objectID;
} Item;
typedef Item *LpItem;
-
/**
* Define a custom function, to use the language MPAL to perform various controls as a result of an action
*/
@@ -206,7 +203,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryGlobalVar(lpszVarName) \
mpalQueryDWORD(MPQ_GLOBAL_VAR, (const char *)(lpszVarName))
-
/**
* Provides access to a resource inside the .MPC file
*
@@ -216,7 +212,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryResource(dwResId) \
mpalQueryHANDLE(MPQ_RESOURCE, (uint32)(dwResId))
-
/**
* Returns a message.
*
@@ -228,7 +223,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryMessage(nMsg) \
(char *)mpalQueryHANDLE(MPQ_MESSAGE, (uint32)(nMsg))
-
/**
* Provides a location image
* @return Returns a picture handle
@@ -236,7 +230,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryLocationImage(nLoc) \
mpalQueryHANDLE(MPQ_LOCATION_IMAGE, (uint32)(nLoc))
-
/**
* Request the x or y size of a location in pixels
*
@@ -247,7 +240,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryLocationSize(nLoc, dwCoord) \
mpalQueryDWORD(MPQ_LOCATION_SIZE, (uint32)(nLoc), (uint32)(dwCoord))
-
/**
* Provides the list of objects in a location.
*
@@ -258,7 +250,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryItemList(nLoc) \
(uint32 *)mpalQueryHANDLE(MPQ_ITEM_LIST, (uint32)(nLoc))
-
/**
* Provides information on an item
*
@@ -268,7 +259,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryItemData(nItem) \
(LpItem)mpalQueryHANDLE(MPQ_ITEM_DATA, (uint32)(nItem))
-
/**
* Provides the current pattern of an item
*
@@ -279,7 +269,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryItemPattern(nItem) \
mpalQueryDWORD(MPQ_ITEM_PATTERN, (uint32)(nItem))
-
/**
* Returns true if an item is active
*
@@ -289,7 +278,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryItemIsActive(nItem) \
(bool)mpalQueryDWORD(MPQ_ITEM_IS_ACTIVE, (uint32)(nItem))
-
/**
* Returns the name of an item
*
@@ -302,7 +290,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryItemName(nItem, lpszName) \
mpalQueryHANDLE(MPQ_ITEM_NAME, (uint32)(nItem), (char *)(lpszName))
-
/**
* Returns a sentence of dialog.
*
@@ -316,7 +303,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
#define mpalQueryDialogPeriod(nPeriod) \
(char *)mpalQueryHANDLE(MPQ_DIALOG_PERIOD, (uint32)(nPeriod))
-
/**
* Wait until the moment in which the need is signaled to make a choice by the user.
* @returns Number of choice to be made, or -1 if the dialogue is finished.
@@ -393,7 +379,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
* @returns TRUE if all OK, FALSE on failure
*/
bool mpalInit(const char *lpszFileName, const char *lpszMprFileName,
- LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings);
+ LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings);
/**
* Frees resources allocated by the MPAL subsystem
@@ -476,7 +462,6 @@ bool mpalStartIdlePoll(int nLoc);
*/
void mpalEndIdlePoll(CORO_PARAM, int nLoc, bool *result);
-
/**
* Load a save state from a buffer.
*
diff --git a/engines/tony/mpal/mpaldll.h b/engines/tony/mpal/mpaldll.h
index 8897096f51..92ddf8fc5a 100644
--- a/engines/tony/mpal/mpaldll.h
+++ b/engines/tony/mpal/mpaldll.h
@@ -73,7 +73,7 @@ namespace MPAL {
* MPAL global variables
*/
struct MpalVar {
- uint32 _dwVal; // Variable value
+ uint32 _dwVal; // Variable value
char _lpszVarName[33]; // Variable name
} PACKED_STRUCT;
typedef MpalVar *LpMpalVar;
@@ -82,8 +82,8 @@ typedef MpalVar *LpMpalVar;
* MPAL Messages
*/
struct MpalMsg {
- MpalHandle _hText; // Handle to the message text
- uint16 _wNum; // Message number
+ MpalHandle _hText; // Handle to the message text
+ uint16 _wNum; // Message number
} PACKED_STRUCT;
typedef MpalMsg *LpMpalMsg;
@@ -91,9 +91,9 @@ typedef MpalMsg *LpMpalMsg;
* MPAL Locations
*/
struct MpalLocation {
- uint32 _nObj; // Location number
- uint32 _dwXlen, _dwYlen; // Dimensions
- uint32 _dwPicRes; // Resource that contains the image
+ uint32 _nObj; // Location number
+ uint32 _dwXlen, _dwYlen; // Dimensions
+ uint32 _dwPicRes; // Resource that contains the image
} PACKED_STRUCT;
typedef MpalLocation *LpMpalLocation;
@@ -110,34 +110,33 @@ struct Command {
* #3 -> Making a choice (DIALOG)
*
*/
- byte _type; // Type of control
+ byte _type; // Type of control
union {
- int32 _nCf; // Custom function call [#1]
- char *_lpszVarName; // Variable name [#2]
- int32 _nChoice; // Number of choice you make [#3]
+ int32 _nCf; // Custom function call [#1]
+ char *_lpszVarName; // Variable name [#2]
+ int32 _nChoice; // Number of choice you make [#3]
};
union {
- int32 _arg1; // Argument for custom function [#1]
- MpalHandle _expr; // Expression to assign to a variable [#2]
+ int32 _arg1; // Argument for custom function [#1]
+ MpalHandle _expr; // Expression to assign to a variable [#2]
};
- int32 _arg2, _arg3, _arg4; // Arguments for custom function [#1]
+ int32 _arg2, _arg3, _arg4; // Arguments for custom function [#1]
} PACKED_STRUCT;
-
/**
* MPAL dialog
*/
struct MpalDialog {
- uint32 _nObj; // Dialog number
+ uint32 _nObj; // Dialog number
struct Command _command[MAX_COMMANDS_PER_DIALOG];
struct {
uint16 _num;
- byte _nCmds;
+ byte _nCmds;
uint16 _cmdNum[MAX_COMMANDS_PER_GROUP];
} _group[MAX_GROUPS_PER_DIALOG];
@@ -152,7 +151,7 @@ struct MpalDialog {
uint32 _dwData;
uint16 _wPlayGroup[MAX_PLAYGROUPS_PER_SELECT];
- // Bit 0=endchoice Bit 1=enddialog
+ // Bit 0=endchoice Bit 1=enddialog
byte _attr;
// Modified at run-time: 0 if the select is currently disabled,
@@ -172,23 +171,22 @@ typedef MpalDialog *LpMpalDialog;
* MPAL Item
*/
struct ItemAction {
- byte _num; // Action number
- uint16 _wTime; // If idle, the time which must pass
- byte _perc; // Percentage of the idle run
- MpalHandle _when; // Expression to compute. If != 0, then
- // action can be done
- uint16 _wParm; // Parameter for action
-
- byte _nCmds; // Number of commands to be executed
- uint32 _cmdNum[MAX_COMMANDS_PER_ACTION]; // Commands to execute
+ byte _num; // Action number
+ uint16 _wTime; // If idle, the time which must pass
+ byte _perc; // Percentage of the idle run
+ MpalHandle _when; // Expression to compute. If != 0, then action can be done
+ uint16 _wParm; // Parameter for action
+
+ byte _nCmds; // Number of commands to be executed
+ uint32 _cmdNum[MAX_COMMANDS_PER_ACTION]; // Commands to execute
} PACKED_STRUCT;
struct MpalItem {
- uint32 _nObj; // Item number
+ uint32 _nObj; // Item number
byte _lpszDescribe[MAX_DESCRIBE_SIZE]; // Name
- byte _nActions; // Number of managed actions
- uint32 _dwRes; // Resource that contains frames and patterns
+ byte _nActions; // Number of managed actions
+ uint32 _dwRes; // Resource that contains frames and patterns
struct Command _command[MAX_COMMANDS_PER_ITEM];
@@ -209,14 +207,14 @@ struct MpalScript {
struct Command _command[MAX_COMMANDS_PER_SCRIPT];
struct {
- int32 _dwTime;
- byte _nCmds;
+ int32 _dwTime;
+ byte _nCmds;
uint32 _cmdNum[MAX_COMMANDS_PER_MOMENT];
} _moment[MAX_MOMENTS_PER_SCRIPT];
} PACKED_STRUCT;
-typedef MpalScript *LpMpalScript;
+typedef MpalScript *LpMpalScript;
#include "common/pack-end.h"
@@ -235,7 +233,6 @@ typedef MpalScript *LpMpalScript;
*/
extern int32 varGetValue(const char *lpszVarName);
-
/**
* Sets the value of a MPAL global variable
* @param lpszVarName Name of the variable
diff --git a/engines/tony/mpal/mpalutils.h b/engines/tony/mpal/mpalutils.h
index d92bb6f9a2..f351f22196 100644
--- a/engines/tony/mpal/mpalutils.h
+++ b/engines/tony/mpal/mpalutils.h
@@ -38,19 +38,19 @@ namespace MPAL {
class RMRes {
protected:
MpalHandle _h;
- byte *_buf;
+ byte *_buf;
public:
RMRes(uint32 resID);
- virtual ~RMRes();
+ virtual ~RMRes();
- // Attributes
+ // Attributes
unsigned int size();
- const byte *dataPointer();
+ const byte *dataPointer();
bool isValid();
- // Casting for access to data
- operator const byte*();
+ // Casting for access to data
+ operator const byte*();
Common::SeekableReadStream *getReadStream();
};