diff options
author | Simon Howard | 2008-07-26 15:45:52 +0000 |
---|---|---|
committer | Simon Howard | 2008-07-26 15:45:52 +0000 |
commit | 6e8d5f118991efdc040f367b208f32219457bb39 (patch) | |
tree | 722c50adc1aeee3b1c13160f8d6a46b364725bdc /src/deh_main.c | |
parent | fa03d0eb682e3838c4cebf62e3c24e3e6a7982b8 (diff) | |
download | chocolate-doom-6e8d5f118991efdc040f367b208f32219457bb39.tar.gz chocolate-doom-6e8d5f118991efdc040f367b208f32219457bb39.tar.bz2 chocolate-doom-6e8d5f118991efdc040f367b208f32219457bb39.zip |
Allow magic comments in dehacked files that disable the DOS dehacked
text replacement limit, so that we can use a dehacked patch to emulate
chex.exe.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1158
Diffstat (limited to 'src/deh_main.c')
-rw-r--r-- | src/deh_main.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/deh_main.c b/src/deh_main.c index 7b08ebf4..e4ae7251 100644 --- a/src/deh_main.c +++ b/src/deh_main.c @@ -59,6 +59,10 @@ extern deh_section_t deh_section_thing; // deh_weapon.c: extern deh_section_t deh_section_weapon; +// If true, we can do long string replacements. + +boolean deh_allow_long_strings = false; + // // List of section types: // @@ -226,6 +230,24 @@ static boolean CheckSignatures(deh_context_t *context) return false; } +// Parses a comment string in a dehacked file. + +static void DEH_ParseComment(char *comment) +{ + // Allow comments containing this special value to allow string + // replacements longer than those permitted by DOS dehacked. + // This allows us to use a dehacked patch for doing string + // replacements for emulating Chex Quest. + // + // If you use this, your dehacked patch may not work in Vanilla + // Doom. + + if (strstr(comment, "*allow-long-strings*") != NULL) + { + deh_allow_long_strings = true; + } +} + // Parses a dehacked file by reading from the context static void DEH_ParseContext(deh_context_t *context) @@ -241,6 +263,8 @@ static void DEH_ParseContext(deh_context_t *context) { DEH_Error(context, "This is not a valid dehacked patch file!"); } + + deh_allow_long_strings = false; // Read the file @@ -262,6 +286,7 @@ static void DEH_ParseContext(deh_context_t *context) { // comment + DEH_ParseComment(line); continue; } |