From: James Turner Date: Mon, 26 Jul 2010 14:15:49 +0000 (+0100) Subject: Removal of PLIB/SG from SimGear X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2a2e2716bdfbecb3494ab935171ed6224a178470;p=simgear.git Removal of PLIB/SG from SimGear --- diff --git a/simgear/compiler.h b/simgear/compiler.h index e29a20e3..616dd15d 100644 --- a/simgear/compiler.h +++ b/simgear/compiler.h @@ -69,6 +69,9 @@ # define copysign _copysign # define strcasecmp stricmp +# undef min +# undef max + # pragma warning(disable: 4786) // identifier was truncated to '255' characters # pragma warning(disable: 4244) // conversion from double to float # pragma warning(disable: 4305) // diff --git a/simgear/constants.h b/simgear/constants.h index 8438e132..5da9c9a6 100644 --- a/simgear/constants.h +++ b/simgear/constants.h @@ -34,15 +34,20 @@ #include -#include +// Make sure PI is defined in its various forms +#ifdef M_PI +#define SGD_PI M_PI +#define SG_PI M_PI +#else +#define SG_PI 3.1415926535f +#define SGD_PI 3.1415926535 +#endif -// Make sure PI is defined in its various forms -// SG_PI and SGD_PI (float and double) come from plib/sg.h /** 2 * PI */ -#define SGD_2PI 6.28318530717958647692 +#define SGD_2PI SGD_PI * 2.0 /** PI / 2 */ #ifdef M_PI_2 @@ -54,6 +59,13 @@ /** PI / 4 */ #define SGD_PI_4 0.78539816339744830961 + +#define SGD_DEGREES_TO_RADIANS (SGD_PI/180.0) +#define SGD_RADIANS_TO_DEGREES (180.0/SGD_PI) + +#define SG_DEGREES_TO_RADIANS SGD_DEGREES_TO_RADIANS +#define SG_RADIANS_TO_DEGREES SGD_RADIANS_TO_DEGREES + /** \def SG_E "e" */ #ifdef M_E # define SG_E M_E diff --git a/simgear/environment/metar.cxx b/simgear/environment/metar.cxx index 79401e39..2f5280e6 100644 --- a/simgear/environment/metar.cxx +++ b/simgear/environment/metar.cxx @@ -30,6 +30,7 @@ #include #include +#include #include #include diff --git a/simgear/environment/visual_enviro.cxx b/simgear/environment/visual_enviro.cxx index 62e7c802..b77cefcb 100644 --- a/simgear/environment/visual_enviro.cxx +++ b/simgear/environment/visual_enviro.cxx @@ -50,23 +50,23 @@ static float rainpos[MAX_RAIN_SLICE]; #define MAX_LT_TREE_SEG 400 #define DFL_MIN_LIGHT 0.35 -sgVec3 SGEnviro::min_light = {DFL_MIN_LIGHT, DFL_MIN_LIGHT, DFL_MIN_LIGHT}; +SGVec3f SGEnviro::min_light(DFL_MIN_LIGHT, DFL_MIN_LIGHT, DFL_MIN_LIGHT); #define DFL_STREAK_BRIGHT_NEARMOST_LAYER 0.9 -SGfloat SGEnviro::streak_bright_nearmost_layer = DFL_STREAK_BRIGHT_NEARMOST_LAYER; +float SGEnviro::streak_bright_nearmost_layer = DFL_STREAK_BRIGHT_NEARMOST_LAYER; #define DFL_STREAK_BRIGHT_FARMOST_LAYER 0.5 -SGfloat SGEnviro::streak_bright_farmost_layer = DFL_STREAK_BRIGHT_FARMOST_LAYER; +float SGEnviro::streak_bright_farmost_layer = DFL_STREAK_BRIGHT_FARMOST_LAYER; #define DFL_STREAK_PERIOD_MAX 2.5 -SGfloat SGEnviro::streak_period_max = DFL_STREAK_PERIOD_MAX; +float SGEnviro::streak_period_max = DFL_STREAK_PERIOD_MAX; #define DFL_STREAK_PERIOD_CHANGE_PER_KT 0.005 -SGfloat SGEnviro::streak_period_change_per_kt = DFL_STREAK_PERIOD_CHANGE_PER_KT; +float SGEnviro::streak_period_change_per_kt = DFL_STREAK_PERIOD_CHANGE_PER_KT; #define DFL_STREAK_PERIOD_MIN 1.0 -SGfloat SGEnviro::streak_period_min = DFL_STREAK_PERIOD_MIN; +float SGEnviro::streak_period_min = DFL_STREAK_PERIOD_MIN; #define DFL_STREAK_LENGTH_MIN 0.03 -SGfloat SGEnviro::streak_length_min = DFL_STREAK_LENGTH_MIN; +float SGEnviro::streak_length_min = DFL_STREAK_LENGTH_MIN; #define DFL_STREAK_LENGTH_CHANGE_PER_KT 0.0005 -SGfloat SGEnviro::streak_length_change_per_kt = DFL_STREAK_LENGTH_CHANGE_PER_KT; +float SGEnviro::streak_length_change_per_kt = DFL_STREAK_LENGTH_CHANGE_PER_KT; #define DFL_STREAK_LENGTH_MAX 0.1 -SGfloat SGEnviro::streak_length_max = DFL_STREAK_LENGTH_MAX; +float SGEnviro::streak_length_max = DFL_STREAK_LENGTH_MAX; #define DFL_STREAK_COUNT_MIN 40 int SGEnviro::streak_count_min = DFL_STREAK_COUNT_MIN; #define DFL_STREAK_COUNT_MAX 190 @@ -75,9 +75,9 @@ int SGEnviro::streak_count_min = DFL_STREAK_COUNT_MIN; #endif int SGEnviro::streak_count_max = DFL_STREAK_COUNT_MAX; #define DFL_CONE_BASE_RADIUS 15.0 -SGfloat SGEnviro::cone_base_radius = DFL_CONE_BASE_RADIUS; +float SGEnviro::cone_base_radius = DFL_CONE_BASE_RADIUS; #define DFL_CONE_HEIGHT 30.0 -SGfloat SGEnviro::cone_height = DFL_CONE_HEIGHT; +float SGEnviro::cone_height = DFL_CONE_HEIGHT; void SGEnviro::config(const SGPropertyNode* n) @@ -86,7 +86,7 @@ void SGEnviro::config(const SGPropertyNode* n) return; const float ml = n->getFloatValue("min-light", DFL_MIN_LIGHT); - sgSetVec3(min_light, ml, ml, ml); + min_light = SGVec3f(ml, ml, ml); streak_bright_nearmost_layer = n->getFloatValue( "streak-brightness-nearmost-layer", @@ -198,7 +198,7 @@ SGEnviro::~SGEnviro(void) { lightnings.clear(); } -void SGEnviro::startOfFrame( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double delta_time) { +void SGEnviro::startOfFrame( SGVec3f p, SGVec3f up, double lon, double lat, double alt, double delta_time) { // OSGFIXME return; view_in_cloud = false; @@ -208,7 +208,7 @@ void SGEnviro::startOfFrame( sgVec3 p, sgVec3 up, double lon, double lat, double elapsed_time += delta_time; min_time_before_lt -= delta_time; dt = delta_time; - +#if 0 sgMat4 T1, LON, LAT; sgVec3 axis; @@ -230,6 +230,7 @@ void SGEnviro::startOfFrame( sgVec3 p, sgVec3 up, double lon, double lat, double sgSetCoord( &pos, TRANSFORM ); sgMakeCoordMat4( transform, &pos ); + #endif last_lon = lon; last_lat = lat; last_alt = alt; @@ -287,10 +288,10 @@ void SGEnviro::set_lightning_enable_state(bool enable) { } } -void SGEnviro::setLight(sgVec4 adj_fog_color) { +void SGEnviro::setLight(SGVec4f adj_fog_color) { // OSGFIXME return; - sgCopyVec4( fog_color, adj_fog_color ); + fog_color = adj_fog_color; if( false ) { // ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse() ); } @@ -416,118 +417,11 @@ list_of_SGWxRadarEcho *SGEnviro::get_radar_echo(void) { void SGEnviro::DrawCone2(float baseRadius, float height, int slices, bool down, double rain_norm, double speed) { // OSGFIXME return; - sgVec3 light; - sgAddVec3( light, fog_color, min_light ); - float da = SG_PI * 2.0f / (float) slices; - // low number = faster - float speedf = streak_period_max - speed * streak_period_change_per_kt; - if( speedf < streak_period_min ) - speedf = streak_period_min; - float lenf = streak_length_min + speed * streak_length_change_per_kt; - if( lenf > streak_length_max ) - lenf = streak_length_max; - float t = fmod((float) elapsed_time, speedf) / speedf; -// t = 0.1f; - if( !down ) - t = 1.0f - t; - float angle = 0.0f; - //glColor4f(1.0f, 0.7f, 0.7f, 0.9f); // XXX unneeded? overriden below - glBegin(GL_LINES); - if (slices > MAX_RAIN_SLICE) - slices = MAX_RAIN_SLICE; // should never happen - for( int i = 0 ; i < slices ; i++ ) { - float x = cos(angle) * baseRadius; - float y = sin(angle) * baseRadius; - angle += da; - sgVec3 dir = {x, -height, y}; - - // rain drops at 2 different speed to simulate depth - float t1 = (i & 1 ? t : t + t) + rainpos[i]; - if(t1 > 1.0f) t1 -= 1.0f; - if(t1 > 1.0f) t1 -= 1.0f; - - // distant raindrops are more transparent - float c = t1 * (i & 1 ? - streak_bright_farmost_layer - : streak_bright_nearmost_layer); - glColor4f(c * light[0], c * light[1], c * light[2], c); - sgVec3 p1, p2; - sgScaleVec3(p1, dir, t1); - // distant raindrops are shorter - float t2 = t1 + (i & 1 ? lenf : lenf+lenf); - sgScaleVec3(p2, dir, t2); - - glVertex3f(p1[0], p1[1] + height, p1[2]); - glVertex3f(p2[0], p2[1] + height, p2[2]); - } - glEnd(); } void SGEnviro::drawRain(double pitch, double roll, double heading, double hspeed, double rain_norm) { // OSGFIXME return; - -#if 0 - static int debug_period = 0; - if (debug_period++ == 50) { - debug_period = 0; - cout << "drawRain(" - << pitch << ", " - << roll << ", " - << heading << ", " - << hspeed << ", " - << rain_norm << ");" - //" angle = " << angle - //<< " raindrop(KTS) = " << raindrop_speed_kts - << endl; - } -#endif - - - glBindTexture(GL_TEXTURE_2D, 0); - - glDisable(GL_DEPTH_TEST); - glShadeModel(GL_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); - glDisable( GL_FOG ); - glDisable(GL_LIGHTING); - - int slice_count = static_cast( - (streak_count_min + rain_norm*(streak_count_max-streak_count_min)) - * precipitation_density / 100.0); - - // www.wonderquest.com/falling-raindrops.htm says that - // Raindrop terminal velocity is 5 to 20mph - // Rather than model it accurately (temp, pressure, diameter), and make it - // smaller than terminal when closer to the precipitation cloud base, - // we interpolate in the 5-20mph range according to rain_norm. - double raindrop_speed_kts - = (5.0 + rain_norm*15.0) * SG_MPH_TO_MPS * SG_MPS_TO_KT; - - float angle = atanf(hspeed / raindrop_speed_kts) * SG_RADIANS_TO_DEGREES; - glPushMatrix(); - // the cone rotate with hspeed - angle = -pitch - angle; - glRotatef(roll, 0.0, 0.0, 1.0); - glRotatef(heading, 0.0, 1.0, 0.0); - glRotatef(angle, 1.0, 0.0, 0.0); - - // up cone - DrawCone2(cone_base_radius, cone_height, - slice_count, true, rain_norm, hspeed); - // down cone (usually not visible) - if(angle > 0.0 || heading != 0.0) - DrawCone2(cone_base_radius, -cone_height, - slice_count, false, rain_norm, hspeed); - - glPopMatrix(); - - glEnable(GL_LIGHTING); - glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ; - glEnable( GL_FOG ); - glEnable(GL_DEPTH_TEST); - } void SGEnviro::set_sampleGroup(SGSampleGroup *sgr) { @@ -566,7 +460,6 @@ void SGLightning::lt_build_tree_branch(int tree_nr, SGVec3d &start, float energy void SGLightning::lt_build(void) { // OSGFIXME return; - } diff --git a/simgear/environment/visual_enviro.hxx b/simgear/environment/visual_enviro.hxx index 08830c0b..9f6788e8 100644 --- a/simgear/environment/visual_enviro.hxx +++ b/simgear/environment/visual_enviro.hxx @@ -22,14 +22,11 @@ #ifndef _VISUAL_ENVIRO_HXX #define _VISUAL_ENVIRO_HXX -#include - #include #include #include -using std::vector; -using std::string; +#include class SGLightning; class SGSampleGroup; @@ -62,7 +59,7 @@ public: int cloudId; }; -typedef vector list_of_SGWxRadarEcho; +typedef std::vector list_of_SGWxRadarEcho; /** * Visual environment helper class. @@ -81,8 +78,8 @@ private: double last_cloud_turbulence, cloud_turbulence; bool lightning_enable_state; double elapsed_time, dt; - sgVec4 fog_color; - sgMat4 transform; + SGVec4f fog_color; + SGMatrixf transform; double last_lon, last_lat, last_alt; SGSampleGroup *sampleGroup; bool snd_active, snd_playing; @@ -93,8 +90,8 @@ private: /** a list of all the radar echo. */ list_of_SGWxRadarEcho radarEcho; - static sgVec3 min_light; - static SGfloat streak_bright_nearmost_layer, + static SGVec3f min_light; + static float streak_bright_nearmost_layer, streak_bright_farmost_layer, streak_period_max, streak_period_change_per_kt, @@ -103,7 +100,7 @@ private: streak_length_change_per_kt, streak_length_max; static int streak_count_min, streak_count_max; - static SGfloat cone_base_radius, + static float cone_base_radius, cone_height; public: @@ -121,7 +118,7 @@ public: /** * Forward a few states used for renderings. */ - void startOfFrame( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double delta_time); + void startOfFrame( SGVec3f p, SGVec3f up, double lon, double lat, double alt, double delta_time); void endOfFrame(void); @@ -158,7 +155,7 @@ public: * Forward the fog color used by the rain rendering. * @param adj_fog_color color of the fog */ - void setLight(sgVec4 adj_fog_color); + void setLight(SGVec4f adj_fog_color); // this can be queried to add some turbulence for example bool is_view_in_cloud(void) const; @@ -250,7 +247,7 @@ public: list_of_SGWxRadarEcho *get_radar_echo(void); - sgMat4 *get_transform(void) { return &transform; } + SGMatrixf *get_transform(void) { return &transform; } }; extern SGEnviro sgEnviro; diff --git a/simgear/io/decode_binobj.cxx b/simgear/io/decode_binobj.cxx index 8560a855..3088393b 100644 --- a/simgear/io/decode_binobj.cxx +++ b/simgear/io/decode_binobj.cxx @@ -6,6 +6,7 @@ #include #include +#include #include "sg_binobj.hxx" diff --git a/simgear/io/lowlevel.hxx b/simgear/io/lowlevel.hxx index 0f650d5b..bab26ab5 100644 --- a/simgear/io/lowlevel.hxx +++ b/simgear/io/lowlevel.hxx @@ -30,11 +30,11 @@ #include #include -#include - #include #include +#include + // Note that output is written in little endian form (and converted as // necessary for big endian machines) @@ -75,39 +75,39 @@ void sgWriteBytes ( gzFile fd, const unsigned int n, const void *var ) ; void sgReadString ( gzFile fd, char **var ) ; void sgWriteString ( gzFile fd, const char *var ) ; -inline void sgReadVec2 ( gzFile fd, sgVec2 var ) { - sgReadFloat ( fd, 2, var ) ; +inline void sgReadVec2 ( gzFile fd, SGVec2f& var ) { + sgReadFloat ( fd, 2, var.data() ) ; } -inline void sgWriteVec2 ( gzFile fd, const sgVec2 var ) { - sgWriteFloat ( fd, 2, var ) ; +inline void sgWriteVec2 ( gzFile fd, const SGVec2f& var ) { + sgWriteFloat ( fd, 2, var.data() ) ; } -inline void sgReadVec3 ( gzFile fd, sgVec3 var ) { - sgReadFloat ( fd, 3, var ) ; +inline void sgReadVec3 ( gzFile fd, SGVec3f& var ) { + sgReadFloat ( fd, 3, var.data() ) ; } -inline void sgWriteVec3 ( gzFile fd, const sgVec3 var ) { - sgWriteFloat ( fd, 3, var ) ; +inline void sgWriteVec3 ( gzFile fd, const SGVec3f& var ) { + sgWriteFloat ( fd, 3, var.data() ) ; } -inline void sgReaddVec3 ( gzFile fd, sgdVec3 var ) { - sgReadDouble ( fd, 3, var ) ; +inline void sgReaddVec3 ( gzFile fd, SGVec3d& var ) { + sgReadDouble ( fd, 3, var.data() ) ; } -inline void sgWritedVec3 ( gzFile fd, const sgdVec3 var ) { - sgWriteDouble ( fd, 3, var ) ; +inline void sgWritedVec3 ( gzFile fd, const SGVec3d& var ) { + sgWriteDouble ( fd, 3, var.data() ) ; } -inline void sgReadVec4 ( gzFile fd, sgVec4 var ) { - sgReadFloat ( fd, 4, var ) ; +inline void sgReadVec4 ( gzFile fd, SGVec4f& var ) { + sgReadFloat ( fd, 4, var.data() ) ; } -inline void sgWriteVec4 ( gzFile fd, const sgVec4 var ) { - sgWriteFloat ( fd, 4, var ) ; +inline void sgWriteVec4 ( gzFile fd, const SGVec4f& var ) { + sgWriteFloat ( fd, 4, var.data() ) ; } -inline void sgReadMat4 ( gzFile fd, sgMat4 var ) { - sgReadFloat ( fd, 16, (float *)var ) ; +inline void sgReadMat4 ( gzFile fd, SGMatrixf& var ) { + sgReadFloat ( fd, 16, (float *)var.data() ) ; } -inline void sgWriteMat4 ( gzFile fd, const sgMat4 var ) { - sgWriteFloat ( fd, 16, (float *)var ) ; +inline void sgWriteMat4 ( gzFile fd, const SGMatrixf& var ) { + sgWriteFloat ( fd, 16, (float *)var.data() ) ; } void sgClearReadError(); diff --git a/simgear/io/sg_binobj.cxx b/simgear/io/sg_binobj.cxx index faed1e68..5f7a34d2 100644 --- a/simgear/io/sg_binobj.cxx +++ b/simgear/io/sg_binobj.cxx @@ -31,6 +31,8 @@ #include #include +#include +#include // for system() #include #include @@ -693,9 +695,7 @@ bool SGBinObject::write_bin( const string& base, const string& name, sgWriteUShort( fp, 1 ); // nelements sgWriteUInt( fp, sizeof(double) * 3 + sizeof(float) ); // nbytes - sgdVec3 center; - sgdSetVec3( center, gbs_center.x(), gbs_center.y(), gbs_center.z() ); - sgWritedVec3( fp, center ); + sgWritedVec3( fp, gbs_center ); sgWriteFloat( fp, gbs_radius ); // dump vertex list @@ -704,8 +704,7 @@ bool SGBinObject::write_bin( const string& base, const string& name, sgWriteUShort( fp, 1 ); // nelements sgWriteUInt( fp, wgs84_nodes.size() * sizeof(float) * 3 ); // nbytes for ( i = 0; i < (int)wgs84_nodes.size(); ++i ) { - SGVec3f p = toVec3f(wgs84_nodes[i] - gbs_center); - sgWriteVec3( fp, p.data() ); + sgWriteVec3( fp, toVec3f(wgs84_nodes[i] - gbs_center)); } // dump vertex color list @@ -714,7 +713,7 @@ bool SGBinObject::write_bin( const string& base, const string& name, sgWriteUShort( fp, 1 ); // nelements sgWriteUInt( fp, colors.size() * sizeof(float) * 4 ); // nbytes for ( i = 0; i < (int)colors.size(); ++i ) { - sgWriteVec4( fp, colors[i].data() ); + sgWriteVec4( fp, colors[i]); } // dump vertex normal list @@ -737,7 +736,7 @@ bool SGBinObject::write_bin( const string& base, const string& name, sgWriteUShort( fp, 1 ); // nelements sgWriteUInt( fp, texcoords.size() * sizeof(float) * 2 ); // nbytes for ( i = 0; i < (int)texcoords.size(); ++i ) { - sgWriteVec2( fp, texcoords[i].data() ); + sgWriteVec2( fp, texcoords[i]); } // dump point groups if they exist diff --git a/simgear/io/sg_binobj.hxx b/simgear/io/sg_binobj.hxx index 83194725..7f672640 100644 --- a/simgear/io/sg_binobj.hxx +++ b/simgear/io/sg_binobj.hxx @@ -28,8 +28,6 @@ #define _SG_BINOBJ_HXX -#include - #include #include #include diff --git a/simgear/route/route.cxx b/simgear/route/route.cxx index a02428e1..d0da1804 100644 --- a/simgear/route/route.cxx +++ b/simgear/route/route.cxx @@ -24,8 +24,6 @@ # include #endif -#include - #include "route.hxx" diff --git a/simgear/scene/bvh/BVHMotionTransform.cxx b/simgear/scene/bvh/BVHMotionTransform.cxx index f86668ed..249c0784 100644 --- a/simgear/scene/bvh/BVHMotionTransform.cxx +++ b/simgear/scene/bvh/BVHMotionTransform.cxx @@ -15,6 +15,10 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // +#ifdef HAVE_CONFIG_H +# include +#endif + #include "BVHMotionTransform.hxx" #include "BVHVisitor.hxx" @@ -103,13 +107,13 @@ BVHMotionTransform::updateAmplificationFactors() // But anyway, almost all transforms in a scenegraph will // have them equal to 1 ... double r = norm(_toWorldReference.xformVec(SGVec3d(1, 0, 0))); - r = std::max(r, norm(_toWorldReference.xformVec(SGVec3d(0, 1, 0)))); - r = std::max(r, norm(_toWorldReference.xformVec(SGVec3d(0, 0, 1)))); + r = SGMiscd::max(r, norm(_toWorldReference.xformVec(SGVec3d(0, 1, 0)))); + r = SGMiscd::max(r, norm(_toWorldReference.xformVec(SGVec3d(0, 0, 1)))); _toWorldAmplification = r; r = norm(_toLocalReference.xformVec(SGVec3d(1, 0, 0))); - r = std::max(r, norm(_toLocalReference.xformVec(SGVec3d(0, 1, 0)))); - r = std::max(r, norm(_toLocalReference.xformVec(SGVec3d(0, 0, 1)))); + r = SGMiscd::max(r, norm(_toLocalReference.xformVec(SGVec3d(0, 1, 0)))); + r = SGMiscd::max(r, norm(_toLocalReference.xformVec(SGVec3d(0, 0, 1)))); _toLocalAmplification = r; } diff --git a/simgear/scene/bvh/BVHSubTreeCollector.cxx b/simgear/scene/bvh/BVHSubTreeCollector.cxx index 156c3756..5c8a915c 100644 --- a/simgear/scene/bvh/BVHSubTreeCollector.cxx +++ b/simgear/scene/bvh/BVHSubTreeCollector.cxx @@ -18,6 +18,7 @@ #include "BVHSubTreeCollector.hxx" #include +#include #include "BVHNode.hxx" #include "BVHGroup.hxx" diff --git a/simgear/scene/model/SGReaderWriterXML.cxx b/simgear/scene/model/SGReaderWriterXML.cxx index 7eed6dac..410878be 100644 --- a/simgear/scene/model/SGReaderWriterXML.cxx +++ b/simgear/scene/model/SGReaderWriterXML.cxx @@ -23,6 +23,7 @@ #include //yuck #include +#include #include diff --git a/simgear/scene/sky/cloudfield.cxx b/simgear/scene/sky/cloudfield.cxx index dde4c653..7d738563 100644 --- a/simgear/scene/sky/cloudfield.cxx +++ b/simgear/scene/sky/cloudfield.cxx @@ -31,7 +31,6 @@ #include -#include #include #include @@ -65,7 +64,7 @@ using namespace simgear; float SGCloudField::fieldSize = 50000.0f; double SGCloudField::timer_dt = 0.0; float SGCloudField::view_distance = 20000.0f; -sgVec3 SGCloudField::view_vec, SGCloudField::view_X, SGCloudField::view_Y; +SGVec3f SGCloudField::view_vec, SGCloudField::view_X, SGCloudField::view_Y; // reposition the cloud layer at the specified origin and orientation bool SGCloudField::reposition( const SGVec3f& p, const SGVec3f& up, double lon, double lat, diff --git a/simgear/scene/sky/cloudfield.hxx b/simgear/scene/sky/cloudfield.hxx index d962ae4f..38fa9e95 100644 --- a/simgear/scene/sky/cloudfield.hxx +++ b/simgear/scene/sky/cloudfield.hxx @@ -23,7 +23,6 @@ #ifndef _CLOUDFIELD_HXX #define _CLOUDFIELD_HXX -#include #include #include @@ -59,7 +58,7 @@ private: class Cloud { public: SGNewCloud *aCloud; - sgVec3 pos; + SGVec3f pos; bool visible; }; @@ -70,7 +69,7 @@ private: static const int QUADTREE_SIZE = 32; // this is a relative position only, with that we can move all clouds at once - sgVec3 relative_position; + SGVec3f relative_position; // double lon, lat; osg::ref_ptr field_root; @@ -83,7 +82,6 @@ private: double deltax, deltay, alt; double last_course; - sgSphere field_sphere; float last_coverage; float coverage; SGGeoc cld_pos; @@ -121,7 +119,7 @@ public: // visibility distance for clouds in meters static float CloudVis; - static sgVec3 view_vec, view_X, view_Y; + static SGVec3f view_vec, view_X, view_Y; static float view_distance; static double timer_dt; diff --git a/simgear/scene/sky/newcloud.cxx b/simgear/scene/sky/newcloud.cxx index 6d35ad99..67acd064 100644 --- a/simgear/scene/sky/newcloud.cxx +++ b/simgear/scene/sky/newcloud.cxx @@ -40,7 +40,6 @@ #include -#include #include #include #include diff --git a/simgear/scene/sky/newcloud.hxx b/simgear/scene/sky/newcloud.hxx index f0ac9451..26987933 100644 --- a/simgear/scene/sky/newcloud.hxx +++ b/simgear/scene/sky/newcloud.hxx @@ -23,7 +23,6 @@ #ifndef _NEWCLOUD_HXX #define _NEWCLOUD_HXX -#include #include #include #include diff --git a/simgear/scene/sky/sphere.cxx b/simgear/scene/sky/sphere.cxx index c41dd9b3..b937c7cc 100644 --- a/simgear/scene/sky/sphere.cxx +++ b/simgear/scene/sky/sphere.cxx @@ -26,6 +26,7 @@ #include #include +#include #include #include diff --git a/simgear/sound/sample_openal.cxx b/simgear/sound/sample_openal.cxx index 16291d7d..0a69170c 100644 --- a/simgear/sound/sample_openal.cxx +++ b/simgear/sound/sample_openal.cxx @@ -27,6 +27,7 @@ #endif #include // rand() +#include #include #include diff --git a/simgear/sound/sample_openal.hxx b/simgear/sound/sample_openal.hxx index 362915b0..75d09752 100644 --- a/simgear/sound/sample_openal.hxx +++ b/simgear/sound/sample_openal.hxx @@ -35,6 +35,7 @@ #endif #include +#include #include #include @@ -42,7 +43,6 @@ #include #include - /** * manages everything we need to know for an individual audio sample */ diff --git a/simgear/sound/sample_queue.cxx b/simgear/sound/sample_queue.cxx index a367ed25..08cb3019 100644 --- a/simgear/sound/sample_queue.cxx +++ b/simgear/sound/sample_queue.cxx @@ -26,7 +26,8 @@ # include #endif -#include // rand() +#include // rand() +#include #include #include diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index e91cf767..369adede 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -37,6 +37,7 @@ #include #include +#include #include "soundmgr_openal.hxx" diff --git a/simgear/structure/SGExpression.cxx b/simgear/structure/SGExpression.cxx index dc0d3270..a6776636 100644 --- a/simgear/structure/SGExpression.cxx +++ b/simgear/structure/SGExpression.cxx @@ -33,6 +33,7 @@ #include #include #include +#include // for strcmp #include diff --git a/simgear/timing/sg_time.cxx b/simgear/timing/sg_time.cxx index 9bc52c18..676251ba 100644 --- a/simgear/timing/sg_time.cxx +++ b/simgear/timing/sg_time.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include diff --git a/simgear/timing/timezone.cxx b/simgear/timing/timezone.cxx index 52811586..7f09e6c6 100644 --- a/simgear/timing/timezone.cxx +++ b/simgear/timing/timezone.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include