diff options
Diffstat (limited to 'source/blender/nodes/intern/CMP_util.c')
-rw-r--r-- | source/blender/nodes/intern/CMP_util.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/source/blender/nodes/intern/CMP_util.c b/source/blender/nodes/intern/CMP_util.c index b396d5549d7..f9805645115 100644 --- a/source/blender/nodes/intern/CMP_util.c +++ b/source/blender/nodes/intern/CMP_util.c @@ -1104,23 +1104,9 @@ void qd_getPixel(CompBuf* src, int x, int y, float* col) { if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) { float* bc = &src->rect[(x + y*src->x)*src->type]; - switch(src->type){ - /* these fallthrough to get all the channels */ - case CB_RGBA: col[3]=bc[3]; - case CB_VEC3: col[2]=bc[2]; - case CB_VEC2: col[1]=bc[1]; - case CB_VAL: col[0]=bc[0]; - } - } - else { - switch(src->type){ - /* these fallthrough to get all the channels */ - case CB_RGBA: col[3]=0.0; - case CB_VEC3: col[2]=0.0; - case CB_VEC2: col[1]=0.0; - case CB_VAL: col[0]=0.0; - } + col[0] = bc[0], col[1] = bc[1], col[2] = bc[2]; } + else col[0] = col[1] = col[2] = 0.f; } // sets pixel (x, y) to color col @@ -1128,13 +1114,7 @@ void qd_setPixel(CompBuf* src, int x, int y, float* col) { if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) { float* bc = &src->rect[(x + y*src->x)*src->type]; - switch(src->type){ - /* these fallthrough to get all the channels */ - case CB_RGBA: bc[3]=col[3]; - case CB_VEC3: bc[2]=col[2]; - case CB_VEC2: bc[1]=col[1]; - case CB_VAL: bc[0]=col[0]; - } + bc[0] = col[0], bc[1] = col[1], bc[2] = col[2]; } } |