aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/mpal
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-01 17:28:24 -0500
committerPaul Gilbert2014-03-01 17:28:24 -0500
commit7880ae0b18c3e2a25ed1c4a2bc42e22066d1ff3e (patch)
tree96de4f3470bd9bcc81bbae82a3e1c59f523a8edf /engines/tony/mpal
parentbadb8d97444767b7d8fea0f877ac044249696a5f (diff)
parent2218d14fb5276724c757406d5ac1ec581160721b (diff)
downloadscummvm-rg350-7880ae0b18c3e2a25ed1c4a2bc42e22066d1ff3e.tar.gz
scummvm-rg350-7880ae0b18c3e2a25ed1c4a2bc42e22066d1ff3e.tar.bz2
scummvm-rg350-7880ae0b18c3e2a25ed1c4a2bc42e22066d1ff3e.zip
Merge branch 'master' into mads
Diffstat (limited to 'engines/tony/mpal')
-rw-r--r--engines/tony/mpal/expr.cpp5
-rw-r--r--engines/tony/mpal/expr.h5
-rw-r--r--engines/tony/mpal/loadmpc.cpp9
-rw-r--r--engines/tony/mpal/loadmpc.h5
-rw-r--r--engines/tony/mpal/lzo.cpp386
-rw-r--r--engines/tony/mpal/lzo.h26
-rw-r--r--engines/tony/mpal/memory.cpp5
-rw-r--r--engines/tony/mpal/memory.h5
-rw-r--r--engines/tony/mpal/mpal.cpp20
-rw-r--r--engines/tony/mpal/mpal.h11
-rw-r--r--engines/tony/mpal/mpaldll.h5
-rw-r--r--engines/tony/mpal/mpalutils.cpp5
-rw-r--r--engines/tony/mpal/mpalutils.h5
13 files changed, 81 insertions, 411 deletions
diff --git a/engines/tony/mpal/expr.cpp b/engines/tony/mpal/expr.cpp
index 7dc640ba7c..1fdf637062 100644
--- a/engines/tony/mpal/expr.cpp
+++ b/engines/tony/mpal/expr.cpp
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/*
* This code is based on original Tony Tough source code
diff --git a/engines/tony/mpal/expr.h b/engines/tony/mpal/expr.h
index 256d09bb9b..6ac1963356 100644
--- a/engines/tony/mpal/expr.h
+++ b/engines/tony/mpal/expr.h
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/*
* This code is based on original Tony Tough source code
diff --git a/engines/tony/mpal/loadmpc.cpp b/engines/tony/mpal/loadmpc.cpp
index 4eb84d1406..8d030f1e52 100644
--- a/engines/tony/mpal/loadmpc.cpp
+++ b/engines/tony/mpal/loadmpc.cpp
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/*
* This code is based on original Tony Tough source code
@@ -139,8 +138,6 @@ static void FreeScript(LpMpalScript lpmsScript) {
* @returns Pointer to the buffer after the item, or NULL on failure.
*/
static const byte *parseDialog(const byte *lpBuf, LpMpalDialog lpmdDialog) {
- byte *lpLock;
-
lpmdDialog->_nObj = READ_LE_UINT32(lpBuf);
lpBuf += 4;
@@ -156,7 +153,7 @@ static const byte *parseDialog(const byte *lpBuf, LpMpalDialog lpmdDialog) {
lpmdDialog->_periodNums[i] = READ_LE_UINT16(lpBuf);
lpBuf += 2;
lpmdDialog->_periods[i] = globalAllocate(GMEM_MOVEABLE | GMEM_ZEROINIT, *lpBuf + 1);
- lpLock = (byte *)globalLock(lpmdDialog->_periods[i]);
+ byte *lpLock = (byte *)globalLock(lpmdDialog->_periods[i]);
Common::copy(lpBuf + 1, lpBuf + 1 + *lpBuf, lpLock);
globalUnlock(lpmdDialog->_periods[i]);
lpBuf += (*lpBuf) + 1;
diff --git a/engines/tony/mpal/loadmpc.h b/engines/tony/mpal/loadmpc.h
index 20956288aa..479cf5f99b 100644
--- a/engines/tony/mpal/loadmpc.h
+++ b/engines/tony/mpal/loadmpc.h
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/*
* This code is based on original Tony Tough source code
diff --git a/engines/tony/mpal/lzo.cpp b/engines/tony/mpal/lzo.cpp
index a04a769528..314d6f3ed5 100644
--- a/engines/tony/mpal/lzo.cpp
+++ b/engines/tony/mpal/lzo.cpp
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/* minilzo.c -- mini subset of the LZO real-time data compression library
@@ -70,15 +69,9 @@ namespace Tony {
namespace MPAL {
#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 M2_MAX_OFFSET 0x0800
-#define LZO1X
/**
* Decompresses an LZO compressed resource
@@ -87,425 +80,142 @@ 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;
-#if defined(COPY_DICT)
- uint32 m_off;
- const byte *dict_end;
-#else
register const byte *m_pos;
-#endif
const byte * const ip_end = in + in_len;
-#if defined(HAVE_ANY_OP)
- byte * const op_end = out + *out_len;
-#endif
-#if defined(LZO1Z)
- 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)
- {
+ 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);
+ assert(t > 0);
+ do
+ *op++ = *ip++;
+ while (--t > 0);
goto first_literal_run;
}
- while (TEST_IP && TEST_OP)
- {
+ while (TEST_IP) {
t = *ip++;
if (t >= 16)
goto match;
- if (t == 0)
- {
- NEED_IP(1);
- while (*ip == 0)
- {
+ if (t == 0) {
+ 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)
- {
+ assert(t > 0);
+
+ *op++ = *ip++;
+ *op++ = *ip++;
+ *op++ = *ip++;
+ do
*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 !defined(LZO_UNALIGNED_OK_4)
- }
- 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);
- }
-#endif
+ while (--t > 0);
first_literal_run:
-
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;
-#else
- m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
-#endif
- 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;
-#else
+
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;
-#endif
+
+ *op++ = *m_pos++;
+ *op++ = *m_pos++;
+ *op++ = *m_pos;
+
goto match_done;
do {
match:
- if (t >= 64)
- {
-#if defined(COPY_DICT)
-#if defined(LZO1X)
- 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;
-#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;
-#endif
-#else
-#if defined(LZO1X)
+ if (t >= 64) {
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;
-#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);
+ assert(t > 0);
goto copy_match;
-#endif
- }
- else if (t >= 32)
- {
+ } else if (t >= 32) {
t &= 31;
- if (t == 0)
- {
- NEED_IP(1);
- while (*ip == 0)
- {
+ if (t == 0) {
+ 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;
-#else
- 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;
- }
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
- m_pos = op - 1;
- m_pos -= UA_GET16(ip) >> 2;
-#else
m_pos = op - 1;
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
-#endif
-#endif
ip += 2;
- }
- else if (t >= 16)
- {
-#if defined(COPY_DICT)
- m_off = (t & 8) << 11;
-#else
+ } else if (t >= 16) {
m_pos = op;
m_pos -= (t & 8) << 11;
-#endif
t &= 7;
- if (t == 0)
- {
- NEED_IP(1);
- while (*ip == 0)
- {
+ if (t == 0) {
+ 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);
-#else
- m_off += (ip[0] >> 2) + (ip[1] << 6);
-#endif
- ip += 2;
- if (m_off == 0)
- goto eof_found;
- m_off += 0x4000;
-#if defined(LZO1Z)
- last_m_off = m_off;
-#endif
-#else
-#if defined(LZO1Z)
- 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;
-#else
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
-#endif
ip += 2;
if (m_pos == op)
goto eof_found;
m_pos -= 0x4000;
-#if defined(LZO1Z)
- last_m_off = pd((const byte *)op, m_pos);
-#endif
-#endif
- }
- else
- {
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
- m_off = 1 + (t << 6) + (*ip++ >> 2);
- last_m_off = m_off;
-#else
- m_off = 1 + (t >> 2) + (*ip++ << 2);
-#endif
- 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;
-#else
+ } else {
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;
-#endif
+ *op++ = *m_pos++;
+ *op++ = *m_pos;
goto match_done;
}
-#if defined(COPY_DICT)
-
- 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);
-#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
-#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);
-#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
+ assert(t > 0);
{
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;
-#else
t = ip[-2] & 3;
-#endif
if (t == 0)
break;
match_next:
- assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
-#if 0
- do *op++ = *ip++; while (--t > 0);
-#else
+ assert(t > 0);
+ assert(t < 4);
*op++ = *ip++;
- if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
-#endif
+ if (t > 1) {
+ *op++ = *ip++;
+ if (t > 2)
+ *op++ = *ip++;
+ }
t = *ip++;
- } while (TEST_IP && TEST_OP);
+ } while (TEST_IP);
}
-#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
- *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));
-#if defined(HAVE_NEED_IP)
-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;
-#endif
-
-#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
-lookbehind_overrun:
- *out_len = pd(op, out);
- return LZO_E_LOOKBEHIND_OVERRUN;
-#endif
}
} // end of namespace MPAL
-
} // end of namespace Tony
diff --git a/engines/tony/mpal/lzo.h b/engines/tony/mpal/lzo.h
index ebb1c4b516..172900f053 100644
--- a/engines/tony/mpal/lzo.h
+++ b/engines/tony/mpal/lzo.h
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/* minilzo.c -- mini subset of the LZO real-time data compression library
@@ -76,36 +75,15 @@ namespace MPAL {
* normal events.
*/
#define LZO_E_OK 0
-#define LZO_E_ERROR (-1)
-#define LZO_E_OUT_OF_MEMORY (-2) /* [lzo_alloc_func_t failure] */
-#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
#define LZO_E_INPUT_OVERRUN (-4)
-#define LZO_E_OUTPUT_OVERRUN (-5)
-#define LZO_E_LOOKBEHIND_OVERRUN (-6)
-#define LZO_E_EOF_NOT_FOUND (-7)
#define LZO_E_INPUT_NOT_CONSUMED (-8)
-#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
-#define LZO_E_INVALID_ARGUMENT (-10)
-
-#define LZO1X_999_MEM_COMPRESS ((uint32) (14 * 16384L * sizeof(uint16)))
/**
* Decompresses an LZO compressed resource
*/
int lzo1x_decompress(const byte *src, uint32 src_len, byte *dst, uint32 *dst_len);
-/**
- * Comrpess a data block into an LZO stream
- */
-int lzo1x_1_compress(const byte *src, uint32 src_len, byte *dst, uint32 *dst_len, void *wrkmem);
-
-/**
- * better compression ratio at the cost of more memory and time
- */
-int lzo1x_999_compress(const byte *src, uint32 src_len, byte *dst, uint32 *dst_len, void *wrkmem);
-
} // end of namespace MPAL
-
} // end of namespace Tony
#endif /* already included */
diff --git a/engines/tony/mpal/memory.cpp b/engines/tony/mpal/memory.cpp
index 9737fe0abf..4076f710de 100644
--- a/engines/tony/mpal/memory.cpp
+++ b/engines/tony/mpal/memory.cpp
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
#include "common/algorithm.h"
diff --git a/engines/tony/mpal/memory.h b/engines/tony/mpal/memory.h
index 9c21cc20e6..7739fdfa48 100644
--- a/engines/tony/mpal/memory.h
+++ b/engines/tony/mpal/memory.h
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
#ifndef TONY_MPAL_MEMORY
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index 19e3d43df4..c813b354b0 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/*
* This code is based on original Tony Tough source code
@@ -1519,13 +1518,12 @@ void mpalFree() {
*
* @param wQueryType Type of query. The list is in the QueryTypes enum.
* @returns 4 bytes depending on the type of query
- * @remarks This is the specialised version of the original single mpalQuery
+ * @remarks This is the specialized version of the original single mpalQuery
* method that returns numeric results.
*/
uint32 mpalQueryDWORD(uint16 wQueryType, ...) {
Common::String buf;
uint32 dwRet = 0;
- char *n;
va_list v;
va_start(v, wQueryType);
@@ -1626,7 +1624,7 @@ uint32 mpalQueryDWORD(uint16 wQueryType, ...) {
*/
lockVar();
int x = GETARG(uint32);
- n = GETARG(char *);
+ char *n = GETARG(char *);
buf = Common::String::format("Status.%u", x);
if (varGetValue(buf.c_str()) <= 0)
n[0]='\0';
@@ -1716,11 +1714,10 @@ uint32 mpalQueryDWORD(uint16 wQueryType, ...) {
*
* @param wQueryType Type of query. The list is in the QueryTypes enum.
* @returns 4 bytes depending on the type of query
- * @remarks This is the specialised version of the original single mpalQuery
+ * @remarks This is the specialized version of the original single mpalQuery
* method that returns a pointer or handle.
*/
MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...) {
- char *n;
Common::String buf;
va_list v;
va_start(v, wQueryType);
@@ -1798,12 +1795,9 @@ MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...) {
error("mpalQuery(MPQ_ITEM_IS_ACTIVE, uint32 nItem) used incorrect variant");
} else if (wQueryType == MPQ_ITEM_NAME) {
- /*
- * uint32 mpalQuery(MPQ_ITEM_NAME, uint32 nItem, char *lpszName);
- */
lockVar();
int x = GETARG(uint32);
- n = GETARG(char *);
+ char *n = GETARG(char *);
buf = Common::String::format("Status.%u", x);
if (varGetValue(buf.c_str()) <= 0)
n[0] = '\0';
@@ -1873,7 +1867,7 @@ MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...) {
*
* @param wQueryType Type of query. The list is in the QueryTypes enum.
* @returns 4 bytes depending on the type of query
- * @remarks This is the specialised version of the original single mpalQuery
+ * @remarks This is the specialized version of the original single mpalQuery
* method that needs to run within a co-routine context.
*/
void mpalQueryCORO(CORO_PARAM, uint16 wQueryType, uint32 *dwRet) {
diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h
index 2d22ee8faf..af24c46697 100644
--- a/engines/tony/mpal/mpal.h
+++ b/engines/tony/mpal/mpal.h
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/*
* This code is based on original Tony Tough source code
@@ -392,7 +391,7 @@ void mpalFree();
*
* @param wQueryType Type of query. The list is in the QueryTypes enum.
* @returns 4 bytes depending on the type of query
- * @remarks This is the specialised version of the original single mpalQuery
+ * @remarks This is the specialized version of the original single mpalQuery
* method that returns numeric results.
*/
uint32 mpalQueryDWORD(uint16 wQueryType, ...);
@@ -403,7 +402,7 @@ uint32 mpalQueryDWORD(uint16 wQueryType, ...);
*
* @param wQueryType Type of query. The list is in the QueryTypes enum.
* @returns 4 bytes depending on the type of query
- * @remarks This is the specialised version of the original single mpalQuery
+ * @remarks This is the specialized version of the original single mpalQuery
* method that returns a pointer or handle.
*/
MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...);
@@ -414,7 +413,7 @@ MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...);
*
* @param wQueryType Type of query. The list is in the QueryTypes enum.
* @returns 4 bytes depending on the type of query
- * @remarks This is the specialised version of the original single mpalQuery
+ * @remarks This is the specialized version of the original single mpalQuery
* method that needs to run within a co-routine context.
*/
void mpalQueryCORO(CORO_PARAM, uint16 wQueryType, uint32 *dwRet);
diff --git a/engines/tony/mpal/mpaldll.h b/engines/tony/mpal/mpaldll.h
index 92ddf8fc5a..68969497c1 100644
--- a/engines/tony/mpal/mpaldll.h
+++ b/engines/tony/mpal/mpaldll.h
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
/*
* This code is based on original Tony Tough source code
diff --git a/engines/tony/mpal/mpalutils.cpp b/engines/tony/mpal/mpalutils.cpp
index 0919aed5ac..84c8a68919 100644
--- a/engines/tony/mpal/mpalutils.cpp
+++ b/engines/tony/mpal/mpalutils.cpp
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
#include "tony/mpal/mpalutils.h"
diff --git a/engines/tony/mpal/mpalutils.h b/engines/tony/mpal/mpalutils.h
index f351f22196..9ef534c632 100644
--- a/engines/tony/mpal/mpalutils.h
+++ b/engines/tony/mpal/mpalutils.h
@@ -8,17 +8,16 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- *
*/
#ifndef TONY_MPAL_MPALUTILS