Skip to content

Commit 32b64ce

Browse files
committed
Delete star styles and legacy star colors, set solar whitepoint by default
1 parent f613993 commit 32b64ce

33 files changed

+57
-436
lines changed

help/CelestiaGuide.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,14 +1506,6 @@ <h3 id="displayoptions">Render / Display Options</h3>
15061506
Toggle star color table
15071507
</td>
15081508
</tr>
1509-
<tr>
1510-
<td class="leftcell">
1511-
Ctrl+S
1512-
</td>
1513-
<td class="rightcell">
1514-
Cycle the Star Style (points / fuzzy discs / scaled discs)
1515-
</td>
1516-
</tr>
15171509
<tr>
15181510
<td class="leftcell">
15191511
V

src/celengine/render.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ Renderer::Renderer() :
235235
#endif
236236
labelMode(NoLabels),
237237
renderFlags(DefaultRenderFlags),
238-
starStyle(FuzzyPointStars),
239238
pointStarVertexBuffer(nullptr),
240239
textureResolution(medres),
241240
frameCount(0),
@@ -4953,7 +4952,7 @@ Renderer::buildNearSystemsLists(const Universe &universe,
49534952
now,
49544953
lightSourceList,
49554954
tintSaturation,
4956-
starColors.type() == ColorTableType::Enhanced ? nullptr : &tintColors);
4955+
&tintColors);
49574956

49584957
// Traverse the frame trees of each nearby solar system and
49594958
// build the list of objects to be rendered.

src/celengine/render.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,6 @@ class Renderer
228228
ShowSmoothLines
229229
};
230230

231-
enum StarStyle
232-
{
233-
FuzzyPointStars = 0,
234-
PointStars = 1,
235-
ScaledDiscStars = 2,
236-
StarStyleCount = 3,
237-
};
238-
239231
uint64_t getRenderFlags() const;
240232
void setRenderFlags(uint64_t);
241233
int getLabelMode() const;
@@ -351,8 +343,6 @@ class Renderer
351343

352344
void buildProjectionMatrix(Eigen::Matrix4f &mat, float nearZ, float farZ, float zoom) const;
353345

354-
void setStarStyle(StarStyle);
355-
StarStyle getStarStyle() const;
356346
void setResolution(unsigned int resolution);
357347
unsigned int getResolution() const;
358348
void enableSelectionPointer();
@@ -687,7 +677,6 @@ class Renderer
687677

688678
float exposure{ 1.0f };
689679
float faintestPlanetIrradiance{ 1.0f }; // default faintestPlanetIrradiance was 0; maybe remove it at all?
690-
StarStyle starStyle;
691680

692681
Color ambientColor;
693682
std::string displayedSurface;
@@ -736,7 +725,7 @@ class Renderer
736725
float minFeatureSize;
737726
uint64_t locationFilter;
738727

739-
ColorTemperatureTable starColors{ ColorTableType::Blackbody_D65 };
728+
ColorTemperatureTable starColors{ ColorTableType::SunWhite };
740729
ColorTemperatureTable tintColors{ ColorTableType::SunWhite };
741730

742731
Selection highlightObject;

src/celengine/starcolors.cpp

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -37,53 +37,6 @@ const Eigen::Vector2d SRGB_G_xy(0.30, 0.60);
3737
const Eigen::Vector2d SRGB_B_xy(0.15, 0.06);
3838

3939

