Skip to content

Commit af86842

Browse files
authoredApr 9, 2018
Sun colour: Undo colour change. Remove double assignment (#7227)
Commit 5070ca2 changed sun colour by fixing what seemed to be a code mistake. Return to the standard colour but comment-out the first assignment of the double-assignment for performance. Add a comment to explain.
1 parent 746ca41 commit af86842

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed
 

‎src/sky.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,17 @@ void Sky::render()
137137
if (m_sunlight_seen) {
138138
float sunsize = 0.07;
139139
video::SColorf suncolor_f(1, 1, 0, 1);
140-
suncolor_f.r = 1;
141-
suncolor_f.g = MYMAX(0.3, MYMIN(1.0, 0.7 + m_time_brightness * 0.5));
142-
suncolor_f.b = MYMAX(0.0, m_brightness * 0.95);
140+
//suncolor_f.r = 1;
141+
//suncolor_f.g = MYMAX(0.3, MYMIN(1.0, 0.7 + m_time_brightness * 0.5));
142+
//suncolor_f.b = MYMAX(0.0, m_brightness * 0.95);
143143
video::SColorf suncolor2_f(1, 1, 1, 1);
144-
suncolor2_f.r = 1;
145-
suncolor2_f.g = MYMAX(0.3, MYMIN(1.0, 0.85 + m_time_brightness * 0.5));
146-
suncolor2_f.b = MYMAX(0.0, m_brightness);
144+
// The values below were probably meant to be suncolor2_f instead of a
145+
// reassignment of suncolor_f. However, the resulting colour was chosen
146+
// and is our long-running classic colour. So preserve, but comment-out
147+
// the unnecessary first assignments above.
148+
suncolor_f.r = 1;
149+
suncolor_f.g = MYMAX(0.3, MYMIN(1.0, 0.85 + m_time_brightness * 0.5));
150+
suncolor_f.b = MYMAX(0.0, m_brightness);
147151

148152
float moonsize = 0.04;
149153
video::SColorf mooncolor_f(0.50, 0.57, 0.65, 1);

0 commit comments

Comments
 (0)
Please sign in to comment.