int CG_NewParticleArea(int num) { // const char *str; char *str; char *token; int type; vec3_t origin, origin2; int i; float range = 0; int turb; int numparticles; int snum; str = (char *) CG_ConfigString(num); if (!str[0]) { return 0; } // returns type 128 64 or 32 token = COM_Parse(&str); type = atoi(token); if (type == 1) { range = 128; } else if (type == 2) { range = 64; } else if (type == 3) { range = 32; } else if (type == 0) { range = 256; } else if (type == 4) { range = 8; } else if (type == 5) { range = 16; } else if (type == 6) { range = 32; } else if (type == 7) { range = 64; } for (i = 0; i < 3; i++) { token = COM_Parse(&str); origin[i] = atof(token); } for (i = 0; i < 3; i++) { token = COM_Parse(&str); origin2[i] = atof(token); } token = COM_Parse(&str); numparticles = atoi(token); token = COM_Parse(&str); turb = atoi(token); token = COM_Parse(&str); snum = atoi(token); for (i = 0; i < numparticles; i++) { if (type >= 4) { CG_ParticleBubble(cgs.media.waterBubbleShader, origin, origin2, turb, range, snum); } else { CG_ParticleSnow(cgs.media.snowShader, origin, origin2, turb, range, snum); } } return 1; }
/** * @brief CG_NewParticleArea * @param[in] num * @return * * @note Unused */ int CG_NewParticleArea(int num) { char *str; char *token; int type; vec3_t origin, origin2; int i; float range; int turb; int numparticles; int snum; str = (char *) CG_ConfigString(num); if (!str[0]) { return (0); } // returns type 128 64 or 32 token = COM_Parse(&str); type = atoi(token); switch (type) { case 0: range = 256; break; case 1: range = 128; break; case 2: case 7: range = 64; break; case 3: case 6: range = 32; break; case 4: range = 8; break; case 5: range = 16; break; default: range = 0; break; } for (i = 0; i < 3; i++) { token = COM_Parse(&str); origin[i] = (float)atof(token); } for (i = 0; i < 3; i++) { token = COM_Parse(&str); origin2[i] = (float)atof(token); } token = COM_Parse(&str); numparticles = atoi(token); token = COM_Parse(&str); turb = atoi(token); token = COM_Parse(&str); snum = atoi(token); for (i = 0; i < numparticles; i++) { if (type >= 4) { CG_ParticleBubble(cgs.media.waterBubbleShader, origin, origin2, turb, range, snum); } else { CG_ParticleSnow(cgs.media.snowShader, origin, origin2, turb, range, snum); } } return 1; }