summaryrefslogtreecommitdiff
path: root/src/deh_ptr.c
diff options
context:
space:
mode:
authorSimon Howard2006-10-05 22:12:22 +0000
committerSimon Howard2006-10-05 22:12:22 +0000
commitd2b34da108fae24c9c70ab00aa261cc9648018c3 (patch)
tree3ca5729fedc3f44462051fed4e4c7580a799ed2a /src/deh_ptr.c
parent09180d3f73e522c1e0c43993aec28cf339dcf74d (diff)
downloadchocolate-doom-d2b34da108fae24c9c70ab00aa261cc9648018c3.tar.gz
chocolate-doom-d2b34da108fae24c9c70ab00aa261cc9648018c3.tar.bz2
chocolate-doom-d2b34da108fae24c9c70ab00aa261cc9648018c3.zip
Dehacked information checksum generation
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 687
Diffstat (limited to 'src/deh_ptr.c')
-rw-r--r--src/deh_ptr.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/deh_ptr.c b/src/deh_ptr.c
index bb0757b9..4ee75657 100644
--- a/src/deh_ptr.c
+++ b/src/deh_ptr.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: deh_ptr.c 175 2005-10-08 20:54:16Z fraggle $
+// $Id: deh_ptr.c 687 2006-10-05 22:12:22Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -54,6 +54,21 @@
static actionf_t codeptrs[NUMSTATES];
+static int CodePointerIndex(actionf_t *ptr)
+{
+ int i;
+
+ for (i=0; i<NUMSTATES; ++i)
+ {
+ if (!memcmp(&codeptrs[i], ptr, sizeof(actionf_t)))
+ {
+ return i;
+ }
+ }
+
+ return -1;
+}
+
static void DEH_PointerInit(void)
{
int i;
@@ -131,6 +146,16 @@ static void DEH_PointerParseLine(deh_context_t *context, char *line, void *tag)
}
}
+static void DEH_PointerMD5Sum(md5_context_t *context)
+{
+ int i;
+
+ for (i=0; i<NUMSTATES; ++i)
+ {
+ MD5_UpdateInt32(context, CodePointerIndex(&states[i].action));
+ }
+}
+
deh_section_t deh_section_pointer =
{
"Pointer",
@@ -138,5 +163,6 @@ deh_section_t deh_section_pointer =
DEH_PointerStart,
DEH_PointerParseLine,
NULL,
+ DEH_PointerMD5Sum,
};