[79ae36dd] | 1 | /*
|
---|
| 2 | * Copyright (c) 2011 Martin Decky
|
---|
| 3 | * All rights reserved.
|
---|
[e9a3c52] | 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
[79ae36dd] | 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** Attributations
|
---|
| 30 | *
|
---|
| 31 | * screen.c 8.1 (Berkeley) 5/31/93
|
---|
| 32 | * NetBSD: screen.c,v 1.4 1995/04/29 01:11:36 mycroft
|
---|
| 33 | * OpenBSD: screen.c,v 1.13 2006/04/20 03:25:36 ray
|
---|
| 34 | *
|
---|
| 35 | * Based upon BSD Tetris
|
---|
| 36 | *
|
---|
| 37 | * Copyright (c) 1992, 1993
|
---|
| 38 | * The Regents of the University of California.
|
---|
| 39 | * Distributed under BSD license.
|
---|
| 40 | *
|
---|
| 41 | * This code is derived from software contributed to Berkeley by
|
---|
| 42 | * Chris Torek and Darren F. Provine.
|
---|
[e9a3c52] | 43 | *
|
---|
| 44 | */
|
---|
| 45 |
|
---|
[b2951e2] | 46 | /** @addtogroup tetris
|
---|
[ebe70f1] | 47 | * @{
|
---|
[b2951e2] | 48 | */
|
---|
| 49 | /** @file
|
---|
| 50 | */
|
---|
| 51 |
|
---|
[e9a3c52] | 52 | /*
|
---|
| 53 | * Tetris screen control.
|
---|
| 54 | */
|
---|
| 55 |
|
---|
[87822ce] | 56 | #include <errno.h>
|
---|
[e9a3c52] | 57 | #include <stdio.h>
|
---|
| 58 | #include <stdlib.h>
|
---|
[19f857a] | 59 | #include <str.h>
|
---|
[0c25c10] | 60 | #include <vfs/vfs.h>
|
---|
[f1b4e74] | 61 | #include <async.h>
|
---|
[3e6a98c5] | 62 | #include <stdbool.h>
|
---|
[9f1362d4] | 63 | #include <io/console.h>
|
---|
| 64 | #include <io/style.h>
|
---|
[e9a3c52] | 65 | #include "screen.h"
|
---|
| 66 | #include "tetris.h"
|
---|
| 67 |
|
---|
[ebe70f1] | 68 | #define STOP (B_COLS - 3)
|
---|
| 69 |
|
---|
| 70 | static cell curscreen[B_SIZE]; /* non-zero => standout (or otherwise marked) */
|
---|
[e9a3c52] | 71 | static int curscore;
|
---|
[ebe70f1] | 72 | static int isset; /* true => terminal is in game mode */
|
---|
| 73 |
|
---|
[e116461] | 74 | static bool use_rgb; /* true => use RGB colors */
|
---|
| 75 | static bool use_color; /* true => use indexed colors */
|
---|
[50cfa6c] | 76 |
|
---|
[ebe70f1] | 77 | static const struct shape *lastshape;
|
---|
[f1b4e74] | 78 |
|
---|
[bd41ac52] | 79 | static usec_t timeleft = 0;
|
---|
[79ae36dd] | 80 |
|
---|
| 81 | console_ctrl_t *console;
|
---|
| 82 |
|
---|
[e9a3c52] | 83 | /*
|
---|
[f1b4e74] | 84 | * putstr() is for unpadded strings (either as in termcap(5) or
|
---|
[0c25c10] | 85 | * simply literal strings);
|
---|
[e9a3c52] | 86 | */
|
---|
[a000878c] | 87 | static inline void putstr(const char *s)
|
---|
[59ed572] | 88 | {
|
---|
| 89 | while (*s)
|
---|
| 90 | putchar(*(s++));
|
---|
| 91 | }
|
---|
[e9a3c52] | 92 |
|
---|
[ebe70f1] | 93 | static void start_standout(uint32_t color)
|
---|
[e9a3c52] | 94 | {
|
---|
[e116461] | 95 | uint8_t bg;
|
---|
| 96 | uint8_t attr;
|
---|
| 97 |
|
---|
[79ae36dd] | 98 | console_flush(console);
|
---|
[e116461] | 99 | if (use_rgb) {
|
---|
| 100 | console_set_rgb_color(console, color, 0xffffff);
|
---|
| 101 | } else if (use_color) {
|
---|
| 102 | bg = 0x00;
|
---|
| 103 | attr = 0;
|
---|
| 104 | if ((color & 0xff0000) != 0)
|
---|
| 105 | bg |= 0x4;
|
---|
| 106 | if ((color & 0x00ff00) != 0)
|
---|
| 107 | bg |= 0x2;
|
---|
| 108 | if ((color & 0x0000ff) != 0)
|
---|
| 109 | bg |= 0x1;
|
---|
| 110 | console_set_color(console, bg, 0x00, attr);
|
---|
| 111 | }
|
---|
[f1b4e74] | 112 | }
|
---|
[e9a3c52] | 113 |
|
---|
[f1b4e74] | 114 | static void resume_normal(void)
|
---|
| 115 | {
|
---|
[79ae36dd] | 116 | console_flush(console);
|
---|
| 117 | console_set_style(console, STYLE_NORMAL);
|
---|
[e9a3c52] | 118 | }
|
---|
| 119 |
|
---|
[9996ed5] | 120 | void clear_screen(void)
|
---|
| 121 | {
|
---|
[79ae36dd] | 122 | console_clear(console);
|
---|
[0cc4313] | 123 | moveto(0, 0);
|
---|
[9996ed5] | 124 | }
|
---|
| 125 |
|
---|
[e9a3c52] | 126 | /*
|
---|
[f1b4e74] | 127 | * Clear the screen, forgetting the current contents in the process.
|
---|
[e9a3c52] | 128 | */
|
---|
[ebe70f1] | 129 | void scr_clear(void)
|
---|
[f1b4e74] | 130 | {
|
---|
[d6cc453] | 131 | resume_normal();
|
---|
[79ae36dd] | 132 | console_clear(console);
|
---|
[f1b4e74] | 133 | curscore = -1;
|
---|
[ebe70f1] | 134 | memset(curscreen, 0, sizeof(curscreen));
|
---|
[f1b4e74] | 135 | }
|
---|
[b917098] | 136 |
|
---|
[e9a3c52] | 137 | /*
|
---|
[f1b4e74] | 138 | * Set up screen
|
---|
[e9a3c52] | 139 | */
|
---|
[ebe70f1] | 140 | void scr_init(void)
|
---|
[e9a3c52] | 141 | {
|
---|
[79ae36dd] | 142 | console_cursor_visibility(console, 0);
|
---|
[f1b4e74] | 143 | resume_normal();
|
---|
| 144 | scr_clear();
|
---|
[e9a3c52] | 145 | }
|
---|
| 146 |
|
---|
[96b02eb9] | 147 | void moveto(sysarg_t r, sysarg_t c)
|
---|
[f1b4e74] | 148 | {
|
---|
[79ae36dd] | 149 | console_flush(console);
|
---|
| 150 | console_set_pos(console, c, r);
|
---|
[f1b4e74] | 151 | }
|
---|
| 152 |
|
---|
[9996ed5] | 153 | winsize_t winsize;
|
---|
[f1b4e74] | 154 |
|
---|
[b7fd2a0] | 155 | static errno_t get_display_size(winsize_t *ws)
|
---|
[f1b4e74] | 156 | {
|
---|
[79ae36dd] | 157 | return console_get_size(console, &ws->ws_col, &ws->ws_row);
|
---|
[f1b4e74] | 158 | }
|
---|
[e9a3c52] | 159 |
|
---|
[e116461] | 160 | static void get_display_color_sup(bool *rgb, bool *color)
|
---|
[50cfa6c] | 161 | {
|
---|
[96b02eb9] | 162 | sysarg_t ccap;
|
---|
[b7fd2a0] | 163 | errno_t rc = console_get_color_cap(console, &ccap);
|
---|
[a35b458] | 164 |
|
---|
[e116461] | 165 | if (rc != EOK) {
|
---|
| 166 | *rgb = false;
|
---|
| 167 | *color = false;
|
---|
| 168 | return;
|
---|
| 169 | }
|
---|
[a35b458] | 170 |
|
---|
[e116461] | 171 | *rgb = ((ccap & CONSOLE_CAP_RGB) == CONSOLE_CAP_RGB);
|
---|
| 172 | *color = ((ccap & CONSOLE_CAP_INDEXED) == CONSOLE_CAP_INDEXED);
|
---|
[50cfa6c] | 173 | }
|
---|
| 174 |
|
---|
[e9a3c52] | 175 | /*
|
---|
| 176 | * Set up screen mode.
|
---|
| 177 | */
|
---|
[ebe70f1] | 178 | void scr_set(void)
|
---|
[e9a3c52] | 179 | {
|
---|
[9996ed5] | 180 | winsize_t ws;
|
---|
[a35b458] | 181 |
|
---|
[ebe70f1] | 182 | Rows = 0;
|
---|
| 183 | Cols = 0;
|
---|
[a35b458] | 184 |
|
---|
[f1b4e74] | 185 | if (get_display_size(&ws) == 0) {
|
---|
[e9a3c52] | 186 | Rows = ws.ws_row;
|
---|
| 187 | Cols = ws.ws_col;
|
---|
| 188 | }
|
---|
[50cfa6c] | 189 |
|
---|
[e116461] | 190 | get_display_color_sup(&use_rgb, &use_color);
|
---|
[a35b458] | 191 |
|
---|
[ebe70f1] | 192 | if ((Rows < MINROWS) || (Cols < MINCOLS)) {
|
---|
[e9a3c52] | 193 | char smallscr[55];
|
---|
[a35b458] | 194 |
|
---|
[86029498] | 195 | snprintf(smallscr, sizeof(smallscr),
|
---|
[e9a3c52] | 196 | "the screen is too small (must be at least %dx%d)",
|
---|
| 197 | MINROWS, MINCOLS);
|
---|
| 198 | stop(smallscr);
|
---|
| 199 | }
|
---|
| 200 | isset = 1;
|
---|
[a35b458] | 201 |
|
---|
[e9a3c52] | 202 | scr_clear();
|
---|
| 203 | }
|
---|
| 204 |
|
---|
| 205 | /*
|
---|
| 206 | * End screen mode.
|
---|
| 207 | */
|
---|
[ebe70f1] | 208 | void scr_end(void)
|
---|
[e9a3c52] | 209 | {
|
---|
[79ae36dd] | 210 | console_cursor_visibility(console, 1);
|
---|
[e9a3c52] | 211 | }
|
---|
| 212 |
|
---|
[a000878c] | 213 | void stop(const char *why)
|
---|
[e9a3c52] | 214 | {
|
---|
| 215 | if (isset)
|
---|
| 216 | scr_end();
|
---|
[a35b458] | 217 |
|
---|
[f538ef3] | 218 | fprintf(stderr, "aborting: %s", why);
|
---|
| 219 | abort();
|
---|
[e9a3c52] | 220 | }
|
---|
| 221 |
|
---|
| 222 | /*
|
---|
| 223 | * Update the screen.
|
---|
| 224 | */
|
---|
[ebe70f1] | 225 | void scr_update(void)
|
---|
[e9a3c52] | 226 | {
|
---|
[ebe70f1] | 227 | cell *bp;
|
---|
| 228 | cell *sp;
|
---|
| 229 | cell so;
|
---|
| 230 | cell cur_so = 0;
|
---|
| 231 | int i;
|
---|
| 232 | int j;
|
---|
| 233 | int ccol;
|
---|
[a35b458] | 234 |
|
---|
[ebe70f1] | 235 | /* Always leave cursor after last displayed point */
|
---|
[e9a3c52] | 236 | curscreen[D_LAST * B_COLS - 1] = -1;
|
---|
[a35b458] | 237 |
|
---|
[e9a3c52] | 238 | if (score != curscore) {
|
---|
[f1b4e74] | 239 | moveto(0, 0);
|
---|
[86029498] | 240 | printf("Score: %d", score);
|
---|
[e9a3c52] | 241 | curscore = score;
|
---|
| 242 | }
|
---|
[a35b458] | 243 |
|
---|
[ebe70f1] | 244 | /* Draw preview of next pattern */
|
---|
| 245 | if ((showpreview) && (nextshape != lastshape)) {
|
---|
[e9a3c52] | 246 | int i;
|
---|
[ebe70f1] | 247 | static int r = 5, c = 2;
|
---|
[e9a3c52] | 248 | int tr, tc, t;
|
---|
[a35b458] | 249 |
|
---|
[e9a3c52] | 250 | lastshape = nextshape;
|
---|
[a35b458] | 251 |
|
---|
[ebe70f1] | 252 | /* Clean */
|
---|
[f1b4e74] | 253 | resume_normal();
|
---|
[ebe70f1] | 254 | moveto(r - 1, c - 1);
|
---|
| 255 | putstr(" ");
|
---|
| 256 | moveto(r, c - 1);
|
---|
| 257 | putstr(" ");
|
---|
| 258 | moveto(r + 1, c - 1);
|
---|
| 259 | putstr(" ");
|
---|
| 260 | moveto(r + 2, c - 1);
|
---|
| 261 | putstr(" ");
|
---|
[a35b458] | 262 |
|
---|
[ebe70f1] | 263 | moveto(r - 3, c - 2);
|
---|
[e9a3c52] | 264 | putstr("Next shape:");
|
---|
[a35b458] | 265 |
|
---|
[ebe70f1] | 266 | /* Draw */
|
---|
| 267 | start_standout(nextshape->color);
|
---|
[e9a3c52] | 268 | moveto(r, 2 * c);
|
---|
[f1b4e74] | 269 | putstr(" ");
|
---|
[e9a3c52] | 270 | for (i = 0; i < 3; i++) {
|
---|
| 271 | t = c + r * B_COLS;
|
---|
| 272 | t += nextshape->off[i];
|
---|
[a35b458] | 273 |
|
---|
[e9a3c52] | 274 | tr = t / B_COLS;
|
---|
| 275 | tc = t % B_COLS;
|
---|
[a35b458] | 276 |
|
---|
[1433ecda] | 277 | moveto(tr, 2 * tc);
|
---|
[f1b4e74] | 278 | putstr(" ");
|
---|
[e9a3c52] | 279 | }
|
---|
[f1b4e74] | 280 | resume_normal();
|
---|
[e9a3c52] | 281 | }
|
---|
[a35b458] | 282 |
|
---|
[e9a3c52] | 283 | bp = &board[D_FIRST * B_COLS];
|
---|
| 284 | sp = &curscreen[D_FIRST * B_COLS];
|
---|
| 285 | for (j = D_FIRST; j < D_LAST; j++) {
|
---|
| 286 | ccol = -1;
|
---|
| 287 | for (i = 0; i < B_COLS; bp++, sp++, i++) {
|
---|
| 288 | if (*sp == (so = *bp))
|
---|
| 289 | continue;
|
---|
[a35b458] | 290 |
|
---|
[e9a3c52] | 291 | *sp = so;
|
---|
| 292 | if (i != ccol) {
|
---|
[86029498] | 293 | if (cur_so) {
|
---|
| 294 | resume_normal();
|
---|
| 295 | cur_so = 0;
|
---|
| 296 | }
|
---|
[e9a3c52] | 297 | moveto(RTOD(j), CTOD(i));
|
---|
| 298 | }
|
---|
[a35b458] | 299 |
|
---|
[f1b4e74] | 300 | if (so != cur_so) {
|
---|
| 301 | if (so)
|
---|
[ebe70f1] | 302 | start_standout(so);
|
---|
[f1b4e74] | 303 | else
|
---|
| 304 | resume_normal();
|
---|
| 305 | cur_so = so;
|
---|
| 306 | }
|
---|
| 307 | putstr(" ");
|
---|
[a35b458] | 308 |
|
---|
[e9a3c52] | 309 | ccol = i + 1;
|
---|
| 310 | /*
|
---|
| 311 | * Look ahead a bit, to avoid extra motion if
|
---|
| 312 | * we will be redrawing the cell after the next.
|
---|
| 313 | * Motion probably takes four or more characters,
|
---|
| 314 | * so we save even if we rewrite two cells
|
---|
| 315 | * `unnecessarily'. Skip it all, though, if
|
---|
| 316 | * the next cell is a different color.
|
---|
| 317 | */
|
---|
[a35b458] | 318 |
|
---|
[ebe70f1] | 319 | if ((i > STOP) || (sp[1] != bp[1]) || (so != bp[1]))
|
---|
[e9a3c52] | 320 | continue;
|
---|
[a35b458] | 321 |
|
---|
[e9a3c52] | 322 | if (sp[2] != bp[2])
|
---|
| 323 | sp[1] = -1;
|
---|
[ebe70f1] | 324 | else if ((i < STOP) && (so == bp[2]) && (sp[3] != bp[3])) {
|
---|
[e9a3c52] | 325 | sp[2] = -1;
|
---|
| 326 | sp[1] = -1;
|
---|
| 327 | }
|
---|
| 328 | }
|
---|
| 329 | }
|
---|
[a35b458] | 330 |
|
---|
[86029498] | 331 | if (cur_so)
|
---|
| 332 | resume_normal();
|
---|
[a35b458] | 333 |
|
---|
[79ae36dd] | 334 | console_flush(console);
|
---|
[e9a3c52] | 335 | }
|
---|
| 336 |
|
---|
| 337 | /*
|
---|
[ebe70f1] | 338 | * Write a message (set != 0), or clear the same message (set == 0).
|
---|
[e9a3c52] | 339 | * (We need its length in case we have to overwrite with blanks.)
|
---|
| 340 | */
|
---|
[9f1362d4] | 341 | void scr_msg(char *s, bool set)
|
---|
[e9a3c52] | 342 | {
|
---|
[92fd52d7] | 343 | int l = str_size(s);
|
---|
[a35b458] | 344 |
|
---|
[d6cc453] | 345 | moveto(Rows - 2, ((Cols - l) >> 1) - 1);
|
---|
[a35b458] | 346 |
|
---|
[d6cc453] | 347 | if (set)
|
---|
| 348 | putstr(s);
|
---|
| 349 | else
|
---|
| 350 | while (--l >= 0)
|
---|
| 351 | (void) putchar(' ');
|
---|
[e9a3c52] | 352 | }
|
---|
[b2951e2] | 353 |
|
---|
[79ae36dd] | 354 | /** Sleep for the current turn time
|
---|
| 355 | *
|
---|
| 356 | * Eat any input that might be available.
|
---|
| 357 | *
|
---|
| 358 | */
|
---|
| 359 | void tsleep(void)
|
---|
| 360 | {
|
---|
[bd41ac52] | 361 | usec_t timeout = fallrate;
|
---|
[87822ce] | 362 | errno_t rc;
|
---|
[a35b458] | 363 |
|
---|
[79ae36dd] | 364 | while (timeout > 0) {
|
---|
[07b7c48] | 365 | cons_event_t event;
|
---|
[a35b458] | 366 |
|
---|
[87822ce] | 367 | rc = console_get_event_timeout(console, &event, &timeout);
|
---|
| 368 | if (rc == ETIMEOUT)
|
---|
[79ae36dd] | 369 | break;
|
---|
[87822ce] | 370 | if (rc != EOK)
|
---|
| 371 | exit(1);
|
---|
[79ae36dd] | 372 | }
|
---|
| 373 | }
|
---|
| 374 |
|
---|
| 375 | /** Get char with timeout
|
---|
| 376 | *
|
---|
| 377 | */
|
---|
| 378 | int tgetchar(void)
|
---|
| 379 | {
|
---|
[87822ce] | 380 | errno_t rc;
|
---|
| 381 |
|
---|
[79ae36dd] | 382 | /*
|
---|
| 383 | * Reset timeleft to fallrate whenever it is not positive
|
---|
| 384 | * and increase speed.
|
---|
| 385 | */
|
---|
[a35b458] | 386 |
|
---|
[79ae36dd] | 387 | if (timeleft <= 0) {
|
---|
| 388 | faster();
|
---|
| 389 | timeleft = fallrate;
|
---|
| 390 | }
|
---|
[a35b458] | 391 |
|
---|
[79ae36dd] | 392 | /*
|
---|
| 393 | * Wait to see if there is any input. If so, take it and
|
---|
| 394 | * update timeleft so that the next call to tgetchar()
|
---|
| 395 | * will not wait as long. If there is no input,
|
---|
| 396 | * make timeleft zero and return -1.
|
---|
| 397 | */
|
---|
[a35b458] | 398 |
|
---|
[28a5ebd] | 399 | char32_t c = 0;
|
---|
[a35b458] | 400 |
|
---|
[79ae36dd] | 401 | while (c == 0) {
|
---|
[07b7c48] | 402 | cons_event_t event;
|
---|
[a35b458] | 403 |
|
---|
[87822ce] | 404 | rc = console_get_event_timeout(console, &event, &timeleft);
|
---|
| 405 | if (rc == ETIMEOUT) {
|
---|
[79ae36dd] | 406 | timeleft = 0;
|
---|
| 407 | return -1;
|
---|
| 408 | }
|
---|
[87822ce] | 409 | if (rc != EOK)
|
---|
| 410 | exit(1);
|
---|
[a35b458] | 411 |
|
---|
[07b7c48] | 412 | if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS)
|
---|
| 413 | c = event.ev.key.c;
|
---|
[79ae36dd] | 414 | }
|
---|
[a35b458] | 415 |
|
---|
[79ae36dd] | 416 | return (int) c;
|
---|
| 417 | }
|
---|
| 418 |
|
---|
| 419 | /** Get char without timeout
|
---|
| 420 | *
|
---|
| 421 | */
|
---|
| 422 | int twait(void)
|
---|
| 423 | {
|
---|
[28a5ebd] | 424 | char32_t c = 0;
|
---|
[87822ce] | 425 | errno_t rc;
|
---|
[a35b458] | 426 |
|
---|
[79ae36dd] | 427 | while (c == 0) {
|
---|
[07b7c48] | 428 | cons_event_t event;
|
---|
[a35b458] | 429 |
|
---|
[87822ce] | 430 | rc = console_get_event(console, &event);
|
---|
| 431 | if (rc == ETIMEOUT)
|
---|
[79ae36dd] | 432 | return -1;
|
---|
[87822ce] | 433 | if (rc != EOK)
|
---|
| 434 | exit(1);
|
---|
[a35b458] | 435 |
|
---|
[07b7c48] | 436 | if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS)
|
---|
| 437 | c = event.ev.key.c;
|
---|
[79ae36dd] | 438 | }
|
---|
[a35b458] | 439 |
|
---|
[79ae36dd] | 440 | return (int) c;
|
---|
| 441 | }
|
---|
| 442 |
|
---|
[b2951e2] | 443 | /** @}
|
---|
| 444 | */
|
---|