From f4161c3200caaa6eb29975178e0c24f3a2e07bab Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Sat, 29 Apr 2017 18:11:10 +0300 Subject: [PATCH] tweak wind and add raindrop2 --- .project | 13 +++++++++++-- res/bin/raindrop2.o | Bin 0 -> 1460 bytes res/raindrop2 | Bin 0 -> 1024 bytes res/raindrop2.png | Bin 0 -> 225 bytes src/gui/ncc/Background.cpp | 15 ++++++++++----- src/gui/ncc/Background.hpp | 2 ++ 6 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 res/bin/raindrop2.o create mode 100644 res/raindrop2 create mode 100644 res/raindrop2.png diff --git a/.project b/.project index fa618a13..a32a4bd5 100644 --- a/.project +++ b/.project @@ -26,7 +26,7 @@ - 1489692006412 + 1493478184465 22 @@ -35,7 +35,7 @@ - 1489692006414 + 1493478184467 22 @@ -43,6 +43,15 @@ 1.0-name-matches-false-false-*.o + + 1493478184469 + + 5 + + org.eclipse.ui.ide.multiFilter + 1.0-location-matches-false-false-res/bin + + 1489692029191 src diff --git a/res/bin/raindrop2.o b/res/bin/raindrop2.o new file mode 100644 index 0000000000000000000000000000000000000000..2f51ed25198bf7779452c21b26d6c22bb9e6acb7 GIT binary patch literal 1460 zcmc&!u};G<5WUbcu$8f5>c#{T$}iA~p=+kdRVtBz6gghX!ot@v^hesI;se@yiJ$69 z5sg6zOV-^zzxRBOqI-XQnkGpiT!{?iSczsNCkCIs_jl>(6XAjH zfAam#Y5B8&#~zUP)lrW~eTc>6|E=d6VtNj_m>%K$7-=;I!Os!Y_b2skFZsNzj9ul{ zlvQDuuMc_cjCCFOqAEJjx_n!R+|{cWXXYB6ZR0bu!Z;Il`F(z)$9TiQ)0)}m`v=7L pT?ZWCpURma@ryjfaB8N?n<)lM;D{sLSGswprt+Z&QzU-T?*KTl?{xqG literal 0 HcmV?d00001 diff --git a/res/raindrop2 b/res/raindrop2 new file mode 100644 index 0000000000000000000000000000000000000000..457c2d9c8c200e11986d5ede35889f482de7ec94 GIT binary patch literal 1024 zcmc(dQ3`+{5Cy%am+m5cc7SrKfr7~0A`--Pee-q|OZjdL<21iMtxw>GIzd(+upNYFY4skn~SpOH=O_J=I8eCAS$N9-MeLJgiSjv*GOw+37C9Z=xu4zSOZlc;l+cQW6#TUet+VQHvs zW0Ezy;}icUK`#rN+!+jd^XE0L`c~}qa%SV%UGmSB7d!d{d3fnf-5Ij2y1O#BG|8A@ zgC5(5bxf0MR~(q7W4qY3CorV6md$Lp_BOS(y{Zp$r`|2)i~sLEVgE$$xySSycTL*< UXz8aVK({b>y85}Sb4q9e01@d;^8f$< literal 0 HcmV?d00001 diff --git a/src/gui/ncc/Background.cpp b/src/gui/ncc/Background.cpp index 95d5f166..ebb2dd98 100644 --- a/src/gui/ncc/Background.cpp +++ b/src/gui/ncc/Background.cpp @@ -13,17 +13,18 @@ Background::Background() : CBaseWidget("nc_background"), tx_snowflake(&_binary_snowflake_start, 16, 16), tx_raindrop(&_binary_raindrop_start, 16, 16), tx_flame(&_binary_flame_start, 16, 16), - tx_heart(&_binary_heart_start, 16, 16) { + tx_heart(&_binary_heart_start, 16, 16), + tx_raindrop2(&_binary_raindrop2_start, 16, 16) { SetSize(draw::width, draw::height); } static CatVar particles(CV_SWITCH, "gui_bg_particles", "0", "Particles"); -static CatEnum particle_type_enum({"Snowflake", "Raindrop", "Flame", "Heart", "Random"}); +static CatEnum particle_type_enum({"Snowflake", "Raindrop", "Flame", "Heart", "Raindrop 2", "Random"}); static CatVar particle_type(particle_type_enum, "gui_bg_particles_type", "0", "Particles Type", "Defines particle type"); static CatVar particle_chance(CV_INT, "gui_bg_particles_chance", "10", "Particles Spawn Rate", "Defines snowflake spawn rate (HAS TO BE NONZERO!)", 1.0f, 100.0f); static CatVar particle_pack_size(CV_INT, "gui_bg_particles_pack_size", "10", "Particles Max Pack", "Defines max snowflake spawn pack size (HAS TO BE NONZERO!)", 1.0f, 100.0f); static CatVar particle_safe(CV_INT, "gui_bg_particles_safe_zone", "100", "Particles Safe Zone", "Defines snowflake safe zone (they will decay after reaching that point)", 0.0f, 400.0f); -static CatVar particle_gravity(CV_FLOAT, "gui_bg_particles_gravity", "700", "Particles Gravity", "Defines snowflake gravity (HAS TO BE NONZERO!)", 0.01f, 5.0f); +static CatVar particle_gravity(CV_FLOAT, "gui_bg_particles_gravity", "700", "Particles Gravity", "Defines snowflake gravity (HAS TO BE NONZERO!)", 0.01f, 2400.0f); static CatVar particle_jittering(CV_INT, "gui_bg_particles_jittering", "2", "Particles Jittering", "Defines snowflake jittering amount", 0.0f, 10.0f); static CatVar particle_wind(CV_INT, "gui_bg_particles_wind", "0", "Particles Wind", "Wind strength and direction", -500.0f, 500.0f); static CatVar particle_jittering_chance(CV_INT, "gui_bg_particles_jittering_chance", "60", "Snowflake Jittering Rate", "Defines snowflake jittering rate (HAS TO BE NONZERO!)", 1.0f, 20.0f); @@ -67,6 +68,7 @@ void Background::LoadTextures() { tx_raindrop.Load(); tx_snowflake.Load(); tx_heart.Load(); + tx_raindrop2.Load(); textures_loaded = true; } @@ -96,7 +98,7 @@ void Background::MakeParticle() { flake->dead = false; flake->next = nullptr; flake->show_in = rand() % 4; - switch (((int)particle_type == 4) ? (rand() % 4) : (int)particle_type) { + switch (((int)particle_type == 5) ? (rand() % 5) : (int)particle_type) { case 1: flake->texture = &tx_raindrop; break; @@ -106,6 +108,9 @@ void Background::MakeParticle() { case 3: flake->texture = &tx_heart; break; + case 4: + flake->texture = &tx_raindrop2; + break; default: flake->texture = &tx_snowflake; } @@ -133,7 +138,7 @@ void Background::KillParticle(Particle* flake) { void Background::Particle::Update(float dt) { if (show_in) show_in--; if (particle_wind) { - vx += (float)particle_wind * dt; + vx += (float)particle_wind * dt * 10.0f; } if (!(rand() % (int)(particle_jittering_chance))) { x += (rand() % 2) ? (int)particle_jittering : -(int)particle_jittering; diff --git a/src/gui/ncc/Background.hpp b/src/gui/ncc/Background.hpp index 38f561f5..133c345e 100644 --- a/src/gui/ncc/Background.hpp +++ b/src/gui/ncc/Background.hpp @@ -13,6 +13,7 @@ extern unsigned char _binary_snowflake_start; extern unsigned char _binary_flame_start; extern unsigned char _binary_raindrop_start; +extern unsigned char _binary_raindrop2_start; extern unsigned char _binary_heart_start; namespace menu { namespace ncc { @@ -43,6 +44,7 @@ public: bool textures_loaded { false }; Texture tx_snowflake; Texture tx_raindrop; + Texture tx_raindrop2; Texture tx_flame; Texture tx_heart; std::chrono::time_point last_update;