fix crosshair 6, and allow custom crosshairs up to 32
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 14 Mar 2006 04:39:14 +0000 (04:39 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 14 Mar 2006 04:39:14 +0000 (04:39 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6112 d7cf8633-e32d-0410-b094-e92efae38249

client.h
gl_draw.c
r_shadow.c

index cb36d4d..5268128 100644 (file)
--- a/client.h
+++ b/client.h
@@ -1015,8 +1015,8 @@ void R_NewExplosion(vec3_t org);
 
 #include "cl_screen.h"
 
 
 #include "cl_screen.h"
 
-#define NUMCROSSHAIRS 6
-extern cachepic_t *r_crosshairs[NUMCROSSHAIRS];
+#define NUMCROSSHAIRS 32
+extern cachepic_t *r_crosshairs[NUMCROSSHAIRS+1];
 
 typedef struct refdef_s
 {
 
 typedef struct refdef_s
 {
index f618099..79d5adc 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 
 static rtexture_t *char_texture;
 
 
 static rtexture_t *char_texture;
-cachepic_t *r_crosshairs[NUMCROSSHAIRS];
+cachepic_t *r_crosshairs[NUMCROSSHAIRS+1];
 
 //=============================================================================
 /* Support Routines */
 
 //=============================================================================
 /* Support Routines */
@@ -468,7 +468,7 @@ static void gl_draw_start(void)
        memset(cachepichash, 0, sizeof(cachepichash));
 
        char_texture = Draw_CachePic("gfx/conchars", true)->tex;
        memset(cachepichash, 0, sizeof(cachepichash));
 
        char_texture = Draw_CachePic("gfx/conchars", true)->tex;
-       for (i = 0;i < NUMCROSSHAIRS;i++)
+       for (i = 1;i <= NUMCROSSHAIRS;i++)
                r_crosshairs[i] = Draw_CachePic(va("gfx/crosshair%i", i), false);
 }
 
                r_crosshairs[i] = Draw_CachePic(va("gfx/crosshair%i", i), false);
 }
 
index 2f4a68e..af19c93 100644 (file)
@@ -3306,7 +3306,7 @@ void R_Shadow_DrawLightSprites(void)
        dlight_t *light;
 
        for (i = 0, light = r_shadow_worldlightchain;light;i++, light = light->next)
        dlight_t *light;
 
        for (i = 0, light = r_shadow_worldlightchain;light;i++, light = light->next)
-               R_MeshQueue_AddTransparent(light->origin, R_Shadow_DrawLightSprite_TransparentCallback, (entity_render_t *)light, i % NUMCROSSHAIRS, &light->rtlight);
+               R_MeshQueue_AddTransparent(light->origin, R_Shadow_DrawLightSprite_TransparentCallback, (entity_render_t *)light, 1+(i % 5), &light->rtlight);
        R_MeshQueue_AddTransparent(r_editlights_cursorlocation, R_Shadow_DrawCursor_TransparentCallback, NULL, 0, NULL);
 }
 
        R_MeshQueue_AddTransparent(r_editlights_cursorlocation, R_Shadow_DrawCursor_TransparentCallback, NULL, 0, NULL);
 }