Skip to content

Commit 04b6d43

Browse files
committed
bringris:: refactored clear_map
1 parent 1bdcbcc commit 04b6d43

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

rogueviz/bringris.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ void shift_block(int dir, bool camera_only = false);
171171
void rotate_block(int dir, bool camera_only = false);
172172

173173
void start_new_game();
174+
void clear_map();
174175
void save();
175176
void load();
176177

@@ -1918,13 +1919,8 @@ void reset_view() {
19181919
set_view();
19191920
pView = tView;
19201921
}
1921-
1922-
void start_new_game() {
1923-
1924-
timerstart = time(NULL);
1925-
1926-
for(auto& p: piecelist) p.count = 0;
19271922

1923+
void clear_map() {
19281924
for(auto lev: level) for(int z=0; z<=camera_level+1; z++) {
19291925
cell *c = get_at(lev, -z);
19301926
setdist(c, 7, nullptr);
@@ -1934,7 +1930,7 @@ void start_new_game() {
19341930
c->wall = waBarrier, c->land = laBarrier;
19351931
else if(z <= camera_level)
19361932
c->wall = waNone;
1937-
else
1933+
else
19381934
c->wall = waWaxWall, c->land = laCanvas, c->landparam = 0xC000C0;
19391935
}
19401936

@@ -1944,8 +1940,17 @@ void start_new_game() {
19441940
c->land = laCanvas;
19451941
c->wall = waWaxWall;
19461942
c->landparam = (get_hipso(z) & 0xFCFCFC) >> 2;
1947-
}
1943+
}
1944+
}
19481945

1946+
void start_new_game() {
1947+
1948+
timerstart = time(NULL);
1949+
1950+
for(auto& p: piecelist) p.count = 0;
1951+
1952+
clear_map();
1953+
19491954
at = get_at(get_center(), -cur.well_size - 1);
19501955
next_shape_id = choose_piece();
19511956

0 commit comments

Comments
 (0)