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:
authorMartin Poirier <theeth@yahoo.com>2003-10-28 06:08:50 +0300
committerMartin Poirier <theeth@yahoo.com>2003-10-28 06:08:50 +0300
commit829c0340f2519ee5b71854e644282877ad2c65e6 (patch)
treee16d2695cc1cbe9b87912bbb03084e1b88ef5f34
parent9c6275c55babe03f377b4897dbf87341c3f80fda (diff)
mostly done for both toets.c and space.c
maybe a couple of odd cases here and there. I'll be cleaning tomorrow.
-rw-r--r--source/blender/src/space.c123
-rw-r--r--source/blender/src/toets.c288
2 files changed, 230 insertions, 181 deletions
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index cff28a4a747..4309e7aa7b4 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -1313,6 +1313,7 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case VKEY:
+ ob= OBACT;
if((G.qual==LR_SHIFTKEY)) {
if ((G.obedit) && G.obedit->type==OB_MESH) {
align_view_to_selected(v3d);
@@ -1355,7 +1356,8 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case XKEY:
case DELKEY:
- delete_context_selected();
+ if(G.qual==0)
+ delete_context_selected();
break;
case YKEY:
if((G.qual==0) && (G.obedit)) {
@@ -1371,39 +1373,49 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case HOMEKEY:
- view3d_home(0);
+ if(G.qual==0)
+ view3d_home(0);
break;
case COMMAKEY:
- G.vd->around= V3D_CENTRE;
- scrarea_queue_headredraw(curarea);
+ if(G.qual==0) {
+ G.vd->around= V3D_CENTRE;
+ scrarea_queue_headredraw(curarea);
+ }
break;
case PERIODKEY:
- G.vd->around= V3D_CURSOR;
- scrarea_queue_headredraw(curarea);
+ if(G.qual==0) {
+ G.vd->around= V3D_CURSOR;
+ scrarea_queue_headredraw(curarea);
+ }
break;
case PADSLASHKEY:
- if(G.vd->localview) {
- G.vd->localview= 0;
- endlocalview(curarea);
- }
- else {
- G.vd->localview= 1;
- initlocalview();
+ if(G.qual==0) {
+ if(G.vd->localview) {
+ G.vd->localview= 0;
+ endlocalview(curarea);
+ }
+ else {
+ G.vd->localview= 1;
+ initlocalview();
+ }
+ scrarea_queue_headredraw(curarea);
}
- scrarea_queue_headredraw(curarea);
break;
case PADASTERKEY: /* '*' */
- ob= OBACT;
- if(ob) {
- obmat_to_viewmat(ob);
- if(G.vd->persp==2) G.vd->persp= 1;
- scrarea_queue_winredraw(curarea);
+ if(G.qual==0) {
+ ob= OBACT;
+ if(ob) {
+ obmat_to_viewmat(ob);
+ if(G.vd->persp==2) G.vd->persp= 1;
+ scrarea_queue_winredraw(curarea);
+ }
}
break;
case PADPERIOD: /* '.' */
- centreview();
+ if(G.qual==0)
+ centreview();
break;
case PAGEUPKEY:
@@ -1428,9 +1440,11 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case ESCKEY:
- if (G.vd->flag & V3D_DISPIMAGE) {
- G.vd->flag &= ~V3D_DISPIMAGE;
- doredraw= 1;
+ if(G.qual==0) {
+ if (G.vd->flag & V3D_DISPIMAGE) {
+ G.vd->flag &= ~V3D_DISPIMAGE;
+ doredraw= 1;
+ }
}
break;
}
@@ -1457,10 +1471,10 @@ void initview3d(ScrArea *sa)
vd->drawtype= OB_WIRE;
vd->view= 7;
vd->dist= 10.0;
- vd->lens= 35.0;
- vd->near= 0.01;
- vd->far= 500.0;
- vd->grid= 1.0;
+ vd->lens= 35.0f;
+ vd->near= 0.01f;
+ vd->far= 500.0f;
+ vd->grid= 1.0f;
vd->gridlines= 16;
vd->lay= vd->layact= 1;
if(G.scene) {
@@ -1544,11 +1558,11 @@ void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
allqueue(REDRAWNLA, 0);
break;
case PADPLUSKEY:
- view2d_zoom(v2d, 0.1154, curarea->winx, curarea->winy);
+ view2d_zoom(v2d, 0.1154f, curarea->winx, curarea->winy);
doredraw= 1;
break;
case PADMINUS:
- view2d_zoom(v2d, -0.15, curarea->winx, curarea->winy);
+ view2d_zoom(v2d, -0.15f, curarea->winx, curarea->winy);
doredraw= 1;
break;
case PAGEUPKEY:
@@ -1660,11 +1674,11 @@ void initipo(ScrArea *sa)
sipo->v2d.cur= sipo->v2d.tot;
- sipo->v2d.min[0]= 0.01;
- sipo->v2d.min[1]= 0.01;
+ sipo->v2d.min[0]= 0.01f;
+ sipo->v2d.min[1]= 0.01f;
- sipo->v2d.max[0]= 15000.0;
- sipo->v2d.max[1]= 10000.0;
+ sipo->v2d.max[0]= 15000.0f;
+ sipo->v2d.max[1]= 10000.0f;
sipo->v2d.scroll= L_SCROLL+B_SCROLL;
sipo->v2d.keeptot= 0;
@@ -1807,7 +1821,6 @@ void info_user_themebuts(uiBlock *block, short y1, short y2, short y3)
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"B ", 465,y1,200,20, col+2, 0.0, 255.0, B_THEMECOL, 0, "");
uiDefButC(block, COL, B_THEMECOL, "", 675,y1,50,y3-y1+20, col, 0, 0, 0, 0, "");
-
if ELEM3(th_curcol, TH_PANEL, TH_FACE, TH_FACE_SELECT) {
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"A ", 465,y3+25,200,20, col+3, 0.0, 255.0, B_THEMECOL, 0, "");
}
@@ -1838,7 +1851,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT);
- fac= ((float)curarea->winx)/1280.0;
+ fac= ((float)curarea->winx)/1280.0f;
myortho2(0.0, 1280.0, 0.0, curarea->winy/fac);
sprintf(naam, "infowin %d", curarea->win);
@@ -2531,11 +2544,11 @@ void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case PADPLUSKEY:
- view2d_zoom(&sbuts->v2d, 0.06, curarea->winx, curarea->winy);
+ view2d_zoom(&sbuts->v2d, 0.06f, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
case PADMINUS:
- view2d_zoom(&sbuts->v2d, -0.075, curarea->winx, curarea->winy);
+ view2d_zoom(&sbuts->v2d, -0.075f, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
case RENDERPREVIEW:
@@ -2582,19 +2595,19 @@ void set_rects_butspace(SpaceButs *buts)
{
/* buts space goes from (0,0) to (1280, 228) */
- buts->v2d.tot.xmin= 0.0;
- buts->v2d.tot.ymin= 0.0;
- buts->v2d.tot.xmax= 1279.0;
- buts->v2d.tot.ymax= 228.0;
+ buts->v2d.tot.xmin= 0.0f;
+ buts->v2d.tot.ymin= 0.0f;
+ buts->v2d.tot.xmax= 1279.0f;
+ buts->v2d.tot.ymax= 228.0f;
- buts->v2d.min[0]= 256.0;
- buts->v2d.min[1]= 42.0;
+ buts->v2d.min[0]= 256.0f;
+ buts->v2d.min[1]= 42.0f;
- buts->v2d.max[0]= 2048.0;
- buts->v2d.max[1]= 450.0;
+ buts->v2d.max[0]= 2048.0f;
+ buts->v2d.max[1]= 450.0f;
- buts->v2d.minzoom= 0.5;
- buts->v2d.maxzoom= 1.21;
+ buts->v2d.minzoom= 0.5f;
+ buts->v2d.maxzoom= 1.21f;
buts->v2d.scroll= 0;
buts->v2d.keepaspect= 1;
@@ -2860,9 +2873,11 @@ void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case XKEY:
case DELKEY:
- if(sseq->mainb) break;
- if((G.qual==0))
- del_seq();
+ if(G.qual==0) {
+ if(sseq->mainb) break;
+ if((G.qual==0))
+ del_seq();
+ }
break;
}
}
@@ -2896,7 +2911,7 @@ void init_seqspace(ScrArea *sa)
sseq->v2d.max[0]= 32000.0;
sseq->v2d.max[1]= MAXSEQ;
- sseq->v2d.minzoom= 0.1;
+ sseq->v2d.minzoom= 0.1f;
sseq->v2d.maxzoom= 10.0;
sseq->v2d.scroll= L_SCROLL+B_SCROLL;
@@ -2946,7 +2961,7 @@ void init_actionspace(ScrArea *sa)
saction->v2d.max[0]= 32000.0;
saction->v2d.max[1]= 1000.0;
- saction->v2d.minzoom= 0.01;
+ saction->v2d.minzoom= 0.01f;
saction->v2d.maxzoom= 10;
saction->v2d.scroll= R_SCROLL+B_SCROLL;
@@ -3069,7 +3084,7 @@ void init_soundspace(ScrArea *sa)
ssound->v2d.max[0]= 32000.0;
ssound->v2d.max[1]= 259;
- ssound->v2d.minzoom= 0.1;
+ ssound->v2d.minzoom= 0.1f;
ssound->v2d.maxzoom= 10.0;
ssound->v2d.scroll= B_SCROLL;
@@ -3378,7 +3393,7 @@ void init_v2d_oops(View2D *v2d)
v2d->max[0]= 320.0;
v2d->max[1]= 320.0;
- v2d->minzoom= 0.01;
+ v2d->minzoom= 0.01f;
v2d->maxzoom= 2.0;
/* v2d->scroll= L_SCROLL+B_SCROLL; */
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
index 55206db9bed..b5153364b8b 100644
--- a/source/blender/src/toets.c
+++ b/source/blender/src/toets.c
@@ -294,14 +294,14 @@ void persptoetsen(unsigned short event)
G.vd->camzoom-= 10;
if(G.vd->camzoom<-30) G.vd->camzoom= -30;
}
- else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2;
+ else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f;
}
else if(event==PADPLUSKEY) {
if(G.vd->persp==2) {
G.vd->camzoom+= 10;
if(G.vd->camzoom>300) G.vd->camzoom= 300;
}
- else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333;
+ else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f;
}
else {
@@ -347,20 +347,20 @@ void persptoetsen(unsigned short event)
if(G.vd->persp==2) {
G.vd->camzoom= MAX2(-30, G.vd->camzoom-5);
}
- else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2;
+ else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f;
}
else if(event==PADPLUSKEY) {
if(G.vd->persp==2) {
G.vd->camzoom= MIN2(300, G.vd->camzoom+5);
}
- else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333;
+ else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f;
}
else if(event==PAD5) {
if(G.vd->persp==1) G.vd->persp=0;
else G.vd->persp=1;
}
else if(event==PAD0) {
- if(G.qual & LR_ALTKEY) {
+ if(G.qual==LR_ALTKEY) {
if(oldcamera && is_an_active_object(oldcamera)) {
G.vd->camera= oldcamera;
}
@@ -368,7 +368,7 @@ void persptoetsen(unsigned short event)
handle_view3d_lock();
}
else if(BASACT) {
- if(G.qual & LR_CTRLKEY) {
+ if(G.qual==LR_CTRLKEY) {
if(G.vd->camera != OBACT) {
if(G.vd->camera && G.vd->camera->type==OB_CAMERA)
oldcamera= G.vd->camera;
@@ -536,7 +536,7 @@ int blenderqread(unsigned short event, short val)
activate_fileselect(FILE_BLENDER, "LOAD FILE", G.sce, BIF_read_file);
return 0;
}
- else if(G.qual & LR_SHIFTKEY) {
+ else if(G.qual==LR_SHIFTKEY) {
activate_fileselect(FILE_LOADLIB, "LOAD LIBRARY", G.lib, 0);
return 0;
}
@@ -548,11 +548,11 @@ int blenderqread(unsigned short event, short val)
activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file);
return 0;
}
- else if(G.qual & LR_CTRLKEY) {
+ else if(G.qual==LR_CTRLKEY) {
write_vrml_fs();
return 0;
}
- else if(G.qual & LR_SHIFTKEY) {
+ else if(G.qual==LR_SHIFTKEY) {
write_dxf_fs();
return 0;
}
@@ -562,12 +562,12 @@ int blenderqread(unsigned short event, short val)
BIF_save_rendered_image();
return 0;
}
- else if(G.qual & LR_CTRLKEY) {
+ else if(G.qual==LR_CTRLKEY) {
BIF_screendump();
}
break;
case F4KEY:
- if(G.qual & LR_SHIFTKEY) {
+ if(G.qual==LR_SHIFTKEY) {
memset(str, 0, 16);
ob= OBACT;
@@ -576,69 +576,86 @@ int blenderqread(unsigned short event, short val)
activate_fileselect(FILE_MAIN, "DATA SELECT", str, 0);
return 0;
}
- else extern_set_butspace(event);
-
+ else if(G.qual==0) {
+ extern_set_butspace(event);
+ }
break;
case F5KEY:
- if(G.qual & LR_SHIFTKEY) {
+ if(G.qual==LR_SHIFTKEY) {
newspace(curarea, SPACE_VIEW3D);
return 0;
}
- else extern_set_butspace(event);
+ else if(G.qual==0) {
+ extern_set_butspace(event);
+ }
break;
case F6KEY:
- if(G.qual & LR_SHIFTKEY) {
+ if(G.qual==LR_SHIFTKEY) {
newspace(curarea, SPACE_IPO);
return 0;
}
- else extern_set_butspace(event);
+ else if(G.qual==0) {
+ extern_set_butspace(event);
+ }
break;
case F7KEY:
- if(G.qual & LR_SHIFTKEY) {
+ if(G.qual==LR_SHIFTKEY) {
newspace(curarea, SPACE_BUTS);
return 0;
}
- else extern_set_butspace(event);
+ else if(G.qual==0) {
+ extern_set_butspace(event);
+ }
break;
case F8KEY:
- if(G.qual & LR_SHIFTKEY) {
+ if(G.qual==LR_SHIFTKEY) {
newspace(curarea, SPACE_SEQ);
return 0;
}
- else extern_set_butspace(event);
+ else if(G.qual==0) {
+ extern_set_butspace(event);
+ }
break;
case F9KEY:
- if(G.qual & LR_SHIFTKEY) {
+ if(G.qual==LR_SHIFTKEY) {
newspace(curarea, SPACE_OOPS);
return 0;
}
- else extern_set_butspace(event);
+ else if(G.qual==0) {
+ extern_set_butspace(event);
+ }
break;
case F10KEY:
- if(G.qual & LR_SHIFTKEY) {
+ if(G.qual==LR_SHIFTKEY) {
newspace(curarea, SPACE_IMAGE);
return 0;
}
- else extern_set_butspace(event);
+ else if(G.qual==0) {
+ extern_set_butspace(event);
+ }
break;
case F11KEY:
- if(G.qual & LR_SHIFTKEY) {
+ if(G.qual==LR_SHIFTKEY) {
newspace(curarea, SPACE_TEXT);
return 0;
}
- else BIF_toggle_render_display();
- return 0;
+ else if(G.qual==0) {
+ BIF_toggle_render_display();
+ return 0;
+ }
break;
case F12KEY:
- if(G.qual & LR_SHIFTKEY) {
- if (G.qual & LR_CTRLKEY){
- newspace(curarea, SPACE_NLA);
- return 0;
- }
+ if(G.qual==LR_SHIFTKEY) {
newspace(curarea, SPACE_ACTION);
return 0;
}
- else BIF_do_render(0);
+ else if (G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) {
+ newspace(curarea, SPACE_NLA);
+ return 0;
+ }
+ else if(G.qual==0) {
+ BIF_do_render(0);
+ }
return 0;
break;
@@ -648,15 +665,20 @@ int blenderqread(unsigned short event, short val)
#ifdef _WIN32 // FULLSCREEN
if(event==DOWNARROWKEY){
- if (G.qual & LR_ALTKEY) mainwindow_toggle_fullscreen(0);
- else CFRA-= 10;
+ if (G.qual==LR_ALTKEY)
+ mainwindow_toggle_fullscreen(0);
+ else if(G.qual==0)
+ CFRA-= 10;
}
#else
- if(event==DOWNARROWKEY) CFRA-= 10;
+ if((event==DOWNARROWKEY)&&(G.qual==0))
+ CFRA-= 10;
#endif
- else CFRA--;
+ else if((event==LEFTARROWKEY)&&(G.qual==0))
+ CFRA--;
- if(G.qual & LR_SHIFTKEY) CFRA= SFRA;
+ if(G.qual==LR_SHIFTKEY)
+ CFRA= SFRA;
if(CFRA<1) CFRA=1;
update_for_newframe();
@@ -670,49 +692,64 @@ int blenderqread(unsigned short event, short val)
#ifdef _WIN32 // FULLSCREEN
if(event==UPARROWKEY){
- if(G.qual & LR_ALTKEY) mainwindow_toggle_fullscreen(1);
- else CFRA+= 10;
+ if(G.qual==LR_ALTKEY)
+ mainwindow_toggle_fullscreen(1);
+ else if(G.qual==0)
+ CFRA+= 10;
}
#else
- if(event==UPARROWKEY) CFRA+= 10;
+ if((event==UPARROWKEY)&&(G.qual==0))
+ CFRA+= 10;
#endif
- else CFRA++;
+ else if((event==RIGHTARROWKEY)&&(G.qual==0))
+ CFRA++;
- if(G.qual & LR_SHIFTKEY) CFRA= EFRA;
+ if(G.qual==LR_SHIFTKEY)
+ CFRA= EFRA;
update_for_newframe();
}
break;
-
+
case ESCKEY:
sound_stop_all_sounds();
break;
case TABKEY:
- if(G.qual==0 ) {
+ if(G.qual==0) {
if(textspace==0) {
- if(curarea->spacetype==SPACE_IPO) set_editflag_editipo();
- else if(curarea->spacetype==SPACE_SEQ) enter_meta();
+ if(curarea->spacetype==SPACE_IPO)
+ set_editflag_editipo();
+ else if(curarea->spacetype==SPACE_SEQ)
+ enter_meta();
else if(G.vd) {
/* also when Alt-E */
- if(G.obedit==0) enter_editmode();
- else exit_editmode(1);
+ if(G.obedit==0)
+ enter_editmode();
+ else
+ exit_editmode(1);
}
return 0;
}
}
- else if(G.qual & LR_CTRLKEY){
- if(G.obpose) exit_posemode(1);
+ else if(G.qual==LR_CTRLKEY){
+ if(G.obpose)
+ exit_posemode(1);
else
enter_posemode();
allqueue(REDRAWHEADERS, 0);
}
- else if(G.qual & LR_SHIFTKEY) {
- if(G.obedit) exit_editmode(1);
- if(G.f & G_FACESELECT) set_faceselect();
- if(G.f & G_VERTEXPAINT) set_vpaint();
- if(G.f & G_WEIGHTPAINT) set_wpaint();
- if(G.obpose) exit_posemode(1);
+ else if(G.qual==LR_SHIFTKEY) {
+ if(G.obedit)
+ exit_editmode(1);
+ if(G.f & G_FACESELECT)
+ set_faceselect();
+ if(G.f & G_VERTEXPAINT)
+ set_vpaint();
+ if(G.f & G_WEIGHTPAINT)
+ set_wpaint();
+ if(G.obpose)
+ exit_posemode(1);
}
break;
@@ -721,18 +758,23 @@ int blenderqread(unsigned short event, short val)
case AKEY:
if(textediting==0 && textspace==0) {
- if(G.qual & LR_ALTKEY) {
- if(G.qual & LR_SHIFTKEY) play_anim(1);
- else play_anim(0);
+ if(G.qual==(LR_SHIFTKEY|LR_ALTKEY)){
+ play_anim(1);
+ return 0;
+ }
+ else if(G.qual==LR_ALTKEY) {
+ play_anim(0);
return 0;
}
}
break;
case EKEY:
- if(G.qual & LR_ALTKEY) {
+ if(G.qual==LR_ALTKEY) {
if(G.vd && textspace==0) {
- if(G.obedit==0) enter_editmode();
- else exit_editmode(1);
+ if(G.obedit==0)
+ enter_editmode();
+ else
+ exit_editmode(1);
return 0;
}
}
@@ -756,8 +798,7 @@ int blenderqread(unsigned short event, short val)
case NKEY:
if(textediting==0 && textspace==0 ) {
- if(G.qual & LR_CTRLKEY);
- else if(G.qual==0 || (G.qual & LR_SHIFTKEY)) {
+ if(G.qual==0 || (G.qual==LR_SHIFTKEY)) {
if(curarea->spacetype!=SPACE_VIEW3D) { // is new panel, in view3d queue
clever_numbuts();
return 0;
@@ -768,7 +809,7 @@ int blenderqread(unsigned short event, short val)
case OKEY:
if(textediting==0) {
- if(G.qual & LR_CTRLKEY) {
+ if(G.qual==LR_CTRLKEY) {
/* There seem to be crashes here sometimes.... String
* bound overwrites? I changed dir and str sizes,
* let's see if this reoccurs. */
@@ -785,74 +826,70 @@ int blenderqread(unsigned short event, short val)
case SKEY:
if(G.obpose==0 && G.obedit==0) {
- if(G.qual & LR_CTRLKEY) {
- if(G.qual & LR_SHIFTKEY);
- else {
- strcpy(dir, G.sce);
- if (untitled(dir)) {
- activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file);
- } else {
- BIF_write_file(dir);
- free_filesel_spec(dir);
- }
- return 0;
+ if(G.qual==LR_CTRLKEY) {
+ strcpy(dir, G.sce);
+ if (untitled(dir)) {
+ activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file);
+ } else {
+ BIF_write_file(dir);
+ free_filesel_spec(dir);
}
+ return 0;
}
}
break;
case TKEY:
- if(G.qual & LR_ALTKEY) {
- if(G.qual & LR_CTRLKEY) {
+ if (G.qual==(LR_SHIFTKEY|LR_ALTKEY|LR_CTRLKEY)) {
int a;
+ double delta, stime;
+
+ waitcursor(1);
+
+ stime= PIL_check_seconds_timer();
+ for(a=0; a<100000; a++) {
+ scrarea_do_windraw(curarea);
- if (G.qual & LR_SHIFTKEY) {
- double delta, stime;
+ delta= PIL_check_seconds_timer()-stime;
+ if (delta>5.0) break;
+ }
+
+ waitcursor(0);
+ notice("FPS: %f (%d iterations)", a/delta, a);
+ return 0;
+ }
+ else if(G.qual==(LR_ALTKEY|LR_CTRLKEY)) {
+ int a;
+ int event= pupmenu("10 Timer%t|draw|draw+swap");
+ if(event>0) {
+ double stime= PIL_check_seconds_timer();
+ char tmpstr[128];
+ int time;
+ printf("start timer\n");
waitcursor(1);
-
- stime= PIL_check_seconds_timer();
- for(a=0; a<100000; a++) {
+
+ for(a=0; a<10; a++) {
scrarea_do_windraw(curarea);
-
- delta= PIL_check_seconds_timer()-stime;
- if (delta>5.0) break;
+ if(event==2) screen_swapbuffers();
}
+
+ time= (PIL_check_seconds_timer()-stime)*1000;
+ if(event==1) sprintf(tmpstr, "draw %%t|%d", time);
+ if(event==2) sprintf(tmpstr, "d+sw %%t|%d", time);
+
waitcursor(0);
- notice("FPS: %f (%d iterations)", a/delta, a);
- } else {
- int event= pupmenu("10 Timer%t|draw|draw+swap");
- if(event>0) {
- double stime= PIL_check_seconds_timer();
- char tmpstr[128];
- int time;
-
- printf("start timer\n");
- waitcursor(1);
-
- for(a=0; a<10; a++) {
- scrarea_do_windraw(curarea);
- if(event==2) screen_swapbuffers();
- }
-
- time= (PIL_check_seconds_timer()-stime)*1000;
-
- if(event==1) sprintf(tmpstr, "draw %%t|%d", time);
- if(event==2) sprintf(tmpstr, "d+sw %%t|%d", time);
-
- waitcursor(0);
- pupmenu(tmpstr);
+ pupmenu(tmpstr);
- }
}
return 0;
- }}
+ }
break;
case UKEY:
if(textediting==0) {
- if(G.qual & LR_CTRLKEY) {
+ if(G.qual==LR_CTRLKEY) {
if(okee("SAVE USER DEFAULTS")) {
BIF_write_homefile();
}
@@ -863,20 +900,17 @@ int blenderqread(unsigned short event, short val)
case WKEY:
if(textediting==0) {
- if(G.qual & LR_CTRLKEY) {
- if(G.qual & LR_SHIFTKEY);
- else {
- strcpy(dir, G.sce);
- if (untitled(dir)) {
- activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file);
- } else {
- BIF_write_file(dir);
- free_filesel_spec(dir);
- }
- return 0;
+ if(G.qual==LR_CTRLKEY) {
+ strcpy(dir, G.sce);
+ if (untitled(dir)) {
+ activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file);
+ } else {
+ BIF_write_file(dir);
+ free_filesel_spec(dir);
}
+ return 0;
}
- else if(G.qual & LR_ALTKEY) {
+ else if(G.qual==LR_ALTKEY) {
write_videoscape_fs();
}
}
@@ -884,7 +918,7 @@ int blenderqread(unsigned short event, short val)
case XKEY:
if(textspace==0) {
- if(G.qual & LR_CTRLKEY) {
+ if(G.qual==LR_CTRLKEY) {
if(okee("ERASE ALL")) {
if( BIF_read_homefile()==0) error("No file ~/.B.blend");
}