Commit 8a7389f2 authored by Sylvain Thery's avatar Sylvain Thery

remove last 64bits & float/double warnings

parent 6fc2e3cb
......@@ -692,7 +692,7 @@ Clipping::Clipping():
m_timer(NULL),
m_lastAnimatedClippingPreset(NULL)
{
m_coeffTopoExplod = Geom::Vec3f(0.9,0.9,0.9);
m_coeffTopoExplod = Geom::Vec3f(0.9f,0.9f,0.9f);
}
void Clipping::initGUI()
......@@ -856,10 +856,10 @@ void Clipping::cb_initGL()
// setup clipping shapes
m_planeDrawable = new Utils::Grid;
m_planeDrawable->setColor(Geom::Vec4f(1.0, 0.0, 0.0, 1.0));
m_planeDrawable->setColor(Geom::Vec4f(1.0f, 0.0f, 0.0f, 1.0f));
m_planeDrawable->updatePrecisionDrawing(5);
m_sphereDrawable = new Utils::IcoSphere;
m_sphereDrawable->setColor(Geom::Vec4f(0.0, 0.4, 1.0, 1.0));
m_sphereDrawable->setColor(Geom::Vec4f(0.0f, 0.4f, 1.0f, 1.0f));
m_sphereDrawable->updatePrecisionDrawing(1);
// setup clipping picking frame
......
......@@ -177,7 +177,7 @@ void MyQT::cb_Open()
// maxV=v;
if(myMap.isVolumeIncidentToBoundary(d))
color[d] = VEC3(1,0.41,0.706);
color[d] = VEC3(1.0f,0.41f,0.706f);
}
// for (unsigned int i = color.begin(); i != color.end(); color.next(i))
// {
......
......@@ -150,8 +150,8 @@ bool exportNAS(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3,
}
unsigned int countCell=1;
unsigned int nbhexa = hexa.size()/8;
unsigned int nbtetra = tetra.size()/4;
unsigned int nbhexa = uint32(hexa.size() / 8);
unsigned int nbtetra = uint32(tetra.size() / 4);
fout << std::right;
if (nbhexa!=0)
......@@ -263,8 +263,8 @@ bool exportVTU(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3,
}
}
unsigned int nbhexa = hexa.size()/8;
unsigned int nbtetra = tetra.size()/4;
unsigned int nbhexa = uint32(hexa.size() / 8);
unsigned int nbtetra = uint32(tetra.size() / 4);
fout << "<?xml version=\"1.0\"?>" << std::endl;
fout << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"BigEndian\">" << std::endl;
......@@ -424,8 +424,8 @@ bool exportMSH(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3,
fout << "$ELM" << std::endl;
unsigned int countCell=1;
unsigned int nbhexa = hexa.size()/8;
unsigned int nbtetra = tetra.size()/4;
unsigned int nbhexa = uint32(hexa.size() / 8);
unsigned int nbtetra = uint32(tetra.size() / 4);
fout << (nbhexa+nbtetra) << std::endl;
if (nbhexa!=0)
......@@ -508,7 +508,7 @@ bool exportTet(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3,
}
}
unsigned int nbtetra = tetra.size()/4;
unsigned int nbtetra = uint32(tetra.size() / 4);
fout << nbtetra << " tets" << std::endl;
for (unsigned int i = position.begin(); i != position.end(); position.next(i))
......@@ -603,7 +603,7 @@ bool exportNodeEle(typename PFP::MAP& map, const VertexAttribute<typename PFP::V
}
unsigned int countCell=0;
unsigned int nbtetra = tetra.size()/4;
unsigned int nbtetra = uint32(tetra.size() / 4);
foutEle << nbtetra << " 4 0" << std::endl;
......@@ -709,8 +709,8 @@ bool exportVolBinGz(typename PFP::MAP& map, const VertexAttribute<typename PFP::
}
}
unsigned int nbhexa = hexa.size()/8;
unsigned int nbtetra = tetra.size()/4;
unsigned int nbhexa = uint32(hexa.size() / 8);
unsigned int nbtetra = uint32(tetra.size() / 4);
unsigned int buffer[3];
buffer[0] = position.nbElements();
......@@ -805,7 +805,7 @@ bool exportTetmesh(typename PFP::MAP& map, const VertexAttribute<typename PFP::V
}
}
unsigned int nbtetra = tetra.size()/4;
unsigned int nbtetra = uint32(tetra.size()/4);
fout << "Tetrahedra" << std::endl << nbtetra << std::endl;
for (unsigned int i=0; i<nbtetra; ++i)
......
......@@ -22,7 +22,7 @@
* *
*******************************************************************************/
#include <math.h>
#include <cmath>
#include "Topology/generic/traversor/traversorCell.h"
namespace CGoGN
......
......@@ -25,7 +25,6 @@
#ifndef __HISTOGRAM__
#define __HISTOGRAM__
#define _USE_MATH_DEFINES
#include <cmath>
#include "Topology/generic/attributeHandler.h"
......
......@@ -309,7 +309,7 @@ public:
* @brief get the number of groups in OBJ file
* @return number of groups
*/
unsigned int nbObjGroups() { return m_groupFirstSub.size(); }
unsigned int nbObjGroups() { return uint32(m_groupFirstSub.size()); }
/**
* @brief get the index of first group mat of obj
......
......@@ -581,19 +581,19 @@ unsigned int OBJModel<PFP>::createSimpleVBO_PTN(Utils::VBO* positionVBO, Utils::
}
positionVBO->setDataSize(3);
positionVBO->allocate(posBuff.size());
positionVBO->allocate(uint32(posBuff.size()));
Geom::Vec3f* ptrPos = reinterpret_cast<Geom::Vec3f*>(positionVBO->lockPtr());
memcpy(ptrPos,&posBuff[0],posBuff.size()*sizeof(Geom::Vec3f));
positionVBO->releasePtr();
texcoordVBO->setDataSize(2);
texcoordVBO->allocate(TCBuff.size());
texcoordVBO->allocate(uint32(TCBuff.size()));
Geom::Vec2f* ptrTC = reinterpret_cast<Geom::Vec2f*>(texcoordVBO->lockPtr());
memcpy(ptrTC,&TCBuff[0],TCBuff.size()*sizeof(Geom::Vec2f));
texcoordVBO->releasePtr();
normalVBO->setDataSize(3);
normalVBO->allocate(normalBuff.size());
normalVBO->allocate(uint32(normalBuff.size()));
Geom::Vec3f* ptrNormal = reinterpret_cast<Geom::Vec3f*>(normalVBO->lockPtr());
memcpy(ptrNormal, &normalBuff[0], normalBuff.size()*sizeof(Geom::Vec3f));
normalVBO->releasePtr();
......@@ -1394,7 +1394,7 @@ bool OBJModel<PFP>::createGroupMatVBO_PTN(
m_groupFirstSub[outGr] = inSg;
}
}
m_groupNbSub[outGr+1] = m_sgMat.size() - m_groupNbSub[outGr];
m_groupNbSub[outGr+1] = uint32(m_sgMat.size()) - m_groupNbSub[outGr];
// now create VBOs
......@@ -1407,7 +1407,7 @@ bool OBJModel<PFP>::createGroupMatVBO_PTN(
unsigned int firstIndex = 0;
unsigned int sz = group_faces.size();
unsigned int sz = uint32(group_faces.size());
m_beginIndices.resize(sz);
m_nbIndices.resize(sz);
m_groupIdx.resize(sz);
......@@ -1478,19 +1478,19 @@ bool OBJModel<PFP>::createGroupMatVBO_PTN(
}
positionVBO->setDataSize(3);
positionVBO->allocate(posBuff.size());
positionVBO->allocate(uint32(posBuff.size()));
Geom::Vec3f* ptrPos = reinterpret_cast<Geom::Vec3f*>(positionVBO->lockPtr());
memcpy(ptrPos,&posBuff[0],posBuff.size()*sizeof(Geom::Vec3f));
positionVBO->releasePtr();
texcoordVBO->setDataSize(2);
texcoordVBO->allocate(TCBuff.size());
texcoordVBO->allocate(uint32(TCBuff.size()));
Geom::Vec2f* ptrTC = reinterpret_cast<Geom::Vec2f*>(texcoordVBO->lockPtr());
memcpy(ptrTC,&TCBuff[0],TCBuff.size()*sizeof(Geom::Vec2f));
texcoordVBO->releasePtr();
normalVBO->setDataSize(3);
normalVBO->allocate(normalBuff.size());
normalVBO->allocate(uint32(normalBuff.size()));
Geom::Vec3f* ptrNormal = reinterpret_cast<Geom::Vec3f*>(normalVBO->lockPtr());
memcpy(ptrNormal, &normalBuff[0], normalBuff.size()*sizeof(Geom::Vec3f));
normalVBO->releasePtr();
......@@ -1556,7 +1556,7 @@ bool OBJModel<PFP>::import( const std::string& filename, std::vector<std::string
if (tag == "mtllib")
{
unsigned found = filename.find_last_of("/\\");
size_t found = filename.find_last_of("/\\");
std::string mtfn;
oss >> mtfn;
m_matPath = filename.substr(0,found) + "/";
......@@ -1795,7 +1795,7 @@ bool OBJModel<PFP>::import( const std::string& filename, std::vector<std::string
std::vector<unsigned int>& vn = vecNormIndPerVertex[d];
// test if normal vertex or multi-attrib vertex
unsigned int nb = vtc.size();
unsigned int nb = uint32(vtc.size());
bool same=true;
for (unsigned int j=1; (j<nb)&&(same); ++j)
{
......
......@@ -26,7 +26,7 @@
#define _IMPORT_PLY_DATA_H
#include <stdio.h>
#include <math.h>
#include <cmath>
#include <string>
#include "Algo/Import/ply.h"
......
......@@ -26,7 +26,7 @@
#include <fstream>
#include <string.h>
#include <vector>
#include <math.h>
#include <cmath>
#include <typeinfo>
namespace CGoGN
......@@ -196,10 +196,10 @@ void Image<DataType>::loadVox(const char *filename)
m_Data = new DataType[total];
int filename_s = strlen(filename) ;
int filename_s = int(strlen(filename))+1 ;
// char datafile[filename_s] ;
char* datafile = new char[filename_s] ;
strcpy(datafile, filename) ;
memcpy(datafile, filename, filename_s);
datafile[filename_s-3] = 'r' ;
datafile[filename_s-2] = 'a' ;
datafile[filename_s-1] = 'w' ;
......
......@@ -25,7 +25,7 @@
#ifndef EXTRUSION_H
#define EXTRUSION_H
#include <math.h>
#include <cmath>
#include <vector>
#include "Algo/Tiling/Surface/square.h"
......
......@@ -160,18 +160,18 @@ Algo::Surface::Tilings::Tiling<PFP>* extrusion_scale_prim(
if (profile_closed)
{
if (path_closed)
prim = new Algo::Surface::Tilings::Square::Tore<PFP>(the_map, profile.size(), path.size());
prim = new Algo::Surface::Tilings::Square::Tore<PFP>(the_map, uint32(profile.size()), uint32(path.size()));
else
prim = new Algo::Surface::Tilings::Square::Cylinder<PFP>(the_map, profile.size(), path.size()-1, false, false);
prim = new Algo::Surface::Tilings::Square::Cylinder<PFP>(the_map, uint32(profile.size()), uint32(path.size() - 1), false, false);
}
else
{
if (path_closed)
{
prim = new Algo::Surface::Tilings::Square::Grid<PFP>(the_map, profile.size()-1, path.size(), true);
prim = new Algo::Surface::Tilings::Square::Grid<PFP>(the_map, uint32(profile.size() - 1), uint32(path.size()), true);
// sewing boundaries correponding to path boundaries
std::vector<Dart>& darts = prim->getVertexDarts();
int index = profile.size()*path.size();
int index = int(profile.size()*path.size());
for (unsigned int i=0;i<profile.size()-1;++i)
{
Dart d = the_map.phi_1(darts[index++]);
......@@ -182,7 +182,7 @@ Algo::Surface::Tilings::Tiling<PFP>* extrusion_scale_prim(
}
else
prim = new Algo::Surface::Tilings::Square::Grid<PFP>(the_map, profile.size()-1, path.size()-1, true);
prim = new Algo::Surface::Tilings::Square::Grid<PFP>(the_map, uint32(profile.size()-1), uint32(path.size()-1), true);
}
glPushMatrix();
......
......@@ -25,7 +25,7 @@
#ifndef __PLANE_CUTTING_H__
#define __PLANE_CUTTING_H__
#include <math.h>
#include <cmath>
#include <vector>
#include "Geometry/plane_3d.h"
#include "Topology/generic/cellmarker.h"
......
......@@ -25,7 +25,8 @@
#ifndef __SUBDIVISION_H__
#define __SUBDIVISION_H__
#include <math.h>
#include <cmath>
#include <vector>
#include "Algo/Geometry/centroid.h"
......
......@@ -26,8 +26,6 @@
#include "Algo/Geometry/centroid.h"
#include "Topology/generic/autoAttributeHandler.h"
#define _USE_MATH_DEFINES
#include <math.h>
namespace CGoGN
{
......
......@@ -25,7 +25,7 @@
#ifndef __SUBDIVISION3_H__
#define __SUBDIVISION3_H__
#include <math.h>
#include <cmath>
#include <vector>
#include "Geometry/plane_3d.h"
#include "Algo/Modelisation/tetrahedralization.h"
......
......@@ -25,7 +25,7 @@
#ifndef _CGOGN_TRIANGULATION_H_
#define _CGOGN_TRIANGULATION_H_
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
......
......@@ -345,7 +345,7 @@ void renderTopoGMD2(typename PFP::MAP& map, const VertexAttribute<typename PFP::
center /= REAL(vecPos.size());
//shrink the face
unsigned int nb = vecPos.size();
unsigned int nb = uint32(vecPos.size());
float k = 1.0f - kf;
for (unsigned int i=0; i<nb; ++i)
vecPos[i] = center*k + vecPos[i]*kf;
......
......@@ -125,7 +125,7 @@ void ExplodeVolumeRender::computeFace(typename PFP::MAP& map, Dart d, const EMBV
a = e;
} while (a != d);
unsigned int nb = normals.size();
unsigned int nb = uint32(normals.size());
VEC3 Ntemp = normals[0];
normals[0] += normals[nb-1];
normals[0].normalize();
......@@ -180,7 +180,7 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const V_ATT& posi
VEC3F volCol = PFP::toVec3f(colorPerXXX[d.dart]);
unsigned int nbs = vertices.size();
unsigned int nbs = uint32(vertices.size());
// just to have more easy algo further
vertices.push_back(vertices.front());
normals.push_back(normals.front());
......@@ -230,21 +230,21 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const V_ATT& posi
});
// ,false); ????
m_nbTris = buffer.size()/4;
m_nbTris = GLuint(buffer.size()/4);
m_vboPos->allocate(buffer.size());
m_vboPos->allocate(uint32(buffer.size()));
VEC3F* ptrPos = reinterpret_cast<VEC3F*>(m_vboPos->lockPtr());
memcpy(ptrPos,&buffer[0],buffer.size()*sizeof(VEC3F));
m_vboPos->releasePtr();
m_shaderS->setAttributePosition(m_vboPos);
m_vboColors->allocate(bufferColors.size());
m_vboColors->allocate(uint32(bufferColors.size()));
VEC3F* ptrCol = reinterpret_cast<VEC3F*>(m_vboColors->lockPtr());
memcpy(ptrCol,&bufferColors[0],bufferColors.size()*sizeof(VEC3F));
m_vboColors->releasePtr();
m_shaderS->setAttributeColor(m_vboColors);
m_vboNormals->allocate(bufferNormals.size());
m_vboNormals->allocate(uint32(bufferNormals.size()));
VEC3F* ptrNorm = reinterpret_cast<VEC3F*>(m_vboNormals->lockPtr());
memcpy(ptrNorm,&bufferNormals[0],bufferNormals.size()*sizeof(VEC3F));
m_vboNormals->releasePtr();
......@@ -261,9 +261,9 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const V_ATT& posi
});
// ,false); ????
m_nbLines = buffer.size()/3;
m_nbLines = GLuint(buffer.size()/3);
m_vboPosLine->allocate(buffer.size());
m_vboPosLine->allocate(uint32(buffer.size()));
ptrPos = reinterpret_cast<VEC3F*>(m_vboPosLine->lockPtr());
memcpy(ptrPos,&buffer[0],buffer.size()*sizeof(VEC3F));
......@@ -488,15 +488,15 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const V_ATT& positi
}
});
m_nbTris = buffer.size()/4;
m_nbTris = GLuint(buffer.size()/4);
m_vboPos->allocate(buffer.size());
m_vboPos->allocate(uint32(buffer.size()));
VEC3F* ptrPos = reinterpret_cast<VEC3F*>(m_vboPos->lockPtr());
memcpy(ptrPos,&buffer[0],buffer.size()*sizeof(VEC3F));
m_vboPos->releasePtr();
m_shader->setAttributePosition(m_vboPos);
m_vboColors->allocate(bufferColors.size());
m_vboColors->allocate(uint32(bufferColors.size()));
VEC3F* ptrCol = reinterpret_cast<VEC3F*>(m_vboColors->lockPtr());
memcpy(ptrCol,&bufferColors[0],bufferColors.size()*sizeof(VEC3F));
m_vboColors->releasePtr();
......@@ -512,9 +512,9 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const V_ATT& positi
buffer.push_back(PFP::toVec3f(positions[map.phi1(c)]));
}); // false ???
m_nbLines = buffer.size()/3;
m_nbLines = GLuint(buffer.size()/3);
m_vboPosLine->allocate(buffer.size());
m_vboPosLine->allocate(uint32(buffer.size()));
ptrPos = reinterpret_cast<VEC3F*>(m_vboPosLine->lockPtr());
memcpy(ptrPos,&buffer[0],buffer.size()*sizeof(VEC3F));
......
......@@ -25,7 +25,6 @@
#ifndef _GL2_MAP_RENDER_
#define _GL2_MAP_RENDER_
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
......
......@@ -482,7 +482,7 @@ void Topo3PrimalRender<PFP>::updateData(MAP& mapx, const VertexAttribute<VEC3, M
dd = mapx.phi1(dd);
} while (dd != d);
unsigned int nb = vecPos.size();
unsigned int nb = uint32(vecPos.size());
vecPos.push_back(vecPos.front()); // copy the first for easy computation on next loop
......
......@@ -820,7 +820,7 @@ void Topo3RenderGMap<PFP>::updateData(MAP& mapx, const VertexAttribute<VEC3, MAP
dd = mapx.phi1(dd);
} while (dd != d);
unsigned int nb = vecPos.size();
unsigned int nb = uint32(vecPos.size());
vecPos.push_back(vecPos.front()); // copy the first for easy computation on next loop
......
......@@ -2,7 +2,7 @@
#define _CONVERT_H_
#include <limits>
#include <math.h>
#include <cmath>
#include <iostream>
#include "Geometry/vector_gen.h"
......
......@@ -109,9 +109,11 @@ public:
Vector<DIM, T>& operator-=(const Vector<DIM, T>& v) ;
Vector<DIM, T>& operator*=(T a) ;
template <typename T2>
Vector<DIM, T>& operator*=(T2 a) ;
Vector<DIM, T>& operator/=(T a) ;
template <typename T2>
Vector<DIM, T>& operator/=(T2 a) ;
/**********************************************/
/* ARITHMETIC OPERATORS */
......@@ -123,12 +125,11 @@ public:
Vector<DIM, T> operator-() const ;
Vector<DIM, T> operator*(T a) const ;
// template <typename T2>
// Vector<DIM, T> operator*(T2 a) const ;
template <typename T2>
Vector<DIM, T> operator*(T2 a) const ;
Vector<DIM, T> operator/(T a) const ;
template <typename T2>
Vector<DIM, T> operator/(T2 a) const ;
/**********************************************/
/* UTILITY FUNCTIONS */
......
......@@ -185,22 +185,44 @@ inline Vector<DIM, T>& Vector<DIM, T>::operator-=(const Vector<DIM, T>& v)
return *this ;
}
//template <unsigned int DIM, typename T>
//inline Vector<DIM, T>& Vector<DIM, T>::operator*=(T a)
//{
// for (unsigned int i = 0; i < DIM; ++i)
// m_data[i] *= a ;
// return *this ;
//}
//
//template <unsigned int DIM, typename T>
//inline Vector<DIM, T>& Vector<DIM, T>::operator/=(T a)
//{
// for (unsigned int i = 0; i < DIM; ++i)
// m_data[i] /= a ;
// return *this ;
//}
template <unsigned int DIM, typename T>
inline Vector<DIM, T>& Vector<DIM, T>::operator*=(T a)
template <typename T2>
inline Vector<DIM, T>& Vector<DIM, T>::operator*=(T2 a)
{
T aa = T(a);
for (unsigned int i = 0; i < DIM; ++i)
m_data[i] *= a ;
return *this ;
m_data[i] *= aa;
return *this;
}
template <unsigned int DIM, typename T>
inline Vector<DIM, T>& Vector<DIM, T>::operator/=(T a)
template <typename T2>
inline Vector<DIM, T>& Vector<DIM, T>::operator/=(T2 a)
{
T aa = T(a);
for (unsigned int i = 0; i < DIM; ++i)
m_data[i] /= a ;
return *this ;
m_data[i] /= aa;
return *this;
}
/**********************************************/
/* ARITHMETIC OPERATORS */
/**********************************************/
......@@ -234,20 +256,24 @@ inline Vector<DIM, T> Vector<DIM, T>::operator-() const
template <unsigned int DIM, typename T>
inline Vector<DIM, T> Vector<DIM, T>::operator*(T a) const
template <typename T2>
inline Vector<DIM, T> Vector<DIM, T>::operator*(T2 a) const
{
Vector<DIM, T> res ;
T aa = T(a);
for (unsigned int i = 0; i < DIM; ++i)
res[i] = m_data[i] * a ;
res[i] = m_data[i] * aa ;
return res ;
}
template <unsigned int DIM, typename T>
inline Vector<DIM, T> Vector<DIM, T>::operator/(T a) const
template <typename T2>
inline Vector<DIM, T> Vector<DIM, T>::operator/(T2 a) const
{
Vector<DIM, T> res ;
T aa = T(a);
for (unsigned int i = 0; i < DIM; ++i)
res[i] = m_data[i] / a ;
res[i] = m_data[i] / T(a) ;
return res ;
}
......
......@@ -10,7 +10,6 @@
#include <windows.h>
#include <stdio.h>
#include <limits>
#define _USE_MATH_DEFINES
#include <cmath>
#define isnan(X) _isnan(X)
......
......@@ -24,7 +24,8 @@
#include "Algo/ImplicitHierarchicalMesh/ihm3.h"
#include "Topology/generic/traversor/traversor3.h"
#include <math.h>
#include <cmath>
#include <limits>
namespace CGoGN
......
......@@ -23,7 +23,8 @@
*******************************************************************************/
#include "Topology/ihmap/ihm2.h"
#include <math.h>
#include <cmath>
namespace CGoGN
{
......
......@@ -23,7 +23,8 @@
*******************************************************************************/
#include "Topology/ihmap/ihm3.h"
#include <math.h>
#include <cmath>
namespace CGoGN
{
......
......@@ -772,14 +772,16 @@ bool GLSLShader::loadShadersFromMemory(const char* vs, const char* fs)
size_t sz = strlen(vs);
m_vertex_shader_source = new char[sz+1];
strcpy(m_vertex_shader_source, vs);
memcpy(m_vertex_shader_source, vs,sz+1);
if (m_fragment_shader_source)
delete [] m_fragment_shader_source;
sz = strlen(fs);
m_fragment_shader_source = new char[sz+1];
strcpy(m_fragment_shader_source, fs);
memcpy(m_fragment_shader_source, fs,sz+1);
if(!loadVertexShaderSourceString(vs))
return false;
......@@ -803,21 +805,21 @@ bool GLSLShader::loadShadersFromMemory(const char* vs, const char* fs, const cha
size_t sz = strlen(vs);
m_vertex_shader_source = new char[sz+1];
strcpy(m_vertex_shader_source,vs);
memcpy(m_vertex_shader_source,vs,sz+1);
if (m_fragment_shader_source)
delete [] m_fragment_shader_source;
sz = strlen(fs);
m_fragment_shader_source = new char[sz+1];
strcpy(m_fragment_shader_source,fs);
memcpy(m_fragment_shader_source,fs,sz+1);
if (m_geom_shader_source)
delete [] m_geom_shader_source;
sz = strlen(gs);
m_geom_shader_source = new char[sz+1];
strcpy(m_geom_shader_source,gs);
memcpy(m_geom_shader_source,gs,sz+1);
if(!loadVertexShaderSourceString(vs))
return false;
......@@ -845,8 +847,7 @@ bool GLSLShader::reloadVertexShaderFromMemory(const char* vs)
size_t sz = strlen(vs);
m_vertex_shader_source = new char[sz+1];
strcpy(m_vertex_shader_source,vs);
memcpy(m_vertex_shader_source,vs,sz+1);
return true;
}
......@@ -858,7 +859,7 @@ bool GLSLShader::reloadFragmentShaderFromMemory(const char* fs)
unsigned int sz = uint32(strlen(fs));
m_fragment_shader_source = new char[sz+1];
strcpy(m_fragment_shader_source,fs);
memcpy(m_fragment_shader_source,fs,sz+1);
return true;
}
......@@ -870,7 +871,7 @@ bool GLSLShader::reloadGeometryShaderFromMemory(const char* gs)
unsigned int sz = uint32(strlen(gs));
m_geom_shader_source = new char[sz+1];
strcpy(m_geom_shader_source,gs);
memcpy(m_geom_shader_source,gs,sz+1);