ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/los.C
(Generate patch)

Comparing deliantra/server/common/los.C (file contents):
Revision 1.72 by root, Tue Jan 3 11:25:31 2012 UTC vs.
Revision 1.74 by root, Wed Nov 16 23:03:09 2016 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * 5 *
6 * Deliantra is free software: you can redistribute it and/or modify it under 6 * Deliantra is free software: you can redistribute it and/or modify it under
7 * the terms of the Affero GNU General Public License as published by the 7 * the terms of the Affero GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your 8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version. 9 * option) any later version.
10 * 10 *
11 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 * 15 *
16 * You should have received a copy of the Affero GNU General Public License 16 * You should have received a copy of the Affero GNU General Public License
17 * and the GNU General Public License along with this program. If not, see 17 * and the GNU General Public License along with this program. If not, see
18 * <http://www.gnu.org/licenses/>. 18 * <http://www.gnu.org/licenses/>.
19 * 19 *
20 * The authors can be reached via e-mail to <support@deliantra.net> 20 * The authors can be reached via e-mail to <support@deliantra.net>
21 */ 21 */
22 22
23#include <global.h> 23#include <global.h>
24#include <cmath> 24#include <cmath>
51 51
52// temporary storage for the los algorithm, 52// temporary storage for the los algorithm,
53// one los_info for each lightable map space 53// one los_info for each lightable map space
54static los_info los[MAP_CLIENT_X][MAP_CLIENT_Y]; 54static los_info los[MAP_CLIENT_X][MAP_CLIENT_Y];
55 55
56struct point 56struct point8
57{ 57{
58 sint8 x, y; 58 sint8 x, y;
59}; 59};
60 60
61// minimum size, but must be a power of two 61// minimum size, but must be a power of two
62#define QUEUE_LENGTH ((MAP_CLIENT_X + MAP_CLIENT_Y) * 2) 62#define QUEUE_LENGTH ((MAP_CLIENT_X + MAP_CLIENT_Y) * 2)
63 63
64// a queue of spaces to calculate 64// a queue of spaces to calculate
65static point queue [QUEUE_LENGTH]; 65static point8 queue [QUEUE_LENGTH];
66static int q1, q2; // queue start, end 66static int q1, q2; // queue start, end
67 67
68/* 68/*
69 * Clears/initialises the los-array associated to the player 69 * Clears/initialises the los-array associated to the player
70 * controlling the object. 70 * controlling the object.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines