plan9fox/sys
cinap_lenrek fdb1698791 games/doom: implement filelength() (thanks quux)
this function is used when playing demos from external lumps. the game just
exits without this patch.
to test this, download a demo lump from somewhere, and play it with -playdemo %s
where %s is the file's name, without the .lmp extension:

(note that this one is a doom 2 demo, so it requires doom2.wad)
% hget http://doomedsda.us/lmps/945/3/30nm2939.zip | unzip -sv
extracting 30nm2939.LMP
extracting 30nm2939.txt
% mv 30nm2939.LMP 30nm2939.lmp	# checking for a lump filename is case sensitive
% games/doom -playdemo 30nm2939

the game exits when the demo ends. also, note that this demo will desync on
map06 (the crusher), because of an unrelated bug (that's another patch :>)

note: filelength() returns vlong, but file lengths for doom lumps are ints.
however, this might be used elsewhere (networking), so i'd leave it this way.
2015-07-29 14:51:00 +02:00
..
doc /sys/doc: permissions for cleanps, mkdirlist, mkfilelist 2012-10-20 19:09:54 +02:00
games/lib fortunes: go away. 2015-07-22 21:35:50 -04:00
include ape: add stdint.h, fix SSIZE_MAX and add SIZE_MAX to limits.h 2015-07-13 02:36:48 +02:00
lib authsrv: remove unused opasstokey 2015-06-09 23:53:07 +02:00
man stream(3): fix reference 2015-07-19 03:34:08 +02:00
src games/doom: implement filelength() (thanks quux) 2015-07-29 14:51:00 +02:00