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

Comparing deliantra/server/random_maps/random_map.h (file contents):
Revision 1.22 by root, Fri Mar 26 00:59:21 2010 UTC vs.
Revision 1.26 by root, Sat Jun 26 22:10:18 2010 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2001 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2001 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992 Frank Tore Johansen 6 * Copyright (©) 1992 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
25#ifndef RANDOM_MAP_H 25#ifndef RANDOM_MAP_H
26#define RANDOM_MAP_H 26#define RANDOM_MAP_H
27 27
28#include "util.h" 28#include "util.h"
29 29
30struct random_map_params 30struct random_map_params : zero_initialised
31{ 31{
32 char wallstyle[512];
33 char wall_name[512]; 32 char wall_name[512];
34 char floorstyle[512];
35 char monsterstyle[512]; 33 char monsterstyle[512];
36 char treasurestyle[512]; 34 char treasurestyle[512];
37 char layoutstyle[512]; 35 char layoutstyle[512];
38 char doorstyle[512]; 36 char doorstyle[512];
39 char decorstyle[512]; 37 char decorstyle[512];
40 shstr origin_map; 38 shstr origin_map;
41 shstr final_map; 39 shstr final_map;
42 char exitstyle[512];
43 shstr this_map; 40 shstr this_map;
44 char exit_on_final_map[512]; 41 char exit_on_final_map[512];
45 char *custom; 42
46
47 int xsize, ysize; 43 int xsize, ysize;
48 int expand2x; 44 int expand2x;
49 int layoutoptions1; 45 int layoutoptions1;
50 int layoutoptions2; 46 int layoutoptions2;
51 int layoutoptions3; 47 int layoutoptions3;
67 int treasureoptions; 63 int treasureoptions;
68 int symmetry_used; 64 int symmetry_used;
69 65
70 struct region *region; 66 struct region *region;
71 67
68 HV *hv;
69
70 // fetch something from the options hash
71 const_utf8_string get_str (const_utf8_string option, const_utf8_string fallback = "") const;
72 IV get_iv (const_utf8_string option, IV fallback = 0) const;
73
74 void set (const_utf8_string option, const_utf8_string value);
75 void set (const_utf8_string option, IV value);
76
72 // "private", adjusted sizes 77 // "private", adjusted sizes
73 int Xsize; 78 int Xsize;
74 int Ysize; 79 int Ysize;
80
81 ~random_map_params ();
75}; 82};
76 83
77enum { 84enum {
78 LAYOUT_NONE, 85 LAYOUT_NONE,
79 LAYOUT_ONION, 86 LAYOUT_ONION,
194 ::swap (layout.ptr->w , ptr->w ); 201 ::swap (layout.ptr->w , ptr->w );
195 ::swap (layout.ptr->h , ptr->h ); 202 ::swap (layout.ptr->h , ptr->h );
196 } 203 }
197}; 204};
198 205
206// utility functions, to use rmg_rndm instead of rndm.
207static inline int
208rmg_find_free_spot (const object *ob, maptile *m, int x, int y, int start, int stop)
209{
210 swap (rmg_rndm, rndm);
211 int i = find_free_spot (ob, m, x, y, start, stop);
212 swap (rmg_rndm, rndm);
213 return i;
214}
215
199#endif 216#endif
200 217

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines