+ identify_rgbimage(ri, islandnamer, archisland, "island");
+ } else if (!strcmp(sunshine,"Land - Ahoy!")) {
+ Rect islandnamer;
+
+ islandnamer.tl.x= (sunshiner.tl.x + sunshiner.br.x) / 2;
+ islandnamer.tl.y= sunshiner.tl.y + 100;
+ islandnamer.br= islandnamer.tl;
+ debug_rect("islandnamer",__LINE__, islandnamer);
+
+ WALK_UNTIL_MUST(islandnamer.tl,y, -1, sunshiner.br.y, 'H');
+ WALK_UNTIL_MUST(islandnamer.tl,x, -1, 0, 'o');
+ WALK_UNTIL_MUST(islandnamer.br,x, +1, cim->w, 'o');
+ debug_rect("islandnamer",__LINE__, islandnamer);
+
+#define RW (RECT_W(islandnamer))
+#define RH (RECT_H(islandnamer))
+
+ ADJUST_BOX(islandnamer,"O",>=,RW-4, cim->h, MUST,br,y,+1);
+ debug_rect("islandnamer",__LINE__, islandnamer);
+
+ islandnamer.br.y += 2;
+
+ ADJUST_BOX(islandnamer,"*",<,RW, cim->h, MUST,br,y,+1);
+ debug_rect("islandnamer",__LINE__, islandnamer);
+
+ islandnamer.tl.y= islandnamer.br.y-1;
+ islandnamer.br.y= islandnamer.br.y+1;
+ debug_rect("islandnamer",__LINE__, islandnamer);
+
+ ADJUST_BOX(islandnamer,"*",>=,RW, cim->h, MUST,br,y,+1);
+ debug_rect("islandnamer",__LINE__, islandnamer);
+
+ ADJUST_BOX(islandnamer,"*",<, RH, cim->w, MUST,tl,x,+1);
+ debug_rect("islandnamer",__LINE__, islandnamer);
+
+ MUST( RECT_H(islandnamer) <= 30, MR(islandnamer));
+
+ Point p;
+ int nspaces=1, might_be_colon=0;
+ uint32_t colon_pattern= 0;
+ p.y=-1;
+
+ for (p.x=islandnamer.br.x; p.x>islandnamer.tl.x; p.x--) {
+ colondebugf("structcolon: x=%4d nsp=%2d mbc=%d cp=%08"PRIx32" ",
+ p.x, nspaces, might_be_colon, colon_pattern);
+
+ uint32_t pattern=0;
+ int runs[32], nruns=0;
+ runs[0]=0; runs[1]=0;
+
+ for (p.y=islandnamer.tl.y; p.y<=islandnamer.br.y; p.y++) {
+ pattern <<= 1;
+ double alpha= find_aa_density(ri,p, 0xCCCCAA,0x002255,0);
+ if (alpha >= 0.49) {
+ runs[nruns]++;
+ pattern |= 1u;
+ } else {
+ if (runs[nruns]) {
+ nruns++;
+ runs[nruns]=0;
+ }
+ }
+ }
+
+ colondebugf(" pat=%08"PRIx32" nruns=%d runs[]={%d,%d..} ",
+ pattern, nruns, runs[0],runs[1]);
+
+ if (!pattern) {
+ if (might_be_colon)
+ /* omg it _is_ a colon */
+ goto colon_found;
+ nspaces++;
+ might_be_colon=0;
+ } else {
+ if (!(pattern & 1UL<<31) && nruns==2 && runs[1]==runs[0]) {
+ if (!nspaces) {
+ if (pattern==colon_pattern)
+ goto ok_might_be_colon;
+ } else if (nspaces>=2) {
+ colon_pattern= pattern;
+ might_be_colon=1;
+ goto ok_might_be_colon;
+ }
+ }
+ might_be_colon=0;
+ ok_might_be_colon:
+ nspaces= 0;
+ }
+ colondebugf(" nsp=%2d mbc=%d\n", nspaces, might_be_colon);
+ }
+ MUST(!"colon found", MP(p);MR(islandnamer) );
+
+ colon_found:
+ colondebugf(" found\n");
+ islandnamer.br.x= p.x;
+