]> git.mxchange.org Git - simgear.git/commitdiff
Use "coverage" instead of "type".
authordavid <david>
Sat, 5 Apr 2003 03:32:18 +0000 (03:32 +0000)
committerdavid <david>
Sat, 5 Apr 2003 03:32:18 +0000 (03:32 +0000)
Rename "mostly-cloudy" to "broken" and "mostly-sunny" to "scattered",
to follow standard weather terminology.

Add "few".

simgear/scene/sky/cloud.cxx
simgear/scene/sky/cloud.hxx

index 5cb994f029d34a022388b137c813282fba9bda90..5f5fd3b7d5419237f3319347a4e11edd92bb1ab3 100644 (file)
@@ -33,7 +33,7 @@
 #include "cloud.hxx"
 
 ssgSimpleState *
-SGCloudLayer::layer_states[SGCloudLayer::SG_MAX_CLOUD_TYPES];
+SGCloudLayer::layer_states[SGCloudLayer::SG_MAX_CLOUD_COVERAGES];
 
 
 // Constructor
@@ -49,12 +49,12 @@ SGCloudLayer::SGCloudLayer( const string &tex_path ) :
     layer_asl(0.0),
     layer_thickness(0.0),
     layer_transition(0.0),
-    layer_type(SG_CLOUD_CLEAR),
+    layer_coverage(SG_CLOUD_CLEAR),
     scale(4000.0),
     last_lon(0.0),
     last_lat(0.0)
 {
-    for ( int i = 0; i < SG_MAX_CLOUD_TYPES; ++i ) {
+    for ( int i = 0; i < SG_MAX_CLOUD_COVERAGES; ++i ) {
         layer_states[i] = NULL;
     }
     layer_root->addKid(layer_transform);
@@ -118,17 +118,17 @@ SGCloudLayer::setTransition_m (float transition_m)
     layer_transition = transition_m;
 }
 
-SGCloudLayer::Type
-SGCloudLayer::getType () const
+SGCloudLayer::Coverage
+SGCloudLayer::getCoverage () const
 {
-    return layer_type;
+    return layer_coverage;
 }
 
 void
-SGCloudLayer::setType (Type type)
+SGCloudLayer::setCoverage (Coverage coverage)
 {
-    if (type != layer_type) {
-       layer_type = type;
+    if (coverage != layer_coverage) {
+       layer_coverage = coverage;
        rebuild();
     }
 }
@@ -147,18 +147,24 @@ SGCloudLayer::rebuild()
         layer_states[SG_CLOUD_OVERCAST] = SGCloudMakeState(cloud_path.str());
 
         cloud_path.set(texture_path.str());
-        cloud_path.append("mostlycloudy.rgba");
-        layer_states[SG_CLOUD_MOSTLY_CLOUDY]
+        cloud_path.append("broken.rgba");
+        layer_states[SG_CLOUD_BROKEN]
             = SGCloudMakeState(cloud_path.str());
 
         cloud_path.set(texture_path.str());
-        cloud_path.append("mostlysunny.rgba");
-        layer_states[SG_CLOUD_MOSTLY_SUNNY]
+        cloud_path.append("scattered.rgba");
+        layer_states[SG_CLOUD_SCATTERED]
+            = SGCloudMakeState(cloud_path.str());
+
+        cloud_path.set(texture_path.str());
+        cloud_path.append("few.rgba");
+        layer_states[SG_CLOUD_FEW]
             = SGCloudMakeState(cloud_path.str());
 
         cloud_path.set(texture_path.str());
         cloud_path.append("cirrus.rgba");
-        layer_states[SG_CLOUD_CIRRUS] = SGCloudMakeState(cloud_path.str());
+        layer_states[SG_CLOUD_CIRRUS]
+            = SGCloudMakeState(cloud_path.str());
 
         layer_states[SG_CLOUD_CLEAR] = 0;
     }
@@ -209,8 +215,8 @@ SGCloudLayer::rebuild()
 
     layer = new ssgVtxTable ( GL_TRIANGLE_STRIP, vl, NULL, tl, cl );
     layer_transform->addKid( layer );
-    if ( layer_states[layer_type] != NULL ) {
-        layer->setState( layer_states[layer_type] );
+    if ( layer_states[layer_coverage] != NULL ) {
+        layer->setState( layer_states[layer_coverage] );
     }
 
     // force a repaint of the sky colors with arbitrary defaults
@@ -358,7 +364,7 @@ bool SGCloudLayer::reposition( sgVec3 p, sgVec3 up, double lon, double lat,
 
 
 void SGCloudLayer::draw() {
-    if ( layer_type != SG_CLOUD_CLEAR ) {
+    if ( layer_coverage != SG_CLOUD_CLEAR ) {
         ssgCullAndDraw( layer_root );
     }
 }
index 36746d888ca1f586cacff210e549fd080d6a91e9..b346f613ee0eebc636f45340e509fc47e37fcfc8 100644 (file)
@@ -37,13 +37,14 @@ class SGCloudLayer {
 
 public:
 
-    enum Type {
+    enum Coverage {
        SG_CLOUD_OVERCAST = 0,
-       SG_CLOUD_MOSTLY_CLOUDY,
-       SG_CLOUD_MOSTLY_SUNNY,
+       SG_CLOUD_BROKEN,
+       SG_CLOUD_SCATTERED,
+       SG_CLOUD_FEW,
        SG_CLOUD_CIRRUS,
        SG_CLOUD_CLEAR,
-       SG_MAX_CLOUD_TYPES
+       SG_MAX_CLOUD_COVERAGES
     };
 
     // Constructors
@@ -64,8 +65,8 @@ public:
     float getTransition_m () const;
     void setTransition_m (float transition_m);
 
-    Type getType () const;
-    void setType (Type type);
+    Coverage getCoverage () const;
+    void setCoverage (Coverage coverage);
 
     // build the cloud object
     void rebuild();
@@ -92,8 +93,8 @@ public:
 
 private:
 
-    static ssgSimpleState *layer_states[SG_MAX_CLOUD_TYPES];
-    static int layer_sizes[SG_MAX_CLOUD_TYPES];
+    static ssgSimpleState *layer_states[SG_MAX_CLOUD_COVERAGES];
+    static int layer_sizes[SG_MAX_CLOUD_COVERAGES];
 
     ssgRoot *layer_root;
     ssgTransform *layer_transform;
@@ -109,7 +110,7 @@ private:
     float layer_asl;
     float layer_thickness;
     float layer_transition;
-    Type layer_type;
+    Coverage layer_coverage;
     float scale;
 
     // for handling texture coordinates to simulate cloud movement