Compare commits

..
Author SHA1 Message Date
James Turner bd93fb279b new version: 2020.2.0 2020-04-27 09:29:55 +01:00
8 changed files with 51 additions and 78 deletions
+7 -15
View File
@@ -165,11 +165,6 @@ if (MSVC)
else (EXISTS ${TEST_3RDPARTY_DIR})
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
endif (EXISTS ${TEST_3RDPARTY_DIR})
# override CMake default RelWithDebInfo flags. This is important to ensure
# good performance
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /O2 /Ob2 /D NDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Zi /O2 /Ob2 /D NDEBUG")
else (MSVC)
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
endif (MSVC)
@@ -227,7 +222,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD
endif()
find_package(Boost REQUIRED)
set (BOOST_CXX_FLAGS "-DBOOST_BIMAP_DISABLE_SERIALIZATION -DBOOST_NO_STDLIB_CONFIG")
set (BOOST_CXX_FLAGS "-DBOOST_BIMAP_DISABLE_SERIALIZATION")
include(BoostTestTargets)
if(SIMGEAR_HEADLESS)
@@ -445,18 +440,15 @@ if (CLANG)
# fix Boost compilation :(
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
# override CMake default RelWithDebInfo flags.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
if (ENABLE_SIMD)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -O0 -fno-omit-frame-pointer -fno-inline-functions")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -O0 -fno-omit-frame-pointer -fno-inline-functions")
elseif (ENABLE_SIMD)
if (X86 OR X86_64)
set(CMAKE_C_FLAGS_RELEASE "-O3 -msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize")
# propogate to the RelWithDebInfo flags
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g -DNDEBUG")
endif()
endif()
endif()
+2 -10
View File
@@ -947,18 +947,10 @@ SGRect<int> intersectRect(const SGRect<int>& a, const SGRect<int>& b)
}
image->setColor(color, x, y);
auto c = getCanvas().lock();
c->enableRendering(true); // force a repaint
}
void Image::dirtyPixels()
{
osg::ref_ptr<osg::Image> image = _texture->getImage();
if (!image)
return;
image->dirty();
auto c = getCanvas().lock();
c->enableRendering(true); // force a repaint
}
void Image::allocateImage()
{
osg::Image* image = new osg::Image;
-5
View File
@@ -115,11 +115,6 @@ namespace canvas
void setPixel(int x, int y, const osg::Vec4& color);
/**
* mark the image pixels as modified, so the canvas is re-painted
*/
void dirtyPixels();
osg::ref_ptr<osg::Image> getImage() const;
// void setRow(int row, int offset, )
+1 -1
View File
@@ -503,7 +503,7 @@ static void setMember(naContext ctx, naRef obj, naRef fld, naRef value)
return;
}
if(!IS_HASH(obj)) naRuntimeError(ctx, "non-object does not have member: %s", naStr_data(fld));
if(!IS_HASH(obj)) ERR(ctx, "non-objects have no members");
naHash_set(obj, fld, value);
ctx->opTop -= 2;
}
+8
View File
@@ -113,6 +113,9 @@ protected:
}
};
// disabling old-syle texture compression in favour of the
// texture-cache
#if 0
class SGTexCompressionVisitor : public SGTextureStateAttributeVisitor {
public:
virtual void apply(int, StateSet::RefAttributePair& refAttr)
@@ -143,6 +146,7 @@ public:
}
}
};
#endif
class SGTexDataVarianceVisitor : public SGTextureStateAttributeVisitor {
public:
@@ -640,8 +644,12 @@ osg::Node* OptimizeModelPolicy::optimize(osg::Node* node,
SGTexDataVarianceVisitor dataVarianceVisitor;
node->accept(dataVarianceVisitor);
// disabling old-syle texture compression in favour of the
// texture-cache
#if 0
SGTexCompressionVisitor texComp;
node->accept(texComp);
#endif
return node;
}
+9 -23
View File
@@ -136,19 +136,11 @@ osg::Vec2d eventToWindowCoords(const osgGA::GUIEventAdapter& ea)
virtual void update(double dt, int keyModState)
{
SG_UNUSED(keyModState);
if (_condition && !_condition->test()) {
return;
}
if (!_condition || _condition->test()) {
SG_UNUSED(keyModState);
if (!_repeatable)
return;
if (!_repeatable)
return;
const bool zeroInterval = (_repeatInterval <= 0.0);
if (zeroInterval) {
// fire once per frame
fireBindingList(_bindingsDown);
} else {
_repeatTime += dt;
while (_repeatInterval < _repeatTime) {
_repeatTime -= _repeatInterval;
@@ -686,18 +678,12 @@ public:
if (_hasDragged) {
return;
}
const bool zeroInterval = (_repeatInterval <= 0.0);
if (zeroInterval) {
// fire once per frame
_repeatTime += dt;
while (_repeatInterval < _repeatTime) {
_repeatTime -= _repeatInterval;
fire(keyModState & osgGA::GUIEventAdapter::MODKEY_SHIFT, _direction);
} else {
_repeatTime += dt;
while (_repeatInterval < _repeatTime) {
_repeatTime -= _repeatInterval;
fire(keyModState & osgGA::GUIEventAdapter::MODKEY_SHIFT, _direction);
} // of repeat iteration
}
} // of repeat iteration
}
bool hover( const osg::Vec2d& windowPos, const Info& ) override
+23 -23
View File
@@ -69,29 +69,29 @@ SGSceneFeatures::instance()
void
SGSceneFeatures::applyTextureCompression(osg::Texture* texture) const
{
// if the texture cache is active, always use the file data format
if (_TextureCacheActive && _TextureCacheCompressionActive) {
texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
} else {
// keep the older texture compression working, some people need it
switch (_textureCompression) {
case UseARBCompression:
texture->setInternalFormatMode(osg::Texture::USE_ARB_COMPRESSION);
break;
case UseDXT1Compression:
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT1_COMPRESSION);
break;
case UseDXT3Compression:
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT3_COMPRESSION);
break;
case UseDXT5Compression:
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT5_COMPRESSION);
break;
default:
texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
break;
}
}
// disable older texture-compression, since it interacts confusingly
// with the the runtime texture-cache. We always want to use
// 'USE_IMAGE_DATA_FORMAT' when the texture-cache is active, since we
// decided whether to compress (or not) prior to this point.
#if 0
switch (_textureCompression) {
case UseARBCompression:
texture->setInternalFormatMode(osg::Texture::USE_ARB_COMPRESSION);
break;
case UseDXT1Compression:
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT1_COMPRESSION);
break;
case UseDXT3Compression:
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT3_COMPRESSION);
break;
case UseDXT5Compression:
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT5_COMPRESSION);
break;
default:
texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
break;
}
#endif
}
bool
+1 -1
View File
@@ -1 +1 @@
2020.1.3
2020.2.0