- removal of sse2 compiler flags for better compatibility
- added workings for a future flag for interpolation cache
This commit is contained in:
parent
f0d492371f
commit
d8e41495d0
|
@ -4,7 +4,7 @@ if ! $(top_builddir)
|
|||
}
|
||||
top_srcdir = $(TOP) ;
|
||||
|
||||
MGFLAGS = -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -msse2 ;
|
||||
MGFLAGS = -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse ;
|
||||
|
||||
JAMCONFIG ?= $(top_builddir)/Jamconfig ;
|
||||
include $(JAMCONFIG) ;
|
||||
|
@ -24,8 +24,6 @@ if $(USE_STLPORT_DEBUG)
|
|||
# if using streflop then add some special compiler defines
|
||||
if $(USE_STREFLOP)
|
||||
{
|
||||
# COMPILER_CFLAGS_optimize += -mfpmath=sse -msse -fsingle-precision-constant -pipe -fno-strict-aliasing $(MGFLAGS) -mieee-fp -mno-tls-direct-seg-refs ;
|
||||
# COMPILER_CXXFLAGS_optimize += -mfpmath=sse -msse -fsingle-precision-constant -frounding-math -pipe -fno-strict-aliasing $(MGFLAGS) -mieee-fp -mno-tls-direct-seg-refs ;
|
||||
CPPFLAGS += $(MGFLAGS) ;
|
||||
COMPILER_CFLAGS += $(MGFLAGS) ;
|
||||
COMPILER_CFLAGS_optimize += $(MGFLAGS) ;
|
||||
|
|
|
@ -34,6 +34,7 @@ private:
|
|||
|
||||
std::map<float, std::map<bool, Vec3f *> > cacheVertices;
|
||||
std::map<float, std::map<bool, Vec3f *> > cacheNormals;
|
||||
bool enableCache;
|
||||
|
||||
public:
|
||||
InterpolationData(const Mesh *mesh);
|
||||
|
|
|
@ -39,6 +39,8 @@ InterpolationData::InterpolationData(const Mesh *mesh){
|
|||
normals= new Vec3f[mesh->getVertexCount()];
|
||||
}
|
||||
|
||||
enableCache = true;
|
||||
|
||||
cacheVertices.clear();
|
||||
cacheNormals.clear();
|
||||
}
|
||||
|
@ -77,7 +79,7 @@ void InterpolationData::updateVertices(float t, bool cycle) {
|
|||
uint32 vertexCount= mesh->getVertexCount();
|
||||
|
||||
if(frameCount > 1) {
|
||||
|
||||
if(enableCache == true) {
|
||||
std::map<float, std::map<bool, Vec3f *> >::iterator iterFind = cacheVertices.find(t);
|
||||
if(iterFind != cacheVertices.end()) {
|
||||
std::map<bool, Vec3f *>::iterator iterFind2 = iterFind->second.find(cycle);
|
||||
|
@ -90,8 +92,7 @@ void InterpolationData::updateVertices(float t, bool cycle) {
|
|||
}
|
||||
}
|
||||
cacheVertices[t][cycle] = new Vec3f[vertexCount];
|
||||
|
||||
|
||||
}
|
||||
|
||||
const Vec3f *meshVertices= mesh->getVertices();
|
||||
|
||||
|
@ -110,9 +111,11 @@ void InterpolationData::updateVertices(float t, bool cycle) {
|
|||
for(uint32 j=0; j<vertexCount; ++j){
|
||||
vertices[j]= meshVertices[prevFrameBase+j].lerp(localT, meshVertices[nextFrameBase+j]);
|
||||
|
||||
if(enableCache == true) {
|
||||
cacheVertices[t][cycle][j] = vertices[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InterpolationData::updateNormals(float t, bool cycle){
|
||||
|
@ -122,7 +125,7 @@ void InterpolationData::updateNormals(float t, bool cycle){
|
|||
uint32 vertexCount= mesh->getVertexCount();
|
||||
|
||||
if(frameCount > 1) {
|
||||
|
||||
if(enableCache == true) {
|
||||
std::map<float, std::map<bool, Vec3f *> >::iterator iterFind = cacheNormals.find(t);
|
||||
if(iterFind != cacheNormals.end()) {
|
||||
std::map<bool, Vec3f *>::iterator iterFind2 = iterFind->second.find(cycle);
|
||||
|
@ -135,7 +138,7 @@ void InterpolationData::updateNormals(float t, bool cycle){
|
|||
}
|
||||
}
|
||||
cacheNormals[t][cycle] = new Vec3f[vertexCount];
|
||||
|
||||
}
|
||||
|
||||
const Vec3f *meshNormals= mesh->getNormals();
|
||||
|
||||
|
@ -154,9 +157,11 @@ void InterpolationData::updateNormals(float t, bool cycle){
|
|||
for(uint32 j=0; j<vertexCount; ++j){
|
||||
normals[j]= meshNormals[prevFrameBase+j].lerp(localT, meshNormals[nextFrameBase+j]);
|
||||
|
||||
if(enableCache == true) {
|
||||
cacheNormals[t][cycle][j] = normals[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}}//end namespace
|
||||
|
|
Loading…
Reference in New Issue