diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-04-03 21:30:15 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-04-03 21:30:15 -0400 |
commit | 5a535f9fac3f4b82f0b154b4c81fd1e2a8d62802 (patch) | |
tree | 2b642b87d97ab13b050e1ef9323725c0bbd5b5c6 /libdimension/finish_combination.c | |
parent | 7bc2770af08e317b2076540050c68d2de55a11db (diff) | |
download | dimension-5a535f9fac3f4b82f0b154b4c81fd1e2a8d62802.tar.xz |
Don't use awkward (*fptr)() syntax.
Diffstat (limited to 'libdimension/finish_combination.c')
-rw-r--r-- | libdimension/finish_combination.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/libdimension/finish_combination.c b/libdimension/finish_combination.c index d7525b2..acdc719 100644 --- a/libdimension/finish_combination.c +++ b/libdimension/finish_combination.c @@ -36,13 +36,13 @@ dmnsn_finish_combination_diffuse_fn(const dmnsn_finish *finish, dmnsn_finish **params = finish->ptr; if (params[0]->diffuse_fn && params[1]->diffuse_fn) { return dmnsn_color_add( - (*params[0]->diffuse_fn)(params[0], light, color, ray, normal), - (*params[1]->diffuse_fn)(params[1], light, color, ray, normal) + params[0]->diffuse_fn(params[0], light, color, ray, normal), + params[1]->diffuse_fn(params[1], light, color, ray, normal) ); } else if (params[0]->diffuse_fn) { - return (*params[0]->diffuse_fn)(params[0], light, color, ray, normal); + return params[0]->diffuse_fn(params[0], light, color, ray, normal); } else if (params[1]->diffuse_fn) { - return (*params[1]->diffuse_fn)(params[1], light, color, ray, normal); + return params[1]->diffuse_fn(params[1], light, color, ray, normal); } else { return dmnsn_black; } @@ -58,15 +58,15 @@ dmnsn_finish_combination_specular_fn(const dmnsn_finish *finish, dmnsn_finish **params = finish->ptr; if (params[0]->specular_fn && params[1]->specular_fn) { return dmnsn_color_add( - (*params[0]->specular_fn)(params[0], light, color, ray, normal, viewer), - (*params[1]->specular_fn)(params[1], light, color, ray, normal, viewer) + params[0]->specular_fn(params[0], light, color, ray, normal, viewer), + params[1]->specular_fn(params[1], light, color, ray, normal, viewer) ); } else if (params[0]->specular_fn) { - return (*params[0]->specular_fn)(params[0], light, color, ray, - normal, viewer); + return params[0]->specular_fn(params[0], light, color, ray, + normal, viewer); } else if (params[1]->specular_fn) { - return (*params[1]->specular_fn)(params[1], light, color, ray, - normal, viewer); + return params[1]->specular_fn(params[1], light, color, ray, + normal, viewer); } else { return dmnsn_black; } @@ -79,12 +79,12 @@ dmnsn_finish_combination_ambient_fn(const dmnsn_finish *finish, { dmnsn_finish **params = finish->ptr; if (params[0]->ambient_fn && params[1]->ambient_fn) { - return dmnsn_color_add((*params[0]->ambient_fn)(params[0], pigment), - (*params[1]->ambient_fn)(params[1], pigment)); + return dmnsn_color_add(params[0]->ambient_fn(params[0], pigment), + params[1]->ambient_fn(params[1], pigment)); } else if (params[0]->ambient_fn) { - return (*params[0]->ambient_fn)(params[0], pigment); + return params[0]->ambient_fn(params[0], pigment); } else if (params[1]->ambient_fn) { - return (*params[1]->ambient_fn)(params[1], pigment); + return params[1]->ambient_fn(params[1], pigment); } else { return dmnsn_black; } @@ -99,13 +99,13 @@ dmnsn_finish_combination_reflection_fn(const dmnsn_finish *finish, dmnsn_finish **params = finish->ptr; if (params[0]->reflection_fn && params[1]->reflection_fn) { return dmnsn_color_add( - (*params[0]->reflection_fn)(params[0], reflect, color, ray, normal), - (*params[1]->reflection_fn)(params[1], reflect, color, ray, normal) + params[0]->reflection_fn(params[0], reflect, color, ray, normal), + params[1]->reflection_fn(params[1], reflect, color, ray, normal) ); } else if (params[0]->reflection_fn) { - return (*params[0]->reflection_fn)(params[0], reflect, color, ray, normal); + return params[0]->reflection_fn(params[0], reflect, color, ray, normal); } else if (params[1]->reflection_fn) { - return (*params[1]->reflection_fn)(params[1], reflect, color, ray, normal); + return params[1]->reflection_fn(params[1], reflect, color, ray, normal); } else { return dmnsn_black; } @@ -133,18 +133,18 @@ dmnsn_new_finish_combination(dmnsn_finish *f1, dmnsn_finish *f2) finish->ptr = params; if (f1->diffuse_fn || f2->diffuse_fn) - finish->diffuse_fn = &dmnsn_finish_combination_diffuse_fn; + finish->diffuse_fn = dmnsn_finish_combination_diffuse_fn; if (f1->specular_fn || f2->specular_fn) - finish->specular_fn = &dmnsn_finish_combination_specular_fn; + finish->specular_fn = dmnsn_finish_combination_specular_fn; if (f1->ambient_fn || f2->ambient_fn) - finish->ambient_fn = &dmnsn_finish_combination_ambient_fn; + finish->ambient_fn = dmnsn_finish_combination_ambient_fn; if (f1->reflection_fn || f2->reflection_fn) - finish->reflection_fn = &dmnsn_finish_combination_reflection_fn; + finish->reflection_fn = dmnsn_finish_combination_reflection_fn; - finish->free_fn = &dmnsn_finish_combination_free_fn; + finish->free_fn = dmnsn_finish_combination_free_fn; return finish; } |