Compare commits

...

7 Commits

Author SHA1 Message Date
Frederic Bouvier
fe2fb8e6ae Fix issue #392: mktime takes a localtime as input. Assumption that if HAVE_DAYLIGHT is missing imply that mktime takes a gmt time is wrong (sg_time.cxx, line 482) 2011-08-06 16:28:34 +02:00
Frederic Bouvier
4793166abf Fix a typo 2011-08-06 16:28:21 +02:00
ThorstenB
4494eb061e Improved CMake support for libsvn
Added missing CMake defines for SVN_CLIENT.
Don't detect libsvn without APR.
When installed, enable libsvn support by default (same as for automake).
When enabled, provide libsvn include dir to libtsync.
gitignore temporary CMake files
2011-08-04 22:40:21 +02:00
ThorstenB
8ed9e01c63 Ove Kåven: Fix property refcounting for particles 2011-08-01 19:53:59 +02:00
ThorstenB
55fc86741b #232: resurrect the "point sprites for runway lights" switch
Automatic GL/OSG feature detection still not working, since we don't have
a "context" - but at least the manual switch works (on start-up only).
2011-07-31 14:18:35 +02:00
ThorstenB
9c0cafb82c Fix locale setting for Windows 2011-07-19 22:01:37 +02:00
ThorstenB
ede50bec49 Clean solution for locale problem.
Changing and reverting the locale isn't thread-safe. Instead, setup the
environment to ensure the active locale sticks to default "C" locale at
any time.
2011-07-19 22:01:23 +02:00
11 changed files with 77 additions and 45 deletions

1
.gitignore vendored
View File

@@ -21,5 +21,6 @@ CMakeCache.txt
CPackConfig.cmake
CPackSourceConfig.cmake
cmake_uninstall.cmake
CTestTestfile.cmake
install_manifest.txt

View File

@@ -20,7 +20,7 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
option(SIMGEAR_SHARED "Set to ON to build SimGear as a shared library/framework" OFF)
option(SIMGEAR_HEADLESS "Set to ON to build SimGear with GUI/graphics support" OFF)
option(JPEG_FACTORY "Enable JPEG-factory support" OFF)
option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" OFF)
option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" ON)
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
@@ -71,11 +71,13 @@ endif()
if(ENABLE_LIBSVN)
find_package(SvnClient)
if(LIBSVN_FOUND)
message(STATUS "libsvn found, enabling in SimGear")
set(HAVE_SVN_CLIENT_H 1)
set(HAVE_LIBSVN_CLIENT_1 1)
else()
message(STATUS "Missing libsvn, unable to enable SVN in SimGear")
endif(LIBSVN_FOUND)
endif(ENABLE_LIBSVN)

View File

@@ -22,27 +22,30 @@ else(HAVE_APR_CONFIG)
message(STATUS "apr-1-config not found, implement manual search for APR")
endif(HAVE_APR_CONFIG)
find_path(LIBSVN_INCLUDE_DIR svn_client.h
HINTS
$ENV{LIBSVN_DIR}
PATH_SUFFIXES include/subversion-1
PATHS
/usr/local
/usr
/opt
)
if(HAVE_APR_CONFIG)
find_path(LIBSVN_INCLUDE_DIR svn_client.h
HINTS
$ENV{LIBSVN_DIR}
PATH_SUFFIXES include/subversion-1
PATHS
/usr/local
/usr
/opt
)
check_library_exists(svn_client-1 svn_client_checkout "" HAVE_LIB_SVNCLIENT)
check_library_exists(svn_subr-1 svn_cmdline_init "" HAVE_LIB_SVNSUBR)
check_library_exists(svn_ra-1 svn_ra_initialize "" HAVE_LIB_SVNRA)
check_library_exists(svn_client-1 svn_client_checkout "" HAVE_LIB_SVNCLIENT)
check_library_exists(svn_subr-1 svn_cmdline_init "" HAVE_LIB_SVNSUBR)
check_library_exists(svn_ra-1 svn_ra_initialize "" HAVE_LIB_SVNRA)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSVN DEFAULT_MSG
HAVE_LIB_SVNSUBR
HAVE_LIB_SVNCLIENT
HAVE_LIB_SVNRA
LIBSVN_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSVN DEFAULT_MSG
HAVE_LIB_SVNSUBR
HAVE_LIB_SVNCLIENT
HAVE_LIB_SVNRA
LIBSVN_INCLUDE_DIR)
if(LIBSVN_FOUND)
set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS})
endif(LIBSVN_FOUND)
endif(HAVE_APR_CONFIG)
if(LIBSVN_FOUND)
set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS})
endif(LIBSVN_FOUND)

View File

@@ -99,7 +99,7 @@ public:
private:
static osg::Vec3 gravity;
static osg::Vec3 wind;
const SGPropertyNode* modelRoot;
SGConstPropertyNode_ptr modelRoot;
static SGConstPropertyNode_ptr enabledNode;
static bool enabled;
};

View File

