Commit fe802183 authored by Jan Möbius's avatar Jan Möbius
Browse files

More size_t fixes

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17110 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8bf9dbb6
......@@ -334,11 +334,11 @@ void IRenderer::bindObjectUniforms( ACG::RenderObject* _obj, GLSL::Program* _pro
// texture
for (std::map<unsigned,RenderObject::Texture>::const_iterator iter = _obj->textures().begin();
for (std::map<size_t,RenderObject::Texture>::const_iterator iter = _obj->textures().begin();
iter != _obj->textures().end();++iter)
{
//check for valid texture id
const unsigned texture_stage = iter->first;
const size_t texture_stage = iter->first;
const RenderObject::Texture tex = iter->second;
if (!tex.id)
continue;
......
......@@ -242,7 +242,7 @@ struct ACGDLLEXPORT RenderObject
/**
* adds a texture to an specific stage and enables texture support in shaderDesc
*/
void addTexture(const Texture& _t,const unsigned int _stage)
void addTexture(const Texture& _t,const size_t _stage)
{
if (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS < numTextures())
{
......@@ -256,13 +256,13 @@ struct ACGDLLEXPORT RenderObject
///clear all textures. Also affected on shaderDesc
void clearTextures() {textures_.clear(); shaderDesc.clearTextures();}
const std::map<unsigned,Texture>& textures(){return textures_;}
const std::map<size_t,Texture>& textures(){return textures_;}
size_t numTextures() {return textures_.size();}
private:
/// holds the textures (second) and the stage id (first)
std::map<unsigned,Texture> textures_;
std::map<size_t,Texture> textures_;
public:
......
......@@ -872,7 +872,7 @@ void ShaderProgGenerator::buildFragmentShader()
// texture sampler id
if (desc_.textured())
{
for (std::map<unsigned,ShaderGenDesc::TextureType>::const_iterator iter = desc_.textureTypes().begin();
for (std::map<size_t,ShaderGenDesc::TextureType>::const_iterator iter = desc_.textureTypes().begin();
iter != desc_.textureTypes().end(); ++iter)
{
QString name = QString("g_Texture%1").arg(iter->first);
......@@ -1008,7 +1008,7 @@ void ShaderProgGenerator::addFragmentBeginCode(QStringList* _code)
if (desc_.textured())
{
std::map<unsigned,ShaderGenDesc::TextureType>::const_iterator iter = desc_.textureTypes().begin();
std::map<size_t,ShaderGenDesc::TextureType>::const_iterator iter = desc_.textureTypes().begin();
_code->push_back("vec4 sg_cTex = texture(g_Texture"+QString::number(iter->first)+", out" + inputShader + "TexCoord);");
for (++iter; iter != desc_.textureTypes().end(); ++iter)
......@@ -1224,7 +1224,7 @@ QString ShaderGenDesc::toString() const
resStrm << "\nshaderDesc.shadeMode: " << shadeModeString[shadeMode];
resStrm << "\nshaderDesc.vertexColors: " << vertexColors;
resStrm << "\nshaderDesc.textured(): " << textured();
for (std::map<unsigned,TextureType>::const_iterator iter = textureTypes_.begin(); iter != textureTypes_.end();++iter)
for (std::map<size_t,TextureType>::const_iterator iter = textureTypes_.begin(); iter != textureTypes_.end();++iter)
{
resStrm << "\nTexture stage: " << iter->first;
resStrm << "\nTexture Type: ";
......
......@@ -177,15 +177,15 @@ public:
};
private:
/// holds the texture types (second) and the stage id (first). if empty, shader does not support textures
std::map<unsigned,TextureType> textureTypes_;
std::map<size_t,TextureType> textureTypes_;
public:
const std::map<unsigned,TextureType>& textureTypes() {return textureTypes_;}
const std::map<size_t,TextureType>& textureTypes() {return textureTypes_;}
/** \brief adds a texture type to the shader and enables texturing.
*
*/
void addTextureType(GLenum _type, bool _shadow, unsigned _stage)
void addTextureType(GLenum _type, bool _shadow, size_t _stage)
{
TextureType t;
t.type = _type;
......
......@@ -173,7 +173,7 @@ clear()
//-----------------------------------------------------------------------------
template <class PointT>
unsigned int
size_t
PolyLineT<PointT>::n_edges() const
{
if (n_vertices() == 0)
......
......@@ -110,10 +110,10 @@ public:
void set_closed(const bool _c) { closed_ = _c;}
/// \brief Get number of vertices
unsigned int n_vertices() const { return points_.size(); }
size_t n_vertices() const { return points_.size(); }
/// \brief Get number of edges
unsigned int n_edges() const;
size_t n_edges() const;
/// \brief Clear the current polyline
void clear();
......
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