15 use constant LUMP_ENTITIES => 0;
19 die "Usage: bsp2ent BSPFILE > ENTFILE\n";
22 my $bspfile = $ARGV[0];
23 open my $fh, '<', $bspfile
24 or die "open $bspfile: $!";
26 or die "$bspfile is no IBSP";
27 unpack('V', get($fh, 4)) == 0x2e
28 or die "$bspfile is no Q3 BSP";
31 [unpack('VV', get($fh, 8))] # offset, length
35 seek($fh, $directory[LUMP_ENTITIES][0], SEEK_SET);
36 my $ent = get($fh, $directory[LUMP_ENTITIES][1]);