From c0a633ea1d9240b467640975167fbcbee576b32b Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 19 Aug 2003 02:08:16 +0000 Subject: [PATCH] Give calc_tex_coords() a more conformant name: sgCalcTexCoords() --- simgear/misc/texcoord.cxx | 16 ++++++++++++---- simgear/misc/texcoord.hxx | 2 +- simgear/scene/tgdb/obj.cxx | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/simgear/misc/texcoord.cxx b/simgear/misc/texcoord.cxx index ee66504f..3c9f762e 100644 --- a/simgear/misc/texcoord.cxx +++ b/simgear/misc/texcoord.cxx @@ -140,8 +140,15 @@ enter this in the official comments in case I forget again. :-) */ +#include + +// #include STL_IOSTREAM + #include "texcoord.hxx" +// SG_USING_STD(cout); +// SG_USING_STD(endl); + #define FG_STANDARD_TEXTURE_DIMENSION 1000.0 // meters #define MAX_TEX_COORD 8.0 @@ -149,9 +156,10 @@ enter this in the official comments in case I forget again. :-) // return the basic unshifted/unmoded texture coordinate for a lat/lon -inline Point3D basic_tex_coord( const Point3D& p, - double degree_width, double degree_height, - double scale ) +static inline Point3D basic_tex_coord( const Point3D& p, + double degree_width, + double degree_height, + double scale ) { return Point3D( p.x() * ( degree_width * scale / FG_STANDARD_TEXTURE_DIMENSION ), @@ -163,7 +171,7 @@ inline Point3D basic_tex_coord( const Point3D& p, // traverse the specified fan/strip/list of vertices and attempt to // calculate "none stretching" texture coordinates -point_list calc_tex_coords( const SGBucket& b, const point_list& geod_nodes, +point_list sgCalcTexCoords( const SGBucket& b, const point_list& geod_nodes, const int_list& fan, double scale ) { // cout << "calculating texture coordinates for a specific fan of size = " diff --git a/simgear/misc/texcoord.hxx b/simgear/misc/texcoord.hxx index a5c13f70..7c8ec0e5 100644 --- a/simgear/misc/texcoord.hxx +++ b/simgear/misc/texcoord.hxx @@ -47,7 +47,7 @@ * @param scale (default = 1.0) scaling factor * @return list of texture coordinates */ -point_list calc_tex_coords( const SGBucket& b, const point_list& geod_nodes, +point_list sgCalcTexCoords( const SGBucket& b, const point_list& geod_nodes, const int_list& fan, double scale = 1.0 ); diff --git a/simgear/scene/tgdb/obj.cxx b/simgear/scene/tgdb/obj.cxx index e26459c8..02873d8c 100644 --- a/simgear/scene/tgdb/obj.cxx +++ b/simgear/scene/tgdb/obj.cxx @@ -130,7 +130,7 @@ bool sgGenTile( const string& path, SGBucket b, geod_nodes.push_back( geod[i] ); rectangle.push_back( i ); } - point_list texs = calc_tex_coords( b, geod_nodes, rectangle, + point_list texs = sgCalcTexCoords( b, geod_nodes, rectangle, 1000.0 / tex_width ); // Allocate ssg structure -- 2.39.2