diff options
author | Simon Howard | 2008-09-23 23:12:03 +0000 |
---|---|---|
committer | Simon Howard | 2008-09-23 23:12:03 +0000 |
commit | fb176d6121a9313cd98cd015045d239ddfef3994 (patch) | |
tree | ca696ac4195e62bc46ba88c8500fd16eb87e1594 | |
parent | 350fe185784d6d0350ed8b675630440ff425a6ca (diff) | |
parent | 5bab2a788da04bd8aaa65891cb3fc7240d56a9b7 (diff) | |
download | chocolate-doom-fb176d6121a9313cd98cd015045d239ddfef3994.tar.gz chocolate-doom-fb176d6121a9313cd98cd015045d239ddfef3994.tar.bz2 chocolate-doom-fb176d6121a9313cd98cd015045d239ddfef3994.zip |
Merge updates from trunk.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1266
-rw-r--r-- | codeblocks/game.cbp | 10 | ||||
-rw-r--r-- | codeblocks/libpcsound.cbp | 2 | ||||
-rw-r--r-- | codeblocks/server.cbp | 2 | ||||
-rw-r--r-- | codeblocks/setup.cbp | 9 | ||||
-rw-r--r-- | codeblocks/textscreen.cbp | 3 | ||||
-rw-r--r-- | src/doom/d_main.c | 2 | ||||
-rw-r--r-- | src/doom/deh_cheat.c | 10 | ||||
-rw-r--r-- | src/doom/deh_io.c | 13 | ||||
-rw-r--r-- | src/doom/deh_main.c | 15 | ||||
-rw-r--r-- | src/doom/deh_main.h | 1 | ||||
-rw-r--r-- | src/i_main.c | 18 |
11 files changed, 67 insertions, 18 deletions
diff --git a/codeblocks/game.cbp b/codeblocks/game.cbp index 05b32d25..bf1c249a 100644 --- a/codeblocks/game.cbp +++ b/codeblocks/game.cbp @@ -13,10 +13,14 @@ <Option type="0" /> <Option compiler="gcc" /> <Option parameters="-iwad d:\russell\games\doom2\iwad\doom2.wad" /> + <Option projectLinkerOptionsRelation="2" /> <Compiler> <Add option="-W" /> - <Add option="-g" /> + <Add option="-gdwarf-2" /> </Compiler> + <Linker> + <Add option="-lpcsound-dbg -ltextscreen-dbg" /> + </Linker> </Target> <Target title="Release"> <Option output="..\bin\$(PROJECT_NAME).exe" prefix_auto="0" extension_auto="0" /> @@ -24,11 +28,13 @@ <Option object_output="..\obj\rel" /> <Option type="0" /> <Option compiler="gcc" /> + <Option projectLinkerOptionsRelation="2" /> <Compiler> <Add option="-O2" /> </Compiler> <Linker> <Add option="-s" /> + <Add option="-lpcsound -ltextscreen" /> </Linker> </Target> </Build> @@ -42,7 +48,7 @@ <Add directory="..\pcsound" /> </Compiler> <Linker> - <Add option="-lpcsound -ltextscreen -lmingw32 -lSDLmain -lSDL -lSDL_mixer -lSDL_net -mwindows" /> + <Add option="-lmingw32 -lSDLmain -lSDL -lSDL_mixer -lSDL_net -mwindows" /> <Add directory="..\lib" /> </Linker> <Unit filename="config.h" /> diff --git a/codeblocks/libpcsound.cbp b/codeblocks/libpcsound.cbp index ce526ee5..9ae9843b 100644 --- a/codeblocks/libpcsound.cbp +++ b/codeblocks/libpcsound.cbp @@ -13,7 +13,7 @@ <Option type="2" /> <Option compiler="gcc" /> <Compiler> - <Add option="-g" /> + <Add option="-gdwarf-2" /> </Compiler> </Target> <Target title="Release"> diff --git a/codeblocks/server.cbp b/codeblocks/server.cbp index 1b30bcfa..c15d3d96 100644 --- a/codeblocks/server.cbp +++ b/codeblocks/server.cbp @@ -14,7 +14,7 @@ <Option compiler="gcc" /> <Compiler> <Add option="-W" /> - <Add option="-g" /> + <Add option="-gdwarf-2" /> </Compiler> </Target> <Target title="Release"> diff --git a/codeblocks/setup.cbp b/codeblocks/setup.cbp index 816693fe..4cfe39e4 100644 --- a/codeblocks/setup.cbp +++ b/codeblocks/setup.cbp @@ -12,10 +12,15 @@ <Option object_output="..\obj\dbg\" /> <Option type="0" /> <Option compiler="gcc" /> + <Option projectLinkerOptionsRelation="2" /> <Compiler> <Add option="-W" /> <Add option="-g" /> + <Add option="-gdwarf-2" /> </Compiler> + <Linker> + <Add option="-ltextscreen-dbg" /> + </Linker> </Target> <Target title="Release"> <Option output="..\bin\$(PROJECT_NAME).exe" prefix_auto="0" extension_auto="0" /> @@ -23,11 +28,13 @@ <Option object_output="..\obj\rel\" /> <Option type="0" /> <Option compiler="gcc" /> + <Option projectLinkerOptionsRelation="2" /> <Compiler> <Add option="-O2" /> </Compiler> <Linker> <Add option="-s" /> + <Add option="-ltextscreen" /> </Linker> </Target> </Build> @@ -45,7 +52,7 @@ <Add directory="..\setup" /> </ResourceCompiler> <Linker> - <Add option="-ltextscreen -lmingw32 -lSDLmain -lSDL -mwindows" /> + <Add option="-lmingw32 -lSDLmain -lSDL -mwindows" /> <Add directory="..\lib" /> </Linker> <Unit filename="setup-res.rc"> diff --git a/codeblocks/textscreen.cbp b/codeblocks/textscreen.cbp index 96869dca..bee3040a 100644 --- a/codeblocks/textscreen.cbp +++ b/codeblocks/textscreen.cbp @@ -15,7 +15,7 @@ <Option createDefFile="1" /> <Compiler> <Add option="-W" /> - <Add option="-g" /> + <Add option="-gdwarf-2" /> </Compiler> </Target> <Target title="Release"> @@ -116,6 +116,7 @@ <Extensions> <code_completion /> <envvars /> + <debugger /> </Extensions> </Project> </CodeBlocks_project_file> diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 67a22a50..3188ece3 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -510,7 +510,7 @@ void D_DoAdvanceDemo (void) paused = false; gameaction = ga_nothing; - if ( gamemode == retail ) + if (gamemode == retail && gameversion != exe_chex) demosequence = (demosequence+1)%7; else demosequence = (demosequence+1)%6; diff --git a/src/doom/deh_cheat.c b/src/doom/deh_cheat.c index d4ea9113..b953c8a8 100644 --- a/src/doom/deh_cheat.c +++ b/src/doom/deh_cheat.c @@ -121,7 +121,10 @@ static void DEH_CheatParseLine(deh_context_t *context, char *line, void *tag) break; } - cheat->seq->sequence[i] = unsvalue[i]; + if (deh_apply_cheats) + { + cheat->seq->sequence[i] = unsvalue[i]; + } ++i; // Absolute limit - don't exceed @@ -133,7 +136,10 @@ static void DEH_CheatParseLine(deh_context_t *context, char *line, void *tag) } } - cheat->seq->sequence[i] = '\0'; + if (deh_apply_cheats) + { + cheat->seq->sequence[i] = '\0'; + } } deh_section_t deh_section_cheat = diff --git a/src/doom/deh_io.c b/src/doom/deh_io.c index 77cc40a1..3386a6fa 100644 --- a/src/doom/deh_io.c +++ b/src/doom/deh_io.c @@ -142,7 +142,7 @@ char *DEH_ReadLine(deh_context_t *context) int c; int pos; - for (pos=0; ; ++pos) + for (pos = 0;;) { c = DEH_GetChar(context); @@ -153,11 +153,6 @@ char *DEH_ReadLine(deh_context_t *context) return NULL; } - if (c == '\0') - { - return NULL; - } - // cope with lines of any length: increase the buffer size if (pos >= context->readbuffer_size) @@ -172,9 +167,13 @@ char *DEH_ReadLine(deh_context_t *context) context->readbuffer[pos] = '\0'; break; } - else + else if (c != '\0') { + // normal character; don't allow NUL characters to be + // added. + context->readbuffer[pos] = (char) c; + ++pos; } } diff --git a/src/doom/deh_main.c b/src/doom/deh_main.c index 9d528b0a..59e63ea3 100644 --- a/src/doom/deh_main.c +++ b/src/doom/deh_main.c @@ -69,6 +69,10 @@ boolean deh_allow_long_strings = false; boolean deh_allow_long_cheats = false; +// If false, dehacked cheat replacements are ignored. + +boolean deh_apply_cheats = true; + // // List of section types: // @@ -384,6 +388,17 @@ void DEH_Init(void) InitialiseSections(); //! + // @category mod + // + // Ignore cheats in dehacked files. + // + + if (M_CheckParm("-nocheats") > 0) + { + deh_apply_cheats = false; + } + + //! // @arg <files> // @category mod // diff --git a/src/doom/deh_main.h b/src/doom/deh_main.h index 8a0587ff..f9cb44ca 100644 --- a/src/doom/deh_main.h +++ b/src/doom/deh_main.h @@ -48,6 +48,7 @@ void DEH_Checksum(md5_digest_t digest); extern boolean deh_allow_long_strings; extern boolean deh_allow_long_cheats; +extern boolean deh_apply_cheats; #endif /* #ifndef DEH_MAIN_H */ diff --git a/src/i_main.c b/src/i_main.c index ac4a68e3..4efd2cd9 100644 --- a/src/i_main.c +++ b/src/i_main.c @@ -32,6 +32,9 @@ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> +#else +#include <unistd.h> +#include <sched.h> #endif #include "doomtype.h" @@ -53,16 +56,27 @@ int main(int argc, char **argv) myargc = argc; myargv = argv; -#ifdef _WIN32 - // Set the process affinity mask to 1 on Windows, so that all threads + // Set the process affinity mask so that all threads // run on the same processor. This is a workaround for a bug in // SDL_mixer that causes occasional crashes. +#ifdef _WIN32 if (!SetProcessAffinityMask(GetCurrentProcess(), 1)) { fprintf(stderr, "Failed to set process affinity mask (%d)\n", (int) GetLastError()); } +#else + // POSIX version: + + { + cpu_set_t set; + + CPU_ZERO(&set); + CPU_SET(0, &set); + + sched_setaffinity(getpid(), sizeof(set), &set); + } #endif // start doom |