foxygit / doom Log in
commit 72680b42095864ec2d4affa55e0831e4d8712b6d
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun May 4 17:09:51 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun May 4 17:09:51 2008 +0000

    Add command line option to disable mmapped WAD I/O.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1139
---
 src/w_file.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/w_file.c b/src/w_file.c
index 75c2eae4..bd1a99bd 100644
--- a/src/w_file.c
+++ b/src/w_file.c
@@ -28,6 +28,7 @@

 #include "doomdef.h"
 #include "doomtype.h"
+#include "m_argv.h"

 #include "w_file.h"

@@ -57,6 +58,16 @@ wad_file_t *W_OpenFile(char *path)
     wad_file_t *result;
     int i;

+    //!
+    // Do not use the OS's virtual memory subsystem to map WAD files
+    // directly into memory.
+    //
+
+    if (M_CheckParm("-nommap") > 0)
+    {
+        return stdc_wad_file.OpenFile(path);
+    }
+
     // Try all classes in order until we find one that works

     result = NULL;