From 6cd571f92fcd17a4607fe981e334fc6554aa0ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Sun, 26 Aug 2012 20:40:39 +0000 Subject: [PATCH] paysages : Small refactor. git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@424 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- lib_paysages/sky.c | 8 ++++---- lib_paysages/{preetham.c => skypreetham.c} | 6 +++--- lib_paysages/{preetham.h => skypreetham.h} | 4 ++-- lib_paysages/{rayleigh.c => skyrayleigh.c} | 6 +++--- lib_paysages/{rayleigh.h => skyrayleigh.h} | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) rename lib_paysages/{preetham.c => skypreetham.c} (94%) rename lib_paysages/{preetham.h => skypreetham.h} (58%) rename lib_paysages/{rayleigh.c => skyrayleigh.c} (93%) rename lib_paysages/{rayleigh.h => skyrayleigh.h} (59%) diff --git a/lib_paysages/sky.c b/lib_paysages/sky.c index cc59e95..592c62b 100644 --- a/lib_paysages/sky.c +++ b/lib_paysages/sky.c @@ -10,8 +10,8 @@ #include "lighting.h" #include "render.h" #include "tools.h" -#include "preetham.h" -#include "rayleigh.h" +#include "skypreetham.h" +#include "skyrayleigh.h" #define SPHERE_SIZE 1000.0 @@ -245,11 +245,11 @@ Color skyGetColor(SkyDefinition* definition, Renderer* renderer, Vector3 eye, Ve if (definition->model == SKY_MODEL_PREETHAM) { - sky_color = preethamGetSkyColor(eye, look, sun_position, definition->model_preetham.turbidity); + sky_color = skyPreethamGetColor(eye, look, sun_position, definition->model_preetham.turbidity); } else if (definition->model == SKY_MODEL_RAYLEIGH_MIE) { - sky_color = rayleighGetSkyColor(eye, look, sun_position); + sky_color = skyRayleighGetColor(eye, look, sun_position); } else { diff --git a/lib_paysages/preetham.c b/lib_paysages/skypreetham.c similarity index 94% rename from lib_paysages/preetham.c rename to lib_paysages/skypreetham.c index e74c433..f8c3db8 100644 --- a/lib_paysages/preetham.c +++ b/lib_paysages/skypreetham.c @@ -1,4 +1,4 @@ -#include "preetham.h" +#include "skypreetham.h" #include @@ -50,7 +50,7 @@ static inline void _directionToThetaPhi(Vector3 direction, double* theta, double *theta = M_PI_2 - asin(direction.y); } -Color preethamGetSkyColor(Vector3 viewer, Vector3 direction, Vector3 sun_direction, double turbidity) +Color skyPreethamGetColor(Vector3 viewer, Vector3 direction, Vector3 sun_direction, double turbidity) { double theta, phi; double thetaSun, phiSun; @@ -130,7 +130,7 @@ Color preethamGetSkyColor(Vector3 viewer, Vector3 direction, Vector3 sun_directi return _xyYToRGB(x, y, Y); } -Color preethamApplyToObject(Vector3 viewer, Vector3 object_location, Vector3 sun_direction, double turbidity, Color object_color) +Color skyPreethamApplyToObject(Vector3 viewer, Vector3 object_location, Vector3 sun_direction, double turbidity, Color object_color) { /* TODO Aerial perspective */ return object_color; diff --git a/lib_paysages/preetham.h b/lib_paysages/skypreetham.h similarity index 58% rename from lib_paysages/preetham.h rename to lib_paysages/skypreetham.h index 2e13f4d..2415f10 100644 --- a/lib_paysages/preetham.h +++ b/lib_paysages/skypreetham.h @@ -10,8 +10,8 @@ extern "C" { #endif -Color preethamGetSkyColor(Vector3 viewer, Vector3 direction, Vector3 sun_direction, double turbidity); -Color preethamApplyToObject(Vector3 viewer, Vector3 object_location, Vector3 sun_direction, double turbidity, Color object_color); +Color skyPreethamGetColor(Vector3 viewer, Vector3 direction, Vector3 sun_direction, double turbidity); +Color skyPreethamApplyToObject(Vector3 viewer, Vector3 object_location, Vector3 sun_direction, double turbidity, Color object_color); #ifdef __cplusplus } diff --git a/lib_paysages/rayleigh.c b/lib_paysages/skyrayleigh.c similarity index 93% rename from lib_paysages/rayleigh.c rename to lib_paysages/skyrayleigh.c index c933bb3..88310b1 100644 --- a/lib_paysages/rayleigh.c +++ b/lib_paysages/skyrayleigh.c @@ -1,4 +1,4 @@ -#include "rayleigh.h" +#include "skyrayleigh.h" #include @@ -71,12 +71,12 @@ static Vector3 _computeIncidentLight(Ray r) return 20 * (sumR * phaseR * _betaR + sumM * phaseM * _betaM); }*/ -Color rayleighGetSkyColor(Vector3 viewer, Vector3 direction, Vector3 sun_direction) +Color skyRayleighGetColor(Vector3 viewer, Vector3 direction, Vector3 sun_direction) { return COLOR_BLACK; } -Color rayleighApplyToObject(Vector3 viewer, Vector3 object_location, Vector3 sun_direction, Color object_color) +Color skyRayleighApplyToObject(Vector3 viewer, Vector3 object_location, Vector3 sun_direction, Color object_color) { return COLOR_BLACK; } diff --git a/lib_paysages/rayleigh.h b/lib_paysages/skyrayleigh.h similarity index 59% rename from lib_paysages/rayleigh.h rename to lib_paysages/skyrayleigh.h index 645d524..0dfffbb 100644 --- a/lib_paysages/rayleigh.h +++ b/lib_paysages/skyrayleigh.h @@ -10,8 +10,8 @@ extern "C" { #endif -Color rayleighGetSkyColor(Vector3 viewer, Vector3 direction, Vector3 sun_direction); -Color rayleighApplyToObject(Vector3 viewer, Vector3 object_location, Vector3 sun_direction, Color object_color); +Color skyRayleighGetColor(Vector3 viewer, Vector3 direction, Vector3 sun_direction); +Color skyRayleighApplyToObject(Vector3 viewer, Vector3 object_location, Vector3 sun_direction, Color object_color); #ifdef __cplusplus }