From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/render/image.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/render/image.cc') diff --git a/src/render/image.cc b/src/render/image.cc index 196eec9..98898ef 100644 --- a/src/render/image.cc +++ b/src/render/image.cc @@ -1,7 +1,7 @@ /* render/image.cc - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 */ #include @@ -9,7 +9,7 @@ #include "render/image.h" -namespace render +namespace render { Image::Image(unsigned int width, unsigned int height, unsigned int channels) @@ -34,7 +34,7 @@ void Image::clear() void Image::swap_channels() { - for (size_t y =0; y < image_height; y++) { + for (size_t y = 0; y < image_height; y++) { for (size_t x = 0; x < image_width; x++) { size_t offset = y * image_width * image_channels + x * image_channels; unsigned char tmp = image_data[offset]; @@ -52,7 +52,7 @@ void Image::pad() if ((w % 8) != 0) { image_width = w + (8 - (w % 8)); } - + if ((w % 8) != 0) { image_height = h + (8 - (h % 8)); } @@ -60,9 +60,9 @@ void Image::pad() unsigned char *image_new = (unsigned char *) malloc(size()); memset(image_new, 0, size()); - for (size_t y =0; y < h; y++) { + for (size_t y = 0; y < h; y++) { memcpy((void *)&image_new[y * image_width * image_channels], - (void *)&image_data[y * w * image_channels], (size_t) w); + (void *)&image_data[y * w * image_channels], (size_t) w); } free(image_data); @@ -72,16 +72,16 @@ void Image::pad() void Image::flip() { unsigned char line[image_width*image_channels]; - for (size_t y=0; y < image_height /2; y++) { + for (size_t y = 0; y < image_height / 2; y++) { memcpy(line, - &image_data[y*image_width*image_channels], - image_width*image_channels); + &image_data[y*image_width*image_channels], + image_width*image_channels); memcpy(&image_data[y*image_width*image_channels], - &image_data[(image_height-1-y)*image_width*image_channels], - image_width*image_channels); + &image_data[(image_height-1-y)*image_width*image_channels], + image_width*image_channels); memcpy(&image_data[(image_height-1-y)*image_width*image_channels], - line, - image_width*image_channels); + line, + image_width*image_channels); } } -- cgit v1.2.3