From e20075bffbbe1f3aaa9cc149953525a7e855f496 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 4 Dec 2009 07:00:37 +0000 Subject: [PATCH] Fix compilation on 64-bit platforms Set init_done in get_version --- source/extension.cpp | 2 ++ source/object.cpp | 4 ++-- source/technique.cpp | 2 +- source/vertexformat.cpp | 12 +++++++----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/source/extension.cpp b/source/extension.cpp index ba7dd402..6383cd3c 100644 --- a/source/extension.cpp +++ b/source/extension.cpp @@ -76,6 +76,8 @@ const Version &get_gl_version() init_version_1_2(); if(combined>=0x103) init_version_1_3(); + + init_done = true; } return version; diff --git a/source/object.cpp b/source/object.cpp index 2026e3d5..a23aa433 100644 --- a/source/object.cpp +++ b/source/object.cpp @@ -111,7 +111,7 @@ void Object::finish_render(const ObjectPass *pass) const void Object::render_instance(const ObjectInstance &inst, const Tag &tag) const { inst.setup_render(tag); - unsigned lod=min(inst.get_level_of_detail(), meshes.size()-1); + unsigned lod=min(inst.get_level_of_detail(), meshes.size()-1); meshes[lod]->draw(); inst.finish_render(tag); } @@ -169,7 +169,7 @@ void Object::Loader::shader_texture(const string &n) if(!obj.technique) throw InvalidState("Can't specify shader textures without a Technique"); - unsigned eqsign=n.find('='); + string::size_type eqsign=n.find('='); if(eqsign==string::npos) throw InvalidParameterValue("Must specify texture slot name"); diff --git a/source/technique.cpp b/source/technique.cpp index 4d2377a3..74cd6c31 100644 --- a/source/technique.cpp +++ b/source/technique.cpp @@ -119,7 +119,7 @@ void Technique::Loader::shader(const string &n) void Technique::Loader::shader_texture(const string &n) { - unsigned eqsign=n.find('='); + string::size_type eqsign=n.find('='); if(eqsign!=string::npos) { tech.textures.push_back(coll.get(n.substr(eqsign+1))); diff --git a/source/vertexformat.cpp b/source/vertexformat.cpp index 91084bcc..b9bd7b94 100644 --- a/source/vertexformat.cpp +++ b/source/vertexformat.cpp @@ -10,6 +10,8 @@ Distributed under the LGPL #include "except.h" #include "vertexformat.h" +using namespace std; + namespace Msp { namespace GL { @@ -102,16 +104,16 @@ uint get_stride(const VertexFormat &f) return stride; } -std::istream &operator>>(std::istream &in, VertexFormat &f) +istream &operator>>(istream &in, VertexFormat &f) { - std::string str; + string str; in>>str; unsigned start=0; while(1) { - unsigned underscore=str.find('_', start); + string::size_type underscore=str.find('_', start); bool fail=false; if(!str.compare(start, underscore-start, "VERTEX2")) f=(f,VERTEX2); @@ -162,11 +164,11 @@ std::istream &operator>>(std::istream &in, VertexFormat &f) if(fail) { - in.setstate(std::ios_base::failbit); + in.setstate(ios_base::failbit); break; } - if(underscore==std::string::npos) + if(underscore==string::npos) break; start=underscore+1; } -- 2.43.0