Added editscreen.c:blender_test_break (copy of MISC_test_break, so

misc dir can be killed)
This commit is contained in:
Daniel Dunbar 2003-03-24 16:34:05 +00:00
parent f7cc1873b7
commit 40ff08a34e
2 changed files with 26 additions and 0 deletions

@ -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);
}