summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2010-04-24 23:53:03 +0000
committerSimon Howard2010-04-24 23:53:03 +0000
commite7f0d2727a01c90a5552a3baf442c11f43a95ce8 (patch)
tree3b822ba2f56dbacfd5054b15275715a2ef658f66
parent4070ecd92c45dadc80e048e1bc929bced925c232 (diff)
downloadchocolate-doom-e7f0d2727a01c90a5552a3baf442c11f43a95ce8.tar.gz
chocolate-doom-e7f0d2727a01c90a5552a3baf442c11f43a95ce8.tar.bz2
chocolate-doom-e7f0d2727a01c90a5552a3baf442c11f43a95ce8.zip
Add -reject_pad_with_ff parameter to allow padding value to be
specified. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1915
-rw-r--r--src/p_setup.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/p_setup.c b/src/p_setup.c
index 385759f8..58edc6fd 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -33,6 +33,7 @@
#include "deh_main.h"
#include "i_swap.h"
+#include "m_argv.h"
#include "m_bbox.h"
#include "g_game.h"
@@ -651,6 +652,7 @@ static void PadRejectArray(byte *array, unsigned int len)
unsigned int i;
unsigned int byte_num;
byte *dest;
+ unsigned int padvalue;
// Values to pad the REJECT array with:
@@ -681,9 +683,18 @@ static void PadRejectArray(byte *array, unsigned int len)
fprintf(stderr, "PadRejectArray: REJECT lump too short to pad! (%i > %i)\n",
len, sizeof(rejectpad));
- // Pad remaining space with 0xff.
+ // Pad remaining space with 0 (or 0xff, if specified on command line).
- memset(array + sizeof(rejectpad), 0x00, len - sizeof(rejectpad));
+ if (M_CheckParm("-reject_pad_with_ff"))
+ {
+ padvalue = 0xff;
+ }
+ else
+ {
+ padvalue = 0xf00;
+ }
+
+ memset(array + sizeof(rejectpad), padvalue, len - sizeof(rejectpad));
}
}