From: Mikko Rasa Date: Mon, 14 Dec 2015 21:18:47 +0000 (+0200) Subject: Rename some variables X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=127a3f103d8ca350a3ebefd294ce02c78b7ef47c;p=geometrycompositor.git Rename some variables It's no longer just cylinder correction, so the variables should be more generic too. --- diff --git a/source/main.c b/source/main.c index b1247d8..b7bd8a3 100644 --- a/source/main.c +++ b/source/main.c @@ -603,8 +603,8 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito unsigned x, y; unsigned i; float aspect; - float cyl_radius; - float cyl_arc; + float curve_radius; + float curve_arc; float sin_ksv; float cos_ksv; float distance; @@ -620,8 +620,8 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito if(monitor->curvature_depth) { - cyl_radius = (monitor->curvature_depth*monitor->curvature_depth+0.25f)/(2.0f*monitor->curvature_depth); - cyl_arc = 2.0f*asin(0.5f/cyl_radius); + curve_radius = (monitor->curvature_depth*monitor->curvature_depth+0.25f)/(2.0f*monitor->curvature_depth); + curve_arc = 2.0f*asin(0.5f/curve_radius); } sin_ksv = monitor->keystone_vertical/sqrt(1.0f+monitor->keystone_vertical*monitor->keystone_vertical); @@ -649,19 +649,19 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito { if(monitor->curvature_type==CYLINDRICAL) { - v[2] = (1.0f-cos(v[0]*cyl_arc))*cyl_radius-monitor->curvature_depth; - v[0] = sin(v[0]*cyl_arc)*cyl_radius; + v[2] = (1.0f-cos(v[0]*curve_arc))*curve_radius-monitor->curvature_depth; + v[0] = sin(v[0]*curve_arc)*curve_radius; } else if(monitor->curvature_type==SPHERICAL) { float r; - v[0] = tan(v[0]*cyl_arc)*cyl_radius; - v[1] = tan(v[1]*cyl_arc)*cyl_radius; - r = sqrt(v[0]*v[0]+v[1]*v[1]+cyl_radius*cyl_radius)/fabs(cyl_radius); + v[0] = tan(v[0]*curve_arc)*curve_radius; + v[1] = tan(v[1]*curve_arc)*curve_radius; + r = sqrt(v[0]*v[0]+v[1]*v[1]+curve_radius*curve_radius)/fabs(curve_radius); v[0] /= r; v[1] /= r; - v[2] = cyl_radius-cyl_radius/r-monitor->curvature_depth; + v[2] = curve_radius-curve_radius/r-monitor->curvature_depth; } } }