Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Hnidek <jiri.hnidek@tul.cz>2003-09-08 16:13:54 +0400
committerJiri Hnidek <jiri.hnidek@tul.cz>2003-09-08 16:13:54 +0400
commit5572323a3a4070a32ca82cf018ea312208730d5b (patch)
treefaa8fcffebd85167f1f43d2fcf7c08309287afda
parent5d2f98f440f8ad6fbfb43e96a6db056853683110 (diff)
- 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).
-rw-r--r--bin/.blender/.Blanguages1
-rw-r--r--po/Makefile2
-rw-r--r--source/blender/src/drawobject.c82
3 files changed, 74 insertions, 11 deletions
diff --git a/bin/.blender/.Blanguages b/bin/.blender/.Blanguages
index dcc1f0949fa..92503cef4ef 100644
--- a/bin/.blender/.Blanguages
+++ b/bin/.blender/.Blanguages
@@ -8,3 +8,4 @@ Swedish:sv_SE
French:fr_FR
Spanish:es_ES
Catalan:ca_ES
+Czech:cs_CZ
diff --git a/po/Makefile b/po/Makefile
index 92cb0a320af..3c866fcffcf 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -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
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index 908ff9f45bb..0fbe2aa89df 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -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();