ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/preprocess
(Generate patch)

Comparing deliantra/server/include/preprocess (file contents):
Revision 1.3 by root, Thu Aug 31 17:54:14 2006 UTC vs.
Revision 1.25 by root, Mon Apr 30 04:25:30 2007 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2
3my %ARG = @ARGV;
2 4
3use List::Util; 5use List::Util;
4 6
5# todo: gather dynamically 7# todo: gather dynamically
6my @kw = qw( 8my @kw = qw(
9 no_pass
10 walk_on
11 walk_off
12 fly_on
13 fly_off
14 flying
15
16 attack_skill
17 ranged_skill
18
7 ac 19 ac
8 activate_on_push 20 activate_on_push
9 activate_on_release 21 activate_on_release
10 alive 22 alive
11 anim_speed 23 anim_speed
59 cursed 71 cursed
60 custom_name 72 custom_name
61 dam 73 dam
62 dam_modifier 74 dam_modifier
63 damned 75 damned
76 destroy_on_death
64 dex 77 dex
65 direction 78 direction
66 duration 79 duration
67 duration_modifier 80 duration_modifier
68 editable 81 editable
85 has_ready_rod 98 has_ready_rod
86 has_ready_scroll 99 has_ready_scroll
87 has_ready_skill 100 has_ready_skill
88 has_ready_wand 101 has_ready_wand
89 has_ready_weapon 102 has_ready_weapon
103 has_ready_range
90 hitback 104 hitback
91 hp 105 hp
92 identified 106 identified
93 immune 107 immune
108 inherit
94 int 109 int
95 inv_locked 110 inv_locked
96 invisible 111 invisible
97 is_animated 112 is_animated
98 is_blind 113 is_blind
99 is_buildable 114 is_buildable
100 is_cauldron 115 is_cauldron
116 is_dust
101 is_floor 117 is_floor
102 is_hilly 118 is_hilly
103 is_lightable 119 is_lightable
104 is_thrown 120 is_thrown
105 is_turnable 121 is_turnable
146 no_pick 162 no_pick
147 no_skill_ident 163 no_skill_ident
148 no_steal 164 no_steal
149 no_strength 165 no_strength
150 nrof 166 nrof
167 obj_original
151 object 168 object
152 oid 169 oid
153 one_hit 170 one_hit
154 only_attack 171 only_attack
155 other_arch 172 other_arch
157 path_attuned 174 path_attuned
158 path_denied 175 path_denied
159 path_repelled 176 path_repelled
160 perm_exp 177 perm_exp
161 pick_up 178 pick_up
179 player_sold
162 pow 180 pow
181 precious
163 protected 182 protected
164 race 183 race
165 random_move 184 random_move
166 random_movement 185 random_movement
167 randomitems 186 randomitems
216 str 235 str
217 subtype 236 subtype
218 tear_down 237 tear_down
219 title 238 title
220 tooltype 239 tooltype
221 treasure 240 treasure_env
222 type 241 type
223 unaggressive 242 unaggressive
224 undead 243 undead
225 unique 244 unique
226 unpaid 245 unpaid
227 use_content_on_gen 246 use_content_on_gen
247 uuid
228 value 248 value
229 vulnerable 249 vulnerable
230 was_wiz 250 was_wiz
231 wc 251 wc
232 weapontype 252 weapontype
235 wis 255 wis
236 wiz 256 wiz
237 x 257 x
238 xrays 258 xrays
239 y 259 y
260
261 maplore
262 endmaplore
263 enter_x
264 enter_y
265 width
266 height
267 reset_timeout
268 reset_time
269 swap_time
270 difficulty
271 darkness
272 fixed_resettime
273 per_player
274 per_party
275 region
276 shopitems
277 shopgreed
278 shopmin
279 shopmax
280 shoprace
281 outdoor
282 tile_path_1
283 tile_path_2
284 tile_path_3
285 tile_path_4
286
287 file_format_version
288
289 temp
290 pressure
291 humid
292 windspeed
293 winddir
294 sky
295
296 map
297 savebed_map
298 bed_x
299 bed_y
300 password
301 bowtype
302 petmode
303 gen_hp
304 gen_sp
305 gen_grace
306 listening
307 peaceful
308 digestion
309 pickup
310 outputs_sync
311 outputs_count
312 usekeys
313 unapply
314 weapon_sp
315 lev_array
316 endplst
317
318 visibility
319 magicmap
320
321 match
322 parent
323 longname
324 jail_map
325 jail_x
326 jail_y
327 fallback
328 nomore
329
330 chance
331 mods
332 diff
333 saves
334 description
335 density
336 damage
337
338 anim
339 mina
340 facings
341 player
342
343 allowed
344 keycode
345 trans
346 yield
347 ingred
348 cauldron
349
350 Str
351 Dex
352 Con
353 Wis
354 Cha
355 Int
356 Pow
357
358 treasure
359 treasureone
360 list
361 change_name
362 change_title
363 change_slaying
364 yes
365 no
240); 366);
241 367
242open GPERF, "|-", "gperf -m50 >kw_hash.h" 368open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
243 or die "gperf: $!"; 369 or die "$ARGV{GPERF}: $!";
244 370
245print GPERF <<EOF; 371print GPERF <<EOF;
246%language=C++ 372%language=C++
247%enum 373%enum
248%define class-name kw_lex 374%define class-name kw_lex
272print GPERF "};\n"; 398print GPERF "};\n";
273 399
274printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n", 400printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
275 join ", ", map length, @kw; 401 join ", ", map length, @kw;
276 402
403close GPERF
404 or die "$ARG{GPERF}: failed to run";
405
277open KW, ">", "keyword.h"; 406open KW, ">", "keyword.h";
278 407
279print KW <<EOF; 408print KW <<EOF;
280#ifndef KW_H__ 409#ifndef KW_H__
281#define KW_H__ 410#define KW_H__
282 411
283enum keyword { 412enum keyword {
284 KW_EOF, KW_ERROR, 413 KW_NULL = 0,
414 KW_EOF = 0,
415 KW_ERROR,
285EOF 416EOF
286 417
287for (@kw) { 418for (@kw) {
288 printf KW " %s,\n", "KW_$_", 419 printf KW " %s,\n", "KW_$_",
289} 420}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines