Painting.cs 773 B

1234567891011121314151617181920
  1. function SG_PrecomputePaintColors()
  2. {
  3. for(%i=0;%i<64;%i++)
  4. {
  5. %color = getColorIDTable(%i);
  6. %colR = mFloatLength(getWord(%color, 0) * 255, 0);
  7. %colG = mFloatLength(getWord(%color, 1) * 255, 0);
  8. %colB = mFloatLength(getWord(%color, 2) * 255, 0);
  9. %paintW = getMin(%colR, getMin(%colG, %colB));
  10. %colR -= %paintW; %colG -= %paintW; %colB -= %paintW;
  11. %paintY = getMin(%colR, %colG); %colR -= %paintY; %colG -= %paintY;
  12. %paintC = getMin(%colG, %colB); %colG -= %paintC; %colB -= %paintC;
  13. %paintM = getMin(%colR, %colB); %colR -= %paintM; %colB -= %paintM;
  14. %paintB = 255 - (%paintW + %paintY + %paintC + %paintM + %colR + %colG + %colB);
  15. $SG_PaintAmt[%i] = %colR SPC %paintY SPC %colG SPC %paintC
  16. SPC %colB SPC %paintM SPC %paintW SPC %paintB;
  17. }
  18. }