]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
VorteX: KeyExists function, cast shadows from func_wall by default in prophecy and dq
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Sun, 29 Mar 2009 17:17:08 +0000 (17:17 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Sun, 29 Mar 2009 17:17:08 +0000 (17:17 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@236 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/bspfile_abstract.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/q3map2_fsr_newfiles/q3map2_fsr_svn158.patch

index ef43a2acd83466dd214a1b405dbd4547299daa99..cf059ca00aedc27c2ec12286528f6105ff6702f0 100644 (file)
@@ -744,7 +744,25 @@ void SetKeyValue( entity_t *ent, const char *key, const char *value )
        ep->value = copystring( value );
 }
 
        ep->value = copystring( value );
 }
 
+/*
+KeyExists()
+returns true if entity has this key
+*/
+
+qboolean KeyExists( const entity_t *ent, const char *key )
+{
+       epair_t *ep;
+       
+       /* walk epair list */
+       for( ep = ent->epairs; ep != NULL; ep = ep->next )
+       {
+               if( !EPAIR_STRCMP( ep->key, key ) )
+                       return qtrue;
+       }
 
 
+       /* no match */
+       return qfalse;
+}
 
 /*
 ValueForKey()
 
 /*
 ValueForKey()
@@ -864,7 +882,6 @@ void GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castS
 {
        const char      *value;
        
 {
        const char      *value;
        
-       
        /* get cast shadows */
        if( castShadows != NULL )
        {
        /* get cast shadows */
        if( castShadows != NULL )
        {
@@ -892,5 +909,19 @@ void GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castS
                if( value[ 0 ] != '\0' )
                        *recvShadows = atoi( value );
        }
                if( value[ 0 ] != '\0' )
                        *recvShadows = atoi( value );
        }
+
+       /* vortex: game-specific default eneity keys */
+       value = ValueForKey( ent, "classname" );
+       if (!Q_stricmp( game->magic, "dq" ) || !Q_stricmp( game->magic, "prophecy" ) )
+       {
+               /* vortex: deluxe quake default shadow flags */
+               if (!Q_stricmp( value, "func_wall" ) )
+               {
+                       if( recvShadows != NULL )
+                               *recvShadows = 1;
+                       if( castShadows != NULL )
+                               *castShadows = 1;
+               }
+       }
 }
 
 }
 
index f0cf4899d0ee181bff99b0b934d63f1c94e2bf5a..ddc5b0a96eefd89021590c29ebeb2b302b25a5ef 100644 (file)
@@ -1802,6 +1802,7 @@ void                                              ParseEntities( void );
 void                                           UnparseEntities( void );
 void                                           PrintEntity( const entity_t *ent );
 void                                           SetKeyValue( entity_t *ent, const char *key, const char *value );
 void                                           UnparseEntities( void );
 void                                           PrintEntity( const entity_t *ent );
 void                                           SetKeyValue( entity_t *ent, const char *key, const char *value );
+qboolean                                       KeyExists( const entity_t *ent, const char *key ); /* VorteX: check if key exists */
 const char                                     *ValueForKey( const entity_t *ent, const char *key );
 int                                                    IntForKey( const entity_t *ent, const char *key );
 vec_t                                          FloatForKey( const entity_t *ent, const char *key );
 const char                                     *ValueForKey( const entity_t *ent, const char *key );
 int                                                    IntForKey( const entity_t *ent, const char *key );
 vec_t                                          FloatForKey( const entity_t *ent, const char *key );
index 4e5dcf3b0bbafdcc27590f761e43baf4b9b416ca..bcf9d93bde0ac56d22b49b563416ba3de68dc9cf 100644 (file)
@@ -1,62 +1,3 @@
-Index: bspfile_abstract.c\r
-===================================================================\r
---- bspfile_abstract.c (revision 158)\r
-+++ bspfile_abstract.c (working copy)\r
-@@ -683,8 +683,26 @@\r
-       ep->value = copystring( value );
- }
-+/*
-+KeyExists()
-+returns true if entity has this key
-+*/
-+qboolean KeyExists( const entity_t *ent, const char *key )
-+{
-+      epair_t *ep;
-+      
-+      /* walk epair list */
-+      for( ep = ent->epairs; ep != NULL; ep = ep->next )
-+      {
-+              if( !EPAIR_STRCMP( ep->key, key ) )
-+                      return qtrue;
-+      }
-+      /* no match */
-+      return qfalse;
-+}
-+
- /*
- ValueForKey()
- gets the value for an entity key
-@@ -803,7 +821,6 @@\r
- {
-       const char      *value;
-       
--      
-       /* get cast shadows */
-       if( castShadows != NULL )
-       {
-@@ -831,5 +848,19 @@\r
-               if( value[ 0 ] != '\0' )
-                       *recvShadows = atoi( value );
-       }
-+
-+      /* vortex: game-specific default eneity keys */
-+      value = ValueForKey( ent, "classname" );
-+      if (!Q_stricmp( game->magic, "dq" ) || !Q_stricmp( game->magic, "prophecy" ) )
-+      {
-+              /* vortex: deluxe quake default shadow flags */
-+              if (!Q_stricmp( value, "func_wall" ) )
-+              {
-+                      if( recvShadows != NULL )
-+                              *recvShadows = 1;
-+                      if( castShadows != NULL )
-+                              *castShadows = 1;
-+              }
-+      }
- }
 Index: game_ef.h\r
 ===================================================================\r
 --- game_ef.h  (revision 158)\r
 Index: game_ef.h\r
 ===================================================================\r
 --- game_ef.h  (revision 158)\r
@@ -2869,14 +2810,6 @@ Index: q3map2.h
  /* image.c */
  void                                          ImageFree( image_t *image );
  image_t                                               *ImageFind( const char *filename );
  /* image.c */
  void                                          ImageFree( image_t *image );
  image_t                                               *ImageFind( const char *filename );
-@@ -1783,6 +1816,7 @@\r
- void                                          UnparseEntities( void );
- void                                          PrintEntity( const entity_t *ent );
- void                                          SetKeyValue( entity_t *ent, const char *key, const char *value );
-+qboolean                                      KeyExists( const entity_t *ent, const char *key ); /* VorteX: check if key exists */
- const char                                    *ValueForKey( const entity_t *ent, const char *key );
- int                                                   IntForKey( const entity_t *ent, const char *key );
- vec_t                                         FloatForKey( const entity_t *ent, const char *key );
 @@ -1845,6 +1879,12 @@\r
                                                                ,
                                                                #include "game_qfusion.h"       /* qfusion game */
 @@ -1845,6 +1879,12 @@\r
                                                                ,
                                                                #include "game_qfusion.h"       /* qfusion game */