improved main loop sequence for the async rendering
This commit is contained in:
13
main.c
13
main.c
@@ -90,15 +90,10 @@ int main(){
|
|||||||
while(!(status & STATUS_QUIT_PROGRAM)){
|
while(!(status & STATUS_QUIT_PROGRAM)){
|
||||||
getmaxyx(stdscr, terminal_height, terminal_width);
|
getmaxyx(stdscr, terminal_height, terminal_width);
|
||||||
|
|
||||||
if (!(terminal_height == temp_heigth) || !(terminal_width == temp_width)) {
|
user_interactions();
|
||||||
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_RESIZE);
|
|
||||||
temp_width = terminal_width;
|
|
||||||
temp_heigth = terminal_height;
|
|
||||||
}
|
|
||||||
if (status & STATUS_RUN_BACKEND) {
|
if (status & STATUS_RUN_BACKEND) {
|
||||||
free(global_path);
|
free(global_path);
|
||||||
global_path = getcwd(NULL, 0);
|
global_path = getcwd(NULL, 0);
|
||||||
pthread_cond_signal(&cond_top);
|
|
||||||
pthread_cond_signal(&cond_mid);
|
pthread_cond_signal(&cond_mid);
|
||||||
pthread_cond_signal(&cond_lft);
|
pthread_cond_signal(&cond_lft);
|
||||||
status &= ~(STATUS_RUN_BACKEND);
|
status &= ~(STATUS_RUN_BACKEND);
|
||||||
@@ -106,8 +101,12 @@ int main(){
|
|||||||
} else {
|
} else {
|
||||||
status &= ~(STATUS_RELOAD_DIRECTORY | STATUS_DELTA_TIME);
|
status &= ~(STATUS_RELOAD_DIRECTORY | STATUS_DELTA_TIME);
|
||||||
}
|
}
|
||||||
user_interactions();
|
|
||||||
|
|
||||||
|
if (!(terminal_height == temp_heigth) || !(terminal_width == temp_width)) {
|
||||||
|
status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_RESIZE);
|
||||||
|
temp_width = terminal_width;
|
||||||
|
temp_heigth = terminal_height;
|
||||||
|
}
|
||||||
render_pass();
|
render_pass();
|
||||||
|
|
||||||
#if SETTINGS_RELOAD_DIR_DELTA != 0
|
#if SETTINGS_RELOAD_DIR_DELTA != 0
|
||||||
|
|||||||
Reference in New Issue
Block a user