forked from bartvdbraak/blender
Added editscreen.c:blender_test_break (copy of MISC_test_break, so
misc dir can be killed)
This commit is contained in:
parent
f7cc1873b7
commit
40ff08a34e
@ -61,6 +61,8 @@ void scrarea_queue_redraw(struct ScrArea *area);
|
||||
void scrarea_queue_winredraw(struct ScrArea *area);
|
||||
void scrarea_queue_headredraw(struct ScrArea *area);
|
||||
|
||||
int blender_test_break(void);
|
||||
|
||||
void duplicate_screen(void);
|
||||
void init_screen_cursors(void);
|
||||
void set_timecursor(int nr);
|
||||
|
@ -826,6 +826,30 @@ unsigned short extern_qread(short *val)
|
||||
return extern_qread_ext(val, &ascii);
|
||||
}
|
||||
|
||||
int blender_test_break(void)
|
||||
{
|
||||
if (!G.background) {
|
||||
static double ltime= 0;
|
||||
double curtime= PIL_check_seconds_timer();
|
||||
|
||||
/* only check for breaks every 10 milliseconds
|
||||
* if we get called more often.
|
||||
*/
|
||||
if ((curtime-ltime)>.001) {
|
||||
ltime= curtime;
|
||||
|
||||
while(qtest()) {
|
||||
short val;
|
||||
if (extern_qread(&val) == ESCKEY) {
|
||||
G.afbreek= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (G.afbreek==1);
|
||||
}
|
||||
|
||||
void reset_autosave(void) {
|
||||
window_set_timer(mainwin, U.savetime*60*1000, AUTOSAVE_FILE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user