Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af8b27032f | ||
|
|
f76b72e2f3 | ||
|
|
59512aea1f | ||
|
|
96618a2e26 | ||
|
|
635f460dd5 | ||
|
|
36316e8859 |
+14
-6
@@ -165,6 +165,11 @@ if (MSVC)
|
|||||||
else (EXISTS ${TEST_3RDPARTY_DIR})
|
else (EXISTS ${TEST_3RDPARTY_DIR})
|
||||||
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
|
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
|
||||||
endif (EXISTS ${TEST_3RDPARTY_DIR})
|
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)
|
else (MSVC)
|
||||||
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
|
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
@@ -440,15 +445,18 @@ if (CLANG)
|
|||||||
# fix Boost compilation :(
|
# fix Boost compilation :(
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
# override CMake default RelWithDebInfo flags.
|
||||||
set(CMAKE_C_FLAGS
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
|
||||||
"${CMAKE_C_FLAGS} -O0 -fno-omit-frame-pointer -fno-inline-functions")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
|
||||||
set(CMAKE_CXX_FLAGS
|
|
||||||
"${CMAKE_CXX_FLAGS} -O0 -fno-omit-frame-pointer -fno-inline-functions")
|
if (ENABLE_SIMD)
|
||||||
elseif (ENABLE_SIMD)
|
|
||||||
if (X86 OR X86_64)
|
if (X86 OR X86_64)
|
||||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize")
|
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")
|
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()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -947,10 +947,18 @@ SGRect<int> intersectRect(const SGRect<int>& a, const SGRect<int>& b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
image->setColor(color, x, y);
|
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()
|
void Image::allocateImage()
|
||||||
{
|
{
|
||||||
osg::Image* image = new osg::Image;
|
osg::Image* image = new osg::Image;
|
||||||
|
|||||||
@@ -115,6 +115,11 @@ namespace canvas
|
|||||||
|
|
||||||
void setPixel(int x, int y, const osg::Vec4& color);
|
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;
|
osg::ref_ptr<osg::Image> getImage() const;
|
||||||
|
|
||||||
// void setRow(int row, int offset, )
|
// void setRow(int row, int offset, )
|
||||||
|
|||||||
@@ -503,7 +503,7 @@ static void setMember(naContext ctx, naRef obj, naRef fld, naRef value)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!IS_HASH(obj)) ERR(ctx, "non-objects have no members");
|
if(!IS_HASH(obj)) naRuntimeError(ctx, "non-object does not have member: %s", naStr_data(fld));
|
||||||
naHash_set(obj, fld, value);
|
naHash_set(obj, fld, value);
|
||||||
ctx->opTop -= 2;
|
ctx->opTop -= 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,9 +113,6 @@ protected:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// disabling old-syle texture compression in favour of the
|
|
||||||
// texture-cache
|
|
||||||
#if 0
|
|
||||||
class SGTexCompressionVisitor : public SGTextureStateAttributeVisitor {
|
class SGTexCompressionVisitor : public SGTextureStateAttributeVisitor {
|
||||||
public:
|
public:
|
||||||
virtual void apply(int, StateSet::RefAttributePair& refAttr)
|
virtual void apply(int, StateSet::RefAttributePair& refAttr)
|
||||||
@@ -146,7 +143,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
class SGTexDataVarianceVisitor : public SGTextureStateAttributeVisitor {
|
class SGTexDataVarianceVisitor : public SGTextureStateAttributeVisitor {
|
||||||
public:
|
public:
|
||||||
@@ -644,12 +640,8 @@ osg::Node* OptimizeModelPolicy::optimize(osg::Node* node,
|
|||||||
SGTexDataVarianceVisitor dataVarianceVisitor;
|
SGTexDataVarianceVisitor dataVarianceVisitor;
|
||||||
node->accept(dataVarianceVisitor);
|
node->accept(dataVarianceVisitor);
|
||||||
|
|
||||||
// disabling old-syle texture compression in favour of the
|
|
||||||
// texture-cache
|
|
||||||
#if 0
|
|
||||||
SGTexCompressionVisitor texComp;
|
SGTexCompressionVisitor texComp;
|
||||||
node->accept(texComp);
|
node->accept(texComp);
|
||||||
#endif
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,29 +69,29 @@ SGSceneFeatures::instance()
|
|||||||
void
|
void
|
||||||
SGSceneFeatures::applyTextureCompression(osg::Texture* texture) const
|
SGSceneFeatures::applyTextureCompression(osg::Texture* texture) const
|
||||||
{
|
{
|
||||||
// disable older texture-compression, since it interacts confusingly
|
// if the texture cache is active, always use the file data format
|
||||||
// with the the runtime texture-cache. We always want to use
|
if (_TextureCacheActive && _TextureCacheCompressionActive) {
|
||||||
// 'USE_IMAGE_DATA_FORMAT' when the texture-cache is active, since we
|
texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
|
||||||
// decided whether to compress (or not) prior to this point.
|
} else {
|
||||||
#if 0
|
// keep the older texture compression working, some people need it
|
||||||
switch (_textureCompression) {
|
switch (_textureCompression) {
|
||||||
case UseARBCompression:
|
case UseARBCompression:
|
||||||
texture->setInternalFormatMode(osg::Texture::USE_ARB_COMPRESSION);
|
texture->setInternalFormatMode(osg::Texture::USE_ARB_COMPRESSION);
|
||||||
break;
|
break;
|
||||||
case UseDXT1Compression:
|
case UseDXT1Compression:
|
||||||
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT1_COMPRESSION);
|
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT1_COMPRESSION);
|
||||||
break;
|
break;
|
||||||
case UseDXT3Compression:
|
case UseDXT3Compression:
|
||||||
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT3_COMPRESSION);
|
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT3_COMPRESSION);
|
||||||
break;
|
break;
|
||||||
case UseDXT5Compression:
|
case UseDXT5Compression:
|
||||||
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT5_COMPRESSION);
|
texture->setInternalFormatMode(osg::Texture::USE_S3TC_DXT5_COMPRESSION);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
|
texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
Reference in New Issue
Block a user