Mercurial > mplayer.hg
annotate gui/ui/render.c @ 36920:40ad45360c8a
Replace old item 'potmeter' by new item 'pimage'.
Recent versions of the X11/GTK GUI didn't allow to control a potmeter,
because that didn't seem to make any sense.
In order to get rid of the confusing potmeter that doesn't distinguish
from a hpotmeter and in order to allow the more useful behaviour recent
versions of the X11/GTK GUI have been utilized (and because we're still
supporting item 'potmeter' for reasons of compatibility with old skins),
introduce new item 'pimage' that reuses most of the current potmeter
code.
Additionally, remove remaining code and documentation of 'potmeter'.
author | ib |
---|---|
date | Mon, 17 Mar 2014 12:29:46 +0000 |
parents | e0a0b0846c4e |
children | 974ee5f5bf44 |
rev | line source |
---|---|
26458 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
18 |
33123
9566100d88a1
Replace inttypes.h by stdint.h and remove inttypes.h where unneeded.
ib
parents:
32982
diff
changeset
|
19 #include <stdint.h> |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
20 #include <stdio.h> |
32963 | 21 #include <stdlib.h> |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
22 #include <string.h> |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
23 |
33556 | 24 #include "render.h" |
32952 | 25 #include "gui/interface.h" |
26365
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
25603
diff
changeset
|
26 #include "gui/skin/font.h" |
34175 | 27 #include "gui/util/string.h" |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
28 |
32963 | 29 #include "libavutil/avstring.h" |
32954 | 30 #include "osdep/timer.h" |
32963 | 31 #include "stream/stream.h" |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
32 |
33269 | 33 #define DLABEL_DELAY 2500 // in milliseconds |
34 | |
32963 | 35 static char *image_buffer; |
36 static int image_width; | |
32956 | 37 |
32975
0dc9d64cd64e
Make functions static that are only used inside the file.
ib
parents:
32973
diff
changeset
|
38 static char *Translate(char *str) |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
39 { |
32963 | 40 static char trbuf[512]; |
41 char tmp[512]; | |
32972 | 42 unsigned int i, c; |
32963 | 43 int t; |
44 | |
32972 | 45 *trbuf = 0; |
32963 | 46 |
32972 | 47 for (c = 0, i = 0; i < strlen(str); i++) { |
32963 | 48 if (str[i] != '$') { |
32972 | 49 if (c + 1 < sizeof(trbuf)) { |
32973 | 50 trbuf[c++] = str[i]; |
51 trbuf[c] = 0; | |
32972 | 52 } |
32963 | 53 } else { |
54 switch (str[++i]) { | |
55 case 't': | |
33555 | 56 snprintf(tmp, sizeof(tmp), "%02d", guiInfo.Track); |
32963 | 57 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
58 break; | |
59 | |
60 case 'o': | |
61 TranslateFilename(0, tmp, sizeof(tmp)); | |
62 av_strlcat(trbuf, tmp, sizeof(trbuf)); | |
63 break; | |
64 | |
65 case 'f': | |
66 TranslateFilename(1, tmp, sizeof(tmp)); | |
67 av_strlcat(trbuf, tmp, sizeof(trbuf)); | |
68 break; | |
69 | |
70 case 'F': | |
71 TranslateFilename(2, tmp, sizeof(tmp)); | |
72 av_strlcat(trbuf, tmp, sizeof(trbuf)); | |
73 break; | |
74 | |
75 case '6': | |
33897 | 76 t = guiInfo.RunningTime; |
32963 | 77 goto calclengthhhmmss; |
78 | |
79 case '1': | |
33897 | 80 t = guiInfo.ElapsedTime; |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
81 calclengthhhmmss: |
32963 | 82 snprintf(tmp, sizeof(tmp), "%02d:%02d:%02d", t / 3600, t / 60 % 60, t % 60); |
83 av_strlcat(trbuf, tmp, sizeof(trbuf)); | |
84 break; | |
85 | |
86 case '7': | |
33897 | 87 t = guiInfo.RunningTime; |
32963 | 88 goto calclengthmmmmss; |
89 | |
90 case '2': | |
33897 | 91 t = guiInfo.ElapsedTime; |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
92 calclengthmmmmss: |
32963 | 93 snprintf(tmp, sizeof(tmp), "%04d:%02d", t / 60, t % 60); |
94 av_strlcat(trbuf, tmp, sizeof(trbuf)); | |
95 break; | |
96 | |
97 case '3': | |
33897 | 98 snprintf(tmp, sizeof(tmp), "%02d", guiInfo.ElapsedTime / 3600); |
32963 | 99 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
100 break; | |
101 | |
102 case '4': | |
33897 | 103 snprintf(tmp, sizeof(tmp), "%02d", (guiInfo.ElapsedTime / 60) % 60); |
32963 | 104 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
105 break; | |
106 | |
107 case '5': | |
33897 | 108 snprintf(tmp, sizeof(tmp), "%02d", guiInfo.ElapsedTime % 60); |
32963 | 109 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
110 break; | |
111 | |
112 case '8': | |
33897 | 113 snprintf(tmp, sizeof(tmp), "%01d:%02d:%02d", guiInfo.ElapsedTime / 3600, (guiInfo.ElapsedTime / 60) % 60, guiInfo.ElapsedTime % 60); |
32963 | 114 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
115 break; | |
116 | |
117 case 'v': | |
33555 | 118 snprintf(tmp, sizeof(tmp), "%3.2f%%", guiInfo.Volume); |
32963 | 119 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
120 break; | |
121 | |
122 case 'V': | |
33555 | 123 snprintf(tmp, sizeof(tmp), "%3.1f", guiInfo.Volume); |
32963 | 124 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
125 break; | |
126 | |
36916 | 127 case 'U': |
128 snprintf(tmp, sizeof(tmp), "%3.0f", guiInfo.Volume); | |
129 av_strlcat(trbuf, tmp, sizeof(trbuf)); | |
130 break; | |
131 | |
32963 | 132 case 'b': |
33555 | 133 snprintf(tmp, sizeof(tmp), "%3.2f%%", guiInfo.Balance); |
32963 | 134 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
135 break; | |
136 | |
137 case 'B': | |
33555 | 138 snprintf(tmp, sizeof(tmp), "%3.1f", guiInfo.Balance); |
32963 | 139 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
140 break; | |
141 | |
36914 | 142 case 'D': |
143 snprintf(tmp, sizeof(tmp), "%3.0f", guiInfo.Balance); | |
144 av_strlcat(trbuf, tmp, sizeof(trbuf)); | |
145 break; | |
146 | |
32963 | 147 case 'x': |
33901 | 148 snprintf(tmp, sizeof(tmp), "%d", guiInfo.VideoWidth); |
32963 | 149 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
150 break; | |
151 | |
152 case 'y': | |
33901 | 153 snprintf(tmp, sizeof(tmp), "%d", guiInfo.VideoHeight); |
32963 | 154 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
155 break; | |
156 | |
157 case 'C': | |
35462 | 158 snprintf(tmp, sizeof(tmp), "%s", guiInfo.CodecName ? guiInfo.CodecName : ""); |
32963 | 159 av_strlcat(trbuf, tmp, sizeof(trbuf)); |
160 break; | |
161 | |
162 case 's': | |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33556
diff
changeset
|
163 if (guiInfo.Playing == GUI_STOP) |
32963 | 164 av_strlcat(trbuf, "s", sizeof(trbuf)); |
165 break; | |
166 | |
33616 | 167 case 'l': // legacy |
168 case 'p': | |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33556
diff
changeset
|
169 if (guiInfo.Playing == GUI_PLAY) |
32963 | 170 av_strlcat(trbuf, "p", sizeof(trbuf)); |
171 break; | |
172 | |
173 case 'e': | |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33556
diff
changeset
|
174 if (guiInfo.Playing == GUI_PAUSE) |
32963 | 175 av_strlcat(trbuf, "e", sizeof(trbuf)); |
176 break; | |
177 | |
36918 | 178 case 'P': |
179 switch (guiInfo.Playing) { | |
180 case GUI_STOP: | |
181 av_strlcat(trbuf, "s", sizeof(trbuf)); | |
182 break; | |
183 | |
184 case GUI_PLAY: | |
185 av_strlcat(trbuf, "p", sizeof(trbuf)); | |
186 break; | |
187 | |
188 case GUI_PAUSE: | |
189 av_strlcat(trbuf, "e", sizeof(trbuf)); | |
190 break; | |
191 } | |
192 break; | |
193 | |
32963 | 194 case 'a': |
33646 | 195 switch (guiInfo.AudioChannels) { |
32963 | 196 case 0: |
197 av_strlcat(trbuf, "n", sizeof(trbuf)); | |
198 break; | |
199 | |
200 case 1: | |
201 av_strlcat(trbuf, "m", sizeof(trbuf)); | |
202 break; | |
203 | |
204 case 2: | |
205 av_strlcat(trbuf, "t", sizeof(trbuf)); | |
206 break; | |
36910
11932adad7a2
Add symbol character 'r' for dynamic label variable $a.
ib
parents:
36909
diff
changeset
|
207 |
11932adad7a2
Add symbol character 'r' for dynamic label variable $a.
ib
parents:
36909
diff
changeset
|
208 default: |
11932adad7a2
Add symbol character 'r' for dynamic label variable $a.
ib
parents:
36909
diff
changeset
|
209 av_strlcat(trbuf, "r", sizeof(trbuf)); |
11932adad7a2
Add symbol character 'r' for dynamic label variable $a.
ib
parents:
36909
diff
changeset
|
210 break; |
32963 | 211 } |
212 break; | |
213 | |
214 case 'T': | |
33555 | 215 switch (guiInfo.StreamType) { |
32963 | 216 case STREAMTYPE_FILE: |
217 av_strlcat(trbuf, "f", sizeof(trbuf)); | |
218 break; | |
219 | |
34077 | 220 case STREAMTYPE_STREAM: |
221 av_strlcat(trbuf, "u", sizeof(trbuf)); | |
222 break; | |
223 | |
34387 | 224 case STREAMTYPE_CDDA: |
225 av_strlcat(trbuf, "a", sizeof(trbuf)); | |
226 break; | |
227 | |
32963 | 228 case STREAMTYPE_VCD: |
229 av_strlcat(trbuf, "v", sizeof(trbuf)); | |
230 break; | |
231 | |
232 case STREAMTYPE_DVD: | |
233 av_strlcat(trbuf, "d", sizeof(trbuf)); | |
234 break; | |
235 | |
36429 | 236 case STREAMTYPE_TV: |
237 case STREAMTYPE_DVB: | |
238 av_strlcat(trbuf, "b", sizeof(trbuf)); | |
239 break; | |
240 | |
32963 | 241 default: |
242 av_strlcat(trbuf, " ", sizeof(trbuf)); | |
243 break; | |
244 } | |
245 break; | |
246 | |
247 case '$': | |
248 av_strlcat(trbuf, "$", sizeof(trbuf)); | |
249 break; | |
250 | |
251 default: | |
252 continue; | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
253 } |
32963 | 254 |
255 c = strlen(trbuf); | |
256 } | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
257 } |
32963 | 258 |
259 return trbuf; | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
260 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
261 |
33555 | 262 static void PutImage(guiImage *bf, int x, int y, int max, int ofs) |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
263 { |
32963 | 264 int i = 0, ix, iy; |
265 uint32_t *buf = NULL; | |
266 uint32_t *drw = NULL; | |
267 register uint32_t tmp; | |
268 | |
269 /* register uint32_t yc; */ | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
270 |
32963 | 271 if (!bf || (bf->Image == NULL)) |
272 return; | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
273 |
32963 | 274 i = bf->Width * (bf->Height / max) * ofs; |
275 buf = (uint32_t *)image_buffer; | |
276 drw = (uint32_t *)bf->Image; | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
277 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
278 #if 1 |
32963 | 279 for (iy = y; iy < (int)(y + bf->Height / max); iy++) |
280 for (ix = x; ix < (int)(x + bf->Width); ix++) { | |
281 tmp = drw[i++]; | |
282 | |
33534 | 283 if (!IS_TRANSPARENT(tmp)) |
32963 | 284 buf[iy * image_width + ix] = tmp; |
285 } | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
286 #else |
32963 | 287 yc = y * image_width; |
288 | |
289 for (iy = y; iy < (int)(y + bf->Height / max); iy++) { | |
290 for (ix = x; ix < (int)(x + bf->Width); ix++) { | |
291 tmp = drw[i++]; | |
292 | |
33534 | 293 if (!IS_TRANSPARENT(tmp)) |
32963 | 294 buf[yc + ix] = tmp; |
295 } | |
296 | |
297 yc += image_width; | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
298 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
299 #endif |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
300 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
301 |
33555 | 302 static void SimplePotmeterPutImage(guiImage *bf, int x, int y, float frac) |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
303 { |
32963 | 304 int i = 0, w, r, ix, iy; |
305 uint32_t *buf = NULL; | |
306 uint32_t *drw = NULL; | |
307 register uint32_t tmp; | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
308 |
32963 | 309 if (!bf || (bf->Image == NULL)) |
310 return; | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
311 |
32963 | 312 buf = (uint32_t *)image_buffer; |
313 drw = (uint32_t *)bf->Image; | |
314 w = bf->Width * frac; | |
315 r = bf->Width - w; | |
316 | |
317 for (iy = y; iy < (int)(y + bf->Height); iy++) { | |
318 for (ix = x; ix < (int)(x + w); ix++) { | |
319 tmp = drw[i++]; | |
320 | |
33534 | 321 if (!IS_TRANSPARENT(tmp)) |
32963 | 322 buf[iy * image_width + ix] = tmp; |
323 } | |
324 | |
325 i += r; | |
326 } | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
327 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
328 |
35688 | 329 void RenderAll(wsWindow *window, guiItem *Items, int nrItems, char *db) |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
330 { |
35688 | 331 guiItem *item; |
33555 | 332 guiImage *image = NULL; |
32963 | 333 int i, ofs; |
334 | |
335 image_buffer = db; | |
336 image_width = window->Width; | |
337 | |
338 for (i = 0; i < nrItems + 1; i++) { | |
339 item = &Items[i]; | |
32966
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
340 |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
341 switch (item->pressed) { |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
342 case btnPressed: |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
343 ofs = 0; |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
344 break; |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
345 |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
346 case btnReleased: |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
347 ofs = 1; |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
348 break; |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
349 |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
350 default: |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
351 ofs = 2; |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
352 break; |
1f51f39916e1
Replace ternary operator by more intelligible switch statement.
ib
parents:
32965
diff
changeset
|
353 } |
32963 | 354 |
355 switch (item->type) { | |
356 case itButton: | |
35541 | 357 |
32963 | 358 PutImage(&item->Bitmap, item->x, item->y, 3, ofs); |
359 break; | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
360 |
36920 | 361 case itPimage: |
35541 | 362 |
32963 | 363 if (item->numphases == 1) |
32970
3673c28ce811
Use double constants for higher precision calculations.
ib
parents:
32969
diff
changeset
|
364 SimplePotmeterPutImage(&item->Bitmap, item->x, item->y, item->value / 100.0); |
32963 | 365 else |
32970
3673c28ce811
Use double constants for higher precision calculations.
ib
parents:
32969
diff
changeset
|
366 PutImage(&item->Bitmap, item->x, item->y, item->numphases, (item->numphases - 1) * (item->value / 100.0)); |
35541 | 367 |
32963 | 368 break; |
369 | |
370 case itHPotmeter: | |
35541 | 371 |
32963 | 372 if (item->numphases == 1) |
32970
3673c28ce811
Use double constants for higher precision calculations.
ib
parents:
32969
diff
changeset
|
373 SimplePotmeterPutImage(&item->Bitmap, item->x, item->y, item->value / 100.0); |
32963 | 374 else |
32970
3673c28ce811
Use double constants for higher precision calculations.
ib
parents:
32969
diff
changeset
|
375 PutImage(&item->Bitmap, item->x, item->y, item->numphases, (item->numphases - 1) * (item->value / 100.0)); |
35541 | 376 |
32970
3673c28ce811
Use double constants for higher precision calculations.
ib
parents:
32969
diff
changeset
|
377 PutImage(&item->Mask, item->x + (item->width - item->pwidth) * (item->value / 100.0), item->y, 3, ofs); |
32963 | 378 break; |
379 | |
380 case itVPotmeter: | |
35541 | 381 |
32970
3673c28ce811
Use double constants for higher precision calculations.
ib
parents:
32969
diff
changeset
|
382 PutImage(&item->Bitmap, item->x, item->y, item->numphases, item->numphases * (1.0 - item->value / 100.0)); |
3673c28ce811
Use double constants for higher precision calculations.
ib
parents:
32969
diff
changeset
|
383 PutImage(&item->Mask, item->x, item->y + (item->height - item->pheight) * (1.0 - item->value / 100.0), 3, ofs); |
32963 | 384 break; |
385 | |
386 case itSLabel: | |
35541 | 387 |
32969 | 388 if (item->width == -1) |
389 item->width = fntTextWidth(item->fontid, item->label); | |
35541 | 390 |
33971 | 391 image = fntTextRender(item, 0, item->label); |
35541 | 392 |
32963 | 393 if (image) |
394 PutImage(image, item->x, item->y, 1, 0); | |
35541 | 395 |
32969 | 396 break; |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
397 |
32963 | 398 case itDLabel: |
399 { | |
400 int x; | |
401 unsigned int d; | |
402 char *t = Translate(item->label); | |
403 | |
404 if (!item->text || (strcmp(item->text, t) != 0)) { | |
405 free(item->text); | |
406 item->text = strdup(t); | |
407 item->textwidth = fntTextWidth(item->fontid, t); | |
408 item->starttime = GetTimerMS(); | |
409 item->last_x = 0; | |
32761
3ceeb62a1125
Improve the readability of dynamic labels which scroll.
ib
parents:
32759
diff
changeset
|
410 } |
32963 | 411 |
412 d = GetTimerMS() - item->starttime; | |
413 | |
32964 | 414 if (d < DLABEL_DELAY) |
32963 | 415 x = item->last_x; // don't scroll yet |
416 else { | |
417 int l; | |
418 char c[2]; | |
419 | |
420 l = (item->textwidth ? item->textwidth : item->width); | |
35362 | 421 x = (l ? l - ((d - DLABEL_DELAY) / 20) % l - 1 : 0); |
32963 | 422 c[0] = *item->text; |
423 c[1] = '\0'; | |
424 | |
425 if (x < (fntTextWidth(item->fontid, c) + 1) >> 1) { | |
426 item->starttime = GetTimerMS(); // stop again | |
427 item->last_x = x; // at current x pos | |
428 } | |
32761
3ceeb62a1125
Improve the readability of dynamic labels which scroll.
ib
parents:
32759
diff
changeset
|
429 } |
32963 | 430 |
33971 | 431 image = fntTextRender(item, x, t); |
32963 | 432 } |
433 | |
434 if (image) | |
435 PutImage(image, item->x, item->y, 1, 0); | |
436 | |
437 break; | |
438 } | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
439 } |
32963 | 440 |
35744 | 441 wsImageRender(window, db); |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
442 } |