Beispiel #1
0
static void check_quadrant(map_t *m,int startX,int startY,int dx, int dy, int extentX,int extentY, bool light_walls) {
    TCOD_list_t active_views=TCOD_list_new();
    line_t shallow_line= {offset,limit,extentX*STEP_SIZE,0};
    line_t steep_line= {limit,offset,0,extentY*STEP_SIZE};
    int maxI=extentX+extentY,i=1;
    view_t *view= &views[startX+startY*m->width];

    view->shallow_line=shallow_line;
    view->steep_line=steep_line;
    view->shallow_bump=NULL;
    view->steep_bump=NULL;
    TCOD_list_push(active_views,view);
    current_view=(view_t **)TCOD_list_begin(active_views);
    while ( i  != maxI+1 && ! TCOD_list_is_empty(active_views) ) {
        int startJ=MAX(i-extentX,0);
        int maxJ=MIN(i,extentY);
        int j=startJ;
        while ( j != maxJ+1 && ! TCOD_list_is_empty(active_views) && current_view != (view_t **)TCOD_list_end(active_views) ) {
            int x=(i - j)*STEP_SIZE;
            int y=j*STEP_SIZE;
            visit_coords(m,startX,startY,x,y,dx,dy,active_views, light_walls);
            j++;
        }
        i++;
        current_view=(view_t **)TCOD_list_begin(active_views);
    }
    TCOD_list_delete(active_views);
}
Beispiel #2
0
/*
 +-----------------------------------------------------------+
 * @desc	FIXME
 +-----------------------------------------------------------+
 */
static void
check_quadrant(RLFL_map_t *m, int startX, int startY, int dx, int dy, int extentX,
			   int extentY, bool light_walls)
{
	RLFL_list_t active_views = RLFL_list_create();
	line_t shallow_line = { 0, 1, extentX, 0 };
	line_t steep_line 	= { 1, 0, 0, extentY };

	int maxI = (extentX + extentY);
	int i = 1;

	view_t *view= &views[(startX + (startY * m->width))];
	view->shallow_line	= shallow_line;
	view->steep_line	= steep_line;
	view->shallow_bump	= NULL;
	view->steep_bump	= NULL;

	RLFL_list_append(active_views, view);
	current_view = (view_t **)RLFL_list_begin(active_views);

	while ( (i != maxI + 1) && RLFL_list_size(active_views))
	{
		int startJ	= MAX(i-extentX, 0);
		int maxJ 	= MIN(i, extentY);
		int j 		= startJ;
		while ( (j != maxJ + 1)
				&& RLFL_list_size(active_views)
				&& (current_view != (view_t **)RLFL_list_end(active_views)))
		{
			int x = (i - j);
			int y = j;
			visit_coords(m, startX, startY, x, y, dx, dy, active_views, light_walls);
			j++;
		}
		i++;
		current_view=(view_t **)RLFL_list_begin(active_views);
	}
}