foxygit / doom Log in
commit f06d0080f3381254bb8f5e9cd01fadaa728bf079
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Wed Jan 25 17:38:40 2006 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Wed Jan 25 17:38:40 2006 +0000

    Allow overriding the animation texture/flat names via dehacked

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 344
---
 src/p_spec.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/p_spec.c b/src/p_spec.c
index 6041559c..586d2ec2 100644
--- 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,13 +45,14 @@
 //-----------------------------------------------------------------------------

 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>

 #include "doomdef.h"
 #include "doomstat.h"

+#include "deh_main.h"
 #include "i_system.h"
 #include "z_zone.h"
 #include "m_argv.h"
@@ -170,22 +174,27 @@ void P_InitPicAnims (void)
     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
 	{
 	    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 @@ void P_InitPicAnims (void)

 	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++;