Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (inputString[2] == 'k')
- {
- if (inputString.substr(6, 16) == "finishColorAlpha")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- fcolor[3] = temp;
- }
- }
- else if (inputString.substr(6, 15) == "finishColorBlue")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- fcolor[2] = temp;
- }
- }
- else if (inputString.substr(6, 16) == "finishColorGreen")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- fcolor[1] = temp;
- }
- }
- else if (inputString.substr(6, 14) == "finishColorRed")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- fcolor[0] = temp;
- }
- }
- else if (inputString.substr(6, 24) == "finishColorVarianceAlpha")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- fcolor[3] = Math::lerp(fcolor[3] - temp, fcolor[3] + temp, glm::linearRand(0.f, 1.f));
- }
- }
- else if (inputString.substr(6, 23) == "finishColorVarianceBlue")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- fcolor[2] = Math::lerp(fcolor[2] - temp, fcolor[2] + temp, glm::linearRand(0.f, 1.f));
- }
- }
- else if (inputString.substr(6, 24) == "finishColorVarianceGreen")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- fcolor[1] = Math::lerp(fcolor[1] - temp, fcolor[1] + temp, glm::linearRand(0.f, 1.f));
- }
- }
- else if (inputString.substr(6, 22) == "finishColorVarianceRed")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- fcolor[0] = Math::lerp(fcolor[0] - temp, fcolor[0] + temp, glm::linearRand(0.f, 1.f));
- }
- }
- else if (inputString.substr(6, 12) == "maxParticles")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- initialize(temp);
- }
- }
- else if (inputString.substr(6, 19) == "minParticleLifespan")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- lifeRange.x = temp;
- }
- }
- else if (inputString.substr(6, 19) == "maxParticleLifespan")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- lifeRange.y = temp;
- }
- }
- else if (inputString.substr(6, 15) == "startColorAlpha")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- scolor[3] = temp;
- }
- }
- else if (inputString.substr(6, 14) == "startColorBlue")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- scolor[2] = temp;
- }
- }
- else if (inputString.substr(6, 15) == "startColorGreen")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- scolor[1] = temp;
- }
- }
- else if (inputString.substr(6, 13) == "startColorRed")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- scolor[0] = temp;
- }
- }
- else if (inputString.substr(6, 23) == "startColorVarianceAlpha")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- scolor[3] = Math::lerp(scolor[3] - temp, scolor[3] + temp, glm::linearRand(0.f, 1.f));
- }
- }
- else if (inputString.substr(6, 22) == "startColorVarianceBlue")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- scolor[2] = Math::lerp(scolor[2] - temp, scolor[2] + temp, glm::linearRand(0.f, 1.f));
- }
- }
- else if (inputString.substr(6, 23) == "startColorVarianceGreen")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- scolor[1] = Math::lerp(scolor[1] - temp, scolor[1] + temp, glm::linearRand(0.f, 1.f));
- }
- }
- else if (inputString.substr(6, 21) == "startColorVarianceRed")
- {
- if (input2[2] == 'r')
- {
- float temp;
- temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- scolor[0] = Math::lerp(scolor[0] - temp, scolor[0] + temp, glm::linearRand(0.f, 1.f));
- }
- }
- /*else if (inputString.substr(6, 8) == "gravityx")
- {
- if (input2[2] == 'r')
- {
- gravitation.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }*/
- else if (inputString.substr(6, 8) == "gravityy")
- {
- if (input2[2] == 'r')
- {
- gravitation.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 15) == "sourcePositionx")
- {
- if (input2[2] == 'r')
- {
- emitterPosition.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 15) == "sourcePositiony")
- {
- if (input2[2] == 'r')
- {
- emitterPosition.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 15) == "offsetPositionx")
- {
- if (input2[2] == 'r')
- {
- offsetPosition.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 15) == "offsetPositiony")
- {
- if (input2[2] == 'r')
- {
- offsetPosition.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 6) == "offset<")
- {
- if (input2[2] == 'r')
- {
- offset = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 7) == "gravity<")
- {
- if (input2[2] == 'r')
- {
- gravity = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 10) == "velocity0x")
- {
- if (input2[2] == 'r')
- {
- velocity0.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 10) == "velocity0y")
- {
- if (input2[2] == 'r')
- {
- velocity0.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 10) == "velocity1x")
- {
- if (input2[2] == 'r')
- {
- velocity1.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 10) == "velocity1y")
- {
- if (input2[2] == 'r')
- {
- velocity1.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 7) == "boxMode")
- {
- if (input2[2] == 'r')
- {
- boxMode = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 8) == "minWidth")
- {
- if (input2[2] == 'r')
- {
- minWidth = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 8) == "maxWidth")
- {
- if (input2[2] == 'r')
- {
- maxWidth = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 9) == "minHeight")
- {
- if (input2[2] == 'r')
- {
- minHeight = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 9) == "maxHeight")
- {
- if (input2[2] == 'r')
- {
- maxHeight = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 17) == "applySeekingForce")
- {
- if (input2[2] == 'r')
- {
- applySeekingForce = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 17) == "seekingForceScale")
- {
- if (input2[2] == 'r')
- {
- seekingForceScale = std::stof(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 18) == "removeSeekingForce")
- {
- if (input2[2] == 'r')
- {
- removeSeekingForce = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 13) == "magnetAttract")
- {
- if (input2[2] == 'r')
- {
- magnetAttract = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 11) == "magnetRepel")
- {
- if (input2[2] == 'r')
- {
- magnetRepel = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 7) == "usePath")
- {
- if (input2[2] == 'r')
- {
- usePath = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- /*else if (inputString.substr(6, 16) == "applyRandomForce")
- {
- if (input2[2] == 'r')
- {
- applyRandomForce = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }*/
- else if (inputString.substr(6, 16) == "emissionRate")
- {
- if (input2[2] == 'r')
- {
- emissionRate = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- else if (inputString.substr(6, 7) == "playing")
- {
- if (input2[2] == 'r')
- {
- playing = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
- }
- }
- /*else if (inputString.substr(6, 12) == "pointHandles")
- {
- if (input2[2] == 'r')
- {
- int offset = 7;
- int offset2;
- float x, y;
- while (offset < input2.size() - 9)
- {
- sscanf(input2.substr(offset).c_str(), " %f %f%n", &x, &y, &offset2);
- offset += offset2;
- }
- }
- }*/
- /*else if (inputString.substr(6, 13) == "seekingTarget")
- {
- if (input2[2] == 'r')
- {
- sscanf(input2.substr(7).c_str(), "%f %f", &seekingTarget.x, &seekingTarget.y);
- }
- }*/
- /*else if (inputString.substr(6, 13) == "fleeingTarget")
- {
- if (input2[2] == 'r')
- {
- sscanf(input2.substr(7).c_str(), "%f %f", &fleeingTarget.x, &fleeingTarget.y);
- }
- }*/
- else
- {
- //std::cout << "Failed reading after k" << std::endl;
- }
- }
- else
- {
- std::cout << "Failed k." << std::endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement