yet another change to the rendering pipeline
This commit is contained in:
@@ -160,43 +160,10 @@ void render_pass(){
|
||||
mvwin(win_b, terminal_height-1, 0);
|
||||
|
||||
}
|
||||
/* render_queue is modified both by this and its associated thread without mutexes, this is intentional.
|
||||
* reason being that since rendering is done in the same thread as the logic,
|
||||
* using mutexes actually slows this down more than the result of an unknown state.
|
||||
* an unknown state may be an incomplete render, which in my tests wont crash, or one too many renders.
|
||||
* both of these chances are non distructive.
|
||||
* doing rendering async is done because
|
||||
* A: its funny
|
||||
* B: previous render pipelines may have caused win_r to lack behind
|
||||
* C: slowdown as a result of too many renders */
|
||||
if (render_queue[RENDER_QUEUE_TOP] || status & (STATUS_UPDATE_SCREEN_RESIZE | STATUS_UPDATE_SCREEN_CLEAR)) {
|
||||
wnoutrefresh(win_t);
|
||||
render_queue[RENDER_QUEUE_TOP] = 0;
|
||||
status |= STATUS_UPDATE_ASYNC_REFRESH;
|
||||
}
|
||||
if (render_queue[RENDER_QUEUE_LFT] || status & (STATUS_UPDATE_SCREEN_RESIZE | STATUS_UPDATE_SCREEN_CLEAR)) {
|
||||
wnoutrefresh(win_l);
|
||||
render_queue[RENDER_QUEUE_LFT] = 0;
|
||||
status |= STATUS_UPDATE_ASYNC_REFRESH;
|
||||
}
|
||||
if (render_queue[RENDER_QUEUE_MID] || status & (STATUS_UPDATE_SCREEN_RESIZE | STATUS_UPDATE_SCREEN_CLEAR)) {
|
||||
wnoutrefresh(win_m);
|
||||
render_queue[RENDER_QUEUE_MID] = 0;
|
||||
status |= STATUS_UPDATE_ASYNC_REFRESH;
|
||||
}
|
||||
if (render_queue[RENDER_QUEUE_RGT] || status & (STATUS_UPDATE_SCREEN_RESIZE | STATUS_UPDATE_SCREEN_CLEAR)) {
|
||||
wnoutrefresh(win_r);
|
||||
render_queue[RENDER_QUEUE_RGT] = 0;
|
||||
status |= STATUS_UPDATE_ASYNC_REFRESH;
|
||||
}
|
||||
if (render_queue[RENDER_QUEUE_BTM] || status & (STATUS_UPDATE_SCREEN_RESIZE | STATUS_UPDATE_SCREEN_CLEAR)) {
|
||||
wnoutrefresh(win_b);
|
||||
render_queue[RENDER_QUEUE_BTM] = 0;
|
||||
status |= STATUS_UPDATE_ASYNC_REFRESH;
|
||||
}
|
||||
if (status & STATUS_UPDATE_SCREEN_MASK) {
|
||||
if (pthread_mutex_lock(&mutex_render) == 0 || status & STATUS_UPDATE_SCREEN_MASK) {
|
||||
doupdate();
|
||||
status &= ~STATUS_UPDATE_SCREEN_MASK;
|
||||
pthread_mutex_unlock(&mutex_render);
|
||||
}
|
||||
}
|
||||
/*this function exists for things done at startup (initialization, reading config, etc)*/
|
||||
|
||||
Reference in New Issue
Block a user