40-
// Approximate colors used by older versions of Celestia
41-
constexpr std::array<Color, 41> StarColors_Enhanced
42-
{
43-
Color(0.00f, 0.00f, 0.00f), // T = 0K
44-
Color(0.75f, 0.20f, 0.20f), // T = 1000K
45-
Color(1.00f, 0.40f, 0.40f), // T = 2000K
46-
Color(1.00f, 0.70f, 0.70f), // T = 3000K
47-
Color(1.00f, 0.90f, 0.70f), // T = 4000K
48-
Color(1.00f, 1.00f, 0.75f), // T = 5000K
49-
Color(1.00f, 1.00f, 0.88f), // T = 6000K
50-
Color(1.00f, 1.00f, 0.95f), // T = 7000K
51-
Color(1.00f, 1.00f, 1.00f), // T = 8000K
52-
Color(0.95f, 0.98f, 1.00f), // T = 9000K
53-
Color(0.90f, 0.95f, 1.00f), // T = 10000K
54-
Color(0.85f, 0.93f, 1.00f), // T = 11000K
55-
Color(0.80f, 0.90f, 1.00f), // T = 12000K
56-
Color(0.79f, 0.89f, 1.00f), // T = 13000K
57-
Color(0.78f, 0.88f, 1.00f), // T = 14000K
58-
Color(0.77f, 0.87f, 1.00f), // T = 15000K
59-
Color(0.76f, 0.86f, 1.00f), // T = 16000K
60-
Color(0.75f, 0.85f, 1.00f), // T = 17000K
61-
Color(0.74f, 0.84f, 1.00f), // T = 18000K
62-
Color(0.73f, 0.83f, 1.00f), // T = 19000K
63-
Color(0.72f, 0.82f, 1.00f), // T = 20000K
64-
Color(0.71f, 0.81f, 1.00f), // T = 21000K
65-
Color(0.70f, 0.80f, 1.00f), // T = 22000K
66-
Color(0.69f, 0.79f, 1.00f), // T = 23000K
67-
Color(0.68f, 0.78f, 1.00f), // T = 24000K
68-
Color(0.67f, 0.77f, 1.00f), // T = 25000K
69-
Color(0.66f, 0.76f, 1.00f), // T = 26000K
70-
Color(0.65f, 0.75f, 1.00f), // T = 27000K
71-
Color(0.65f, 0.75f, 1.00f), // T = 28000K
72-
Color(0.64f, 0.74f, 1.00f), // T = 29000K
73-
Color(0.64f, 0.74f, 1.00f), // T = 30000K
74-
Color(0.63f, 0.73f, 1.00f), // T = 31000K
75-
Color(0.63f, 0.73f, 1.00f), // T = 32000K
76-
Color(0.62f, 0.72f, 1.00f), // T = 33000K
77-
Color(0.62f, 0.72f, 1.00f), // T = 34000K
78-
Color(0.61f, 0.71f, 1.00f), // T = 35000K
79-
Color(0.61f, 0.71f, 1.00f), // T = 36000K
80-
Color(0.60f, 0.70f, 1.00f), // T = 37000K
81-
Color(0.60f, 0.70f, 1.00f), // T = 38000K
82-
Color(0.60f, 0.70f, 1.00f), // T = 39000K
83-
Color(0.60f, 0.70f, 1.00f), // T = 40000K
84-
};
85-
86-
8740
struct CIEPoint
8841
{
8942
int wavelength;
@@ -695,7 +648,7 @@ createBlackbodyTable(const Eigen::Vector3d& whitepoint,
695648
ColorTemperatureTable::ColorTemperatureTable(ColorTableType _type)
696649
{
697650
if (!setType(_type))
698-
setType(ColorTableType::Enhanced);
651+
setType(ColorTableType::SunWhite);
699652
}
700653

701654

@@ -705,13 +658,6 @@ ColorTemperatureTable::setType(ColorTableType _type)
705658
tableType = _type;
706659
switch (tableType)
707660
{
708-
case ColorTableType::Enhanced:
709-
colors.clear();
710-
colors.reserve(StarColors_Enhanced.size());
711-
std::copy(StarColors_Enhanced.cbegin(), StarColors_Enhanced.cend(), std::back_inserter(colors));
712-
tempScale = static_cast<float>(StarColors_Enhanced.size() - 1) / MaxTemperature;
713-
return true;
714-
715661
case ColorTableType::Blackbody_D65:
716662
createBlackbodyTable(D65_XYZ, tempScale, colors);
717663
return true;

src/celengine/starcolors.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222

2323
enum class ColorTableType
2424
{
25-
Enhanced = 0,
26-
Blackbody_D65 = 1,
27-
SunWhite = 2,
28-
VegaWhite = 3,
25+
Blackbody_D65 = 0,
26+
SunWhite = 1,
27+
VegaWhite = 2,
2928
};
3029

3130
class ColorTemperatureTable

src/celestia/celestiacore.cpp

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,27 +1020,6 @@ void CelestiaCore::charEntered(const char *c_p, int modifiers)
10201020
singleView();
10211021
break;
10221022

1023-
case '\023': // Ctrl+S
1024-
renderer->setStarStyle((Renderer::StarStyle) (((int) renderer->getStarStyle() + 1) %
1025-
(int) Renderer::StarStyleCount));
1026-
switch (renderer->getStarStyle())
1027-
{
1028-
case Renderer::FuzzyPointStars:
1029-
flash(_("Star style: fuzzy points"));
1030-
break;
1031-
case Renderer::PointStars:
1032-
flash(_("Star style: points"));
1033-
break;
1034-
case Renderer::ScaledDiscStars:
1035-
flash(_("Star style: scaled discs"));
1036-
break;
1037-
default:
1038-
break;
1039-
}
1040-
1041-
notifyWatchers(RenderFlagsChanged);
1042-
break;
1043-
10441023
case '\024': // Ctrl+T
10451024
renderer->setRenderFlags(renderer->getRenderFlags() ^ Renderer::ShowCometTails);
10461025
if (renderer->getRenderFlags() & Renderer::ShowCometTails)
@@ -1150,29 +1129,23 @@ void CelestiaCore::charEntered(const char *c_p, int modifiers)
11501129
case '%':
11511130
switch (renderer->getStarColorTable())
11521131
{
1153-
case ColorTableType::Enhanced:
1132+
case ColorTableType::Blackbody_D65:
11541133
renderer->setStarColorTable(ColorTableType::Blackbody_D65);
11551134
flash(_("Star color: Blackbody D65"));
11561135
notifyWatchers(RenderFlagsChanged);
11571136
break;
11581137

1159-
case ColorTableType::Blackbody_D65:
1138+
case ColorTableType::SunWhite:
11601139
renderer->setStarColorTable(ColorTableType::SunWhite);
11611140
flash(_("Star color: Blackbody (Solar Whitepoint)"));
11621141
notifyWatchers(RenderFlagsChanged);
11631142
break;
11641143

1165-
case ColorTableType::SunWhite:
1144+
case ColorTableType::VegaWhite:
11661145
renderer->setStarColorTable(ColorTableType::VegaWhite);
11671146
flash(_("Star color: Blackbody (Vega Whitepoint)"));
11681147
notifyWatchers(RenderFlagsChanged);
11691148
break;
1170-
1171-
case ColorTableType::VegaWhite:
1172-
renderer->setStarColorTable(ColorTableType::Enhanced);
1173-
flash(_("Star color: Classic"));
1174-
notifyWatchers(RenderFlagsChanged);
1175-
break;
11761149
}
11771150
break;
11781151

src/celestia/gtk/actions.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -871,13 +871,6 @@ actionVerbosity(GtkRadioAction* action, GtkRadioAction*, AppData* app)
871871
app->core->setHudDetail(value);
872872
}
873873

874-
void
875-
actionStarStyle(GtkRadioAction* action, GtkRadioAction*, AppData* app)
876-
{
877-
int value = gtk_radio_action_get_current_value(action);
878-
app->renderer->setStarStyle((Renderer::StarStyle)value);
879-
}
880-
881874
void
882875
actionAmbientLight(GtkRadioAction* action, GtkRadioAction*, AppData* app)
883876
{
@@ -1347,26 +1340,6 @@ resyncAmbientActions(AppData* app)
13471340
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
13481341
}
13491342

1350-
/* Synchronizes the Verbosity Actions with the state of the core */
1351-
void
1352-
resyncStarStyleActions(AppData* app)
1353-
{
1354-
GtkAction* action;
1355-
const char* actionName;
1356-
1357-
switch (app->renderer->getStarStyle())
1358-
{
1359-
case Renderer::FuzzyPointStars: actionName = "StarsFuzzy"; break;
1360-
case Renderer::PointStars: actionName = "StarsPoints"; break;
1361-
case Renderer::ScaledDiscStars: actionName = "StarsDiscs"; break;
1362-
default: return;
1363-
}
1364-
1365-
/* Get the action, set the widget */
1366-
action = gtk_action_group_get_action(app->agStarStyle, actionName);
1367-
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
1368-
}
1369-
13701343
/* Placeholder for when galaxy brightness is added as an action */
13711344
void
13721345
resyncGalaxyGainActions(AppData* app)

src/celestia/gtk/actions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ void actionHelpAbout(GtkAction*, AppData*);
6666

6767
/* Radio Button Actions */
6868
void actionVerbosity(GtkRadioAction*, GtkRadioAction*, AppData*);
69-
void actionStarStyle(GtkRadioAction*, GtkRadioAction*, AppData*);
7069
void actionAmbientLight(GtkRadioAction*, GtkRadioAction*, AppData*);
7170

7271
/* Render-Flag Actions */
@@ -130,7 +129,6 @@ void resyncOrbitActions(AppData* app);
130129
void resyncVerbosityActions(AppData* app);
131130
void resyncTimeZoneAction(AppData* app);
132131
void resyncAmbientActions(AppData* app);
133-
void resyncStarStyleActions(AppData* app);
134132
void resyncGalaxyGainActions(AppData* app);
135133
void resyncTextureResolutionActions(AppData* app);
136134

src/celestia/gtk/common.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ setSaneAmbientLight(AppData* app, float value)
180180

181181
/* Sanitizes and sets Exposure */
182182
void
183-
setSaneVisualMagnitude(AppData* app, float value)
183+
setSaneExposure(AppData* app, float value)
184184
{
185185
if (value < 0.0 || value > 1000.0)
186186
value = 1.0f; /* Default */
@@ -218,16 +218,6 @@ setSaneVerbosity(AppData* app, int value)
218218
app->core->setHudDetail(value);
219219
}
220220

221-
/* Sanitizes and sets Star Style */
222-
void
223-
setSaneStarStyle(AppData* app, Renderer::StarStyle value)
224-
{
225-
if (value < Renderer::FuzzyPointStars || value > Renderer::ScaledDiscStars)
226-
value = Renderer::FuzzyPointStars;
227-
228-
app->renderer->setStarStyle(value);
229-
}
230-
231221
/* Sanitizes and sets Texture Resolution */
232222
void
233223
setSaneTextureResolution(AppData* app, int value)

src/celestia/gtk/common.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ struct _AppData {
4343
GtkActionGroup* agOrbit;
4444
GtkActionGroup* agLabel;
4545
GtkActionGroup* agVerbosity;
46-
GtkActionGroup* agStarStyle;
4746
GtkActionGroup* agAmbient;
4847

4948
/* Settings */
@@ -80,11 +79,10 @@ int getWinY(AppData* app);
8079

8180
/* Functions to apply preferences with sanity checks */
8281
void setSaneAmbientLight(AppData* app, float value);
83-
void setSaneVisualMagnitude(AppData* app, float value);
82+
void setSaneExposure(AppData* app, float value);
8483
void setSaneGalaxyLightGain(float value);
8584
void setSaneDistanceLimit(AppData* app, int value);
8685
void setSaneVerbosity(AppData* app, int value);
87-
void setSaneStarStyle(AppData* app, Renderer::StarStyle value);
8886
void setSaneTextureResolution(AppData* app, int value);
8987
void setSaneAltSurface(AppData* app, char* value);
9088
void setSaneWinSize(AppData* app, int x, int y);

0 commit comments

Comments
 (0)