- added czech translation (cs.po)
authorJiri Hnidek <jiri.hnidek@tul.cz>
Mon, 8 Sep 2003 12:13:54 +0000 (12:13 +0000)
committerJiri Hnidek <jiri.hnidek@tul.cz>
Mon, 8 Sep 2003 12:13:54 +0000 (12:13 +0000)
- changed function drawcircball() in source/blender/src/drawobject.c. Circle is computed faster (no 32 calls of sin() and cos() each time witch same results).

bin/.blender/.Blanguages
po/Makefile
source/blender/src/drawobject.c

index dcc1f0949fa10cb4a499a35ec2530e535cfc6b23..92503cef4efd4e21a233fd485118b9a58d6d6527 100644 (file)
@@ -8,3 +8,4 @@ Swedish:sv_SE
 French:fr_FR
 Spanish:es_ES
 Catalan:ca_ES
+Czech:cs_CZ
index 92cb0a320af1decdf2d594c0f2facccd222c7de0..3c866fcffcfbc072fb63d167f464d5177b7aebd6 100644 (file)
@@ -36,7 +36,7 @@ SOURCEDIR = blender/po
 
 include nan_definitions.mk
 
-LINGUAS = ca de es fr it ja nl sv
+LINGUAS = ca cs de es fr it ja nl sv
 ifeq ($(OS), darwin)
 DIR = $(OCGDIR)/bin/blender.app/Contents/Resources/locale/$@/LC_MESSAGES/
 else
index 908ff9f45bbc9814a4795363f48d862af73547f1..0fbe2aa89df1d64911ff8b58756a56e436b943f1 100644 (file)
@@ -3022,24 +3022,86 @@ static void tekentextcurs(void)
 
 void drawcircball(float *cent, float rad, float tmat[][4])
 {
-       float si, co, phi, dphi, vec[3], vx[3], vy[3];
+       float vec[3], vx[3], vy[3];
        int a, tot=32;
+
+       /* 32 values of sin function (still same result!) */
+       static float si[32] = {0.00000000,
+               0.20129852,
+               0.39435585,
+               0.57126821,
+               0.72479278,
+               0.84864425,
+               0.93775213,
+               0.98846832,
+               0.99871650,
+               0.96807711,
+               0.89780453,
+               0.79077573,
+               0.65137248,
+               0.48530196,
+               0.29936312,
+               0.10116832,
+               -0.10116832,
+                -0.29936312,
+                -0.48530196,
+                -0.65137248,
+                -0.79077573,
+                -0.89780453,
+                -0.96807711,
+                -0.99871650,
+                -0.98846832,
+                -0.93775213,
+                -0.84864425,
+                -0.72479278,
+                -0.57126821,
+                -0.39435585,
+                -0.20129852,
+               0.00000000};
+       /* 32 values of cos function (still same result!) */
+       static float co[32] ={1.00000000,
+                0.97952994,
+                0.91895781,
+                0.82076344,
+                0.68896691,
+                0.52896401,
+                0.34730525,
+                0.15142777,
+                -0.05064916,
+                -0.25065253,
+                -0.44039415,
+                -0.61210598,
+                -0.75875812,
+                -0.87434661,
+                -0.95413925,
+                -0.99486932,
+                -0.99486932,
+                -0.95413925,
+                -0.87434661,
+                -0.75875812,
+                -0.61210598,
+                -0.44039415,
+                -0.25065253,
+                -0.05064916,
+                0.15142777,
+                0.34730525,
+                0.52896401,
+                0.68896691,
+                0.82076344,
+                0.91895781,
+                0.97952994,
+                1.00000000};
                
        VECCOPY(vx, tmat[0]);
        VECCOPY(vy, tmat[1]);
        VecMulf(vx, rad);
        VecMulf(vy, rad);
        
-       dphi= 2.0*M_PI/tot;
-       phi= 0.0;
-       
        glBegin(GL_LINE_LOOP);
-       for(a=0; a<tot; a++, phi+= dphi) {
-               si= sin(phi);
-               co= cos(phi);
-               vec[0]= cent[0]+si*vx[0]+co*vy[0];
-               vec[1]= cent[1]+si*vx[1]+co*vy[1];
-               vec[2]= cent[2]+si*vx[2]+co*vy[2];
+       for(a=0; a<tot; a++) {
+               vec[0]= cent[0] + *(si+a) * vx[0] + *(co+a) * vy[0];
+               vec[1]= cent[1] + *(si+a) * vx[1] + *(co+a) * vy[1];
+               vec[2]= cent[2] + *(si+a) * vx[2] + *(co+a) * vy[2];
                glVertex3fv(vec);
        }
        glEnd();