summaryrefslogtreecommitdiff
path: root/src/doom/r_data.c
diff options
context:
space:
mode:
authorSimon Howard2011-02-12 18:42:10 +0000
committerSimon Howard2011-02-12 18:42:10 +0000
commit516a7028994df6718289a7e3db4d07a45c95466b (patch)
treecf974cb4bd38b8e9d0101a41263b42b8c87e96c7 /src/doom/r_data.c
parenta15ba75736d15409876c1f0a44fffc99adf1c192 (diff)
parenta9996b41e954d85fde5ec5188bbf6a7f4df88011 (diff)
downloadchocolate-doom-516a7028994df6718289a7e3db4d07a45c95466b.tar.gz
chocolate-doom-516a7028994df6718289a7e3db4d07a45c95466b.tar.bz2
chocolate-doom-516a7028994df6718289a7e3db4d07a45c95466b.zip
Merge from raven-branch. FEATURE_MULTIPLAYER has been disabled
temporarily until the netgame changes on raven-branch are finished. Subversion-branch: /branches/strife-branch Subversion-revision: 2259
Diffstat (limited to 'src/doom/r_data.c')
-rw-r--r--src/doom/r_data.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/doom/r_data.c b/src/doom/r_data.c
index b999e916..505f1ff7 100644
--- a/src/doom/r_data.c
+++ b/src/doom/r_data.c
@@ -413,6 +413,7 @@ R_GetColumn
static void GenerateTextureHashTable(void)
{
+ texture_t **rover;
int i;
int key;
@@ -429,12 +430,25 @@ static void GenerateTextureHashTable(void)
textures[i]->index = i;
- // Hook into hash table
+ // Vanilla Doom does a linear search of the texures array
+ // and stops at the first entry it finds. If there are two
+ // entries with the same name, the first one in the array
+ // wins. The new entry must therefore be added at the end
+ // of the hash chain, so that earlier entries win.
key = W_LumpNameHash(textures[i]->name) % numtextures;
- textures[i]->next = textures_hashtable[key];
- textures_hashtable[key] = textures[i];
+ rover = &textures_hashtable[key];
+
+ while (*rover != NULL)
+ {
+ rover = &(*rover)->next;
+ }
+
+ // Hook into hash table
+
+ textures[i]->next = NULL;
+ *rover = textures[i];
}
}