Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ShadowCBparticles(EntityData1 *a1, CharObj2 *a2)
- {
- if (GameState != 21 && is_shadow)
- {
- if (CB_lv2 || CB_lv3)
- {
- //Actual Sparkles
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_DESTALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- //Big ones
- ParticleDepthOverride = 0.0f;
- EntityData1 *co1 = EntityData1Ptrs[0];
- for (auto it = sparklesgems.begin(); it != sparklesgems.end(); )
- {
- NJS_VECTOR pos = { 0, it->radius, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, it->rotation.x);
- njRotateY(nullptr, it->rotation.y);
- njRotateZ(nullptr, it->rotation.z);
- njCalcVector(nullptr, &pos, &sparklegemssprite.p);
- njPopMatrix(1);
- sparklegemssprite.p.x += it->pos.x;
- sparklegemssprite.p.y += it->pos.y;
- sparklegemssprite.p.z += it->pos.z;
- if (it->framegems < 11)
- {
- SetMaterialAndSpriteColor_Float((11 - it->framegems) / 11.0f, 1, 1, 1);
- sparklegemssprite.sx = ((22 - it->framegems) / 22.0f) * 0.6f * 1.3f * HorizontalResolution / 1680.0f;
- sparklegemssprite.sy = ((22 - it->framegems) / 22.0f) * 0.6f * 1.3f * VerticalResolution / 1050.0f;
- if (Gauge > 0 && a2->AnimationThing.Index != 87) njDrawSprite3D_Queue(&sparklegemssprite, 2, NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- }
- it->framegems++;
- if (it->framegems >= 11)
- it = sparklesgems.erase(it);
- else
- {
- it->radius += 0.15f;
- ++it;
- }
- }
- if (++sparklegemstimer == 8)
- {
- sparklegemsdata sp = {};
- //sp.radius = ((float)rand() / RAND_MAX) * 8.0;//if I wanted them to spawn in the center
- sp.radius = (((float)rand() / RAND_MAX) * 3.0) + 4.0;//sp.radius = (((float)rand() / RAND_MAX) * max_radius) + min_radius; //if min_radius is 2, and max_radius is 3, then the sparkles will spawn between 2 and 5 (2+3) away
- sp.rotation.x = rand() & 0xFFFF;
- sp.rotation.y = rand() & 0xFFFF;
- sp.rotation.z = rand() & 0xFFFF;
- sp.pos = co1->CollisionInfo->CollisionArray->origin;
- sparklesgems.push_back(sp);
- sparklegemstimer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- //Small ones
- ParticleDepthOverride = 0.0f;
- for (auto it = sparklesgems_tiny.begin(); it != sparklesgems_tiny.end(); )
- {
- NJS_VECTOR pos = { 0, it->radius, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, it->rotation.x);
- njRotateY(nullptr, it->rotation.y);
- njRotateZ(nullptr, it->rotation.z);
- njCalcVector(nullptr, &pos, &sparklegemssprite.p);
- njPopMatrix(1);
- sparklegemssprite.p.x += it->pos.x;
- sparklegemssprite.p.y += it->pos.y;
- sparklegemssprite.p.z += it->pos.z;
- if (it->framegems_tiny < 11)
- {
- SetMaterialAndSpriteColor_Float((11 - it->framegems_tiny) / 11.0f, 1, 1, 1);
- sparklegemssprite.sx = ((22 - it->framegems_tiny) / 22.0f) * 0.0375f * 3.0f * 1.3f * HorizontalResolution / 1680.0f;
- sparklegemssprite.sy = ((22 - it->framegems_tiny) / 22.0f) * 0.0375f * 3.0f * 1.3f * VerticalResolution / 1050.0f;
- if (Gauge > 0 && a2->AnimationThing.Index != 87) njDrawSprite3D_Queue(&sparklegemssprite, 6, NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- }
- it->framegems_tiny++;
- if (it->framegems_tiny >= 15)
- it = sparklesgems_tiny.erase(it);
- else
- {
- it->radius += 0.075f;
- ++it;
- }
- }
- if (++sparklegems_tiny_timer == 3)
- {
- sparklegemsdata sp = {};
- sp.radius = (((float)rand() / RAND_MAX) * 2.0) + 2.5;
- sp.rotation.x = rand() & 0xFFFF;
- sp.rotation.y = rand() & 0xFFFF;
- sp.rotation.z = rand() & 0xFFFF;
- sp.pos = co1->CollisionInfo->CollisionArray->origin;
- sparklesgems_tiny.push_back(sp);
- sparklegems_tiny_timer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement