shithub: choc

Download patch

ref: f06d0080f3381254bb8f5e9cd01fadaa728bf079
parent: c3319d6d6ec40465f2ec1427adcac8096116b11a
author: Simon Howard <[email protected]>
date: Wed Jan 25 12:38:40 EST 2006

Allow overriding the animation texture/flat names via dehacked

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 344

--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: p_spec.c 19 2005-07-23 19:17:11Z fraggle $
+// $Id: p_spec.c 344 2006-01-25 17:38:40Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.4  2006/01/25 17:38:40  fraggle
+// Allow overriding the animation texture/flat names via dehacked
+//
 // Revision 1.3  2005/07/23 19:17:11  fraggle
 // Use ANSI-standard limit constants.  Remove LINUX define.
 //
@@ -42,7 +45,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: p_spec.c 19 2005-07-23 19:17:11Z fraggle $";
+rcsid[] = "$Id: p_spec.c 344 2006-01-25 17:38:40Z fraggle $";
 
 #include <stdlib.h>
 
@@ -49,6 +52,7 @@
 #include "doomdef.h"
 #include "doomstat.h"
 
+#include "deh_main.h"
 #include "i_system.h"
 #include "z_zone.h"
 #include "m_argv.h"
@@ -170,14 +174,19 @@
     lastanim = anims;
     for (i=0 ; animdefs[i].istexture != -1 ; i++)
     {
+        char *startname, *endname;
+
+        startname = DEH_String(animdefs[i].startname);
+        endname = DEH_String(animdefs[i].endname);
+
 	if (animdefs[i].istexture)
 	{
 	    // different episode ?
-	    if (R_CheckTextureNumForName(animdefs[i].startname) == -1)
+	    if (R_CheckTextureNumForName(startname) == -1)
 		continue;	
 
-	    lastanim->picnum = R_TextureNumForName (animdefs[i].endname);
-	    lastanim->basepic = R_TextureNumForName (animdefs[i].startname);
+	    lastanim->picnum = R_TextureNumForName(endname);
+	    lastanim->basepic = R_TextureNumForName(startname);
 	}
 	else
 	{
@@ -184,8 +193,8 @@
 	    if (W_CheckNumForName(animdefs[i].startname) == -1)
 		continue;
 
-	    lastanim->picnum = R_FlatNumForName (animdefs[i].endname);
-	    lastanim->basepic = R_FlatNumForName (animdefs[i].startname);
+	    lastanim->picnum = R_FlatNumForName(endname);
+	    lastanim->basepic = R_FlatNumForName(startname);
 	}
 
 	lastanim->istexture = animdefs[i].istexture;
@@ -193,8 +202,7 @@
 
 	if (lastanim->numpics < 2)
 	    I_Error ("P_InitPicAnims: bad cycle from %s to %s",
-		     animdefs[i].startname,
-		     animdefs[i].endname);
+		     startname, endname);
 	
 	lastanim->speed = animdefs[i].speed;
 	lastanim++;