Initial import. master
authorSimon Morgan <sjm@eml.cc>
Tue, 4 Dec 2012 20:15:08 +0000 (20:15 +0000)
committerSimon Morgan <sjm@eml.cc>
Tue, 4 Dec 2012 20:15:08 +0000 (20:15 +0000)
717 files changed:
EULA - Source Code.doc [new file with mode: 0644]
H2MP/Portals/PUZZLES.TXT [new file with mode: 0644]
H2MP/Portals/Strings.txt [new file with mode: 0644]
H2MP/Portals/hexen.rc [new file with mode: 0644]
H2MP/Portals/infolist.txt [new file with mode: 0644]
H2MP/code/ADIVTAB.H [new file with mode: 0644]
H2MP/code/ANORMS.H [new file with mode: 0644]
H2MP/code/BSPFILE.H [new file with mode: 0644]
H2MP/code/CDAUDIO.H [new file with mode: 0644]
H2MP/code/CD_WIN.C [new file with mode: 0644]
H2MP/code/CLIENT.H [new file with mode: 0644]
H2MP/code/CL_DEMO.C [new file with mode: 0644]
H2MP/code/CL_INPUT.C [new file with mode: 0644]
H2MP/code/CL_MAIN.C [new file with mode: 0644]
H2MP/code/CL_TENT.C [new file with mode: 0644]
H2MP/code/CMD.C [new file with mode: 0644]
H2MP/code/CMD.H [new file with mode: 0644]
H2MP/code/COMMON.C [new file with mode: 0644]
H2MP/code/COMMON.H [new file with mode: 0644]
H2MP/code/CONSOLE.C [new file with mode: 0644]
H2MP/code/CONSOLE.H [new file with mode: 0644]
H2MP/code/CRC.C [new file with mode: 0644]
H2MP/code/CRC.H [new file with mode: 0644]
H2MP/code/CVAR.C [new file with mode: 0644]
H2MP/code/CVAR.H [new file with mode: 0644]
H2MP/code/Cl_parse.c [new file with mode: 0644]
H2MP/code/DOSISMS.H [new file with mode: 0644]
H2MP/code/DRAW.C [new file with mode: 0644]
H2MP/code/DRAW.H [new file with mode: 0644]
H2MP/code/D_EDGE.C [new file with mode: 0644]
H2MP/code/D_FILL.C [new file with mode: 0644]
H2MP/code/D_IFACE.H [new file with mode: 0644]
H2MP/code/D_INIT.C [new file with mode: 0644]
H2MP/code/D_LOCAL.H [new file with mode: 0644]
H2MP/code/D_MODECH.C [new file with mode: 0644]
H2MP/code/D_PART.C [new file with mode: 0644]
H2MP/code/D_POLYSE.C [new file with mode: 0644]
H2MP/code/D_SCAN.C [new file with mode: 0644]
H2MP/code/D_SKY.C [new file with mode: 0644]
H2MP/code/D_SPRITE.C [new file with mode: 0644]
H2MP/code/D_SURF.C [new file with mode: 0644]
H2MP/code/D_VARS.C [new file with mode: 0644]
H2MP/code/D_ZPOINT.C [new file with mode: 0644]
H2MP/code/HOST.C [new file with mode: 0644]
H2MP/code/Host_cmd.c [new file with mode: 0644]
H2MP/code/INPUT.H [new file with mode: 0644]
H2MP/code/IN_WIN.C [new file with mode: 0644]
H2MP/code/KEYS.C [new file with mode: 0644]
H2MP/code/KEYS.H [new file with mode: 0644]
H2MP/code/MATHLIB.C [new file with mode: 0644]
H2MP/code/MATHLIB.H [new file with mode: 0644]
H2MP/code/MENU.H [new file with mode: 0644]
H2MP/code/MODEL.C [new file with mode: 0644]
H2MP/code/MODEL.H [new file with mode: 0644]
H2MP/code/Menu.c [new file with mode: 0644]
H2MP/code/NET.H [new file with mode: 0644]
H2MP/code/NET_DGRM.C [new file with mode: 0644]
H2MP/code/NET_DGRM.H [new file with mode: 0644]
H2MP/code/NET_LOOP.C [new file with mode: 0644]
H2MP/code/NET_LOOP.H [new file with mode: 0644]
H2MP/code/NET_MAIN.C [new file with mode: 0644]
H2MP/code/NET_SER.H [new file with mode: 0644]
H2MP/code/NET_VCR.C [new file with mode: 0644]
H2MP/code/NET_VCR.H [new file with mode: 0644]
H2MP/code/NET_WIN.C [new file with mode: 0644]
H2MP/code/NET_WINS.C [new file with mode: 0644]
H2MP/code/NET_WINS.H [new file with mode: 0644]
H2MP/code/NET_WIPX.C [new file with mode: 0644]
H2MP/code/NET_WIPX.H [new file with mode: 0644]
H2MP/code/PROGS.H [new file with mode: 0644]
H2MP/code/PROTOCOL.H [new file with mode: 0644]
H2MP/code/PR_COMP.H [new file with mode: 0644]
H2MP/code/PR_EXEC.C [new file with mode: 0644]
H2MP/code/Pr_cmds.c [new file with mode: 0644]
H2MP/code/Pr_edict.c [new file with mode: 0644]
H2MP/code/Quakedef.h [new file with mode: 0644]
H2MP/code/RENDER.H [new file with mode: 0644]
H2MP/code/RESOURCE.H [new file with mode: 0644]
H2MP/code/R_ACLIP.C [new file with mode: 0644]
H2MP/code/R_ALIAS.C [new file with mode: 0644]
H2MP/code/R_BSP.C [new file with mode: 0644]
H2MP/code/R_DRAW.C [new file with mode: 0644]
H2MP/code/R_EDGE.C [new file with mode: 0644]
H2MP/code/R_EFRAG.C [new file with mode: 0644]
H2MP/code/R_LIGHT.C [new file with mode: 0644]
H2MP/code/R_LOCAL.H [new file with mode: 0644]
H2MP/code/R_MAIN.C [new file with mode: 0644]
H2MP/code/R_MISC.C [new file with mode: 0644]
H2MP/code/R_PART.C [new file with mode: 0644]
H2MP/code/R_SHARED.H [new file with mode: 0644]
H2MP/code/R_SKY.C [new file with mode: 0644]
H2MP/code/R_SPRITE.C [new file with mode: 0644]
H2MP/code/R_SURF.C [new file with mode: 0644]
H2MP/code/R_VARS.C [new file with mode: 0644]
H2MP/code/SBAR.H [new file with mode: 0644]
H2MP/code/SCREEN.H [new file with mode: 0644]
H2MP/code/SND_DMA.C [new file with mode: 0644]
H2MP/code/SND_MEM.C [new file with mode: 0644]
H2MP/code/SND_MIX.C [new file with mode: 0644]
H2MP/code/SND_WIN.C [new file with mode: 0644]
H2MP/code/SOUND.H [new file with mode: 0644]
H2MP/code/SPRITEGN.H [new file with mode: 0644]
H2MP/code/SV_MAIN.C [new file with mode: 0644]
H2MP/code/SV_MOVE.C [new file with mode: 0644]
H2MP/code/SV_PHYS.C [new file with mode: 0644]
H2MP/code/SV_USER.C [new file with mode: 0644]
H2MP/code/SYS.H [new file with mode: 0644]
H2MP/code/SYS_WIN.C [new file with mode: 0644]
H2MP/code/Sbar.c [new file with mode: 0644]
H2MP/code/Screen.c [new file with mode: 0644]
H2MP/code/Server.h [new file with mode: 0644]
H2MP/code/VID.H [new file with mode: 0644]
H2MP/code/VID_WIN.C [new file with mode: 0644]
H2MP/code/VIEW.C [new file with mode: 0644]
H2MP/code/VIEW.H [new file with mode: 0644]
H2MP/code/WAD.C [new file with mode: 0644]
H2MP/code/WAD.H [new file with mode: 0644]
H2MP/code/WINQUAKE.H [new file with mode: 0644]
H2MP/code/WORLD.H [new file with mode: 0644]
H2MP/code/Winquake.dsp [new file with mode: 0644]
H2MP/code/Winquake.dsw [new file with mode: 0644]
H2MP/code/World.c [new file with mode: 0644]
H2MP/code/ZONE.C [new file with mode: 0644]
H2MP/code/ZONE.H [new file with mode: 0644]
H2MP/code/anorm_dots.h [new file with mode: 0644]
H2MP/code/bugs.txt [new file with mode: 0644]
H2MP/code/chase.c [new file with mode: 0644]
H2MP/code/cl_effect.c [new file with mode: 0644]
H2MP/code/cl_effect.h [new file with mode: 0644]
H2MP/code/conproc.c [new file with mode: 0644]
H2MP/code/conproc.h [new file with mode: 0644]
H2MP/code/d_draw.asm [new file with mode: 0644]
H2MP/code/d_draw16.asm [new file with mode: 0644]
H2MP/code/d_draw16t.asm [new file with mode: 0644]
H2MP/code/d_parta.asm [new file with mode: 0644]
H2MP/code/d_partb.asm [new file with mode: 0644]
H2MP/code/d_polysa.asm [new file with mode: 0644]
H2MP/code/d_polysa2.asm [new file with mode: 0644]
H2MP/code/d_polysa3.asm [new file with mode: 0644]
H2MP/code/d_polysa4.asm [new file with mode: 0644]
H2MP/code/d_polysa5.asm [new file with mode: 0644]
H2MP/code/d_scana.asm [new file with mode: 0644]
H2MP/code/d_spr8.asm [new file with mode: 0644]
H2MP/code/d_spr8t.asm [new file with mode: 0644]
H2MP/code/d_spr8t2.asm [new file with mode: 0644]
H2MP/code/d_varsa.asm [new file with mode: 0644]
H2MP/code/fastsqrt.cpp [new file with mode: 0644]
H2MP/code/ftol.asm [new file with mode: 0644]
H2MP/code/genmodel.h [new file with mode: 0644]
H2MP/code/gl_draw.c [new file with mode: 0644]
H2MP/code/gl_mesh.c [new file with mode: 0644]
H2MP/code/gl_model.c [new file with mode: 0644]
H2MP/code/gl_model.h [new file with mode: 0644]
H2MP/code/gl_refrag.c [new file with mode: 0644]
H2MP/code/gl_rlight.c [new file with mode: 0644]
H2MP/code/gl_rmain.c [new file with mode: 0644]
H2MP/code/gl_rmisc.c [new file with mode: 0644]
H2MP/code/gl_rsurf.c [new file with mode: 0644]
H2MP/code/gl_screen.c [new file with mode: 0644]
H2MP/code/gl_test.c [new file with mode: 0644]
H2MP/code/gl_vidnt.c [new file with mode: 0644]
H2MP/code/gl_warp.c [new file with mode: 0644]
H2MP/code/gl_warp_sin.h [new file with mode: 0644]
H2MP/code/glquake.h [new file with mode: 0644]
H2MP/code/math.asm [new file with mode: 0644]
H2MP/code/midi.c [new file with mode: 0644]
H2MP/code/midi.h [new file with mode: 0644]
H2MP/code/midstuff.h [new file with mode: 0644]
H2MP/code/mstrconv.c [new file with mode: 0644]
H2MP/code/progdefs.h [new file with mode: 0644]
H2MP/code/qe3.ico [new file with mode: 0644]
H2MP/code/r_aclipa.asm [new file with mode: 0644]
H2MP/code/r_aliasa.asm [new file with mode: 0644]
H2MP/code/r_drawa.asm [new file with mode: 0644]
H2MP/code/r_edgea.asm [new file with mode: 0644]
H2MP/code/r_edgeb.asm [new file with mode: 0644]
H2MP/code/r_varsa.asm [new file with mode: 0644]
H2MP/code/snd_mixa.asm [new file with mode: 0644]
H2MP/code/surf16.asm [new file with mode: 0644]
H2MP/code/surf8.asm [new file with mode: 0644]
H2MP/code/sys_wina.asm [new file with mode: 0644]
H2MP/code/winquake.rc [new file with mode: 0644]
H2MP/code/worlda.asm [new file with mode: 0644]
H2MP/hcode/Ai.hc [new file with mode: 0644]
H2MP/hcode/Bridge.hc [new file with mode: 0644]
H2MP/hcode/Buttons.hc [new file with mode: 0644]
H2MP/hcode/COMBAT.hc [new file with mode: 0644]
H2MP/hcode/Client.hc [new file with mode: 0644]
H2MP/hcode/Corpse.hc [new file with mode: 0644]
H2MP/hcode/Doors.hc [new file with mode: 0644]
H2MP/hcode/FAblade.hc [new file with mode: 0644]
H2MP/hcode/FAspell.hc [new file with mode: 0644]
H2MP/hcode/FIGHT.hc [new file with mode: 0644]
H2MP/hcode/HCode.dsp [new file with mode: 0644]
H2MP/hcode/Head.hc [new file with mode: 0644]
H2MP/hcode/Items.hc [new file with mode: 0644]
H2MP/hcode/MONSTERS.hc [new file with mode: 0644]
H2MP/hcode/Mirage.hc [new file with mode: 0644]
H2MP/hcode/Misc.hc [new file with mode: 0644]
H2MP/hcode/PLATS.hc [new file with mode: 0644]
H2MP/hcode/Progs.src [new file with mode: 0644]
H2MP/hcode/SPRITES.hc [new file with mode: 0644]
H2MP/hcode/SUBS.hc [new file with mode: 0644]
H2MP/hcode/TRIGGERS.hc [new file with mode: 0644]
H2MP/hcode/WORLD.hc [new file with mode: 0644]
H2MP/hcode/Weapons.hc [new file with mode: 0644]
H2MP/hcode/acidorb.hc [new file with mode: 0644]
H2MP/hcode/allplay.hc [new file with mode: 0644]
H2MP/hcode/altdeath.hc [new file with mode: 0644]
H2MP/hcode/archer.hc [new file with mode: 0644]
H2MP/hcode/artifact.hc [new file with mode: 0644]
H2MP/hcode/assassin.hc [new file with mode: 0644]
H2MP/hcode/assgren.hc [new file with mode: 0644]
H2MP/hcode/axe.hc [new file with mode: 0644]
H2MP/hcode/barrel.hc [new file with mode: 0644]
H2MP/hcode/bldrain.hc [new file with mode: 0644]
H2MP/hcode/boner.hc [new file with mode: 0644]
H2MP/hcode/boulder.hc [new file with mode: 0644]
H2MP/hcode/breakabl.hc [new file with mode: 0644]
H2MP/hcode/buddha.hc [new file with mode: 0644]
H2MP/hcode/builtin.hc [new file with mode: 0644]
H2MP/hcode/camera.hc [new file with mode: 0644]
H2MP/hcode/cameraMG.hc [new file with mode: 0644]
H2MP/hcode/cat2.hc [new file with mode: 0644]
H2MP/hcode/catapult.hc [new file with mode: 0644]
H2MP/hcode/chunk.hc [new file with mode: 0644]
H2MP/hcode/constant.hc [new file with mode: 0644]
H2MP/hcode/crossbow.hc [new file with mode: 0644]
H2MP/hcode/crusader.hc [new file with mode: 0644]
H2MP/hcode/cube.hc [new file with mode: 0644]
H2MP/hcode/damage.hc [new file with mode: 0644]
H2MP/hcode/dthfire.hc [new file with mode: 0644]
H2MP/hcode/dthhorse.hc [new file with mode: 0644]
H2MP/hcode/eidolon.hc [new file with mode: 0644]
H2MP/hcode/entity.hc [new file with mode: 0644]
H2MP/hcode/eric.hc [new file with mode: 0644]
H2MP/hcode/explode.hc [new file with mode: 0644]
H2MP/hcode/famhorse.hc [new file with mode: 0644]
H2MP/hcode/fangel.hc [new file with mode: 0644]
H2MP/hcode/fireball.hc [new file with mode: 0644]
H2MP/hcode/fish.hc [new file with mode: 0644]
H2MP/hcode/flameorb.hc [new file with mode: 0644]
H2MP/hcode/flames.hc [new file with mode: 0644]
H2MP/hcode/fx.hc [new file with mode: 0644]
H2MP/hcode/gauntlet.hc [new file with mode: 0644]
H2MP/hcode/global.hc [new file with mode: 0644]
H2MP/hcode/glyph.hc [new file with mode: 0644]
H2MP/hcode/golem.hc [new file with mode: 0644]
H2MP/hcode/h3ents.txt [new file with mode: 0644]
H2MP/hcode/hurter.hc [new file with mode: 0644]
H2MP/hcode/hydra.hc [new file with mode: 0644]
H2MP/hcode/icemace.hc [new file with mode: 0644]
H2MP/hcode/imp.hc [new file with mode: 0644]
H2MP/hcode/impulse.hc [new file with mode: 0644]
H2MP/hcode/invntory.hc [new file with mode: 0644]
H2MP/hcode/light.hc [new file with mode: 0644]
H2MP/hcode/lightning.hc [new file with mode: 0644]
H2MP/hcode/lightwp.hc [new file with mode: 0644]
H2MP/hcode/magicmis.hc [new file with mode: 0644]
H2MP/hcode/math.hc [new file with mode: 0644]
H2MP/hcode/medusa.hc [new file with mode: 0644]
H2MP/hcode/messages.hc [new file with mode: 0644]
H2MP/hcode/meteor.hc [new file with mode: 0644]
H2MP/hcode/mezzoman.hc [new file with mode: 0644]
H2MP/hcode/mg_ai.hc [new file with mode: 0644]
H2MP/hcode/mummy.hc [new file with mode: 0644]
H2MP/hcode/necro.hc [new file with mode: 0644]
H2MP/hcode/newai.hc [new file with mode: 0644]
H2MP/hcode/newfunc.hc [new file with mode: 0644]
H2MP/hcode/newimp.hc [new file with mode: 0644]
H2MP/hcode/newplay.hc [new file with mode: 0644]
H2MP/hcode/object.hc [new file with mode: 0644]
H2MP/hcode/paladin.hc [new file with mode: 0644]
H2MP/hcode/path.hc [new file with mode: 0644]
H2MP/hcode/pentacles.hc [new file with mode: 0644]
H2MP/hcode/ph_eido.hc [new file with mode: 0644]
H2MP/hcode/plaque.hc [new file with mode: 0644]
H2MP/hcode/plats_mp.hc [new file with mode: 0644]
H2MP/hcode/precache.hc [new file with mode: 0644]
H2MP/hcode/projbhvr.hc [new file with mode: 0644]
H2MP/hcode/proto.hc [new file with mode: 0644]
H2MP/hcode/pstboar.hc [new file with mode: 0644]
H2MP/hcode/punchdgr.hc [new file with mode: 0644]
H2MP/hcode/purifier.hc [new file with mode: 0644]
H2MP/hcode/quake.hc [new file with mode: 0644]
H2MP/hcode/rat.hc [new file with mode: 0644]
H2MP/hcode/raven.hc [new file with mode: 0644]
H2MP/hcode/ravenai.hc [new file with mode: 0644]
H2MP/hcode/ravenstf.hc [new file with mode: 0644]
H2MP/hcode/reflect.hc [new file with mode: 0644]
H2MP/hcode/rider.hc [new file with mode: 0644]
H2MP/hcode/rings.hc [new file with mode: 0644]
H2MP/hcode/scorpion.hc [new file with mode: 0644]
H2MP/hcode/setmodth.hc [new file with mode: 0644]
H2MP/hcode/setstaff.hc [new file with mode: 0644]
H2MP/hcode/shardice.hc [new file with mode: 0644]
H2MP/hcode/sheep.hc [new file with mode: 0644]
H2MP/hcode/shield.hc [new file with mode: 0644]
H2MP/hcode/sickle.hc [new file with mode: 0644]
H2MP/hcode/skullwiz.hc [new file with mode: 0644]
H2MP/hcode/snake.hc [new file with mode: 0644]
H2MP/hcode/soul.hc [new file with mode: 0644]
H2MP/hcode/sound.hc [new file with mode: 0644]
H2MP/hcode/spawn.hc [new file with mode: 0644]
H2MP/hcode/specials.hc [new file with mode: 0644]
H2MP/hcode/spider.hc [new file with mode: 0644]
H2MP/hcode/spit.hc [new file with mode: 0644]
H2MP/hcode/sspike.hc [new file with mode: 0644]
H2MP/hcode/stats.hc [new file with mode: 0644]
H2MP/hcode/strings.hc [new file with mode: 0644]
H2MP/hcode/sunstaff.hc [new file with mode: 0644]
H2MP/hcode/t_head.hc [new file with mode: 0644]
H2MP/hcode/testweap.hc [new file with mode: 0644]
H2MP/hcode/torch.hc [new file with mode: 0644]
H2MP/hcode/tripmine.hc [new file with mode: 0644]
H2MP/hcode/vorpal.hc [new file with mode: 0644]
H2MP/hcode/warhamer.hc [new file with mode: 0644]
H2MP/hcode/warhorse.hc [new file with mode: 0644]
H2MP/hcode/waypoint.hc [new file with mode: 0644]
H2MP/hcode/weather.hc [new file with mode: 0644]
H2MP/hcode/wp_art.hc [new file with mode: 0644]
H2MP/hcode/yakman.hc [new file with mode: 0644]
H2MP/scitech/debug.h [new file with mode: 0644]
H2MP/scitech/mgldos.h [new file with mode: 0644]
H2MP/scitech/mgllt.lib [new file with mode: 0644]
H2MP/scitech/mglwin.h [new file with mode: 0644]
H2MP/scitech/mgraph.h [new file with mode: 0644]
H2W/Client/adivtab.h [new file with mode: 0644]
H2W/Client/anorm_dots.h [new file with mode: 0644]
H2W/Client/anorms.h [new file with mode: 0644]
H2W/Client/bothdefs.h [new file with mode: 0644]
H2W/Client/bspfile.h [new file with mode: 0644]
H2W/Client/cd_win.c [new file with mode: 0644]
H2W/Client/cdaudio.h [new file with mode: 0644]
H2W/Client/cl_cam.c [new file with mode: 0644]
H2W/Client/cl_demo.c [new file with mode: 0644]
H2W/Client/cl_effect.c [new file with mode: 0644]
H2W/Client/cl_effect.h [new file with mode: 0644]
H2W/Client/cl_ents.c [new file with mode: 0644]
H2W/Client/cl_input.c [new file with mode: 0644]
H2W/Client/cl_main.c [new file with mode: 0644]
H2W/Client/cl_parse.c [new file with mode: 0644]
H2W/Client/cl_pred.c [new file with mode: 0644]
H2W/Client/cl_tent.c [new file with mode: 0644]
H2W/Client/client.h [new file with mode: 0644]
H2W/Client/cmd.c [new file with mode: 0644]
H2W/Client/cmd.h [new file with mode: 0644]
H2W/Client/common.c [new file with mode: 0644]
H2W/Client/common.h [new file with mode: 0644]
H2W/Client/console.c [new file with mode: 0644]
H2W/Client/console.h [new file with mode: 0644]
H2W/Client/crc.c [new file with mode: 0644]
H2W/Client/crc.h [new file with mode: 0644]
H2W/Client/cvar.c [new file with mode: 0644]
H2W/Client/cvar.h [new file with mode: 0644]
H2W/Client/d_draw.asm [new file with mode: 0644]
H2W/Client/d_draw.s [new file with mode: 0644]
H2W/Client/d_draw16.asm [new file with mode: 0644]
H2W/Client/d_draw16.s [new file with mode: 0644]
H2W/Client/d_draw16t.asm [new file with mode: 0644]
H2W/Client/d_edge.c [new file with mode: 0644]
H2W/Client/d_fill.c [new file with mode: 0644]
H2W/Client/d_iface.h [new file with mode: 0644]
H2W/Client/d_ifacea.h [new file with mode: 0644]
H2W/Client/d_init.c [new file with mode: 0644]
H2W/Client/d_local.h [new file with mode: 0644]
H2W/Client/d_modech.c [new file with mode: 0644]
H2W/Client/d_part.c [new file with mode: 0644]
H2W/Client/d_parta.asm [new file with mode: 0644]
H2W/Client/d_parta.s [new file with mode: 0644]
H2W/Client/d_polysa.asm [new file with mode: 0644]
H2W/Client/d_polysa.s [new file with mode: 0644]
H2W/Client/d_polysa2.asm [new file with mode: 0644]
H2W/Client/d_polysa3.asm [new file with mode: 0644]
H2W/Client/d_polysa4.asm [new file with mode: 0644]
H2W/Client/d_polysa5.asm [new file with mode: 0644]
H2W/Client/d_polyse.c [new file with mode: 0644]
H2W/Client/d_scan.c [new file with mode: 0644]
H2W/Client/d_scana.asm [new file with mode: 0644]
H2W/Client/d_scana.s [new file with mode: 0644]
H2W/Client/d_sky.c [new file with mode: 0644]
H2W/Client/d_spr8.asm [new file with mode: 0644]
H2W/Client/d_spr8.s [new file with mode: 0644]
H2W/Client/d_spr8t.asm [new file with mode: 0644]
H2W/Client/d_spr8t2.asm [new file with mode: 0644]
H2W/Client/d_sprite.c [new file with mode: 0644]
H2W/Client/d_surf.c [new file with mode: 0644]
H2W/Client/d_vars.c [new file with mode: 0644]
H2W/Client/d_varsa.asm [new file with mode: 0644]
H2W/Client/d_varsa.s [new file with mode: 0644]
H2W/Client/d_zpoint.c [new file with mode: 0644]
H2W/Client/draw.c [new file with mode: 0644]
H2W/Client/draw.h [new file with mode: 0644]
H2W/Client/genmodel.h [new file with mode: 0644]
H2W/Client/gl_draw.c [new file with mode: 0644]
H2W/Client/gl_mesh.c [new file with mode: 0644]
H2W/Client/gl_model.c [new file with mode: 0644]
H2W/Client/gl_model.h [new file with mode: 0644]
H2W/Client/gl_ngraph.c [new file with mode: 0644]
H2W/Client/gl_refrag.c [new file with mode: 0644]
H2W/Client/gl_rlight.c [new file with mode: 0644]
H2W/Client/gl_rmain.c [new file with mode: 0644]
H2W/Client/gl_rmisc.c [new file with mode: 0644]
H2W/Client/gl_rsurf.c [new file with mode: 0644]
H2W/Client/gl_screen.c [new file with mode: 0644]
H2W/Client/gl_test.c [new file with mode: 0644]
H2W/Client/gl_vidnt.c [new file with mode: 0644]
H2W/Client/gl_warp.c [new file with mode: 0644]
H2W/Client/gl_warp_sin.h [new file with mode: 0644]
H2W/Client/glquake.h [new file with mode: 0644]
H2W/Client/in_win.c [new file with mode: 0644]
H2W/Client/input.h [new file with mode: 0644]
H2W/Client/keys.c [new file with mode: 0644]
H2W/Client/keys.h [new file with mode: 0644]
H2W/Client/math.asm [new file with mode: 0644]
H2W/Client/math.s [new file with mode: 0644]
H2W/Client/mathlib.c [new file with mode: 0644]
H2W/Client/mathlib.h [new file with mode: 0644]
H2W/Client/menu.c [new file with mode: 0644]
H2W/Client/menu.h [new file with mode: 0644]
H2W/Client/midi.c [new file with mode: 0644]
H2W/Client/midi.h [new file with mode: 0644]
H2W/Client/mididef.h [new file with mode: 0644]
H2W/Client/midstuff.h [new file with mode: 0644]
H2W/Client/model.c [new file with mode: 0644]
H2W/Client/model.h [new file with mode: 0644]
H2W/Client/modelgen.h [new file with mode: 0644]
H2W/Client/mstrconv.c [new file with mode: 0644]
H2W/Client/net.h [new file with mode: 0644]
H2W/Client/net_chan.c [new file with mode: 0644]
H2W/Client/net_wins.c [new file with mode: 0644]
H2W/Client/nonintel.c [new file with mode: 0644]
H2W/Client/pmove.c [new file with mode: 0644]
H2W/Client/pmove.h [new file with mode: 0644]
H2W/Client/pmovetst.c [new file with mode: 0644]
H2W/Client/protocol.h [new file with mode: 0644]
H2W/Client/qe3.ico [new file with mode: 0644]
H2W/Client/quakedef.h [new file with mode: 0644]
H2W/Client/quakeworld.bmp [new file with mode: 0644]
H2W/Client/qwcl.dsp [new file with mode: 0644]
H2W/Client/qwcl.dsw [new file with mode: 0644]
H2W/Client/qwcl2.ico [new file with mode: 0644]
H2W/Client/r_aclip.c [new file with mode: 0644]
H2W/Client/r_aclipa.asm [new file with mode: 0644]
H2W/Client/r_aclipa.s [new file with mode: 0644]
H2W/Client/r_alias.c [new file with mode: 0644]
H2W/Client/r_aliasa.asm [new file with mode: 0644]
H2W/Client/r_aliasa.s [new file with mode: 0644]
H2W/Client/r_bsp.c [new file with mode: 0644]
H2W/Client/r_draw.c [new file with mode: 0644]
H2W/Client/r_drawa.asm [new file with mode: 0644]
H2W/Client/r_drawa.s [new file with mode: 0644]
H2W/Client/r_edge.c [new file with mode: 0644]
H2W/Client/r_edgea.asm [new file with mode: 0644]
H2W/Client/r_edgea.s [new file with mode: 0644]
H2W/Client/r_edgeb.asm [new file with mode: 0644]
H2W/Client/r_efrag.c [new file with mode: 0644]
H2W/Client/r_light.c [new file with mode: 0644]
H2W/Client/r_local.h [new file with mode: 0644]
H2W/Client/r_main.c [new file with mode: 0644]
H2W/Client/r_misc.c [new file with mode: 0644]
H2W/Client/r_part.c [new file with mode: 0644]
H2W/Client/r_shared.h [new file with mode: 0644]
H2W/Client/r_sky.c [new file with mode: 0644]
H2W/Client/r_sprite.c [new file with mode: 0644]
H2W/Client/r_surf.c [new file with mode: 0644]
H2W/Client/r_vars.c [new file with mode: 0644]
H2W/Client/r_varsa.asm [new file with mode: 0644]
H2W/Client/r_varsa.s [new file with mode: 0644]
H2W/Client/render.h [new file with mode: 0644]
H2W/Client/resource.h [new file with mode: 0644]
H2W/Client/sbar.c [new file with mode: 0644]
H2W/Client/sbar.h [new file with mode: 0644]
H2W/Client/screen.c [new file with mode: 0644]
H2W/Client/screen.h [new file with mode: 0644]
H2W/Client/skin.c [new file with mode: 0644]
H2W/Client/snd_dma.c [new file with mode: 0644]
H2W/Client/snd_mem.c [new file with mode: 0644]
H2W/Client/snd_mix.c [new file with mode: 0644]
H2W/Client/snd_mixa.asm [new file with mode: 0644]
H2W/Client/snd_mixa.s [new file with mode: 0644]
H2W/Client/snd_win.c [new file with mode: 0644]
H2W/Client/sound.h [new file with mode: 0644]
H2W/Client/spritegn.h [new file with mode: 0644]
H2W/Client/strings.c [new file with mode: 0644]
H2W/Client/strings.h [new file with mode: 0644]
H2W/Client/surf16.asm [new file with mode: 0644]
H2W/Client/surf16.s [new file with mode: 0644]
H2W/Client/surf8.asm [new file with mode: 0644]
H2W/Client/surf8.s [new file with mode: 0644]
H2W/Client/sys.h [new file with mode: 0644]
H2W/Client/sys_win.c [new file with mode: 0644]
H2W/Client/sys_wina.asm [new file with mode: 0644]
H2W/Client/sys_wina.s [new file with mode: 0644]
H2W/Client/vid.h [new file with mode: 0644]
H2W/Client/vid_win.c [new file with mode: 0644]
H2W/Client/view.c [new file with mode: 0644]
H2W/Client/view.h [new file with mode: 0644]
H2W/Client/wad.c [new file with mode: 0644]
H2W/Client/wad.h [new file with mode: 0644]
H2W/Client/winquake.h [new file with mode: 0644]
H2W/Client/winquake.rc [new file with mode: 0644]
H2W/Client/zone.c [new file with mode: 0644]
H2W/Client/zone.h [new file with mode: 0644]
H2W/HCode/Ai.hc [new file with mode: 0644]
H2W/HCode/Bridge.hc [new file with mode: 0644]
H2W/HCode/Buttons.hc [new file with mode: 0644]
H2W/HCode/COMBAT.hc [new file with mode: 0644]
H2W/HCode/Client.hc [new file with mode: 0644]
H2W/HCode/Corpse.hc [new file with mode: 0644]
H2W/HCode/Defs.hc [new file with mode: 0644]
H2W/HCode/Demon.hc [new file with mode: 0644]
H2W/HCode/Doors.hc [new file with mode: 0644]
H2W/HCode/Enforcer.hc [new file with mode: 0644]
H2W/HCode/FAblade.hc [new file with mode: 0644]
H2W/HCode/FAspell.hc [new file with mode: 0644]
H2W/HCode/FIGHT.hc [new file with mode: 0644]
H2W/HCode/Fish.hc [new file with mode: 0644]
H2W/HCode/HC.BAT [new file with mode: 0644]
H2W/HCode/Head.hc [new file with mode: 0644]
H2W/HCode/Holotic.hc [new file with mode: 0644]
H2W/HCode/Items.hc [new file with mode: 0644]
H2W/HCode/MONSTERS.hc [new file with mode: 0644]
H2W/HCode/Mirage.hc [new file with mode: 0644]
H2W/HCode/Misc.hc [new file with mode: 0644]
H2W/HCode/Ogre.hc [new file with mode: 0644]
H2W/HCode/PLATS.hc [new file with mode: 0644]
H2W/HCode/SPRITES.hc [new file with mode: 0644]
H2W/HCode/SUBS.hc [new file with mode: 0644]
H2W/HCode/TRIGGERS.hc [new file with mode: 0644]
H2W/HCode/WORLD.hc [new file with mode: 0644]
H2W/HCode/Weapons.hc [new file with mode: 0644]
H2W/HCode/acidorb.hc [new file with mode: 0644]
H2W/HCode/ai2.hc [new file with mode: 0644]
H2W/HCode/allplay.hc [new file with mode: 0644]
H2W/HCode/altdeath.hc [new file with mode: 0644]
H2W/HCode/archer.hc [new file with mode: 0644]
H2W/HCode/artifact.hc [new file with mode: 0644]
H2W/HCode/assassin.hc [new file with mode: 0644]
H2W/HCode/assgren.hc [new file with mode: 0644]
H2W/HCode/assweap.hc [new file with mode: 0644]
H2W/HCode/axe.hc [new file with mode: 0644]
H2W/HCode/barrel.hc [new file with mode: 0644]
H2W/HCode/bldrain.hc [new file with mode: 0644]
H2W/HCode/boner.hc [new file with mode: 0644]
H2W/HCode/boulder.hc [new file with mode: 0644]
H2W/HCode/breakabl.hc [new file with mode: 0644]
H2W/HCode/builtin.hc [new file with mode: 0644]
H2W/HCode/camera.hc [new file with mode: 0644]
H2W/HCode/cameraMG.hc [new file with mode: 0644]
H2W/HCode/cat2.hc [new file with mode: 0644]
H2W/HCode/catapult.hc [new file with mode: 0644]
H2W/HCode/chunk.hc [new file with mode: 0644]
H2W/HCode/constant.hc [new file with mode: 0644]
H2W/HCode/crossbow.hc [new file with mode: 0644]
H2W/HCode/crusader.hc [new file with mode: 0644]
H2W/HCode/cube.hc [new file with mode: 0644]
H2W/HCode/damage.hc [new file with mode: 0644]
H2W/HCode/dmlevels.hc [new file with mode: 0644]
H2W/HCode/dthfire.hc [new file with mode: 0644]
H2W/HCode/dthhorse.hc [new file with mode: 0644]
H2W/HCode/eidolon.hc [new file with mode: 0644]
H2W/HCode/entity.hc [new file with mode: 0644]
H2W/HCode/entity2.hc [new file with mode: 0644]
H2W/HCode/eric.hc [new file with mode: 0644]
H2W/HCode/explode.hc [new file with mode: 0644]
H2W/HCode/famhorse.hc [new file with mode: 0644]
H2W/HCode/fangel.hc [new file with mode: 0644]
H2W/HCode/fireball.hc [new file with mode: 0644]
H2W/HCode/flameorb.hc [new file with mode: 0644]
H2W/HCode/flames.hc [new file with mode: 0644]
H2W/HCode/fx.hc [new file with mode: 0644]
H2W/HCode/gauntlet.hc [new file with mode: 0644]
H2W/HCode/gib.hc [new file with mode: 0644]
H2W/HCode/global.hc [new file with mode: 0644]
H2W/HCode/glyph.hc [new file with mode: 0644]
H2W/HCode/golem.hc [new file with mode: 0644]
H2W/HCode/golem_b.hc [new file with mode: 0644]
H2W/HCode/golem_i.hc [new file with mode: 0644]
H2W/HCode/golem_s.hc [new file with mode: 0644]
H2W/HCode/grenade2.hc [new file with mode: 0644]
H2W/HCode/hamthrow.hc [new file with mode: 0644]
H2W/HCode/hcode.dsp [new file with mode: 0644]
H2W/HCode/horse.hc [new file with mode: 0644]
H2W/HCode/hydra.hc [new file with mode: 0644]
H2W/HCode/ice_imp.hc [new file with mode: 0644]
H2W/HCode/icemace.hc [new file with mode: 0644]
H2W/HCode/iceshot.hc [new file with mode: 0644]
H2W/HCode/imp.hc [new file with mode: 0644]
H2W/HCode/impulse.hc [new file with mode: 0644]
H2W/HCode/invntory.hc [new file with mode: 0644]
H2W/HCode/javelin.hc [new file with mode: 0644]
H2W/HCode/light.hc [new file with mode: 0644]
H2W/HCode/lightning.hc [new file with mode: 0644]
H2W/HCode/lightwp.hc [new file with mode: 0644]
H2W/HCode/magicmis.hc [new file with mode: 0644]
H2W/HCode/math.hc [new file with mode: 0644]
H2W/HCode/medusa.hc [new file with mode: 0644]
H2W/HCode/medusa2.hc [new file with mode: 0644]
H2W/HCode/messages.hc [new file with mode: 0644]
H2W/HCode/meteor.hc [new file with mode: 0644]
H2W/HCode/mezzoman.hc [new file with mode: 0644]
H2W/HCode/mg_ai.hc [new file with mode: 0644]
H2W/HCode/mummy.hc [new file with mode: 0644]
H2W/HCode/necro.hc [new file with mode: 0644]
H2W/HCode/necspell.hc [new file with mode: 0644]
H2W/HCode/newai.hc [new file with mode: 0644]
H2W/HCode/newcube.hc [new file with mode: 0644]
H2W/HCode/newfunc.hc [new file with mode: 0644]
H2W/HCode/newimp.hc [new file with mode: 0644]
H2W/HCode/newplay.hc [new file with mode: 0644]
H2W/HCode/object.hc [new file with mode: 0644]
H2W/HCode/paladin.hc [new file with mode: 0644]
H2W/HCode/path.hc [new file with mode: 0644]
H2W/HCode/plaque.hc [new file with mode: 0644]
H2W/HCode/plats_mp.hc [new file with mode: 0644]
H2W/HCode/precache.hc [new file with mode: 0644]
H2W/HCode/progs.src [new file with mode: 0644]
H2W/HCode/progs2.src [new file with mode: 0644]
H2W/HCode/projbhvr.hc [new file with mode: 0644]
H2W/HCode/proto.hc [new file with mode: 0644]
H2W/HCode/pstboar.hc [new file with mode: 0644]
H2W/HCode/psthorse.hc [new file with mode: 0644]
H2W/HCode/punchdgr.hc [new file with mode: 0644]
H2W/HCode/purifier.hc [new file with mode: 0644]
H2W/HCode/quake.hc [new file with mode: 0644]
H2W/HCode/rat.hc [new file with mode: 0644]
H2W/HCode/raven.hc [new file with mode: 0644]
H2W/HCode/ravenai.hc [new file with mode: 0644]
H2W/HCode/ravenstf.hc [new file with mode: 0644]
H2W/HCode/reflect.hc [new file with mode: 0644]
H2W/HCode/rider.hc [new file with mode: 0644]
H2W/HCode/rings.hc [new file with mode: 0644]
H2W/HCode/scorpion.hc [new file with mode: 0644]
H2W/HCode/setmodth.hc [new file with mode: 0644]
H2W/HCode/setstaff.hc [new file with mode: 0644]
H2W/HCode/shardice.hc [new file with mode: 0644]
H2W/HCode/sheep.hc [new file with mode: 0644]
H2W/HCode/shield.hc [new file with mode: 0644]
H2W/HCode/sickle.hc [new file with mode: 0644]
H2W/HCode/skullwiz.hc [new file with mode: 0644]
H2W/HCode/snake.hc [new file with mode: 0644]
H2W/HCode/soul.hc [new file with mode: 0644]
H2W/HCode/sound.hc [new file with mode: 0644]
H2W/HCode/spawn.hc [new file with mode: 0644]
H2W/HCode/spawner.hc [new file with mode: 0644]
H2W/HCode/specials.hc [new file with mode: 0644]
H2W/HCode/spectate.hc [new file with mode: 0644]
H2W/HCode/spider.hc [new file with mode: 0644]
H2W/HCode/spit.hc [new file with mode: 0644]
H2W/HCode/stats.hc [new file with mode: 0644]
H2W/HCode/strings.hc [new file with mode: 0644]
H2W/HCode/sunstaff.hc [new file with mode: 0644]
H2W/HCode/testweap.hc [new file with mode: 0644]
H2W/HCode/torch.hc [new file with mode: 0644]
H2W/HCode/tripmine.hc [new file with mode: 0644]
H2W/HCode/u.bat [new file with mode: 0644]
H2W/HCode/vorpal.hc [new file with mode: 0644]
H2W/HCode/warhamer.hc [new file with mode: 0644]
H2W/HCode/warhorse.hc [new file with mode: 0644]
H2W/HCode/warrider.hc [new file with mode: 0644]
H2W/HCode/waypoint.hc [new file with mode: 0644]
H2W/HCode/waypoint.qc [new file with mode: 0644]
H2W/HCode/weather.hc [new file with mode: 0644]
H2W/HCode/window.hc [new file with mode: 0644]
H2W/HCode/wp_art.hc [new file with mode: 0644]
H2W/HCode/xray.hc [new file with mode: 0644]
H2W/Server/asm_i386.h [new file with mode: 0644]
H2W/Server/model.c [new file with mode: 0644]
H2W/Server/pr_cmds.c [new file with mode: 0644]
H2W/Server/pr_comp.h [new file with mode: 0644]
H2W/Server/pr_edict.c [new file with mode: 0644]
H2W/Server/pr_exec.c [new file with mode: 0644]
H2W/Server/progdefs.h [new file with mode: 0644]
H2W/Server/progs.h [new file with mode: 0644]
H2W/Server/quakeasm.h [new file with mode: 0644]
H2W/Server/qwsv.dsp [new file with mode: 0644]
H2W/Server/qwsv.dsw [new file with mode: 0644]
H2W/Server/qwsvdef.h [new file with mode: 0644]
H2W/Server/server.h [new file with mode: 0644]
H2W/Server/sv_ccmds.c [new file with mode: 0644]
H2W/Server/sv_effect.c [new file with mode: 0644]
H2W/Server/sv_ents.c [new file with mode: 0644]
H2W/Server/sv_init.c [new file with mode: 0644]
H2W/Server/sv_main.c [new file with mode: 0644]
H2W/Server/sv_move.c [new file with mode: 0644]
H2W/Server/sv_phys.c [new file with mode: 0644]
H2W/Server/sv_send.c [new file with mode: 0644]
H2W/Server/sv_user.c [new file with mode: 0644]
H2W/Server/sys.h [new file with mode: 0644]
H2W/Server/sys_win.c [new file with mode: 0644]
H2W/Server/world.c [new file with mode: 0644]
H2W/Server/world.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/d3d.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/d3dcaps.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/d3drm.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/d3drmdef.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/d3drmobj.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/d3drmwin.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/d3dtypes.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/ddraw.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/dinput.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/dplay.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/dsetup.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/dsound.h [new file with mode: 0644]
H2W/dxsdk/sdk/inc/fastfile.h [new file with mode: 0644]
H2W/dxsdk/sdk/lib/dinput.lib [new file with mode: 0644]
H2W/dxsdk/sdk/lib/dxguid.lib [new file with mode: 0644]
H2W/h2w.dsw [new file with mode: 0644]
H2W/hw/Strings.txt [new file with mode: 0644]
H2W/scitech/include/debug.h [new file with mode: 0644]
H2W/scitech/include/mgldos.h [new file with mode: 0644]
H2W/scitech/include/mglwin.h [new file with mode: 0644]
H2W/scitech/include/mgraph.h [new file with mode: 0644]
H2W/scitech/lib/win32/vc/mgllt.lib [new file with mode: 0644]
gnu.txt [new file with mode: 0644]
info.txt [new file with mode: 0644]

