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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines