Commits

Christian Fischer  committed df22592

fixed some compiler warnings

  • Participants
  • Parent commits 7aec915

Comments (0)

Files changed (7)

File src/common/wiesel/gl/shader/shader.cpp

 }
 
 
-GLuint ShaderProgram::getUniformHandle(const std::string& name) const {
-	std::map<string,GLuint>::const_iterator it = uniform_attributes.find(name);
+GLint ShaderProgram::getUniformHandle(const std::string& name) const {
+	std::map<string,GLint>::const_iterator it = uniform_attributes.find(name);
 	if (it != uniform_attributes.end()) {
 		return it->second;
 	}
 
 
 void ShaderProgram::set(const std::string& name, int value) {
-	GLuint handle = getUniformHandle(name);
+	GLint handle = getUniformHandle(name);
 	if (handle != -1) {
 		glUniform1i(handle, value);
 	}
 
 
 void ShaderProgram::set(const std::string& name, float value) {
-	GLuint handle = getUniformHandle(name);
+	GLint handle = getUniformHandle(name);
 	if (handle != -1) {
 		glUniform1f(handle, value);
 	}
 
 void ShaderProgram::setProjectionMatrix(const matrix4x4& matrix) {
 	// bind the projection matrix
-	GLuint uniform_projection_matrix = getProjectionMatrixHandle();
+	GLint uniform_projection_matrix = getProjectionMatrixHandle();
 	assert(uniform_projection_matrix != -1);
 
 	if (uniform_projection_matrix != -1) {
 
 void ShaderProgram::setModelviewMatrix(const matrix4x4& matrix) {
 	// bind the modelview matrix
-	GLuint uniform_modelview_matrix = getModelviewMatrixHandle();
+	GLint uniform_modelview_matrix = getModelviewMatrixHandle();
 	assert(uniform_modelview_matrix != -1);
 
 	if (uniform_modelview_matrix != -1) {
 bool ShaderProgram::isBound() const {
 	GLint current_program;
 	glGetIntegerv(GL_CURRENT_PROGRAM, &current_program);
-	return current_program == program;
+	return static_cast<GLuint>(current_program) == program;
 }

File src/common/wiesel/gl/shader/shader.h

 
 	// attribute access
 	public:
-		inline GLuint getVertexPositionAttribute() const {
+		inline GLint getVertexPositionAttribute() const {
 			return attrib_handle_vertex_position;
 		}
 
-		inline GLuint getVertexNormalAttribute() const {
+		inline GLint getVertexNormalAttribute() const {
 			return attrib_handle_vertex_normal;
 		}
 
-		inline GLuint getVertexColorAttribute() const {
+		inline GLint getVertexColorAttribute() const {
 			return attrib_handle_vertex_color;
 		}
 
-		inline GLuint getVertexTextureCoordAttribute(unsigned int layer) const {
+		inline GLint getVertexTextureCoordAttribute(unsigned int layer) const {
 			return (attrib_handle_vertex_texcoords.size() > layer) ? attrib_handle_vertex_texcoords.at(layer) : -1;
 		}
 
-		inline GLuint getVertexTextureAttribute(unsigned int layer) const {
+		inline GLint getVertexTextureAttribute(unsigned int layer) const {
 			return (attrib_handle_vertex_textures.size() > layer) ? attrib_handle_vertex_textures.at(layer) : -1;
 		}
 
-		inline GLuint getProjectionMatrixHandle() const {
+		inline GLint getProjectionMatrixHandle() const {
 			return uniform_handle_projection_matrix;
 		}
 
-		inline GLuint getModelviewMatrixHandle() const {
+		inline GLint getModelviewMatrixHandle() const {
 			return uniform_handle_modelview_matrix;
 		}
 
 		/**
 		 * @brief get the OpenGL handle to a specific uniform parameter.
 		 */
-		GLuint getUniformHandle(const std::string &name) const;
+		GLint getUniformHandle(const std::string &name) const;
 
 		/**
 		 * @brief release the shader.
 		GLuint					program;
 		bool					need_link;
 
-		GLuint					uniform_handle_projection_matrix;
-		GLuint					uniform_handle_modelview_matrix;
-		GLuint					attrib_handle_vertex_position;
-		GLuint					attrib_handle_vertex_normal;
-		GLuint					attrib_handle_vertex_color;
-		std::vector<GLuint>		attrib_handle_vertex_texcoords;
-		std::vector<GLuint>		attrib_handle_vertex_textures;
+		GLint					uniform_handle_projection_matrix;
+		GLint					uniform_handle_modelview_matrix;
+		GLint					attrib_handle_vertex_position;
+		GLint					attrib_handle_vertex_normal;
+		GLint					attrib_handle_vertex_color;
+		std::vector<GLint>		attrib_handle_vertex_texcoords;
+		std::vector<GLint>		attrib_handle_vertex_textures;
 
-		std::map<std::string,GLuint>	uniform_attributes;
+		std::map<std::string,GLint>	uniform_attributes;
 	};
 
 }

File src/common/wiesel/gl/texture/spriteframe.h

 	private:
 		std::string		name;
 		Texture*		texture;
+		dimension		sprite_size;
+		rect			inner_rect;
 		TextureCoords	texture_coordinates;
-		rect			inner_rect;
-		dimension		sprite_size;
 	};
 
 

File src/common/wiesel/gl/vbo/vertexbuffer.cpp

 }
 
 
-bool VertexBuffer::setupTextureLayer(int layer) {
+bool VertexBuffer::setupTextureLayer(unsigned int layer) {
 	if (checkIfSetupPossible()) {
 		assert(layer <= textures.size());
 		assert(layer >= 0);
 }
 
 
-void VertexBuffer::disableTextureLayer(int layer) {
+void VertexBuffer::disableTextureLayer(unsigned int layer) {
 	if (checkIfSetupPossible()) {
 		// it's only possible to delete the last texture layer
 		assert(layer == textures.size() - 1);
 VertexBuffer::index_t VertexBuffer::setCapacity(index_t capacity) {
 	if (this->data == NULL) {
 		this->data = reinterpret_cast<data_t>(malloc(vertex_size * capacity));
+		assert(this->data);
 
 		// clear the allocated memory
-		memset(this->data, NULL, vertex_size * capacity);
-		assert(this->data);
+		memset(this->data, '\0', vertex_size * capacity);
 
 		if (this->data) {
 			this->capacity = capacity;
 }
 
 
-void VertexBuffer::setVertexTextureCoordinate(index_t index, int layer, const vector2d &coord) {
+void VertexBuffer::setVertexTextureCoordinate(index_t index, unsigned int layer, const vector2d &coord) {
 	setVertexTextureCoordinate(index, layer, coord.u, coord.v);
 }
 
 
-void VertexBuffer::setVertexTextureCoordinate(index_t index, int layer, float u, float v) {
+void VertexBuffer::setVertexTextureCoordinate(index_t index, unsigned int layer, float u, float v) {
 	assert(layer < textures.size());
 	if (layer < textures.size()) {
 		data_t ptr = getVertexPtr(index, textures[layer]);
 	assert(program->isBound());
 
 	if (positions.size) {
-		GLuint attr_vertex_position = program->getVertexPositionAttribute();
+		GLint  attr_vertex_position = program->getVertexPositionAttribute();
 		assert(attr_vertex_position != -1);
 		if (attr_vertex_position != -1) {
 			glVertexAttribPointer(attr_vertex_position, positions.fields, GL_FLOAT, GL_FALSE, vertex_size, data + positions.offset);
 	}
 
 	if (normals.size) {
-		GLuint attr_vertex_normals = program->getVertexNormalAttribute();
+		GLint  attr_vertex_normals = program->getVertexNormalAttribute();
 		assert(attr_vertex_normals != -1);
 		if (attr_vertex_normals != -1) {
 			glVertexAttribPointer(attr_vertex_normals, normals.fields, GL_FLOAT, GL_FALSE, vertex_size, data + normals.offset);
 	}
 
 	if (colors.size) {
-		GLuint attr_vertex_colors = program->getVertexColorAttribute();
+		GLint  attr_vertex_colors = program->getVertexColorAttribute();
 		assert(attr_vertex_colors != -1);
 		if (attr_vertex_colors != -1) {
 			glVertexAttribPointer(attr_vertex_colors, colors.fields, GL_FLOAT, GL_FALSE, vertex_size, data + colors.offset);
 
 	int num_textures = textures.size();
 	for(int i=0; i<num_textures; i++) {
-		GLuint attr_vertex_texcoord = program->getVertexTextureCoordAttribute(i);
-		GLuint attr_vertex_texture  = program->getVertexTextureAttribute(i);
+		GLint  attr_vertex_texcoord = program->getVertexTextureCoordAttribute(i);
+		GLint  attr_vertex_texture  = program->getVertexTextureAttribute(i);
 		assert(attr_vertex_texcoord != -1);
 		assert(pTextures != NULL);
 

File src/common/wiesel/gl/vbo/vertexbuffer.h

 		 * @brief configure a texture layer of the vertices.
 		 * @param layer		The layer to be configured.
 		 */
-		bool setupTextureLayer(int layer);
+		bool setupTextureLayer(unsigned int layer);
 
 		/**
 		 * @brief disables vertex normals.
 		/**
 		 * @brief disables a texture layer.
 		 */
-		void disableTextureLayer(int layer);
+		void disableTextureLayer(unsigned int layer);
 
 
 
 		 * @param index		The index of the vertex to change.
 		 * @param layer		The texture layer which coordinate should be set.
 		 */
-		void setVertexTextureCoordinate(index_t index, int layer, const vector2d &coord);
+		void setVertexTextureCoordinate(index_t index, unsigned int layer, const vector2d &coord);
 
 		/**
 		 * @brief set the texture coordinate of a vertex.
 		 * @param index		The index of the vertex to change.
 		 * @param layer		The texture layer which coordinate should be set.
 		 */
-		void setVertexTextureCoordinate(index_t index, int layer, float u, float v);
+		void setVertexTextureCoordinate(index_t index, unsigned int layer, float u, float v);
 
 		/**
 		 * @brief clears the content of this vertex buffer.

File src/common/wiesel/io/directory_filesystem.cpp

 
 FileList DirectoryFileSystemDirectory::getFiles() {
 	FileList files = getEnclosedDirectory()->getFiles();
-	FileList::size_type n = files.size();
 
 	for(FileList::iterator it=files.begin(); it!=files.end(); it++) {
 		// create a new wrapper object

File src/common/wiesel/util/imageutils.cpp

 	if ((new_width >= old_width) && (new_height >= old_height)) {
 		size_t old_line_length	= old_width * bytesPerPixel;
 		size_t new_line_length	= new_width * bytesPerPixel;
-		size_t old_size			= old_line_length * old_height;
+	//	size_t old_size			= old_line_length * old_height;
 		size_t new_size			= new_line_length * new_height;
 		size_t gap				= new_line_length - old_line_length;
 
 	if ((new_width <= old_width) && (new_height <= old_height)) {
 		size_t old_line_length	= old_width * bytesPerPixel;
 		size_t new_line_length	= new_width * bytesPerPixel;
-		size_t old_size			= old_line_length * old_height;
+	//	size_t old_size			= old_line_length * old_height;
 		size_t new_size			= new_line_length * new_height;
 		size_t gap				= old_line_length - new_line_length;