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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines