]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Rename some variables
authorMikko Rasa <tdb@tdb.fi>
Mon, 14 Dec 2015 21:18:47 +0000 (23:18 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 14 Dec 2015 21:18:47 +0000 (23:18 +0200)
It's no longer just cylinder correction, so the variables should be more
generic too.

source/main.c

index b1247d88d680ec012d36215fc0bede6fcb8f782b..b7bd8a3be92a9b225abe37a74fbd8df2aedf4db9 100644 (file)
@@ -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;
                                }
                        }
                }