summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2005-10-08 21:02:55 +0000
committerSimon Howard2005-10-08 21:02:55 +0000
commitf9d08985de6d73e56f7acd86aa37628b66b7265a (patch)
tree39756ab03de087caf477b69ad2cb6c6c9346041a
parent50bdeb95160fb3a6408b1af53fcf39c9d8695d51 (diff)
downloadchocolate-doom-f9d08985de6d73e56f7acd86aa37628b66b7265a.tar.gz
chocolate-doom-f9d08985de6d73e56f7acd86aa37628b66b7265a.tar.bz2
chocolate-doom-f9d08985de6d73e56f7acd86aa37628b66b7265a.zip
Allow dehacked substitutions on sprite names
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 177
-rw-r--r--src/r_things.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/r_things.c b/src/r_things.c
index 86dabd6c..4e4b051a 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: r_things.c 45 2005-08-06 18:37:47Z fraggle $
+// $Id: r_things.c 177 2005-10-08 21:02:55Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.6 2005/10/08 21:02:55 fraggle
+// Allow dehacked substitutions on sprite names
+//
// Revision 1.5 2005/08/06 18:37:47 fraggle
// Fix low resolution mode
//
@@ -45,13 +48,14 @@
static const char
-rcsid[] = "$Id: r_things.c 45 2005-08-06 18:37:47Z fraggle $";
+rcsid[] = "$Id: r_things.c 177 2005-10-08 21:02:55Z fraggle $";
#include <stdio.h>
#include <stdlib.h>
+#include "deh_main.h"
#include "doomdef.h"
#include "m_swap.h"
@@ -201,7 +205,6 @@ void R_InitSpriteDefs (char** namelist)
char** check;
int i;
int l;
- int intname;
int frame;
int rotation;
int start;
@@ -228,17 +231,16 @@ void R_InitSpriteDefs (char** namelist)
// Just compare 4 characters as ints
for (i=0 ; i<numsprites ; i++)
{
- spritename = namelist[i];
+ spritename = DEH_String(namelist[i]);
memset (sprtemp,-1, sizeof(sprtemp));
maxframe = -1;
- intname = *(int *)namelist[i];
// scan the lumps,
// filling in the frames for whatever is found
for (l=start+1 ; l<end ; l++)
{
- if (*(int *)lumpinfo[l].name == intname)
+ if (!strncasecmp(lumpinfo[l].name, spritename, 4))
{
frame = lumpinfo[l].name[4] - 'A';
rotation = lumpinfo[l].name[5] - '0';
@@ -275,7 +277,7 @@ void R_InitSpriteDefs (char** namelist)
case -1:
// no rotations were found for that frame at all
I_Error ("R_InitSprites: No patches found "
- "for %s frame %c", namelist[i], frame+'A');
+ "for %s frame %c", spritename, frame+'A');
break;
case 0:
@@ -288,7 +290,7 @@ void R_InitSpriteDefs (char** namelist)
if (sprtemp[frame].lump[rotation] == -1)
I_Error ("R_InitSprites: Sprite %s frame %c "
"is missing rotations",
- namelist[i], frame+'A');
+ spritename, frame+'A');
break;
}
}