This commit is contained in:
Enno Rehling 2009-09-26 19:33:08 +00:00
parent 83769d40ea
commit ecdb0b760e

View file

@ -1116,6 +1116,17 @@ cr_output_resources(FILE * F, report_context * ctx, seen_region * sr)
if (pos!=cbuf) fputs(cbuf, F); if (pos!=cbuf) fputs(cbuf, F);
} }
static void
cr_region_header(FILE * F, int plid, int nx, int ny, unsigned int uid)
{
if (plid==0) {
fprintf(F, "REGION %d %d\n", nx, ny);
} else {
fprintf(F, "REGION %d %d %d\n", nx, ny, plid);
}
fprintf(F, "%d;id\n", uid);
}
static void static void
cr_output_region(FILE * F, report_context * ctx, seen_region * sr) cr_output_region(FILE * F, report_context * ctx, seen_region * sr)
{ {
@ -1124,6 +1135,7 @@ cr_output_region(FILE * F, report_context * ctx, seen_region * sr)
plane * pl = rplane(r); plane * pl = rplane(r);
int plid = plane_id(pl), nx, ny; int plid = plane_id(pl), nx, ny;
const char * tname; const char * tname;
int oc[4][2], o = 0;
if (opt_cr_absolute_coords) { if (opt_cr_absolute_coords) {
nx = r->x; nx = r->x;
@ -1134,12 +1146,28 @@ cr_output_region(FILE * F, report_context * ctx, seen_region * sr)
pnormalize(&nx, &ny, pl); pnormalize(&nx, &ny, pl);
} }
if (plid==0) { if (ny==pl->maxy) {
fprintf(F, "REGION %d %d\n", nx, ny); oc[o][0] = nx;
} else { oc[o++][1] = pl->miny-1;
fprintf(F, "REGION %d %d %d\n", nx, ny, plid);
} }
fprintf(F, "%d;id\n", r->uid); if (nx==pl->maxx) {
oc[o][0] = pl->minx-1;
oc[o++][1] = ny;
}
if (ny==pl->miny) {
oc[o][0] = nx;
oc[o++][1] = pl->maxy+1;
}
if (nx==pl->minx) {
oc[o][0] = pl->maxx+1;
oc[o++][1] = ny;
}
while (o--) {
cr_region_header(F, plid, oc[o][0], oc[o][1], r->uid);
fputs("\"wrap\";visibility\n", F);
}
cr_region_header(F, plid, nx, ny, r->uid);
if (r->land) { if (r->land) {
const char * str = rname(r, f->locale); const char * str = rname(r, f->locale);