- added czech translation (cs.po)

- 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).
This commit is contained in:
Jiri Hnidek 2003-09-08 12:13:54 +00:00
parent 5d2f98f440
commit 5572323a3a
3 changed files with 74 additions and 11 deletions

View File

@ -8,3 +8,4 @@ Swedish:sv_SE
French:fr_FR
Spanish:es_ES
Catalan:ca_ES
Czech:cs_CZ

View 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

View 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();