source: titan/titan/autores.h @ 15297

Last change on this file since 15297 was 14082, checked in by nit, 12 years ago

[titan] first step anim screens

File size: 1.4 KB
Line 
1#ifndef AUTORES_H
2#define AUTORES_H
3
4void screenautores(char* text, int timeout, int flag)
5{
6        debug(1000, "in");
7        int rcret = -1, tmpscreencalc = 0, fromthread = 0;
8        struct skin* autores = getscreen("autores");
9        struct skin* framebuffer = getscreen("framebuffer");
10        char* bg = NULL;
11
12        if(pthread_self() != status.mainthread)
13                fromthread = 1;
14
15        changetext(autores, text);
16
17        if(fromthread == 1)
18        {
19                m_lock(&status.drawingmutex, 0);
20                m_lock(&status.rcmutex, 10);
21                tmpscreencalc = status.screencalc;
22                status.screencalc = 2;
23                setnodeattr(autores, framebuffer);
24                status.screencalc = tmpscreencalc;
25                status.rcowner = autores;
26                bg = savescreen(autores);
27                tmpscreencalc = status.screencalc;
28                status.screencalc = 0;
29                drawscreen(autores, 2);
30        }
31        else
32                drawscreen(autores, 0);
33
34        //deaktivate for test, so we can end the screen with each keypress
35        //while(rcret != RCTIMEOUT && rcret != getrcconfigint("rcexit", NULL))
36                        rcret = waitrc(autores, timeout * 1000, 0);
37
38        if(fromthread != 1)
39                delownerrc(autores);
40
41        if(fromthread == 1)
42        {
43                clearscreennolock(autores);
44                restorescreen(bg, autores);
45                blitfb(0);
46                status.screencalc = tmpscreencalc;
47                sleep(1);
48                status.rcowner = NULL;
49                m_unlock(&status.rcmutex, 10);
50                m_unlock(&status.drawingmutex, 0);
51        }
52        else
53        {
54                clearscreen(autores);
55                drawscreen(skin, 0);
56        }
57
58        debug(1000, "out");
59}
60
61void autoresthreadfunc(struct stimerthread* self, char* text, int timeout)
62{
63        screenautores(text, timeout, 0);
64}
65
66#endif
Note: See TracBrowser for help on using the repository browser.