Beispiel #1
0
void render_wall(sqr *o, sqr *s, int x1, int y1, int x2, int y2, int mip, sqr *d1, sqr *d2, bool topleft, int dir)
{
    if(minimap) return;
    if(SOLID(o) || o->type==SEMISOLID)
    {
        float c1 = s->floor;
        float c2 = s->floor;
        if(s->type==FHF) { c1 -= d1->vdelta/4.0f; c2 -= d2->vdelta/4.0f; }
        float f1 = s->ceil;
        float f2 = s->ceil;
        if(s->type==CHF) { f1 += d1->vdelta/4.0f; f2 += d2->vdelta/4.0f; }
        //if(f1-c1<=0 && f2-c2<=0) return;
        render_square(o->wtex, c1, c2, f1, f2, x1<<mip, y1<<mip, x2<<mip, y2<<mip, 1<<mip, d1, d2, topleft, dir);
        return;
    }
    {
        float f1 = s->floor;
        float f2 = s->floor;
        float c1 = o->floor;
        float c2 = o->floor;
        if(o->type==FHF && s->type!=FHF)
        {
            c1 -= d1->vdelta/4.0f;
            c2 -= d2->vdelta/4.0f;
        }
        if(s->type==FHF && o->type!=FHF)
        {
            f1 -= d1->vdelta/4.0f;
            f2 -= d2->vdelta/4.0f;
        }
        if(f1>=c1 && f2>=c2) goto skip;
        render_square(o->wtex, f1, f2, c1, c2, x1<<mip, y1<<mip, x2<<mip, y2<<mip, 1<<mip, d1, d2, topleft, dir);
    }
    skip:
    {
        float f1 = o->ceil;
        float f2 = o->ceil;
        float c1 = s->ceil;
        float c2 = s->ceil;
        if(o->type==CHF && s->type!=CHF)
        {
            f1 += d1->vdelta/4.0f;
            f2 += d2->vdelta/4.0f;
        }
        else if(s->type==CHF && o->type!=CHF)
        {
            c1 += d1->vdelta/4.0f;
            c2 += d2->vdelta/4.0f;
        }
        if(c1<=f1 && c2<=f2) return;
        render_square(o->utex, f1, f2, c1, c2, x1<<mip, y1<<mip, x2<<mip, y2<<mip, 1<<mip, d1, d2, topleft, dir);
    }
}
Beispiel #2
0
void			resolve(void)
{
	t_square	r;
	int			x;
	int			y;

	y = -1;
	r.size = 0;
	while (g_tab[++y][0])
	{
		x = -1;
		while (g_tab[y][++x])
		{
			while (biggest_square(r.size + 1, y, x))
			{
				r.x = x;
				r.y = y;
				r.size++;
			}
		}
	}
	render_square(r.size, r.y, r.x);
}