… | |
… | |
369 | self->rows = 0; |
369 | self->rows = 0; |
370 | } |
370 | } |
371 | |
371 | |
372 | #define CELL_CLEAR(cell) \ |
372 | #define CELL_CLEAR(cell) \ |
373 | do { \ |
373 | do { \ |
|
|
374 | if ((cell)->player) \ |
|
|
375 | (cell)->tile [2] = 0; \ |
374 | (cell)->darkness = 0; \ |
376 | (cell)->darkness = 0; \ |
375 | (cell)->stat_hp = 0; \ |
377 | (cell)->stat_hp = 0; \ |
376 | (cell)->flags = 0; \ |
378 | (cell)->flags = 0; \ |
377 | (cell)->player = 0; \ |
379 | (cell)->player = 0; \ |
378 | } while (0) |
380 | } while (0) |
… | |
… | |
669 | const_iv (SDL_GL_ACCUM_ALPHA_SIZE), |
671 | const_iv (SDL_GL_ACCUM_ALPHA_SIZE), |
670 | const_iv (SDL_GL_STEREO), |
672 | const_iv (SDL_GL_STEREO), |
671 | const_iv (SDL_GL_MULTISAMPLEBUFFERS), |
673 | const_iv (SDL_GL_MULTISAMPLEBUFFERS), |
672 | const_iv (SDL_GL_MULTISAMPLESAMPLES), |
674 | const_iv (SDL_GL_MULTISAMPLESAMPLES), |
673 | const_iv (SDL_GL_ACCELERATED_VISUAL), |
675 | const_iv (SDL_GL_ACCELERATED_VISUAL), |
674 | const_iv (SDL_GL_SWAP_CONTROL) |
676 | const_iv (SDL_GL_SWAP_CONTROL), |
|
|
677 | |
|
|
678 | const_iv (FOW_DARKNESS) |
675 | # undef const_iv |
679 | # undef const_iv |
676 | }; |
680 | }; |
677 | |
681 | |
678 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
682 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
679 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
683 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
… | |
… | |
696 | RETVAL |
700 | RETVAL |
697 | |
701 | |
698 | NV floor (NV x) |
702 | NV floor (NV x) |
699 | |
703 | |
700 | NV ceil (NV x) |
704 | NV ceil (NV x) |
|
|
705 | |
|
|
706 | NV ceilabs (NV x) |
|
|
707 | CODE: |
|
|
708 | RETVAL = x < 0. ? - ceil (-x) : ceil (x); |
|
|
709 | OUTPUT: |
|
|
710 | RETVAL |
701 | |
711 | |
702 | IV minpot (UV n) |
712 | IV minpot (UV n) |
703 | |
713 | |
704 | IV popcount (UV n) |
714 | IV popcount (UV n) |
705 | |
715 | |
… | |
… | |
2232 | SvCUR_set (darkness3_sv, sw34 * sh3); |
2242 | SvCUR_set (darkness3_sv, sw34 * sh3); |
2233 | |
2243 | |
2234 | mx += self->x - 1; |
2244 | mx += self->x - 1; |
2235 | my += self->y - 1; |
2245 | my += self->y - 1; |
2236 | |
2246 | |
2237 | memset (darkness1, 255, sw1 * sh1); |
2247 | memset (darkness1, 255 - FOW_DARKNESS, sw1 * sh1); |
2238 | |
2248 | |
2239 | for (y = 0; y < sh1; y++) |
2249 | for (y = 0; y < sh1; y++) |
2240 | if (0 <= y + my && y + my < self->rows) |
2250 | if (0 <= y + my && y + my < self->rows) |
2241 | { |
2251 | { |
2242 | maprow *row = self->row + (y + my); |
2252 | maprow *row = self->row + (y + my); |