From 7be20f617bbd80167ee83d42d5ccc4323297dadd Mon Sep 17 00:00:00 2001 From: haasj <juergen.haas@unibas.ch> Date: Tue, 11 Jan 2011 18:25:56 +0100 Subject: [PATCH] win patches for gfx and mol; forcing ldt to be linked dynamically;fixing recursion issue with != operator in chemclass --- modules/geom/src/vec3.hh | 2 +- modules/gfx/src/glext_include.hh | 3 ++- modules/gfx/src/impl/cartoon_renderer.cc | 2 +- modules/gfx/src/offscreen_buffer.hh | 2 +- modules/gfx/src/scene.cc | 8 ++++++-- modules/mol/alg/src/ldt.cc | 4 ++++ modules/mol/base/src/chem_class.hh | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/geom/src/vec3.hh b/modules/geom/src/vec3.hh index 4d139a321..47b301fb3 100644 --- a/modules/geom/src/vec3.hh +++ b/modules/geom/src/vec3.hh @@ -208,7 +208,7 @@ public: Vec3List& operator=(const Vec3List& rhs) { - *this=rhs; + base_type::operator=(rhs); return *this; } Mat3 GetInertia() const; diff --git a/modules/gfx/src/glext_include.hh b/modules/gfx/src/glext_include.hh index 4ac3d6ec8..308103f42 100644 --- a/modules/gfx/src/glext_include.hh +++ b/modules/gfx/src/glext_include.hh @@ -35,7 +35,7 @@ # if !defined(__APPLE__) # include <ost/gfx/GL/glew.h> # endif -# if defined(_WIN32) +# if defined(_MSC_VER) # include <ost/gfx/GL/wglew.h> # endif #endif @@ -45,6 +45,7 @@ #if defined(__APPLE__) // On all MacOS X version we support, OpenGL 2.0 is available, so it's safe to // hardcode the value here... +//same for windows vista and above, XP only has 1.1 #define OST_GL_VERSION_2_0 1 #else #ifdef GLEW_VERSION_2_0 diff --git a/modules/gfx/src/impl/cartoon_renderer.cc b/modules/gfx/src/impl/cartoon_renderer.cc index b52d496f0..1c5bc481b 100644 --- a/modules/gfx/src/impl/cartoon_renderer.cc +++ b/modules/gfx/src/impl/cartoon_renderer.cc @@ -109,7 +109,7 @@ void CartoonRenderer::PrepareRendering(const BackboneTrace& subset, unsigned int tmp_count=0; #endif for(SplineEntryListList::const_iterator sit=tmp_sll.begin();sit!=tmp_sll.end();++sit) { - if(sit->size()==2 and sit->at(0).type==6) { + if((sit->size()==2) && (sit->at(0).type==6)) { // don't intpol cylinders spline_list_list.push_back(*sit); } else { diff --git a/modules/gfx/src/offscreen_buffer.hh b/modules/gfx/src/offscreen_buffer.hh index df2ca183f..8270d1579 100644 --- a/modules/gfx/src/offscreen_buffer.hh +++ b/modules/gfx/src/offscreen_buffer.hh @@ -62,7 +62,7 @@ public: #include "impl/glx_offscreen_buffer.hh" #elif defined(__APPLE__) #include "impl/cgl_offscreen_buffer.hh" -#elif defined(_WIN32) +#elif defined(_MSC_VER) #include "impl/wgl_offscreen_buffer.hh" #else #error platform not found for offscreen rendering diff --git a/modules/gfx/src/scene.cc b/modules/gfx/src/scene.cc index 6166f009a..cdbec3ef4 100644 --- a/modules/gfx/src/scene.cc +++ b/modules/gfx/src/scene.cc @@ -385,7 +385,9 @@ void Scene::InitGL(bool full) glDisable(GL_LINE_SMOOTH); glDisable(GL_POINT_SMOOTH); glDisable(GL_POLYGON_SMOOTH); - glEnable(GL_MULTISAMPLE); +#if defined(OST_GL_VERSION_2_0) + glDisable(GL_MULTISAMPLE); +#endif } else { glEnable(GL_LINE_SMOOTH); glDisable(GL_POINT_SMOOTH); @@ -946,7 +948,7 @@ void Scene::OnInput(const InputEvent& e) } } else if(e.GetCommand()==INPUT_COMMAND_TRANSZ) { float currz=transform_.GetTrans()[2]; - float delta=currz*pow(1.01,-e.GetDelta())-currz; + float delta=currz*pow(1.01f,-e.GetDelta())-currz; transform_.ApplyZAxisTranslation(delta); SetNearFar(znear_-delta,zfar_-delta); } else if(e.GetCommand()==INPUT_COMMAND_SLABN) { @@ -1878,7 +1880,9 @@ void Scene::render_stereo() glDisable(GL_BLEND); glDisable(GL_LINE_SMOOTH); glDisable(GL_POINT_SMOOTH); +#if defined(OST_GL_VERSION_2_0) glDisable(GL_MULTISAMPLE); +#endif glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); diff --git a/modules/mol/alg/src/ldt.cc b/modules/mol/alg/src/ldt.cc index eed10f53f..109711672 100644 --- a/modules/mol/alg/src/ldt.cc +++ b/modules/mol/alg/src/ldt.cc @@ -16,12 +16,16 @@ // along with this library; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA //------------------------------------------------------------------------------ +#if defined (_MSC_VER) +#define BOOST_ALL_DYN_LINK 1 +#endif #include <boost/program_options.hpp> #include <ost/mol/alg/local_dist_test.hh> #include <ost/mol/alg/filter_clashes.hh> #include <ost/io/mol/pdb_reader.hh> #include <ost/io/io_exception.hh> #include <ost/conop/conop.hh> + using namespace ost; using namespace ost::io; using namespace ost::mol; diff --git a/modules/mol/base/src/chem_class.hh b/modules/mol/base/src/chem_class.hh index 43bdef9a8..de74bcabc 100644 --- a/modules/mol/base/src/chem_class.hh +++ b/modules/mol/base/src/chem_class.hh @@ -48,7 +48,7 @@ struct DLLEXPORT ChemClass { } bool operator!=(const ChemClass& cc) const { - return this->operator!=(cc); + return !this->operator==(cc); } bool IsPeptideLinking() const { -- GitLab