diff --git a/EULA - Source Code.doc b/EULA - Source Code.doc
new file mode 100644 (file)
index 0000000..ed3baf8
Binary files /dev/null and b/EULA - Source Code.doc differ
diff --git a/H2MP/Portals/PUZZLES.TXT b/H2MP/Portals/PUZZLES.TXT
new file mode 100644 (file)
index 0000000..27f0ac8
--- /dev/null
@@ -0,0 +1,79 @@
+78\r
+lens Lens of Seeing\r
+takey Tailor's Key\r
+trkey Treasury Key\r
+shovl Shovel\r
+sand Pile of Sand\r
+stkey Stable Key\r
+glass Bead of Glass\r
+scrol Disrupt Magic Scroll\r
+amult Amulet of Hunger\r
+mithl Mithral Transmutation\r
+cskey Castle Key\r
+keep1 Bones of Loric\r
+keep3 Mill Key\r
+keep2 Bone Dust\r
+staff Staff of Nefertum\r
+lcrwn Lower Crown of Egypt\r
+ucrwn Upper Crown of Egypt\r
+ankey Key of Anubis\r
+eyeh Eye of Horus\r
+e3 Imsethy Canopic Jar\r
+s2 Guardian Key\r
+rcjem Rough Cut Gem\r
+e6 Qebhsenudr Canopic Jar\r
+e1 Pharaoh Key\r
+rakey Key of RA\r
+stime Scarab of Time\r
+scept Dark Pharaoh's Scepter\r
+e5 Duamutef Canopic Jar\r
+e4 Hapy Canopic Jar\r
+speye Serpent's Eye Gem\r
+gsphere Gold Sphere\r
+prybar Pry Bar\r
+music Sheet of Music\r
+cross Defiled Holy Relic\r
+holycrss Restored Holy Relic\r
+m1 Ornamental Stone Key\r
+m2 Crystal Skull\r
+m3 Jade Skull\r
+m4 Serpent's Heart\r
+fire Element of Fire\r
+air Element of Air\r
+water Element of Water\r
+earth Element of Earth\r
+r1 Gold Bar\r
+silver Silver Bar\r
+r2 Unpowered Crystal\r
+r3 Crown of Kings\r
+r4 Diamond Scepter\r
+r5 Powered Crystal\r
+r6 Voidstone\r
+r7 Sunstone\r
+r8 Shadowstone\r
+soul Soul Key\r
+mage Mage's Tome\r
+chalice Chalice of St. Eric\r
+mask Burial Mask of King Lazarus\r
+dagger Ajanti Dagger\r
+vial Oil of Anointment\r
+goldgem Jewel of Buddha\r
+greengem Sangha Gem\r
+redgem Dharma Jewel\r
+lbudda Jade Buddha\r
+dtongue Jar of Dragon Tongue\r
+scroll Scroll of Enchantment\r
+dukeseal Duke's Seal\r
+prayer2 Prayer Wheel\r
+crosskey Cross Key\r
+headkey Staff of Emperor Lo Pan\r
+tbtmask Eyes of Buddha\r
+scepter Vajra Scepter\r
+orb Orb of Dakini\r
+magekey Mage's Key\r
+tienkey Tien's Key\r
+incense Incense of Enlightenment\r
+tbtkey Emperor's Key\r
+orb2 Sphere of Order\r
+bell Bell of Ghanta\r
+stonet Stone of Seldoot\r
diff --git a/H2MP/Portals/Strings.txt b/H2MP/Portals/Strings.txt
new file mode 100644 (file)
index 0000000..acbe15b
--- /dev/null
@@ -0,0 +1,562 @@
+You need a bead of glass\r
+You have made a Lens of Seeing!\r
+This letter reads: "My Love, before the guillotine can separate us, I will break the stained glass and escape.  Love Anton"\r
+You see a crystal wall and...\r
+An Arch of Crystal!\r
+This fireplace is unusual\r
+Your digging pays off!\r
+The tailor's closet is locked\r
+A magical barrier blocks your way\r
+You need the Treasury Key\r
+Only one of the Brotherhood of Hunger may approach the Altar\r
+"And it is foretold that by seeking out sand, glass, and grindstone, one may cross the crystal barrier and join with the Master of Hunger.  Your quest begins at the fireplace by the forge."\r
+You have melted the sand!\r
+You need sand to make glass\r
+You need the Stable Key\r
+You find a hidden book!\r
+The butcher's diary tells how@he found the key to the treasury, but@buried it where the water runs upward\r
+This letter reads: "My Love, before the guillotine I will break the stained glass and escape.  If I fail, in my grave I will hold the key to the treasury for you.  Love Anton"\r
+The book reads "They took the castle@by storm, so many died, but I was able@to bury the key by the tree and the forge."\r
+You hear a door across the room open\r
+You need the bones of Loric\r
+You have created a potion of@Mithril Transmutation!\r
+You need the bone dust of Loric@to complete the spell and create the potion of Mithril Transmutation\r
+You have found the Tomb of Loric\r
+You need the Mill Key\r
+The catapult looks to be the way over the wall.  Step on the platform and swing to fire!\r
+The door is barred\r
+A large Mithril wall\r
+You have transmuted the@Mithril wall to wood!\r
+You need the castle key\r
+You see a body encased in webs\r
+You feel a strong magic radiating@from the grindstone\r
+Resting place for the@Upper Crown of Egypt\r
+Resting place for the@Lower Crown of Egypt\r
+You have re-united the Crowns of Egypt!@Horus smiles upon you\r
+The obelisk tells of the@God Horus creating an all@seeing Eye for RamessesII\r
+And Horus smiled upon@RamsessesII with his Eye,@granting him endless travel\r
+You need the Eye of Horus\r
+Horus breaks the seal@and opens your path\r
+This wall tells of Set searching@for his Scarab of Time\r
+You need the Staff of Nefertum\r
+Prophecy of Set: When RA rides his chariot highest in the heavens at the Palace of the Pharaoh shall the Staff of Nefertum be set free from this chamber of the Sun\r
+Prophecy of Amun: Setting the wheel@of ages to alignment with each equinox@shall Upper and Lower Egypt unite\r
+RamsessesII fortells of the wheel of ages@being aligned on both equinoxes at@the same, yet different times\r
+You have rotated the wheel of ages@30 degrees.  It now points to a jackal\r
+The constellation of Atum\r
+The constellation of Cancer\r
+A constellation of a Hippopotamus\r
+A constellation of a Ram\r
+The constellation of Pisces\r
+The constellation of Gemini\r
+The constellation of Taurus\r
+The constellation of Isis\r
+The constellation of Aries\r
+A constellation of a Lion\r
+A constellation of a Baboon\r
+The hieroglyphs read:@Hapy Canopic Jar\r
+The hieroglyphs read:@Imsethy Canopic Jar\r
+The hieroplyphs read:@Qebhsenuef Canopic Jar\r
+The hieroglyphs read:@Duamutef Canopic Jar\r
+You have found@the Burial Chamber of@the Dark Pharaoh\r
+The boat is ready for the journey                                                    \r
+You need the key of RA\r
+The sundial reads: 9 o'clock\r
+10 o'clock\r
+11 o'clock\r
+12 o'clock\r
+1 o'clock\r
+2 o'clock\r
+3 o'clock\r
+4 o'clock\r
+5 o'clock\r
+6 o'clock\r
+7 o'clock\r
+8 o'clock\r
+You need the key of Anubis\r
+The Scepter is placed!\r
+You need the Rough Cut Gem\r
+The Gem is ready to be cut\r
+On this wall, the scribes give calculations for the planet's shift over time in the Zodiac.  These calculations instruct the advancement of the Wheel of Time in the current day two steps further than Gemini\r
+The Dark Pharaoh's Journey@beyond has been staved@without his Royal Scepter\r
+The hieroglyphs ask Anubis to@re-unite the Dark Pharaoh with@his Royal Scepter\r
+Summer Solstice falls in the@constellation of the@Hippopotamus\r
+Vernal Equinox lands in the@constellation of Gemini\r
+You need some music@before you can play@the organ\r
+The music is beautiful!\r
+You find a secret door!\r
+You need the Serpent's Eye Gem\r
+You have restored the@Blessing\r
+You see a font of@Holy Water before you\r
+The Altar has been desecrated!\r
+They have desecrated this@Holy Place.  For that I will never@forgive them.  Eidolon must be@behind this!  Only his foulness could@penetrate this far into our@realm.  He will pay!\r
+You destroyed the old tower!\r
+You have been given the power to destroy the Crystal Golem!\r
+Welcome to the Temple of@Horus, God of the Sky and@Protector of the Pharaoh\r
+You have found the Time Portal of Set\r
+You have traveled back 1000@years to the Temple of Nefertum\r
+The Guardian Key is needed\r
+You need the Key of the Pharaoh\r
+You hear a door open above you\r
+The Bones are crushing nicely.  Go outside to gather the dust.\r
+The Eye of the Serpent@holds the key\r
+The Upper Crown of Egypt@once rested here\r
+The Shrine of the Dark Pharaoh@waits for the return of His Scepter\r
+Blackmarsh\r
+Barbican\r
+King's Court\r
+Inner Courtyard\r
+Stables\r
+Temple of Horus\r
+Ancient Temple of Nefertum\r
+Temple of Nefertum\r
+Palace of the Pharaoh\r
+Pyramid of Anubis\r
+Cathedral\r
+Here lies Anton, he lost his head\r
+You DARE defile the image of Anubis!\r
+The portal is barred\r
+Famine's Domain\r
+Pestilence's Lair\r
+Palace Entrance\r
+You have activated the drawbridge\r
+Before the Dark Ones stormed the castle, I sealed the old tower\r
+Two Golden Lions are all that stand between you and the Dark Mage\r
+The Forgotten Chapel\r
+Invisible forces are at work here.  If only you could see what lies beyond the wall in front of you.\r
+You've killed Steve!!!!\r
+The Crystal Golem seems to be immune to your attacks!\r
+Temple of Light\r
+The Shrine of Naos\r
+The Mill\r
+The Brotherhood of Hunger has a secret altar in the Shoppe next door.  Must hide the key in the forgotten chapel@@-Martek, the tailor \r
+I am leaving messages in case I fail to destroy Eidolon. I begin in Castle Blackmarsh where Famine waits. I've heard strange rumors of an invincible Crystal Golem that protects the entrance to Famine's Lair. Perhaps the King's mages know of a way to grant me the power to destroy it. I believe that the Brotherhood of Hunger may hold some clues, and knowing that I must acquire the Amulet of Hunger from the castle treasury. -Tyranith\r
+Our defenses have fallen! The key to our magic is in the hands of the Evil. Death has captured the Four Elements and spread them throughout the realm. Defended by were-jaguars and scorpions, the Elements must be reclaimed to extend the Bridge of Stars. Only when the Elements have been returned will the Well of Souls be opened. I have heard legends hinting at the Test of the Elements, and I can only hope that I will be able to pass all four. -Tyranith\r
+The fiends! Two of Thysis' greatest treasures have been stolen. For the sake of honor, both Crowns must be returned to their resting place! First, I must find the Four Canopic Jars and enter the Afterworld, a place I hoped to never see. I happened upon a gravely wounded scribe who told me to use the Staff of Nefertum to advance the Wheel of Ages. I have put this down as the delirium of a dying man, let us hope that this is the case. -Tyranith\r
+Again, the foul creatures have stolen items of great power from the people of Thyrion. In order to return these items of import, I will first need to gain entrance to the reflecting pool. Unfortunately, I carry no items for donation. Let us hope that the temple priests have left enough behind to pay the tithe. -Tyranith\r
+Curse Eidolon, for all that I have done has been for naught! Even now I hear the dreadful stomp of Eidolon's Golems spelling my doom. The Chaos Sphere, Eidolon's power source, has resurrected the Dark Generals who have already reclaimed what was taken from them. Alas, I have no warning of lies ahead for I can only see my death. As I ready my weapons for one final assault, I pray that my death was not in vain. Someone must destroy Eidolon. -Tyranith\r
+You've found Tyranith's body!  \r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+This door is jammed shut\r
+The circuit is not complete\r
+My research shows gold to be the best conductor\r
+Some sort of invisible wall impedes you.@Perhaps it can be destroyed...\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+Charity in all things\r
+You need the Diamond Scepter\r
+You need the Crown of Kings\r
+Some sort of magical recharger...\r
+It's missing the power supply\r
+A reward awaits in the Temple of Mars\r
+To the Gardens of Athena\r
+Choose life above all others\r
+To the Forum of Zeus\r
+The guardians of Zeus hide from normal vision\r
+To the Temple of Mars\r
+Fortune awaits those who search\r
+To the Baths of Demetrius\r
+Alignment is the key\r
+The Hall of Heroes\r
+Only the charitable shall pass\r
+This door opens elsewhere\r
+Gardens of Athena\r
+Let no weapon be drawn before the altar of Athena\r
+Look above for divine providence\r
+The door is barred from the other side\r
+Donation is the key to charity\r
+To the Hall of Heroes\r
+Follow the ledge to hidden rewards\r
+Forum of Zeus\r
+Be penitent before the throne of Zeus\r
+Choose your fate\r
+Spells of illusions can deceive unknowing eyes\r
+Search the pool for aid in the future\r
+You chose poorly\r
+You have already chosen\r
+A vital piece is missing\r
+Baths of Demetrius\r
+Fire first, then steam, water, and air\r
+Careful study prevails\r
+The pattern is incorrect\r
+The pattern is set\r
+Something is not set right\r
+Temple of Mars\r
+Your perseverence is now rewarded\r
+You need the Voidstone\r
+You need the Sunstone\r
+You need the Shadowstone\r
+Coliseum of War\r
+Palace of Columns\r
+You have proven your worth\r
+The High Priest Coatepec has taken the Element of Air with him to the other side\r
+The Heart is the key to the Altar\r
+Plaza of the Sun\r
+Prove yourself in the Test of Fire\r
+You have desecrated the Stream of Life!\r
+The Four Elements are needed to finish@the Bridge of Stars.  Only then@will the Well of Souls be opened\r
+Those who desecrate the Stream of Life@shall be punished with death\r
+You need the Crystal Skull\r
+You need the Jade skull\r
+You need the Ornamental Key\r
+Square of the Stream\r
+Prove yourself in the Test of Water\r
+You need the Serpent's Heart\r
+Tomb of the High Priest\r
+Court of 1000 Warriors\r
+Prove yourself in the Test of Earth\r
+Your path is clear\r
+\r
+Those who dare to desecrate the@Tomb of Coatepec@shall join Him in death\r
+\r
+Bridge of Stars\r
+There is no return from the Realm of Death\r
+\r
+Only those who pass the Ordeal@shall gain an audience with Eidolon\r
+Eidolon controls the Chaos Sphere@and with it,@the power of life and death\r
+The Soul Key awaits those@who brave the Ordeal and survive\r
+You need the Soul Key to enter the realm of Eidolon\r
+Eidolon's Ordeal\r
+The Underhalls\r
+The Cathedral\r
+Tower of the Dark Mage\r
+Eidolon's Lair\r
+You need the Mage's Tome\r
+The bars have opened on the second floor of the Mage's Tower\r
+This door is corroded shut\r
+Your quest is nearing an end@prepare to tremble before the@onslaught of War\r
+You need the Element of Earth\r
+You need the Element of Air\r
+You need the Element of Water\r
+You need the Element of Fire\r
+You may now enter to the Realm of Death\r
+Well of Souls\r
+Reckless Abandon\r
+Tom Foolery\r
+Total Carnage\r
+To the Palace of Columns\r
+To the Plaza of the Sun\r
+To the Square of the Stream\r
+To the Tomb of the High Priest\r
+To the Court of 1000 Warriors\r
+To the Bridge of Stars\r
+To Eidolon's Ordeal\r
+To the Underhalls\r
+To the Cathedral\r
+To the Tower of the Dark Mage\r
+Atrium of Immolation\r
+Temple of Ra\r
+To the Obelisk of the Moon\r
+Obelisk of the Moon\r
+To the Reflecting Pool\r
+Reflecting Pool\r
+The solitude of the pool is known to heal the pain of many\r
+The King of the realm decreed emergency stores to be hidden throughout the city.  Most have been blocked in.\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+As the last traces of Famine are pulled into the depths of the Nether Dimension, weariness fills your very soul.  This was but the first of the Dark Generals, who can guess what terrors await you, guarding the dark secrets of their awful master, Eidolon.  Still, the lifeblood of your entire race depends on the sharpness of your wits and the edge of your blade.  Do you have the strength to defeat all of Eidolon's foul legions?@@To carry the fight to Eidolon, please purchase the full version of hexen II... Thyrion needs your help.\r
+With the destruction of Eidolon and his four Dark Generals, Thyrion is once again free from the darkness that had enshrouded it.  As the news of Eidolon's defeat spreads like wildfire throughout the land, the cries of victory rise from millions of lips.  Narrowly, we have avoided genocide.\r
+Given time, our nations shall grow strong again and our people shall prosper.  Once the last vestiges of Eidolon's foul machinations and troops are swept from Thyrion, the world shall return to normal.  Even now, our most powerful magicians are weaving spells to forever entrap the root of the Serpent Rider's power, the remains of the Chaos Sphere.  For if even mere shards of the Chaos Sphere still exist, so does deadly evil.  Fortunately, its masters have all been destroyed.  And so, the final chapter is written in the Chronicle of Deeds.  It is with a light heart that I set down my quill and close the tome that lies before me.\r
+For with the fall of Eidolon, there is nothing left to fear.\r
+As the mystical energies released by the destruction of Famine swirl the air before you, a sense of urgency overwhelms you as the very fabric of space is torn asunder.  Hurled instantly across vast distances, you find yourself in the land of Mazaera.  While the nausea from the teleportation begins to fade, you ready your weapons and survey the landscape before you.  Once teeming with life, now there is only a dark silence.  As the oppressive heat threatens to suffocate, you begin the next leg of your journey.  Regardless of the path you choose, Death awaits you.\r
+As the screams of Death fade to silence, you are once again ripped through the ethereal plane.  Sunlight shines down from the uncaring heavens and you recognize your surroundings as the land of Thysis.  Once a cultural haven for learning and art, the land is now a barren, deserted place.  Deep within his hidden stronghold lies Pestilence, master of curses and pain.  It was his diseases and plagues that decimated the people of Thysis, allowing Eidolon to enter this realm with barely a fight.  Perhaps now, with your newfound abilities and weapons, a cure has finally arrived.  \r
+As the killing blow falls, Pestilence is enveloped in a cloud of energy, forever removing the blight of his scabrous body from the face of Thyrion.  Once again, there is a sickening twist and you find yourself in the land of Septimus, Thyrion's final defense against the coming of Eidolon.  In a sick sort of irony, it seems fitting that the Dark General known as War would rule the most militaristic civilization in the world.  Taking a few minutes of much needed rest, you reflect on what you have accomplished.  You wonder to yourself, what sort of powerful being could bend the Dark Generals to his whim?  \r
+Once again you are victorious, and once again you are magically teleported to another realm.  Still, something is not right, you have a feeling of deja vu.  What sort of vile trickery is this?  You have returned to the land of Blackmarsh, where you first began this heroic adventure.  This entire time, while you hunted down and destroyed the Dark generals, you were within leagues of the darkest heart ever to stalk humanity.  With a renewed vigor, you begin what might be the hardest test of your life.  But the question remains, can Eidolon be defeated in his lair?  There is only one way to find out, and knowing this you begin the last part of your adventure.\r
+You found a secret area!\r
+Free Action\r
+Divine Intervention\r
+Revivification\r
+Holy Strength\r
+Soul Stealing\r
+Vampiric Drain\r
+Hide In Shadows\r
+Backstab\r
+Demon Glide\r
+Masochistic Mana\r
+You've made it this far, but you are not done yet.  Eidolon, the last of the Serpent Riders waits in the darkened castle before you.  Surrounded by his legions of soulless abominations, only you can save Thyrion from its plight.  All life rests in your hands.@----------@Nothing shall stop you from exacting your bloody vengeance.  Nothing will stand in your way.@----------@At least, not after you buy the full version of Hexen 2!@----------@No sheep were harmed in the making of this demo.\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+You need the Chalice of St. Eric\r
+Untold riches lie beyond the vacant grave\r
+You need the Eyes of Buddha\r
+Duck!\r
+This door is closed forever\r
+Close the door behind you \r
+You need the Mage's Key\r
+You need the Cross Key\r
+This statue seems strange...\r
+This cabinet is locked with the Duke's Seal\r
+The Duke's Seal is broken\r
+You need the Dragon's Tongue to complete this potion\r
+My dear friend Razumen, I have left the final ingredient for your potion in your lab.  I hope you succeed in your quest to get into the catacombs.\r
+The ballista cannot harm the magical field....yet\r
+The ballista is enchanted\r
+The False Temple\r
+You need the Sangha Gem\r
+After coming so far, to leave now would be defeat\r
+Palace of Emperor Egg Chen\r
+Only those of noble blood shall unlock this passage\r
+Persistence brings reward\r
+Tulku\r
+The Ice Caverns\r
+Courtyards of Tsok\r
+Temple of Kalachakra\r
+You need the Staff of Emperor Lo Pan\r
+You need the Orb of Dakini\r
+This ice is too thick to break with normal weapons\r
+Only the Dagger of Ajanti can break the lock that seals the doors before you\r
+Eidolon's Lair\r
+The Village of Turnabel\r
+The Duke's Keep\r
+The Catacombs\r
+The Hall of the Dead\r
+...I don't know what to do about Razumen.  He knows of the magic portal in the King's Tomb within the Hall of the Dead.  He hopes to use it to his advantage.  Because of this madness, I have used my seal to lock away his spells so he will not gain entrance to the tomb.\r
+Hmmm...this must be Razumen.  Looks like he never made it to town.\r
+I made my way down the village well to find out why the water supply has become tainted.  What I found was at once astounding and confusing.  An underground castle sits inside these cavernous regions and Eidolon's minions are about.  Perhaps Razumen back in the village can shed light on this situation.\r
+Watchman's Log -  A strange man in flowing robes appeared near the well.  Paramor approached him to question his intentions, and was instantly changed into a sheep.  I am ashamed for hiding, but what can one do against powerful magics?  I last saw the sorcerer heading towards the Duke's Keep.\r
+You need the Mage's Key\r
+Temple of Bardo\r
+Temple of Phurbu\r
+Palace Inner Chambers\r
+The Inner Sanctum of Praevus\r
+Follow the light, for while the path is wrought with danger, your destiny lies below.\r
+One of the prayer wheels is missing\r
+The Way of the Wheels:  Se, Mu, Dong, Tong, Dru, Ra\r
+You need the three supreme jewels: The Buddha, The Dharma, and The Sangha\r
+You need the Dharma Jewel\r
+You need the Jewel of Buddha\r
+The Wheel of Time\r
+Why are you standing in the fire?\r
+The Book of the Dead\r
+You need to complete the Way of the Wheels\r
+To achieve your goal, you must complete the tasks set forth by the three supreme jewels and make an offering to Shiva.\r
+To stop time, stop the wheel.\r
+You need the Oil of Anointment\r
+You need the Vajra Scepter\r
+You need the Incense of Enlightenment\r
+Se\r
+Mu\r
+Dong\r
+Tong\r
+Dru\r
+Ra\r
+It is barracaded from the inside\r
+This door has been locked\r
+Tien's Key has not outlived its usefulness\r
+After the strange snowfall and appearance of the creatures, Ameis went mad!  Screaming that we are meant to die, he has stolen the Stone of Seldoot and hidden in the storeroom...we cannot get him out.  Without the stone, we will surely freeze to death.  I pray salvation is near.\r
+Alas poor Paramor, you slew him well\r
+Razumen@as per your request, I have locked your laboratory, and hidden the key in my wine cellar.@-Garron\r
+The door is now frozen solid, and we are soon to follow.  Tien managed to lock our most valued treasure away before we could no longer leave, and now waits in his room for death.  I wish I could believe that we could escape, but the pounding of the monsters is growing louder.\r
+The door is frozen solid\r
+You need the Sphere of Order\r
+There is a holder here for the Stone of Seldoot\r
+Who says it's wrong to destroy literature?\r
+Tien's key is no longer needed\r
+You've made it to your final goal, to turn back would be cowardice\r
+You have done well\r
+You have not yet completed your tasks\r
+This ice seems strange......Your weapons do no good\r
+The incense has cleared your thoughts\r
+The cleansing of your soul is complete\r
+You have proven your strength\r
+Your mind must be clear and your soul at rest to pass this way\r
+The Trial of Strength is about to begin\r
+Prepare yourself...\r
+Apparently, Razumen isn't home\r
+You are indeed mighty!\r
+There is an inscription-@Only the Bell of Ghanta, along with the Vajra Scepter can wake the guardians of the portal\r
+Praevus has been defeated, and the souls of the Serpent Riders have been released.  As they disappear into the void, you wonder if the Serpent Riders are truly gone.  Perhaps evil has been vanquished from Thyrion once and for all.  Returning home, you have an uneasy feeling that it hasn't.\r
+You must also place the Bell of Ghanta in its cradle\r
+You must also place the Vajra Scepter in its cradle\r
+You need the Jade Buddha\r
+You've finally found the musical Bar-B-Que!\r
+To pass through these doors, you must defeat the guardians\r
+Do not attempt to follow any further.@Your meddling will only result in your death.  Leave while you can.@-Praevus\r
+As you step into the bright light a blast of cold air whips at your face.  Snow falls gently as far as you can see.  Its peaceful grace does not cause you to lose sight of your goal.  Praevus is not far...and neither is death.\r
+To enter the pillar of fire, you must first complete the trials of the Mind, Soul, and Body.\r
+This door is sealed...but that ballista might do the trick\r
+Abandon hope all ye who enter here\r
+Eidolon, the last of the Serpent Riders, is defeated by four unlikely companions\r
+The Paladin\r
+The Assassin\r
+The Crusader\r
+The Necromancer\r
+Months have passed, and a strange winter besets the land\r
+Eidolon's minion, the Demoness, is troubled by this strange magic and comes out of hiding\r
+The heroes, also troubled by the unexpected winter, return to Blackmarsh to investigate\r
+They decide to return to Eidolon's lair\r
+Meanwhile, the Demoness finds Eidolon's body missing and goes into his castle in search of the one who is responsible\r
+The heroes catch a fleeting image of the Demoness disappearing through the hole in the earth\r
+Gritting their teeth, they follow her into the darkness\r
+After Eidolon's defeat, the heroes returned to their homelands thinking that evil had finally been defeated.  Months passed with no sign of any trouble.  However, one day a strange winter suddenly overtook all of Thyrion.  The heroes returned to Eidolon's lair to investigate the strange happenings.  Upon their arrival, they discovered a large hole in the earth and the image of a demoness disappearing into it.  Gritting their teeth, they followed her into the darkness.\r
diff --git a/H2MP/Portals/hexen.rc b/H2MP/Portals/hexen.rc
new file mode 100644 (file)
index 0000000..370fd76
--- /dev/null
@@ -0,0 +1,21 @@
+\r
+developer 1\r
+\r
+// load the base configuration\r
+exec default.cfg\r
+\r
+// load the last saved configuration\r
+exec config.cfg\r
+\r
+// run a user script file if present\r
+exec autoexec.cfg\r
+\r
+//\r
+// stuff command line statements\r
+//\r
+stuffcmds\r
+\r
+// start demos if not allready running a server\r
+//startdemos demo1 demo2 demo3\r
+\r
+menu_main\r
diff --git a/H2MP/Portals/infolist.txt b/H2MP/Portals/infolist.txt
new file mode 100644 (file)
index 0000000..079df2c
--- /dev/null
@@ -0,0 +1,65 @@
+Find the Hall of the Dead\r
+Find the Chalice of St. Eric\r
+Get Mage's Key from the Tavern\r
+Go to the Duke's Keep\r
+Get Dragon's Tongue from Razumen's Lab in town\r
+Gain entrance to the Catacombs\r
+Find the Cross Key in the Warrior's Tomb\r
+Investigate the King's Tomb\r
+Find the spring that leads to the village well\r
+Take the Sphere of Order to the Thaumaturgical Conveyance\r
+Get the Sphere of Order from Eidolon's Throne Room\r
+Find Razumen's House.  He should be there\r
+Take the Mage's Key to Razumen's Lab\r
+Get the Scroll of Enchantment from Razumen's Castle Quarters\r
+Take the Scroll of Enchantment to the Ballista near the magic field\r
+Get the Duke's Seal by completing the potion\r
+Get the Duke's Seal by completing the potion in the next room\r
+Take the Duke's Seal to the locked cabinet\r
+Take Dragon's Tongue to Razumen's Castle Quarters\r
+Take the Chalice of St. Eric to the Altar of the Four Kings\r
+Take the Cross Key to the Cross Lock\r
+[------------------------]\r
+Use the Orb of Dakini at the temple to break the ice on the frozen lake\r
+Get the Ajanti Dagger from the meeting room in the Ice Caverns\r
+Take the Ajanti Dagger to the Gates of Tulku\r
+Get the Jade Buddha from the Ice Caverns\r
+Take the Jade Buddha to the offering place in the False Temple\r
+You need the Stone of Seldoot that is locked in the Storage Room\r
+Take the Stone of Seldoot to the Cauldron room\r
+You need to find Tien's key\r
+Tien's key has multiple uses\r
+Get the staff of Emperor Lo Pan from the offering room\r
+Take the staff of Emperor Lo Pan to the Arcane Sacrarium\r
+Get the sixth Prayer Wheel from the Symbolic Room of Kalachakra\r
+Take the sixth Prayer Wheel to the Way of the Wheels\r
+Get the Jewel of Buddha by stopping the Wheel of Time\r
+Offer the Jewel of Buddha to Shiva\r
+Get the Eyes of Buddha by following the unseen path\r
+Use the Eyes of Buddha to see the guardian of the portal\r
+Get the Sangha Gem from its resting place \r
+Bring the Sangha Gem to the guardian of the portal\r
+Offer the Sangha Gem to Shiva\r
+Get the Oil of Annointment from the Invocation Chambers\r
+Take the Oil of Annointment to the Pool of Cleansing\r
+Get the Incense of Enlightenment from Hidden Supplication Chamber\r
+Use the Incense of Enlightenment in the Invocation Chambers\r
+Enter the Pillar of Fire\r
+Ready your body for the journey through death and rebirth\r
+Offer the Dharma Jewel to Shiva\r
+To pass the Guardians in the Inner Chambers, you must use the Vajra Scepter and the Bell of Ghanta\r
+Gain entrance to the Inner Sanctum of Praevus\r
+Find a way to return to the Gates of Tulku\r
+The exit to the False Temple lies behind the Great Buddha\r
+Avoid unseen pitfalls as you make your way to the Main Temple\r
+Complete the three trials to continue on your journey towards Praevus\r
+To search the rest of the Palace, you must first acquire the Emperor's Key\r
+The Emperor's Key will let you pass the Portal of Nobility\r
+Find the Vajra Scepter in an earlier portion of the Palace\r
+The Bell of Ghanta is nearby...\r
+To start your journey towards Praevus, you must gain entrance to the False Temple\r
+60\r
+61\r
+62\r
+Kill and Maim\r
+\r
diff --git a/H2MP/code/ADIVTAB.H b/H2MP/code/ADIVTAB.H
new file mode 100644 (file)
index 0000000..819627d
--- /dev/null
@@ -0,0 +1,1058 @@
+// table of quotients and remainders for [-15...16] / [-15...16]\r
+\r
+// numerator = -15\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{1, -4},\r
+{1, -5},\r
+{1, -6},\r
+{1, -7},\r
+{2, -1},\r
+{2, -3},\r
+{3, 0},\r
+{3, -3},\r
+{5, 0},\r
+{7, -1},\r
+{15, 0},\r
+{0, 0},\r
+{-15, 0},\r
+{-8, 1},\r
+{-5, 0},\r
+{-4, 1},\r
+{-3, 0},\r
+{-3, 3},\r
+{-3, 6},\r
+{-2, 1},\r
+{-2, 3},\r
+{-2, 5},\r
+{-2, 7},\r
+{-2, 9},\r
+{-2, 11},\r
+{-2, 13},\r
+{-1, 0},\r
+{-1, 1},\r
+// numerator = -14\r
+{0, -14},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{1, -4},\r
+{1, -5},\r
+{1, -6},\r
+{2, 0},\r
+{2, -2},\r
+{2, -4},\r
+{3, -2},\r
+{4, -2},\r
+{7, 0},\r
+{14, 0},\r
+{0, 0},\r
+{-14, 0},\r
+{-7, 0},\r
+{-5, 1},\r
+{-4, 2},\r
+{-3, 1},\r
+{-3, 4},\r
+{-2, 0},\r
+{-2, 2},\r
+{-2, 4},\r
+{-2, 6},\r
+{-2, 8},\r
+{-2, 10},\r
+{-2, 12},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+// numerator = -13\r
+{0, -13},\r
+{0, -13},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{1, -4},\r
+{1, -5},\r
+{1, -6},\r
+{2, -1},\r
+{2, -3},\r
+{3, -1},\r
+{4, -1},\r
+{6, -1},\r
+{13, 0},\r
+{0, 0},\r
+{-13, 0},\r
+{-7, 1},\r
+{-5, 2},\r
+{-4, 3},\r
+{-3, 2},\r
+{-3, 5},\r
+{-2, 1},\r
+{-2, 3},\r
+{-2, 5},\r
+{-2, 7},\r
+{-2, 9},\r
+{-2, 11},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+// numerator = -12\r
+{0, -12},\r
+{0, -12},\r
+{0, -12},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{1, -4},\r
+{1, -5},\r
+{2, 0},\r
+{2, -2},\r
+{3, 0},\r
+{4, 0},\r
+{6, 0},\r
+{12, 0},\r
+{0, 0},\r
+{-12, 0},\r
+{-6, 0},\r
+{-4, 0},\r
+{-3, 0},\r
+{-3, 3},\r
+{-2, 0},\r
+{-2, 2},\r
+{-2, 4},\r
+{-2, 6},\r
+{-2, 8},\r
+{-2, 10},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+// numerator = -11\r
+{0, -11},\r
+{0, -11},\r
+{0, -11},\r
+{0, -11},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{1, -4},\r
+{1, -5},\r
+{2, -1},\r
+{2, -3},\r
+{3, -2},\r
+{5, -1},\r
+{11, 0},\r
+{0, 0},\r
+{-11, 0},\r
+{-6, 1},\r
+{-4, 1},\r
+{-3, 1},\r
+{-3, 4},\r
+{-2, 1},\r
+{-2, 3},\r
+{-2, 5},\r
+{-2, 7},\r
+{-2, 9},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+// numerator = -10\r
+{0, -10},\r
+{0, -10},\r
+{0, -10},\r
+{0, -10},\r
+{0, -10},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{1, -4},\r
+{2, 0},\r
+{2, -2},\r
+{3, -1},\r
+{5, 0},\r
+{10, 0},\r
+{0, 0},\r
+{-10, 0},\r
+{-5, 0},\r
+{-4, 2},\r
+{-3, 2},\r
+{-2, 0},\r
+{-2, 2},\r
+{-2, 4},\r
+{-2, 6},\r
+{-2, 8},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+// numerator = -9\r
+{0, -9},\r
+{0, -9},\r
+{0, -9},\r
+{0, -9},\r
+{0, -9},\r
+{0, -9},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{1, -4},\r
+{2, -1},\r
+{3, 0},\r
+{4, -1},\r
+{9, 0},\r
+{0, 0},\r
+{-9, 0},\r
+{-5, 1},\r
+{-3, 0},\r
+{-3, 3},\r
+{-2, 1},\r
+{-2, 3},\r
+{-2, 5},\r
+{-2, 7},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+// numerator = -8\r
+{0, -8},\r
+{0, -8},\r
+{0, -8},\r
+{0, -8},\r
+{0, -8},\r
+{0, -8},\r
+{0, -8},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{2, 0},\r
+{2, -2},\r
+{4, 0},\r
+{8, 0},\r
+{0, 0},\r
+{-8, 0},\r
+{-4, 0},\r
+{-3, 1},\r
+{-2, 0},\r
+{-2, 2},\r
+{-2, 4},\r
+{-2, 6},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+{-1, 8},\r
+// numerator = -7\r
+{0, -7},\r
+{0, -7},\r
+{0, -7},\r
+{0, -7},\r
+{0, -7},\r
+{0, -7},\r
+{0, -7},\r
+{0, -7},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{1, -3},\r
+{2, -1},\r
+{3, -1},\r
+{7, 0},\r
+{0, 0},\r
+{-7, 0},\r
+{-4, 1},\r
+{-3, 2},\r
+{-2, 1},\r
+{-2, 3},\r
+{-2, 5},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+{-1, 8},\r
+{-1, 9},\r
+// numerator = -6\r
+{0, -6},\r
+{0, -6},\r
+{0, -6},\r
+{0, -6},\r
+{0, -6},\r
+{0, -6},\r
+{0, -6},\r
+{0, -6},\r
+{0, -6},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{2, 0},\r
+{3, 0},\r
+{6, 0},\r
+{0, 0},\r
+{-6, 0},\r
+{-3, 0},\r
+{-2, 0},\r
+{-2, 2},\r
+{-2, 4},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+{-1, 8},\r
+{-1, 9},\r
+{-1, 10},\r
+// numerator = -5\r
+{0, -5},\r
+{0, -5},\r
+{0, -5},\r
+{0, -5},\r
+{0, -5},\r
+{0, -5},\r
+{0, -5},\r
+{0, -5},\r
+{0, -5},\r
+{0, -5},\r
+{1, 0},\r
+{1, -1},\r
+{1, -2},\r
+{2, -1},\r
+{5, 0},\r
+{0, 0},\r
+{-5, 0},\r
+{-3, 1},\r
+{-2, 1},\r
+{-2, 3},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+{-1, 8},\r
+{-1, 9},\r
+{-1, 10},\r
+{-1, 11},\r
+// numerator = -4\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{0, -4},\r
+{1, 0},\r
+{1, -1},\r
+{2, 0},\r
+{4, 0},\r
+{0, 0},\r
+{-4, 0},\r
+{-2, 0},\r
+{-2, 2},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+{-1, 8},\r
+{-1, 9},\r
+{-1, 10},\r
+{-1, 11},\r
+{-1, 12},\r
+// numerator = -3\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{0, -3},\r
+{1, 0},\r
+{1, -1},\r
+{3, 0},\r
+{0, 0},\r
+{-3, 0},\r
+{-2, 1},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+{-1, 8},\r
+{-1, 9},\r
+{-1, 10},\r
+{-1, 11},\r
+{-1, 12},\r
+{-1, 13},\r
+// numerator = -2\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{0, -2},\r
+{1, 0},\r
+{2, 0},\r
+{0, 0},\r
+{-2, 0},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+{-1, 8},\r
+{-1, 9},\r
+{-1, 10},\r
+{-1, 11},\r
+{-1, 12},\r
+{-1, 13},\r
+{-1, 14},\r
+// numerator = -1\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{0, -1},\r
+{1, 0},\r
+{0, 0},\r
+{-1, 0},\r
+{-1, 1},\r
+{-1, 2},\r
+{-1, 3},\r
+{-1, 4},\r
+{-1, 5},\r
+{-1, 6},\r
+{-1, 7},\r
+{-1, 8},\r
+{-1, 9},\r
+{-1, 10},\r
+{-1, 11},\r
+{-1, 12},\r
+{-1, 13},\r
+{-1, 14},\r
+{-1, 15},\r
+// numerator = 0\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+{0, 0},\r
+// numerator = 1\r
+{-1, -14},\r
+{-1, -13},\r
+{-1, -12},\r
+{-1, -11},\r
+{-1, -10},\r
+{-1, -9},\r
+{-1, -8},\r
+{-1, -7},\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{0, 0},\r
+{1, 0},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+{0, 1},\r
+// numerator = 2\r
+{-1, -13},\r
+{-1, -12},\r
+{-1, -11},\r
+{-1, -10},\r
+{-1, -9},\r
+{-1, -8},\r
+{-1, -7},\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, 0},\r
+{0, 0},\r
+{2, 0},\r
+{1, 0},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+{0, 2},\r
+// numerator = 3\r
+{-1, -12},\r
+{-1, -11},\r
+{-1, -10},\r
+{-1, -9},\r
+{-1, -8},\r
+{-1, -7},\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -1},\r
+{-3, 0},\r
+{0, 0},\r
+{3, 0},\r
+{1, 1},\r
+{1, 0},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+{0, 3},\r
+// numerator = 4\r
+{-1, -11},\r
+{-1, -10},\r
+{-1, -9},\r
+{-1, -8},\r
+{-1, -7},\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -2},\r
+{-2, 0},\r
+{-4, 0},\r
+{0, 0},\r
+{4, 0},\r
+{2, 0},\r
+{1, 1},\r
+{1, 0},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+{0, 4},\r
+// numerator = 5\r
+{-1, -10},\r
+{-1, -9},\r
+{-1, -8},\r
+{-1, -7},\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -3},\r
+{-2, -1},\r
+{-3, -1},\r
+{-5, 0},\r
+{0, 0},\r
+{5, 0},\r
+{2, 1},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+{0, 5},\r
+// numerator = 6\r
+{-1, -9},\r
+{-1, -8},\r
+{-1, -7},\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -4},\r
+{-2, -2},\r
+{-2, 0},\r
+{-3, 0},\r
+{-6, 0},\r
+{0, 0},\r
+{6, 0},\r
+{3, 0},\r
+{2, 0},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 6},\r
+{0, 6},\r
+{0, 6},\r
+{0, 6},\r
+{0, 6},\r
+{0, 6},\r
+{0, 6},\r
+{0, 6},\r
+{0, 6},\r
+{0, 6},\r
+// numerator = 7\r
+{-1, -8},\r
+{-1, -7},\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -5},\r
+{-2, -3},\r
+{-2, -1},\r
+{-3, -2},\r
+{-4, -1},\r
+{-7, 0},\r
+{0, 0},\r
+{7, 0},\r
+{3, 1},\r
+{2, 1},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 7},\r
+{0, 7},\r
+{0, 7},\r
+{0, 7},\r
+{0, 7},\r
+{0, 7},\r
+{0, 7},\r
+{0, 7},\r
+{0, 7},\r
+// numerator = 8\r
+{-1, -7},\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -6},\r
+{-2, -4},\r
+{-2, -2},\r
+{-2, 0},\r
+{-3, -1},\r
+{-4, 0},\r
+{-8, 0},\r
+{0, 0},\r
+{8, 0},\r
+{4, 0},\r
+{2, 2},\r
+{2, 0},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 8},\r
+{0, 8},\r
+{0, 8},\r
+{0, 8},\r
+{0, 8},\r
+{0, 8},\r
+{0, 8},\r
+{0, 8},\r
+// numerator = 9\r
+{-1, -6},\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -7},\r
+{-2, -5},\r
+{-2, -3},\r
+{-2, -1},\r
+{-3, -3},\r
+{-3, 0},\r
+{-5, -1},\r
+{-9, 0},\r
+{0, 0},\r
+{9, 0},\r
+{4, 1},\r
+{3, 0},\r
+{2, 1},\r
+{1, 4},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 9},\r
+{0, 9},\r
+{0, 9},\r
+{0, 9},\r
+{0, 9},\r
+{0, 9},\r
+{0, 9},\r
+// numerator = 10\r
+{-1, -5},\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -8},\r
+{-2, -6},\r
+{-2, -4},\r
+{-2, -2},\r
+{-2, 0},\r
+{-3, -2},\r
+{-4, -2},\r
+{-5, 0},\r
+{-10, 0},\r
+{0, 0},\r
+{10, 0},\r
+{5, 0},\r
+{3, 1},\r
+{2, 2},\r
+{2, 0},\r
+{1, 4},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 10},\r
+{0, 10},\r
+{0, 10},\r
+{0, 10},\r
+{0, 10},\r
+{0, 10},\r
+// numerator = 11\r
+{-1, -4},\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -9},\r
+{-2, -7},\r
+{-2, -5},\r
+{-2, -3},\r
+{-2, -1},\r
+{-3, -4},\r
+{-3, -1},\r
+{-4, -1},\r
+{-6, -1},\r
+{-11, 0},\r
+{0, 0},\r
+{11, 0},\r
+{5, 1},\r
+{3, 2},\r
+{2, 3},\r
+{2, 1},\r
+{1, 5},\r
+{1, 4},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 11},\r
+{0, 11},\r
+{0, 11},\r
+{0, 11},\r
+{0, 11},\r
+// numerator = 12\r
+{-1, -3},\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -10},\r
+{-2, -8},\r
+{-2, -6},\r
+{-2, -4},\r
+{-2, -2},\r
+{-2, 0},\r
+{-3, -3},\r
+{-3, 0},\r
+{-4, 0},\r
+{-6, 0},\r
+{-12, 0},\r
+{0, 0},\r
+{12, 0},\r
+{6, 0},\r
+{4, 0},\r
+{3, 0},\r
+{2, 2},\r
+{2, 0},\r
+{1, 5},\r
+{1, 4},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 12},\r
+{0, 12},\r
+{0, 12},\r
+{0, 12},\r
+// numerator = 13\r
+{-1, -2},\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -11},\r
+{-2, -9},\r
+{-2, -7},\r
+{-2, -5},\r
+{-2, -3},\r
+{-2, -1},\r
+{-3, -5},\r
+{-3, -2},\r
+{-4, -3},\r
+{-5, -2},\r
+{-7, -1},\r
+{-13, 0},\r
+{0, 0},\r
+{13, 0},\r
+{6, 1},\r
+{4, 1},\r
+{3, 1},\r
+{2, 3},\r
+{2, 1},\r
+{1, 6},\r
+{1, 5},\r
+{1, 4},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 13},\r
+{0, 13},\r
+{0, 13},\r
+// numerator = 14\r
+{-1, -1},\r
+{-1, 0},\r
+{-2, -12},\r
+{-2, -10},\r
+{-2, -8},\r
+{-2, -6},\r
+{-2, -4},\r
+{-2, -2},\r
+{-2, 0},\r
+{-3, -4},\r
+{-3, -1},\r
+{-4, -2},\r
+{-5, -1},\r
+{-7, 0},\r
+{-14, 0},\r
+{0, 0},\r
+{14, 0},\r
+{7, 0},\r
+{4, 2},\r
+{3, 2},\r
+{2, 4},\r
+{2, 2},\r
+{2, 0},\r
+{1, 6},\r
+{1, 5},\r
+{1, 4},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 14},\r
+{0, 14},\r
+// numerator = 15\r
+{-1, 0},\r
+{-2, -13},\r
+{-2, -11},\r
+{-2, -9},\r
+{-2, -7},\r
+{-2, -5},\r
+{-2, -3},\r
+{-2, -1},\r
+{-3, -6},\r
+{-3, -3},\r
+{-3, 0},\r
+{-4, -1},\r
+{-5, 0},\r
+{-8, -1},\r
+{-15, 0},\r
+{0, 0},\r
+{15, 0},\r
+{7, 1},\r
+{5, 0},\r
+{3, 3},\r
+{3, 0},\r
+{2, 3},\r
+{2, 1},\r
+{1, 7},\r
+{1, 6},\r
+{1, 5},\r
+{1, 4},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
+{0, 15},\r
+// numerator = 16\r
+{-2, -14},\r
+{-2, -12},\r
+{-2, -10},\r
+{-2, -8},\r
+{-2, -6},\r
+{-2, -4},\r
+{-2, -2},\r
+{-2, 0},\r
+{-3, -5},\r
+{-3, -2},\r
+{-4, -4},\r
+{-4, 0},\r
+{-6, -2},\r
+{-8, 0},\r
+{-16, 0},\r
+{0, 0},\r
+{16, 0},\r
+{8, 0},\r
+{5, 1},\r
+{4, 0},\r
+{3, 1},\r
+{2, 4},\r
+{2, 2},\r
+{2, 0},\r
+{1, 7},\r
+{1, 6},\r
+{1, 5},\r
+{1, 4},\r
+{1, 3},\r
+{1, 2},\r
+{1, 1},\r
+{1, 0},\r
diff --git a/H2MP/code/ANORMS.H b/H2MP/code/ANORMS.H
new file mode 100644 (file)
index 0000000..f6d982c
--- /dev/null
@@ -0,0 +1,162 @@
+{-0.525731, 0.000000, 0.850651}, \r
+{-0.442863, 0.238856, 0.864188}, \r
+{-0.295242, 0.000000, 0.955423}, \r
+{-0.309017, 0.500000, 0.809017}, \r
+{-0.162460, 0.262866, 0.951056}, \r
+{0.000000, 0.000000, 1.000000}, \r
+{0.000000, 0.850651, 0.525731}, \r
+{-0.147621, 0.716567, 0.681718}, \r
+{0.147621, 0.716567, 0.681718}, \r
+{0.000000, 0.525731, 0.850651}, \r
+{0.309017, 0.500000, 0.809017}, \r
+{0.525731, 0.000000, 0.850651}, \r
+{0.295242, 0.000000, 0.955423}, \r
+{0.442863, 0.238856, 0.864188}, \r
+{0.162460, 0.262866, 0.951056}, \r
+{-0.681718, 0.147621, 0.716567}, \r
+{-0.809017, 0.309017, 0.500000}, \r
+{-0.587785, 0.425325, 0.688191}, \r
+{-0.850651, 0.525731, 0.000000}, \r
+{-0.864188, 0.442863, 0.238856}, \r
+{-0.716567, 0.681718, 0.147621}, \r
+{-0.688191, 0.587785, 0.425325}, \r
+{-0.500000, 0.809017, 0.309017}, \r
+{-0.238856, 0.864188, 0.442863}, \r
+{-0.425325, 0.688191, 0.587785}, \r
+{-0.716567, 0.681718, -0.147621}, \r
+{-0.500000, 0.809017, -0.309017}, \r
+{-0.525731, 0.850651, 0.000000}, \r
+{0.000000, 0.850651, -0.525731}, \r
+{-0.238856, 0.864188, -0.442863}, \r
+{0.000000, 0.955423, -0.295242}, \r
+{-0.262866, 0.951056, -0.162460}, \r
+{0.000000, 1.000000, 0.000000}, \r
+{0.000000, 0.955423, 0.295242}, \r
+{-0.262866, 0.951056, 0.162460}, \r
+{0.238856, 0.864188, 0.442863}, \r
+{0.262866, 0.951056, 0.162460}, \r
+{0.500000, 0.809017, 0.309017}, \r
+{0.238856, 0.864188, -0.442863}, \r
+{0.262866, 0.951056, -0.162460}, \r
+{0.500000, 0.809017, -0.309017}, \r
+{0.850651, 0.525731, 0.000000}, \r
+{0.716567, 0.681718, 0.147621}, \r
+{0.716567, 0.681718, -0.147621}, \r
+{0.525731, 0.850651, 0.000000}, \r
+{0.425325, 0.688191, 0.587785}, \r
+{0.864188, 0.442863, 0.238856}, \r
+{0.688191, 0.587785, 0.425325}, \r
+{0.809017, 0.309017, 0.500000}, \r
+{0.681718, 0.147621, 0.716567}, \r
+{0.587785, 0.425325, 0.688191}, \r
+{0.955423, 0.295242, 0.000000}, \r
+{1.000000, 0.000000, 0.000000}, \r
+{0.951056, 0.162460, 0.262866}, \r
+{0.850651, -0.525731, 0.000000}, \r
+{0.955423, -0.295242, 0.000000}, \r
+{0.864188, -0.442863, 0.238856}, \r
+{0.951056, -0.162460, 0.262866}, \r
+{0.809017, -0.309017, 0.500000}, \r
+{0.681718, -0.147621, 0.716567}, \r
+{0.850651, 0.000000, 0.525731}, \r
+{0.864188, 0.442863, -0.238856}, \r
+{0.809017, 0.309017, -0.500000}, \r
+{0.951056, 0.162460, -0.262866}, \r
+{0.525731, 0.000000, -0.850651}, \r
+{0.681718, 0.147621, -0.716567}, \r
+{0.681718, -0.147621, -0.716567}, \r
+{0.850651, 0.000000, -0.525731}, \r
+{0.809017, -0.309017, -0.500000}, \r
+{0.864188, -0.442863, -0.238856}, \r
+{0.951056, -0.162460, -0.262866}, \r
+{0.147621, 0.716567, -0.681718}, \r
+{0.309017, 0.500000, -0.809017}, \r
+{0.425325, 0.688191, -0.587785}, \r
+{0.442863, 0.238856, -0.864188}, \r
+{0.587785, 0.425325, -0.688191}, \r
+{0.688191, 0.587785, -0.425325}, \r
+{-0.147621, 0.716567, -0.681718}, \r
+{-0.309017, 0.500000, -0.809017}, \r
+{0.000000, 0.525731, -0.850651}, \r
+{-0.525731, 0.000000, -0.850651}, \r
+{-0.442863, 0.238856, -0.864188}, \r
+{-0.295242, 0.000000, -0.955423}, \r
+{-0.162460, 0.262866, -0.951056}, \r
+{0.000000, 0.000000, -1.000000}, \r
+{0.295242, 0.000000, -0.955423}, \r
+{0.162460, 0.262866, -0.951056}, \r
+{-0.442863, -0.238856, -0.864188}, \r
+{-0.309017, -0.500000, -0.809017}, \r
+{-0.162460, -0.262866, -0.951056}, \r
+{0.000000, -0.850651, -0.525731}, \r
+{-0.147621, -0.716567, -0.681718}, \r
+{0.147621, -0.716567, -0.681718}, \r
+{0.000000, -0.525731, -0.850651}, \r
+{0.309017, -0.500000, -0.809017}, \r
+{0.442863, -0.238856, -0.864188}, \r
+{0.162460, -0.262866, -0.951056}, \r
+{0.238856, -0.864188, -0.442863}, \r
+{0.500000, -0.809017, -0.309017}, \r
+{0.425325, -0.688191, -0.587785}, \r
+{0.716567, -0.681718, -0.147621}, \r
+{0.688191, -0.587785, -0.425325}, \r
+{0.587785, -0.425325, -0.688191}, \r
+{0.000000, -0.955423, -0.295242}, \r
+{0.000000, -1.000000, 0.000000}, \r
+{0.262866, -0.951056, -0.162460}, \r
+{0.000000, -0.850651, 0.525731}, \r
+{0.000000, -0.955423, 0.295242}, \r
+{0.238856, -0.864188, 0.442863}, \r
+{0.262866, -0.951056, 0.162460}, \r
+{0.500000, -0.809017, 0.309017}, \r
+{0.716567, -0.681718, 0.147621}, \r
+{0.525731, -0.850651, 0.000000}, \r
+{-0.238856, -0.864188, -0.442863}, \r
+{-0.500000, -0.809017, -0.309017}, \r
+{-0.262866, -0.951056, -0.162460}, \r
+{-0.850651, -0.525731, 0.000000}, \r
+{-0.716567, -0.681718, -0.147621}, \r
+{-0.716567, -0.681718, 0.147621}, \r
+{-0.525731, -0.850651, 0.000000}, \r
+{-0.500000, -0.809017, 0.309017}, \r
+{-0.238856, -0.864188, 0.442863}, \r
+{-0.262866, -0.951056, 0.162460}, \r
+{-0.864188, -0.442863, 0.238856}, \r
+{-0.809017, -0.309017, 0.500000}, \r
+{-0.688191, -0.587785, 0.425325}, \r
+{-0.681718, -0.147621, 0.716567}, \r
+{-0.442863, -0.238856, 0.864188}, \r
+{-0.587785, -0.425325, 0.688191}, \r
+{-0.309017, -0.500000, 0.809017}, \r
+{-0.147621, -0.716567, 0.681718}, \r
+{-0.425325, -0.688191, 0.587785}, \r
+{-0.162460, -0.262866, 0.951056}, \r
+{0.442863, -0.238856, 0.864188}, \r
+{0.162460, -0.262866, 0.951056}, \r
+{0.309017, -0.500000, 0.809017}, \r
+{0.147621, -0.716567, 0.681718}, \r
+{0.000000, -0.525731, 0.850651}, \r
+{0.425325, -0.688191, 0.587785}, \r
+{0.587785, -0.425325, 0.688191}, \r
+{0.688191, -0.587785, 0.425325}, \r
+{-0.955423, 0.295242, 0.000000}, \r
+{-0.951056, 0.162460, 0.262866}, \r
+{-1.000000, 0.000000, 0.000000}, \r
+{-0.850651, 0.000000, 0.525731}, \r
+{-0.955423, -0.295242, 0.000000}, \r
+{-0.951056, -0.162460, 0.262866}, \r
+{-0.864188, 0.442863, -0.238856}, \r
+{-0.951056, 0.162460, -0.262866}, \r
+{-0.809017, 0.309017, -0.500000}, \r
+{-0.864188, -0.442863, -0.238856}, \r
+{-0.951056, -0.162460, -0.262866}, \r
+{-0.809017, -0.309017, -0.500000}, \r
+{-0.681718, 0.147621, -0.716567}, \r
+{-0.681718, -0.147621, -0.716567}, \r
+{-0.850651, 0.000000, -0.525731}, \r
+{-0.688191, 0.587785, -0.425325}, \r
+{-0.587785, 0.425325, -0.688191}, \r
+{-0.425325, 0.688191, -0.587785}, \r
+{-0.425325, -0.688191, -0.587785}, \r
+{-0.587785, -0.425325, -0.688191}, \r
+{-0.688191, -0.587785, -0.425325}, \r
diff --git a/H2MP/code/BSPFILE.H b/H2MP/code/BSPFILE.H
new file mode 100644 (file)
index 0000000..6fa4929
--- /dev/null
@@ -0,0 +1,322 @@
+/*\r
+ * $Header: /H3/game/BSPFILE.H 4     2/19/97 11:17a Rjohnson $\r
+ */\r
+\r
+\r
+// upper design bounds\r
+\r
+#define        MAX_MAP_HULLS           8\r
+\r
+#define        MAX_MAP_MODELS          256\r
+#define        MAX_MAP_BRUSHES         4096\r
+#define        MAX_MAP_ENTITIES        1024\r
+#define        MAX_MAP_ENTSTRING       65536\r
+\r
+// Before Id 1.07 update\r
+// #define     MAX_MAP_PLANES          8192\r
+#define        MAX_MAP_PLANES          32767\r
+#define        MAX_MAP_NODES           32767           // because negative shorts are contents\r
+#define        MAX_MAP_CLIPNODES       32767           //\r
+// Before Id 1.07 update\r
+// #define     MAX_MAP_LEAFS           32767           // \r
+#define        MAX_MAP_LEAFS           8192\r
+#define        MAX_MAP_VERTS           65535\r
+#define        MAX_MAP_FACES           65535\r
+#define        MAX_MAP_MARKSURFACES 65535\r
+#define        MAX_MAP_TEXINFO         4096\r
+#define        MAX_MAP_EDGES           256000\r
+#define        MAX_MAP_SURFEDGES       512000\r
+#define        MAX_MAP_TEXTURES        512\r
+#define        MAX_MAP_MIPTEX          0x200000\r
+#define        MAX_MAP_LIGHTING        0x100000\r
+#define        MAX_MAP_VISIBILITY      0x100000\r
+\r
+#define        MAX_MAP_PORTALS         65536\r
+\r
+// key / value pair sizes\r
+\r
+#define        MAX_KEY         32\r
+#define        MAX_VALUE       1024\r
+\r
+//=============================================================================\r
+\r
+\r
+#define BSPVERSION     29\r
+#define        TOOLVERSION     2\r
+\r
+typedef struct\r
+{\r
+       int             fileofs, filelen;\r
+} lump_t;\r
+\r
+#define        LUMP_ENTITIES   0\r
+#define        LUMP_PLANES             1\r
+#define        LUMP_TEXTURES   2\r
+#define        LUMP_VERTEXES   3\r
+#define        LUMP_VISIBILITY 4\r
+#define        LUMP_NODES              5\r
+#define        LUMP_TEXINFO    6\r
+#define        LUMP_FACES              7\r
+#define        LUMP_LIGHTING   8\r
+#define        LUMP_CLIPNODES  9\r
+#define        LUMP_LEAFS              10\r
+#define        LUMP_MARKSURFACES 11\r
+#define        LUMP_EDGES              12\r
+#define        LUMP_SURFEDGES  13\r
+#define        LUMP_MODELS             14\r
+\r
+#define        HEADER_LUMPS    15\r
+\r
+typedef struct\r
+{\r
+       float           mins[3], maxs[3];\r
+       float           origin[3];\r
+       int                     headnode[MAX_MAP_HULLS];\r
+       int                     visleafs;               // not including the solid leaf 0\r
+       int                     firstface, numfaces;\r
+} dmodel_t;\r
+\r
+typedef struct\r
+{\r
+       int                     version;        \r
+       lump_t          lumps[HEADER_LUMPS];\r
+} dheader_t;\r
+\r
+typedef struct\r
+{\r
+       int                     nummiptex;\r
+       int                     dataofs[4];             // [nummiptex]\r
+} dmiptexlump_t;\r
+\r
+#define        MIPLEVELS       4\r
+typedef struct miptex_s\r
+{\r
+       char            name[16];\r
+       unsigned        width, height;\r
+       unsigned        offsets[MIPLEVELS];             // four mip maps stored\r
+} miptex_t;\r
+\r
+\r
+typedef struct\r
+{\r
+       float   point[3];\r
+} dvertex_t;\r
+\r
+\r
+// 0-2 are axial planes\r
+#define        PLANE_X                 0\r
+#define        PLANE_Y                 1\r
+#define        PLANE_Z                 2\r
+\r
+// 3-5 are non-axial planes snapped to the nearest\r
+#define        PLANE_ANYX              3\r
+#define        PLANE_ANYY              4\r
+#define        PLANE_ANYZ              5\r
+\r
+typedef struct\r
+{\r
+       float   normal[3];\r
+       float   dist;\r
+       int             type;           // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate\r
+} dplane_t;\r
+\r
+\r
+\r
+#define        CONTENTS_EMPTY          -1\r
+#define        CONTENTS_SOLID          -2\r
+#define        CONTENTS_WATER          -3\r
+#define        CONTENTS_SLIME          -4\r
+#define        CONTENTS_LAVA           -5\r
+#define        CONTENTS_SKY            -6\r
+#define        CONTENTS_ORIGIN         -7              // removed at csg time\r
+#define        CONTENTS_CLIP           -8              // changed to contents_solid\r
+\r
+#define        CONTENTS_CURRENT_0              -9\r
+#define        CONTENTS_CURRENT_90             -10\r
+#define        CONTENTS_CURRENT_180    -11\r
+#define        CONTENTS_CURRENT_270    -12\r
+#define        CONTENTS_CURRENT_UP             -13\r
+#define        CONTENTS_CURRENT_DOWN   -14\r
+\r
+\r
+// !!! if this is changed, it must be changed in asm_i386.h too !!!\r
+typedef struct\r
+{\r
+       int                     planenum;\r
+       short           children[2];    // negative numbers are -(leafs+1), not nodes\r
+       short           mins[3];                // for sphere culling\r
+       short           maxs[3];\r
+       unsigned short  firstface;\r
+       unsigned short  numfaces;       // counting both sides\r
+} dnode_t;\r
+\r
+typedef struct\r
+{\r
+       int                     planenum;\r
+       short           children[2];    // negative numbers are contents\r
+} dclipnode_t;\r
+\r
+\r
+typedef struct texinfo_s\r
+{\r
+       float           vecs[2][4];             // [s/t][xyz offset]\r
+       int                     miptex;\r
+       int                     flags;\r
+} texinfo_t;\r
+#define        TEX_SPECIAL             1               // sky or slime, no lightmap or 256 subdivision\r
+\r
+// note that edge 0 is never used, because negative edge nums are used for\r
+// counterclockwise use of the edge in a face\r
+typedef struct\r
+{\r
+       unsigned short  v[2];           // vertex numbers\r
+} dedge_t;\r
+\r
+#define        MAXLIGHTMAPS    4\r
+typedef struct\r
+{\r
+       short           planenum;\r
+       short           side;\r
+\r
+       int                     firstedge;              // we must support > 64k edges\r
+       short           numedges;       \r
+       short           texinfo;\r
+\r
+// lighting info\r
+       byte            styles[MAXLIGHTMAPS];\r
+       int                     lightofs;               // start of [numstyles*surfsize] samples\r
+} dface_t;\r
+\r
+\r
+\r
+#define        AMBIENT_WATER   0\r
+#define        AMBIENT_SKY             1\r
+#define        AMBIENT_SLIME   2\r
+#define        AMBIENT_LAVA    3\r
+\r
+#define        NUM_AMBIENTS                    4               // automatic ambient sounds\r
+\r
+// leaf 0 is the generic CONTENTS_SOLID leaf, used for all solid areas\r
+// all other leafs need visibility info\r
+typedef struct\r
+{\r
+       int                     contents;\r
+       int                     visofs;                         // -1 = no visibility info\r
+\r
+       short           mins[3];                        // for frustum culling\r
+       short           maxs[3];\r
+\r
+       unsigned short          firstmarksurface;\r
+       unsigned short          nummarksurfaces;\r
+\r
+       byte            ambient_level[NUM_AMBIENTS];\r
+} dleaf_t;\r
+\r
+\r
+//============================================================================\r
+\r
+#ifndef QUAKE_GAME\r
+\r
+#define        ANGLE_UP        -1\r
+#define        ANGLE_DOWN      -2\r
+\r
+\r
+// the utilities get to be lazy and just use large static arrays\r
+\r
+extern int                     nummodels;\r
+extern dmodel_t        dmodels[MAX_MAP_MODELS];\r
+\r
+extern int                     visdatasize;\r
+extern byte            dvisdata[MAX_MAP_VISIBILITY];\r
+\r
+extern int                     lightdatasize;\r
+extern byte            dlightdata[MAX_MAP_LIGHTING];\r
+\r
+extern int                     texdatasize;\r
+extern byte            dtexdata[MAX_MAP_MIPTEX]; // (dmiptexlump_t)\r
+\r
+extern int                     entdatasize;\r
+extern char            dentdata[MAX_MAP_ENTSTRING];\r
+\r
+extern int                     numleafs;\r
+extern dleaf_t         dleafs[MAX_MAP_LEAFS];\r
+\r
+extern int                     numplanes;\r
+extern dplane_t        dplanes[MAX_MAP_PLANES];\r
+\r
+extern int                     numvertexes;\r
+extern dvertex_t       dvertexes[MAX_MAP_VERTS];\r
+\r
+extern int                     numnodes;\r
+extern dnode_t         dnodes[MAX_MAP_NODES];\r
+\r
+extern int                     numtexinfo;\r
+extern texinfo_t       texinfo[MAX_MAP_TEXINFO];\r
+\r
+extern int                     numfaces;\r
+extern dface_t         dfaces[MAX_MAP_FACES];\r
+\r
+extern int                     numclipnodes;\r
+extern dclipnode_t     dclipnodes[MAX_MAP_CLIPNODES];\r
+\r
+extern int                     numedges;\r
+extern dedge_t         dedges[MAX_MAP_EDGES];\r
+\r
+extern int                     nummarksurfaces;\r
+extern unsigned short  dmarksurfaces[MAX_MAP_MARKSURFACES];\r
+\r
+extern int                     numsurfedges;\r
+extern int                     dsurfedges[MAX_MAP_SURFEDGES];\r
+\r
+\r
+void DecompressVis (byte *in, byte *decompressed);\r
+int CompressVis (byte *vis, byte *dest);\r
+\r
+void   LoadBSPFile (char *filename);\r
+void   WriteBSPFile (char *filename);\r
+void   PrintBSPFileSizes (void);\r
+\r
+//===============\r
+\r
+\r
+typedef struct epair_s\r
+{\r
+       struct epair_s  *next;\r
+       char    *key;\r
+       char    *value;\r
+} epair_t;\r
+\r
+typedef struct\r
+{\r
+       vec3_t          origin;\r
+       int                     firstbrush;\r
+       int                     numbrushes;\r
+       epair_t         *epairs;\r
+} entity_t;\r
+\r
+extern int                     num_entities;\r
+extern entity_t        entities[MAX_MAP_ENTITIES];\r
+\r
+void   ParseEntities (void);\r
+void   UnparseEntities (void);\r
+\r
+void   SetKeyValue (entity_t *ent, char *key, char *value);\r
+char   *ValueForKey (entity_t *ent, char *key);\r
+// will return "" if not present\r
+\r
+vec_t  FloatForKey (entity_t *ent, char *key);\r
+void   GetVectorForKey (entity_t *ent, char *key, vec3_t vec);\r
+\r
+epair_t *ParseEpair (void);\r
+\r
+#endif\r
+\r
+/*\r
+ * $Log: /H3/game/BSPFILE.H $\r
+ * \r
+ * 4     2/19/97 11:17a Rjohnson\r
+ * Id Updates\r
+ * \r
+ * 3     2/10/97 2:59p Rjohnson\r
+ * Changed max_map_hulls to 8 and added a 5th hull\r
+ */\r
diff --git a/H2MP/code/CDAUDIO.H b/H2MP/code/CDAUDIO.H
new file mode 100644 (file)
index 0000000..84e7ed2
--- /dev/null
@@ -0,0 +1,8 @@
+\r
+int CDAudio_Init(void);\r
+void CDAudio_Play(byte track, qboolean looping);\r
+void CDAudio_Stop(void);\r
+void CDAudio_Pause(void);\r
+void CDAudio_Resume(void);\r
+void CDAudio_Shutdown(void);\r
+void CDAudio_Update(void);\r
diff --git a/H2MP/code/CD_WIN.C b/H2MP/code/CD_WIN.C
new file mode 100644 (file)
index 0000000..4df9d6d
--- /dev/null
@@ -0,0 +1,505 @@
+// Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All\r
+// rights reserved.\r
+\r
+#include <windows.h>\r
+#include "quakedef.h"\r
+\r
+extern HWND    mainwindow;\r
+extern cvar_t  bgmvolume;\r
+\r
+static qboolean cdValid = false;\r
+static qboolean        playing = false;\r
+static qboolean        wasPlaying = false;\r
+static qboolean        initialized = false;\r
+static qboolean        enabled = false;\r
+static qboolean playLooping = false;\r
+static float   cdvolume;\r
+static byte    remap[100];\r
+static byte            cdrom;\r
+static byte            playTrack;\r
+static byte            maxTrack;\r
+\r
+static UINT CD_ID;\r
+static unsigned long CD_OrigVolume;\r
+\r
+UINT   wDeviceID;\r
+\r
+void CD_SetVolume(unsigned long Volume);\r
+\r
+\r
+static void CDAudio_Eject(void)\r
+{\r
+       DWORD   dwReturn;\r
+\r
+    if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD)NULL))\r
+               Con_DPrintf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);\r
+}\r
+\r
+\r
+static void CDAudio_CloseDoor(void)\r
+{\r
+       DWORD   dwReturn;\r
+\r
+    if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD)NULL))\r
+               Con_DPrintf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);\r
+}\r
+\r
+\r
+static int CDAudio_GetAudioDiskInfo(void)\r
+{\r
+       DWORD                           dwReturn;\r
+       MCI_STATUS_PARMS        mciStatusParms;\r
+\r
+\r
+       cdValid = false;\r
+\r
+       mciStatusParms.dwItem = MCI_STATUS_READY;\r
+    dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);\r
+       if (dwReturn)\r
+       {\r
+               Con_DPrintf("CDAudio: drive ready test - get status failed\n");\r
+               return -1;\r
+       }\r
+       if (!mciStatusParms.dwReturn)\r
+       {\r
+               Con_DPrintf("CDAudio: drive not ready\n");\r
+               return -1;\r
+       }\r
+\r
+       mciStatusParms.dwItem = MCI_STATUS_NUMBER_OF_TRACKS;\r
+    dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);\r
+       if (dwReturn)\r
+       {\r
+               Con_DPrintf("CDAudio: get tracks - status failed\n");\r
+               return -1;\r
+       }\r
+       if (mciStatusParms.dwReturn < 1)\r
+       {\r
+               Con_DPrintf("CDAudio: no music tracks\n");\r
+               return -1;\r
+       }\r
+\r
+       cdValid = true;\r
+       maxTrack = mciStatusParms.dwReturn;\r
+\r
+       return 0;\r
+}\r
+\r
+\r
+void CDAudio_Play(byte track, qboolean looping)\r
+{\r
+       DWORD                           dwReturn;\r
+    MCI_PLAY_PARMS             mciPlayParms;\r
+       MCI_STATUS_PARMS        mciStatusParms;\r
+\r
+       if (!enabled)\r
+               return;\r
+       \r
+       if (!cdValid)\r
+       {\r
+               CDAudio_GetAudioDiskInfo();\r
+               if (!cdValid)\r
+                       return;\r
+       }\r
+\r
+       track = remap[track];\r
+\r
+       if (track < 1 || track > maxTrack)\r
+       {\r
+               Con_DPrintf("CDAudio: Bad track number %u.\n", track);\r
+               return;\r
+       }\r
+\r
+       // don't try to play a non-audio track\r
+       mciStatusParms.dwItem = MCI_CDA_STATUS_TYPE_TRACK;\r
+       mciStatusParms.dwTrack = track;\r
+    dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);\r
+       if (dwReturn)\r
+       {\r
+               Con_DPrintf("MCI_STATUS failed (%i)\n", dwReturn);\r
+               return;\r
+       }\r
+       if (mciStatusParms.dwReturn != MCI_CDA_TRACK_AUDIO)\r
+       {\r
+               Con_Printf("CDAudio: track %i is not audio\n", track);\r
+               return;\r
+       }\r
+\r
+       // get the length of the track to be played\r
+       mciStatusParms.dwItem = MCI_STATUS_LENGTH;\r
+       mciStatusParms.dwTrack = track;\r
+    dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);\r
+       if (dwReturn)\r
+       {\r
+               Con_DPrintf("MCI_STATUS failed (%i)\n", dwReturn);\r
+               return;\r
+       }\r
+\r
+       if (playing)\r
+       {\r
+               if (playTrack == track)\r
+                       return;\r
+               CDAudio_Stop();\r
+       }\r
+\r
+    mciPlayParms.dwFrom = MCI_MAKE_TMSF(track, 0, 0, 0);\r
+       mciPlayParms.dwTo = (mciStatusParms.dwReturn << 8) | track;\r
+    mciPlayParms.dwCallback = (DWORD)mainwindow;\r
+    dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD)(LPVOID) &mciPlayParms);\r
+       if (dwReturn)\r
+       {\r
+               Con_DPrintf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);\r
+               return;\r
+       }\r
+\r
+       playLooping = looping;\r
+       playTrack = track;\r
+       playing = true;\r
+\r
+       if (cdvolume == 0.0)\r
+               CDAudio_Pause ();\r
+}\r
+\r
+\r
+void CDAudio_Stop(void)\r
+{\r
+       DWORD   dwReturn;\r
+\r
+       if (!enabled)\r
+               return;\r
+       \r
+       if (!playing)\r
+               return;\r
+\r
+    if (dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD)NULL))\r
+               Con_DPrintf("MCI_STOP failed (%i)", dwReturn);\r
+\r
+       wasPlaying = false;\r
+       playing = false;\r
+}\r
+\r
+\r
+void CDAudio_Pause(void)\r
+{\r
+       DWORD                           dwReturn;\r
+       MCI_GENERIC_PARMS       mciGenericParms;\r
+\r
+       if (!enabled)\r
+               return;\r
+\r
+       if (!playing)\r
+               return;\r
+\r
+       mciGenericParms.dwCallback = (DWORD)mainwindow;\r
+    if (dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD)(LPVOID) &mciGenericParms))\r
+               Con_DPrintf("MCI_PAUSE failed (%i)", dwReturn);\r
+\r
+       wasPlaying = playing;\r
+       playing = false;\r
+}\r
+\r
+\r
+void CDAudio_Resume(void)\r
+{\r
+       DWORD                   dwReturn;\r
+    MCI_PLAY_PARMS     mciPlayParms;\r
+\r
+       if (!enabled)\r
+               return;\r
+       \r
+       if (!cdValid)\r
+               return;\r
+\r
+       if (!wasPlaying)\r
+               return;\r
+       \r
+    mciPlayParms.dwFrom = MCI_MAKE_TMSF(playTrack, 0, 0, 0);\r
+    mciPlayParms.dwTo = MCI_MAKE_TMSF(playTrack + 1, 0, 0, 0);\r
+    mciPlayParms.dwCallback = (DWORD)mainwindow;\r
+    dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (DWORD)(LPVOID) &mciPlayParms);\r
+       if (dwReturn)\r
+       {\r
+               Con_DPrintf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);\r
+               return;\r
+       }\r
+       playing = true;\r
+}\r
+\r
+\r
+static void CD_f (void)\r
+{\r
+       char    *command;\r
+       int             ret;\r
+       int             n;\r
+       int             startAddress;\r
+\r
+       if (Cmd_Argc() < 2)\r
+       {\r
+               Con_Printf("commands:");\r
+               Con_Printf("on, off, reset, remap, \n");\r
+               Con_Printf("play, stop, loop, pause, resume\n");\r
+               Con_Printf("eject, close, info\n");\r
+               return;\r
+       }\r
+\r
+       command = Cmd_Argv (1);\r
+\r
+       if (Q_strcasecmp(command, "on") == 0)\r
+       {\r
+               enabled = true;\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "off") == 0)\r
+       {\r
+               if (playing)\r
+                       CDAudio_Stop();\r
+               enabled = false;\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "reset") == 0)\r
+       {\r
+               enabled = true;\r
+               if (playing)\r
+                       CDAudio_Stop();\r
+               for (n = 0; n < 100; n++)\r
+                       remap[n] = n;\r
+               CDAudio_GetAudioDiskInfo();\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "remap") == 0)\r
+       {\r
+               ret = Cmd_Argc() - 2;\r
+               if (ret <= 0)\r
+               {\r
+                       for (n = 1; n < 100; n++)\r
+                               if (remap[n] != n)\r
+                                       Con_Printf("  %u -> %u\n", n, remap[n]);\r
+                       return;\r
+               }\r
+               for (n = 1; n <= ret; n++)\r
+                       remap[n] = atoi(Cmd_Argv (n+1));\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "close") == 0)\r
+       {\r
+               CDAudio_CloseDoor();\r
+               return;\r
+       }\r
+\r
+       if (!cdValid)\r
+       {\r
+               CDAudio_GetAudioDiskInfo();\r
+               if (!cdValid)\r
+               {\r
+                       Con_Printf("No CD in player.\n");\r
+                       return;\r
+               }\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "play") == 0)\r
+       {\r
+               CDAudio_Play((byte)atoi(Cmd_Argv (2)), false);\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "loop") == 0)\r
+       {\r
+               CDAudio_Play((byte)atoi(Cmd_Argv (2)), true);\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "stop") == 0)\r
+       {\r
+               CDAudio_Stop();\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "pause") == 0)\r
+       {\r
+               CDAudio_Pause();\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "resume") == 0)\r
+       {\r
+               CDAudio_Resume();\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "eject") == 0)\r
+       {\r
+               if (playing)\r
+                       CDAudio_Stop();\r
+               CDAudio_Eject();\r
+               cdValid = false;\r
+               return;\r
+       }\r
+\r
+       if (Q_strcasecmp(command, "info") == 0)\r
+       {\r
+               Con_Printf("%u tracks\n", maxTrack);\r
+               if (playing)\r
+                       Con_Printf("Currently %s track %u\n", playLooping ? "looping" : "playing", playTrack);\r
+               else if (wasPlaying)\r
+                       Con_Printf("Paused %s track %u\n", playLooping ? "looping" : "playing", playTrack);\r
+               Con_Printf("Volume is %f\n", cdvolume);\r
+               return;\r
+       }\r
+}\r
+\r
+\r
+LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
+{\r
+       if (lParam != wDeviceID)\r
+               return 1;\r
+\r
+       switch (wParam)\r
+       {\r
+               case MCI_NOTIFY_SUCCESSFUL:\r
+                       if (playing)\r
+                       {\r
+                               playing = false;\r
+                               if (playLooping)\r
+                                       CDAudio_Play(playTrack, true);\r
+                       }\r
+                       break;\r
+\r
+               case MCI_NOTIFY_ABORTED:\r
+               case MCI_NOTIFY_SUPERSEDED:\r
+                       break;\r
+\r
+               case MCI_NOTIFY_FAILURE:\r
+                       Con_DPrintf("MCI_NOTIFY_FAILURE\n");\r
+                       CDAudio_Stop ();\r
+                       cdValid = false;\r
+                       break;\r
+\r
+               default:\r
+                       Con_DPrintf("Unexpected MM_MCINOTIFY type (%i)\n", wParam);\r
+                       return 1;\r
+       }\r
+\r
+       return 0;\r
+}\r
+\r
+\r
+void CDAudio_Update(void)\r
+{\r
+       if (!enabled)\r
+               return;\r
+\r
+       if (bgmvolume.value != cdvolume)\r
+               CD_SetVolume(bgmvolume.value * 0xffff);\r
+\r
+       if ((!bgmvolume.value && cdvolume) ||\r
+               (bgmvolume.value && !cdvolume))\r
+       {\r
+               if (cdvolume)\r
+               {\r
+//                     Cvar_SetValue ("bgmvolume", 0.0);\r
+                       CDAudio_Pause ();\r
+               }\r
+               else\r
+               {\r
+//                     Cvar_SetValue ("bgmvolume", 1.0);\r
+                       CDAudio_Resume ();\r
+               }\r
+       }\r
+       cdvolume = bgmvolume.value;\r
+}\r
+\r
+\r
+void CD_FindCDAux(void)\r
+{\r
+       UINT NumDevs,counter;\r
+       MMRESULT Result;\r
+       AUXCAPS Caps;\r
+\r
+       CD_ID = -1;\r
+       if (!COM_CheckParm("-usecdvolume"))\r
+               return;\r
+       NumDevs = auxGetNumDevs();\r
+       for(counter=0;counter<NumDevs;counter++)\r
+       {\r
+               Result = auxGetDevCaps(counter,&Caps,sizeof(Caps));\r
+               if (!Result) // valid\r
+               {\r
+                       if (Caps.wTechnology == AUXCAPS_CDAUDIO)\r
+                       {\r
+                               CD_ID = counter;\r
+                               auxGetVolume(CD_ID,&CD_OrigVolume);\r
+                               return;\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
+void CD_SetVolume(unsigned long Volume)\r
+{\r
+       if (CD_ID != -1) \r
+               auxSetVolume(CD_ID,(Volume<<16)+Volume);\r
+}\r
+\r
+int CDAudio_Init(void)\r
+{\r
+       DWORD   dwReturn;\r
+       MCI_OPEN_PARMS  mciOpenParms;\r
+    MCI_SET_PARMS      mciSetParms;\r
+       int                             n;\r
+\r
+       if (cls.state == ca_dedicated)\r
+               return -1;\r
+\r
+       if (COM_CheckParm("-nocdaudio"))\r
+               return -1;\r
+\r
+       mciOpenParms.lpstrDeviceType = "cdaudio";\r
+       if (dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD) (LPVOID) &mciOpenParms))\r
+       {\r
+               Con_Printf("CDAudio_Init: MCI_OPEN failed (%i)\n", dwReturn);\r
+               return -1;\r
+       }\r
+       wDeviceID = mciOpenParms.wDeviceID;\r
+\r
+    // Set the time format to track/minute/second/frame (TMSF).\r
+    mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF;\r
+    if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD)(LPVOID) &mciSetParms))\r
+    {\r
+               Con_Printf("MCI_SET_TIME_FORMAT failed (%i)\n", dwReturn);\r
+        mciSendCommand(wDeviceID, MCI_CLOSE, 0, (DWORD)NULL);\r
+               return -1;\r
+    }\r
+\r
+       for (n = 0; n < 100; n++)\r
+               remap[n] = n;\r
+       initialized = true;\r
+       enabled = true;\r
+\r
+       if (CDAudio_GetAudioDiskInfo())\r
+       {\r
+               Con_Printf("CDAudio_Init: No CD in player.\n");\r
+               cdValid = false;\r
+       }\r
+\r
+       Cmd_AddCommand ("cd", CD_f);\r
+\r
+       CD_FindCDAux();\r
+\r
+       Con_Printf("CD Audio Initialized\n");\r
+\r
+       return 0;\r
+}\r
+\r
+\r
+void CDAudio_Shutdown(void)\r
+{\r
+       if (!initialized)\r
+               return;\r
+       CDAudio_Stop();\r
+       if (mciSendCommand(wDeviceID, MCI_CLOSE, MCI_WAIT, (DWORD)NULL))\r
+               Con_DPrintf("CDAudio_Shutdown: MCI_CLOSE failed\n");\r
+}\r
diff --git a/H2MP/code/CLIENT.H b/H2MP/code/CLIENT.H
new file mode 100644 (file)
index 0000000..7cf7a71
--- /dev/null
@@ -0,0 +1,440 @@
+// client.h\r
+\r
+/*\r
+ * $Header: /H2 Mission Pack/CLIENT.H 4     3/12/98 6:31p Mgummelt $\r
+ */\r
+\r
+typedef struct\r
+{\r
+       vec3_t  viewangles;\r
+\r
+// intended velocities\r
+       float   forwardmove;\r
+       float   sidemove;\r
+       float   upmove;\r
+#ifdef QUAKE2RJ\r
+       byte    lightlevel;\r
+#endif\r
+} usercmd_t;\r
+\r
+typedef struct\r
+{\r
+       int             length;\r
+       char    map[MAX_STYLESTRING];\r
+} lightstyle_t;\r
+\r
+typedef struct\r
+{\r
+       char    name[MAX_SCOREBOARDNAME];\r
+       float   entertime;\r
+       int             frags;\r
+       int             colors;                 // two 4 bit fields\r
+       byte    translations[VID_GRADES*256];\r
+       float   playerclass;\r
+} scoreboard_t;\r
+\r
+typedef struct\r
+{\r
+       int             destcolor[3];\r
+       int             percent;                // 0-256\r
+} cshift_t;\r
+\r
+#define        CSHIFT_CONTENTS         0\r
+#define        CSHIFT_DAMAGE           1\r
+#define        CSHIFT_BONUS            2\r
+#define        CSHIFT_POWERUP          3\r
+#define        CSHIFT_INTERVENTION 4\r
+#define        NUM_CSHIFTS                     5\r
+\r
+#define        NAME_LENGTH     64\r
+\r
+\r
+//\r
+// client_state_t should hold all pieces of the client state\r
+//\r
+\r
+#define        SIGNONS         4                       // signon messages to receive before connected\r
+\r
+#define        MAX_DLIGHTS             32\r
+typedef struct\r
+{\r
+       vec3_t  origin;\r
+       float   radius;\r
+       float   die;                            // stop lighting after this time\r
+       float   decay;                          // drop this each second\r
+       float   minlight;                       // don't add when contributing less\r
+       int             key;\r
+#ifdef QUAKE2RJ\r
+       qboolean        dark;                   // subtracts light instead of adding\r
+#endif\r
+} dlight_t;\r
+\r
+#define        MAX_EFRAGS              640\r
+\r
+#define        MAX_MAPSTRING   2048\r
+#define        MAX_DEMOS               8\r
+#define        MAX_DEMONAME    16\r
+\r
+typedef enum {\r
+ca_dedicated,          // a dedicated server with no ability to start a client\r
+ca_disconnected,       // full screen console with no connection\r
+ca_connected           // valid netcon, talking to a server\r
+} cactive_t;\r
+\r
+//\r
+// the client_static_t structure is persistant through an arbitrary number\r
+// of server connections\r
+//\r
+typedef struct\r
+{\r
+       cactive_t       state;\r
+\r
+// personalization data sent to server \r
+       char            mapstring[MAX_QPATH];\r
+       char            spawnparms[MAX_MAPSTRING];      // to restart a level\r
+\r
+// demo loop control\r
+       int                     demonum;                // -1 = don't play demos\r
+       char            demos[MAX_DEMOS][MAX_DEMONAME];         // when not playing\r
+\r
+// demo recording info must be here, because record is started before\r
+// entering a map (and clearing client_state_t)\r
+       qboolean        demorecording;\r
+       qboolean        demoplayback;\r
+       qboolean        timedemo;\r
+       int                     forcetrack;                     // -1 = use normal cd track\r
+       FILE            *demofile;\r
+       FILE            *introdemofile;\r
+       int                     td_lastframe;           // to meter out one message a frame\r
+       int                     td_startframe;          // host_framecount at start\r
+       float           td_starttime;           // realtime at second frame of timedemo\r
+\r
+\r
+// connection information\r
+       int                     signon;                 // 0 to SIGNONS\r
+       struct qsocket_s        *netcon;\r
+       sizebuf_t       message;                // writing buffer to send to server\r
+       \r
+} client_static_t;\r
+\r
+extern client_static_t cls;\r
+\r
+//\r
+// the client_state_t structure is wiped completely at every\r
+// server signon\r
+//\r
+typedef struct\r
+{\r
+       int                     movemessages;   // since connecting to this server\r
+                                                               // throw out the first couple, so the player\r
+                                                               // doesn't accidentally do something the \r
+                                                               // first frame\r
+       usercmd_t       cmd;                    // last command sent to the server\r
+\r
+// information for local display\r
+       int                     stats[MAX_CL_STATS];    // health, etc\r
+       int                     inv_order[MAX_INVENTORY];\r
+       int                     inv_count, inv_startpos, inv_selected;\r
+       int                     items;                  // inventory bit flags\r
+       float           item_gettime[32];       // cl.time of aquiring item, for blinking\r
+       float           faceanimtime;   // use anim frame if cl.time < this\r
+\r
+       entvars_t               v; // NOTE: not every field will be update - you must specifically add\r
+                          // them in functions SV_WriteClientdatatToMessage() and CL_ParseClientdata()\r
+\r
+       cshift_t        cshifts[NUM_CSHIFTS];   // color shifts for damage, powerups\r
+       cshift_t        prev_cshifts[NUM_CSHIFTS];      // and content types\r
+\r
+       char puzzle_pieces[8][10]; // puzzle piece names\r
+\r
+// the client maintains its own idea of view angles, which are\r
+// sent to the server each frame.  The server sets punchangle when\r
+// the view is temporarliy offset, and an angle reset commands at the start\r
+// of each level and after teleporting.\r
+       vec3_t          mviewangles[2]; // during demo playback viewangles is lerped\r
+                                                               // between these\r
+       vec3_t          viewangles;\r
+       \r
+       vec3_t          mvelocity[2];   // update by server, used for lean+bob\r
+                                                               // (0 is newest)\r
+       vec3_t          velocity;               // lerped between mvelocity[0] and [1]\r
+\r
+       vec3_t          punchangle;             // temporary offset\r
+\r
+       float           idealroll;\r
+       float           rollvel;\r
+       \r
+// pitch drifting vars\r
+       float           idealpitch;\r
+       float           pitchvel;\r
+       qboolean        nodrift;\r
+       float           driftmove;\r
+       double          laststop;\r
+\r
+       float           viewheight;\r
+       float           crouch;                 // local amount for smoothing stepups\r
+\r
+       qboolean        paused;                 // send over by server\r
+       qboolean        onground;\r
+       qboolean        inwater;\r
+       \r
+       int                     intermission;   // don't change view angle, full screen, etc\r
+       int                     completed_time; // latched at intermission start\r
+       \r
+       double          mtime[2];               // the timestamp of last two messages   \r
+       double          time;                   // clients view of time, should be between\r
+                                                               // servertime and oldservertime to generate\r
+                                                               // a lerp point for other data\r
+       double          oldtime;                // previous cl.time, time-oldtime is used\r
+                                                               // to decay light values and smooth step ups\r
+       \r
+\r
+       float           last_received_message;  // (realtime) for net trouble icon\r
+\r
+//\r
+// information that is static for the entire time connected to a server\r
+//\r
+       struct model_s          *model_precache[MAX_MODELS];\r
+       struct sfx_s            *sound_precache[MAX_SOUNDS];\r
+\r
+       char            levelname[40];  // for display on solo scoreboard\r
+       int                     viewentity;             // cl_entitites[cl.viewentity] = player\r
+       int                     maxclients;\r
+       int                     gametype;\r
+\r
+// refresh related state\r
+       struct model_s  *worldmodel;    // cl_entitites[0].model\r
+       struct efrag_s  *free_efrags;\r
+       int                     num_entities;   // held in cl_entities array\r
+       int                     num_statics;    // held in cl_staticentities array\r
+       entity_t        viewent;                        // the gun model\r
+       struct EffectT Effects[MAX_EFFECTS];\r
+\r
+       int                     cdtrack, looptrack;     // cd audio\r
+       char            midi_name[128];     // midi file name\r
+       byte            current_frame, last_frame, reference_frame;\r
+       byte            current_sequence, last_sequence;\r
+       byte            need_build;\r
+\r
+// frag scoreboard\r
+       scoreboard_t    *scores;                // [cl.maxclients]\r
+\r
+#ifdef QUAKE2RJ\r
+// light level at player's position including dlights\r
+// this is sent back to the server each frame\r
+// architectually ugly but it works\r
+       int                     light_level;\r
+#endif\r
+\r
+       client_frames2_t frames[3]; // 0 = base, 1 = building, 2 = 0 & 1 merged\r
+       short RemoveList[MAX_CLIENT_STATES],NumToRemove;\r
+\r
+       long    info_mask, info_mask2;\r
+} client_state_t;\r
+\r
+\r
+//\r
+// cvars\r
+//\r
+extern cvar_t  cl_name;\r
+extern cvar_t  cl_color;\r
+extern cvar_t  cl_playerclass;\r
+\r
+extern cvar_t  cl_upspeed;\r
+extern cvar_t  cl_forwardspeed;\r
+extern cvar_t  cl_backspeed;\r
+extern  cvar_t cl_prettylights;\r
+extern cvar_t  cl_sidespeed;\r
+\r
+extern cvar_t  cl_movespeedkey;\r
+\r
+extern cvar_t  cl_yawspeed;\r
+extern cvar_t  cl_pitchspeed;\r
+\r
+extern cvar_t  cl_anglespeedkey;\r
+\r
+extern cvar_t  cl_autofire;\r
+\r
+extern cvar_t  cl_shownet;\r
+extern cvar_t  cl_nolerp;\r
+\r
+extern cvar_t  cl_pitchdriftspeed;\r
+extern cvar_t  lookspring;\r
+extern cvar_t  lookstrafe;\r
+extern cvar_t  sensitivity;\r
+\r
+extern cvar_t  m_pitch;\r
+extern cvar_t  m_yaw;\r
+extern cvar_t  m_forward;\r
+extern cvar_t  m_side;\r
+\r
+\r
+#define        MAX_STATIC_ENTITIES     256                     // torches, etc\r
+\r
+extern client_state_t  cl;\r
+\r
+// FIXME, allocate dynamically\r
+extern efrag_t                 cl_efrags[MAX_EFRAGS];\r
+extern entity_t                cl_entities[MAX_EDICTS];\r
+extern entity_t                cl_static_entities[MAX_STATIC_ENTITIES];\r
+extern lightstyle_t    cl_lightstyle[MAX_LIGHTSTYLES];\r
+extern dlight_t                cl_dlights[MAX_DLIGHTS];\r
+\r
+//=============================================================================\r
+\r
+//\r
+// cl_main\r
+//\r
+dlight_t *CL_AllocDlight (int key);\r
+void   CL_DecayLights (void);\r
+\r
+void CL_Init (void);\r
+\r
+void CL_EstablishConnection (char *host);\r
+void CL_Signon1 (void);\r
+void CL_Signon2 (void);\r
+void CL_Signon3 (void);\r
+void CL_Signon4 (void);\r
+void CL_SignonReply (void);\r
+\r
+void CL_Disconnect (void);\r
+void CL_Disconnect_f (void);\r
+void CL_NextDemo (void);\r
+\r
+#define                        MAX_VISEDICTS   256\r
+extern int                             cl_numvisedicts;\r
+extern entity_t                *cl_visedicts[MAX_VISEDICTS];\r
+\r
+//\r
+// cl_input\r
+//\r
+typedef struct\r
+{\r
+       int             down[2];                // key nums holding it down\r
+       int             state;                  // low bit is down state\r
+} kbutton_t;\r
+\r
+extern kbutton_t       in_mlook, in_klook;\r
+extern         kbutton_t       in_strafe;\r
+extern         kbutton_t       in_speed;\r
+\r
+void CL_InitInput (void);\r
+void CL_SendCmd (void);\r
+void CL_SendMove (usercmd_t *cmd);\r
+\r
+void CL_ClearState (void);\r
+\r
+int  CL_ReadFromServer (void);\r
+void CL_WriteToServer (usercmd_t *cmd);\r
+void CL_BaseMove (usercmd_t *cmd);\r
+\r
+\r
+float CL_KeyState (kbutton_t *key);\r
+char *Key_KeynumToString (int keynum);\r
+\r
+//\r
+// cl_demo.c\r
+//\r
+void CL_StopPlayback (void);\r
+int CL_GetMessage (void);\r
+\r
+void CL_Stop_f (void);\r
+void CL_Record_f (void);\r
+void CL_PlayDemo_f (void);\r
+void CL_TimeDemo_f (void);\r
+\r
+//\r
+// cl_parse.c\r
+//\r
+void CL_ParseServerMessage (void);\r
+void CL_NewTranslation (int slot);\r
+\r
+//\r
+// view\r
+//\r
+void V_StartPitchDrift (void);\r
+void V_StopPitchDrift (void);\r
+\r
+void V_RenderView (void);\r
+void V_UpdatePalette (void);\r
+void V_Register (void);\r
+void V_ParseDamage (void);\r
+void V_SetContentsColor (int contents);\r
+\r
+//\r
+// cl_tent\r
+//\r
+void CL_InitTEnts(void);\r
+void CL_ClearTEnts(void);\r
+void CL_ParseTEnt(void);\r
+void CL_UpdateTEnts(void);\r
+\r
+/*\r
+ * $Log: /H2 Mission Pack/CLIENT.H $\r
+ * \r
+ * 4     3/12/98 6:31p Mgummelt\r
+ * \r
+ * 3     3/02/98 2:51p Jweier\r
+ * \r
+ * 2     2/27/98 11:53p Jweier\r
+ * \r
+ * 22    9/02/97 12:24a Rjohnson\r
+ * Update\r
+ * \r
+ * 21    8/30/97 6:17p Rjohnson\r
+ * Network changes\r
+ * \r
+ * 20    8/29/97 2:49p Rjohnson\r
+ * Network updates\r
+ * \r
+ * 19    8/26/97 8:17a Rjohnson\r
+ * Just a few changes\r
+ * \r
+ * 18    8/11/97 2:52p Rlove\r
+ * \r
+ * 17    8/04/97 2:22p Rjohnson\r
+ * Included light level for the player\r
+ * \r
+ * 16    6/16/97 7:52a Bgokey\r
+ * \r
+ * 15    6/09/97 1:56p Rjohnson\r
+ * Increased max statics\r
+ * \r
+ * 14    5/23/97 3:04p Rjohnson\r
+ * Included some more quake2 things\r
+ * \r
+ * 13    5/20/97 11:32a Rjohnson\r
+ * Revised Effects\r
+ * \r
+ * 12    5/20/97 11:19a Bgokey\r
+ * \r
+ * 11    5/10/97 1:08p Bgokey\r
+ * \r
+ * 10    4/09/97 2:34p Rjohnson\r
+ * Revised inventory\r
+ * \r
+ * 9     4/04/97 3:06p Rjohnson\r
+ * Networking updates and corrections\r
+ * \r
+ * 8     3/31/97 7:24p Rjohnson\r
+ * Added a playerclass field and made sure the server/clients handle it\r
+ * properly\r
+ * \r
+ * 7     2/27/97 4:11p Rjohnson\r
+ * Midi file name is stored in the server and client structs\r
+ * \r
+ * 6     2/19/97 11:20a Rjohnson\r
+ * Id Updates\r
+ * \r
+ * 5     2/10/97 2:05p Rlove\r
+ * Inventory change\r
+ * \r
+ * 4     1/30/97 3:09p Rlove\r
+ * Refined flight mode and added sv_walkpitch, sv_flypitch,\r
+ * sv_idealrollscale console varibles\r
+ * \r
+ * 3     12/18/96 9:33a Rlove\r
+ * Changes for inventory screen\r
+ * \r
+ */\r
+\r
diff --git a/H2MP/code/CL_DEMO.C b/H2MP/code/CL_DEMO.C
new file mode 100644 (file)
index 0000000..897e63e
--- /dev/null
@@ -0,0 +1,404 @@
+\r
+#include "quakedef.h"\r
+\r
+void CL_FinishTimeDemo (void);\r
+\r
+/*\r
+==============================================================================\r
+\r
+DEMO CODE\r
+\r
+When a demo is playing back, all NET_SendMessages are skipped, and\r
+NET_GetMessages are read from the demo file.\r
+\r
+Whenever cl.time gets past the last received message, another message is\r
+read from the demo file.\r
+==============================================================================\r
+*/\r
+\r
+/*\r
+==============\r
+CL_StopPlayback\r
+\r
+Called when a demo file runs out, or the user starts a game\r
+==============\r
+*/\r
+void CL_StopPlayback (void)\r
+{\r
+       if (!cls.demoplayback)\r
+               return;\r
+\r
+       if (intro_playing)\r
+               M_ToggleMenu_f();\r
+\r
+\r
+       intro_playing=false;\r
+       num_intro_msg=0;\r
+\r
+       fclose (cls.demofile);\r
+       cls.demoplayback = false;\r
+       cls.demofile = NULL;\r
+       cls.state = ca_disconnected;\r
+\r
+       if (cls.timedemo)\r
+               CL_FinishTimeDemo ();\r
+}\r
+\r
+/*\r
+====================\r
+CL_WriteDemoMessage\r
+\r
+Dumps the current net message, prefixed by the length and view angles\r
+====================\r
+*/\r
+void CL_WriteDemoMessage (void)\r
+{\r
+       int             len;\r
+       int             i;\r
+       float   f;\r
+\r
+       len = LittleLong (net_message.cursize);\r
+       fwrite (&len, 4, 1, cls.demofile);\r
+//     fwrite (&len, 4, 1, cls.introdemofile);\r
+       for (i=0 ; i<3 ; i++)\r
+       {\r
+               f = LittleFloat (cl.viewangles[i]);\r
+               fwrite (&f, 4, 1, cls.demofile);\r
+//             fwrite (&f, 4, 1, cls.introdemofile);\r
+       }\r
+       fwrite (net_message.data, net_message.cursize, 1, cls.demofile);\r
+       fflush (cls.demofile);\r
+//     fwrite (net_message.data, net_message.cursize, 1, cls.introdemofile);\r
+//     fflush (cls.introdemofile);\r
+}\r
+\r
+/*\r
+====================\r
+CL_GetMessage\r
+\r
+Handles recording and playback of demos, on top of NET_ code\r
+====================\r
+*/\r
+int CL_GetMessage (void)\r
+{\r
+       int             r, i;\r
+       float   f;\r
+       \r
+       if      (cls.demoplayback)\r
+       {\r
+       // decide if it is time to grab the next message                \r
+               if (cls.signon == SIGNONS)      // allways grab until fully connected\r
+               {\r
+                       if (cls.timedemo)\r
+                       {\r
+                               if (host_framecount == cls.td_lastframe)\r
+                                       return 0;               // allready read this frame's message\r
+                               cls.td_lastframe = host_framecount;\r
+                       // if this is the second frame, grab the real td_starttime\r
+                       // so the bogus time on the first frame doesn't count\r
+                               if (host_framecount == cls.td_startframe + 1)\r
+                                       cls.td_starttime = realtime;\r
+                       }\r
+                       else if ( /* cl.time > 0 && */ cl.time <= cl.mtime[0])\r
+                       {\r
+                                       return 0;               // don't need another message yet\r
+                       }\r
+               }\r
+               \r
+       // get the next message\r
+//             if(intro_playing&&num_intro_msg>0&&num_intro_msg<21)\r
+//                     V_DarkFlash_f();//Fade into demo\r
+\r
+/*             if(skip_start&&num_intro_msg>3)\r
+               {\r
+                       while(num_intro_msg<1110)\r
+                       {\r
+                               fread (&net_message.cursize, 4, 1, cls.demofile);\r
+                               VectorCopy (cl.mviewangles[0], cl.mviewangles[1]);\r
+                               for (i=0 ; i<3 ; i++)\r
+                               {\r
+                                       r = fread (&f, 4, 1, cls.demofile);\r
+                                       cl.mviewangles[0][i] = LittleFloat (f);\r
+                               }\r
+                               \r
+                               net_message.cursize = LittleLong (net_message.cursize);\r
+                               num_intro_msg++;\r
+                               if (net_message.cursize > MAX_MSGLEN)\r
+                                       Sys_Error ("Demo message > MAX_MSGLEN");\r
+                               r = fread (net_message.data, net_message.cursize, 1, cls.demofile);\r
+                               if (r != 1)\r
+                               {\r
+                                       CL_StopPlayback ();\r
+                                       return 0;\r
+                               }\r
+                               if(num_intro_msg==174||\r
+                                       num_intro_msg==178||\r
+                                       num_intro_msg==428||\r
+                                       num_intro_msg==553||\r
+                                       num_intro_msg==1012)\r
+                                       break;\r
+                       }\r
+                       if(num_intro_msg==1110)\r
+                               skip_start=false;\r
+               }\r
+               else\r
+               {*/\r
+                       fread (&net_message.cursize, 4, 1, cls.demofile);\r
+                       VectorCopy (cl.mviewangles[0], cl.mviewangles[1]);\r
+                       for (i=0 ; i<3 ; i++)\r
+                       {\r
+                               r = fread (&f, 4, 1, cls.demofile);\r
+                               cl.mviewangles[0][i] = LittleFloat (f);\r
+                       }\r
+                       \r
+                       net_message.cursize = LittleLong (net_message.cursize);\r
+                       num_intro_msg++;\r
+                       if (net_message.cursize > MAX_MSGLEN)\r
+                               Sys_Error ("Demo message > MAX_MSGLEN");\r
+                       r = fread (net_message.data, net_message.cursize, 1, cls.demofile);\r
+                       if (r != 1)\r
+                       {\r
+                               CL_StopPlayback ();\r
+                               return 0;\r
+                       }\r
+//             }\r
+\r
+//             if (cls.demorecording)\r
+//                     CL_WriteDemoMessage ();\r
+       \r
+               return 1;\r
+       }\r
+\r
+       while (1)\r
+       {\r
+               r = NET_GetMessage (cls.netcon);\r
+               \r
+               if (r != 1 && r != 2)\r
+                       return r;\r
+       \r
+       // discard nop keepalive message\r
+               if (net_message.cursize == 1 && net_message.data[0] == svc_nop)\r
+                       Con_Printf ("<-- server to client keepalive\n");\r
+               else\r
+                       break;\r
+       }\r
+\r
+       if (cls.demorecording)\r
+               CL_WriteDemoMessage ();\r
+       \r
+       return r;\r
+}\r
+\r
+\r
+/*\r
+====================\r
+CL_Stop_f\r
+\r
+stop recording a demo\r
+====================\r
+*/\r
+void CL_Stop_f (void)\r
+{\r
+       if (cmd_source != src_command)\r
+               return;\r
+\r
+       if (!cls.demorecording)\r
+       {\r
+               Con_Printf ("Not recording a demo.\n");\r
+               return;\r
+       }\r
+\r
+       intro_playing=false;\r
+       num_intro_msg=0;\r
+// write a disconnect message to the demo file\r
+       SZ_Clear (&net_message);\r
+       MSG_WriteByte (&net_message, svc_disconnect);\r
+       CL_WriteDemoMessage ();\r
+\r
+// finish up\r
+//     fclose (cls.introdemofile);\r
+//     cls.introdemofile = NULL;\r
+       fclose (cls.demofile);\r
+       cls.demofile = NULL;\r
+       cls.demorecording = false;\r
+       Con_Printf ("Completed demo\n");\r
+}\r
+\r
+/*\r
+====================\r
+CL_Record_f\r
+\r
+record <demoname> <map> [cd track]\r
+====================\r
+*/\r
+void CL_Record_f (void)\r
+{\r
+       int             c;\r
+       char    name[MAX_OSPATH];\r
+       int             track;\r
+\r
+       if (cmd_source != src_command)\r
+               return;\r
+\r
+       c = Cmd_Argc();\r
+       if (c != 2 && c != 3 && c != 4)\r
+       {\r
+               Con_Printf ("record <demoname> [<map> [cd track]]\n");\r
+               return;\r
+       }\r
+\r
+       if (strstr(Cmd_Argv(1), ".."))\r
+       {\r
+               Con_Printf ("Relative pathnames are not allowed.\n");\r
+               return;\r
+       }\r
+\r
+       if (c == 2 && cls.state == ca_connected)\r
+       {\r
+               Con_Printf("Can not record - already connected to server\nClient demo recording must be started before connecting\n");\r
+               return;\r
+       }\r
+\r
+// write the forced cd track number, or -1\r
+       if (c == 4)\r
+       {\r
+               track = atoi(Cmd_Argv(3));\r
+               Con_Printf ("Forcing CD track to %i\n", cls.forcetrack);\r
+       }\r
+       else\r
+               track = -1;     \r
+\r
+       sprintf (name, "%s/%s", com_gamedir, Cmd_Argv(1));\r
+       \r
+//\r
+// start the map up\r
+//\r
+       if (c > 2)\r
+               Cmd_ExecuteString ( va("map %s", Cmd_Argv(2)), src_command);\r
+       \r
+//\r
+// open the demo file\r
+//\r
+       COM_DefaultExtension (name, ".dem");\r
+\r
+       Con_Printf ("recording to %s.\n", name);\r
+       cls.demofile = fopen (name, "wb");\r
+       if (!cls.demofile)\r
+       {\r
+               Con_Printf ("ERROR: couldn't open.\n");\r
+               return;\r
+       }\r
+\r
+       cls.forcetrack = track;\r
+       fprintf (cls.demofile, "%i\n", cls.forcetrack);\r
+       \r
+       cls.demorecording = true;\r
+}\r
+\r
+\r
+/*\r
+====================\r
+CL_PlayDemo_f\r
+\r
+play [demoname]\r
+====================\r
+*/\r
+void CL_PlayDemo_f (void)\r
+{\r
+       char    name[256];\r
+\r
+       if (cmd_source != src_command)\r
+               return;\r
+\r
+       if (Cmd_Argc() != 2)\r
+       {\r
+               Con_Printf ("play <demoname> : plays a demo\n");\r
+               return;\r
+       }\r
+\r
+//\r
+// disconnect from server\r
+//\r
+       CL_Disconnect ();\r
+       \r
+//\r
+// open the demo file\r
+//\r
+       strcpy (name, Cmd_Argv(1));\r
+       if(!stricmp(name,"t9"))\r
+       {\r
+               intro_playing=true;\r
+//             skip_start=true;\r
+       }\r
+       else\r
+               intro_playing=false;\r
+       COM_DefaultExtension (name, ".dem");\r
+\r
+       Con_Printf ("Playing demo from %s.\n", name);\r
+/*     if(intro_playing)\r
+       {\r
+               cls.demorecording = true;\r
+               cls.introdemofile=fopen("t9.dem","wb");\r
+       }\r
+*/     COM_FOpenFile (name, &cls.demofile, false);\r
+       if (!cls.demofile)\r
+       {\r
+               Con_Printf ("ERROR: couldn't open.\n");\r
+               cls.demonum = -1;               // stop demo loop\r
+               return;\r
+       }\r
+\r
+       cls.demoplayback = true;\r
+       cls.state = ca_connected;\r
+       fscanf (cls.demofile, "%i\n", &cls.forcetrack);\r
+}\r
+\r
+/*\r
+====================\r
+CL_FinishTimeDemo\r
+\r
+====================\r
+*/\r
+void CL_FinishTimeDemo (void)\r
+{\r
+       int             frames;\r
+       float   time;\r
+       \r
+       cls.timedemo = false;\r
+       \r
+// the first frame didn't count\r
+       frames = (host_framecount - cls.td_startframe) - 1;\r
+       time = realtime - cls.td_starttime;\r
+       if (!time)\r
+               time = 1;\r
+       Con_Printf ("%i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time);\r
+}\r
+\r
+/*\r
+====================\r
+CL_TimeDemo_f\r
+\r
+timedemo [demoname]\r
+====================\r
+*/\r
+void CL_TimeDemo_f (void)\r
+{\r
+       if (cmd_source != src_command)\r
+               return;\r
+\r
+       if (Cmd_Argc() != 2)\r
+       {\r
+               Con_Printf ("timedemo <demoname> : gets demo speeds\n");\r
+               return;\r
+       }\r
+\r
+       CL_PlayDemo_f ();\r
+       \r
+// cls.td_starttime will be grabbed at the second frame of the demo, so\r
+// all the loading time doesn't get counted\r
+       \r
+       cls.timedemo = true;\r
+       cls.td_startframe = host_framecount;\r
+       cls.td_lastframe = -1;          // get a new message this frame\r
+}\r
+\r
diff --git a/H2MP/code/CL_INPUT.C b/H2MP/code/CL_INPUT.C
new file mode 100644 (file)
index 0000000..23ebe54
--- /dev/null
@@ -0,0 +1,559 @@
+// cl.input.c  -- builds an intended movement command to send to the server\r
+\r
+// Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All\r
+// rights reserved.\r
+\r
+#include "quakedef.h"\r
+\r
+/*\r
+===============================================================================\r
+\r
+KEY BUTTONS\r
+\r
+Continuous button event tracking is complicated by the fact that two different\r
+input sources (say, mouse button 1 and the control key) can both press the\r
+same button, but the button should only be released when both of the\r
+pressing key have been released.\r
+\r
+When a key event issues a button command (+forward, +attack, etc), it appends\r
+its key number as a parameter to the command so it can be matched up with\r
+the release.\r
+\r
+state bit 0 is the current state of the key\r
+state bit 1 is edge triggered on the up to down transition\r
+state bit 2 is edge triggered on the down to up transition\r
+\r
+===============================================================================\r
+*/\r
+\r
+\r
+kbutton_t      in_mlook, in_klook;\r
+kbutton_t      in_left, in_right, in_forward, in_back;\r
+kbutton_t      in_lookup, in_lookdown, in_moveleft, in_moveright;\r
+kbutton_t      in_strafe, in_speed, in_use, in_jump, in_attack;\r
+kbutton_t      in_up, in_down, in_crouch;\r
+kbutton_t      in_infoplaque;\r
+\r
+int                                    in_impulse;\r
+extern qboolean                info_up;\r
+\r
+void KeyDown (kbutton_t *b)\r
+{\r
+       int             k;\r
+       char    *c;\r
+\r
+       c = Cmd_Argv(1);\r
+       if (c[0])\r
+               k = atoi(c);\r
+       else\r
+               k = -1;         // typed manually at the console for continuous down\r
+\r
+       if (k == b->down[0] || k == b->down[1])\r
+               return;         // repeating key\r
+       \r
+       if (!b->down[0])\r
+               b->down[0] = k;\r
+       else if (!b->down[1])\r
+               b->down[1] = k;\r
+       else\r
+       {\r
+               Con_Printf ("Three keys down for a button!\n");\r
+               return;\r
+       }\r
+       \r
+       if (b->state & 1)\r
+               return;         // still down\r
+       b->state |= 1 + 2;      // down + impulse down\r
+}\r
+\r
+void KeyUp (kbutton_t *b)\r
+{\r
+       int             k;\r
+       char    *c;\r
+       \r
+       c = Cmd_Argv(1);\r
+       if (c[0])\r
+               k = atoi(c);\r
+       else\r
+       { // typed manually at the console, assume for unsticking, so clear all\r
+               b->down[0] = b->down[1] = 0;\r
+               b->state = 4;   // impulse up\r
+               return;\r
+       }\r
+\r
+       if (b->down[0] == k)\r
+               b->down[0] = 0;\r
+       else if (b->down[1] == k)\r
+               b->down[1] = 0;\r
+       else\r
+               return;         // key up without coresponding down (menu pass through)\r
+       if (b->down[0] || b->down[1])\r
+               return;         // some other key is still holding it down\r
+\r
+       if (!(b->state & 1))\r
+               return;         // still up (this should not happen)\r
+       b->state &= ~1;         // now up\r
+       b->state |= 4;          // impulse up\r
+}\r
+\r
+void IN_KLookDown (void) {KeyDown(&in_klook);}\r
+void IN_KLookUp (void) {KeyUp(&in_klook);}\r
+void IN_MLookDown (void) {KeyDown(&in_mlook);}\r
+void IN_MLookUp (void) {\r
+KeyUp(&in_mlook);\r
+if ( !(in_mlook.state&1) &&  lookspring.value)\r
+       V_StartPitchDrift();\r
+}\r
+void IN_UpDown(void) {KeyDown(&in_up);}\r
+void IN_UpUp(void) {KeyUp(&in_up);}\r
+void IN_DownDown(void) {KeyDown(&in_down);}\r
+void IN_DownUp(void) {KeyUp(&in_down);}\r
+void IN_LeftDown(void) {KeyDown(&in_left);}\r
+void IN_LeftUp(void) {KeyUp(&in_left);}\r
+void IN_RightDown(void) {KeyDown(&in_right);}\r
+void IN_RightUp(void) {KeyUp(&in_right);}\r
+void IN_ForwardDown(void) {KeyDown(&in_forward);}\r
+void IN_ForwardUp(void) {KeyUp(&in_forward);}\r
+void IN_BackDown(void) {KeyDown(&in_back);}\r
+void IN_BackUp(void) {KeyUp(&in_back);}\r
+void IN_LookupDown(void) {KeyDown(&in_lookup);}\r
+void IN_LookupUp(void) {KeyUp(&in_lookup);}\r
+void IN_LookdownDown(void) {KeyDown(&in_lookdown);}\r
+void IN_LookdownUp(void) {KeyUp(&in_lookdown);}\r
+void IN_MoveleftDown(void) {KeyDown(&in_moveleft);}\r
+void IN_MoveleftUp(void) {KeyUp(&in_moveleft);}\r
+void IN_MoverightDown(void) {KeyDown(&in_moveright);}\r
+void IN_MoverightUp(void) {KeyUp(&in_moveright);}\r
+\r
+void IN_SpeedDown(void) {KeyDown(&in_speed);}\r
+void IN_SpeedUp(void) {KeyUp(&in_speed);}\r
+void IN_StrafeDown(void) {KeyDown(&in_strafe);}\r
+void IN_StrafeUp(void) {KeyUp(&in_strafe);}\r
+\r
+void IN_AttackDown(void) {KeyDown(&in_attack);}\r
+void IN_AttackUp(void) {KeyUp(&in_attack);}\r
+\r
+void IN_UseDown (void) {KeyDown(&in_use);}\r
+void IN_UseUp (void) {KeyUp(&in_use);}\r
+void IN_JumpDown (void) {KeyDown(&in_jump);}\r
+void IN_JumpUp (void) {KeyUp(&in_jump);}\r
+\r
+void IN_Impulse (void) {in_impulse=atoi(Cmd_Argv(1));}\r
+\r
+/*\r
+===============\r
+CL_KeyState\r
+\r
+Returns 0.25 if a key was pressed and released during the frame,\r
+0.5 if it was pressed and held\r
+0 if held then released, and\r
+1.0 if held for the entire time\r
+===============\r
+*/\r
+float CL_KeyState (kbutton_t *key)\r
+{\r
+       float           val;\r
+       qboolean        impulsedown, impulseup, down;\r
+       \r
+       impulsedown = key->state & 2;\r
+       impulseup = key->state & 4;\r
+       down = key->state & 1;\r
+       val = 0;\r
+       \r
+       if (impulsedown && !impulseup)\r
+               if (down)\r
+                       val = 0.5;      // pressed and held this frame\r
+               else\r
+                       val = 0;        //      I_Error ();\r
+       if (impulseup && !impulsedown)\r
+               if (down)\r
+                       val = 0;        //      I_Error ();\r
+               else\r
+                       val = 0;        // released this frame\r
+       if (!impulsedown && !impulseup)\r
+               if (down)\r
+                       val = 1.0;      // held the entire frame\r
+               else\r
+                       val = 0;        // up the entire frame\r
+       if (impulsedown && impulseup)\r
+               if (down)\r
+                       val = 0.75;     // released and re-pressed this frame\r
+               else\r
+                       val = 0.25;     // pressed and released this frame\r
+\r
+       key->state &= 1;                // clear impulses\r
+       \r
+       return val;\r
+}\r
+\r
+\r
+\r
+\r
+//==========================================================================\r
+\r
+cvar_t cl_upspeed = {"cl_upspeed","200"};\r
+cvar_t cl_forwardspeed = {"cl_forwardspeed","200", true};\r
+cvar_t cl_backspeed = {"cl_backspeed","200", true};\r
+//cvar_t       cl_sidespeed = {"cl_sidespeed","350"};\r
+cvar_t cl_sidespeed = {"cl_sidespeed","225"};\r
+\r
+cvar_t cl_movespeedkey = {"cl_movespeedkey","2.0"};\r
+\r
+cvar_t cl_yawspeed = {"cl_yawspeed","140"};\r
+cvar_t cl_pitchspeed = {"cl_pitchspeed","150"};\r
+\r
+cvar_t cl_anglespeedkey = {"cl_anglespeedkey","1.5"};\r
+\r
+cvar_t cl_prettylights = {"cl_prettylights","1"};\r
+\r
+/*\r
+================\r
+CL_AdjustAngles\r
+\r
+Moves the local angle positions\r
+================\r
+*/\r
+void CL_AdjustAngles (void)\r
+{\r
+       float   speed;\r
+       float   up, down;\r
+       \r
+       if (in_speed.state & 1)\r
+               speed = host_frametime * cl_anglespeedkey.value;\r
+       else\r
+               speed = host_frametime;\r
+\r
+       if (!(in_strafe.state & 1))\r
+       {\r
+               cl.viewangles[YAW] -= speed*cl_yawspeed.value*CL_KeyState (&in_right);\r
+               cl.viewangles[YAW] += speed*cl_yawspeed.value*CL_KeyState (&in_left);\r
+               cl.viewangles[YAW] = anglemod(cl.viewangles[YAW]);\r
+       }\r
+       if (in_klook.state & 1)\r
+       {\r
+               V_StopPitchDrift ();\r
+               cl.viewangles[PITCH] -= speed*cl_pitchspeed.value * CL_KeyState (&in_forward);\r
+               cl.viewangles[PITCH] += speed*cl_pitchspeed.value * CL_KeyState (&in_back);\r
+       }\r
+\r
+       // FIXME: This is a cheap way of doing this, it belongs in V_CalcViewRoll\r
+       // but I don't see where I can get the yaw velocity, I have to get on to other things so here it is\r
+\r
+       if ((CL_KeyState (&in_left)!=0) && (cl.v.movetype==MOVETYPE_FLY))\r
+               cl.idealroll=-10;\r
+       else if ((CL_KeyState (&in_right)!=0) && (cl.v.movetype==MOVETYPE_FLY))\r
+               cl.idealroll=10;\r
+       else\r
+               cl.idealroll=0;\r
+\r
+       \r
+       up = CL_KeyState (&in_lookup);\r
+       down = CL_KeyState(&in_lookdown);\r
+       \r
+       cl.viewangles[PITCH] -= speed*cl_pitchspeed.value * up;\r
+       cl.viewangles[PITCH] += speed*cl_pitchspeed.value * down;\r
+\r
+       if (up || down)\r
+               V_StopPitchDrift ();\r
+               \r
+       if (cl.viewangles[PITCH] > 80)\r
+               cl.viewangles[PITCH] = 80;\r
+       if (cl.viewangles[PITCH] < -70)\r
+               cl.viewangles[PITCH] = -70;\r
+\r
+       if (cl.viewangles[ROLL] > 50)\r
+               cl.viewangles[ROLL] = 50;\r
+       if (cl.viewangles[ROLL] < -50)\r
+               cl.viewangles[ROLL] = -50;\r
+               \r
+}\r
+\r
+/*\r
+================\r
+CL_BaseMove\r
+\r
+Send the intended movement message to the server\r
+================\r
+*/\r
+void CL_BaseMove (usercmd_t *cmd)\r
+{      \r
+       if (cls.signon != SIGNONS)\r
+               return;\r
+                       \r
+       if (cl.v.cameramode)    // Stuck in a different camera so don't move\r
+       {\r
+               memset (cmd, 0, sizeof(*cmd));\r
+               return;\r
+       }\r
+\r
+       CL_AdjustAngles ();\r
+       \r
+       memset (cmd, 0, sizeof(*cmd));\r
+       \r
+       if (in_strafe.state & 1)\r
+       {\r
+//             cmd->sidemove += cl_sidespeed.value * CL_KeyState (&in_right);\r
+//             cmd->sidemove -= cl_sidespeed.value * CL_KeyState (&in_left);\r
+               cmd->sidemove += 225 * CL_KeyState (&in_right);\r
+               cmd->sidemove -= 225 * CL_KeyState (&in_left);\r
+       }\r
+\r
+//     cmd->sidemove += cl_sidespeed.value * CL_KeyState (&in_moveright);\r
+//     cmd->sidemove -= cl_sidespeed.value * CL_KeyState (&in_moveleft);\r
+       cmd->sidemove += 225 * CL_KeyState (&in_moveright);\r
+       cmd->sidemove -= 225 * CL_KeyState (&in_moveleft);\r
+\r
+       cmd->upmove += cl_upspeed.value * CL_KeyState (&in_up);\r
+       cmd->upmove -= cl_upspeed.value * CL_KeyState (&in_down);\r
+\r
+       if (! (in_klook.state & 1) )\r
+       {       \r
+//             cmd->forwardmove += cl_forwardspeed.value * CL_KeyState (&in_forward);\r
+               cmd->forwardmove += 200 * CL_KeyState (&in_forward);\r
+//             cmd->forwardmove -= cl_backspeed.value * CL_KeyState (&in_back);\r
+               cmd->forwardmove -= 200 * CL_KeyState (&in_back);\r
+       }       \r
+\r
+//\r
+// adjust for speed key (but not if always runs has been chosen)\r
+//\r
+       if ((cl_forwardspeed.value > 200 || in_speed.state & 1) && cl.v.hasted <= 1)\r
+       {\r
+               cmd->forwardmove *= cl_movespeedkey.value;\r
+               cmd->sidemove *= cl_movespeedkey.value;\r
+               cmd->upmove *= cl_movespeedkey.value;\r
+       }\r
+\r
+       // Hasted player?\r
+       if (cl.v.hasted)\r
+       {\r
+               cmd->forwardmove = cmd->forwardmove * cl.v.hasted;\r
+               cmd->sidemove = cmd->sidemove * cl.v.hasted;\r
+               cmd->upmove = cmd->upmove * cl.v.hasted;\r
+       }\r
+\r
+#ifdef QUAKE2RJ\r
+       cmd->lightlevel = cl.light_level;\r
+#endif\r
+}\r
+\r
+\r
+\r
+/*\r
+==============\r
+CL_SendMove\r
+==============\r
+*/\r
+void CL_SendMove (usercmd_t *cmd)\r
+{\r
+       int             i;\r
+       int             bits;\r
+       sizebuf_t       buf;\r
+       byte    data[128];\r
+       \r
+       buf.maxsize = 128;\r
+       buf.cursize = 0;\r
+       buf.data = data;\r
+       \r
+       cl.cmd = *cmd;\r
+\r
+//\r
+// send the movement message\r
+//\r
+       MSG_WriteByte (&buf, clc_frame);\r
+       MSG_WriteByte (&buf, cl.reference_frame);\r
+       MSG_WriteByte (&buf, cl.current_sequence);\r
+\r
+       MSG_WriteByte (&buf, clc_move);\r
+\r
+       MSG_WriteFloat (&buf, cl.mtime[0]);     // so server can get ping times\r
+\r
+       for (i=0 ; i<3 ; i++)\r
+               MSG_WriteAngle (&buf, cl.viewangles[i]);\r
+       \r
+    MSG_WriteShort (&buf, cmd->forwardmove);\r
+    MSG_WriteShort (&buf, cmd->sidemove);\r
+    MSG_WriteShort (&buf, cmd->upmove);\r
+\r
+//\r
+// send button bits\r
+//\r
+       bits = 0;\r
+       \r
+       if ( in_attack.state & 3 )\r
+               bits |= 1;\r
+       in_attack.state &= ~2;\r
+       \r
+       if (in_jump.state & 3)\r
+               bits |= 2;\r
+       in_jump.state &= ~2;\r
+       \r
+       if (in_crouch.state & 1)\r
+               bits |= 4;\r
+\r
+    MSG_WriteByte (&buf, bits);\r
+\r
+    MSG_WriteByte (&buf, in_impulse);\r
+       in_impulse = 0;\r
+\r
+#ifdef QUAKE2RJ\r
+//\r
+// light level\r
+//\r
+       MSG_WriteByte (&buf, cmd->lightlevel);\r
+#endif\r
+\r
+//\r
+// deliver the message\r
+//\r
+       if (cls.demoplayback)\r
+               return;\r
+\r
+//\r
+// allways dump the first two message, because it may contain leftover inputs\r
+// from the last level\r
+//\r
+       if (++cl.movemessages <= 2)\r
+               return;\r
+       \r
+       if (NET_SendUnreliableMessage (cls.netcon, &buf) == -1)\r
+       {\r
+               Con_Printf ("CL_SendMove: lost server connection\n");\r
+               CL_Disconnect ();\r
+       }\r
+}\r
+\r
+void IN_CrouchDown (void)\r
+{\r
+       int state;\r
+\r
+       if (key_dest == key_game)\r
+       {\r
+               state = in_crouch.state;\r
+               KeyDown(&in_crouch);\r
+\r
+//             if (!(state & 1) && (in_crouch.state & 1))\r
+//                     in_impulse = 22;\r
+       }\r
+}\r
+\r
+void IN_CrouchUp (void)\r
+{\r
+       int state;\r
+\r
+       if (key_dest == key_game)\r
+       {\r
+               state = in_crouch.state;\r
+\r
+               KeyUp(&in_crouch);\r
+//             if ((state & 1) && !(in_crouch.state & 1))\r
+//                     in_impulse = 22;\r
+       }\r
+}\r
+\r
+void IN_infoPlaqueUp(void)\r
+{\r
+       if (key_dest == key_game)\r
+       {\r
+               //They want to lower the plaque\r
+               /*if (!infomessage)\r
+               {\r
+                       infomessage=Z_Malloc(1028);//"Objectives:@";\r
+               }*/\r
+               \r
+               info_up = 0;\r
+               KeyUp(&in_infoplaque);\r
+       }\r
+}\r
+\r
+void IN_infoPlaqueDown(void)\r
+{\r
+       if (key_dest == key_game)\r
+       {\r
+               //They want to see the plaque\r
+               /*if (infomessage[0] == '\0')\r
+                       strcpy(infomessage, "Objectives:");*/\r
+\r
+               info_up = 1;\r
+               KeyDown(&in_infoplaque);\r
+       }\r
+}\r
+\r
+/*\r
+============\r
+CL_InitInput\r
+============\r
+*/\r
+void CL_InitInput (void)\r
+{\r
+       Cmd_AddCommand ("+moveup",IN_UpDown);\r
+       Cmd_AddCommand ("-moveup",IN_UpUp);\r
+       Cmd_AddCommand ("+movedown",IN_DownDown);\r
+       Cmd_AddCommand ("-movedown",IN_DownUp);\r
+       Cmd_AddCommand ("+left",IN_LeftDown);\r
+       Cmd_AddCommand ("-left",IN_LeftUp);\r
+       Cmd_AddCommand ("+right",IN_RightDown);\r
+       Cmd_AddCommand ("-right",IN_RightUp);\r
+       Cmd_AddCommand ("+forward",IN_ForwardDown);\r
+       Cmd_AddCommand ("-forward",IN_ForwardUp);\r
+       Cmd_AddCommand ("+back",IN_BackDown);\r
+       Cmd_AddCommand ("-back",IN_BackUp);\r
+       Cmd_AddCommand ("+lookup", IN_LookupDown);\r
+       Cmd_AddCommand ("-lookup", IN_LookupUp);\r
+       Cmd_AddCommand ("+lookdown", IN_LookdownDown);\r
+       Cmd_AddCommand ("-lookdown", IN_LookdownUp);\r
+       Cmd_AddCommand ("+strafe", IN_StrafeDown);\r
+       Cmd_AddCommand ("-strafe", IN_StrafeUp);\r
+       Cmd_AddCommand ("+moveleft", IN_MoveleftDown);\r
+       Cmd_AddCommand ("-moveleft", IN_MoveleftUp);\r
+       Cmd_AddCommand ("+moveright", IN_MoverightDown);\r
+       Cmd_AddCommand ("-moveright", IN_MoverightUp);\r
+       Cmd_AddCommand ("+speed", IN_SpeedDown);\r
+       Cmd_AddCommand ("-speed", IN_SpeedUp);\r
+       Cmd_AddCommand ("+attack", IN_AttackDown);\r
+       Cmd_AddCommand ("-attack", IN_AttackUp);\r
+       Cmd_AddCommand ("+use", IN_UseDown);\r
+       Cmd_AddCommand ("-use", IN_UseUp);\r
+       Cmd_AddCommand ("+jump", IN_JumpDown);\r
+       Cmd_AddCommand ("-jump", IN_JumpUp);\r
+       Cmd_AddCommand ("impulse", IN_Impulse);\r
+       Cmd_AddCommand ("+klook", IN_KLookDown);\r
+       Cmd_AddCommand ("-klook", IN_KLookUp);\r
+       Cmd_AddCommand ("+mlook", IN_MLookDown);\r
+       Cmd_AddCommand ("-mlook", IN_MLookUp);\r
+\r
+       Cmd_AddCommand ("+crouch", IN_CrouchDown);\r
+       Cmd_AddCommand ("-crouch", IN_CrouchUp);\r
+\r
+       Cmd_AddCommand ("+infoplaque", IN_infoPlaqueDown);\r
+       Cmd_AddCommand ("-infoplaque", IN_infoPlaqueUp);\r
+}\r
+\r
+\r
+/*\r
+============\r
+CL_ClearStates\r
+============\r
+*/\r
+void CL_ClearStates (void)\r
+{\r
+\r
+       in_mlook.state = 0;\r
+       in_klook.state = 0;\r
+       in_left.state = 0;\r
+       in_right.state = 0;\r
+       in_forward.state = 0;\r
+       in_back.state = 0;\r
+       in_lookup.state = 0;\r
+       in_lookdown.state = 0;\r
+       in_moveleft.state = 0;\r
+       in_moveright.state = 0;\r
+       in_strafe.state = 0;\r
+       in_speed.state = 0;\r
+       in_use.state = 0;\r
+       in_jump.state = 0;\r
+       in_attack.state = 0;\r
+       in_up.state = 0;\r
+       in_down.state = 0;\r
+       in_crouch.state = 0;\r
+}\r
diff --git a/H2MP/code/CL_MAIN.C b/H2MP/code/CL_MAIN.C
new file mode 100644 (file)
index 0000000..a0e602d
--- /dev/null
@@ -0,0 +1,1063 @@
+// cl_main.c  -- client main loop\r
+\r
+/*\r
+ * $Header: /H2 Mission Pack/CL_MAIN.C 12    3/16/98 5:32p Jweier $\r
+ */\r
+\r
+#include "quakedef.h"\r
+\r
+#include <windows.h>\r
+\r
+// we need to declare some mouse variables here, because the menu system\r
+// references them even when on a unix system.\r
+\r
+// these two are not intended to be set directly\r
+cvar_t cl_name = {"_cl_name", "player", true};\r
+cvar_t cl_color = {"_cl_color", "0", true};\r
+cvar_t cl_playerclass = {"_cl_playerclass", "5", true};\r
+\r
+cvar_t cl_shownet = {"cl_shownet","0"};        // can be 0, 1, or 2\r
+cvar_t cl_nolerp = {"cl_nolerp","0"};\r
+\r
+cvar_t lookspring = {"lookspring","0", true};\r
+cvar_t lookstrafe = {"lookstrafe","0", true};\r
+cvar_t sensitivity = {"sensitivity","3", true};\r
+static float save_sensitivity;\r
+\r
+cvar_t m_pitch = {"m_pitch","0.022", true};\r
+cvar_t m_yaw = {"m_yaw","0.022", true};\r
+cvar_t m_forward = {"m_forward","1", true};\r
+cvar_t m_side = {"m_side","0.8", true};\r
+\r
+\r
+client_static_t        cls;\r
+client_state_t cl;\r
+// FIXME: put these on hunk?\r
+efrag_t                        cl_efrags[MAX_EFRAGS];\r
+entity_t               cl_entities[MAX_EDICTS];\r
+entity_t               cl_static_entities[MAX_STATIC_ENTITIES];\r
+lightstyle_t   cl_lightstyle[MAX_LIGHTSTYLES];\r
+dlight_t               cl_dlights[MAX_DLIGHTS];\r
+\r
+int                            cl_numvisedicts;\r
+entity_t               *cl_visedicts[MAX_VISEDICTS];\r
+/*\r
+=====================\r
+CL_ClearState\r
+\r
+=====================\r
+*/\r
+void CL_ClearState (void)\r
+{\r
+       int                     i;\r
+\r
+       if (!sv.active)\r
+               Host_ClearMemory ();\r
+\r
+// wipe the entire cl structure\r
+       memset (&cl, 0, sizeof(cl));\r
+\r
+       SZ_Clear (&cls.message);\r
+\r
+// clear other arrays  \r
+       memset (cl_efrags, 0, sizeof(cl_efrags));\r
+       memset (cl_entities, 0, sizeof(cl_entities));\r
+       memset (cl_dlights, 0, sizeof(cl_dlights));\r
+       memset (cl_lightstyle, 0, sizeof(cl_lightstyle));\r
+       CL_ClearTEnts();\r
+       CL_ClearEffects();\r
+\r
+//\r
+// allocate the efrags and chain together into a free list\r
+//\r
+       cl.free_efrags = cl_efrags;\r
+       for (i=0 ; i<MAX_EFRAGS-1 ; i++)\r
+               cl.free_efrags[i].entnext = &cl.free_efrags[i+1];\r
+       cl.free_efrags[i].entnext = NULL;\r
+\r
+       cl.current_frame = cl.current_sequence = 99;\r
+       cl.reference_frame = cl.last_frame = cl.last_sequence = 199;\r
+       cl.need_build = 2;\r
+\r
+       plaquemessage = "";\r
+\r
+       SB_InvReset();\r
+}\r
+\r
+void CL_RemoveGIPFiles (char *path)\r
+{\r
+       char    name[MAX_OSPATH],tempdir[MAX_OSPATH];\r
+       int i;\r
+       HANDLE handle;\r
+       WIN32_FIND_DATA filedata;\r
+       BOOL retval;\r
+\r
+       if (path)\r
+       {\r
+               sprintf(tempdir,"%s\\",path);\r
+       }\r
+       else\r
+       {\r
+               i = GetTempPath(sizeof(tempdir),tempdir);\r
+               if (!i) \r
+               {\r
+                       sprintf(tempdir,"%s\\",com_gamedir);\r
+               }\r
+       }\r
+\r
+       sprintf (name, "%s*.gip", tempdir);\r
+\r
+       handle = FindFirstFile(name,&filedata);\r
+       retval = TRUE;\r
+\r
+       while (handle != INVALID_HANDLE_VALUE && retval)\r
+       {\r
+               sprintf(name,"%s%s", tempdir,filedata.cFileName);\r
+               DeleteFile(name);\r
+\r
+               retval = FindNextFile(handle,&filedata);\r
+       }\r
+\r
+       if (handle != INVALID_HANDLE_VALUE)\r
+               FindClose(handle);\r
+}\r
+\r
+qboolean CL_CopyFiles(char *source, char *pat, char *dest)\r
+{\r
+       char    name[MAX_OSPATH],tempdir[MAX_OSPATH];\r
+       HANDLE handle;\r
+       WIN32_FIND_DATA filedata;\r
+       BOOL retval,error;\r
+\r
+       handle = FindFirstFile(pat,&filedata);\r
+       retval = TRUE;\r
+       error = false;\r
+\r
+       while (handle != INVALID_HANDLE_VALUE && retval)\r
+       {\r
+               sprintf(name,"%s%s", source, filedata.cFileName);\r
+               sprintf(tempdir,"%s%s", dest, filedata.cFileName);\r
+               if (!CopyFile(name,tempdir,FALSE))\r
+                       error = true;\r
+\r
+               retval = FindNextFile(handle,&filedata);\r
+       }\r
+\r
+       if (handle != INVALID_HANDLE_VALUE)\r
+               FindClose(handle);\r
+\r
+       return error;\r
+}\r
+\r
+/*\r
+=====================\r
+CL_Disconnect\r
+\r
+Sends a disconnect message to the server\r
+This is also called on Host_Error, so it shouldn't cause any errors\r
+=====================\r
+*/\r
+void CL_Disconnect (void)\r
+{\r
+       R_ClearParticles ();    //jfm: need to clear parts because some now check world\r
+       S_StopAllSounds (true);// stop sounds (especially looping!)\r
+       loading_stage = 0;\r
+\r
+// bring the console down and fade the colors back to normal\r
+//     SCR_BringDownConsole ();\r
+\r
+// if running a local server, shut it down\r
+       if (cls.demoplayback)\r
+               CL_StopPlayback ();\r
+       else if (cls.state == ca_connected)\r
+       {\r
+               if (cls.demorecording)\r
+                       CL_Stop_f ();\r
+\r
+               Con_DPrintf ("Sending clc_disconnect\n");\r
+               SZ_Clear (&cls.message);\r
+               MSG_WriteByte (&cls.message, clc_disconnect);\r
+               NET_SendUnreliableMessage (cls.netcon, &cls.message);\r
+               SZ_Clear (&cls.message);\r
+               NET_Close (cls.netcon);\r
+\r
+               cls.state = ca_disconnected;\r
+               if (sv.active)\r
+                       Host_ShutdownServer(false);\r
+\r
+               CL_RemoveGIPFiles(NULL);\r
+       }\r
+\r
+       cls.demoplayback = cls.timedemo = false;\r
+       cls.signon = 0;\r
+}\r
+\r
+void CL_Disconnect_f (void)\r
+{\r
+       CL_Disconnect ();\r
+       if (sv.active)\r
+               Host_ShutdownServer (false);\r
+}\r
+\r
+\r
+\r
+\r
+/*\r
+=====================\r
+CL_EstablishConnection\r
+\r
+Host should be either "local" or a net address to be passed on\r
+=====================\r
+*/\r
+void CL_EstablishConnection (char *host)\r
+{\r
+       if (cls.state == ca_dedicated)\r
+               return;\r
+\r
+       if (cls.demoplayback)\r
+               return;\r
+\r
+       CL_Disconnect ();\r
+\r
+       cls.netcon = NET_Connect (host);\r
+       if (!cls.netcon)\r
+               Host_Error ("CL_Connect: connect failed\n");\r
+       Con_DPrintf ("CL_EstablishConnection: connected to %s\n", host);\r
+       \r
+       cls.demonum = -1;                       // not in the demo loop now\r
+       cls.state = ca_connected;\r
+       cls.signon = 0;                         // need all the signon messages before playing\r
+}\r
+\r
+/*\r
+=====================\r
+CL_SignonReply\r
+\r
+An svc_signonnum has been received, perform a client side setup\r
+=====================\r
+*/\r
+void CL_SignonReply (void)\r
+{\r
+       char    str[8192];\r
+\r
+Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);\r
+\r
+       switch (cls.signon)\r
+       {\r
+       case 1:\r
+               MSG_WriteByte (&cls.message, clc_stringcmd);\r
+               MSG_WriteString (&cls.message, "prespawn");\r
+               break;\r
+               \r
+       case 2:         \r
+               MSG_WriteByte (&cls.message, clc_stringcmd);\r
+               MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name.string));\r
+       \r
+               MSG_WriteByte (&cls.message, clc_stringcmd);\r
+               MSG_WriteString (&cls.message, va("playerclass %i\n", (int)cl_playerclass.value));\r
+\r
+               MSG_WriteByte (&cls.message, clc_stringcmd);\r
+               MSG_WriteString (&cls.message, va("color %i %i\n", ((int)cl_color.value)>>4, ((int)cl_color.value)&15));\r
+\r
+               MSG_WriteByte (&cls.message, clc_stringcmd);\r
+               sprintf (str, "spawn %s", cls.spawnparms);\r
+               MSG_WriteString (&cls.message, str);\r
+               break;\r
+               \r
+       case 3: \r
+               MSG_WriteByte (&cls.message, clc_stringcmd);\r
+               MSG_WriteString (&cls.message, "begin");\r
+               Cache_Report ();                // print remaining memory\r
+               break;\r
+               \r
+       case 4:\r
+               SCR_EndLoadingPlaque ();                // allow normal screen updates\r
+               break;\r
+       }\r
+}\r
+\r
+/*\r
+=====================\r
+CL_NextDemo\r
+\r
+Called to play the next demo in the demo loop\r
+=====================\r
+*/\r
+void CL_NextDemo (void)\r
+{\r
+       char    str[1024];\r
+\r
+       if (cls.demonum == -1)\r
+               return;         // don't play demos\r
+\r
+       SCR_BeginLoadingPlaque ();\r
+\r
+       if (!cls.demos[cls.demonum][0] || cls.demonum == MAX_DEMOS)\r
+       {\r
+               cls.demonum = 0;\r
+               if (!cls.demos[cls.demonum][0])\r
+               {\r
+                       Con_Printf ("No demos listed with startdemos\n");\r
+                       cls.demonum = -1;\r
+                       return;\r
+               }\r
+       }\r
+\r
+       sprintf (str,"playdemo %s\n", cls.demos[cls.demonum]);\r
+       Cbuf_InsertText (str);\r
+       cls.demonum++;\r
+}\r
+\r
+/*\r
+==============\r
+CL_PrintEntities_f\r
+==============\r
+*/\r
+void CL_PrintEntities_f (void)\r
+{\r
+       entity_t        *ent;\r
+       int                     i;\r
+       \r
+       for (i=0,ent=cl_entities ; i<cl.num_entities ; i++,ent++)\r
+       {\r
+               Con_Printf ("%3i:",i);\r
+               if (!ent->model)\r
+               {\r
+                       Con_Printf ("EMPTY\n");\r
+                       continue;\r
+               }\r
+               Con_Printf ("%s:%2i  (%5.1f,%5.1f,%5.1f) [%5.1f %5.1f %5.1f]\n"\r
+               ,ent->model->name,ent->frame, ent->origin[0], ent->origin[1], ent->origin[2], ent->angles[0], ent->angles[1], ent->angles[2]);\r
+       }\r
+}\r
+\r
+\r
+/*\r
+===============\r
+SetPal\r
+\r
+Debugging tool, just flashes the screen\r
+===============\r
+*/\r
+void SetPal (int i)\r
+{\r
+#if 0\r
+       static int old;\r
+       byte    pal[768];\r
+       int             c;\r
+       \r
+       if (i == old)\r
+               return;\r
+       old = i;\r
+\r
+       if (i==0)\r
+               VID_SetPalette (host_basepal);\r
+       else if (i==1)\r
+       {\r
+               for (c=0 ; c<768 ; c+=3)\r
+               {\r
+                       pal[c] = 0;\r
+                       pal[c+1] = 255;\r
+                       pal[c+2] = 0;\r
+               }\r
+               VID_SetPalette (pal);\r
+       }\r
+       else\r
+       {\r
+               for (c=0 ; c<768 ; c+=3)\r
+               {\r
+                       pal[c] = 0;\r
+                       pal[c+1] = 0;\r
+                       pal[c+2] = 255;\r
+               }\r
+               VID_SetPalette (pal);\r
+       }\r
+#endif\r
+}\r
+\r
+/*\r
+===============\r
+CL_AllocDlight\r
+\r
+===============\r
+*/\r
+dlight_t *CL_AllocDlight (int key)\r
+{\r
+       int             i;\r
+       dlight_t        *dl;\r
+\r
+// first look for an exact key match\r
+       if (key)\r
+       {\r
+               dl = cl_dlights;\r
+               for (i=0 ; i<MAX_DLIGHTS ; i++, dl++)\r
+               {\r
+                       if (dl->key == key)\r
+                       {\r
+                               memset (dl, 0, sizeof(*dl));\r
+                               dl->key = key;\r
+                               return dl;\r
+                       }\r
+               }\r
+       }\r
+\r
+// then look for anything else\r
+       dl = cl_dlights;\r
+       for (i=0 ; i<MAX_DLIGHTS ; i++, dl++)\r
+       {\r
+               if (dl->die < cl.time)\r
+               {\r
+                       memset (dl, 0, sizeof(*dl));\r
+                       dl->key = key;\r
+                       return dl;\r
+               }\r
+       }\r
+\r
+       dl = &cl_dlights[0];\r
+       memset (dl, 0, sizeof(*dl));\r
+       dl->key = key;\r
+       return dl;\r
+}\r
+\r
+\r
+/*\r
+===============\r
+CL_DecayLights\r
+\r
+===============\r
+*/\r
+void CL_DecayLights (void)\r
+{\r
+       int                     i;\r
+       dlight_t        *dl;\r
+       float           time;\r
+       \r
+       time = cl.time - cl.oldtime;\r
+\r
+       dl = cl_dlights;\r
+       for (i=0 ; i<MAX_DLIGHTS ; i++, dl++)\r
+       {\r
+               if (dl->die < cl.time || !dl->radius)\r
+                       continue;\r
+               \r
+               if (dl->radius > 0)\r
+               {\r
+                       dl->radius -= time*dl->decay;\r
+                       if (dl->radius < 0)\r
+                               dl->radius = 0;\r
+               }\r
+               else\r
+               {\r
+                       dl->radius += time*dl->decay;\r
+                       if (dl->radius > 0)\r
+                               dl->radius = 0;\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*\r
+===============\r
+CL_LerpPoint\r
+\r
+Determines the fraction between the last two messages that the objects\r
+should be put at.\r
+===============\r
+*/\r
+float  CL_LerpPoint (void)\r
+{\r
+       float   f, frac;\r
+\r
+       f = cl.mtime[0] - cl.mtime[1];\r
+       \r
+       if (!f || cl_nolerp.value || cls.timedemo || sv.active)\r
+       {\r
+               cl.time = cl.mtime[0];\r
+               return 1;\r
+       }\r
+               \r
+       if (f > 0.1)\r
+       {       // dropped packet, or start of demo\r
+               cl.mtime[1] = cl.mtime[0] - 0.1;\r
+               f = 0.1;\r
+       }\r
+       frac = (cl.time - cl.mtime[1]) / f;\r
+//Con_Printf ("frac: %f\n",frac);\r
+       if (frac < 0)\r
+       {\r
+               if (frac < -0.01)\r
+               {\r
+SetPal(1);\r
+                       cl.time = cl.mtime[1];\r
+//                             Con_Printf ("low frac\n");\r
+               }\r
+               frac = 0;\r
+       }\r
+       else if (frac > 1)\r
+       {\r
+               if (frac > 1.01)\r
+               {\r
+SetPal(2);\r
+                       cl.time = cl.mtime[0];\r
+//                             Con_Printf ("high frac\n");\r
+               }\r
+               frac = 1;\r
+       }\r
+       else\r
+               SetPal(0);\r
+               \r
+       return frac;\r
+}\r
+\r
+\r
+/*\r
+===============\r
+CL_RelinkEntities\r
+===============\r
+*/\r
+void CL_RelinkEntities (void)\r
+{\r
+       entity_t        *ent;\r
+       int                     i, j;\r
+       float           frac, f, d;\r
+       vec3_t          delta;\r
+       //float         bobjrotate;\r
+       vec3_t          oldorg;\r
+       dlight_t        *dl;\r
+       int c;\r
+       static int lastc = 0;\r
+\r
+       c = 0;\r
+// determine partial update time       \r
+       frac = CL_LerpPoint ();\r
+\r
+       cl_numvisedicts = 0;\r
+\r
+//\r
+// interpolate player info\r
+//\r
+       for (i=0 ; i<3 ; i++)\r
+               cl.velocity[i] = cl.mvelocity[1][i] + \r
+                       frac * (cl.mvelocity[0][i] - cl.mvelocity[1][i]);\r
+\r
+       if (cls.demoplayback && !intro_playing)\r
+       {\r
+       // interpolate the angles       \r
+               for (j=0 ; j<3 ; j++)\r
+               {\r
+                       d = cl.mviewangles[0][j] - cl.mviewangles[1][j];\r
+                       if (d > 180)\r
+                               d -= 360;\r
+                       else if (d < -180)\r
+                               d += 360;\r
+                       cl.viewangles[j] = cl.mviewangles[1][j] + frac*d;\r
+               }\r
+       }\r
+       \r
+       //bobjrotate = anglemod(100*(cl.time+ent->origin[0]+ent->origin[1]));\r
+       \r
+// start on the entity after the world\r
+       for (i=1,ent=cl_entities+1 ; i<cl.num_entities ; i++,ent++)\r
+       {\r
+               if (!ent->model)\r
+               {       // empty slot\r
+                       if (ent->forcelink)\r
+                               R_RemoveEfrags (ent);   // just became empty\r
+                       continue;\r
+               }\r
+\r
+// if the object wasn't included in the last packet, remove it\r
+#if RJNET\r
+               if (ent->msgtime != cl.mtime[0] && !(ent->baseline.flags & BE_ON))\r
+#else\r
+               if (ent->msgtime != cl.mtime[0])\r
+#endif\r
+               {\r
+                       ent->model = NULL;\r
+                       continue;\r
+               }\r
+\r
+               VectorCopy (ent->origin, oldorg);\r
+\r
+#if RJNET\r
+               if (ent->forcelink || ent->msgtime != cl.mtime[0])\r
+#else\r
+               if (ent->forcelink)\r
+#endif\r
+               {       // the entity was not updated in the last message\r
+                       // so move to the final spot\r
+                       VectorCopy (ent->msg_origins[0], ent->origin);\r
+                       VectorCopy (ent->msg_angles[0], ent->angles);\r
+               }\r
+               else\r
+               {       // if the delta is large, assume a teleport and don't lerp\r
+                       f = frac;\r
+                       for (j=0 ; j<3 ; j++)\r
+                       {\r
+                               delta[j] = ent->msg_origins[0][j] - ent->msg_origins[1][j];\r
+\r
+                               if (delta[j] > 100 || delta[j] < -100)\r
+                                       f = 1;          // assume a teleportation, not a motion\r
+                       }\r
+\r
+               // interpolate the origin and angles\r
+                       for (j=0 ; j<3 ; j++)\r
+                       {\r
+                               ent->origin[j] = ent->msg_origins[1][j] + f*delta[j];\r
+\r
+                               d = ent->msg_angles[0][j] - ent->msg_angles[1][j];\r
+                               if (d > 180)\r
+                                       d -= 360;\r
+                               else if (d < -180)\r
+                                       d += 360;\r
+                               ent->angles[j] = ent->msg_angles[1][j] + f*d;\r
+                       }\r
+                       \r
+               }\r
+\r
+// rotate binary objects locally\r
+// BG: Moved to r_alias.c / gl_rmain.c\r
+               //if(ent->model->flags&EF_ROTATE)\r
+               //{\r
+               //      ent->angles[1] = anglemod(ent->origin[0]+ent->origin[1]\r
+               //              +(100*cl.time));\r
+               //}\r
+\r
+\r
+               c++;\r
+//             if (ent->effects & EF_BRIGHTFIELD);\r
+//                     R_EntityParticles (ent);\r
+#ifdef QUAKE2RJ\r
+               if (ent->effects & EF_DARKFIELD)\r
+                       R_DarkFieldParticles (ent);\r
+#endif\r
+               if (ent->effects & EF_MUZZLEFLASH)\r
+               {\r
+                       vec3_t          fv, rv, uv;\r
+\r
+                       if (cl_prettylights.value)\r
+                       {\r
+                               dl = CL_AllocDlight (i);\r
+                               VectorCopy (ent->origin,  dl->origin);\r
+                               dl->origin[2] += 16;\r
+                               AngleVectors (ent->angles, fv, rv, uv);\r
+                                \r
+                               VectorMA (dl->origin, 18, fv, dl->origin);\r
+                               dl->radius = 200 + (rand()&31);\r
+                               dl->minlight = 32;\r
+                               dl->die = cl.time + 0.1;\r
+                       }\r
+               }\r
+               if (ent->effects & EF_BRIGHTLIGHT)\r
+               {                       \r
+                       if (cl_prettylights.value)\r
+                       {\r
+                               dl = CL_AllocDlight (i);\r
+                               VectorCopy (ent->origin,  dl->origin);\r
+                               dl->origin[2] += 16;\r
+                               dl->radius = 400 + (rand()&31);\r
+                               dl->die = cl.time + 0.001;\r
+                       }\r
+               }\r
+               if (ent->effects & EF_DIMLIGHT)\r
+               {                       \r
+                       if (cl_prettylights.value)\r
+                       {\r
+                               dl = CL_AllocDlight (i);\r
+                               VectorCopy (ent->origin,  dl->origin);\r
+                               dl->radius = 200 + (rand()&31);\r
+                               dl->die = cl.time + 0.001;\r
+                       }\r
+               }\r
+#ifdef QUAKE2RJ\r
+               if (ent->effects & EF_DARKLIGHT)\r
+               {                       \r
+                       if (cl_prettylights.value)\r
+                       {\r
+                               dl = CL_AllocDlight (i);\r
+                               VectorCopy (ent->origin,  dl->origin);\r
+                               dl->radius = 200.0 + (rand()&31);\r
+                               dl->die = cl.time + 0.001;\r
+                               dl->dark = true;\r
+                       }\r
+               }\r
+               if (ent->effects & EF_LIGHT)\r
+               {                       \r
+                       if (cl_prettylights.value)\r
+                       {\r
+                               dl = CL_AllocDlight (i);\r
+                               VectorCopy (ent->origin,  dl->origin);\r
+                               dl->radius = 200;\r
+                               dl->die = cl.time + 0.001;\r
+                       }\r
+               }\r
+#endif\r
+\r
+               if (ent->model->flags & EF_GIB)\r
+                       R_RocketTrail (oldorg, ent->origin, 2);\r
+               else if (ent->model->flags & EF_ZOMGIB)\r
+                       R_RocketTrail (oldorg, ent->origin, 4);\r
+               else if (ent->model->flags & EF_BLOODSHOT)\r
+                       R_RocketTrail (oldorg, ent->origin, 17);\r
+               else if (ent->model->flags & EF_TRACER)\r
+                       R_RocketTrail (oldorg, ent->origin, 3);\r
+               else if (ent->model->flags & EF_TRACER2)\r
+                       R_RocketTrail (oldorg, ent->origin, 5);\r
+               else if (ent->model->flags & EF_ROCKET)\r
+               {\r
+                       R_RocketTrail (oldorg, ent->origin, 0);\r
+/*                     dl = CL_AllocDlight (i);\r
+                       VectorCopy (ent->origin, dl->origin);\r
+                       dl->radius = 200;\r
+                       dl->die = cl.time + 0.01;*/\r
+               }\r
+               else if (ent->model->flags & EF_FIREBALL)\r
+               {\r
+                       R_RocketTrail (oldorg, ent->origin, rt_fireball);\r
+                       if (cl_prettylights.value)\r
+                       {\r
+                               dl = CL_AllocDlight (i);\r
+                               VectorCopy (ent->origin, dl->origin);\r
+                               dl->radius = 120 - (rand() % 20);\r
+                               dl->die = cl.time + 0.01;\r
+                       }\r
+               }\r
+               else if (ent->model->flags & EF_ACIDBALL)\r
+               {\r
+                       R_RocketTrail (oldorg, ent->origin, rt_acidball);\r
+                       if (cl_prettylights.value)\r
+                       {\r
+                               dl = CL_AllocDlight (i);\r
+                               VectorCopy (ent->origin, dl->origin);\r
+                               dl->radius = 120 - (rand() % 20);\r
+                               dl->die = cl.time + 0.01;\r
+                       }\r
+               }\r
+               else if (ent->model->flags & EF_ICE)\r
+               {\r
+                       R_RocketTrail (oldorg, ent->origin, rt_ice);\r
+               }\r
+               else if (ent->model->flags & EF_SPIT)\r
+               {\r
+                       R_RocketTrail (oldorg, ent->origin, rt_spit);\r
+                       if (cl_prettylights.value)\r
+                       {\r
+                               dl = CL_AllocDlight (i);\r
+                               VectorCopy (ent->origin, dl->origin);\r
+                               dl->radius = -120 - (rand() % 20);\r
+                               dl->die = cl.time + 0.05;\r
+                       }\r
+               }\r
+               else if (ent->model->flags & EF_SPELL)\r
+               {\r
+                       R_RocketTrail (oldorg, ent->origin, rt_spell);\r
+               }\r
+               else if (ent->model->flags & EF_GRENADE)\r
+                       R_RocketTrail (oldorg, ent->origin, 1);\r
+               else if (ent->model->flags & EF_TRACER3)\r
+                       R_RocketTrail (oldorg, ent->origin, 6);\r
+               else if (ent->model->flags & EF_VORP_MISSILE)\r
+               {\r
+                       R_RocketTrail (oldorg, ent->origin, rt_vorpal);\r
+               }\r
+               else if (ent->model->flags & EF_SET_STAFF)\r
+               {\r
+                       R_RocketTrail (oldorg, ent->origin,rt_setstaff);\r
+               }\r
+               else if (ent->model->flags & EF_MAGICMISSILE)\r
+               {\r
+                       if ((rand() & 3) < 1)\r
+                               R_RocketTrail (oldorg, ent->origin, rt_magicmissile);\r
+               }\r
+               else if (ent->model->flags & EF_BONESHARD)\r
+                       R_RocketTrail (oldorg, ent->origin, rt_boneshard);\r
+               else if (ent->model->flags & EF_SCARAB)\r
+                       R_RocketTrail (oldorg, ent->origin, rt_scarab);\r
+\r
+               ent->forcelink = false;\r
+\r
+               if (i == cl.viewentity && !chase_active.value)\r
+                       continue;\r
+\r
+#ifdef QUAKE2RJ\r
+               if ( ent->effects & EF_NODRAW )\r
+                       continue;\r
+#endif\r
+               if (cl_numvisedicts < MAX_VISEDICTS)\r
+               {\r
+                       cl_visedicts[cl_numvisedicts] = ent;\r
+                       cl_numvisedicts++;\r
+               }\r
+       }\r
+\r
+/*     if (c != lastc)\r
+       {\r
+               Con_Printf("Number of entities: %d\n",c);\r
+               lastc = c;\r
+       }*/\r
+}\r
+\r
+\r
+/*\r
+===============\r
+CL_ReadFromServer\r
+\r
+Read all incoming data from the server\r
+===============\r
+*/\r
+int CL_ReadFromServer (void)\r
+{\r
+       int             ret;\r
+\r
+       cl.oldtime = cl.time;\r
+       cl.time += host_frametime;\r
+       \r
+       do\r
+       {\r
+               ret = CL_GetMessage ();\r
+               if (ret == -1)\r
+                       Host_Error ("CL_ReadFromServer: lost server connection");\r
+               if (!ret)\r
+                       break;\r
+               \r
+               cl.last_received_message = realtime;\r
+               CL_ParseServerMessage ();\r
+       } while (ret && cls.state == ca_connected);\r
+       \r
+       if (cl_shownet.value)\r
+               Con_Printf ("\n");\r
+\r
+       CL_RelinkEntities ();\r
+       CL_UpdateTEnts ();\r
+\r
+//\r
+// bring the links up to date\r
+//\r
+       return 0;\r
+}\r
+\r
+/*\r
+=================\r
+CL_SendCmd\r
+=================\r
+*/\r
+void CL_SendCmd (void)\r
+{\r
+       usercmd_t               cmd;\r
+\r
+       if (cls.state != ca_connected)\r
+               return;\r
+\r
+       if (cls.signon == SIGNONS)\r
+       {\r
+       // get basic movement from keyboard\r
+               CL_BaseMove (&cmd);\r
+       \r
+       // allow mice or other external controllers to add to the move\r
+               IN_Move (&cmd);\r
+       \r
+       // send the unreliable message\r
+               CL_SendMove (&cmd);\r
+       \r
+       }\r
+\r
+       if (cls.demoplayback)\r
+       {\r
+               SZ_Clear (&cls.message);\r
+               return;\r
+       }\r
+       \r
+// send the reliable message\r
+       if (!cls.message.cursize)\r
+               return;         // no message at all\r
+       \r
+       if (!NET_CanSendMessage (cls.netcon))\r
+       {\r
+               Con_DPrintf ("CL_WriteToServer: can't send\n");\r
+               return;\r
+       }\r
+\r
+       if (NET_SendMessage (cls.netcon, &cls.message) == -1)\r
+               Host_Error ("CL_WriteToServer: lost server connection");\r
+\r
+       SZ_Clear (&cls.message);\r
+}\r
+\r
+void CL_Sensitivity_save_f (void)\r
+{\r
+       if (Cmd_Argc() != 2)\r
+       {\r
+               Con_Printf ("sensitivity_save <save/restore>\n");\r
+               return;\r
+       }\r
+\r
+       if (strcmpi(Cmd_Argv(1),"save") == 0)\r
+               save_sensitivity = sensitivity.value;\r
+       else if (strcmpi(Cmd_Argv(1),"restore") == 0)\r
+               Cvar_SetValue ("sensitivity", save_sensitivity);\r
+}\r
+/*\r
+=================\r
+CL_Init\r
+=================\r
+*/\r
+void CL_Init (void)\r
+{      \r
+       SZ_Alloc (&cls.message, 1024);\r
+\r
+       CL_InitInput ();\r
+       CL_InitTEnts ();\r
+       CL_InitEffects();\r
+\r
+       \r
+//\r
+// register our commands\r
+//\r
+       Cvar_RegisterVariable (&cl_name);\r
+       Cvar_RegisterVariable (&cl_color);\r
+       Cvar_RegisterVariable (&cl_playerclass);\r
+       Cvar_RegisterVariable (&cl_upspeed);\r
+       Cvar_RegisterVariable (&cl_forwardspeed);\r
+       Cvar_RegisterVariable (&cl_backspeed);\r
+       Cvar_RegisterVariable (&cl_sidespeed);\r
+       Cvar_RegisterVariable (&cl_movespeedkey);\r
+       Cvar_RegisterVariable (&cl_yawspeed);\r
+       Cvar_RegisterVariable (&cl_pitchspeed);\r
+       Cvar_RegisterVariable (&cl_anglespeedkey);\r
+       Cvar_RegisterVariable (&cl_shownet);\r
+       Cvar_RegisterVariable (&cl_nolerp);\r
+       Cvar_RegisterVariable (&lookspring);\r
+       Cvar_RegisterVariable (&lookstrafe);\r
+       Cvar_RegisterVariable (&sensitivity);\r
+\r
+       Cvar_RegisterVariable (&m_pitch);\r
+       Cvar_RegisterVariable (&m_yaw);\r
+       Cvar_RegisterVariable (&m_forward);\r
+       Cvar_RegisterVariable (&m_side);\r
+       Cvar_RegisterVariable (&cl_prettylights);\r
+\r
+//     Cvar_RegisterVariable (&cl_autofire);\r
+       \r
+       Cmd_AddCommand ("entities", CL_PrintEntities_f);\r
+       Cmd_AddCommand ("disconnect", CL_Disconnect_f);\r
+       Cmd_AddCommand ("record", CL_Record_f);\r
+       Cmd_AddCommand ("stop", CL_Stop_f);\r
+       Cmd_AddCommand ("playdemo", CL_PlayDemo_f);\r
+       Cmd_AddCommand ("timedemo", CL_TimeDemo_f);\r
+       Cmd_AddCommand ("sensitivity_save", CL_Sensitivity_save_f);\r
+}\r
+\r
+/*\r
+ * $Log: /H2 Mission Pack/CL_MAIN.C $\r
+ * \r
+ * 12    3/16/98 5:32p Jweier\r
+ * \r
+ * 11    3/16/98 12:02a Jweier\r
+ * \r
+ * 10    3/13/98 7:30p Jweier\r
+ * \r
+ * 9     3/12/98 6:30p Mgummelt\r
+ * \r
+ * 8     3/09/98 12:30p Mgummelt\r
+ * \r
+ * 7     3/06/98 4:55p Mgummelt\r
+ * \r
+ * 6     3/02/98 11:04p Jmonroe\r
+ * changed start sound back to byte, added stopsound, put in a hack fix\r
+ * for touchtriggers area getting removed\r
+ * \r
+ * 5     3/02/98 3:52p Jweier\r
+ * \r
+ * 34    10/03/97 4:07p Rjohnson\r
+ * Copy file updates\r
+ * \r
+ * 33    9/25/97 11:56p Rjohnson\r
+ * CL_CopyFiles() not returns error if wasn't successful\r
+ * \r
+ * 32    9/19/97 8:47a Rlove\r
+ * \r
+ * 31    9/18/97 2:34p Rlove\r
+ * \r
+ * 30    9/17/97 1:27p Rlove\r
+ * \r
+ * 29    9/17/97 11:11a Rlove\r
+ * \r
+ * 28    9/15/97 11:15a Rjohnson\r
+ * Updates\r
+ * \r
+ * 27    9/04/97 4:44p Rjohnson\r
+ * Updates\r
+ * \r
+ * 26    9/01/97 4:29a Rjohnson\r
+ * Save mouse sensitivity\r
+ * \r
+ * 25    8/31/97 9:27p Rjohnson\r
+ * GL Updates\r
+ * \r
+ * 24    8/29/97 2:49p Rjohnson\r
+ * Network updates\r
+ * \r
+ * 23    8/26/97 8:17a Rjohnson\r
+ * Just a few changes\r
+ * \r
+ * 22    8/14/97 2:37p Rjohnson\r
+ * Fix for save games\r
+ * \r
+ * 21    7/21/97 9:25p Rjohnson\r
+ * Reduces the amount of memory used by RJNET\r
+ * \r
+ * 20    7/15/97 4:09p Rjohnson\r
+ * New particle effect\r
+ * \r
+ * 19    6/12/97 9:02a Rlove\r
+ * New vorpal particle effect\r
+ * \r
+ * 18    5/23/97 3:04p Rjohnson\r
+ * Included some more quake2 things\r
+ * \r
+ * 17    5/20/97 11:18a Bgokey\r
+ * \r
+ * 16    5/19/97 2:54p Rjohnson\r
+ * Added new client effects\r
+ * \r
+ * 15    5/10/97 1:08p Bgokey\r
+ * \r
+ * 14    4/30/97 11:20p Bgokey\r
+ * \r
+ * 13    4/20/97 5:05p Rjohnson\r
+ * Networking Update\r
+ * \r
+ * 12    4/16/97 12:16p Rjohnson\r
+ * Made the GIP files be stored in the temp directory\r
+ * \r
+ * 11    4/16/97 12:02p Bgokey\r
+ * \r
+ * 10    4/09/97 2:34p Rjohnson\r
+ * Revised inventory\r
+ * \r
+ * 9     3/31/97 7:24p Rjohnson\r
+ * Added a playerclass field and made sure the server/clients handle it\r
+ * properly\r
+ * \r
+ * 8     3/07/97 12:23p Rjohnson\r
+ * Id Updates\r
+ * \r
+ * 7     3/07/97 12:06p Rjohnson\r
+ * Added new spell particle effect\r
+ * \r
+ * 6     2/20/97 12:13p Rjohnson\r
+ * Code fixes for id update\r
+ * \r
+ * 5     2/17/97 2:20p Rjohnson\r
+ * Id Update\r
+ * \r
+ * 4     1/02/97 11:16a Rjohnson\r
+ * Christmas work - added adaptive time, game delays, negative light,\r
+ * particle effects, etc\r
+ * \r
+ * 3     12/11/96 10:45a Rjohnson\r
+ * Added the new ice effect\r
+ * \r
+ * 2     12/06/96 2:00p Rjohnson\r
+ * New particle type for the fireball\r
+ */\r
diff --git a/H2MP/code/CL_TENT.C b/H2MP/code/CL_TENT.C
new file mode 100644 (file)
index 0000000..5aa5fe8
--- /dev/null
@@ -0,0 +1,694 @@
+\r
+//**************************************************************************\r
+//**\r
+//** cl_tent.c\r
+//**\r
+//** Client side temporary entity effects.\r
+//**\r
+//** $Header: /H2 Mission Pack/CL_TENT.C 6     3/02/98 2:51p Jweier $\r
+//**\r
+//**************************************************************************\r
+\r
+// HEADER FILES ------------------------------------------------------------\r
+\r
+#include "quakedef.h"\r
+\r
+// MACROS ------------------------------------------------------------------\r
+\r
+#define MAX_STREAMS                            32\r
+#define MAX_STREAM_ENTITIES            128\r
+#define STREAM_ATTACHED                        16\r
+#define STREAM_TRANSLUCENT             32\r
+\r
+#define        TE_SPIKE                                0\r
+#define        TE_SUPERSPIKE                   1\r
+#define        TE_GUNSHOT                              2\r
+#define        TE_EXPLOSION                    3\r
+//#define      TE_TAREXPLOSION                 4\r
+#define        TE_LIGHTNING1                   5\r
+#define        TE_LIGHTNING2                   6\r
+#define        TE_WIZSPIKE                             7\r
+#define        TE_KNIGHTSPIKE                  8\r
+#define        TE_LIGHTNING3                   9\r
+#define        TE_LAVASPLASH                   10\r
+#define        TE_TELEPORT                             11\r
+//#define TE_EXPLOSION2                        12\r
+#define TE_STREAM_CHAIN                        25\r
+#define TE_STREAM_SUNSTAFF1            26\r
+#define TE_STREAM_SUNSTAFF2            27\r
+#define TE_STREAM_LIGHTNING            28\r
+#define TE_STREAM_COLORBEAM            29\r
+#define TE_STREAM_ICECHUNKS            30\r
+#define TE_STREAM_GAZE                 31\r
+#define TE_STREAM_FAMINE               32\r
+#define TE_STREAM_LIGHTNING_SMALL              24\r
+\r
+// TYPES -------------------------------------------------------------------\r
+\r
+typedef struct\r
+{\r
+       int type;\r
+       int entity;\r
+       int tag;\r
+       int flags;\r
+       int skin;\r
+       struct model_s *models[4];\r
+       vec3_t source;\r
+       vec3_t dest;\r
+       vec3_t offset;\r
+       float endTime;\r
+       float lastTrailTime;\r
+} stream_t;\r
+\r
+// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------\r
+\r
+// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------\r
+\r
+// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------\r
+\r
+static void ParseStream(int type);\r
+static stream_t *NewStream(int ent, int tag);\r
+static entity_t *NewStreamEntity(void);\r
+\r
+// EXTERNAL DATA DECLARATIONS ----------------------------------------------\r
+\r
+// PUBLIC DATA DEFINITIONS -------------------------------------------------\r
+\r
+// PRIVATE DATA DEFINITIONS ------------------------------------------------\r
+\r
+static stream_t cl_Streams[MAX_STREAMS];\r
+static entity_t StreamEntities[MAX_STREAM_ENTITIES];\r
+static int StreamEntityCount;\r
+static sfx_t *cl_sfx_wizhit;\r
+static sfx_t *cl_sfx_knighthit;\r
+static sfx_t *cl_sfx_tink1;\r
+static sfx_t *cl_sfx_ric1;\r
+static sfx_t *cl_sfx_ric2;\r
+static sfx_t *cl_sfx_ric3;\r
+static sfx_t *cl_sfx_r_exp3;\r
+#ifdef QUAKE2\r
+static sfx_t *cl_sfx_imp;\r
+static sfx_t *cl_sfx_rail;\r
+#endif\r
+\r
+// CODE --------------------------------------------------------------------\r
+\r
+//==========================================================================\r
+//\r
+// CL_InitTEnts\r
+//\r
+//==========================================================================\r
+\r
+void CL_InitTEnts(void)\r
+{\r
+       cl_sfx_tink1 = S_PrecacheSound ("weapons/tink1.wav");\r
+       cl_sfx_ric1 = S_PrecacheSound ("weapons/ric1.wav");\r
+       cl_sfx_ric2 = S_PrecacheSound ("weapons/ric2.wav");\r
+       cl_sfx_ric3 = S_PrecacheSound ("weapons/ric3.wav");\r
+       cl_sfx_r_exp3 = S_PrecacheSound ("weapons/r_exp3.wav");\r
+#ifdef QUAKE2\r
+       cl_sfx_imp = S_PrecacheSound ("shambler/sattck1.wav");\r
+       cl_sfx_rail = S_PrecacheSound ("weapons/lstart.wav");\r
+#endif\r
+}\r
+\r
+//==========================================================================\r
+//\r
+// CL_ClearTEnts\r
+//\r
+//==========================================================================\r
+\r
+void CL_ClearTEnts(void)\r
+{\r
+       memset(cl_Streams, 0, sizeof(cl_Streams));\r
+}\r
+\r
+//==========================================================================\r
+//\r
+// CL_ParseTEnt\r
+//\r
+//==========================================================================\r
+\r
+void CL_ParseTEnt(void)\r
+{\r
+       int type;\r
+       vec3_t pos;\r
+#ifdef QUAKE2\r
+       vec3_t endpos;\r
+#endif\r
+       dlight_t *dl;\r
+       int rnd;\r
+       int colorStart, colorLength;\r
+\r
+       type = MSG_ReadByte();\r
+       switch(type)\r
+       {\r
+       case TE_WIZSPIKE:                       // spike hitting wall\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               R_RunParticleEffect (pos, vec3_origin, 20, 30);\r
+//             S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);\r
+               break;\r
+               \r
+       case TE_KNIGHTSPIKE:                    // spike hitting wall\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               R_RunParticleEffect (pos, vec3_origin, 226, 20);\r
+//             S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);\r
+               break;\r
+               \r
+       case TE_SPIKE:                  // spike hitting wall\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+#ifdef GLTEST\r
+               Test_Spawn (pos);\r
+#else\r
+               R_RunParticleEffect (pos, vec3_origin, 0, 10);\r
+#endif\r
+               if ( rand() % 5 )\r
+                       S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);\r
+               else\r
+               {\r
+                       rnd = rand() & 3;\r
+                       if (rnd == 1)\r
+                               S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);\r
+                       else if (rnd == 2)\r
+                               S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);\r
+                       else\r
+                               S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);\r
+               }\r
+               break;\r
+       case TE_SUPERSPIKE:                     // super spike hitting wall\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               R_RunParticleEffect (pos, vec3_origin, 0, 20);\r
+\r
+               if ( rand() % 5 )\r
+                       S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);\r
+               else\r
+               {\r
+                       rnd = rand() & 3;\r
+                       if (rnd == 1)\r
+                               S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);\r
+                       else if (rnd == 2)\r
+                               S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);\r
+                       else\r
+                               S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);\r
+               }\r
+               break;\r
+               \r
+       case TE_GUNSHOT:                        // bullet hitting wall\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               R_RunParticleEffect (pos, vec3_origin, 0, 20);\r
+               break;\r
+               \r
+       case TE_EXPLOSION:                      // rocket explosion\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               R_ParticleExplosion (pos);\r
+               break;\r
+               dl = CL_AllocDlight (0);\r
+               VectorCopy (pos, dl->origin);\r
+               dl->radius = 350;\r
+               dl->die = cl.time + 0.5;\r
+               dl->decay = 300;\r
+               S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);\r
+               break;\r
+/*     //jfm:not used\r
+       case TE_TAREXPLOSION:                   // tarbaby explosion\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               R_BlobExplosion (pos);\r
+\r
+               S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);\r
+               break;\r
+*/\r
+       case TE_LIGHTNING1:\r
+       case TE_LIGHTNING2:\r
+       case TE_LIGHTNING3:\r
+               MSG_ReadShort();\r
+               MSG_ReadCoord();\r
+               MSG_ReadCoord();\r
+               MSG_ReadCoord();\r
+               MSG_ReadCoord();\r
+               MSG_ReadCoord();\r
+               MSG_ReadCoord();\r
+               break;\r
+\r
+       case TE_STREAM_CHAIN:\r
+       case TE_STREAM_SUNSTAFF1:\r
+       case TE_STREAM_SUNSTAFF2:\r
+       case TE_STREAM_LIGHTNING:\r
+       case TE_STREAM_LIGHTNING_SMALL:\r
+       case TE_STREAM_COLORBEAM:\r
+       case TE_STREAM_ICECHUNKS:\r
+       case TE_STREAM_GAZE:\r
+       case TE_STREAM_FAMINE:\r
+               ParseStream(type);\r
+               break;\r
+\r
+       case TE_LAVASPLASH:\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               R_LavaSplash (pos);\r
+               break;\r
+\r
+       case TE_TELEPORT:\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               R_TeleportSplash (pos);\r
+               break;\r
+/*     //jfm:not used\r
+       case TE_EXPLOSION2:                             // color mapped explosion\r
+               pos[0] = MSG_ReadCoord ();\r
+               pos[1] = MSG_ReadCoord ();\r
+               pos[2] = MSG_ReadCoord ();\r
+               colorStart = MSG_ReadByte ();\r
+               colorLength = MSG_ReadByte ();\r
+               R_ParticleExplosion2 (pos, colorStart, colorLength);\r
+               dl = CL_AllocDlight (0);\r
+               VectorCopy (pos, dl->origin);\r
+               dl->radius = 350;\r
+               dl->die = cl.time + 0.5;\r
+               dl->decay = 300;\r
+               S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);\r
+               break;\r
+*/\r
+       default:\r
+               Sys_Error ("CL_ParseTEnt: bad type");\r
+       }\r
+}\r
+\r
+//==========================================================================\r
+//\r
+// ParseStream\r
+//\r
+//==========================================================================\r
+\r
+static void ParseStream(int type)\r
+{\r
+       int ent;\r
+       int tag;\r
+       int flags;\r
+       int skin;\r
+       vec3_t source;\r
+       vec3_t dest;\r
+       stream_t *stream;\r
+       float duration;\r
+       model_t *models[4];\r
+\r
+       ent = MSG_ReadShort();\r
+       flags = MSG_ReadByte();\r
+       tag = flags&15;\r
+       duration = (float)MSG_ReadByte()*0.05;\r
+       skin = 0;\r
+       if(type == TE_STREAM_COLORBEAM)\r
+       {\r
+               skin = MSG_ReadByte();\r
+       }\r
+       source[0] = MSG_ReadCoord();\r
+       source[1] = MSG_ReadCoord();\r
+       source[2] = MSG_ReadCoord();\r
+       dest[0] = MSG_ReadCoord();\r
+       dest[1] = MSG_ReadCoord();\r
+       dest[2] = MSG_ReadCoord();\r
+\r
+       models[1] = models[2] = models[3] = NULL;\r
+       switch(type)\r
+       {\r
+       case TE_STREAM_CHAIN:\r
+               models[0] = Mod_ForName("models/stchain.mdl", true);\r
+               break;\r
+       case TE_STREAM_SUNSTAFF1:\r
+               models[0] = Mod_ForName("models/stsunsf1.mdl", true);\r
+               models[1] = Mod_ForName("models/stsunsf2.mdl", true);\r
+               models[2] = Mod_ForName("models/stsunsf3.mdl", true);\r
+               models[3] = Mod_ForName("models/stsunsf4.mdl", true);\r
+               break;\r
+       case TE_STREAM_SUNSTAFF2:\r
+               models[0] = Mod_ForName("models/stsunsf5.mdl", true);\r
+               models[2] = Mod_ForName("models/stsunsf3.mdl", true);\r
+               models[3] = Mod_ForName("models/stsunsf4.mdl", true);\r
+               break;\r
+       case TE_STREAM_LIGHTNING:\r
+               models[0] = Mod_ForName("models/stlghtng.mdl", true);\r
+//             duration*=2;\r
+               break;\r
+       case TE_STREAM_LIGHTNING_SMALL:\r
+               models[0] = Mod_ForName("models/stltng2.mdl", true);\r
+//             duration*=2;\r
+               break;\r
+       case TE_STREAM_FAMINE:\r
+               models[0] = Mod_ForName("models/fambeam.mdl", true);\r
+               break;\r
+       case TE_STREAM_COLORBEAM:\r
+               models[0] = Mod_ForName("models/stclrbm.mdl", true);\r
+               break;\r
+       case TE_STREAM_ICECHUNKS:\r
+               models[0] = Mod_ForName("models/stice.mdl", true);\r
+               break;\r
+       case TE_STREAM_GAZE:\r
+               models[0] = Mod_ForName("models/stmedgaz.mdl", true);\r
+               break;\r
+       default:\r
+               Sys_Error("ParseStream: bad type");\r
+       }\r
+\r
+       if((stream = NewStream(ent, tag)) == NULL)\r
+       {\r
+               Con_Printf("stream list overflow\n");\r
+               return;\r
+       }\r
+       stream->type = type;\r
+       stream->tag = tag;\r
+       stream->flags = flags;\r
+       stream->entity = ent;\r
+       stream->skin = skin;\r
+       stream->models[0] = models[0];\r
+       stream->models[1] = models[1];\r
+       stream->models[2] = models[2];\r
+       stream->models[3] = models[3];\r
+       stream->endTime = cl.time+duration;\r
+       stream->lastTrailTime = 0;\r
+       VectorCopy(source, stream->source);\r
+       VectorCopy(dest, stream->dest);\r
+       if(flags&STREAM_ATTACHED)\r
+       {\r
+               VectorSubtract(source, cl_entities[ent].origin, stream->offset);\r
+       }\r
+}\r
+\r
+//==========================================================================\r
+//\r
+// NewStream\r
+//\r
+//==========================================================================\r
+\r
+static stream_t *NewStream(int ent, int tag)\r
+{\r
+       int i;\r
+       stream_t *stream;\r
+\r
+       // Search for a stream with matching entity and tag\r
+       for(i = 0, stream = cl_Streams; i < MAX_STREAMS; i++, stream++)\r
+       {\r
+               if(stream->entity == ent && stream->tag == tag)\r
+               {\r
+                       return stream;\r
+               }\r
+       }\r
+       // Search for a free stream\r
+       for(i = 0, stream = cl_Streams; i < MAX_STREAMS; i++, stream++)\r
+       {\r
+               if(!stream->models[0] || stream->endTime < cl.time)\r
+               {\r
+                       return stream;\r
+               }\r
+       }\r
+       return NULL;\r
+}\r
+\r
+//==========================================================================\r
+//\r
+// CL_UpdateTEnts\r
+//\r
+//==========================================================================\r
+\r
+void CL_UpdateTEnts(void)\r
+{\r
+       int i;\r
+       stream_t *stream;\r
+       vec3_t dist;\r
+       vec3_t org;\r
+       float d;\r
+       entity_t *ent;\r
+       float yaw, pitch;\r
+       float forward;\r
+       int segmentCount;\r
+       int offset;\r
+\r
+       // Update streams\r
+       StreamEntityCount = 0;\r
+       for(i = 0, stream = cl_Streams; i < MAX_STREAMS; i++, stream++)\r
+       {\r
+               if(!stream->models[0])// || stream->endTime < cl.time)\r
+               { // Inactive\r
+                       continue;\r
+               }\r
+               if(stream->endTime < cl.time)\r
+               { // Inactive\r
+                       if(stream->type!=TE_STREAM_LIGHTNING&&stream->type!=TE_STREAM_LIGHTNING_SMALL)\r
+                               continue;\r
+                       else if(stream->endTime + 0.25 < cl.time)\r
+                               continue;\r
+               }\r
+\r
+               if(stream->flags&STREAM_ATTACHED&&stream->endTime >= cl.time)\r
+               { // Attach the start position to owner\r
+                       VectorAdd(cl_entities[stream->entity].origin, stream->offset,\r
+                               stream->source);\r
+               }\r
+\r
+               VectorSubtract(stream->dest, stream->source, dist);\r
+               if(dist[1] == 0 && dist[0] == 0)\r
+               {\r
+                       yaw = 0;\r
+                       if(dist[2] > 0)\r
+                       {\r
+                               pitch = 90;\r
+                       }\r
+                       else\r
+                       {\r
+                               pitch = 270;\r
+                       }\r
+       &