@@ -204,21 +204,26 @@ Effect* getLightEffect(float size, const Vec3& attenuation,
Pass *combinedPass = clone(spritePass, CopyOp::SHALLOW_COPY);
combinedPass->setAttributeAndModes(point);
Effect* effect = new Effect;
std::vector<std::string> combinedExtensions;
combinedExtensions.push_back("GL_ARB_point_sprite");
combinedExtensions.push_back("GL_ARB_point_parameters");
Technique* combinedTniq = new Technique;
combinedTniq->passes.push_back(combinedPass);
combinedTniq->setGLExtensionsPred(2.0, combinedExtensions);
effect->techniques.push_back(combinedTniq);
std::vector<std::string> spriteExtensions;
spriteExtensions.push_back(combinedExtensions.front());
Technique* spriteTniq = new Technique;
spriteTniq->passes.push_back(spritePass);
spriteTniq->setGLExtensionsPred(2.0, spriteExtensions);
effect->techniques.push_back(spriteTniq);
std::vector<std::string> parameterExtensions;
parameterExtensions.push_back(combinedExtensions.back());
if (SGSceneFeatures::instance()->getEnablePointSpriteLights())
{
std::vector<std::string> combinedExtensions;
combinedExtensions.push_back("GL_ARB_point_sprite");
combinedExtensions.push_back("GL_ARB_point_parameters");
Technique* combinedTniq = new Technique;
combinedTniq->passes.push_back(combinedPass);
combinedTniq->setGLExtensionsPred(2.0, combinedExtensions);
effect->techniques.push_back(combinedTniq);
std::vector<std::string> spriteExtensions;
spriteExtensions.push_back(combinedExtensions.front());
Technique* spriteTniq = new Technique;
spriteTniq->passes.push_back(spritePass);
spriteTniq->setGLExtensionsPred(2.0, spriteExtensions);
effect->techniques.push_back(spriteTniq);
parameterExtensions.push_back(combinedExtensions.back());
}
Technique* parameterTniq = new Technique;
parameterTniq->passes.push_back(attenuationPass);
parameterTniq->setGLExtensionsPred(1.4, parameterExtensions);

View File

@@ -8,4 +8,15 @@ set(SOURCES
terrasync.cxx
)
if(LIBSVN_FOUND)
add_definitions(${APR_CFLAGS})
IF(APPLE)
set_property(SOURCE terrasync.cxx PROPERTY COMPILE_FLAGS "-iwithsysroot ${LIBSVN_INCLUDE_DIR}")
ELSE()
include_directories(${LIBSVN_INCLUDE_DIR})
ENDIF(APPLE)
endif()
simgear_component(tsync scene/tsync "${SOURCES}" "${HEADERS}")

View File

@@ -569,16 +569,18 @@ int SGTerraSync::SvnThread::svnClientSetup(void)
// not supported under msvc 7.1 ( code inside svn_cmdline_init )
if (svn_cmdline_init("terrasync", 0) != EXIT_SUCCESS)
return EXIT_FAILURE;
// revert locale setting
setlocale(LC_ALL,"C");
#else
/* svn_cmdline_init configures the locale. Setup environment to ensure the
* default "C" locale remains active, since fgfs isn't locale aware - especially
* requires "." as decimal point in strings containing floating point varibales. */
setenv("LC_ALL", "C", 1);
if (svn_cmdline_init("terrasync", stderr) != EXIT_SUCCESS)
return EXIT_FAILURE;
#endif
/* Oh no! svn_cmdline_init configures the locale - affecting numeric output
* formats (i.e. sprintf("%f", ...)). fgfs relies on "C" locale in many places
* (including assumptions on required sprintf buffer sizes). Things go horribly
* wrong when the locale is changed to anything else but "C". Might be enough to
* revert LC_NUMERIC locale - but we'll do a complete revert for now...*/
setlocale(LC_ALL,"C");
apr_pool_t *pool;
apr_pool_create(&pool, NULL);

View File

@@ -46,6 +46,10 @@ public:
void setEnablePointSpriteLights(bool enable)
{ _pointSpriteLights = enable; }
bool getEnablePointSpriteLights() const
{
return _pointSpriteLights;
}
bool getEnablePointSpriteLights(unsigned contextId) const
{
if (!_pointSpriteLights)

View File

@@ -151,6 +151,7 @@
#define HAVE_MEMORY_H 1
#define HAVE_MEMCPY 1
#define HAVE_DAYLIGHT 1
#define GLUT_H <GL/glut.h>

View File

@@ -12,5 +12,8 @@
#cmakedefine HAVE_ISNAN
#cmakedefine HAVE_WINDOWS_H
#cmakedefine HAVE_SVN_CLIENT_H
#cmakedefine HAVE_LIBSVN_CLIENT_1
// set if building headless (no OSG or OpenGL libs)
#cmakedefine NO_OPENSCENEGRAPH_INTERFACE

View File

@@ -538,7 +538,7 @@ time_t sgTimeGetGMT(int year, int month, int day, int hour, int min, int sec)
if ( daylight > 0 ) {
daylight = 1;
} else if ( daylight < 0 ) {
SG_LOG( SG_EVENT, FG_WARN,
SG_LOG( SG_EVENT, SG_WARN,
"OOOPS, problem in sg_time.cxx, no daylight savings info." );
}