• R/O
  • SSH
  • HTTPS

jsporkhack: コミット


コミットメタ情報

リビジョン41 (tree)
日時2009-11-07 20:45:25
作者dplusplus

ログメッセージ

本家#481
in sp_lev.c, split maze grid and solid filling level inits into their own functi
ons, prepping for future changes.

変更サマリ

差分

--- JSporkHack/trunk/src/sp_lev.c (revision 40)
+++ JSporkHack/trunk/src/sp_lev.c (revision 41)
@@ -95,8 +95,34 @@
9595 lev_region *lregions = 0;
9696 int num_lregions = 0;
9797
98+void
99+lvlfill_maze_grid(x1,y1,x2,y2,filling)
100+ int x1,y1,x2,y2;
101+ schar filling;
102+{
103+ int x,y;
98104
105+ for (x = x1; x <= x2; x++)
106+ for (y = y1; y <= y2; y++) {
107+#ifndef WALLIFIED_MAZE
108+ levl[x][y].typ = STONE;
109+#else
110+ levl[x][y].typ =
111+ (y < 2 || ((x % 2) && (y % 2))) ? STONE : filling;
112+#endif
113+ }
114+}
99115
116+void
117+lvlfill_solid(filling)
118+ schar filling;
119+{
120+ int x,y;
121+ for (x = 2; x <= x_maze_max; x++)
122+ for (y = 0; y <= y_maze_max; y++)
123+ levl[x][y].typ = filling;
124+}
125+
100126 void flip_drawbridge_horizontal(lev)
101127 struct rm *lev;
102128 {
@@ -2693,18 +2719,10 @@
26932719 if (lvl->init_lev.lit < 0) lvl->init_lev.lit = rn2(2);
26942720 mkmap(&(lvl->init_lev));
26952721 } else {
2696- for(x = 2; x <= x_maze_max; x++)
2697- for(y = 0; y <= y_maze_max; y++)
2698- if (lvl->init_lev.filling == -1) {
2699-#ifndef WALLIFIED_MAZE
2700- levl[x][y].typ = STONE;
2701-#else
2702- levl[x][y].typ =
2703- (y < 2 || ((x % 2) && (y % 2))) ? STONE : HWALL;
2704-#endif
2705- } else {
2706- levl[x][y].typ = lvl->init_lev.filling;
2707- }
2722+ if (lvl->init_lev.filling == -1)
2723+ lvlfill_maze_grid(2,0, x_maze_max,y_maze_max, HWALL);
2724+ else
2725+ lvlfill_solid(lvl->init_lev.filling);
27082726 /* ensure the whole level is marked as mapped area */
27092727 xstart = 1;
27102728 ystart = 0;
旧リポジトリブラウザで表示