Advertisement
Guest User

Untitled

a guest
Apr 7th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     if (inputString[2] == 'k')
  2.         {
  3.             if (inputString.substr(6, 16) == "finishColorAlpha")
  4.             {
  5.                
  6.                 if (input2[2] == 'r')
  7.                 {
  8.                     float temp;
  9.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  10.                     fcolor[3] = temp;
  11.                 }
  12.             }
  13.             else if (inputString.substr(6, 15) == "finishColorBlue")
  14.             {
  15.                 if (input2[2] == 'r')
  16.                 {
  17.                     float temp;
  18.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  19.                     fcolor[2] = temp;
  20.                 }
  21.             }
  22.             else if (inputString.substr(6, 16) == "finishColorGreen")
  23.             {
  24.                 if (input2[2] == 'r')
  25.                 {
  26.                     float temp;
  27.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  28.                     fcolor[1] = temp;
  29.                 }
  30.             }
  31.             else if (inputString.substr(6, 14) == "finishColorRed")
  32.             {
  33.                 if (input2[2] == 'r')
  34.                 {
  35.                     float temp;
  36.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  37.                     fcolor[0] = temp;
  38.                 }
  39.             }
  40.             else if (inputString.substr(6, 24) == "finishColorVarianceAlpha")
  41.             {
  42.                 if (input2[2] == 'r')
  43.                 {
  44.                     float temp;
  45.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  46.                     fcolor[3] = Math::lerp(fcolor[3] - temp, fcolor[3] + temp, glm::linearRand(0.f, 1.f));
  47.                 }
  48.             }
  49.             else if (inputString.substr(6, 23) == "finishColorVarianceBlue")
  50.             {
  51.                 if (input2[2] == 'r')
  52.                 {
  53.                     float temp;
  54.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  55.                     fcolor[2] = Math::lerp(fcolor[2] - temp, fcolor[2] + temp, glm::linearRand(0.f, 1.f));
  56.                 }
  57.             }
  58.             else if (inputString.substr(6, 24) == "finishColorVarianceGreen")
  59.             {
  60.                 if (input2[2] == 'r')
  61.                 {
  62.                     float temp;
  63.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  64.                     fcolor[1] = Math::lerp(fcolor[1] - temp, fcolor[1] + temp, glm::linearRand(0.f, 1.f));
  65.                 }
  66.             }
  67.             else if (inputString.substr(6, 22) == "finishColorVarianceRed")
  68.             {
  69.                 if (input2[2] == 'r')
  70.                 {
  71.                     float temp;
  72.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  73.                     fcolor[0] = Math::lerp(fcolor[0] - temp, fcolor[0] + temp, glm::linearRand(0.f, 1.f));
  74.                 }
  75.             }
  76.             else if (inputString.substr(6, 12) == "maxParticles")
  77.             {
  78.                 if (input2[2] == 'r')
  79.                 {
  80.                     float temp;
  81.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  82.                     initialize(temp);
  83.                 }
  84.             }
  85.             else if (inputString.substr(6, 19) == "minParticleLifespan")
  86.             {
  87.                 if (input2[2] == 'r')
  88.                 {
  89.                     float temp;
  90.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  91.                     lifeRange.x = temp;
  92.                 }
  93.             }
  94.             else if (inputString.substr(6, 19) == "maxParticleLifespan")
  95.             {
  96.                 if (input2[2] == 'r')
  97.                 {
  98.                     float temp;
  99.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  100.                     lifeRange.y = temp;
  101.                 }
  102.             }
  103.             else if (inputString.substr(6, 15) == "startColorAlpha")
  104.             {
  105.                 if (input2[2] == 'r')
  106.                 {
  107.                     float temp;
  108.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  109.                     scolor[3] = temp;
  110.                 }
  111.             }
  112.             else if (inputString.substr(6, 14) == "startColorBlue")
  113.             {
  114.                 if (input2[2] == 'r')
  115.                 {
  116.                     float temp;
  117.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  118.                     scolor[2] = temp;
  119.                 }
  120.             }
  121.             else if (inputString.substr(6, 15) == "startColorGreen")
  122.             {
  123.                 if (input2[2] == 'r')
  124.                 {
  125.                     float temp;
  126.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  127.                     scolor[1] = temp;
  128.                 }
  129.             }
  130.             else if (inputString.substr(6, 13) == "startColorRed")
  131.             {
  132.                 if (input2[2] == 'r')
  133.                 {
  134.                     float temp;
  135.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  136.                     scolor[0] = temp;
  137.                 }
  138.             }
  139.             else if (inputString.substr(6, 23) == "startColorVarianceAlpha")
  140.             {
  141.                 if (input2[2] == 'r')
  142.                 {
  143.                     float temp;
  144.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  145.                     scolor[3] = Math::lerp(scolor[3] - temp, scolor[3] + temp, glm::linearRand(0.f, 1.f));
  146.                 }
  147.             }
  148.             else if (inputString.substr(6, 22) == "startColorVarianceBlue")
  149.             {
  150.                 if (input2[2] == 'r')
  151.                 {
  152.                     float temp;
  153.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  154.                     scolor[2] = Math::lerp(scolor[2] - temp, scolor[2] + temp, glm::linearRand(0.f, 1.f));
  155.                 }
  156.             }
  157.             else if (inputString.substr(6, 23) == "startColorVarianceGreen")
  158.             {
  159.                 if (input2[2] == 'r')
  160.                 {
  161.                     float temp;
  162.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  163.                     scolor[1] = Math::lerp(scolor[1] - temp, scolor[1] + temp, glm::linearRand(0.f, 1.f));
  164.                 }
  165.             }
  166.             else if (inputString.substr(6, 21) == "startColorVarianceRed")
  167.             {
  168.                 if (input2[2] == 'r')
  169.                 {
  170.                     float temp;
  171.                     temp = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  172.                     scolor[0] = Math::lerp(scolor[0] - temp, scolor[0] + temp, glm::linearRand(0.f, 1.f));
  173.                 }
  174.             }
  175.             /*else if (inputString.substr(6, 8) == "gravityx")
  176.             {
  177.                 if (input2[2] == 'r')
  178.                 {
  179.                     gravitation.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  180.                 }
  181.             }*/
  182.             else if (inputString.substr(6, 8) == "gravityy")
  183.             {
  184.                 if (input2[2] == 'r')
  185.                 {
  186.                     gravitation.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  187.                 }
  188.             }
  189.             else if (inputString.substr(6, 15) == "sourcePositionx")
  190.             {
  191.                 if (input2[2] == 'r')
  192.                 {
  193.                     emitterPosition.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  194.                 }
  195.             }
  196.             else if (inputString.substr(6, 15) == "sourcePositiony")
  197.             {
  198.                 if (input2[2] == 'r')
  199.                 {
  200.                     emitterPosition.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  201.                 }
  202.             }
  203.             else if (inputString.substr(6, 15) == "offsetPositionx")
  204.             {
  205.                 if (input2[2] == 'r')
  206.                 {
  207.                     offsetPosition.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  208.                 }
  209.             }
  210.             else if (inputString.substr(6, 15) == "offsetPositiony")
  211.             {
  212.                 if (input2[2] == 'r')
  213.                 {
  214.                     offsetPosition.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  215.                 }
  216.             }
  217.             else if (inputString.substr(6, 6) == "offset<")
  218.             {
  219.                 if (input2[2] == 'r')
  220.                 {
  221.                     offset = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  222.                 }
  223.             }
  224.             else if (inputString.substr(6, 7) == "gravity<")
  225.             {
  226.                 if (input2[2] == 'r')
  227.                 {
  228.                     gravity = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  229.                 }
  230.             }
  231.             else if (inputString.substr(6, 10) == "velocity0x")
  232.             {
  233.                 if (input2[2] == 'r')
  234.                 {
  235.                     velocity0.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  236.                 }
  237.             }
  238.             else if (inputString.substr(6, 10) == "velocity0y")
  239.             {
  240.                 if (input2[2] == 'r')
  241.                 {
  242.                     velocity0.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  243.                 }
  244.             }
  245.             else if (inputString.substr(6, 10) == "velocity1x")
  246.             {
  247.                 if (input2[2] == 'r')
  248.                 {
  249.                     velocity1.x = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  250.                 }
  251.             }
  252.             else if (inputString.substr(6, 10) == "velocity1y")
  253.             {
  254.                 if (input2[2] == 'r')
  255.                 {
  256.                     velocity1.y = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  257.                 }
  258.             }
  259.             else if (inputString.substr(6, 7) == "boxMode")
  260.             {
  261.                 if (input2[2] == 'r')
  262.                 {
  263.                     boxMode = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  264.                 }
  265.             }
  266.             else if (inputString.substr(6, 8) == "minWidth")
  267.             {
  268.                 if (input2[2] == 'r')
  269.                 {
  270.                     minWidth = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  271.                 }
  272.             }
  273.             else if (inputString.substr(6, 8) == "maxWidth")
  274.             {
  275.                 if (input2[2] == 'r')
  276.                 {
  277.                     maxWidth = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  278.                 }
  279.             }
  280.             else if (inputString.substr(6, 9) == "minHeight")
  281.             {
  282.                 if (input2[2] == 'r')
  283.                 {
  284.                     minHeight = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  285.                 }
  286.             }
  287.             else if (inputString.substr(6, 9) == "maxHeight")
  288.             {
  289.                 if (input2[2] == 'r')
  290.                 {
  291.                     maxHeight = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  292.                 }
  293.             }
  294.             else if (inputString.substr(6, 17) == "applySeekingForce")
  295.             {
  296.                 if (input2[2] == 'r')
  297.                 {
  298.                     applySeekingForce = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  299.                 }
  300.             }
  301.             else if (inputString.substr(6, 17) == "seekingForceScale")
  302.             {
  303.                 if (input2[2] == 'r')
  304.                 {
  305.                     seekingForceScale = std::stof(input2.substr(7, input2.find('<', 7) - 7));
  306.                 }
  307.             }
  308.             else if (inputString.substr(6, 18) == "removeSeekingForce")
  309.             {
  310.                 if (input2[2] == 'r')
  311.                 {
  312.                     removeSeekingForce = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  313.                 }
  314.             }
  315.             else if (inputString.substr(6, 13) == "magnetAttract")
  316.             {
  317.                 if (input2[2] == 'r')
  318.                 {
  319.                     magnetAttract = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  320.                 }
  321.             }
  322.             else if (inputString.substr(6, 11) == "magnetRepel")
  323.             {
  324.                 if (input2[2] == 'r')
  325.                 {
  326.                     magnetRepel = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  327.                 }
  328.             }
  329.             else if (inputString.substr(6, 7) == "usePath")
  330.             {
  331.                 if (input2[2] == 'r')
  332.                 {
  333.                     usePath = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  334.                 }
  335.             }
  336.             /*else if (inputString.substr(6, 16) == "applyRandomForce")
  337.             {
  338.                 if (input2[2] == 'r')
  339.                 {
  340.                     applyRandomForce = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  341.                 }
  342.             }*/
  343.             else if (inputString.substr(6, 16) == "emissionRate")
  344.             {
  345.                 if (input2[2] == 'r')
  346.                 {
  347.                     emissionRate = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  348.                 }
  349.             }
  350.             else if (inputString.substr(6, 7) == "playing")
  351.             {
  352.                 if (input2[2] == 'r')
  353.                 {
  354.                     playing = std::stoi(input2.substr(7, input2.find('<', 7) - 7));
  355.                 }
  356.             }
  357.             /*else if (inputString.substr(6, 12) == "pointHandles")
  358.             {
  359.                 if (input2[2] == 'r')
  360.                 {
  361.                     int offset = 7;
  362.                     int offset2;
  363.                     float x, y;
  364.                     while (offset < input2.size() - 9)
  365.                     {
  366.                         sscanf(input2.substr(offset).c_str(), " %f %f%n", &x, &y, &offset2);
  367.                         offset += offset2;
  368.                     }
  369.                 }
  370.             }*/
  371.             /*else if (inputString.substr(6, 13) == "seekingTarget")
  372.             {
  373.                 if (input2[2] == 'r')
  374.                 {
  375.                     sscanf(input2.substr(7).c_str(), "%f %f", &seekingTarget.x, &seekingTarget.y);
  376.                 }
  377.             }*/
  378.             /*else if (inputString.substr(6, 13) == "fleeingTarget")
  379.             {
  380.                 if (input2[2] == 'r')
  381.                 {
  382.                     sscanf(input2.substr(7).c_str(), "%f %f", &fleeingTarget.x, &fleeingTarget.y);
  383.                 }
  384.             }*/
  385.             else
  386.             {
  387.                 //std::cout << "Failed reading after k" << std::endl;
  388.             }
  389.         }
  390.         else
  391.         {
  392.             std::cout << "Failed k." << std::endl;
  393.         }
  394.        
  395. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement