changeset 694:7c6197d9acc9

Fixed a bunch of truncation warnings in various parts of the library
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 17 May 2019 09:21:30 +0200
parents 9a474e90e832
children 75deb0acd632
files Framework/Scene2D/Internals/OpenGLLinesProgram.cpp Framework/Scene2D/ZoomSceneTracker.h
diffstat 2 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Scene2D/Internals/OpenGLLinesProgram.cpp	Fri May 17 08:49:55 2019 +0200
+++ b/Framework/Scene2D/Internals/OpenGLLinesProgram.cpp	Fri May 17 09:21:30 2019 +0200
@@ -420,12 +420,12 @@
             
             glUniform1f(program_->GetUniformLocation("u_thickness"), 
               static_cast<GLfloat>(t1 / zoom));
-            glUniform1f(program_->GetUniformLocation("u_antialiasing_start"),
+            glUniform1f(program_->GetUniformLocation("u_antialiasing_start"), 
               static_cast<GLfloat>(t0 / t1));
           }
           else
           {
-            glUniform1f(program_->GetUniformLocation("u_thickness"),
+            glUniform1f(program_->GetUniformLocation("u_thickness"), 
               static_cast<GLfloat>(thickness / zoom));
           }
         }
@@ -436,14 +436,14 @@
             double t1 = std::max(thickness, aliasingBorder / zoom);
             double t0 = std::max(0.0, thickness - aliasingBorder / zoom);
 
-            glUniform1f(program_->GetUniformLocation("u_thickness"),
+            glUniform1f(program_->GetUniformLocation("u_thickness"), 
               static_cast<GLfloat>(t1));
-            glUniform1f(program_->GetUniformLocation("u_antialiasing_start"),
+            glUniform1f(program_->GetUniformLocation("u_antialiasing_start"), 
               static_cast<GLfloat>(t0 / t1));
           }
           else
           {
-            glUniform1f(program_->GetUniformLocation("u_thickness"),
+            glUniform1f(program_->GetUniformLocation("u_thickness"), 
               static_cast<GLfloat>(thickness));
           }
         }
@@ -452,12 +452,14 @@
         {
           glEnable(GL_BLEND);
           glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-          glDrawArrays(GL_TRIANGLES, 0, data.GetVerticesCount());
+          glDrawArrays(GL_TRIANGLES, 0, 
+            static_cast<GLsizei>(data.GetVerticesCount()));
           glDisable(GL_BLEND);
         }
         else
         {
-          glDrawArrays(GL_TRIANGLES, 0, data.GetVerticesCount());
+          glDrawArrays(GL_TRIANGLES, 0, 
+            static_cast<GLsizei>(data.GetVerticesCount()));
         }
 
         glDisableVertexAttribArray(locationPosition);
--- a/Framework/Scene2D/ZoomSceneTracker.h	Fri May 17 08:49:55 2019 +0200
+++ b/Framework/Scene2D/ZoomSceneTracker.h	Fri May 17 09:21:30 2019 +0200
@@ -21,11 +21,14 @@
 
 #pragma once
 
+
 #include "IPointerTracker.h"
 #include "Internals/FixedPointAligner.h"
 
 namespace OrthancStone
 {
+  class Scene2D;
+
   class ZoomSceneTracker : public IPointerTracker
   {
   private: