ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/wall.C
(Generate patch)

Comparing deliantra/server/random_maps/wall.C (file contents):
Revision 1.13 by root, Sun Dec 31 19:02:24 2006 UTC vs.
Revision 1.19 by root, Sat Feb 17 23:32:11 2007 UTC

1
2/* 1/*
3 CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game for X-windows
4 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
5 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team
6 Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
7 7 *
8 This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version. 11 * (at your option) any later version.
12 12 *
13 This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details. 16 * GNU General Public License for more details.
17 17 *
18 You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 21 *
22 The authors can be reached via e-mail at <crossfire@schmorp.de> 22 * The authors can be reached via e-mail at <crossfire@schmorp.de>
23*/ 23 */
24 24
25#include <global.h> 25#include <global.h>
26#include <random_map.h> 26#include <random_map.h>
27#include <rproto.h> 27#include <rproto.h>
28 28
133 w_style) at '#' marks. */ 133 w_style) at '#' marks. */
134 134
135void 135void
136make_map_walls (maptile *map, char **layout, char *w_style, random_map_params *RP) 136make_map_walls (maptile *map, char **layout, char *w_style, random_map_params *RP)
137{ 137{
138 char styledirname[256]; 138 char styledirname[1024];
139 char stylefilepath[256]; 139 char stylefilepath[1024];
140 maptile *style_map = 0; 140 maptile *style_map = 0;
141 object *the_wall; 141 object *the_wall;
142 142
143 /* get the style map */ 143 /* get the style map */
144 if (!strcmp (w_style, "none")) 144 if (!strcmp (w_style, "none"))
145 return; 145 return;
146 sprintf (styledirname, "%s", "/styles/wallstyles"); 146 sprintf (styledirname, "%s", "/styles/wallstyles");
147 sprintf (stylefilepath, "%s/%s", styledirname, w_style); 147 sprintf (stylefilepath, "%s/%s", styledirname, w_style);
148 style_map = find_style (styledirname, w_style, -1); 148 style_map = find_style (styledirname, w_style, -1);
149 if (style_map == 0) 149 if (!style_map)
150 return; 150 return;
151 151
152 /* fill up the map with the given floor style */ 152 /* fill up the map with the given floor style */
153 if ((the_wall = pick_random_object (style_map)) != NULL) 153 if ((the_wall = style_map->pick_random_object ()))
154 { 154 {
155 int i, j; 155 int i, j;
156 char *cp; 156 char *cp;
157 int joinedwalls = 0; 157 int joinedwalls = 0;
158 object *thiswall; 158 object *thiswall;
193 2 = wall to right, 193 2 = wall to right,
194 4 = wall above 194 4 = wall above
195 8 = wall below */ 195 8 = wall below */
196 int surround_index = 0; 196 int surround_index = 0;
197 int l; 197 int l;
198 char wall_name[64]; 198 char wall_name[1024];
199 archetype *wall_arch = 0; 199 archetype *wall_arch = 0;
200 200
201 strcpy (wall_name, the_wall->arch->name); 201 assign (wall_name, the_wall->arch->name);
202 202
203 /* conventionally, walls are named like this: 203 /* conventionally, walls are named like this:
204 wallname_wallcode, where wallcode indicates 204 wallname_wallcode, where wallcode indicates
205 a joinedness, and wallname is the wall. 205 a joinedness, and wallname is the wall.
206 this code depends on the convention for 206 this code depends on the convention for

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines