TiManGames / AmnesiaTheDarkDescent

GNU General Public License v3.0
30 stars 8 forks source link

Colors with all RGBA channels set to 255 aren't getting applied #39

Closed jkulawik closed 3 weeks ago

jkulawik commented 3 weeks ago

See https://github.com/jkulawik/tdd-issues/issues/5

jkulawik commented 3 weeks ago

Fix from Luis:

Index: GuiPopUpColorPicker.cpp
===================================================================
--- GuiPopUpColorPicker.cpp    (revision 166)
+++ GuiPopUpColorPicker.cpp    (revision 167)
@@ -701,7 +701,7 @@

     const cColor& cGuiPopUpColorPicker::GetOldColor()
     {
-        return mpFPreviousColor->GetBackGroundColor();
+        return mPrevColor;
     }

     //-------------------------------------------------------------------------------
@@ -909,7 +909,7 @@
         if(pColor)
             col = *pColor;
         else
-            col = mpFPreviousColor->GetBackGroundColor();
+            col = mPrevColor;

         SetColor(col);

@@ -1394,7 +1394,7 @@
     {
         ///////////////////////////////////////////////////////////////
         // Compare old color to new and set up stuff if different
-        if((mColor == mpFPreviousColor->GetBackGroundColor()) == false)
+        if (mColor != mPrevColor)
         {
             if(mpDestColor)
                 *mpDestColor = mColor;
jkulawik commented 3 weeks ago

I didn't expect this to work because mPrevColor is something we don't have so I just changed one of the conditions and it seems to have worked. Storing the previous color might be a better solution though because the current way of doing it is a hack, so this might need a solution in the future