Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-27 11:57:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-27 11:57:17 +0400
commitd612fc04267ca035930eddbfa431f567599baa2c (patch)
tree9826916848dba3ef6e9f73d93a3f1294b4b3d19a /source/blender/nodes/texture/nodes/node_texture_image.c
parentac0a8af41413b730c0ab17cf19390c65dee3134c (diff)
style cleanup: nodes
Diffstat (limited to 'source/blender/nodes/texture/nodes/node_texture_image.c')
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_image.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/source/blender/nodes/texture/nodes/node_texture_image.c b/source/blender/nodes/texture/nodes/node_texture_image.c
index b4cd759d88f..4d9f2febf7a 100644
--- a/source/blender/nodes/texture/nodes/node_texture_image.c
+++ b/source/blender/nodes/texture/nodes/node_texture_image.c
@@ -42,12 +42,12 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i
{
float x = p->co[0];
float y = p->co[1];
- Image *ima= (Image *)node->id;
- ImageUser *iuser= (ImageUser *)node->storage;
+ Image *ima = (Image *)node->id;
+ ImageUser *iuser = (ImageUser *)node->storage;
- if ( ima ) {
+ if (ima) {
ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, NULL);
- if ( ibuf ) {
+ if (ibuf) {
float xsize, ysize;
float xoff, yoff;
int px, py;
@@ -58,24 +58,24 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i
ysize = ibuf->y / 2;
xoff = yoff = -1;
- px = (int)( (x-xoff) * xsize );
- py = (int)( (y-yoff) * ysize );
+ px = (int)( (x - xoff) * xsize);
+ py = (int)( (y - yoff) * ysize);
if ( (!xsize) || (!ysize) ) return;
- if ( !ibuf->rect_float ) {
+ if (!ibuf->rect_float) {
BLI_lock_thread(LOCK_IMAGE);
- if ( !ibuf->rect_float )
+ if (!ibuf->rect_float)
IMB_float_from_rect(ibuf);
BLI_unlock_thread(LOCK_IMAGE);
}
- while ( px < 0 ) px += ibuf->x;
- while ( py < 0 ) py += ibuf->y;
- while ( px >= ibuf->x ) px -= ibuf->x;
- while ( py >= ibuf->y ) py -= ibuf->y;
+ while (px < 0) px += ibuf->x;
+ while (py < 0) py += ibuf->y;
+ while (px >= ibuf->x) px -= ibuf->x;
+ while (py >= ibuf->y) py -= ibuf->y;
- result = ibuf->rect_float + py*ibuf->x*4 + px*4;
+ result = ibuf->rect_float + py * ibuf->x * 4 + px * 4;
copy_v4_v4(out, result);
BKE_image_release_ibuf(ima, ibuf, NULL);
@@ -90,18 +90,18 @@ static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *exe
static void init(bNodeTree *UNUSED(ntree), bNode *node)
{
- ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user");
- node->storage= iuser;
- iuser->sfra= 1;
- iuser->fie_ima= 2;
- iuser->ok= 1;
+ ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "node image user");
+ node->storage = iuser;
+ iuser->sfra = 1;
+ iuser->fie_ima = 2;
+ iuser->ok = 1;
}
void register_node_type_tex_image(void)
{
static bNodeType ntype;
- tex_node_type_base(&ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
+ tex_node_type_base(&ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW | NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, outputs);
node_type_init(&ntype, init);
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);