~ubuntu-branches/ubuntu/saucy/sgt-puzzles/saucy

« back to all changes in this revision

Viewing changes to lightup.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings
  • Date: 2008-04-13 17:39:38 UTC
  • mto: (1.1.6 upstream) (3.1.2 lenny)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20080413173938-nnrvlls98m6ky6eq
ImportĀ upstreamĀ versionĀ 7983

Show diffs side-by-side

added added

removed removed

Lines of Context:
2077
2077
            int lcol = (ds_flags & DF_OVERLAP) ? COL_ERROR : COL_LIGHT;
2078
2078
            draw_circle(dr, dx + TILE_SIZE/2, dy + TILE_SIZE/2, TILE_RADIUS,
2079
2079
                        lcol, COL_BLACK);
2080
 
        } else if (ds_flags & DF_IMPOSSIBLE) {
2081
 
            int rlen = TILE_SIZE / 4;
2082
 
            draw_rect(dr, dx + TILE_SIZE/2 - rlen/2, dy + TILE_SIZE/2 - rlen/2,
2083
 
                      rlen, rlen, COL_BLACK);
 
2080
        } else if ((ds_flags & DF_IMPOSSIBLE)) {
 
2081
            static int draw_blobs_when_lit = -1;
 
2082
            if (draw_blobs_when_lit < 0) {
 
2083
                char *env = getenv("LIGHTUP_LIT_BLOBS");
 
2084
                draw_blobs_when_lit = (!env || (env[0] == 'y' ||
 
2085
                                                env[0] == 'Y'));
 
2086
            }
 
2087
            if (!(ds_flags & DF_LIT) || draw_blobs_when_lit) {
 
2088
                int rlen = TILE_SIZE / 4;
 
2089
                draw_rect(dr, dx + TILE_SIZE/2 - rlen/2,
 
2090
                          dy + TILE_SIZE/2 - rlen/2,
 
2091
                          rlen, rlen, COL_BLACK);
 
2092
            }
2084
2093
        }
2085
2094
    }
2086
2095
 
2216
2225
#endif
2217
2226
 
2218
2227
const struct game thegame = {
2219
 
    "Light Up", "games.lightup",
 
2228
    "Light Up", "games.lightup", "lightup",
2220
2229
    default_params,
2221
2230
    game_fetch_preset,
2222
2231
    decode_params,