Commit 02007caa authored by Jan Möbius's avatar Jan Möbius

Fixed more float conversions

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17158 383ad7c9-94d9-4d36-a494-682f7c89f535
parent debff72c
......@@ -450,7 +450,7 @@ void GLCone::addToRenderer(IRenderer* _renderer,
// compute rotation matrix mAlign
// such that vBindDir rotates to _upDir
ACG::GLMatrixd mAlign;
ACG::GLMatrixf mAlign;
mAlign.identity();
ACG::Vec3f vBindDir(0.0f, 0.0f, 1.0f);
......
......@@ -170,8 +170,8 @@ GlutExaminer::setup_scene(const Vec3f& _center, float _radius)
void
GlutExaminer::view_all()
{
ACG::Vec3f t = (-(glstate_.modelview().transform_point(center_))
- Vec3f(0.0f, 0.0f, 3.0f*radius_));
ACG::Vec3d t = (-(glstate_.modelview().transform_point(center_))
- Vec3d(0.0f, 0.0f, 3.0f*radius_));
glstate_.translate(t[0], t[1], t[2], MULT_FROM_LEFT);
}
......@@ -182,7 +182,7 @@ GlutExaminer::view_all()
double
GlutExaminer::measure_fps()
{
const Vec3f t = glstate_.modelview().transform_point(center_);
const Vec3d t = glstate_.modelview().transform_point(center_);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
......
......@@ -94,7 +94,7 @@ protected:
protected:
GLTrackball trackball_;
Vec3f center_;
Vec3d center_;
float radius_;
};
......
......@@ -182,7 +182,7 @@ drawCoordsys( GLState& _state) {
void CoordsysNode::drawCoordsys(IRenderer* _renderer, RenderObject* _baseRO)
{
// save model view matrix
GLMatrixf mModelView = _baseRO->modelview;
const GLMatrixd mModelView = _baseRO->modelview;
const double arrowLength = 0.03;
......
......@@ -75,7 +75,7 @@ ShaderNode::ShaderNode( BaseNode* _parent,
}
ShaderNode::~ShaderNode() {
for ( std::map<unsigned int,ShaderInfo>::iterator it = shaders.begin(); it != shaders.end(); ++it) {
for ( std::map<size_t,ShaderInfo>::iterator it = shaders.begin(); it != shaders.end(); ++it) {
if ( it->second.initialized ) {
if ( it->second.program != 0 )
......@@ -100,7 +100,7 @@ hasShader( DrawModes::DrawMode _drawmode, bool _pick ) {
return false;
}
std::map<unsigned int,ShaderInfo>::iterator it;
std::map<size_t,ShaderInfo>::iterator it;
if ( _pick ) {
it = pickShaders.find(_drawmode.getIndex());
......@@ -121,7 +121,7 @@ hasShader( DrawModes::DrawMode _drawmode, bool _pick ) {
void
ShaderNode::enter(GLState& /*_state*/, const DrawModes::DrawMode& _drawmode )
{
for ( std::map<unsigned int,ShaderInfo>::iterator it = shaders.begin(); it != shaders.end(); ++it) {
for ( std::map<size_t,ShaderInfo>::iterator it = shaders.begin(); it != shaders.end(); ++it) {
if ( _drawmode.containsAtomicDrawMode(it->first) && it->second.initialized ) {
it->second.program->use();
}
......@@ -133,7 +133,7 @@ ShaderNode::enter(GLState& /*_state*/, const DrawModes::DrawMode& _drawmode )
void
ShaderNode::enterPick(GLState& /*_state*/, PickTarget /*_target*/, const DrawModes::DrawMode& _drawmode )
{
for ( std::map<unsigned int,ShaderInfo>::iterator it = pickShaders.begin(); it != pickShaders.end(); ++it) {
for ( std::map<size_t,ShaderInfo>::iterator it = pickShaders.begin(); it != pickShaders.end(); ++it) {
if ( _drawmode.containsAtomicDrawMode(it->first) && it->second.initialized ) {
it->second.program->use();
}
......@@ -149,7 +149,7 @@ ShaderNode::vertexShaderName(DrawModes::DrawMode _drawmode, bool _pick) {
return std::string("");
}
std::map<unsigned int,ShaderInfo>::iterator it;
std::map<size_t,ShaderInfo>::iterator it;
if ( _pick ) {
it = pickShaders.find(_drawmode.getIndex());
......@@ -176,7 +176,7 @@ ShaderNode::fragmentShaderName(DrawModes::DrawMode _drawmode, bool _pick) {
return std::string("");
}
std::map<unsigned int,ShaderInfo>::iterator it;
std::map<size_t,ShaderInfo>::iterator it;
if ( _pick ) {
it = pickShaders.find(_drawmode.getIndex());
......@@ -200,7 +200,7 @@ ShaderNode::fragmentShaderName(DrawModes::DrawMode _drawmode, bool _pick) {
void ShaderNode::leave(GLState& /*_state*/, const DrawModes::DrawMode& _drawmode )
{
for ( std::map<unsigned int,ShaderInfo>::iterator it = shaders.begin(); it != shaders.end(); ++it)
for ( std::map<size_t,ShaderInfo>::iterator it = shaders.begin(); it != shaders.end(); ++it)
if ( _drawmode.containsAtomicDrawMode(it->first) && it->second.initialized )
it->second.program->disable();
}
......@@ -210,7 +210,7 @@ void ShaderNode::leave(GLState& /*_state*/, const DrawModes::DrawMode& _drawmode
void ShaderNode::leavePick(GLState& /*_state*/, PickTarget /*_target*/, const DrawModes::DrawMode& _drawmode )
{
for ( std::map<unsigned int,ShaderInfo>::iterator it = pickShaders.begin(); it != pickShaders.end(); ++it)
for ( std::map<size_t,ShaderInfo>::iterator it = pickShaders.begin(); it != pickShaders.end(); ++it)
if ( _drawmode.containsAtomicDrawMode(it->first) && it->second.initialized )
it->second.program->disable();
}
......@@ -227,7 +227,7 @@ getShader( DrawModes::DrawMode _drawmode, bool _pick ) {
return 0;
}
std::map<unsigned int,ShaderInfo>::iterator it;
std::map<size_t,ShaderInfo>::iterator it;
if ( _pick ) {
it = pickShaders.find(_drawmode.getIndex());
......@@ -268,7 +268,7 @@ disableShader (DrawModes::DrawMode _drawmode) {
return;
}
unsigned int index = _drawmode.getIndex();
size_t index = _drawmode.getIndex();
// Cleanup old shaders for this mode, if they exist
if ( shaders[index].initialized ) {
......@@ -311,7 +311,7 @@ setShader( DrawModes::DrawMode _drawmode ,
}
disableShader (_drawmode);
unsigned int index = _drawmode.getIndex();
size_t index = _drawmode.getIndex();
shaders[index].vertexShaderFile = shaderDir_ + _vertexShader;
shaders[index].fragmentShaderFile = shaderDir_ + _fragmentShader;
......@@ -400,7 +400,7 @@ availableDrawModes() const
{
DrawModes::DrawMode drawModes(DrawModes::NONE);
for ( std::map<unsigned int,ShaderInfo>::const_iterator it = shaders.begin(); it != shaders.end(); ++it) {
for ( std::map<size_t,ShaderInfo>::const_iterator it = shaders.begin(); it != shaders.end(); ++it) {
// If the shader for this drawmode is initialized, this node supports the given draw mode.
// Then we add it to the list of supported draw modes
if ( it->second.initialized) {
......
......@@ -167,8 +167,8 @@ private :
bool initialized;
};
std::map< unsigned int, ShaderInfo> shaders;
std::map< unsigned int, ShaderInfo> pickShaders;
std::map< size_t, ShaderInfo> shaders;
std::map< size_t, ShaderInfo> pickShaders;
};
......
......@@ -495,7 +495,7 @@ TextureNode::add_texture(const QImage& _image)
// Generate new texture
glGenTextures(1, &( textures_.back().id ) );
activeTexture_ = textures_.size() - 1;
activeTexture_ = int(textures_.size() - 1);
// Set the image
setTextureDataGL(activeTexture_ ,GL_TEXTURE_2D,tex_w,tex_h,GL_RGBA,GL_UNSIGNED_BYTE,texture.bits());
......
......@@ -864,7 +864,7 @@ void TranslationManipulatorNode::addManipulatorToRenderer (IRenderer* _renderer,
{
_baseRO->culling = false;
GLMatrixf oldModelview = _baseRO->modelview;
GLMatrixd oldModelview = _baseRO->modelview;
//================================================================================================
// Z-Axis
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment