X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=cl_particles.c;h=9361b9c610caa569c25a79cc52b4c78808e5bed5;hb=cc3473e216fce052672ec4600896124584866e52;hp=691e6d96e867841a73b08f967ba2c944439c0f24;hpb=423f8a5d7c929910066f58d2f4f0109e092bf262;p=xonotic%2Fdarkplaces.git diff --git a/cl_particles.c b/cl_particles.c index 691e6d96..9361b9c6 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -629,7 +629,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o count *= cl_particles_quality.value; for (;count > 0;count--) { - int k = particlepalette[palettecolor + (rand()&7)]; + int k = particlepalette[(palettecolor & ~7) + (rand()&7)]; CL_NewParticle(pt_alphastatic, k, k, tex_particle, 1.5, 0, 255, 0, 0.05, 0, lhrandom(originmins[0], originmaxs[0]), lhrandom(originmins[1], originmaxs[1]), lhrandom(originmins[2], originmaxs[2]), lhrandom(velocitymins[0], velocitymaxs[0]), lhrandom(velocitymins[1], velocitymaxs[1]), lhrandom(velocitymins[2], velocitymaxs[2]), 0, 0, 8, 0, true, lhrandom(0.1, 0.5)); } } @@ -656,7 +656,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o } } // bullet hole - if (cl_stainmaps.integer) R_Stain(center, 32, 96, 96, 96, 24, 128, 128, 128, 24); + R_Stain(center, 16, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(center, 6, 3, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); } else if (effectnameindex == EFFECT_TE_SPIKEQUAD) @@ -676,7 +676,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o } } // bullet hole - if (cl_stainmaps.integer) R_Stain(center, 32, 96, 96, 96, 24, 128, 128, 128, 24); + R_Stain(center, 16, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(center, 6, 3, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); CL_AllocLightFlash(NULL, &tempmatrix, 100, 0.15f, 0.15f, 1.5f, 500, 0.2, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE); } @@ -697,7 +697,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o } } // bullet hole - if (cl_stainmaps.integer) R_Stain(center, 32, 96, 96, 96, 24, 128, 128, 128, 24); + R_Stain(center, 16, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(center, 6, 3, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); } else if (effectnameindex == EFFECT_TE_SUPERSPIKEQUAD) @@ -717,7 +717,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o } } // bullet hole - if (cl_stainmaps.integer) R_Stain(center, 32, 96, 96, 96, 24, 128, 128, 128, 24); + R_Stain(center, 16, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(center, 6, 3, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); CL_AllocLightFlash(NULL, &tempmatrix, 100, 0.15f, 0.15f, 1.5f, 500, 0.2, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE); } @@ -730,7 +730,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o else { static double bloodaccumulator = 0; - CL_NewParticle(pt_alphastatic, 0x4f0000,0x7f0000, tex_particle, 2.5, 0, 256, 256, 0, 0, lhrandom(originmins[0], originmaxs[0]), lhrandom(originmins[1], originmaxs[1]), lhrandom(originmins[2], originmaxs[2]), 0, 0, 0, 1, 4, 0, 0, true, 0); + //CL_NewParticle(pt_alphastatic, 0x4f0000,0x7f0000, tex_particle, 2.5, 0, 256, 256, 0, 0, lhrandom(originmins[0], originmaxs[0]), lhrandom(originmins[1], originmaxs[1]), lhrandom(originmins[2], originmaxs[2]), 0, 0, 0, 1, 4, 0, 0, true, 0); bloodaccumulator += count * 0.333 * cl_particles_quality.value; for (;bloodaccumulator > 0;bloodaccumulator--) CL_NewParticle(pt_blood, 0xFFFFFF, 0xFFFFFF, tex_bloodparticle[rand()&7], 8, 0, cl_particles_blood_alpha.value * 768, cl_particles_blood_alpha.value * 384, 0, -1, lhrandom(originmins[0], originmaxs[0]), lhrandom(originmins[1], originmaxs[1]), lhrandom(originmins[2], originmaxs[2]), lhrandom(velocitymins[0], velocitymaxs[0]), lhrandom(velocitymins[1], velocitymaxs[1]), lhrandom(velocitymins[2], velocitymaxs[2]), 1, 4, 0, 64, true, 0); @@ -741,7 +741,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o else if (effectnameindex == EFFECT_TE_PLASMABURN) { // plasma scorch mark - if (cl_stainmaps.integer) R_Stain(center, 48, 96, 96, 96, 32, 128, 128, 128, 32); + R_Stain(center, 40, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(center, 6, 6, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); CL_AllocLightFlash(NULL, &tempmatrix, 200, 1, 1, 1, 1000, 0.2, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE); } @@ -759,7 +759,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o } } // bullet hole - if (cl_stainmaps.integer) R_Stain(center, 32, 96, 96, 96, 24, 128, 128, 128, 24); + R_Stain(center, 16, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(center, 6, 3, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); } else if (effectnameindex == EFFECT_TE_GUNSHOTQUAD) @@ -776,7 +776,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o } } // bullet hole - if (cl_stainmaps.integer) R_Stain(center, 32, 96, 96, 96, 24, 128, 128, 128, 24); + R_Stain(center, 16, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(center, 6, 3, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); CL_AllocLightFlash(NULL, &tempmatrix, 100, 0.15f, 0.15f, 1.5f, 500, 0.2, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE); } @@ -884,8 +884,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o else if (effectnameindex == EFFECT_TE_TEI_PLASMAHIT) { float f; - if (cl_stainmaps.integer) - R_Stain(center, 40, 96, 96, 96, 40, 128, 128, 128, 40); + R_Stain(center, 40, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(center, 6, 8, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); if (cl_particles_smoke.integer) for (f = 0;f < count;f += 4.0f / cl_particles_quality.value) @@ -980,7 +979,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o if (cl_particles_quake.integer) { color = particlepalette[67 + (rand()&3)]; - CL_NewParticle(pt_alphastatic, color, color, tex_particle, 1.5f, 0, 255, 0, 0, -0.05, pos[0], pos[1], pos[2], 0, 0, 0, 0, 0, 3, 0, true, 2); + CL_NewParticle(pt_alphastatic, color, color, tex_particle, 1.5f, 0, 255, 0, 0.05, 0, pos[0], pos[1], pos[2], 0, 0, 0, 0, 0, 3, 0, true, 2); } else { @@ -994,7 +993,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o { dec = 6; color = particlepalette[67 + (rand()&3)]; - CL_NewParticle(pt_alphastatic, color, color, tex_particle, 1.5f, 0, 255, 0, 0, -0.05, pos[0], pos[1], pos[2], 0, 0, 0, 0, 0, 3, 0, true, 2); + CL_NewParticle(pt_alphastatic, color, color, tex_particle, 1.5f, 0, 255, 0, 0.05, 0, pos[0], pos[1], pos[2], 0, 0, 0, 0, 0, 3, 0, true, 2); } else { @@ -1387,8 +1386,7 @@ void CL_ParticleExplosion (const vec3_t org) trace_t trace; //vec3_t v; //vec3_t v2; - if (cl_stainmaps.integer) - R_Stain(org, 96, 80, 80, 80, 64, 176, 176, 176, 64); + R_Stain(org, 96, 40, 40, 40, 64, 88, 88, 88, 64); CL_SpawnDecalParticleForPoint(org, 40, 48, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF); if (cl_particles_quake.integer) @@ -1906,22 +1904,23 @@ static void r_part_shutdown(void) static void r_part_newmap(void) { + CL_Particles_LoadEffectInfo(); } #define BATCHSIZE 256 -int particle_element3i[BATCHSIZE*6]; +unsigned short particle_elements[BATCHSIZE*6]; void R_Particles_Init (void) { int i; for (i = 0;i < BATCHSIZE;i++) { - particle_element3i[i*6+0] = i*4+0; - particle_element3i[i*6+1] = i*4+1; - particle_element3i[i*6+2] = i*4+2; - particle_element3i[i*6+3] = i*4+0; - particle_element3i[i*6+4] = i*4+2; - particle_element3i[i*6+5] = i*4+3; + particle_elements[i*6+0] = i*4+0; + particle_elements[i*6+1] = i*4+1; + particle_elements[i*6+2] = i*4+2; + particle_elements[i*6+3] = i*4+0; + particle_elements[i*6+4] = i*4+2; + particle_elements[i*6+5] = i*4+3; } Cvar_RegisterVariable(&r_drawparticles); @@ -2002,7 +2001,7 @@ void R_DrawDecal_TransparentCallback(const entity_render_t *ent, const rtlight_t GL_BlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR); R_Mesh_TexBind(0, R_GetTexture(particletexture[63].texture)); GL_LockArrays(0, numsurfaces*4); - R_Mesh_Draw(0, numsurfaces * 4, numsurfaces * 2, particle_element3i, 0, 0); + R_Mesh_Draw(0, numsurfaces * 4, 0, numsurfaces * 2, NULL, particle_elements, 0, 0); GL_LockArrays(0, 0); } @@ -2259,7 +2258,7 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh } batchcount = surfacelistindex - batchstart; - R_Mesh_Draw(batchstart * 4, batchcount * 4, batchcount * 2, particle_element3i + batchstart * 6, 0, 0); + R_Mesh_Draw(batchstart * 4, batchcount * 4, batchstart * 2, batchcount * 2, NULL, particle_elements, 0, 0); } GL_LockArrays(0, 0); } @@ -2354,8 +2353,7 @@ void R_DrawParticles (void) // blood - splash on solid if (trace.hitq3surfaceflags & Q3SURFACEFLAG_NOMARKS) goto killparticle; - if (cl_stainmaps.integer) - R_Stain(p->org, 32, 32, 16, 16, (int)(p->alpha * p->size * (1.0f / 40.0f)), 192, 48, 48, (int)(p->alpha * p->size * (1.0f / 40.0f))); + R_Stain(p->org, 16, 64, 16, 16, (int)(p->alpha * p->size * (1.0f / 80.0f)), 64, 32, 32, (int)(p->alpha * p->size * (1.0f / 80.0f))); if (cl_decals.integer) { // create a decal for the blood splat