Start on patch
authorDan Olson <theoddone33@icculus.org>
Wed, 27 Aug 2008 09:25:10 +0000 (02:25 -0700)
committerDan Olson <theoddone33@icculus.org>
Wed, 27 Aug 2008 09:25:10 +0000 (02:25 -0700)
pyhexen/patch.py [new file with mode: 0644]
pyhexen/wad.py

diff --git a/pyhexen/patch.py b/pyhexen/patch.py
new file mode 100644 (file)
index 0000000..70a4230
--- /dev/null
@@ -0,0 +1,6 @@
+
+from struct import *
+
+class PatchDesc:
+       patch_t = '<hhhh8i'
+       patch_t_size = calcsize (patch_t)
index 5eb1cba..8083324 100644 (file)
@@ -6,7 +6,7 @@ from struct import *
 class WadException(Exception):
        pass
 
-class WadBase:
+class WadDesc:
        wadinfo_t = '<4sii'
        wadinfo_size = calcsize (wadinfo_t)
        filelump_t = '<ii8s'
@@ -28,7 +28,7 @@ class WadReader:
                lumpinfo = []
                if ext.lower() == '.wad':
                        # yay, a wad file.
-                       (id, numLumps, infoTable) = unpack (WadBase.wadinfo_t, fileHandle.read(WadBase.wadinfo_size))
+                       (id, numLumps, infoTable) = unpack (WadDesc.wadinfo_t, fileHandle.read(WadDesc.wadinfo_size))
 
                        if id != 'IWAD' and id != 'PWAD':
                                raise WadException("Wad file %s doesn't have IWAD or PWAD id" % filename)
@@ -36,7 +36,7 @@ class WadReader:
                        fileHandle.seek (infoTable)
 
                        for i in range (0, numLumps):
-                               lumpinfo.append (unpack (WadBase.filelump_t, fileHandle.read(WadBase.filelump_size)))
+                               lumpinfo.append (unpack (WadDesc.filelump_t, fileHandle.read(WadDesc.filelump_size)))
                else:
                        # single file, boring.
                        size = os.stat (filename).st_size