From 4561ae35f7c2c641e5dd0070b6cd3779dad0275b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 May 2011 23:18:39 +0300 Subject: Add drawing colors for new collision types. --- src/gui/palette.cpp | 72 ----------------------------------------------------- 1 file changed, 72 deletions(-) (limited to 'src/gui/palette.cpp') diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index 4614d7023..5a61c332a 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -201,75 +201,3 @@ void Palette::advanceGradient() mRainbowTime = tick_time; } } - -/* -gcn::Color Palette::produceHPColor(int hp, int maxHp, int alpha) -{ - float r1 = 255; - float g1 = 255; - float b1 = 255; - float r2 = 255; - float g2 = 255; - float b2 = 255; - - float weight = 1.0f; - - int thresholdLevel = maxHp / 4; - int thresholdProgress = hp % thresholdLevel; - - if (thresholdLevel) - weight = 1 - ((float)thresholdProgress) / ((float)thresholdLevel); - else - weight = 0; - - if (hp < (thresholdLevel)) - { - gcn::Color color1 = guiPalette->getColor(Palette::HPBAR_ONE_HALF); - gcn::Color color2 = guiPalette->getColor(Palette::HPBAR_ONE_QUARTER); - r1 = color1.r; r2 = color2.r; - g1 = color1.g; g2 = color2.g; - b1 = color1.b; b2 = color2.b; - } - else if (hp < (thresholdLevel*2)) - { - gcn::Color color1 = guiPalette->getColor(Palette::HPBAR_THREE_QUARTERS); - gcn::Color color2 = guiPalette->getColor(Palette::HPBAR_ONE_HALF); - r1 = color1.r; r2 = color2.r; - g1 = color1.g; g2 = color2.g; - b1 = color1.b; b2 = color2.b; - } - else if (hp < thresholdLevel*3) - { - gcn::Color color1 = guiPalette->getColor(Palette::HPBAR_FULL); - gcn::Color color2 = guiPalette->getColor(Palette::HPBAR_THREE_QUARTERS); - r1 = color1.r; r2 = color2.r; - g1 = color1.g; g2 = color2.g; - b1 = color1.b; b2 = color2.b; - } - else - { - gcn::Color color1 = guiPalette->getColor(Palette::HPBAR_FULL); - gcn::Color color2 = guiPalette->getColor(Palette::HPBAR_FULL); - r1 = color1.r; r2 = color2.r; - g1 = color1.g; g2 = color2.g; - b1 = color1.b; b2 = color2.b; - } - - // Safety checks - if (weight > 1.0f) weight = 1.0f; - if (weight < 0.0f) weight = 0.0f; - - // Do the color blend - r1 = (int) weightedAverage(r1, r2,weight); - g1 = (int) weightedAverage(g1, g2, weight); - b1 = (int) weightedAverage(b1, b2, weight); - - // More safety checks - if (r1 > 255) r1 = 255; - if (g1 > 255) g1 = 255; - if (b1 > 255) b1 = 255; - - return gcn::Color(r1, g1, b1, alpha); -} -*/ - -- cgit v1.2.3-70-g09d2