jacob614

vibr gradient

Sep 21st, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. int graphics_VIBR(GRAPHICS_FUNC_ARGS)
  2. {
  3.     float maxtemp = fmax(cpart->tmp,cpart->temp);
  4.     if (cpart->ctype > 1000 && cpart->ctype < 2000)
  5.     {
  6.         *colr += (int)restrict_flt((cpart->ctype-1000)/20,0,51);
  7.         *colg += (int)restrict_flt((cpart->ctype-1000)/18,0,55);
  8.         *colb += (int)restrict_flt((cpart->ctype-1000)/20,0,51);
  9.     }
  10.     else if (cpart->ctype >= 2000 && cpart->ctype < 3000)
  11.     {
  12.         *colr += (int)restrict_flt((cpart->ctype-2000)/20+51,51,100);
  13.         *colg += (int)restrict_flt((cpart->ctype-2000)/31+55,55,87);
  14.         *colb += (int)restrict_flt((cpart->ctype-2000)/20+51,51,100);
  15.     }
  16.     else if (cpart->ctype >= 3000 && cpart->ctype < 3200)
  17.     {
  18.         *colr += (int)restrict_flt((cpart->ctype-3000)/1.7+100,100,218);
  19.         *colg += (int)restrict_flt((cpart->ctype-3000)/2+87,87,192);
  20.         *colb += (int)restrict_flt((cpart->ctype-3000)/1.7+100,100,218);
  21.     }
  22.     else if (cpart->ctype >= 3200)
  23.     {
  24.         *pixel_mode = PMODE_NONE;
  25.         *pixel_mode |= FIRE_ADD;
  26.         *firea = 60;
  27.         *firer = *colr;
  28.         *fireg = *colg;
  29.         *fireb = *colb;
  30.         *colr = 146;
  31.         *colg = 158;
  32.         *colb = 113;
  33.     }
  34.    
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment