ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.266 by root, Sun Jul 20 02:51:40 2008 UTC vs.
Revision 1.271 by root, Sun Jul 20 15:09:29 2008 UTC

367 self->oy = 0; 367 self->oy = 0;
368 self->row = 0; 368 self->row = 0;
369 self->rows = 0; 369 self->rows = 0;
370} 370}
371 371
372#define CELL_CLEAR(cell) \
373 do { \
374 if ((cell)->player) \
375 (cell)->tile [2] = 0; \
376 (cell)->darkness = 0; \
377 (cell)->stat_hp = 0; \
378 (cell)->flags = 0; \
379 (cell)->player = 0; \
380 } while (0)
381
372static void 382static void
373map_blank (DC__Map self, int x0, int y0, int w, int h) 383map_blank (DC__Map self, int x0, int y0, int w, int h)
374{ 384{
375 int x, y; 385 int x, y;
376 maprow *row; 386 maprow *row;
390 if (x >= row->c1) 400 if (x >= row->c1)
391 break; 401 break;
392 402
393 cell = row->col + x - row->c0; 403 cell = row->col + x - row->c0;
394 404
395 cell->darkness = 0; 405 CELL_CLEAR (cell);
396 cell->stat_hp = 0;
397 cell->flags = 0;
398 cell->player = 0;
399 } 406 }
400 } 407 }
401} 408}
402 409
403typedef struct { 410typedef struct {
664 const_iv (SDL_GL_ACCUM_ALPHA_SIZE), 671 const_iv (SDL_GL_ACCUM_ALPHA_SIZE),
665 const_iv (SDL_GL_STEREO), 672 const_iv (SDL_GL_STEREO),
666 const_iv (SDL_GL_MULTISAMPLEBUFFERS), 673 const_iv (SDL_GL_MULTISAMPLEBUFFERS),
667 const_iv (SDL_GL_MULTISAMPLESAMPLES), 674 const_iv (SDL_GL_MULTISAMPLESAMPLES),
668 const_iv (SDL_GL_ACCELERATED_VISUAL), 675 const_iv (SDL_GL_ACCELERATED_VISUAL),
669 const_iv (SDL_GL_SWAP_CONTROL) 676 const_iv (SDL_GL_SWAP_CONTROL),
677
678 const_iv (FOW_DARKNESS)
670# undef const_iv 679# undef const_iv
671 }; 680 };
672 681
673 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; )
674 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 683 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
1780 } 1789 }
1781 } 1790 }
1782 } 1791 }
1783 } 1792 }
1784 else 1793 else
1785 { 1794 CELL_CLEAR (cell);
1786 cell->darkness = 0;
1787 cell->stat_hp = 0;
1788 cell->flags = 0;
1789 cell->player = 0;
1790 }
1791 } 1795 }
1792} 1796}
1793 OUTPUT: 1797 OUTPUT:
1794 RETVAL 1798 RETVAL
1795 1799
2232 SvCUR_set (darkness3_sv, sw34 * sh3); 2236 SvCUR_set (darkness3_sv, sw34 * sh3);
2233 2237
2234 mx += self->x - 1; 2238 mx += self->x - 1;
2235 my += self->y - 1; 2239 my += self->y - 1;
2236 2240
2237 memset (darkness1, 255, sw1 * sh1); 2241 memset (darkness1, 255 - FOW_DARKNESS, sw1 * sh1);
2238 2242
2239 for (y = 0; y < sh1; y++) 2243 for (y = 0; y < sh1; y++)
2240 if (0 <= y + my && y + my < self->rows) 2244 if (0 <= y + my && y + my < self->rows)
2241 { 2245 {
2242 maprow *row = self->row + (y + my); 2246 maprow *row = self->row + (y + my);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines