Change Details
ubb-la/gui.c |
45 | 45 | static SDL_Surface *surf; |
46 | 46 | |
47 | 47 | |
| 48 | /* ----- SDL initialization and screen-wide functions ---------------------- */ |
| 49 | |
| 50 | |
48 | 51 | void gui_init(void) |
49 | 52 | { |
50 | 53 | if (SDL_Init(SDL_INIT_VIDEO) < 0) { |
... | ... | |
70 | 73 | } |
71 | 74 | |
72 | 75 | |
| 76 | static void update(void) |
| 77 | { |
| 78 | SDL_UnlockSurface(surf); |
| 79 | SDL_UpdateRect(surf, 0, 0, 0, 0); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | /* ----- Waveform elements ------------------------------------------------- */ |
| 84 | |
| 85 | |
73 | 86 | static inline int ch_y(int ch, int v) |
74 | 87 | { |
75 | 88 | return CH_YOFF+CH_SKIP*ch+(v ? 0 : CH_HEIGHT); |
... | ... | |
97 | 110 | } |
98 | 111 | |
99 | 112 | |
| 113 | /* ----- Show (part of) a buffer ------------------------------------------- */ |
| 114 | |
| 115 | |
100 | 116 | static void show_buffer_zoom_in(const uint8_t *buf, int skip, int nibbles, |
101 | 117 | int x0, int x1) |
102 | 118 | { |
... | ... | |
206 | 222 | } |
207 | 223 | |
208 | 224 | |
209 | | static void update(void) |
210 | | { |
211 | | SDL_UnlockSurface(surf); |
212 | | SDL_UpdateRect(surf, 0, 0, 0, 0); |
213 | | } |
| 225 | /* ----- Main event loop --------------------------------------------------- */ |
214 | 226 | |
215 | 227 | |
216 | 228 | static int pos_step(int zoom) |
Download the corresponding diff file