├── source └── AvP_vc │ ├── 3dc │ ├── avp.rc │ ├── avp │ │ ├── BH_NEAR.H │ │ ├── win95 │ │ │ ├── CHEAT.H │ │ │ ├── vssver.scc │ │ │ ├── winmain.c │ │ │ ├── winmain.bak │ │ │ ├── gadgets │ │ │ │ ├── vssver.scc │ │ │ │ ├── rootgadg.hpp │ │ │ │ ├── conssym.hpp │ │ │ │ ├── ahudgadg.hpp │ │ │ │ └── conssym.cpp │ │ │ ├── Frontend │ │ │ │ ├── vssver.scc │ │ │ │ └── AvP_MP_Config.h │ │ │ ├── datatype.h │ │ │ ├── SCRSHOT.HPP │ │ │ ├── intro.hpp │ │ │ ├── GammaControl.h │ │ │ ├── AvpReg.hpp │ │ │ ├── NPCSETUP.H │ │ │ ├── LANGPLAT.C │ │ │ ├── endianio.h │ │ │ ├── progress_bar.h │ │ │ ├── jsndsup.h │ │ │ ├── KZSORT.H │ │ │ ├── OBJSETUP.HPP │ │ │ ├── GAMEPLAT.H │ │ │ ├── HUD_layout.h │ │ │ ├── MouseCentreing.cpp │ │ │ ├── PathChnk.hpp │ │ │ ├── endianio.c │ │ │ ├── modcmds.hpp │ │ │ ├── iofocus.h │ │ │ ├── d3d_hud.h │ │ │ ├── d3d_render.h │ │ │ ├── VMANPSET.H │ │ │ ├── menugfx.h │ │ │ ├── PCPAUSE.C │ │ │ ├── PathChnk.cpp │ │ │ ├── dp_Sprh.h │ │ │ ├── AvpReg.cpp │ │ │ ├── GammaControl.cpp │ │ │ ├── iofocus.cpp │ │ │ ├── hierplace.hpp │ │ │ ├── Dp_func.h │ │ │ ├── FFSTDIO.H │ │ │ └── dbdefs.h │ │ ├── TRIGGERS.H │ │ ├── Dynamics.c │ │ ├── vssver.scc │ │ ├── shapes │ │ │ └── vssver.scc │ │ ├── support │ │ │ ├── vssver.scc │ │ │ ├── reflist.cpp │ │ │ ├── ourbool.h │ │ │ ├── consbtch.hpp │ │ │ ├── command.hpp │ │ │ ├── dcontext.hpp │ │ │ ├── r2pos666.hpp │ │ │ ├── strtab.hpp │ │ │ ├── rentrntq.h │ │ │ └── trig666.hpp │ │ ├── CDTrackSelection.h │ │ ├── AI_Sight.h │ │ ├── AVPVIEW.H │ │ ├── MACRO.H │ │ ├── bh_RubberDuck.h │ │ ├── targeting.h │ │ ├── BonusAbilities.h │ │ ├── ConsoleLog.hpp │ │ ├── mempool.h │ │ ├── bh_dummy.h │ │ ├── bh_selfdest.h │ │ ├── extents.c │ │ ├── extents.h │ │ ├── load_shp.h │ │ ├── ltfx_exp.h │ │ ├── projtext.h │ │ ├── Paintball.h │ │ ├── bh_cable.h │ │ ├── bh_videoscreen.h │ │ ├── bh_deathvol.h │ │ ├── PHEROMON.H │ │ ├── DetailLevels.h │ │ ├── davehook.h │ │ ├── bh_ltfx.h │ │ ├── bh_ldoor.h │ │ ├── sfx.h │ │ ├── COMP_SHP.H │ │ ├── mempool.c │ │ ├── LIGHTING.H │ │ ├── bh_mission.h │ │ ├── bh_snds.h │ │ ├── BH_SWDOR.H │ │ ├── projfont.h │ │ ├── bh_fan.h │ │ ├── HUD_MAP.H │ │ ├── bh_spcl.h │ │ ├── equiputl.hpp │ │ ├── bh_debri.h │ │ ├── DATABASE.H │ │ ├── INVENTRY.H │ │ ├── statpane.h │ │ ├── LANGUAGE.H │ │ ├── bh_plift.h │ │ ├── scream.h │ │ ├── MAPS.C │ │ ├── BH_FAR.H │ │ ├── bh_waypt.h │ │ ├── bh_pargen.h │ │ ├── bh_corpse.h │ │ ├── bh_agun.h │ │ ├── PMOVE.H │ │ ├── DYNAMICS.H │ │ ├── movement.c │ │ ├── bh_plachier.h │ │ └── bh_track.h │ ├── plddpvc.lnk │ ├── Maths.c │ ├── avp.ico │ ├── ia3d.lib │ ├── default.cfg │ ├── dialog.dll │ ├── dialog.lib │ ├── fontbr.pgm │ ├── vssver.scc │ ├── ENGLISH.TXT │ ├── Language.txt │ ├── SMACKW32.DLL │ ├── SMACKW32.LIB │ ├── binkw32.dll │ ├── binkw32.lib │ ├── plddpvc.dll │ ├── include │ │ ├── vssver.scc │ │ └── 3dc.h │ ├── win95 │ │ ├── vssver.scc │ │ ├── plat_shp.h │ │ ├── VRAMTIME.H │ │ ├── CL_INIT.H │ │ ├── DEBUGLOG.H │ │ ├── TOOLCHNK.HPP │ │ ├── aw.h │ │ ├── huffman.hpp │ │ ├── VRAMTIME.C │ │ ├── VideoModes.h │ │ ├── fail.c │ │ ├── DXLOG.H │ │ ├── CHNKIMAG.HPP │ │ ├── fail.h │ │ ├── ShowCmds.h │ │ ├── smacker.h │ │ ├── OUR_MEM.C │ │ ├── TOOLCHNK.CPP │ │ ├── CL_INIT.CPP │ │ ├── TXIOCTRL.H │ │ ├── SMSOPT.H │ │ ├── PENTIME.H │ │ ├── ENUMCHNK.HPP │ │ ├── GSPRCHNK.HPP │ │ ├── objedit.h │ │ ├── KRENDER.H │ │ ├── ANIMCHNK.HPP │ │ ├── ENUMSCH.HPP │ │ ├── fragchnk.hpp │ │ ├── list_tem.cpp │ │ ├── OEChunk.h │ │ ├── ILBM_ext.cpp │ │ ├── DummyObjectChunk.hpp │ │ ├── Zsp.hpp │ │ └── alt_tab.h │ ├── version.h │ ├── MSLHAND.H │ ├── version.c │ ├── movement.txt │ ├── sphere.h │ ├── MEM3DCPP.CPP │ ├── CD Tracks.txt │ └── frustrum.h │ ├── AvP.opt │ ├── avp395.mk │ ├── AvP.dsw │ └── avp395.wpj └── README.txt /source/AvP_vc/3dc/avp.rc: -------------------------------------------------------------------------------- 1 | AVPICON ICON AvP.ICO -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/BH_NEAR.H: -------------------------------------------------------------------------------- 1 | 2 | extern void NearAlienBehaviour(STRATEGYBLOCK *sbPtr); 3 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/plddpvc.lnk: -------------------------------------------------------------------------------- 1 | import '_InvokeDavesDirectPlayDLL@4' plddpvc.InvokeDavesDirectPlayDLL -------------------------------------------------------------------------------- /source/AvP_vc/AvP.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/AvP.opt -------------------------------------------------------------------------------- /source/AvP_vc/3dc/Maths.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/Maths.c -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp.ico -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/CHEAT.H: -------------------------------------------------------------------------------- 1 | extern void HandleCheatModes(void); 2 | extern void GiveAllWeaponsCheat(void); 3 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/ia3d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/ia3d.lib -------------------------------------------------------------------------------- /source/AvP_vc/3dc/default.cfg: -------------------------------------------------------------------------------- 1 | '(BD8%&$ 5:64wyON1T3QP[ef*'(BD8%&$ 5:64wyON13T/0Q2P[ef*'(BD8%&$ 5:64wyT3[ef* -------------------------------------------------------------------------------- /source/AvP_vc/3dc/dialog.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/dialog.dll -------------------------------------------------------------------------------- /source/AvP_vc/3dc/dialog.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/dialog.lib -------------------------------------------------------------------------------- /source/AvP_vc/3dc/fontbr.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/fontbr.pgm -------------------------------------------------------------------------------- /source/AvP_vc/3dc/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/ENGLISH.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/ENGLISH.TXT -------------------------------------------------------------------------------- /source/AvP_vc/3dc/Language.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/Language.txt -------------------------------------------------------------------------------- /source/AvP_vc/3dc/SMACKW32.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/SMACKW32.DLL -------------------------------------------------------------------------------- /source/AvP_vc/3dc/SMACKW32.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/SMACKW32.LIB -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/TRIGGERS.H: -------------------------------------------------------------------------------- 1 | extern void OperateObjectInLineOfSight(void); 2 | extern BOOL AnythingInMyModule(MODULE* my_mod); -------------------------------------------------------------------------------- /source/AvP_vc/3dc/binkw32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/binkw32.dll -------------------------------------------------------------------------------- /source/AvP_vc/3dc/binkw32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/binkw32.lib -------------------------------------------------------------------------------- /source/AvP_vc/3dc/plddpvc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/plddpvc.dll -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/Dynamics.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/Dynamics.c -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/include/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/include/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/win95/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/win95/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/winmain.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/win95/winmain.c -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/shapes/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/shapes/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/support/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/support/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/winmain.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/win95/winmain.bak -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/gadgets/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/win95/gadgets/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/CDTrackSelection.h: -------------------------------------------------------------------------------- 1 | extern void LoadCDTrackList(); 2 | extern void CheckCDAndChooseTrackIfNeeded(); 3 | extern void ResetCDPlayForLevel(); 4 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/Frontend/vssver.scc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSourcedGames/Aliens-vs-Predator/HEAD/source/AvP_vc/3dc/avp/win95/Frontend/vssver.scc -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/AI_Sight.h: -------------------------------------------------------------------------------- 1 | #define NPC_MAX_VIEWRANGE (50000) 2 | 3 | extern int NPCCanSeeTarget(STRATEGYBLOCK *sbptr, STRATEGYBLOCK *target, int viewRange); 4 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Alien vs. Predator GOLD source code downloaded from: 2 | 3 | http://www.gamefront.com/files/10029302/AvP_Gold_Complete_Source_Code 4 | 5 | Orignal release date 2008. -------------------------------------------------------------------------------- /source/AvP_vc/3dc/version.h: -------------------------------------------------------------------------------- 1 | /* KJL 15:56:24 29/03/98 - this function supplies a text 2 | description of the current build, and the build date. */ 3 | extern void GiveVersionDetails(void); -------------------------------------------------------------------------------- /source/AvP_vc/avp395.mk: -------------------------------------------------------------------------------- 1 | project : c:\avp_copy\avpprog.exe c:\avp_copy\release\avp.exe .SYMBOLIC 2 | 3 | !include c:\avp_copy\avpprog.mk1 4 | !include c:\avp_copy\release\avp.mk1 5 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/datatype.h: -------------------------------------------------------------------------------- 1 | #define CHAR char 2 | #define BYTE unsigned char 3 | #define WORD unsigned short 4 | #define DWORD unsigned int 5 | 6 | #define SHORT short 7 | #define VOID void 8 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/SCRSHOT.HPP: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | extern void ScreenShot(); 6 | extern void HandleScreenShot(); 7 | 8 | #ifdef __cplusplus 9 | 10 | }; 11 | #endif 12 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/intro.hpp: -------------------------------------------------------------------------------- 1 | extern void PlayIntroSequence(void); 2 | 3 | #ifdef __cplusplus 4 | extern "C" 5 | { 6 | #endif 7 | extern void WeWantAnIntro(void); 8 | #ifdef __cplusplus 9 | }; 10 | #endif 11 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/include/3dc.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "system.h" 6 | #include "equates.h" 7 | #include "platform.h" 8 | #include "shape.h" 9 | #include "prototyp.h" 10 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/AVPVIEW.H: -------------------------------------------------------------------------------- 1 | /* KJL 10:49:41 04/21/97 - avpview.h */ 2 | extern void AvpShowViews(void); 3 | extern void InitCameraValues(void); 4 | extern void LightSourcesInRangeOfObject(DISPLAYBLOCK *dptr); 5 | 6 | 7 | extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr; 8 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/GammaControl.h: -------------------------------------------------------------------------------- 1 | #ifndef _included_GammaControl_h_ 2 | #define _included_GammaControl_h_ 1 3 | 4 | extern void InitialiseGammaSettings(int gamma); 5 | extern void UpdateGammaSettings(void); 6 | extern int RequestedGammaSetting; 7 | 8 | 9 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/AvpReg.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _avpreg_h 2 | #define _avpreg_h 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | 10 | extern char* AvpCDPath; 11 | void GetPathFromRegistry(); 12 | 13 | 14 | #ifdef __cplusplus 15 | }; 16 | #endif 17 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/MACRO.H: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Project specific inline macro support, 4 | currently platform specific by 5 | default 6 | 7 | */ 8 | 9 | 10 | #define GNU_ABS(x) (((x) < 0) ? -(x) : (x)) 11 | 12 | #define GNU_SIGN(x) (((x) < 0) ? -1 : +1) 13 | 14 | 15 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_RubberDuck.h: -------------------------------------------------------------------------------- 1 | extern void CreateRubberDuckBot(void); 2 | extern void CreateRubberDuck(VECTORCH *positionPtr); 3 | extern void CreateRubberDucks(void); 4 | extern void RubberDuckBehaviour(STRATEGYBLOCK *sbPtr); 5 | 6 | extern void CreateFlamingDebris(VECTORCH *positionPtr, VECTORCH *dirPtr); 7 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/targeting.h: -------------------------------------------------------------------------------- 1 | /* KJL 16:20:20 19/05/98 - targeting externs */ 2 | 3 | extern void GetTargetingPointOfObject(DISPLAYBLOCK *objectPtr, VECTORCH *targetPtr); 4 | extern void GetTargetingPointOfObject_Far(STRATEGYBLOCK *sbPtr, VECTORCH *targetPtr); 5 | extern void CalculatePlayersTarget(TEMPLATE_WEAPON_DATA *twPtr, PLAYER_WEAPON_DATA *weaponPtr); 6 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/BonusAbilities.h: -------------------------------------------------------------------------------- 1 | /* KJL 12:09:35 10/09/98 - BonusAbilities.h */ 2 | 3 | /* KJL 12:09:43 10/09/98 - Grappling Hook */ 4 | extern void InitialiseGrapplingHook(void); 5 | extern void ActivateGrapplingHook(void); 6 | extern void HandleGrapplingHookForces(void); 7 | extern void RenderGrapplingHook(void); 8 | extern void DisengageGrapplingHook(void); 9 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/NPCSETUP.H: -------------------------------------------------------------------------------- 1 | #ifndef _included_npcsetup_h_ 2 | #define _included_npcsetup_h_ 3 | 4 | #include "chnkload.h" /* for RIFFHANDLE type */ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* pass handle to environment rif */ 11 | void InitNPCs(RIFFHANDLE); 12 | 13 | /* unload them all after intance of game */ 14 | void EndNPCs(); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif /* ! _included_npcsetup_h_ */ 21 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/plat_shp.h: -------------------------------------------------------------------------------- 1 | /* Plat_Shp.h */ 2 | 3 | 4 | extern void SetupPolygonFlagAccessForShape(SHAPEHEADER *shape); 5 | extern int Request_PolyFlags(void *polygon); 6 | 7 | extern int SetupPolygonAccess(DISPLAYBLOCK *objectPtr); 8 | extern void AccessNextPolygon(void); 9 | extern void GetPolygonVertices(struct ColPolyTag *polyPtr); 10 | extern void GetPolygonNormal(struct ColPolyTag *polyPtr); 11 | extern int SetupPolygonAccessFromShapeIndex(int shapeIndex); 12 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/VRAMTIME.H: -------------------------------------------------------------------------------- 1 | #ifndef _included_vramtime_h_ 2 | #define _included_vramtime_h_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef enum VramWaitState 9 | { 10 | VWS_DDRELEASE, 11 | VWS_D3DTEXRELEASE, 12 | VWS_DDCREATE, 13 | VWS_D3DTEXCREATE, 14 | VWS_UNKNOWN, 15 | VWS_MAXSTATES 16 | 17 | } VRAM_WAIT_STATE; 18 | 19 | void WaitForVRamReady(VRAM_WAIT_STATE); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif /* ! _included_vramtime_h_ */ 26 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/ConsoleLog.hpp: -------------------------------------------------------------------------------- 1 | /* KJL 10:19:41 30/03/98 - ConsoleLog.hpp 2 | 3 | This file handles the mirroring of the console text 4 | to a log file. 5 | 6 | */ 7 | #ifndef ConsoleLog_h_included 8 | #define ConsoleLog_h_included 9 | 10 | extern void OutputToConsoleLogfile(char *messagePtr); 11 | 12 | 13 | 14 | #ifdef __cplusplus 15 | extern "C" 16 | { 17 | #endif 18 | extern void OutputBugReportToConsoleLogfile(char *messagePtr); 19 | #ifdef __cplusplus 20 | }; 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/CL_INIT.H: -------------------------------------------------------------------------------- 1 | #ifndef _included_cl_init_h_ 2 | #define _included_cl_init_h_ 3 | 4 | #error "This file is obsolete" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #include "d3d.h" // required by d3_func.hpp 11 | #include "d3_func.h" // for D3DINFO definition 12 | 13 | extern int VideoModeTypeScreen; 14 | extern int ScanDrawMode; 15 | extern D3DINFO d3d; 16 | 17 | void CL_Init_All(void); 18 | 19 | #ifdef __cplusplus 20 | }; 21 | #endif 22 | 23 | #endif // !_included_cl_init_h_ -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/LANGPLAT.C: -------------------------------------------------------------------------------- 1 | #include "3dc.h" 2 | #include "inline.h" 3 | #include "language.h" 4 | /* KJL 12:07:26 05/02/97 - this will be buggered 5 | up if the enum in gamedef.h changes */ 6 | unsigned char *LanguageFilename[] = 7 | { 8 | ENGLISH_TEXT_FILENAME, /* I_English */ 9 | ENGLISH_TEXT_FILENAME, /* I_French */ 10 | ENGLISH_TEXT_FILENAME, /* I_Spanish */ 11 | ENGLISH_TEXT_FILENAME, /* I_German */ 12 | ENGLISH_TEXT_FILENAME, /* I_Italian */ 13 | ENGLISH_TEXT_FILENAME, /* I_Swedish */ 14 | }; 15 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/mempool.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _mempool_h_ 3 | #define _mempool_h_ 1 4 | 5 | 6 | #ifdef __cplusplus 7 | 8 | extern "C" { 9 | 10 | #endif 11 | 12 | #define NEW_DEALLOCATION_ORDER 1 13 | 14 | #define USE_LEVEL_MEMORY_POOL 1 15 | 16 | #if USE_LEVEL_MEMORY_POOL 17 | void* PoolAllocateMem(unsigned int amount); 18 | void ClearMemoryPool(); 19 | #else 20 | #define PoolAllocateMem AllocateMem 21 | #define ClearMemoryPool() ((void)0) 22 | #endif 23 | 24 | 25 | #ifdef __cplusplus 26 | 27 | }; 28 | 29 | #endif 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/MSLHAND.H: -------------------------------------------------------------------------------- 1 | #ifndef _included_mslhand_h_ 2 | #define _included_mslhand_h_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef enum MSL_Section 9 | { 10 | MSLS_COMPILEDIN, 11 | MSLS_CHARACTER, 12 | MSLS_ENVIRONMENT, 13 | 14 | MSLS_MAXSECTIONS 15 | 16 | } MSL_SECTION; 17 | 18 | #define MSL_OVERFLOW (-1) 19 | 20 | int GetNextMSLEntry(MSL_SECTION, unsigned int num_shapes, int auto_delete); 21 | 22 | void FlushMSLSection(MSL_SECTION); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif /* !_included_mslhand_h_ */ 29 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/endianio.h: -------------------------------------------------------------------------------- 1 | #ifndef _included_endianio_h_ 2 | #define _included_endianio_h_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #include 9 | 10 | #include "datatype.h" 11 | 12 | BYTE GetByte(FILE *fp); 13 | WORD GetLittleWord(FILE *fp); 14 | DWORD GetLittleDword(FILE *fp); 15 | 16 | VOID PutByte(BYTE v, FILE *fp); 17 | VOID PutLittleWord(WORD v, FILE *fp); 18 | VOID PutLittleDword(DWORD v, FILE *fp); 19 | 20 | #ifdef __cplusplus 21 | }; 22 | #endif /* __cplusplus */ 23 | 24 | #endif /* _included_endianio_h_ */ 25 | 26 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/support/reflist.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | * 3 | * DESCRIPTION: reflist.cpp 4 | * 5 | * AUTHOR: David Malcolm 6 | * 7 | * HISTORY: Created 28/1/98 8 | * 9 | *******************************************************************/ 10 | 11 | /* Includes ********************************************************/ 12 | #include "3dc.h" 13 | #include "reflist.hpp" 14 | 15 | /* Exported globals ************************************************/ 16 | 17 | char const* reflist_fail_destructor = "Failure in RefList destructor\n"; 18 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/DEBUGLOG.H: -------------------------------------------------------------------------------- 1 | #ifndef _included_debuglog_h_ 2 | #define _included_debuglog_h_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | typedef struct LogFile LOGFILE; 11 | 12 | int vlfprintf(LOGFILE * lfp, char const * format, va_list args ); 13 | 14 | int lfprintf(LOGFILE * lfp, char const * format, ... ); 15 | 16 | int lfputs(LOGFILE * lfp, char const * str); 17 | 18 | LOGFILE * lfopen(char const * fname); 19 | 20 | void lfclose(LOGFILE * lfp); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif /* ! _included_debuglog_h_ */ 27 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/TOOLCHNK.HPP: -------------------------------------------------------------------------------- 1 | #ifndef _toolchnk_hpp 2 | #define _toolchnk_hpp 3 | 4 | #include "chunk.hpp" 5 | #include "chnktype.hpp" 6 | 7 | class Camera_Origin_Chunk :public Chunk 8 | { 9 | public : 10 | Camera_Origin_Chunk(Chunk_With_Children* parent); 11 | Camera_Origin_Chunk(Chunk_With_Children * parent,const char* data,size_t size); 12 | 13 | ChunkVector location; 14 | ChunkMatrix orientation;//not used yet 15 | 16 | virtual void fill_data_block (char * data_start); 17 | virtual size_t size_chunk (){return chunk_size=12+sizeof(ChunkVector)+sizeof(ChunkMatrix); } 18 | 19 | 20 | }; 21 | 22 | 23 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/aw.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDED_AW_H_ 2 | #define _INCLUDED_AW_H_ 3 | 4 | #include 5 | 6 | typedef IDirectDraw DDObject; 7 | typedef IDirect3DDevice D3DDevice; 8 | typedef IDirect3DTexture D3DTexture; 9 | typedef IDirectDrawSurface DDSurface; 10 | typedef IDirectDrawPalette DDPalette; 11 | 12 | #define GUID_D3D_TEXTURE IID_IDirect3DTexture 13 | #define GUID_DD_SURFACE IID_IDirectDrawSurface 14 | 15 | typedef DDSURFACEDESC DD_SURFACE_DESC; 16 | typedef DDSCAPS DD_S_CAPS; 17 | 18 | struct AwBackupTexture; 19 | typedef struct AwBackupTexture * AW_BACKUPTEXTUREHANDLE; 20 | 21 | #endif /* _INCLUDED_AW_H_ */ -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/progress_bar.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _progress_bar_h 3 | #define _progress_bar_h 4 | 5 | #ifdef __cplusplus 6 | extern "C" 7 | { 8 | #endif 9 | 10 | #define PBAR_HUD_START 0 11 | #define PBAR_LEVEL_START 1000 12 | #define PBAR_NPC_START 3000 13 | #define PBAR_LENGTH 5000 14 | 15 | #define PBAR_HUD_INTERVAL (PBAR_LEVEL_START) 16 | #define PBAR_LEVEL_INTERVAL (PBAR_NPC_START-PBAR_LEVEL_START) 17 | #define PBAR_NPC_INTERVAL (PBAR_LENGTH-PBAR_NPC_START) 18 | 19 | void Start_Progress_Bar(); 20 | void Set_Progress_Bar_Position(int pos); 21 | 22 | #ifdef __cplusplus 23 | }; 24 | #endif 25 | 26 | 27 | 28 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/jsndsup.h: -------------------------------------------------------------------------------- 1 | #ifndef _jsndsup_h 2 | #define _jsndsup_h 1 3 | 4 | #include "3dc.h" 5 | #include "inline.h" 6 | #include "module.h" 7 | 8 | #ifdef __cplusplus 9 | 10 | extern "C" { 11 | 12 | #endif 13 | 14 | typedef struct loaded_sound 15 | { 16 | int sound_num; 17 | 18 | char * wavname; 19 | int num_attached; 20 | 21 | unsigned long permanent :1; 22 | 23 | } LOADED_SOUND; 24 | 25 | 26 | void LoseSound (LOADED_SOUND const * ls); 27 | LOADED_SOUND const * GetSound (char const * fname); 28 | 29 | #ifdef __cplusplus 30 | 31 | }; // end of extern "c" 32 | 33 | #endif 34 | 35 | 36 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/AvP.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "AvP"=.\AvP.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _bhdummy_h_ 3 | #define _bhdummy_h_ 1 4 | 5 | 6 | #ifdef __cplusplus 7 | 8 | extern "C" { 9 | 10 | #endif 11 | 12 | #include "bh_ais.h" 13 | 14 | typedef struct dummyStatusBlock { 15 | I_PLAYER_TYPE PlayerType; 16 | int incidentFlag; 17 | int incidentTimer; 18 | HMODELCONTROLLER HModelController; 19 | } DUMMY_STATUS_BLOCK; 20 | 21 | 22 | extern void MakeDummyNear(STRATEGYBLOCK *sbPtr); 23 | extern void MakeDummyFar(STRATEGYBLOCK *sbPtr); 24 | extern void DummyBehaviour(STRATEGYBLOCK *sbPtr); 25 | 26 | 27 | #ifdef __cplusplus 28 | 29 | } 30 | 31 | #endif 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /source/AvP_vc/avp395.wpj: -------------------------------------------------------------------------------- 1 | 40 2 | projectIdent 3 | 0 4 | VpeMain 5 | 1 6 | WRect 7 | 0 8 | 0 9 | 10240 10 | 10240 11 | 2 12 | MProject 13 | 3 14 | MCommand 15 | 0 16 | 4 17 | MCommand 18 | 0 19 | 2 20 | 5 21 | WFileName 22 | 11 23 | avpprog.tgt 24 | 6 25 | WFileName 26 | 19 27 | wat_release\avp.tgt 28 | 7 29 | WVList 30 | 2 31 | 8 32 | VComponent 33 | 9 34 | WRect 35 | 160 36 | 0 37 | 4240 38 | 4800 39 | 0 40 | 0 41 | 10 42 | WFileName 43 | 11 44 | avpprog.tgt 45 | 203 46 | 205 47 | 11 48 | VComponent 49 | 12 50 | WRect 51 | 4560 52 | 0 53 | 4160 54 | 4800 55 | 0 56 | 0 57 | 13 58 | WFileName 59 | 19 60 | wat_release\avp.tgt 61 | 0 62 | 4 63 | 8 64 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_selfdest.h: -------------------------------------------------------------------------------- 1 | #ifndef _bh_selfdest_h 2 | #define _bh_selfdest_h 1 3 | 4 | #ifdef __cplusplus 5 | 6 | extern "C" { 7 | 8 | #endif 9 | 10 | extern void* SelfDestructBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr); 11 | extern void SelfDestructBehaveFun(STRATEGYBLOCK* sbptr); 12 | 13 | 14 | typedef struct self_destruct_behav_block 15 | { 16 | AVP_BEHAVIOUR_TYPE bhvr_type; 17 | int timer; //in fixed point seconds 18 | BOOL active; 19 | }SELF_DESTRUCT_BEHAV_BLOCK; 20 | 21 | typedef struct self_destruct_tools_template 22 | { 23 | char nameID[SB_NAME_LENGTH]; 24 | int timer; 25 | }SELF_DESTRUCT_TOOLS_TEMPLATE; 26 | 27 | 28 | 29 | 30 | 31 | #ifdef __cplusplus 32 | 33 | }; 34 | 35 | #endif 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/extents.c: -------------------------------------------------------------------------------- 1 | /* KJL 12:15:10 8/23/97 - extents.c 2 | * 3 | * This file contains the collision extents 4 | * data for the game characters. 5 | * 6 | */ 7 | #include "extents.h" 8 | 9 | COLLISION_EXTENTS CollisionExtents[MAX_NO_OF_COLLISION_EXTENTS] = 10 | { 11 | /* CE_MARINE */ 12 | {450,0, -1950, -1200}, 13 | 14 | /* CE_PREDATOR */ 15 | {450,0, -789-1309, -1309}, 16 | 17 | /* CE_ALIEN */ 18 | {450,0, -900-1133, -900}, 19 | 20 | /* CE_XENOBORG */ 21 | {450,0, -900-1133, -900}, 22 | 23 | /* CE_PREDATORALIEN */ 24 | {400,0, -851-1338, -851}, 25 | 26 | /* CE_FACEHUGGER */ 27 | {300,0, 27-329, 27}, 28 | 29 | /* CE_QUEEN */ 30 | {1300,0, -2867-1133, -867}, 31 | 32 | /* CE_CORPSE */ 33 | {700,0, -200, -200}, 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/KZSORT.H: -------------------------------------------------------------------------------- 1 | /* If this is set to a non-zero value then kzsort.c hijacks the pipeline */ 2 | #define KZSORT_ON 1 3 | 4 | /* maximum number of modules likely to appear on-screen */ 5 | #define MAX_NUMBER_OF_VISIBLE_MODULES 400 6 | 7 | struct KItem 8 | { 9 | POLYHEADER *PolyPtr; 10 | 11 | int SortKey; 12 | }; 13 | 14 | struct KObject 15 | { 16 | DISPLAYBLOCK *DispPtr; 17 | 18 | int SortKey; 19 | 20 | int DrawBeforeEnvironment; 21 | }; 22 | 23 | /* render with new z-sort */ 24 | extern void KRenderItems(VIEWDESCRIPTORBLOCK *VDBPtr); 25 | 26 | /* generic item shape function */ 27 | extern void KShapeItemsInstr(SHAPEINSTR *shapeinstrptr); 28 | extern void OutputKItem(int *shapeitemptr); 29 | 30 | extern void RenderThisDisplayblock(DISPLAYBLOCK *dbPtr); 31 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/extents.h: -------------------------------------------------------------------------------- 1 | /* KJL 12:15:10 8/23/97 - extents.h 2 | * 3 | * This file contains the collision extents 4 | * structures for the game characters. 5 | * 6 | */ 7 | 8 | enum COLLISION_EXTENTS_ID 9 | { 10 | CE_MARINE, 11 | 12 | CE_PREDATOR, 13 | 14 | CE_ALIEN, 15 | 16 | CE_XENOBORG, 17 | 18 | CE_PREDATORALIEN, 19 | 20 | CE_FACEHUGGER, 21 | 22 | CE_QUEEN, 23 | 24 | CE_CORPSE, 25 | 26 | MAX_NO_OF_COLLISION_EXTENTS 27 | }; 28 | 29 | 30 | typedef struct 31 | { 32 | /* radius of shape in XZ plane */ 33 | int CollisionRadius; 34 | 35 | /* height extents */ 36 | int Bottom; /* ie. max Y of the shape */ 37 | 38 | int StandingTop; 39 | int CrouchingTop; 40 | 41 | } COLLISION_EXTENTS; 42 | 43 | 44 | extern COLLISION_EXTENTS CollisionExtents[]; 45 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/huffman.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _huffman_hpp_included 2 | #define _huffman_hpp_included 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | #define MAX_DEPTH 11 10 | typedef struct 11 | { 12 | char Identifier[8]; 13 | int CompressedDataSize; 14 | int UncompressedDataSize; 15 | int CodelengthCount[MAX_DEPTH]; 16 | unsigned char ByteAssignment[256]; 17 | } HuffmanPackage; 18 | 19 | /* KJL 17:16:03 17/09/98 - Compression */ 20 | extern HuffmanPackage *HuffmanCompression(unsigned char *sourcePtr, int length); 21 | 22 | /* KJL 16:53:53 19/09/98 - Decompression */ 23 | extern char *HuffmanDecompress(HuffmanPackage *inpackage); 24 | 25 | 26 | #define COMPRESSED_RIF_IDENTIFIER "REBCRIF1" 27 | #ifdef __cplusplus 28 | }; 29 | #endif 30 | 31 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/load_shp.h: -------------------------------------------------------------------------------- 1 | 2 | typedef enum 3 | { 4 | I_Shape_BadGuy1 = 0, 5 | I_Shape_BadGuy2, 6 | I_Shape_BadGuy3, 7 | I_Shape_BadGuy4, 8 | I_Shape_BadGuy5, 9 | I_Shape_BadGuy6, 10 | I_Shape_BadGuy7, 11 | 12 | I_Shape_Grenade, 13 | I_Shape_Missile, 14 | I_Shape_Disc, 15 | I_Shape_Plasma, 16 | I_Shape_AutoGun, 17 | 18 | I_Shape_Explosion1, 19 | I_Shape_Explosion2, 20 | I_Shape_PlasmaGunExp, 21 | I_Shape_Ricochet, 22 | 23 | I_Shape_BloodSplash1, 24 | I_Shape_BloodSplash2, 25 | I_Shape_BloodSplash3, 26 | I_Shape_BloodSplash4, 27 | I_Shape_BloodSplash5, 28 | 29 | I_Num_Character_Shapes, 30 | 31 | }CHARACTER_SHAPES; 32 | 33 | 34 | extern void InitCharacterMSLReferences(); 35 | extern int GetMSLPosFromEnum(CHARACTER_SHAPES shape_enum); 36 | extern int GetLoadedShapeMSL(const char *); 37 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/VRAMTIME.C: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "vramtime.h" 4 | 5 | static DWORD transition_times_matrix[][VWS_MAXSTATES] = 6 | { 7 | /* from DDRELEASE */ 8 | { 0, 20, 0, 100, 100 }, 9 | /* from D3DTEXRELEASE */ 10 | { 20, 0, 100, 100, 100 }, 11 | /* from DDCREATE */ 12 | { 0, 100, 0, 20, 100 }, 13 | /* from D3DTEXCREATE */ 14 | { 20, 100, 20, 20, 100 }, 15 | /* from UNKNOWN */ 16 | { 100, 100, 100, 100, 100 } 17 | }; 18 | 19 | 20 | void WaitForVRamReady(VRAM_WAIT_STATE vws) 21 | { 22 | static DWORD old_time = 0; 23 | static VRAM_WAIT_STATE old_vws = VWS_UNKNOWN; 24 | 25 | DWORD new_time; 26 | 27 | if (0==old_time) old_time = timeGetTime(); 28 | 29 | do new_time = timeGetTime(); while (new_time - old_time < transition_times_matrix[old_vws][vws]); 30 | 31 | old_time = new_time; 32 | old_vws = vws; 33 | } 34 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/ltfx_exp.h: -------------------------------------------------------------------------------- 1 | #ifndef _ltfx_exp_h 2 | #define _ltfx_exp_h 1 3 | 4 | #ifdef __cplusplus 5 | 6 | extern "C" 7 | { 8 | 9 | #endif 10 | 11 | typedef enum 12 | { 13 | 14 | LFX_RandomFlicker, 15 | LFX_Strobe, 16 | LFX_Switch, 17 | LFX_FlickySwitch, 18 | 19 | } LIGHT_FX_TYPE; 20 | 21 | typedef enum 22 | { 23 | 24 | LFXS_LightOn, 25 | LFXS_LightOff, 26 | LFXS_LightFadingUp, 27 | LFXS_LightFadingDown, 28 | LFXS_Flicking, 29 | LFXS_NotFlicking, 30 | 31 | } LIGHT_FX_STATE; 32 | 33 | typedef struct 34 | { 35 | 36 | unsigned long type; 37 | unsigned long init_state; 38 | 39 | unsigned long fade_up_speed; 40 | unsigned long fade_down_speed; 41 | 42 | unsigned long post_fade_up_delay; 43 | unsigned long post_fade_down_delay; 44 | 45 | } LightFXData; 46 | 47 | #ifdef __cplusplus 48 | 49 | }; 50 | 51 | #endif 52 | 53 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/VideoModes.h: -------------------------------------------------------------------------------- 1 | #define MAX_DEVICES 4 2 | #define MAX_VIDEOMODES 100 3 | 4 | 5 | typedef struct 6 | { 7 | int Width; 8 | int Height; 9 | int ColourDepth; 10 | } VIDEOMODEDESC; 11 | 12 | typedef struct 13 | { 14 | GUID DDGUID; 15 | int DDGUIDIsSet; 16 | 17 | DDDEVICEIDENTIFIER DeviceInfo; 18 | DDDEVICEIDENTIFIER DeviceInfoHost; 19 | DDCAPS DriverCaps; 20 | 21 | VIDEOMODEDESC VideoModes[MAX_VIDEOMODES]; 22 | int NumberOfVideoModes; 23 | 24 | } DEVICEANDVIDEOMODESDESC; 25 | 26 | typedef struct 27 | { 28 | GUID DDGUID; 29 | int DDGUIDIsSet; 30 | int Width; 31 | int Height; 32 | int ColourDepth; 33 | 34 | } DEVICEANDVIDEOMODE; 35 | 36 | extern DEVICEANDVIDEOMODESDESC DeviceDescriptions[MAX_DEVICES]; 37 | extern int NumberOfDevices; 38 | extern int CurrentlySelectedDevice; 39 | extern int CurrentlySelectedVideoMode; 40 | 41 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/OBJSETUP.HPP: -------------------------------------------------------------------------------- 1 | #ifndef _objsetup_hpp_ 2 | #define _objsetup_hpp_ 3 | 4 | #include "envchunk.hpp" 5 | #include "obchunk.hpp" 6 | 7 | extern "C" { 8 | #include "3dc.h" 9 | void SetUpRunTimeLights (); 10 | void create_strategies_from_list(); 11 | void deallocate_behaviour_list(); 12 | }; 13 | 14 | void deal_with_module_object(Object_Chunk * ob, int shape1, int AnimationShape, int shape2, MODULE * mod); 15 | void deal_with_placed_object(Object_Chunk * ob, int shape1, int AnimationShape); 16 | void setup_generators (Environment_Data_Chunk * envd); 17 | void setup_particle_generators (Environment_Data_Chunk * envd); 18 | void setup_cables (Environment_Data_Chunk * envd); 19 | void DealWithExternalObjectStategies (Environment_Data_Chunk * envd); 20 | void Create_Xenoborg_Morph_Jobby(Object_Chunk * ob, int AnimationShape, MODULE * mod, MORPHCTRL * mc); 21 | void setup_sounds (Environment_Data_Chunk * envd); 22 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/fail.c: -------------------------------------------------------------------------------- 1 | /* LotU: Error handling functions. 2 | 3 | Copyright (C) 1995, Jamie Lokier. 4 | Written for Rebellion Developments, Ltd. 5 | 6 | Permission to use, copy, modify and distribute this file for any 7 | purpose by Rebellion Developments, Ltd. is hereby granted. If you 8 | want to use this file outside the company, please let me know. 9 | */ 10 | 11 | #include "3dc.h" 12 | #include "fail.h" 13 | #include "dxlog.h" 14 | 15 | void 16 | fail (const char * format, ...) 17 | { 18 | va_list ap; 19 | 20 | LOGDXSTR(format); 21 | va_start (ap, format); 22 | if (format != 0) 23 | vfprintf (stderr, format, ap); 24 | va_end (ap); 25 | 26 | exit (EXIT_FAILURE); 27 | } 28 | 29 | void FAILHandleCompilerWarningMessage(void) 30 | { 31 | int temp; 32 | 33 | temp = D3DRMMAP_PERSPCORRECT; 34 | temp = D3DRMMAP_WRAPU; 35 | temp = D3DRMMAP_WRAPV; 36 | temp = D3DRMGROUP_ALLGROUPS; 37 | } -------------------------------------------------------------------------------- /source/AvP_vc/3dc/version.c: -------------------------------------------------------------------------------- 1 | /* KJL 16:41:33 29/03/98 - not the most complicated code I've ever written... */ 2 | #include "version.h" 3 | extern void NewOnScreenMessage(unsigned char *messagePtr); 4 | 5 | 6 | void GiveVersionDetails(void) 7 | { 8 | /* KJL 15:54:25 29/03/98 - give version details; this is not language localised since I thought that would be a little odd */ 9 | // NewOnScreenMessage("ALIENS VS PREDATOR - DEATHMATCH DEMO V1.0 - REBELLION DEVELOPMENTS 1998/11/28"); 10 | // NewOnScreenMessage("Aliens vs Predator - Alien Demo V1.3 - Rebellion Developments 1999/1/25"); 11 | // NewOnScreenMessage("Aliens vs Predator - \n Build 103 \n Rebellion Developments 1999/7/13 \n (European Release)"); 12 | // NewOnScreenMessage("Aliens vs Predator - \n Build 103 \n Rebellion Developments 1999/7/13 \n (American Release)"); 13 | NewOnScreenMessage("Aliens vs Predator - Gold\n Build 116 \n Rebellion Developments 2000/16/3 \n"); //11:25 14 | 15 | } 16 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/DXLOG.H: -------------------------------------------------------------------------------- 1 | #ifndef _included_dxlog_h_ 2 | #define _included_dxlog_h_ 3 | 4 | #include "system.h" 5 | #include "ddraw.h" 6 | #include "d3d.h" 7 | #include "d3drm.h" 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #if debug 14 | 15 | void dx_err_log(HRESULT error, int line, char const * file); 16 | void dx_str_log(char const * str, int line, char const * file); 17 | void dx_line_log(int line, char const * file); 18 | void dx_strf_log(char const * fmt, ...); 19 | 20 | #define LOGDXERR(error) dx_err_log(error,__LINE__,__FILE__) 21 | #define LOGDXSTR(str) dx_str_log(str,__LINE__,__FILE__) 22 | #define LOGDXFMT(args) (dx_line_log(__LINE__,__FILE__),dx_strf_log args) 23 | 24 | #else 25 | 26 | #define LOGDXERR(error) (void)0 27 | #define LOGDXSTR(str) (void)0 28 | #define LOGDXFMT(args) (void)0 29 | 30 | #endif 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* ! _included_dxlog_h_ */ 38 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/projtext.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | projtext.h 4 | 5 | Created 12 Nov 97 by DHM: Project specific text type 6 | 7 | */ 8 | 9 | #ifndef _projtext 10 | #define _projtext 1 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /* Version settings *****************************************************/ 17 | 18 | /* Constants ***********************************************************/ 19 | 20 | /* Macros ***************************************************************/ 21 | 22 | /* Type definitions *****************************************************/ 23 | 24 | typedef char ProjChar; 25 | 26 | /* Exported globals *****************************************************/ 27 | 28 | /* Function prototypes **************************************************/ 29 | 30 | 31 | 32 | /* End of the header ****************************************************/ 33 | 34 | 35 | #ifdef __cplusplus 36 | }; 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/GAMEPLAT.H: -------------------------------------------------------------------------------- 1 | /* 2 | This contains project platfrom specifc externs 3 | and prototypes. Only valid when we are calling one 4 | p\p function from another. 5 | */ 6 | 7 | 8 | 9 | extern void LoadRifFile(); 10 | 11 | 12 | 13 | /* record of the histance passed to winmain */ 14 | 15 | 16 | extern HINSTANCE AVP_HInstance; 17 | extern int AVP_NCmd; 18 | 19 | extern int AVP_ChangeDisplayMode 20 | ( 21 | HINSTANCE hInst, 22 | int nCmd, 23 | int NewVideoMode, 24 | int NewWindowMode, 25 | int NewZBufferMode, 26 | int NewRasterisationMode, 27 | int NewSoftwareScanDrawMode, 28 | int NewDXMemoryMode 29 | ); 30 | 31 | 32 | 33 | extern int WindowMode; 34 | extern int WindowRequestMode; 35 | extern int VideoRequestMode; 36 | extern int ZBufferRequestMode; 37 | extern int RasterisationRequestMode; 38 | extern int SoftwareScanDrawRequestMode; 39 | extern int DXMemoryRequestMode; 40 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/HUD_layout.h: -------------------------------------------------------------------------------- 1 | /* KJL 17:58:47 18/04/98 - layout defines */ 2 | 3 | #define HUD_FONT_WIDTH 15 4 | //5 5 | #define HUD_FONT_HEIGHT 15 6 | //8 7 | #define HUD_DIGITAL_NUMBERS_WIDTH 14 8 | #define HUD_DIGITAL_NUMBERS_HEIGHT 22 9 | 10 | #define HUDLayout_RightmostTextCentre -40 11 | 12 | #define HUDLayout_Health_TopY 10 13 | #define HUDLayout_Armour_TopY 60 14 | 15 | /* KJL 15:28:12 09/06/98 - the following are pixels from the bottom of the screen */ 16 | #define HUDLayout_Rounds_TopY 40 17 | #define HUDLayout_Magazines_TopY 90 18 | #define HUDLayout_AmmoDesc_TopY 115 19 | 20 | 21 | #define HUDLayout_Colour_BrightWhite 0xffffffff 22 | #define HUDLayout_Colour_MarineGreen ((255<<24)+(95<<16)+(179<<8)+(39)) 23 | #define HUDLayout_Colour_MarineRed ((255<<24)+(255<<16)) 24 | #define HUDLayout_Linespacing 16 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | extern char AAFontWidths[]; 31 | #ifdef __cplusplus 32 | }; 33 | #endif 34 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/MouseCentreing.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | 7 | extern "C" 8 | { 9 | extern BOOL bActive; 10 | extern int WinLeftX, WinRightX, WinTopY, WinBotY; 11 | 12 | } 13 | 14 | static volatile int EndMouseThread=0; 15 | 16 | 17 | 18 | 19 | //thread continually moves the mouse cursor to the centre of the window 20 | //so you don't accidently click outside it. 21 | void MouseThread(void* ) 22 | { 23 | while(!EndMouseThread) 24 | { 25 | Sleep(10); 26 | 27 | if(!bActive) continue; 28 | 29 | SetCursorPos((WinLeftX+WinRightX)>>1,(WinTopY+WinBotY)>>1); 30 | 31 | 32 | } 33 | EndMouseThread=0; 34 | } 35 | 36 | 37 | 38 | extern "C" 39 | { 40 | 41 | 42 | void InitCentreMouseThread() 43 | { 44 | _beginthread(MouseThread,10000,0); 45 | } 46 | 47 | 48 | void FinishCentreMouseThread() 49 | { 50 | EndMouseThread=1; 51 | } 52 | 53 | 54 | 55 | }; 56 | 57 | 58 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/PathChnk.hpp: -------------------------------------------------------------------------------- 1 | #ifndef pathchnk_hpp 2 | #define pathchnk_hpp 1 3 | 4 | #include "chunk.hpp" 5 | #include "chnktype.hpp" 6 | #include "obchunk.hpp" 7 | 8 | #define PathPointFlag_InterpolatedPoint 0x00000001 9 | #define PathPointFlag_LocationValid 0x00000002 10 | 11 | struct ChunkPathPoint 12 | { 13 | int module_index; 14 | ChunkVectorInt location; //relative to world 15 | int flags,spare2; 16 | }; 17 | 18 | 19 | #define PathFlag_LoopPath 0x00000001 20 | #define PathFlag_BackAndForth 0x00000002 21 | 22 | class AVP_Path_Chunk : public Chunk 23 | { 24 | public : 25 | AVP_Path_Chunk(Chunk_With_Children*,const char *,size_t); 26 | AVP_Path_Chunk(Chunk_With_Children*); 27 | ~AVP_Path_Chunk(); 28 | 29 | virtual size_t size_chunk(); 30 | virtual void fill_data_block(char* data_start); 31 | 32 | int PathLength; 33 | ChunkPathPoint* Path; 34 | 35 | char* PathName; 36 | int PathID; 37 | int flags,spare2; 38 | 39 | 40 | }; 41 | 42 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/Paintball.h: -------------------------------------------------------------------------------- 1 | /* KJL 16:20:56 30/09/98 - Paintball.h */ 2 | #ifndef _included_paintball_h_ /* Is this your first time? */ 3 | #define _included_paintball_h_ 1 4 | 5 | #include "Decal.h" 6 | 7 | typedef struct 8 | { 9 | DISPLAYBLOCK *TargetDispPtr; 10 | VECTORCH TargetPosition; 11 | VECTORCH TargetNormal; 12 | 13 | enum DECAL_ID CurrentDecalID; 14 | int CurrentDecalSubclass; 15 | int CurrentDecalSize; 16 | int CurrentDecalRotation; 17 | 18 | unsigned int IsOn :1; 19 | unsigned int DecalIsInverted :1; 20 | 21 | } PAINTBALLMODE; 22 | 23 | extern PAINTBALLMODE PaintBallMode; 24 | 25 | #define FIRST_PAINTBALL_DECAL (DECAL_SCORCHED) 26 | #define LAST_PAINTBALL_DECAL (DECAL_HUMAN_BLOOD) 27 | 28 | extern void TogglePaintBallMode(void); 29 | extern void PaintBallMode_DrawCurrentDecalAtTarget(void); 30 | extern void PaintBallMode_ChangeSelectedDecalID(int delta); 31 | extern void PaintBallMode_ChangeSize(int delta); 32 | extern void PaintBallMode_AddDecal(void); 33 | 34 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/support/ourbool.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | ourbool.h 4 | 5 | Exists in order to define the type OurBool; 6 | */ 7 | 8 | #ifndef _ourbool 9 | #define _ourbool 1 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /* Version settings *****************************************************/ 16 | 17 | /* Constants ***********************************************************/ 18 | 19 | /* Macros ***************************************************************/ 20 | 21 | /* Type definitions *****************************************************/ 22 | typedef char OurBool; 23 | // marker for an explicitly boolean type (e.g. for a return value) 24 | 25 | /* Exported globals *****************************************************/ 26 | 27 | /* Function prototypes **************************************************/ 28 | 29 | 30 | 31 | /* End of the header ****************************************************/ 32 | 33 | 34 | #ifdef __cplusplus 35 | }; 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_cable.h: -------------------------------------------------------------------------------- 1 | #ifndef _bh_cable_h 2 | #define _bh_cable_h 1 3 | 4 | #ifdef __cplusplus 5 | 6 | extern "C" { 7 | 8 | #endif 9 | 10 | extern void* PowerCableBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr); 11 | extern void PowerCableBehaveFun(STRATEGYBLOCK* sbptr); 12 | 13 | 14 | #define CABLE_HEALTH_DISTANCE 2000 15 | 16 | typedef struct power_cable_behav_block 17 | { 18 | AVP_BEHAVIOUR_TYPE bhvr_type; 19 | 20 | char nameID[SB_NAME_LENGTH]; 21 | 22 | VECTORCH position; 23 | 24 | int max_charge; //health value in fixed point 25 | int current_charge; //ditto 26 | int recharge_rate; //recharge rate per second 27 | }POWER_CABLE_BEHAV_BLOCK; 28 | 29 | typedef struct power_cable_tools_template 30 | { 31 | char nameID[SB_NAME_LENGTH]; 32 | VECTORCH position; 33 | int max_charge; 34 | int current_charge; 35 | int recharge_rate; 36 | }POWER_CABLE_TOOLS_TEMPLATE; 37 | 38 | 39 | 40 | 41 | 42 | #ifdef __cplusplus 43 | 44 | }; 45 | 46 | #endif 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/CHNKIMAG.HPP: -------------------------------------------------------------------------------- 1 | #ifndef _included__chnkimag_hpp_ 2 | #define _included__chnkimag_hpp_ 3 | 4 | #error "This file is obsolete" 5 | 6 | #include 7 | 8 | #include "d3_image.hpp" 9 | #include "mishchnk.hpp" 10 | #include "bmpnames.hpp" 11 | 12 | extern "C" extern char projectsubdirectory[]; 13 | 14 | extern char const * GameTex_Directory; 15 | extern char const * GenTex_Directory; 16 | extern char const * FixTex_Directory; 17 | extern char const * ToolsTex_Directory; 18 | 19 | struct CL_RIFFImage : public CL_Image 20 | { 21 | public: 22 | static char const * game_mode; // game mode defines palette and set of graphics - can be null or "" for default 23 | 24 | CL_RIFFImage() : CL_Image() {} 25 | CL_RIFFImage(CL_Image const & base) : CL_Image(base) {} 26 | 27 | private: 28 | virtual CL_Error Locate(char const * iname, int const enum_id); 29 | 30 | void GetPath(ImageDescriptor const & idsc, Environment_Data_Chunk * envd, BMPN_Flags bflags); 31 | }; 32 | 33 | #endif // !_included__chnkimag_hpp_ 34 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_videoscreen.h: -------------------------------------------------------------------------------- 1 | #ifndef _bh_videoscreen_h 2 | #define _bh_videoscreen_h 3 | 4 | typedef struct video_screen_behav_block 5 | { 6 | AVP_BEHAVIOUR_TYPE bhvr_type; 7 | BOOL Indestructable; 8 | 9 | TXACTRLBLK *inan_tac;//for video screens with anims on them 10 | 11 | int destruct_target_request; 12 | char destruct_target_ID[SB_NAME_LENGTH]; 13 | STRATEGYBLOCK* destruct_target_sbptr; 14 | 15 | }VIDEO_SCREEN_BEHAV_BLOCK; 16 | 17 | 18 | typedef struct toolsdata_video_screen 19 | { 20 | struct vectorch position; 21 | struct euler orientation; 22 | int shapeIndex; 23 | char nameID[SB_NAME_LENGTH]; 24 | int integrity; // 0-20 (>20 = indestructable) 25 | 26 | int destruct_target_request; 27 | char destruct_target_ID[SB_NAME_LENGTH]; 28 | 29 | 30 | }TOOLS_DATA_VIDEO_SCREEN; 31 | 32 | void* InitVideoScreen(void* bhdata,STRATEGYBLOCK *sbPtr); 33 | void VideoScreenBehaviour(STRATEGYBLOCK *sbPtr); 34 | void VideoScreenIsDamaged(STRATEGYBLOCK *sbPtr, DAMAGE_PROFILE *damage, int multiple); 35 | 36 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/movement.txt: -------------------------------------------------------------------------------- 1 | Movement Speeds 2 | 3 | Feel free to experiment with the values. 4 | (10000 mm per second means the player 5 | can cover 100m in 10 seconds.) 6 | 7 | You MUST leave the # signs in front of the numbers; 8 | please do not change this file in any other way! 9 | 10 | 11 | * Alien Movement Values * 12 | 13 | Running speed, (mm per second) 14 | #18000 15 | Side-step speed, (mm per second) 16 | #18000 17 | Turning speed, (revolutions per second * 4096) 18 | #2000 19 | Jumping speed, (mm per second) 20 | #9000 21 | 22 | * Predator Movement Values * 23 | 24 | Running speed, (mm per second) 25 | #16000 26 | Side-step speed, (mm per second) 27 | #16000 28 | Turning speed, (revolutions per second * 4096) 29 | #2000 30 | Jumping speed, (mm per second) 31 | #9000 32 | 33 | 34 | * Marine Movement Values * 35 | 36 | Running speed, (mm per second) 37 | #15000 38 | Side-step speed, (mm per second) 39 | #15000 40 | Turning speed, (revolutions per second * 4096) 41 | #2000 42 | Jumping speed, (mm per second) 43 | #9000 44 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_deathvol.h: -------------------------------------------------------------------------------- 1 | #ifndef _bh_deathvol_h 2 | #define _bh_deathvol_h 1 3 | 4 | #ifdef __cplusplus 5 | 6 | extern "C" { 7 | 8 | #endif 9 | 10 | extern void* DeathVolumeBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr); 11 | extern void DeathVolumeBehaveFun(STRATEGYBLOCK* sbptr); 12 | 13 | 14 | typedef struct death_volume_behav_block 15 | { 16 | AVP_BEHAVIOUR_TYPE bhvr_type; 17 | VECTORCH volume_min; 18 | VECTORCH volume_max; 19 | unsigned int damage_per_second; //0 means infinite damage (a proper death volume - bwa ha ha.) 20 | unsigned int active :1; 21 | unsigned int collision_required :1; 22 | }DEATH_VOLUME_BEHAV_BLOCK; 23 | 24 | typedef struct death_volume_tools_template 25 | { 26 | char nameID[SB_NAME_LENGTH]; 27 | VECTORCH volume_min; 28 | VECTORCH volume_max; 29 | unsigned int damage_per_second; 30 | unsigned int active :1; 31 | unsigned int collision_required :1; 32 | }DEATH_VOLUME_TOOLS_TEMPLATE; 33 | 34 | 35 | 36 | 37 | 38 | #ifdef __cplusplus 39 | 40 | }; 41 | 42 | #endif 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/sphere.h: -------------------------------------------------------------------------------- 1 | #ifndef _included_sphere_h_ /* Is this your first time? */ 2 | #define _included_sphere_h_ 1 3 | 4 | 5 | typedef struct 6 | { 7 | int v[3]; 8 | } TRI_FACE; 9 | 10 | #define SPHERE_ORDER 6 11 | #define SPHERE_RADIUS ONE_FIXED 12 | #define SPHERE_FACES (8*SPHERE_ORDER*SPHERE_ORDER) 13 | #define SPHERE_VERTICES (4*SPHERE_ORDER*SPHERE_ORDER+2) 14 | #define SPHERE_TEXTURE_WRAP 4 15 | extern VECTORCH SphereVertex[]; 16 | extern VECTORCH SphereRotatedVertex[]; 17 | extern VECTORCH SphereAtmosRotatedVertex[]; 18 | extern int SphereAtmosU[]; 19 | extern int SphereAtmosV[]; 20 | extern TRI_FACE SphereFace[]; 21 | extern int SphereVertexHeight[]; 22 | 23 | typedef struct 24 | { 25 | VECTORCH Position[SPHERE_VERTICES]; 26 | VECTORCH Velocity[SPHERE_VERTICES]; 27 | int RipplePhase[SPHERE_VERTICES]; 28 | int BeenStopped[SPHERE_VERTICES]; 29 | 30 | int ExplosionPhase; 31 | int NumberVerticesMoving; 32 | int LifeTime; 33 | int UseCollisions; 34 | 35 | } VOLUMETRIC_EXPLOSION; 36 | 37 | extern void Generate_Sphere(void); 38 | 39 | 40 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/PHEROMON.H: -------------------------------------------------------------------------------- 1 | /*-----------------------Patrick 14/11/96-------------------------- 2 | Header for AVP Pheromone system 3 | -----------------------------------------------------------------*/ 4 | 5 | #define SUPER_PHEROMONE_SYSTEM 1 6 | 7 | /* Global Data access to pheromone system */ 8 | 9 | extern unsigned int *PherPl_ReadBuf; 10 | extern unsigned int *PherPl_WriteBuf; 11 | #if SUPER_PHEROMONE_SYSTEM 12 | extern unsigned int *PherAls_ReadBuf; 13 | extern unsigned int *PherAls_WriteBuf; 14 | 15 | extern unsigned int *PherMars_ReadBuf; 16 | extern unsigned int *PherMars_WriteBuf; 17 | #endif 18 | extern unsigned char *PherAi_Buf; 19 | extern MODULE *playerPherModule; 20 | 21 | /* function prototypes */ 22 | void InitPheromoneSystem(void); 23 | void PlayerPheromoneSystem(void); 24 | void AiPheromoneSystem(void); 25 | void CleanUpPheromoneSystem(void); 26 | int AIModuleAdmitsPheromones(AIMODULE *targetModule); 27 | 28 | #if SUPER_PHEROMONE_SYSTEM 29 | void AddMarinePheromones(AIMODULE *targetModule); 30 | void MaintainMarineTargetZone(AIMODULE *targetModule); 31 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/fail.h: -------------------------------------------------------------------------------- 1 | /* LotU: Error handling functions. 2 | 3 | Copyright (C) 1995, Jamie Lokier. 4 | Written for Rebellion Developments, Ltd. 5 | 6 | Permission to use, copy, modify and distribute this file for any 7 | purpose by Rebellion Developments, Ltd. is hereby granted. If you 8 | want to use this file outside the company, please let me know. 9 | */ 10 | 11 | #ifndef __fail_h 12 | #define __fail_h 1 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifdef _MSC_VER 19 | #define VARARG_DECL __cdecl 20 | #else 21 | #define VARARG_DECL 22 | #endif 23 | 24 | #ifdef __GNUC__ 25 | 26 | #if __GNUC__ >= 2 && __GNUC_MINOR__ >= 5 27 | extern void 28 | VARARG_DECL fail (const char * __format, ...) 29 | __attribute__ ((noreturn, format (printf, 1, 2))); 30 | #else 31 | extern __volatile__ void VARARG_DECL fail (const char * __format, ...); 32 | #endif 33 | 34 | #else 35 | 36 | extern void VARARG_DECL fail (const char * __format, ...); 37 | 38 | #endif 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* __fail_h */ 45 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/DetailLevels.h: -------------------------------------------------------------------------------- 1 | #ifndef _detaillevels_h_ 2 | #define _detaillevels_h_ 1 3 | typedef struct 4 | { 5 | unsigned int MaximumAllowedNumberOfDecals; 6 | unsigned int AlienEnergyViewThreshold; 7 | unsigned int NumberOfSmokeParticlesFromLargeExplosion; 8 | unsigned int NumberOfSmokeParticlesFromSmallExplosion; 9 | 10 | unsigned int BloodCollidesWithEnvironment :1; 11 | unsigned int DrawLightCoronas :1; 12 | unsigned int DrawHierarchicalDecals :1; 13 | unsigned int ExplosionsDeformToEnvironment :1; 14 | unsigned int GhostFlameThrowerCollisions :1; 15 | 16 | } DETAIL_LEVELS; 17 | 18 | extern DETAIL_LEVELS LocalDetailLevels; 19 | typedef struct 20 | { 21 | int DecalNumber; 22 | int LightCoronas; 23 | int DecalsOnCharacters; 24 | int DeformableExplosions; 25 | int CharacterComplexity; 26 | int ParticleComplexity; 27 | 28 | } MENU_DETAIL_LEVEL_OPTIONS; 29 | 30 | extern MENU_DETAIL_LEVEL_OPTIONS MenuDetailLevelOptions; 31 | 32 | 33 | extern void SetToDefaultDetailLevels(void); 34 | extern void SetToMinimalDetailLevels(void); 35 | 36 | extern void SetDetailLevelsFromMenu(void); 37 | 38 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/ShowCmds.h: -------------------------------------------------------------------------------- 1 | /* KJL 14:42:10 29/03/98 - ShowCmds.h 2 | 3 | defines the variables that describe the status of the debugging text 4 | 5 | 6 | eg. if ShowDebuggingText.FPS == 1, then the frame-rate show be displayed. 7 | 8 | */ 9 | struct DEBUGGINGTEXTOPTIONS 10 | { 11 | unsigned int FPS :1; 12 | unsigned int Environment :1; 13 | unsigned int Coords :1; 14 | unsigned int Module :1; 15 | unsigned int Target :1; 16 | 17 | unsigned int Networking: 1; 18 | unsigned int Dynamics :1; 19 | unsigned int GunPos :1; 20 | unsigned int Tears :1; 21 | unsigned int PolyCount :1; 22 | unsigned int Sounds :1; 23 | }; 24 | 25 | extern struct DEBUGGINGTEXTOPTIONS ShowDebuggingText; 26 | 27 | #ifdef AVP_DEBUG_VERSION 28 | #define DEBUGGING_TEXT_ON 1 29 | #else 30 | #define DEBUGGING_TEXT_ON 0 31 | #endif 32 | 33 | #if DEBUGGING_TEXT_ON 34 | extern int PrintDebuggingText(const char* t, ...); 35 | #else 36 | #define PrintDebuggingText(ignore) 37 | #endif 38 | 39 | #if 1 40 | extern int ReleasePrintDebuggingText(const char* t, ...); 41 | #else 42 | #define PrintDebuggingText(ignore) 43 | #endif 44 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/smacker.h: -------------------------------------------------------------------------------- 1 | /* KJL 15:25:20 8/16/97 2 | * 3 | * smacker.h - functions to handle FMV playback 4 | * 5 | */ 6 | #include "smack.h" 7 | 8 | extern void PlayFMV(char *filenamePtr); 9 | extern void StartMenuMusic(void); 10 | extern void PlayMenuMusic(void); 11 | extern void EndMenuMusic(void); 12 | 13 | 14 | 15 | typedef struct 16 | { 17 | IMAGEHEADER *ImagePtr; 18 | Smack *SmackHandle; 19 | int SoundVolume; 20 | int IsTriggeredPlotFMV; 21 | int StaticImageDrawn; 22 | 23 | int MessageNumber; 24 | 25 | LPDIRECTDRAWSURFACE SrcSurface; 26 | LPDIRECT3DTEXTURE SrcTexture; 27 | LPDIRECT3DTEXTURE DestTexture; 28 | PALETTEENTRY SrcPalette[256]; 29 | 30 | int RedScale; 31 | int GreenScale; 32 | int BlueScale; 33 | 34 | } FMVTEXTURE; 35 | 36 | 37 | extern int NextFMVTextureFrame(FMVTEXTURE *ftPtr, void *bufferPtr); 38 | extern void UpdateFMVTexturePalette(FMVTEXTURE *ftPtr); 39 | extern void InitialiseTriggeredFMVs(void); 40 | extern void StartTriggerPlotFMV(int number); 41 | 42 | extern void StartFMVAtFrame(int number, int frame); 43 | extern void GetFMVInformation(int *messageNumberPtr, int *frameNumberPtr); 44 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/endianio.c: -------------------------------------------------------------------------------- 1 | #include "endianio.h" 2 | 3 | BYTE GetByte(FILE *fp) 4 | { 5 | unsigned char c = fgetc(fp); 6 | return c; 7 | } 8 | 9 | WORD GetLittleWord(FILE *fp) 10 | { 11 | unsigned char c1 = fgetc(fp); 12 | unsigned char c2 = fgetc(fp); 13 | return c1 + (c2 << 8); 14 | } 15 | 16 | DWORD GetLittleDword(FILE *fp) 17 | { 18 | unsigned char c1 = fgetc(fp); 19 | unsigned char c2 = fgetc(fp); 20 | unsigned char c3 = fgetc(fp); 21 | unsigned char c4 = fgetc(fp); 22 | 23 | return c1 + (c2 + (c3 + (c4 << 8) << 8) << 8); 24 | } 25 | 26 | VOID PutByte(BYTE v, FILE *fp) 27 | { 28 | fputc(v, fp); 29 | } 30 | 31 | VOID PutLittleWord(WORD v, FILE *fp) 32 | { 33 | unsigned char c1 = v & 0xff; 34 | unsigned char c2 = (v >> 8) & 0xff; 35 | fputc(c1, fp); 36 | fputc(c2, fp); 37 | } 38 | 39 | VOID PutLittleDword(DWORD v, FILE *fp) 40 | { 41 | unsigned char c1 = v & 0xff; 42 | unsigned char c2 = (v >> 8) & 0xff; 43 | unsigned char c3 = (v >> 16) & 0xff; 44 | unsigned char c4 = (v >> 24) & 0xff; 45 | 46 | fputc(c1, fp); 47 | fputc(c2, fp); 48 | fputc(c3, fp); 49 | fputc(c4, fp); 50 | } 51 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/OUR_MEM.C: -------------------------------------------------------------------------------- 1 | #include "3dc.h" 2 | 3 | #include 4 | 5 | #define UseLocalAssert No 6 | 7 | #include "ourasert.h" 8 | 9 | #if debug 10 | int alloc_cnt = 0; 11 | int deall_cnt = 0; 12 | #endif 13 | 14 | void *AllocMem(size_t __size); 15 | void DeallocMem(void *__ptr); 16 | 17 | /* Note: Never use AllocMem directly ! */ 18 | /* Instead use AllocateMem() which is a */ 19 | /* macro defined in mem3dc.h that allows */ 20 | /* for debugging info. */ 21 | 22 | void *AllocMem(size_t __size) 23 | { 24 | GLOBALASSERT(__size>0); 25 | #if debug 26 | alloc_cnt++; 27 | #endif 28 | 29 | return malloc(__size); 30 | }; 31 | 32 | /* Note: Never use DeallocMem directly ! */ 33 | /* Instead use DeallocateMem() which is a */ 34 | /* macro defined in mem3dc.h that allows */ 35 | /* for debugging info. */ 36 | 37 | void DeallocMem(void *__ptr) 38 | { 39 | #if debug 40 | deall_cnt++; 41 | #endif 42 | 43 | if(__ptr) free(__ptr); 44 | 45 | #if debug 46 | else { 47 | 48 | textprint("ERROR - freeing null ptr\n"); 49 | WaitForReturn(); 50 | 51 | } 52 | #endif 53 | }; 54 | 55 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/TOOLCHNK.CPP: -------------------------------------------------------------------------------- 1 | #include "toolchnk.hpp" 2 | 3 | #ifdef cencon 4 | #define new my_new 5 | #endif 6 | 7 | //macro for helping to force inclusion of chunks when using libraries 8 | FORCE_CHUNK_INCLUDE_IMPLEMENT(toolchnk) 9 | 10 | RIF_IMPLEMENT_DYNCREATE("CAMORIGN",Camera_Origin_Chunk) 11 | 12 | Camera_Origin_Chunk::Camera_Origin_Chunk(Chunk_With_Children* parent) 13 | :Chunk(parent,"CAMORIGN") 14 | { 15 | location.x=0; 16 | location.y=0; 17 | location.z=0; 18 | ChunkMatrix identity={1,0,0,0,1,0,0,0,1}; 19 | orientation=identity; 20 | } 21 | 22 | Camera_Origin_Chunk::Camera_Origin_Chunk(Chunk_With_Children* parent,const char* data,size_t ) 23 | :Chunk(parent,"CAMORIGN") 24 | { 25 | location=*(ChunkVector*)data; 26 | data+=sizeof(ChunkVector); 27 | orientation=*(ChunkMatrix*)data; 28 | } 29 | 30 | void Camera_Origin_Chunk::fill_data_block(char * data_start) 31 | { 32 | strncpy (data_start, identifier, 8); 33 | data_start += 8; 34 | *((int *) data_start) = chunk_size; 35 | data_start += 4; 36 | 37 | *(ChunkVector*)data_start=location; 38 | data_start+=sizeof(ChunkVector); 39 | *(ChunkMatrix*)data_start=orientation; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/MEM3DCPP.CPP: -------------------------------------------------------------------------------- 1 | #include "mem3dc.h" 2 | 3 | #if DBGMALLOC 4 | 5 | #if 1 6 | 7 | // try and turn C++ new/delete tracking on such that 8 | // we can do a malloc dump when the global objects 9 | // with associated memory allocated is recored, the 10 | // deallocation is recored, and then a malloc dump 11 | // is done 12 | 13 | // note that some global objects wont have their memory 14 | // allocations/deallocations in the constructor/destructor 15 | // tracked through record_malloc/record_free, but since 16 | // global objects are deconstructed in the reverse order 17 | // from construction, the deallocation type in the destructor 18 | // will correspond to the allocation type in the constructor 19 | 20 | int __cpp_new_recording = 0; 21 | 22 | class DebugObject 23 | { 24 | public: 25 | DebugObject(); 26 | ~DebugObject(); 27 | }; 28 | 29 | DebugObject::DebugObject() 30 | { 31 | __cpp_new_recording = 1; 32 | } 33 | 34 | DebugObject::~DebugObject() 35 | { 36 | __cpp_new_recording = 0; 37 | DumpMallocInfo(DUMPTOFILE); 38 | } 39 | 40 | static DebugObject dbo; 41 | 42 | #else 43 | 44 | int __cpp_new_recording = 1; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/davehook.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | davehook.h 4 | 5 | 6 | Created 18/11/97 by DHM: 7 | Contains all the hooks for my code 8 | */ 9 | 10 | #ifndef _davehook 11 | #define _davehook 1 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /* Version settings *****************************************************/ 18 | 19 | /* Constants ***********************************************************/ 20 | 21 | /* Macros ***************************************************************/ 22 | 23 | /* Type definitions *****************************************************/ 24 | 25 | /* Exported globals *****************************************************/ 26 | 27 | /* Function prototypes **************************************************/ 28 | extern void DAVEHOOK_Init(void); 29 | extern void DAVEHOOK_UnInit(void); 30 | extern void DAVEHOOK_Maintain(void); 31 | 32 | extern void DAVEHOOK_ScreenModeChange_Setup(void); 33 | extern void DAVEHOOK_ScreenModeChange_Cleanup(void); 34 | 35 | 36 | 37 | 38 | /* End of the header ****************************************************/ 39 | 40 | 41 | #ifdef __cplusplus 42 | }; 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_ltfx.h: -------------------------------------------------------------------------------- 1 | #ifndef _bh_ltfx_h 2 | #define _bh_ltfx_h 1 3 | 4 | #include "ltfx_exp.h" 5 | 6 | 7 | typedef struct light_fx_behav_block 8 | { 9 | AVP_BEHAVIOUR_TYPE bhvr_type; 10 | 11 | LIGHT_FX_TYPE type; 12 | LIGHT_FX_STATE current_state; 13 | 14 | unsigned long fade_up_speed; 15 | unsigned long fade_down_speed; 16 | 17 | unsigned long post_fade_up_delay; 18 | unsigned long post_fade_down_delay; 19 | 20 | unsigned long fade_up_speed_multiplier; 21 | unsigned long fade_down_speed_multiplier; 22 | 23 | unsigned long post_fade_up_delay_multiplier; 24 | unsigned long post_fade_down_delay_multiplier; 25 | 26 | signed long multiplier; 27 | unsigned long timer; 28 | unsigned long timer2; 29 | 30 | signed long time_to_next_flicker_state; 31 | 32 | TXACTRLBLK *anim_control; 33 | } LIGHT_FX_BEHAV_BLOCK; 34 | 35 | typedef struct light_fx_tools_template 36 | { 37 | 38 | LightFXData light_data; 39 | 40 | char nameID[SB_NAME_LENGTH]; 41 | MREF my_module; 42 | 43 | } LIGHT_FX_TOOLS_TEMPLATE; 44 | 45 | void * LightFXBehaveInit (void * bhdata, STRATEGYBLOCK* sbptr); 46 | void LightFXBehaveFun (STRATEGYBLOCK* sbptr); 47 | 48 | 49 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_ldoor.h: -------------------------------------------------------------------------------- 1 | /******************** LIFT DOORS ********************/ 2 | 3 | /* 4 | lift doors do not have to look at the environment for 5 | triggers. they wait for the controlling lift block to 6 | say open or closed. EXCEPT when the door is open it 7 | will not close if some other object is in its module 8 | */ 9 | 10 | 11 | typedef struct lift_door_behaviour_type 12 | { 13 | AVP_BEHAVIOUR_TYPE bhvr_type; 14 | DOOR_STATES door_state; 15 | MORPHCTRL *PDmctrl; 16 | 17 | DOOR_STATES request_state; 18 | 19 | int SoundHandle; 20 | 21 | /*---- Patrick 1/1/97 ----- 22 | added for far ai stratgies 23 | --------------------------*/ 24 | int door_opening_speed; 25 | int door_closing_speed; 26 | } LIFT_DOOR_BEHAV_BLOCK; 27 | 28 | 29 | typedef struct lift_door_tools_template 30 | { 31 | BOOL state; 32 | MREF my_module; 33 | int shape_open; 34 | int shape_closed; 35 | char nameID[SB_NAME_LENGTH]; 36 | 37 | int door_opening_speed; 38 | int door_closing_speed; 39 | } LIFT_DOOR_TOOLS_TEMPLATE; 40 | 41 | 42 | extern void* LiftDoorBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr); 43 | extern void LiftDoorBehaveFun(STRATEGYBLOCK* sbptr); 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/CL_INIT.CPP: -------------------------------------------------------------------------------- 1 | #include "cl_init.h" 2 | #include "system.h" // because the 3dc header files don't automatically include the ones they need 3 | #include "equates.h" // because the 3dc header files don't automatically include the ones they need 4 | #include "platform.h" // for VideoModeTypes 5 | #include "shape.h" // because the 3dc header files don't automatically include the ones they need 6 | #include "prototyp.h" // for SDB 7 | #include "d3_image.hpp" // for init functions 8 | 9 | extern "C" extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock; 10 | 11 | void CL_Init_All(void) 12 | { 13 | switch (VideoModeTypeScreen) 14 | { 15 | case VideoModeType_8: 16 | if (ScreenDescriptorBlock.SDB_Flags & SDB_Flag_TLTPalette) 17 | CL_Init_DirectDrawMode(CLV_8TLT); 18 | else 19 | CL_Init_DirectDrawMode(CLV_8); 20 | break; 21 | case VideoModeType_15: 22 | CL_Init_DirectDrawMode(CLV_15); 23 | break; 24 | case VideoModeType_24: 25 | CL_Init_DirectDrawMode(CLV_24); 26 | break; 27 | case VideoModeType_8T: 28 | CL_Init_DirectDrawMode(CLV_8T); 29 | break; 30 | } 31 | 32 | if (ScanDrawDirectDraw != ScanDrawMode) 33 | CL_Init_D3DMode(&(d3d.TextureFormat[d3d.CurrentTextureFormat].ddsd)); 34 | } 35 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/modcmds.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | modcmds.hpp 4 | 5 | */ 6 | 7 | #ifndef _modcmds 8 | #define _modcmds 1 9 | 10 | #ifndef MODULE_INCLUDED 11 | #include "module.h" 12 | #endif 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /* Version settings *****************************************************/ 19 | 20 | /* Constants ***********************************************************/ 21 | 22 | /* Macros ***************************************************************/ 23 | 24 | /* Type definitions *****************************************************/ 25 | 26 | /* Exported globals *****************************************************/ 27 | 28 | /* Function prototypes **************************************************/ 29 | namespace ModuleCommands 30 | { 31 | void ListModules(void); 32 | 33 | void TryToTeleport(char* UpperCasePotentialModuleName); 34 | 35 | MODULE* FindModule(char* UpperCasePotentialModuleName); 36 | // allowed to return NULL if no match 37 | 38 | void TeleportPlayerToModule(MODULE* pModule_Dst); 39 | }; 40 | 41 | 42 | 43 | /* End of the header ****************************************************/ 44 | 45 | 46 | #ifdef __cplusplus 47 | }; 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/sfx.h: -------------------------------------------------------------------------------- 1 | #ifndef _included_sfx_h_ /* Is this your first time? */ 2 | #define _included_sfx_h_ 1 3 | 4 | #define MAX_NO_OF_SFX_BLOCKS 10 5 | enum SFX_ID 6 | { 7 | SFX_NONE, 8 | SFX_MUZZLE_FLASH_SMARTGUN, 9 | SFX_MUZZLE_FLASH_AMORPHOUS, 10 | SFX_PREDATOR_PLASMA_BOLT, 11 | SFX_SMALL_PREDATOR_PLASMA_BOLT, 12 | SFX_FRISBEE_PLASMA_BOLT, 13 | SFX_MUZZLE_FLASH_SKEETER, 14 | MAX_NO_OF_SFXS, 15 | }; 16 | 17 | typedef struct sfxblock 18 | { 19 | enum SFX_ID SfxID; 20 | 21 | unsigned int EffectDrawnLastFrame:1; // useful for strobing effects 22 | 23 | 24 | } SFXBLOCK; 25 | 26 | #define SFXFLAG_ISAFFECTEDBYHEAT 0x1 27 | #define SFXFLAG_MELTINGINTOGROUND 0x2 28 | #define SFXFLAG_ONFIRE 0x4 29 | #define SFXFLAG_SPARKING 0x8 30 | 31 | typedef struct forcefield 32 | { 33 | VECTORCH Corner; 34 | VECTORCH Scale; 35 | int ModuleIndex; 36 | 37 | } FORCEFIELD; 38 | 39 | 40 | 41 | extern void InitialiseSfxBlocks(void); 42 | extern SFXBLOCK* AllocateSfxBlock(void); 43 | extern void DeallocateSfxBlock(SFXBLOCK *sfxPtr); 44 | 45 | 46 | extern struct displayblock *CreateSFXObject(enum SFX_ID sfxID); 47 | extern void DrawSfxObject(struct displayblock *dispPtr); 48 | 49 | extern void HandleSfxForObject(DISPLAYBLOCK *dispPtr); 50 | 51 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/COMP_SHP.H: -------------------------------------------------------------------------------- 1 | 2 | extern SHAPEHEADER** mainshapelist; 3 | 4 | extern int start_of_loaded_shapes; 5 | 6 | extern SHAPEHEADER CUBE_header; 7 | extern SHAPEHEADER PRISM_header; 8 | extern SHAPEHEADER BOB_header; 9 | extern SHAPEHEADER ALIEN_header; 10 | extern SHAPEHEADER BLOODSPLASH_header; 11 | extern SHAPEHEADER BULLETRICOCHET_header; 12 | extern SHAPEHEADER EXPLOSION_header; 13 | extern SHAPEHEADER BOBCROUCH_header; 14 | extern SHAPEHEADER BOBLIE_header; 15 | extern SHAPEHEADER FLAME1_header; 16 | extern SHAPEHEADER FLAME2_header; 17 | extern SHAPEHEADER LGRENADE_header; 18 | 19 | typedef enum marineshapesenum 20 | { 21 | I_ShapeCube, 22 | I_ShapePrism, 23 | I_ShapeMarinePlayer, 24 | I_ShapePredatorPlayer, 25 | I_ShapeAlienPlayer, 26 | I_ShapeAlien, 27 | I_ShapeBloodSplash, 28 | I_ShapeBulletRicochet, 29 | I_ShapeExplosion, 30 | I_ShapeMarinePlayerCrouch, 31 | I_ShapeMarinePlayerLieDown, 32 | I_ShapeFlame1, 33 | I_ShapeFlame2, 34 | I_ShapeLGrenade, 35 | I_ShapePulseRifle, 36 | I_ShapeAAShotgun, 37 | I_ShapeCanisterGun, 38 | I_ShapeFThrower, 39 | I_ShapeSmartGun, 40 | I_ShapePig, 41 | I_ShapeLATW, 42 | I_ShapeParticle, 43 | I_ShapeRocket, 44 | I_ShapeGenerator, 45 | 46 | } MARINE_SHAPES_ENUM; 47 | 48 | 49 | extern int load_precompiled_shapes(void); 50 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/mempool.c: -------------------------------------------------------------------------------- 1 | #include "ourasert.h" 2 | #include "mem3dc.h" 3 | #include "mempool.h" 4 | 5 | 6 | #if USE_LEVEL_MEMORY_POOL 7 | 8 | #define MAX_NUM_MEMORY_BLOCK 40 9 | #define MEMORY_BLOCK_SIZE (1024*1024) 10 | 11 | static char* MemoryBlocks[MAX_NUM_MEMORY_BLOCK]; 12 | static int CurrentMemoryBlock =-1; 13 | 14 | static char* MemoryPoolPtr=0; 15 | static unsigned int MemoryLeft=0; 16 | 17 | 18 | void* PoolAllocateMem(unsigned int amount) 19 | { 20 | char* retval; 21 | 22 | GLOBALASSERT(amount<=MEMORY_BLOCK_SIZE) 23 | 24 | if(amount>MemoryLeft) 25 | { 26 | CurrentMemoryBlock++; 27 | GLOBALASSERT(CurrentMemoryBlock>1) /* fixed point seconds */ 53 | #define PLATFORMLIFT_NUMNETMESSAGES 5 54 | 55 | void InitialisePlatformLift(void* bhdata, STRATEGYBLOCK *sbPtr); 56 | void PlatformLiftBehaviour(STRATEGYBLOCK *sbPtr); 57 | 58 | void ActivatePlatformLift(STRATEGYBLOCK *sbPtr); 59 | void SendPlatformLiftUp(STRATEGYBLOCK *sbPtr); 60 | void SendPlatformLiftDown(STRATEGYBLOCK *sbPtr); 61 | void StopPlatformLift(STRATEGYBLOCK *sbPtr); 62 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/scream.h: -------------------------------------------------------------------------------- 1 | #ifndef scream_h 2 | #define scream_h 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef enum sound_category { 9 | SC_Angry=0, 10 | SC_Panic, 11 | SC_Pain, 12 | SC_Death, 13 | SC_Surprise, 14 | SC_Oooph, 15 | SC_OnFire, 16 | SC_Electrocution, 17 | SC_Sobbing, 18 | SC_Acid, 19 | SC_Facehugged, 20 | SC_PC_OnFire, 21 | SC_Taunt, 22 | SC_Falling, 23 | SC_Jump, 24 | } SOUND_CATERGORY; 25 | 26 | typedef enum alien_sound_category 27 | { 28 | ASC_TailSound, 29 | ASC_Swipe, 30 | ASC_Scream_Hurt, 31 | ASC_Scream_Dying, 32 | ASC_Scream_General, 33 | ASC_Taunt, 34 | ASC_LimbLoss, 35 | ASC_Death, 36 | ASC_PC_OnFire, 37 | }ALIEN_SOUND_CATEGORY; 38 | 39 | typedef enum predator_sound_category 40 | { 41 | PSC_Swipe, 42 | PSC_Scream_Hurt, 43 | PSC_Scream_Dying, 44 | PSC_Scream_General, 45 | PSC_Taunt, 46 | PSC_Acid, 47 | PSC_Facehugged, 48 | PSC_PC_OnFire, 49 | PSC_Jump, 50 | PSC_Medicomp_Special, 51 | }PREDATOR_SOUND_CATEGORY; 52 | 53 | typedef enum queen_sound_category 54 | { 55 | QSC_Hiss, 56 | QSC_Scream_Hurt, 57 | 58 | QSC_Object_Bounce, //not actually used by the queen , but only occurs in queen's level 59 | }QUEEN_SOUND_CATEGORY; 60 | 61 | void UnloadScreamSounds(); 62 | 63 | void LoadMarineScreamSounds(); 64 | void LoadAlienScreamSounds(); 65 | void LoadPredatorScreamSounds(); 66 | void LoadQueenScreamSounds(); 67 | 68 | void PlayMarineScream(int VoiceType,int SoundCategory,int PitchShift,int* ExternalRef,VECTORCH* Location); 69 | void PlayAlienSound(int VoiceType,int SoundCategory,int PitchShift,int* ExternalRef,VECTORCH* Location); 70 | void PlayPredatorSound(int VoiceType,int SoundCategory,int PitchShift,int* ExternalRef,VECTORCH* Location); 71 | void PlayQueenSound(int VoiceType,int SoundCategory,int PitchShift,int* ExternalRef,VECTORCH* Location); 72 | 73 | #ifdef __cplusplus 74 | }; 75 | #endif 76 | 77 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/KRENDER.H: -------------------------------------------------------------------------------- 1 | /* If this define is set to a non-zero value then the new scandraws will be used */ 2 | #define KRENDER_ON 1 3 | 4 | /* prototypes of the replacement scandraw functions */ 5 | extern void KR_ScanDraw_Item_2dTexturePolygon_VideoModeType_8(int *itemptr); 6 | extern void KR_ScanDraw_Item_Gouraud2dTexturePolygon_VideoModeType_8(int *itemptr); 7 | extern void KR_ScanDraw_Item_Gouraud3dTexturePolygon_Linear_S_VideoModeType_8(int *itemptr); 8 | extern void MotionTrackerRotateBlit(void); 9 | extern void MotionTrackerRotateBlit8(void); 10 | 11 | 12 | /*KJL***************************************************** 13 | * Palette fading; a value of 65536 corresponds to normal * 14 | * palette, 0 is completely other (eg. all white). * 15 | *****************************************************KJL*/ 16 | extern void SetPaletteFadeLevel(int fadeLevel); 17 | extern void FadeBetweenPalettes(unsigned char *palPtr, int fadeLevel); 18 | extern void FadePaletteToWhite(unsigned char *palPtr,int fadeLevel); 19 | 20 | /*KJL********************************************* 21 | * Fill the screen with black & flip then repeat. * 22 | *********************************************KJL*/ 23 | extern void BlankScreen(void); 24 | 25 | 26 | /* KJL 16:06:24 04/04/97 - To choose between laced and full screen modes */ 27 | extern int KRenderDrawMode; 28 | 29 | 30 | 31 | 32 | 33 | 34 | extern void KDraw_Item_GouraudPolygon(int *itemptr); 35 | extern void KDraw_Item_2dTexturePolygon(int *itemptr); 36 | extern void KDraw_Item_Gouraud2dTexturePolygon(int *itemptr); 37 | extern void KDraw_Item_Gouraud3dTexturePolygon(int *itemptr); 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | extern void MakeViewingWindowSmaller(void); 51 | extern void MakeViewingWindowLarger(void); 52 | 53 | /* routines to draw a star filled sky */ 54 | extern void CreateStarArray(void); 55 | extern void DrawStarfilledSky(void); -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/MAPS.C: -------------------------------------------------------------------------------- 1 | /* 2 | this now contains only the map processing 3 | functions for the PC and saturn - compiled in maos 4 | have been moved to comp_map 5 | */ 6 | #include "3dc.h" 7 | #include "module.h" 8 | #include "inline.h" 9 | 10 | #include "stratdef.h" 11 | #include "gamedef.h" 12 | 13 | #define UseLocalAssert Yes 14 | 15 | #include "ourasert.h" 16 | 17 | 18 | /************ GLOBALS **********/ 19 | 20 | 21 | DISPLAYBLOCK *Player; 22 | 23 | 24 | /***************************************************************/ 25 | 26 | /* MAP TYPE PROCESSING FUNCTIONS*/ 27 | 28 | /**************************************************************/ 29 | /* 30 | The functions require a pointer to a display block. It uses "ObType" 31 | in the block to select the function. 32 | */ 33 | 34 | static void Process_Default_MapType(DISPLAYBLOCK *dblockptr); 35 | static void Process_Player_MapType(DISPLAYBLOCK *dblockptr); 36 | static void Process_PlayerShipCamera_MapType(DISPLAYBLOCK *dblockptr); 37 | static void Process_Sprite_MapType(DISPLAYBLOCK *dblockptr); 38 | static void Process_Term_MapType(DISPLAYBLOCK *dblockptr); 39 | 40 | 41 | void (*MapTypeFunctions[])(DISPLAYBLOCK *dblockptr) = 42 | { 43 | Process_Default_MapType, 44 | Process_Player_MapType, 45 | Process_PlayerShipCamera_MapType, /* Player ship camera */ 46 | Process_Sprite_MapType, 47 | Process_Term_MapType 48 | }; 49 | 50 | 51 | static void Process_Default_MapType(DISPLAYBLOCK *dptr) 52 | { 53 | dptr->ObLightType = LightType_PerVertex; 54 | dptr->ObFlags |= ObFlag_MultLSrc; 55 | } 56 | 57 | 58 | static void Process_Player_MapType(DISPLAYBLOCK *dptr) 59 | { 60 | Player = dptr; 61 | } 62 | 63 | 64 | static void Process_PlayerShipCamera_MapType(DISPLAYBLOCK *dptr) 65 | { 66 | } 67 | 68 | 69 | 70 | static void Process_Sprite_MapType(DISPLAYBLOCK *dblockptr) 71 | { 72 | } 73 | 74 | 75 | static void Process_Term_MapType(DISPLAYBLOCK *dptr) 76 | {} 77 | 78 | 79 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/menugfx.h: -------------------------------------------------------------------------------- 1 | #ifndef _included_menugfx_h_ 2 | #define _included_menugfx_h_ 3 | 4 | #include "aw.h" 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | #include "langenum.h" 9 | // structures used for the menu code 10 | 11 | typedef struct menugraphic { 12 | char *filename; 13 | int image_number; 14 | LPDIRECTDRAWSURFACE image_ptr; 15 | AW_BACKUPTEXTUREHANDLE hBackup; 16 | short destx; 17 | short desty; 18 | short width; 19 | short height; 20 | 21 | } MENUGRAPHIC; 22 | 23 | /* JH 12/5/97 these were static in menuplat.cpp - but they're quite useful functions */ 24 | extern void LoadMenuGraphic(MENUGRAPHIC* menugraphptr); 25 | extern void BLTMenuToScreen(MENUGRAPHIC* menuptr); 26 | extern void ReleaseMenuGraphic(MENUGRAPHIC* mptr); 27 | 28 | typedef struct menu_graphic_item{ 29 | int id; 30 | MENUGRAPHIC On; 31 | MENUGRAPHIC Off; 32 | } MENU_GRAPHIC_ITEM; 33 | 34 | 35 | 36 | /* KJL 15:23:39 05/03/97 - new menu_text_item, which 37 | looks as much like the menu_font_item as possible 38 | while enabling me to add language internationalization */ 39 | typedef struct menu_text_item 40 | { 41 | int id; 42 | enum TEXTSTRING_ID StringID; 43 | char *SecondStringPtr; 44 | int X; 45 | int Y; 46 | } MENU_TEXT_ITEM; 47 | 48 | 49 | 50 | // OVERALL menus - this describes one menu screen 51 | 52 | typedef struct avp_menu 53 | { 54 | MENUGRAPHIC *backdrop; 55 | MENU_GRAPHIC_ITEM *menugitems; 56 | MENU_TEXT_ITEM *menufitems; 57 | int previous_selection; 58 | int default_selection; 59 | 60 | } AVP_MENU; 61 | 62 | 63 | #define BASEX 112 64 | #define BASEY 43 65 | 66 | 67 | extern AVP_MENU *Current_Menu; 68 | extern void ProcessGraphicForLoading(AVP_MENU *menu_to_load); 69 | extern void ProcessGraphicForUnloading(AVP_MENU *menu_to_load); 70 | 71 | extern void PlatformSpecificEnteringDatabase(void); 72 | extern void PlatformSpecificExitingDatabase(void); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* ! _included_menugfx_h_ */ 79 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/support/strtab.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | strtab.hpp 4 | 5 | */ 6 | 7 | #ifndef _strtab 8 | #define _strtab 1 9 | 10 | #ifndef _projtext 11 | #include "projtext.h" 12 | #endif 13 | 14 | #ifndef _langenum_h_ 15 | #include "langenum.h" 16 | #endif 17 | 18 | #ifdef __cplusplus 19 | #ifndef _scstring 20 | #include "scstring.hpp" 21 | #endif 22 | #endif 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Version settings *****************************************************/ 29 | #define OnlyOneStringTable Yes 30 | 31 | /* Constants ***********************************************************/ 32 | 33 | /* Macros ***************************************************************/ 34 | #if OnlyOneStringTable 35 | #define STRINGTABLE_DECL_SPECIFIER static 36 | #else 37 | #define STRINGTABLE_DECL_SPECIFIER 38 | #endif 39 | 40 | /* Type definitions *****************************************************/ 41 | #ifdef __cplusplus 42 | class StringTable 43 | { 44 | public: 45 | STRINGTABLE_DECL_SPECIFIER SCString& GetSCString 46 | ( 47 | enum TEXTSTRING_ID stringID 48 | ); 49 | 50 | STRINGTABLE_DECL_SPECIFIER void Add( ProjChar* pProjChar ); 51 | 52 | #if OnlyOneStringTable 53 | static void Unload(void); 54 | #else 55 | StringTable(); 56 | ~StringTable(); 57 | #endif 58 | 59 | private: 60 | STRINGTABLE_DECL_SPECIFIER unsigned int NumStrings; 61 | STRINGTABLE_DECL_SPECIFIER SCString* pSCString[ MAX_NO_OF_TEXTSTRINGS ]; 62 | }; 63 | #endif // __cplusplus 64 | 65 | /* Exported globals *****************************************************/ 66 | 67 | /* Function prototypes **************************************************/ 68 | #if OnlyOneStringTable 69 | extern void AddToTable( ProjChar* pProjChar ); 70 | extern void UnloadTable(void); 71 | #endif 72 | 73 | 74 | /* End of the header ****************************************************/ 75 | 76 | 77 | #ifdef __cplusplus 78 | }; 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/ANIMCHNK.HPP: -------------------------------------------------------------------------------- 1 | #ifndef _animchnk_hpp 2 | #define _animchnk_hpp 3 | #include "chunk.hpp" 4 | #include "Chnktype.hpp" 5 | 6 | struct TEXANIM; 7 | 8 | 9 | class Animation_Chunk : public Chunk 10 | { 11 | public : 12 | Animation_Chunk(Chunk_With_Children* parent,const char*,size_t); 13 | Animation_Chunk(Chunk_With_Children* parent); 14 | ~Animation_Chunk(); 15 | 16 | virtual BOOL output_chunk (HANDLE &hand); 17 | 18 | virtual size_t size_chunk(); 19 | 20 | virtual void fill_data_block(char* data_start); 21 | 22 | int NumPolys; //with animation in this shape 23 | TEXANIM** AnimList; 24 | 25 | }; 26 | 27 | #define txa_flag_nointerptofirst 0x80000000 28 | 29 | struct FrameList 30 | { 31 | ~FrameList(); 32 | FrameList(TEXANIM*); 33 | #if InterfaceEngine 34 | FrameList(TEXANIM* p,FrameList* templ); 35 | #endif 36 | FrameList(TEXANIM* p,FrameList* fl,int* conv); 37 | int Speed; 38 | int Flags; 39 | 40 | int NumFrames; 41 | int CurFrame; 42 | TEXANIM* parent; 43 | 44 | int* Textures; 45 | int* UVCoords; 46 | int spare1,spare2; 47 | 48 | 49 | #if InterfaceEngine 50 | void CopyToSID(int shape,int poly); 51 | void CopyFromSID(int shape,int poly); 52 | void AddFrame(); 53 | void RemoveFrame(); 54 | #endif 55 | }; 56 | 57 | #define AnimFlag_NotPlaying 0x00000001 58 | struct TEXANIM 59 | { 60 | TEXANIM(TEXANIM*); 61 | TEXANIM(); 62 | ~TEXANIM(); 63 | 64 | #if InterfaceEngine 65 | TEXANIM(int s,int p,int id); 66 | //construct a TEXANIM using templ as a template. 67 | TEXANIM(int s,int p,TEXANIM* templ); 68 | #endif 69 | int shape; 70 | int poly; 71 | int NumVerts; 72 | int ID; 73 | int NumSeq;//number of sequences 74 | int CurSeq; 75 | int AnimFlags; 76 | int Identifier; 77 | FrameList** Seq; 78 | 79 | #if InterfaceEngine 80 | void ChangeFrame(int newseq,int newframe); 81 | void AddSeq(); 82 | void RemoveSeq(); 83 | void CopySeq(int seq_num); 84 | #endif 85 | void CopyAnimData(TEXANIM* ta,int* conv); 86 | }; 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/gadgets/rootgadg.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | rootgadg.hpp 4 | 5 | */ 6 | 7 | #ifndef _rootgadg 8 | #define _rootgadg 1 9 | 10 | #ifndef _gadget 11 | #include "gadget.h" 12 | #endif 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /* Version settings *****************************************************/ 19 | 20 | /* Constants ***********************************************************/ 21 | 22 | /* Macros ***************************************************************/ 23 | 24 | /* Type definitions *****************************************************/ 25 | 26 | #if UseGadgets 27 | class HUDGadget; // fully declared in HUDGADG.HPP 28 | 29 | class RootGadget : public Gadget 30 | { 31 | friend void GADGET_Init(void); 32 | friend void GADGET_UnInit(void); 33 | // friend functions: these get permission in order to allow 34 | // construction/destruction 35 | 36 | public: 37 | void Render 38 | ( 39 | const struct r2pos& R2Pos, 40 | const struct r2rect& R2Rect_Clip, 41 | int FixP_Alpha 42 | ); 43 | 44 | static RootGadget* GetRoot(void); 45 | 46 | HUDGadget* GetHUD(void); 47 | 48 | void RefreshHUD(void); 49 | 50 | private: 51 | RootGadget(); 52 | ~RootGadget(); 53 | 54 | private: 55 | static RootGadget* pSingleton; 56 | 57 | HUDGadget* pHUDGadg; 58 | // allowed to be NULL if no head-up-display e.g. when not in a game 59 | 60 | }; 61 | 62 | // Inline methods: 63 | inline /*static*/ RootGadget* RootGadget::GetRoot(void) 64 | { 65 | return pSingleton; 66 | } 67 | inline HUDGadget* RootGadget::GetHUD(void) 68 | { 69 | return pHUDGadg; 70 | } 71 | #endif // UseGadgets 72 | 73 | /* Exported globals *****************************************************/ 74 | 75 | /* Function prototypes **************************************************/ 76 | 77 | 78 | 79 | /* End of the header ****************************************************/ 80 | 81 | 82 | #ifdef __cplusplus 83 | }; 84 | #endif 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/ENUMSCH.HPP: -------------------------------------------------------------------------------- 1 | #ifndef _included_enumsch_hpp_ 2 | #define _included_enumsch_hpp_ 3 | 4 | #include "chunk.hpp" 5 | 6 | class Enum_Constant 7 | { 8 | public: 9 | char * cname; 10 | int value; 11 | int reserved; 12 | 13 | Enum_Constant() : cname(0), value(0), reserved(0) {} 14 | 15 | ~Enum_Constant() 16 | { 17 | if (cname) delete[] cname; 18 | } 19 | 20 | Enum_Constant(char const * const _cname, int const _value); 21 | Enum_Constant(Enum_Constant const & ec2); 22 | 23 | Enum_Constant & operator = (Enum_Constant const & ec2); 24 | 25 | BOOL operator == (Enum_Constant const & ec2) const; 26 | BOOL operator != (Enum_Constant const & ec2) const; 27 | BOOL operator < (Enum_Constant const & ec2) const; 28 | 29 | private: 30 | 31 | friend class BMP_Enums_Chunk; 32 | 33 | // constructor from buffer 34 | Enum_Constant(char const * sdata); 35 | 36 | size_t size_chunk() const; 37 | 38 | void fill_data_block(char * data_start); 39 | }; 40 | 41 | 42 | class Enum_Const_List 43 | { 44 | public: 45 | List enums; 46 | 47 | virtual ~Enum_Const_List(){} 48 | #if cencon 49 | int lowest_free_index(void); 50 | void Sort_By_Name(void); 51 | #endif 52 | }; 53 | 54 | 55 | class BMP_Enums_Chunk : public Chunk, public Enum_Const_List 56 | { 57 | public: 58 | // constructor from buffer 59 | BMP_Enums_Chunk (Chunk_With_Children * const parent, char const * sdata, size_t const ssize); 60 | 61 | #if cencon 62 | // empty constructor 63 | BMP_Enums_Chunk (Chunk_With_Children * const parent) 64 | : Chunk(parent,"BMPENUMS") 65 | , ctype(0) 66 | , reserved1(0) 67 | , reserved2(0) 68 | {} 69 | #endif 70 | 71 | ~BMP_Enums_Chunk () 72 | { 73 | if (ctype) delete[] ctype; 74 | } 75 | 76 | virtual size_t size_chunk (); 77 | virtual void fill_data_block (char * data_start); 78 | 79 | char * ctype; 80 | int reserved1; 81 | int reserved2; 82 | // List enums; 83 | 84 | private: 85 | 86 | friend class Enum_Chunk; 87 | 88 | }; 89 | 90 | 91 | #endif // !_included_enumsch_hpp_ 92 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/PCPAUSE.C: -------------------------------------------------------------------------------- 1 | /*-----------------------------Patrick 14/5/97------------------------------ 2 | Source for PC game pause stuff 3 | --------------------------------------------------------------------------*/ 4 | #include "3dc.h" 5 | #include "inline.h" 6 | #include "module.h" 7 | #include "stratdef.h" 8 | #include "gamedef.h" 9 | #include "gameplat.h" 10 | #include "bh_types.h" 11 | #include "menudefs.h" 12 | #include "menugfx.h" 13 | #include "pcmenus.h" 14 | #include "usr_io.h" 15 | 16 | #define UseLocalAssert Yes 17 | #include "ourasert.h" 18 | 19 | extern void CheckForGamePause(void); 20 | extern void SaveGameToFile(void); 21 | extern void AccessDatabase(void); 22 | extern int ScanDrawMode; 23 | 24 | 25 | void DoPcPause(void) 26 | { 27 | ReadUserInput(); 28 | ReadPlayerGameInput(Player->ObStrategyBlock); 29 | 30 | if(AvP.Network!=I_No_Network) 31 | { 32 | // escape ends game for network play 33 | AvP.MainLoopRunning = 0; 34 | AvP.GameMode = I_GM_Playing; 35 | return; 36 | } 37 | 38 | 39 | CheckForGamePause(); 40 | 41 | #if 0 42 | FlushTextprintBuffer(); 43 | AvpShowViews(); 44 | 45 | /* KJL 11:25:33 7/29/97 - this needs to be changed if 46 | the HUD goes all 3D accelerator drawn */ 47 | if (ScanDrawMode != ScanDrawDirectDraw) 48 | { 49 | WriteEndCodeToExecuteBuffer(); 50 | UnlockExecuteBufferAndPrepareForUse(); 51 | ExecuteBuffer(); 52 | EndD3DScene(); 53 | } 54 | 55 | BLTPausedToScreen(); 56 | 57 | 58 | FlipBuffers(); 59 | #endif 60 | 61 | AccessDatabase(); 62 | 63 | ResetFrameCounter(); 64 | 65 | AvP.GameMode = I_GM_Playing; 66 | } 67 | 68 | static int pauseOk = 1; 69 | void CheckForGamePause(void) 70 | { 71 | /* check for pause key */ 72 | if(PlayerStatusPtr->Mvt_InputRequests.Flags.Rqst_PauseGame) 73 | { 74 | if(pauseOk) 75 | { 76 | /* switch state */ 77 | if(AvP.GameMode == I_GM_Playing) AvP.GameMode = I_GM_Paused; 78 | else if(AvP.GameMode == I_GM_Paused) AvP.GameMode = I_GM_Playing; 79 | pauseOk = 0; 80 | } 81 | } 82 | else pauseOk = 1; 83 | } -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/gadgets/conssym.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | conssym.hpp 4 | 5 | "Console symbols" - a base class for managing auto-completion of typing. 6 | 7 | Console commands and variables are derived from this class 8 | 9 | */ 10 | 11 | #ifndef _conssym_hpp 12 | #define _conssym_hpp 1 13 | 14 | #if ( defined( __WATCOMC__ ) || defined( _MSC_VER ) ) 15 | #pragma once 16 | #endif 17 | 18 | #ifndef _scstring 19 | #include "scstring.hpp" 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /* Version settings *****************************************************/ 27 | 28 | /* Constants ***********************************************************/ 29 | 30 | /* Macros ***************************************************************/ 31 | 32 | /* Type definitions *****************************************************/ 33 | class ConsoleSymbol 34 | { 35 | friend class TextInputState; 36 | /* WARNING! 37 | 38 | TextInputState objects can refer to the list of ConsoleSymbols 39 | in order to iterate through possible completion strings. For 40 | this reason, don't destroy ConsoleSymbol objects if TextInputState 41 | objects exist... 42 | (I believe I've asserted against all such possible failures) 43 | */ 44 | 45 | public: 46 | 47 | OurBool ThisIsACheat; 48 | protected: 49 | ConsoleSymbol 50 | ( 51 | ProjChar* pProjCh_ToUse 52 | ); 53 | virtual ~ConsoleSymbol(); 54 | 55 | SCString* pSCString_Symbol; 56 | 57 | 58 | public: 59 | SCString* GetpSCString(void) const 60 | { 61 | return pSCString_Symbol; 62 | } 63 | 64 | 65 | private: 66 | static List List_pConsoleSym; 67 | }; // suggested naming: "ConsoleSym" 68 | 69 | /* Exported globals *****************************************************/ 70 | 71 | /* Function prototypes **************************************************/ 72 | 73 | 74 | 75 | /* End of the header ****************************************************/ 76 | 77 | 78 | #ifdef __cplusplus 79 | }; 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/BH_FAR.H: -------------------------------------------------------------------------------- 1 | 2 | /*------------------------Patrick 26/11/96----------------------------- 3 | Header file for FAR AI alien behaviour 4 | --------------------------------------------------------------------*/ 5 | 6 | #ifndef _bhfar_h_ 7 | #define _bhfar_h_ 1 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | 14 | /* enum for far alien target module status */ 15 | typedef enum fnpc_targetmodulestatus 16 | { 17 | NPCTM_NoEntryPoint, 18 | NPCTM_NormalRoom, 19 | NPCTM_AirDuct, 20 | NPCTM_LiftTeleport, 21 | NPCTM_ProxDoorOpen, 22 | NPCTM_ProxDoorNotOpen, 23 | NPCTM_LiftDoorOpen, 24 | NPCTM_LiftDoorNotOpen, 25 | NPCTM_SecurityDoorOpen, 26 | NPCTM_SecurityDoorNotOpen, 27 | 28 | 29 | } NPC_TARGETMODULESTATUS; 30 | 31 | /* prototypes */ 32 | extern void FarAlienBehaviour(STRATEGYBLOCK *sbPtr); 33 | extern void BuildFarModuleLocs(void); 34 | extern void KillFarModuleLocs(void); 35 | 36 | extern void LocateFarNPCInModule(STRATEGYBLOCK *sbPtr, MODULE *targetModule); 37 | extern void LocateFarNPCInAIModule(STRATEGYBLOCK *sbPtr, AIMODULE *targetModule); 38 | extern NPC_TARGETMODULESTATUS GetTargetAIModuleStatus(STRATEGYBLOCK *sbPtr, AIMODULE *targetModule, int alien); 39 | 40 | extern AIMODULE *FarNPC_GetTargetAIModuleForHunt(STRATEGYBLOCK *sbPtr,int alien); 41 | extern AIMODULE *FarNPC_GetTargetAIModuleForGlobalHunt(STRATEGYBLOCK *sbPtr); 42 | extern AIMODULE *FarNPC_GetTargetAIModuleForWander(STRATEGYBLOCK *sbPtr, AIMODULE *exception, int alien); 43 | extern AIMODULE *FarNPC_GetTargetAIModuleForRetreat(STRATEGYBLOCK *sbPtr); 44 | extern AIMODULE *FarNPC_GetTargetAIModuleForMarineRespond(STRATEGYBLOCK *sbPtr); 45 | extern void FarNpc_FlipAround(STRATEGYBLOCK *sbPtr); 46 | 47 | /* this define to help stop aliens coagulating in the environment */ 48 | #if SupportWindows95 49 | #define MAX_GENERATORNPCSPERMODULE 5 50 | #define MAX_VISIBLEGENERATORNPCS 8 //12 51 | #else 52 | /* PSX & Saturn*/ 53 | #define MAX_GENERATORNPCSPERMODULE 5 54 | #define MAX_VISIBLEGENERATORNPCS 6 55 | #endif 56 | 57 | 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_waypt.h: -------------------------------------------------------------------------------- 1 | /***** bh_waypt.h *****/ 2 | 3 | /***** Waypoint system code... *****/ 4 | 5 | /***** CDF 27/10/97 *****/ 6 | 7 | struct strategyblock; 8 | 9 | typedef struct waypoint_link { 10 | 11 | int link_target_index; 12 | int link_flags; 13 | 14 | } WAYPOINT_LINK; 15 | 16 | #define linkflag_oneway 0x00000001 /* link is... get this... one way! */ 17 | #define linkflag_reversed_oneway 0x00000002 /* link is one way, only NOT this way. */ 18 | #define linkflag_alienonly 0x00000004 19 | #define linkflag_largetarget 0x00000008 20 | 21 | typedef struct waypoint_volume { 22 | 23 | VECTORCH centre; /* in MODULE space! */ 24 | VECTORCH max_extents; 25 | VECTORCH min_extents; 26 | int flags; 27 | int workspace:14; 28 | unsigned int contains_npc:1; 29 | unsigned int contains_target:1; 30 | int num_links; 31 | WAYPOINT_LINK *first_link; 32 | unsigned char weighting; 33 | 34 | } WAYPOINT_VOLUME; 35 | 36 | #define wayflag_cancrawl 0x00000001 37 | 38 | typedef struct waypoint_header { 39 | 40 | int num_waypoints; 41 | WAYPOINT_VOLUME *first_waypoint; 42 | 43 | } WAYPOINT_HEADER; 44 | 45 | typedef struct waypoint_route { 46 | 47 | int num_waypoints; 48 | WAYPOINT_VOLUME *start; 49 | WAYPOINT_VOLUME *second; 50 | WAYPOINT_VOLUME *last; 51 | WAYPOINT_LINK *first_link; 52 | 53 | } WAYPOINT_ROUTE; 54 | 55 | typedef struct waypoint_manager { 56 | 57 | WAYPOINT_VOLUME *current_container; 58 | WAYPOINT_VOLUME *current_target; 59 | WAYPOINT_LINK *current_link; 60 | VECTORCH current_target_point; 61 | 62 | } WAYPOINT_MANAGER; 63 | 64 | extern void InitWaypointSystem(int npctype); 65 | extern int NPCGetWaypointDirection(WAYPOINT_HEADER *waypoints, struct strategyblock *sbPtr, VECTORCH *velocityDirection, VECTORCH *targetPosition, WAYPOINT_MANAGER *manager); 66 | extern int AlienIsAllowedToAttack(struct strategyblock *sbPtr); 67 | extern int AlienIsEncouragedToCrawl(void); 68 | extern WAYPOINT_VOLUME *GetPositionValidity(struct module *conmod, VECTORCH *position, VECTORCH *suggestion); 69 | extern void InitWaypointManager(WAYPOINT_MANAGER *manager); 70 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/PathChnk.cpp: -------------------------------------------------------------------------------- 1 | #include "PathChnk.hpp" 2 | //macro for helping to force inclusion of chunks when using libraries 3 | FORCE_CHUNK_INCLUDE_IMPLEMENT(pathchnk) 4 | 5 | RIF_IMPLEMENT_DYNCREATE("AVPPATH2",AVP_Path_Chunk) 6 | 7 | AVP_Path_Chunk::AVP_Path_Chunk(Chunk_With_Children* parent) 8 | :Chunk(parent,"AVPPATH2") 9 | { 10 | PathLength=0; 11 | Path=0; 12 | PathID=0; 13 | PathName=0; 14 | flags=spare2=0; 15 | } 16 | 17 | AVP_Path_Chunk::AVP_Path_Chunk(Chunk_With_Children* parent,const char* data,size_t datasize) 18 | :Chunk(parent,"AVPPATH2") 19 | { 20 | int name_length=strlen(data); 21 | PathName=new char[name_length+1]; 22 | strcpy(PathName,data); 23 | data+=(name_length+4)&~3; 24 | 25 | PathID=*(int*)data; 26 | data+=4; 27 | flags=*(int*)data; 28 | data+=4; 29 | spare2=*(int*)data; 30 | data+=4; 31 | PathLength=*(int*)data; 32 | data+=4; 33 | 34 | if(PathLength) Path=new ChunkPathPoint[PathLength]; 35 | else Path=0; 36 | 37 | for(int i=0;i 0 attached 38 | sizes. The DLL will write the requested names to these buffers, truncating 39 | if necessary. Note that the size includes any zero termination character. 40 | */ 41 | 42 | 43 | 44 | /* Input fields to DLL */ 45 | HWND hWndMain; 46 | HINSTANCE hInst; 47 | 48 | LPTSTR lptszFormalPlayerName_In; 49 | LPTSTR lptszFriendlyPlayerName_In; 50 | /* 51 | Both of these are allowed to be NULL; 52 | if non-NULL they point to zero-terminated ANSI strings 53 | */ 54 | 55 | } ExchangedDataType; 56 | /* 57 | We pass a 4-byte pointer to one of these to the DLL; 58 | some are read as inputs, some written to as outputs. 59 | 60 | Assumes Watcom and Visual C++ access structures in the 61 | same way... 62 | */ 63 | 64 | 65 | /* Exported globals *****************************************************/ 66 | 67 | /* Function prototypes **************************************************/ 68 | extern WINAPI InvokeDavesDirectPlayDLL(ExchangedDataType* pExchangedData); 69 | 70 | 71 | #ifdef __cplusplus 72 | }; 73 | #endif 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/OEChunk.h: -------------------------------------------------------------------------------- 1 | #ifndef _oechunk_h_ 2 | #define _oechunk_h_ 1 3 | 4 | #include "Chunk.hpp" 5 | #include "obchunk.hpp" 6 | 7 | #if objedit 8 | #include "Template.hpp" 9 | #endif 10 | //#if engine 11 | //#define VECTOR VECTORCH 12 | //#endif 13 | 14 | #if engine 15 | #else 16 | struct VECTORCH 17 | { 18 | int vx, vy, vz; 19 | }; 20 | #endif 21 | 22 | struct ChunkMapBlock 23 | { 24 | char TemplateName[20]; 25 | char TemplateNotes[100]; 26 | int MapType; 27 | int MapShape; 28 | int MapFlags; 29 | int MapFlags2; 30 | int MapFlags3; 31 | int MapCType; 32 | int MapCGameType; 33 | int MapCStrategyS; 34 | int MapCStrategyL; 35 | int MapInteriorType; 36 | int MapLightType; 37 | int MapMass; 38 | VECTORCH MapNewtonV; 39 | VECTORCH MapOrigin; 40 | int MapViewType; 41 | 42 | int MapVDBData; 43 | int SimShapeList; 44 | 45 | 46 | 47 | }; 48 | 49 | class Map_Block_Chunk : public Chunk 50 | { 51 | public: 52 | virtual size_t size_chunk() 53 | { 54 | return (chunk_size=216); 55 | } 56 | virtual BOOL output_chunk (HANDLE &); 57 | 58 | virtual void fill_data_block (char * data_start); 59 | 60 | ChunkMapBlock map_data; 61 | friend class Object_Project_Data_Chunk; 62 | 63 | Map_Block_Chunk (Object_Project_Data_Chunk * parent) 64 | :Chunk(parent,"MAPBLOCK") 65 | {} 66 | 67 | //constructor from buffer 68 | Map_Block_Chunk (Chunk_With_Children * parent,const char* data,size_t); 69 | }; 70 | 71 | struct ChunkStrategy 72 | { 73 | char StrategyName[20]; 74 | char StrategyNotes[100]; 75 | int Strategy; 76 | }; 77 | 78 | class Strategy_Chunk : public Chunk 79 | { 80 | public : 81 | virtual size_t size_chunk() 82 | { 83 | return (chunk_size=136); 84 | } 85 | virtual BOOL output_chunk (HANDLE &); 86 | 87 | virtual void fill_data_block (char * data_start); 88 | 89 | ChunkStrategy strategy_data; 90 | friend class Object_Project_Data_Chunk; 91 | 92 | Strategy_Chunk(Object_Project_Data_Chunk *parent) 93 | :Chunk(parent,"STRATEGY") 94 | {} 95 | 96 | //constructor from buffer 97 | Strategy_Chunk (Chunk_With_Children * parent,const char* data,size_t); 98 | }; 99 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/CD Tracks.txt: -------------------------------------------------------------------------------- 1 | ;CD track list 2 | ;Only lines starting with a # are looked at. 3 | ;After the # a list of cd track numbers should be provided 4 | ;All track numbers for a give level must appear on one line 5 | ;Any symbol can be used to seperate the numbers (Other than ;) , I'm using commas. 6 | ;Anything coming after a semicolon is ignored 7 | 8 | 9 | 10 | 11 | ;Default tracks for each character. 12 | ;Used in multiplayer games , or if no tracks have been assigned 13 | ;to a level 14 | # 1,2,3,4,5 ;Marine 15 | # 6,7,8,9,10 ;Predator 16 | # 11,12,13,14,15 ;Alien 17 | 18 | ;Cd tracks assigned to each level 19 | 20 | ;Marine 21 | # 2 ; AVP_ENVIRONMENT_DERELICT, 22 | # 1 ; AVP_ENVIRONMENT_COLONY, 23 | # 4 ; AVP_ENVIRONMENT_INVASION, 24 | # 3 ; AVP_ENVIRONMENT_ORBITAL, 25 | # 5 ; AVP_ENVIRONMENT_TYRARGO, 26 | # 5 ; AVP_ENVIRONMENT_TYRARGOHANGAR, 27 | 28 | ;Predator 29 | # 7 ; AVP_ENVIRONMENT_WATERFALL, 30 | # 6 ; AVP_ENVIRONMENT_AREA52, 31 | # 8 ; AVP_ENVIRONMENT_VAULTS, 32 | # 10 ; AVP_ENVIRONMENT_FURY161, 33 | # 9 ; AVP_ENVIRONMENT_CAVERNS, 34 | # 9 ; AVP_ENVIRONMENT_CAVERNSEND, 35 | 36 | ;Alien 37 | # 11 ; AVP_ENVIRONMENT_FERARCO, 38 | # 12 ; AVP_ENVIRONMENT_TEMPLE, 39 | # 13 ; AVP_ENVIRONMENT_GATEWAY, 40 | # 14 ; AVP_ENVIRONMENT_ESCAPE, 41 | # 15 ; AVP_ENVIRONMENT_EARTHBOUND, 42 | 43 | ;Multiplayer part 1(ignored , but leave the same number of #'s) 44 | # ; 45 | # ; 46 | # ; 47 | # ; 48 | # ; 49 | 50 | ;Alien bonus 51 | # ; AVP_ENVIRONMENT_INVASION_A, 52 | # ; AVP_ENVIRONMENT_DERELICT_A, 53 | # ; AVP_ENVIRONMENT_TYRARGO_A, 54 | # ; AVP_ENVIRONMENT_FURY161_A, 55 | # ; AVP_ENVIRONMENT_CAVERNS_A, 56 | 57 | ;Predator bonus 58 | # ; AVP_ENVIRONMENT_INVASION_P, 59 | # ; AVP_ENVIRONMENT_TYRARGO_P, 60 | # ; AVP_ENVIRONMENT_TEMPLE_P, 61 | # ; AVP_ENVIRONMENT_ESCAPE_P, 62 | # ; AVP_ENVIRONMENT_EARTHBOUND_P, 63 | 64 | ;Marine bonus 65 | # ; AVP_ENVIRONMENT_WATERFALL_M, 66 | # ; AVP_ENVIRONMENT_VAULTS_M, 67 | # ; AVP_ENVIRONMENT_FERARCO_M, 68 | # ; AVP_ENVIRONMENT_TEMPLE_M, 69 | # ; AVP_ENVIRONMENT_GATEWAY_M, 70 | 71 | ;Multiplayer part 2(ignored , but leave the same number of #'s) 72 | # ; 73 | # ; 74 | # ; 75 | # ; 76 | # ; 77 | # ; 78 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/AvpReg.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "avpreg.hpp" 4 | 5 | extern "C" 6 | { 7 | char* AvpCDPath=0; 8 | extern char const * SecondTex_Directory; 9 | extern char * SecondSoundDir; 10 | 11 | void GetPathFromRegistry() 12 | { 13 | HKEY hKey; 14 | 15 | if(AvpCDPath) 16 | { 17 | delete AvpCDPath; 18 | AvpCDPath=0; 19 | } 20 | 21 | if 22 | ( 23 | ERROR_SUCCESS == RegOpenKeyEx 24 | ( 25 | HKEY_LOCAL_MACHINE, 26 | "Software\\Fox Interactive\\Aliens vs Predator\\1.00", 27 | REG_OPTION_NON_VOLATILE, 28 | KEY_ALL_ACCESS, 29 | &hKey 30 | ) 31 | ) 32 | { 33 | char szBuf[MAX_PATH+1]; 34 | DWORD dwType = REG_NONE; 35 | DWORD dwSize = sizeof szBuf; 36 | 37 | if 38 | ( 39 | ERROR_SUCCESS == RegQueryValueEx 40 | ( 41 | hKey, 42 | const_cast("Source Path"), 43 | 0, 44 | &dwType, 45 | reinterpret_cast(szBuf), 46 | &dwSize 47 | ) 48 | && REG_SZ == dwType 49 | ) 50 | { 51 | int length=strlen(szBuf); 52 | if(length) 53 | { 54 | AvpCDPath=new char[length+1]; 55 | strcpy(AvpCDPath,szBuf); 56 | } 57 | 58 | } 59 | 60 | RegCloseKey(hKey); 61 | } 62 | 63 | //now set second texture directory 64 | if(!SecondTex_Directory) 65 | { 66 | char* directory; 67 | if(AvpCDPath) 68 | { 69 | directory=new char[strlen(AvpCDPath)+10]; 70 | sprintf(directory,"%sGraphics",AvpCDPath); 71 | } 72 | else 73 | { 74 | directory=new char[40]; 75 | strcpy(directory,"\\\\bob\\textures\\avp_graphics"); 76 | } 77 | *(char**)&SecondTex_Directory=directory; 78 | } 79 | 80 | //and the second sound directory 81 | if(!SecondSoundDir) 82 | { 83 | char* directory; 84 | if(AvpCDPath) 85 | { 86 | directory=new char[strlen(AvpCDPath)+20]; 87 | sprintf(directory,"%ssound\\",AvpCDPath); 88 | } 89 | else 90 | { 91 | directory=new char[40]; 92 | strcpy(directory,"\\\\bob\\vss\\avp\\sound\\"); 93 | } 94 | SecondSoundDir=directory; 95 | } 96 | 97 | 98 | } 99 | 100 | }; -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/ILBM_ext.cpp: -------------------------------------------------------------------------------- 1 | #include "ILBM_ext.hpp" 2 | 3 | IFF_IMPLEMENT_DYNCREATE("ILBM","TRAN",IlbmTranChunk) 4 | IFF_IMPLEMENT_DYNCREATE("ILBM","ALPH",IlbmAlphChunk) 5 | IFF_IMPLEMENT_DYNCREATE("MIPM","CONT",MipmContChunk) 6 | IFF_IMPLEMENT_DYNCREATE("ILBM","S3TC",IlbmS3tcChunk) 7 | IFF_IMPLEMENT_DYNCREATE("MIPM","FLAG",MipmFlagChunk) 8 | 9 | namespace IFF 10 | { 11 | void IlbmTranChunk::Serialize(Archive * pArchv) 12 | { 13 | pArchv->Transfer(eTransType); 14 | pArchv->Transfer(xPos); 15 | pArchv->Transfer(yPos); 16 | pArchv->Transfer(rgb); 17 | } 18 | 19 | void IlbmAlphChunk::Serialize(Archive * pArchv) 20 | { 21 | pArchv->Transfer(width); 22 | pArchv->Transfer(height); 23 | pArchv->Transfer(nBitPlanes); 24 | pArchv->Transfer(eCompression); 25 | 26 | IlbmBodyChunk::Serialize(pArchv); 27 | } 28 | 29 | bool IlbmAlphChunk::GetHeaderInfo() const 30 | { 31 | IlbmBodyChunk::nWidth = width; 32 | IlbmBodyChunk::eCompression = eCompression; 33 | IlbmBodyChunk::nBitPlanes = nBitPlanes; 34 | return true; 35 | } 36 | 37 | void MipmContChunk::Serialize(Archive * pArchv) 38 | { 39 | pArchv->Transfer(nMipMaps); 40 | pArchv->Transfer(eFilter); 41 | } 42 | 43 | void MipmFlagChunk::Serialize(Archive * pArchv) 44 | { 45 | pArchv->Transfer(flags); 46 | } 47 | 48 | IlbmS3tcChunk::IlbmS3tcChunk() 49 | { 50 | m_idCk = "S3TC"; 51 | 52 | pData = NULL; 53 | dataSize = 0; 54 | } 55 | 56 | IlbmS3tcChunk::~IlbmS3tcChunk() 57 | { 58 | if(pData) delete [] pData; 59 | pData = NULL; 60 | } 61 | 62 | void IlbmS3tcChunk::Serialize(Archive * pArchv) 63 | { 64 | pArchv->Transfer(flags); 65 | pArchv->Transfer(fourCC); 66 | pArchv->Transfer(redWeight); 67 | pArchv->Transfer(blueWeight); 68 | pArchv->Transfer(greenWeight); 69 | pArchv->Transfer(width); 70 | pArchv->Transfer(height); 71 | 72 | pArchv->Transfer(dataSize); 73 | 74 | if (pArchv->m_bIsLoading) 75 | { 76 | if(pData) delete [] pData; 77 | pData = new UBYTE[dataSize]; 78 | } 79 | 80 | UBYTE *pDataPos = pData; 81 | for(unsigned i=0;iTransfer(*pDataPos++); 84 | } 85 | } 86 | 87 | } -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/GammaControl.cpp: -------------------------------------------------------------------------------- 1 | extern "C" 2 | { 3 | 4 | #include "3dc.h" 5 | #include "module.h" 6 | #include "inline.h" 7 | #include "d3dmacs.h" 8 | #include "GammaControl.h" 9 | 10 | extern LPDIRECTDRAWSURFACE lpDDSPrimary; 11 | static int ActualGammaSetting; 12 | int RequestedGammaSetting; 13 | 14 | unsigned char GammaValues[256]; 15 | 16 | void InitialiseGammaSettings(int gamma) 17 | { 18 | ActualGammaSetting = gamma+1; 19 | RequestedGammaSetting = gamma; 20 | UpdateGammaSettings(); 21 | } 22 | #if 0 23 | void UpdateGammaSettings(void) 24 | { 25 | LPDIRECTDRAWGAMMACONTROL handle=NULL; 26 | DDGAMMARAMP gammaValues; 27 | 28 | if (RequestedGammaSetting==ActualGammaSetting) return; 29 | 30 | lpDDSPrimary->QueryInterface(IID_IDirectDrawGammaControl,(LPVOID*)&handle); 31 | if(!handle) 32 | { 33 | return; 34 | } 35 | // handle->GetGammaRamp(0,&gammaValues); 36 | for (int i=0; i<=255; i++) 37 | { 38 | int u = ((i*65536)/255); 39 | int m = MUL_FIXED(u,u); 40 | int l = MUL_FIXED(2*u,ONE_FIXED-u); 41 | 42 | int a; 43 | 44 | a = m/256+MUL_FIXED(RequestedGammaSetting,l); 45 | if (a<0) a=0; 46 | if (a>255) a=255; 47 | 48 | gammaValues.red[i]=a*256; 49 | gammaValues.green[i]=a*256; 50 | gammaValues.blue[i]=a*256; 51 | } 52 | 53 | HRESULT result = handle->SetGammaRamp(0,&gammaValues); 54 | 55 | RELEASE(handle); 56 | 57 | ActualGammaSetting=RequestedGammaSetting; 58 | 59 | } 60 | #else 61 | void UpdateGammaSettings(void) 62 | { 63 | LPDIRECTDRAWGAMMACONTROL handle=NULL; 64 | DDGAMMARAMP gammaValues; 65 | 66 | if (RequestedGammaSetting==ActualGammaSetting) return; 67 | 68 | for (int i=0; i<=255; i++) 69 | { 70 | int u = ((i*65536)/255); 71 | int m = MUL_FIXED(u,u); 72 | int l = MUL_FIXED(2*u,ONE_FIXED-u); 73 | 74 | int a; 75 | 76 | a = m+MUL_FIXED(RequestedGammaSetting*256,l); 77 | 78 | 79 | 80 | m = MUL_FIXED(a,a); 81 | l = MUL_FIXED(2*a,ONE_FIXED-a); 82 | 83 | a = m/256+MUL_FIXED(RequestedGammaSetting,l); 84 | 85 | if (a<0) a=0; 86 | if (a>255) a=255; 87 | 88 | GammaValues[i]=a; 89 | } 90 | 91 | ActualGammaSetting=RequestedGammaSetting; 92 | 93 | } 94 | #endif 95 | 96 | }; -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_corpse.h: -------------------------------------------------------------------------------- 1 | #ifndef bh_corpse_h_included 2 | #define bh_corpse_h_included 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #define CORPSE_SIGHTINGS 1 8 | 9 | typedef struct netcorpsedatablock { 10 | int timer; 11 | int validityTimer; 12 | int SoundHandle; /* Just in case. */ 13 | int SoundHandle2; 14 | int SoundHandle3; 15 | int SoundHandle4; 16 | HMODELCONTROLLER HModelController; 17 | 18 | AVP_BEHAVIOUR_TYPE Type; 19 | HITLOCATIONTABLE *hltable; 20 | int GibbFactor; 21 | DEATH_DATA *This_Death; 22 | /* If you're a predator... */ 23 | PRED_CLOAKSTATE CloakStatus; 24 | int CloakTimer; 25 | int destructTimer; 26 | /* If you're a marine... */ 27 | void (*WeaponMisfireFunction)(SECTION_DATA *, int *); 28 | SECTION_DATA *My_Gunflash_Section; 29 | SECTION *TemplateRoot; 30 | struct marine_weapon_data *My_Weapon; 31 | int weapon_variable; 32 | int Android; 33 | int ARealMarine; 34 | /* If you're an alien... */ 35 | int subtype; 36 | 37 | int Wounds; 38 | 39 | int DeathFiring :1; 40 | 41 | 42 | }NETCORPSEDATABLOCK; 43 | 44 | extern void Convert_Alien_To_Corpse(STRATEGYBLOCK *sbPtr,DEATH_DATA *this_death,DAMAGE_PROFILE* damage); 45 | extern void Convert_Predator_To_Corpse(STRATEGYBLOCK *sbPtr,DEATH_DATA *this_death); 46 | extern void Convert_Marine_To_Corpse(STRATEGYBLOCK *sbPtr,DEATH_DATA *this_death); 47 | extern void Convert_Xenoborg_To_Corpse(STRATEGYBLOCK *sbPtr,DEATH_DATA *this_death); 48 | extern void CorpseBehaveFun(STRATEGYBLOCK *sbPtr); 49 | extern void MakeCorpseNear(STRATEGYBLOCK *sbPtr); 50 | extern void MakeCorpseFar(STRATEGYBLOCK *sbPtr); 51 | extern void CorpseIsDamaged(STRATEGYBLOCK *sbPtr, DAMAGE_PROFILE *damage, int multiple, int wounds,SECTION_DATA *Section,VECTORCH *incoming); 52 | 53 | #define CORPSE_EXPIRY_TIME (ONE_FIXED*10) 54 | #define CORPSE_VALIDITY_TIME (ONE_FIXED>>2) 55 | #define ALIEN_DYINGTIME (ONE_FIXED*8) 56 | #define PRED_DIETIME (ONE_FIXED*16) 57 | #define MARINE_DYINGTIME (ONE_FIXED*16) 58 | #define XENO_DYINGTIME (ONE_FIXED*8) 59 | #define AGUN_DYINGTIME (ONE_FIXED*8) 60 | #define HDEBRIS_LIFETIME (ONE_FIXED*8) 61 | /* Was (ONE_FIXED*3)... */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/iofocus.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | * 3 | * DESCRIPTION: iofocus.cpp 4 | * 5 | * AUTHOR: David Malcolm 6 | * 7 | * HISTORY: Created 21/11/97 8 | * 9 | *******************************************************************/ 10 | 11 | /* Includes ********************************************************/ 12 | #include "3dc.h" 13 | #include "iofocus.h" 14 | #include "gadget.h" 15 | #include "avp_menus.h" 16 | #include "psnd.h" 17 | extern "C" 18 | { 19 | 20 | #define UseLocalAssert Yes 21 | #include "ourasert.h" 22 | 23 | /* Version settings ************************************************/ 24 | 25 | /* Constants *******************************************************/ 26 | 27 | /* Macros **********************************************************/ 28 | 29 | /* Imported function prototypes ************************************/ 30 | extern int InGameMenusAreRunning(void); 31 | 32 | /* Imported data ***************************************************/ 33 | 34 | 35 | /* Exported globals ************************************************/ 36 | 37 | /* Internal type definitions ***************************************/ 38 | 39 | /* Internal function prototypes ************************************/ 40 | 41 | /* Internal globals ************************************************/ 42 | static OurBool iofocus_AcceptTyping = No; 43 | 44 | /* Exported function definitions ***********************************/ 45 | OurBool IOFOCUS_AcceptControls(void) 46 | { 47 | return !iofocus_AcceptTyping; 48 | } 49 | 50 | OurBool IOFOCUS_AcceptTyping(void) 51 | { 52 | return iofocus_AcceptTyping; 53 | } 54 | 55 | void IOFOCUS_Toggle(void) 56 | { 57 | #if CONSOLE_DEBUGGING_COMMANDS_ACTIVATED||!(PREDATOR_DEMO||MARINE_DEMO||ALIEN_DEMO) 58 | if(InGameMenusAreRunning()) return;; 59 | 60 | iofocus_AcceptTyping = !iofocus_AcceptTyping; 61 | if (iofocus_AcceptTyping) 62 | { 63 | Sound_Play(SID_CONSOLE_ACTIVATES,NULL); 64 | } 65 | else 66 | { 67 | Sound_Play(SID_CONSOLE_DEACTIVATES,NULL); 68 | RemoveTheConsolePlease(); 69 | } 70 | #endif 71 | } 72 | 73 | 74 | /* Internal function definitions ***********************************/ 75 | 76 | }; -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_agun.h: -------------------------------------------------------------------------------- 1 | // RWH - the autogun code 2 | 3 | /* CDF 25/7/98 - Heaven help us. */ 4 | 5 | extern void AutoGunBehaveFun(STRATEGYBLOCK* ag_sbptr); 6 | extern void AutoGunBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr); 7 | //extern void CreatePlayerAutogun(void); 8 | 9 | void MakeSentrygunNear(STRATEGYBLOCK *sbPtr); 10 | void MakeSentrygunFar(STRATEGYBLOCK *sbPtr); 11 | int AGunSight_FrustrumReject(VECTORCH *localOffset); 12 | void AGunIsDamaged(STRATEGYBLOCK *sbPtr, DAMAGE_PROFILE *damage, int multiple, int wounds,VECTORCH *incoming); 13 | 14 | typedef enum { 15 | I_disabled, 16 | I_tracking, 17 | I_inactive, 18 | }AG_STATE; 19 | 20 | typedef struct autogun_behaviour_block 21 | { 22 | AG_STATE behaviourState; 23 | int stateTimer; 24 | 25 | HMODELCONTROLLER HModelController; 26 | DELTA_CONTROLLER *gun_pan; 27 | DELTA_CONTROLLER *gun_tilt; 28 | 29 | STRATEGYBLOCK *Target; 30 | char Target_SBname[SB_NAME_LENGTH]; 31 | /* A level of indirection for better control. */ 32 | VECTORCH targetTrackPos; 33 | 34 | int Gun_Pan; 35 | int Gun_Tilt; 36 | DISPLAYBLOCK *GunFlash; 37 | 38 | int incidentFlag; 39 | int incidentTimer; 40 | 41 | int ammo; 42 | int roundsFired; 43 | int volleyFired; 44 | 45 | int soundHandle; 46 | int soundHandle2; 47 | int Firing; 48 | int WhirrSoundOn; 49 | int Drama; 50 | 51 | unsigned int createdByPlayer:1; 52 | unsigned int gunpandir :1; 53 | unsigned int guntiltdir :1; 54 | unsigned int IAmFar :1; 55 | 56 | unsigned int OnTarget :1; 57 | unsigned int OnTarget_LastFrame :1; 58 | 59 | char death_target_ID[SB_NAME_LENGTH]; 60 | STRATEGYBLOCK* death_target_sbptr; 61 | int death_target_request; 62 | 63 | }AUTOGUN_STATUS_BLOCK; 64 | 65 | 66 | typedef struct autogun_tools_template 67 | { 68 | VECTORCH position; 69 | EULER orientation; 70 | 71 | int ammo; 72 | int shapenum; 73 | int startInactive; 74 | 75 | char nameID[SB_NAME_LENGTH]; 76 | 77 | char death_target_ID[SB_NAME_LENGTH]; 78 | int death_target_request; 79 | 80 | }AUTOGUN_TOOLS_TEMPLATE; 81 | 82 | #define SGUN_PITCH_GIMBALL (1024) 83 | #define SGUN_PAN_GIMBALL (1024) 84 | #define AGUN_NEAR_VIEW_WIDTH 500 /* mm */ 85 | 86 | #define AGUN_ROF (30) 87 | #define AGUN_VOLLEYSIZE (15) 88 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/PMOVE.H: -------------------------------------------------------------------------------- 1 | /*--------------Patrick 15/10/96 --------------------- 2 | Header File for Player Movement Stuff 3 | ---------------------------------------------------*/ 4 | 5 | 6 | #ifndef _pmove_h_ 7 | #define _pmove_h_ 1 8 | 9 | 10 | 11 | #ifdef __cplusplus 12 | 13 | extern "C" { 14 | 15 | #endif 16 | 17 | 18 | 19 | 20 | /*--------------Patrick 15/10/96 --------------------- 21 | Enumeration of player movement states 22 | Free movement indicates normal movement. 23 | Special Movement indicates that the player is 24 | executing a special move. 25 | Aborting indicates that a special move is 26 | prematurely terminating. 27 | ---------------------------------------------------*/ 28 | 29 | typedef enum player_mov_state 30 | { 31 | PMov_FreeMovement, 32 | PMov_SpecialMovement, 33 | PMov_AbortingSpecialMovement, 34 | }PLAYER_MOVEMENT_STATE; 35 | 36 | /*--------------Patrick 15/10/96 --------------------- 37 | Enumeration of special move types 38 | Special moves are flagged as belonging to a 39 | character type 40 | ---------------------------------------------------*/ 41 | 42 | 43 | /*--------------Patrick 31/10/96 --------------------- 44 | Enumeration of player's morphing states for crouching 45 | and lying down. 46 | ---------------------------------------------------*/ 47 | typedef enum player_morph_state 48 | { 49 | PMph_Standing, 50 | PMph_Crouching, 51 | PMph_Lying, 52 | PMph_StoC, 53 | PMph_CtoS, 54 | PMph_StoL, 55 | PMph_LtoS, 56 | 57 | }PLAYER_MORPH_STATE; 58 | 59 | 60 | 61 | 62 | /*--------------Patrick 1/11/96 --------------------- 63 | this define determines how crouching and lying down 64 | are implemented for the player. It can either be 65 | done by changing the shape, or by morphing.... 66 | Morphing is better, but doesn't work with the current 67 | collision system. 68 | ---------------------------------------------------*/ 69 | #define CrouchByMorphingPlayer 0 70 | 71 | 72 | /* Prototypes */ 73 | extern void InitPlayerMovementData(STRATEGYBLOCK* sbPtr); 74 | extern void PlayerBehaviour(STRATEGYBLOCK* sbptr); 75 | extern void ExecuteFreeMovement(STRATEGYBLOCK* sbPtr); 76 | 77 | 78 | #ifdef __cplusplus 79 | 80 | } 81 | 82 | #endif 83 | 84 | 85 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/hierplace.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _hierplace_hpp 2 | #define _hierplace_hpp 1 3 | 4 | #include "chunk.hpp" 5 | #include "chnktype.hpp" 6 | 7 | class Placed_Hierarchy_Data_Chunk; 8 | 9 | class Placed_Hierarchy_Chunk : public Chunk_With_Children 10 | { 11 | public : 12 | 13 | Placed_Hierarchy_Chunk(Chunk_With_Children* parent,const char* _name,int _hierarchy_index,ChunkVectorInt& _location,ChunkQuat& _orientation); 14 | Placed_Hierarchy_Chunk(Chunk_With_Children * const parent,const char* ,const size_t); 15 | 16 | 17 | Placed_Hierarchy_Data_Chunk* get_data_chunk() 18 | { 19 | return (Placed_Hierarchy_Data_Chunk*)lookup_single_child("PLACHIDT"); 20 | } 21 | }; 22 | 23 | class Placed_Hierarchy_Data_Chunk : public Chunk 24 | { 25 | public : 26 | Placed_Hierarchy_Data_Chunk(Chunk_With_Children* parent,const char* , const size_t); 27 | Placed_Hierarchy_Data_Chunk(Chunk_With_Children* parent,const char* _name,int _hierarchy_index,ChunkVectorInt& _location,ChunkQuat& _orientation); 28 | ~Placed_Hierarchy_Data_Chunk(); 29 | 30 | void fill_data_block(char*); 31 | size_t size_chunk(); 32 | 33 | 34 | 35 | char* name; 36 | 37 | int hierarchy_index; 38 | 39 | ChunkVectorInt location; 40 | ChunkQuat orientation; 41 | 42 | ObjectID id; 43 | 44 | int num_extra_data; 45 | int* extra_data; 46 | 47 | 48 | }; 49 | 50 | struct Timed_Sound_Description 51 | { 52 | int sound_index; 53 | int start_time; //in ms 54 | int end_time; //in ms 55 | }; 56 | 57 | 58 | #define HierarchySequenceFlag_Loop 0x00000001 59 | #define HierarchySequenceFlag_InitialSequence 0x00000002 60 | #define HierarchySequenceFlag_Playing 0x00000004 61 | class Placed_Hierarchy_Sequence_Chunk : public Chunk 62 | { 63 | public: 64 | Placed_Hierarchy_Sequence_Chunk(Chunk_With_Children* parent,const char* , const size_t); 65 | Placed_Hierarchy_Sequence_Chunk(Chunk_With_Children* parent,int _index); 66 | ~Placed_Hierarchy_Sequence_Chunk(); 67 | 68 | void fill_data_block(char*); 69 | size_t size_chunk(); 70 | 71 | 72 | int index; 73 | int sequence; 74 | int sub_sequence; 75 | int time; //time to play sequence in ms 76 | int flags; 77 | 78 | int sound_list_size; 79 | Timed_Sound_Description* sound_list; 80 | 81 | 82 | int num_extra_data; 83 | int* extra_data; 84 | }; 85 | 86 | 87 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/Dp_func.h: -------------------------------------------------------------------------------- 1 | /*------------------------------Patrick 18/3/97------------------------ 2 | Header for setting up and handling direct play objects 3 | (This is mostly nicked from DHM's headhunter stuff) 4 | -----------------------------------------------------------------------*/ 5 | #ifndef dpfunc_h_included 6 | #define dpfunc_h_included 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | /* globals */ 12 | extern LPDIRECTPLAY4 glpDP; 13 | extern LPGUID glpGuid; 14 | 15 | extern DPNAME AVPDPplayerName; 16 | extern DPID AVPDPNetID; 17 | 18 | 19 | /* Constants */ 20 | #define MAX_SIZE_FORMAL_NAME 128+1 21 | #define MAX_SIZE_FRIENDLY_NAME 128+1 22 | 23 | 24 | HRESULT DPlayClose(void); 25 | HRESULT DPlayCreate(LPVOID lpCon); 26 | HRESULT DPlayCreatePlayer(LPDPID lppidID, LPTSTR lptszPlayerName, HANDLE hEvent, 27 | LPVOID lpData, DWORD dwDataSize); 28 | HRESULT DPlayCreateSession(LPTSTR lptszSessionName,int maxPlayers,int dwUser1,int dwUser2); 29 | HRESULT DPlayDestroyPlayer(DPID pid); 30 | HRESULT DPlayEnumPlayers(LPGUID lpSessionGuid, LPDPENUMPLAYERSCALLBACK2 lpEnumCallback, 31 | LPVOID lpContext, DWORD dwFlags); 32 | HRESULT DPlayEnumSessions(DWORD dwTimeout, LPDPENUMSESSIONSCALLBACK2 lpEnumCallback, 33 | LPVOID lpContext, DWORD dwFlags); 34 | HRESULT DPlayGetPlayerData(DPID pid, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags); 35 | HRESULT DPlayClose(void); 36 | HRESULT DPlayCreate(LPVOID lpCon); 37 | HRESULT DPlayCreatePlayer(LPDPID lppidID, LPTSTR lptszPlayerName, HANDLE hEvent, 38 | LPVOID lpData, DWORD dwDataSize); 39 | HRESULT DPlayDestroyPlayer(DPID pid); 40 | HRESULT DPlayEnumSessions(DWORD dwTimeout, LPDPENUMSESSIONSCALLBACK2 lpEnumCallback, 41 | LPVOID lpContext, DWORD dwFlags); 42 | HRESULT DPlayGetPlayerData(DPID pid, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags); 43 | HRESULT DPlayGetSessionDesc(void); 44 | BOOL IsDPlay(void); 45 | HRESULT DPlayOpenSession(LPGUID lpSessionGuid); 46 | HRESULT DPlayReceive(LPDPID lpidFrom, LPDPID lpidTo, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize); 47 | HRESULT DPlayRelease(void); 48 | HRESULT DPlaySend(DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize); 49 | HRESULT DPlaySetPlayerData(DPID pid, LPVOID lpData, DWORD dwSize, DWORD dwFlags); 50 | 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/DummyObjectChunk.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DummyObjectChunk_hpp 3 | #define _DummyObjectChunk_hpp 1 4 | 5 | #include "chunk.hpp" 6 | #include "list_tem.hpp" 7 | #include "chnktype.hpp" 8 | 9 | class Dummy_Object_Data_Chunk; 10 | 11 | class Dummy_Object_Chunk : public Chunk_With_Children 12 | { 13 | public: 14 | 15 | Dummy_Object_Chunk(Chunk_With_Children* parent,const char* _name ,ChunkVectorInt& _location,ChunkVectorInt& min ,ChunkVectorInt& max ,ChunkQuat& orient); 16 | 17 | // constructor from buffer 18 | Dummy_Object_Chunk (Chunk_With_Children * const parent,const char *, size_t const); 19 | 20 | Dummy_Object_Data_Chunk * get_data_chunk();//gets data chunk (name and location) 21 | 22 | const char* get_text(); //get text attached to a dummy object 23 | void set_text(const char* text); //change the text attached to a dummy object 24 | 25 | }; 26 | 27 | //chunk containing name and location of dummy object 28 | class Dummy_Object_Data_Chunk : public Chunk 29 | { 30 | public : 31 | Dummy_Object_Data_Chunk(Dummy_Object_Chunk* parent,const char* _name ,ChunkVectorInt& _location,ChunkVectorInt& min ,ChunkVectorInt& max ,ChunkQuat& orient); 32 | Dummy_Object_Data_Chunk (Chunk_With_Children * parent, const char * data, size_t ); 33 | ~Dummy_Object_Data_Chunk(); 34 | 35 | 36 | /*------------------------** 37 | ** Main dummy object data ** 38 | **------------------------*/ 39 | char* name; 40 | 41 | ChunkVectorInt location; 42 | ChunkQuat orientation; 43 | 44 | ChunkVectorInt min_extents; 45 | ChunkVectorInt max_extents; 46 | /*------------------------** 47 | ** Main dummy object data ** 48 | **------------------------*/ 49 | 50 | size_t size_chunk(); 51 | void fill_data_block (char * data); 52 | 53 | private : 54 | 55 | friend class Dummy_Object_Chunk; 56 | 57 | }; 58 | 59 | 60 | //contains the 'user text' from 3dsmax 61 | class Dummy_Object_Text_Chunk : public Chunk 62 | { 63 | public : 64 | Dummy_Object_Text_Chunk(Dummy_Object_Chunk* parent,const char* _text); 65 | Dummy_Object_Text_Chunk(Chunk_With_Children * parent, const char * data, size_t ); 66 | ~Dummy_Object_Text_Chunk(); 67 | 68 | size_t size_chunk(); 69 | void fill_data_block (char * data); 70 | 71 | 72 | const char* get_text() {return text;} 73 | void set_text(const char* _text); 74 | 75 | private : 76 | char* text; 77 | 78 | }; 79 | 80 | 81 | #endif -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/FFSTDIO.H: -------------------------------------------------------------------------------- 1 | #ifndef _included_ffstdio_h_ 2 | #define _included_ffstdio_h_ 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define FFF_EOF 0x0001 11 | #define FFF_ERR 0x0002 12 | #define FFF_ALOC 0x0004 13 | 14 | struct _FFile 15 | { 16 | void const * data_start; 17 | unsigned char const * data_ptr; 18 | size_t length; 19 | size_t pos; 20 | size_t remaining; 21 | int flag; 22 | }; 23 | typedef struct _FFile FFILE; 24 | typedef size_t ffpos_t; 25 | 26 | extern int ffInit(char const * infofilename, char const * ffpath); 27 | extern void ffKill(void); /* only need to call this to prevent misreported memory leaks */ 28 | 29 | /* only mode supported is "rb" */ 30 | extern int ffclearerr(FFILE * fp); 31 | extern int ffclose(FFILE * fp); 32 | extern int ffcloseall(void); 33 | extern int ffclose_almost_all(void); 34 | extern int ffeof(FFILE * fp); 35 | extern int fferror(FFILE * fp); 36 | extern int ffgetc(FFILE * fp); 37 | extern int ffgetpos(FFILE * fp, ffpos_t * pos); 38 | extern char * ffgets(char * s, int n, FFILE * fp); 39 | extern size_t fflook(void const * * ptr, size_t size, size_t n, FFILE * fp); 40 | extern size_t fflookb(void const * * ptr, size_t n, FFILE * fp); 41 | extern FFILE * ffopen(char const * filename, char const * mode); 42 | extern size_t ffread(void * ptr, size_t size, size_t n, FFILE * fp); 43 | extern size_t ffreadb(void * ptr, size_t n, FFILE * fp); 44 | extern int ffseek(FFILE * fp, long offset, int whence); 45 | extern int ffsetpos(FFILE * fp, ffpos_t const * pos); 46 | extern long fftell(FFILE * fp); 47 | 48 | /* this function is called by ffopen, but you can call it direct 49 | to get a pointer to memory where the contents of a file exist */ 50 | /* nb. the buffer remains valid until a call to ffcloseall */ 51 | extern void const * ffreadbuf(char const * filename, size_t * len); 52 | 53 | /* speedy macros */ 54 | #define ffclearerr(fp) ((fp)->flag &= ~(FFF_ERR|FFF_EOF)) 55 | #define ffeof(fp) ((fp)->flag & FFF_EOF) 56 | #define fferror(fp) ((fp)->flag & FFF_ERR) 57 | #define ffgetpos(fp,pos) (*(pos) = (fp)->pos,0) 58 | #define fftell(fp) ((fp)->pos) 59 | #define ffread(ptr,size,n,fp) ffreadb(ptr,(size)*(n),fp) 60 | #define fflook(ptr,size,n,fp) fflookb(ptr,(size)*(n),fp) 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* ! _included_ffstdio_h_ */ 67 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/DYNAMICS.H: -------------------------------------------------------------------------------- 1 | #ifndef _dynamics_h_ /* KJL 17:23:01 11/05/96 - is this your first time? */ 2 | #define _dynamics_h_ 1 3 | #include "particle.h" 4 | 5 | /*KJL************************************************************************ 6 | * DYNAMICS.H * 7 | * - this file contains prototypes for the functions in dynamics.c * 8 | * which can be called externally. * 9 | ************************************************************************KJL*/ 10 | 11 | 12 | /*KJL**************************************************************************************** 13 | * S T R U C T U R E S * 14 | ****************************************************************************************KJL*/ 15 | struct ColPolyTag 16 | { 17 | int NumberOfVertices; 18 | VECTORCH PolyPoint[4]; 19 | VECTORCH PolyNormal; 20 | DISPLAYBLOCK *ParentObject; 21 | }; 22 | 23 | 24 | /*KJL**************************************************************************************** 25 | * P H Y S I C A L C O N S T A N T S * 26 | ****************************************************************************************KJL*/ 27 | 28 | #define GRAVITY_STRENGTH 25000 29 | #define TIME_BEFORE_GRAVITY_KICKS_IN 16384 30 | 31 | #define MAXIMUM_STEP_HEIGHT 450 32 | #define MAX_ANG_VELOCITY 8192 33 | #define MAX_MOVES 4 34 | 35 | //16384 36 | 37 | /*KJL**************************************************************************************** 38 | * P R O T O T Y P E S * 39 | ****************************************************************************************KJL*/ 40 | extern void ObjectDynamics(void); 41 | extern void DynamicallyRotateObject(DYNAMICSBLOCK *dynPtr); 42 | 43 | 44 | /* externs to shape access fns (platform specific) */ 45 | extern int SetupPolygonAccess(DISPLAYBLOCK *objectPtr); 46 | extern void AccessNextPolygon(void); 47 | extern void GetPolygonVertices(struct ColPolyTag *polyPtr); 48 | extern void GetPolygonNormal(struct ColPolyTag *polyPtr); 49 | 50 | 51 | 52 | /* extra camera movement */ 53 | extern EULER HeadOrientation; 54 | 55 | extern int ParticleDynamics(PARTICLE *particlePtr, VECTORCH *obstacleNormalPtr, int *moduleIndexPtr); 56 | 57 | #endif /* end of preprocessor condition for file wrapping */ 58 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/Zsp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _zsp_hpp 2 | #define _zsp_hpp 1 3 | 4 | #include "shpchunk.hpp" 5 | 6 | 7 | #define rsp_oc_x0 0x00000001 8 | #define rsp_oc_x1 0x00000002 9 | #define rsp_oc_y0 0x00000004 10 | #define rsp_oc_y1 0x00000008 11 | #define rsp_oc_z0 0x00000010 12 | #define rsp_oc_z1 0x00000020 13 | 14 | 15 | // this file should be included from chunk.hpp 16 | 17 | 18 | struct ChunkShape; 19 | 20 | struct ZSP_zone 21 | { 22 | #if (cencon || shpedit) 23 | ZSP_zone (const ChunkShape &, double, double, double, double); 24 | #endif 25 | 26 | ZSP_zone (); 27 | ~ZSP_zone(); 28 | 29 | ZSP_zone (const ZSP_zone &); 30 | ZSP_zone & operator=(const ZSP_zone &); 31 | 32 | int num_z_polys; 33 | int * z_poly_list; 34 | int num_z_verts; 35 | int * z_vert_list; 36 | 37 | friend unsigned char operator==(const ZSP_zone &, const ZSP_zone &); 38 | friend unsigned char operator!=(const ZSP_zone &, const ZSP_zone &); 39 | }; 40 | 41 | 42 | class ZSP_Data 43 | { 44 | 45 | public: 46 | 47 | #if (cencon || shpedit) 48 | ZSP_Data (const ChunkShape &, int); 49 | #endif 50 | 51 | ZSP_Data (const char * zdata, size_t zsize); 52 | 53 | ~ZSP_Data (); 54 | 55 | double cube_size; 56 | double cube_radius; 57 | 58 | int num_x_cubes, num_y_cubes, num_z_cubes; 59 | 60 | List zone_array; 61 | 62 | 63 | }; 64 | 65 | 66 | ///////////////////////////////////////// 67 | 68 | class Shape_ZSP_Data_Chunk : public Chunk 69 | { 70 | public: 71 | 72 | #if cencon || shpedit 73 | Shape_ZSP_Data_Chunk (Shape_Sub_Shape_Chunk * parent, ZSP_Data zspin) 74 | : Chunk(parent, "SHPZSPDT"), zspdata (zspin) 75 | {} 76 | 77 | Shape_ZSP_Data_Chunk (Shape_Chunk * parent, ZSP_Data zspin) 78 | : Chunk(parent, "SHPZSPDT"), zspdata (zspin) 79 | {} 80 | #endif 81 | 82 | const ZSP_Data zspdata; 83 | 84 | size_t size_chunk (); 85 | void fill_data_block (char *); 86 | 87 | Shape_ZSP_Data_Chunk (Shape_Sub_Shape_Chunk * parent, const char * zdata, size_t zsize) 88 | : Chunk (parent, "SHPZSPDT"), zspdata (zdata, zsize) 89 | {} 90 | 91 | Shape_ZSP_Data_Chunk (Shape_Chunk * parent, const char * zdata, size_t zsize) 92 | : Chunk (parent, "SHPZSPDT"), zspdata (zdata, zsize) 93 | {} 94 | 95 | }; 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/frustrum.h: -------------------------------------------------------------------------------- 1 | #ifndef _frustrum_h_ /* Is this your first time? */ 2 | #define _frustrum_h_ 1 3 | 4 | #include "kshape.h" 5 | /* 6 | * KJL 15:13:43 7/17/97 - frustrum.h 7 | * 8 | * function prototypes & pointers for things connected 9 | * to the view frustrum and clipping 10 | * 11 | */ 12 | 13 | enum FrustrumType 14 | { 15 | FRUSTRUM_TYPE_NORMAL, 16 | FRUSTRUM_TYPE_WIDE 17 | }; 18 | 19 | extern void SetFrustrumType(enum FrustrumType frustrumType); 20 | 21 | /* GOURAUD POLYGON CLIPPING */ 22 | extern void GouraudPolygon_ClipWithZ(void); 23 | extern void (*GouraudPolygon_ClipWithNegativeX)(void); 24 | extern void (*GouraudPolygon_ClipWithPositiveY)(void); 25 | extern void (*GouraudPolygon_ClipWithNegativeY)(void); 26 | extern void (*GouraudPolygon_ClipWithPositiveX)(void); 27 | 28 | /* TEXTURED POLYGON CLIPPING */ 29 | extern void TexturedPolygon_ClipWithZ(void); 30 | extern void (*TexturedPolygon_ClipWithNegativeX)(void); 31 | extern void (*TexturedPolygon_ClipWithPositiveY)(void); 32 | extern void (*TexturedPolygon_ClipWithNegativeY)(void); 33 | extern void (*TexturedPolygon_ClipWithPositiveX)(void); 34 | 35 | /* GOURAUD TEXTURED POLYGON CLIPPING */ 36 | extern void GouraudTexturedPolygon_ClipWithZ(void); 37 | extern void (*GouraudTexturedPolygon_ClipWithNegativeX)(void); 38 | extern void (*GouraudTexturedPolygon_ClipWithPositiveY)(void); 39 | extern void (*GouraudTexturedPolygon_ClipWithNegativeY)(void); 40 | extern void (*GouraudTexturedPolygon_ClipWithPositiveX)(void); 41 | 42 | /* FRUSTRUM TESTS */ 43 | extern int PolygonWithinFrustrum(POLYHEADER *polyPtr); 44 | extern int PolygonShouldBeDrawn(POLYHEADER *polyPtr); 45 | extern int (*ObjectWithinFrustrum)(DISPLAYBLOCK *dbPtr); 46 | extern int (*ObjectCompletelyWithinFrustrum)(DISPLAYBLOCK *dbPtr); 47 | extern int (*VertexWithinFrustrum)(RENDERVERTEX *vertexPtr); 48 | extern void (*TestVerticesWithFrustrum)(void); 49 | 50 | extern int DecalWithinFrustrum(DECAL *decalPtr); 51 | extern int QuadWithinFrustrum(void); 52 | extern int TriangleWithinFrustrum(void); 53 | 54 | 55 | /* pass a pointer to a vertex to be tested; results are returned in an int, 56 | using the following defines */ 57 | #define INSIDE_FRUSTRUM_Z_PLANE 1 58 | #define INSIDE_FRUSTRUM_PX_PLANE 2 59 | #define INSIDE_FRUSTRUM_NX_PLANE 4 60 | #define INSIDE_FRUSTRUM_PY_PLANE 8 61 | #define INSIDE_FRUSTRUM_NY_PLANE 16 62 | #define INSIDE_FRUSTRUM 31 63 | 64 | extern char FrustrumFlagForVertex[maxrotpts]; 65 | 66 | #define USE_FOV_53 0 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/gadgets/ahudgadg.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | ahudgadg.hpp 4 | 5 | Alien HUD gadget; a concrete derived class of abstract class "HUDGadget" 6 | 7 | */ 8 | 9 | #ifndef _ahudgadg 10 | #define _ahudgadg 1 11 | 12 | #ifndef _hudgadg 13 | #include "hudgadg.hpp" 14 | #endif 15 | 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Version settings *****************************************************/ 22 | 23 | /* Constants ***********************************************************/ 24 | 25 | /* Macros ***************************************************************/ 26 | 27 | /* Type definitions *****************************************************/ 28 | #if UseGadgets 29 | class TextEntryGadget; // fully declared in TEXTIN.HPP 30 | 31 | class AlienHUDGadget : public HUDGadget 32 | { 33 | public: 34 | void Render 35 | ( 36 | const struct r2pos& R2Pos, 37 | const struct r2rect& R2Rect_Clip, 38 | int FixP_Alpha 39 | ); 40 | 41 | AlienHUDGadget(); 42 | ~AlienHUDGadget(); 43 | 44 | void AddTextReport 45 | ( 46 | SCString* pSCString_ToAdd 47 | // ultimately turn into an MCString 48 | ); 49 | void ClearTheTextReportQueue(void); 50 | 51 | #if EnableStatusPanels 52 | void RequestStatusPanel 53 | ( 54 | enum StatusPanelIndex I_StatusPanel 55 | ); 56 | 57 | void NoRequestedPanel(void); 58 | #endif 59 | 60 | void CharTyped 61 | ( 62 | char Ch 63 | // note that this _is _ a char 64 | ); 65 | void Key_Backspace(void); 66 | void Key_End(void); 67 | void Key_Home(void); 68 | void Key_Left(void); 69 | void Key_Up(void); 70 | void Key_Right(void); 71 | void Key_Down(void); 72 | void Key_Delete(void); 73 | void Key_Tab(void); 74 | 75 | void SetString(const char* text); 76 | 77 | void Jitter(int FixP_Magnitude); 78 | 79 | TextReportGadget* pTextReportGadg; 80 | private: 81 | // not allowed to be NULL 82 | 83 | TextEntryGadget* pTextEntryGadg; 84 | // not allowed to be NULL 85 | }; 86 | #endif // UseGadgets 87 | 88 | /* Exported globals *****************************************************/ 89 | 90 | /* Function prototypes **************************************************/ 91 | 92 | 93 | 94 | /* End of the header ****************************************************/ 95 | 96 | 97 | #ifdef __cplusplus 98 | }; 99 | #endif 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/movement.c: -------------------------------------------------------------------------------- 1 | /* CDF 20/10/98 - Single file for the movement stat lists. */ 2 | 3 | #include "3dc.h" 4 | #include "inline.h" 5 | #include "module.h" 6 | #include "stratdef.h" 7 | #include "gamedef.h" 8 | #include "comp_shp.h" 9 | #include "dynblock.h" 10 | #include "dynamics.h" 11 | #include "pfarlocs.h" 12 | #include "pheromon.h" 13 | #include "bh_types.h" 14 | #include "pvisible.h" 15 | #include "bh_far.h" 16 | #include "bh_debri.h" 17 | #include "bh_pred.h" 18 | #include "bh_paq.h" 19 | #include "bh_queen.h" 20 | #include "bh_marin.h" 21 | #include "bh_alien.h" 22 | #include "lighting.h" 23 | #include "bh_weap.h" 24 | #include "weapons.h" 25 | #include "psnd.h" 26 | #include "equipmnt.h" 27 | #include "los.h" 28 | #include "AI_Sight.h" 29 | #include "targeting.h" 30 | #include "dxlog.h" 31 | #include "ShowCmds.h" 32 | 33 | #define UseLocalAssert Yes 34 | #include "ourasert.h" 35 | 36 | /* First number is max speed, in mm/s. */ 37 | /* Second number is acceleration, in mm/s^2. */ 38 | /* Individual marines vary this by +/- 12.5%. */ 39 | /* Predators and xenoborgs don't at the moment. */ 40 | 41 | static MOVEMENT_DATA Movement_Stats[] = { 42 | { 43 | MDI_Marine_Mooch_Bored, 44 | 1500, 45 | 1500, 46 | }, 47 | { 48 | MDI_Marine_Mooch_Alert, 49 | 1500, 50 | 1500, 51 | }, 52 | { 53 | MDI_Marine_Combat, 54 | 4000, 55 | 4000, 56 | }, 57 | { 58 | MDI_Marine_Sprint, 59 | 10000, 60 | 10000, 61 | }, 62 | { 63 | MDI_Civilian_Mooch_Bored, 64 | 1500, 65 | 1500, 66 | }, 67 | { 68 | MDI_Civilian_Mooch_Alert, 69 | 1500, 70 | 1500, 71 | }, 72 | { 73 | MDI_Civilian_Combat, 74 | 4000, 75 | 4000, 76 | }, 77 | { 78 | MDI_Civilian_Sprint, 79 | 10000, 80 | 10000, 81 | }, 82 | { 83 | MDI_Predator, 84 | 8000, 85 | 10000, 86 | }, 87 | { 88 | MDI_Casual_Predator, 89 | 3000, 90 | 3000, 91 | }, 92 | { 93 | MDI_Xenoborg, 94 | 1000, 95 | 1000, 96 | }, 97 | { 98 | MDI_End, 99 | 0, 100 | 0, 101 | }, 102 | }; 103 | 104 | MOVEMENT_DATA *GetThisMovementData(MOVEMENT_DATA_INDEX index) { 105 | 106 | int a; 107 | 108 | if (index<0) { 109 | return(NULL); 110 | } 111 | 112 | a=0; 113 | while (Movement_Stats[a].index!=MDI_End) { 114 | if (Movement_Stats[a].index==index) { 115 | return(&Movement_Stats[a]); 116 | } 117 | a++; 118 | GLOBALASSERT(a<1000); 119 | } 120 | return(NULL); 121 | } 122 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/win95/alt_tab.h: -------------------------------------------------------------------------------- 1 | /* 2 | JH - 18/02/98 3 | Deal with lost surfaces and textures - restore them when the application is re-activated 4 | */ 5 | 6 | #ifndef _INCLUDED_ALT_TAB_H_ 7 | #define _INCLUDED_ALT_TAB_H_ 8 | 9 | #include "aw.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef void (* AT_PFN_RESTORETEXTURE) (D3DTexture * pTexture, void * pUser); 16 | typedef void (* AT_PFN_RESTORESURFACE) (DDSurface * pSurface, void * pUser); 17 | 18 | #ifdef NDEBUG 19 | extern void ATIncludeTexture(D3DTexture * pTexture, AW_BACKUPTEXTUREHANDLE hBackup); 20 | extern void ATIncludeTextureEx(D3DTexture * pTexture, AT_PFN_RESTORETEXTURE pfnRestore, void * pUser); 21 | extern void ATIncludeSurface(DDSurface * pSurface, AW_BACKUPTEXTUREHANDLE hBackup); 22 | extern void ATIncludeSurfaceEx(DDSurface * pSurface, AT_PFN_RESTORESURFACE pfnRestore, void * pUser); 23 | #else 24 | extern void _ATIncludeTexture(D3DTexture * pTexture, AW_BACKUPTEXTUREHANDLE hBackup, char const * pszFile, unsigned nLine, char const * pszDebugString); 25 | extern void _ATIncludeTextureEx(D3DTexture * pTexture, AT_PFN_RESTORETEXTURE pfnRestore, void * pUser, char const * pszFile, unsigned nLine, char const * pszFuncName, char const * pszDebugString); 26 | extern void _ATIncludeSurface(DDSurface * pSurface, AW_BACKUPTEXTUREHANDLE hBackup, char const * pszFile, unsigned nLine, char const * pszDebugString); 27 | extern void _ATIncludeSurfaceEx(DDSurface * pSurface, AT_PFN_RESTORESURFACE pfnRestore, void * pUser, char const * pszFile, unsigned nLine, char const * pszFuncName, char const * pszDebugString); 28 | #define ATIncludeTexture(p,h) _ATIncludeTexture(p,h,__FILE__,__LINE__,NULL) 29 | #define ATIncludeTextureEx(p,f,u) _ATIncludeTextureEx(p,f,u,__FILE__,__LINE__,#f ,NULL) 30 | #define ATIncludeSurface(p,h) _ATIncludeSurface(p,h,__FILE__,__LINE__,NULL) 31 | #define ATIncludeSurfaceEx(p,f,u) _ATIncludeSurfaceEx(p,f,u,__FILE__,__LINE__,#f ,NULL) 32 | #define ATIncludeTextureDb(p,h,d) _ATIncludeTexture(p,h,__FILE__,__LINE__,d) 33 | #define ATIncludeTextureExDb(p,f,u,d) _ATIncludeTextureEx(p,f,u,__FILE__,__LINE__,#f ,d) 34 | #define ATIncludeSurfaceDb(p,h,d) _ATIncludeSurface(p,h,__FILE__,__LINE__,d) 35 | #define ATIncludeSurfaceExDb(p,f,u,d) _ATIncludeSurfaceEx(p,f,u,__FILE__,__LINE__,#f ,d) 36 | #endif 37 | 38 | extern void ATRemoveTexture(D3DTexture * pTexture); 39 | extern void ATRemoveSurface(DDSurface * pSurface); 40 | 41 | extern void ATOnAppReactivate(); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* ! _INCLUDED_ALT_TAB_H_ */ 48 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/support/rentrntq.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | rentrntq.h 4 | 5 | Created 21/11/97 by DHM: 6 | 7 | "Support for a queue of messages (generated by/analagous to Windows messages) 8 | to avoid problems with re-entrancy". 9 | 10 | The problem being solved is that (in theory at least) the application's 11 | WinProc() procedure can be called at any point within any function in the Win32 API. 12 | 13 | This means that any code that the application's WinProc procedure 14 | calls (both directly or indirectly) must, in general, be re-entrant 15 | 16 | For example, textprint(), the memory allocators, etc. can't be guaranteed to work if 17 | called from WinProc() or something called by it. This is a mahor restriction on what 18 | you can call from WinProc. 19 | 20 | The idea of this code is to isolate the re-entrancy by buffering the 21 | messages, which can then be flushed somewhere "safe" within the main loop 22 | that doesn't need to be re-entrant. 23 | 24 | Functions within this header are labelled with either (i)"WinProc" or (ii)"WinMain" 25 | in their names to indicate whether (i)they should be called from the windows procedure 26 | or (ii) from within the WinMain function (or anything it calls i.e. the entire program 27 | and main loop _except_ for the windows procedure) 28 | */ 29 | 30 | #ifndef _rentrntq 31 | #define _rentrntq 1 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Version settings *****************************************************/ 38 | 39 | /* Constants ***********************************************************/ 40 | 41 | /* Macros ***************************************************************/ 42 | 43 | /* Type definitions *****************************************************/ 44 | 45 | /* Exported globals *****************************************************/ 46 | 47 | /* Function prototypes **************************************************/ 48 | /* Functions callable within the Windows procedure */ 49 | extern void RE_ENTRANT_QUEUE_WinProc_AddMessage_WM_CHAR 50 | ( 51 | char Ch 52 | ); 53 | 54 | extern void RE_ENTRANT_QUEUE_WinProc_AddMessage_WM_KEYDOWN 55 | ( 56 | WPARAM wParam 57 | ); 58 | 59 | /* Functions callable from the WinMain() body of code */ 60 | extern void RE_ENTRANT_QUEUE_WinMain_FlushMessages(void); 61 | extern void RE_ENTRANT_QUEUE_WinMain_FlushMessagesWithoutProcessing(void); 62 | 63 | 64 | /* End of the header ****************************************************/ 65 | 66 | 67 | #ifdef __cplusplus 68 | }; 69 | #endif 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/support/trig666.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | trig666.hpp 4 | 5 | */ 6 | 7 | #ifndef _trig666 8 | #define _trig666 1 9 | 10 | #ifndef _daemon 11 | #include "daemon.h" 12 | #endif 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /* Version settings *****************************************************/ 19 | 20 | /* Macros ***************************************************************/ 21 | 22 | /* Type definitions *****************************************************/ 23 | class TriggerDaemon : public Daemon 24 | { 25 | public: 26 | TriggerDaemon 27 | ( 28 | OurBool fActive 29 | ); 30 | ~TriggerDaemon(); 31 | virtual void Triggered(void) = 0; 32 | // called by the daemon's activity whenever the daemon decides to 33 | // trigger it. 34 | private: 35 | 36 | }; 37 | 38 | // A daemon which fires at regular intervals (potentially more than once per frame) 39 | class PulsingTriggerDaemon : public TriggerDaemon 40 | { 41 | public: 42 | PulsingTriggerDaemon 43 | ( 44 | OurBool fActive, 45 | int FixP_Period // interval between triggers in seconds 46 | ); 47 | 48 | ~PulsingTriggerDaemon(); 49 | 50 | ACTIVITY_RETURN_TYPE Activity(ACTIVITY_INPUT); 51 | // never causes callback hooks to fire 52 | 53 | void SetFuse_FixP 54 | ( 55 | int FixP_Fuse // time until it next triggers; doesn't change the period 56 | ); 57 | 58 | // void Triggered(void) remains pure virtual 59 | private: 60 | int FixP_Period_Val; 61 | int FixP_TimeToNextPulse; 62 | }; 63 | 64 | // A countdown daemon which DESTROYS ITSELF after it triggers 65 | class CountdownDaemon : public TriggerDaemon 66 | { 67 | public: 68 | CountdownDaemon 69 | ( 70 | OurBool fActive, 71 | int FixP_Fuse // time until it triggers 72 | ); 73 | 74 | ~CountdownDaemon(); 75 | 76 | ACTIVITY_RETURN_TYPE Activity(ACTIVITY_INPUT); 77 | // never causes callback hooks to fire 78 | 79 | void SetFuse_FixP 80 | ( 81 | int FixP_Fuse // time until it triggers 82 | ); 83 | 84 | // void Triggered(void) remains pure virtual 85 | private: 86 | int FixP_TimeRemaining; 87 | }; 88 | 89 | 90 | /* Exported globals *****************************************************/ 91 | 92 | /* Function prototypes **************************************************/ 93 | 94 | 95 | 96 | /* End of the header ****************************************************/ 97 | 98 | 99 | #ifdef __cplusplus 100 | }; 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/gadgets/conssym.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************* 2 | * 3 | * DESCRIPTION: conssym.cpp 4 | * 5 | * AUTHOR: David Malcolm 6 | * 7 | * HISTORY: Created 26/1/98 8 | * 9 | *******************************************************************/ 10 | 11 | /* Includes ********************************************************/ 12 | #include "3dc.h" 13 | #include "conssym.hpp" 14 | 15 | #define UseLocalAssert Yes 16 | #include "ourasert.h" 17 | 18 | /* Version settings ************************************************/ 19 | 20 | /* Constants *******************************************************/ 21 | 22 | /* Macros **********************************************************/ 23 | 24 | /* Imported function prototypes ************************************/ 25 | 26 | /* Imported data ***************************************************/ 27 | #ifdef __cplusplus 28 | extern "C" 29 | { 30 | #endif 31 | #if 0 32 | extern OurBool DaveDebugOn; 33 | extern FDIEXTENSIONTAG FDIET_Dummy; 34 | extern IFEXTENSIONTAG IFET_Dummy; 35 | extern FDIQUAD FDIQuad_WholeScreen; 36 | extern FDIPOS FDIPos_Origin; 37 | extern FDIPOS FDIPos_ScreenCentre; 38 | extern IFOBJECTLOCATION IFObjLoc_Origin; 39 | extern UncompressedGlobalPlotAtomID UGPAID_StandardNull; 40 | extern IFCOLOUR IFColour_Dummy; 41 | extern IFVECTOR IFVec_Zero; 42 | #endif 43 | #ifdef __cplusplus 44 | }; 45 | #endif 46 | 47 | 48 | 49 | /* Exported globals ************************************************/ 50 | /*static*/ List ConsoleSymbol :: List_pConsoleSym; 51 | 52 | /* Internal type definitions ***************************************/ 53 | 54 | /* Internal function prototypes ************************************/ 55 | 56 | /* Internal globals ************************************************/ 57 | 58 | /* Exported function definitions ***********************************/ 59 | // class ConsoleSymbol 60 | // public: 61 | 62 | // protected: 63 | ConsoleSymbol :: ConsoleSymbol 64 | ( 65 | ProjChar* pProjCh_ToUse 66 | ) : pSCString_Symbol 67 | ( 68 | new SCString( pProjCh_ToUse ) 69 | // constructor for the SCString adds the required reference 70 | ) 71 | { 72 | List_pConsoleSym . add_entry 73 | ( 74 | this 75 | ); 76 | } 77 | 78 | ConsoleSymbol :: ~ConsoleSymbol() 79 | { 80 | pSCString_Symbol ->R_Release(); 81 | 82 | // remove from the list 83 | List_pConsoleSym . delete_entry 84 | ( 85 | this 86 | ); 87 | } 88 | 89 | 90 | 91 | 92 | /* Internal function definitions ***********************************/ 93 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/win95/dbdefs.h: -------------------------------------------------------------------------------- 1 | // enums for the number of information screens we have 2 | // data description 3 | 4 | typedef enum maps{ 5 | I_No_Map, 6 | I_Map_Gen1, I_Map_Gen2, I_Map_Gen3, I_Map_Gen4, 7 | I_Map_Cmc1, I_Map_Cmc2, I_Map_Cmc3, I_Map_Cmc4, I_Map_Cmc5, I_Map_Cmc6, 8 | I_Map_Rnd1, I_Map_Rnd2, I_Map_Rnd3, I_Map_Rnd4, 9 | I_Map_Mps1, I_Map_Mps2, I_Map_Mps3, I_Map_Mps4, 10 | I_Map_Sp1, I_Map_Sp2, I_Map_Sp3, 11 | I_Map_Surface, I_Map_Medlab, 12 | I_Num_Maps 13 | }DATABASE_MAP; 14 | 15 | typedef enum 16 | { 17 | I_Floor_0 = 0, 18 | I_Floor_1, 19 | I_Floor_2, 20 | I_Floor_3, 21 | I_Floor_4, 22 | I_Floor_5, 23 | I_Max_Num_Floors, 24 | 25 | }FLOOR_NUM; 26 | 27 | typedef enum 28 | { 29 | I_No_Weapon, 30 | I_Weapon_Pulse, 31 | I_Num_Weapons 32 | 33 | }DATABASE_WEAPON; 34 | 35 | 36 | typedef enum 37 | { 38 | I_No_Message, 39 | I_Message_1, 40 | I_Num_Messages, 41 | 42 | }DATABASE_MESSAGE; 43 | 44 | typedef struct dbasedesc 45 | { 46 | int floor; 47 | DATABASE_MAP map_enum; 48 | DATABASE_WEAPON weap_enum; 49 | DATABASE_MESSAGE message_enum; 50 | short pixel_x; 51 | short pixel_y; 52 | 53 | }DBASEDESC; 54 | 55 | // enums to control flow of the database screens 56 | // data base states - each one is associated with a 57 | // enum to describes the option from the satae 58 | 59 | typedef enum 60 | { 61 | DB_STATE_SELECT, 62 | DB_STATE_MAP, 63 | DB_STATE_MESSAGE, 64 | DB_STATE_WEAPON, 65 | DB_STATE_LOAD, 66 | DB_STATE_SAVE, 67 | DB_STATE_END, 68 | NUM_DB_STATES, 69 | 70 | }DB_MENU_STATE; 71 | 72 | 73 | 74 | typedef enum database_options 75 | { 76 | DB_MAP_OPTION, 77 | DB_MESSAGE_OPTION, 78 | DB_WEAPON_OPTION, 79 | DB_LOAD_OPTION, 80 | DB_SAVE_OPTION, 81 | DB_LOGOFF_OPTION, 82 | DB_QUIT_OPTION, 83 | DB_NUM_OPTIONS 84 | 85 | }DB_MENU_OPTIONS; 86 | 87 | 88 | typedef enum map_screen_options 89 | { 90 | DB_MAP_EXIT_OPTION, 91 | DB_MAP_LOGOFF_OPTION, 92 | DB_NUM_MAP_OPTIONS, 93 | 94 | }DB_MAP_OPTIONS; 95 | 96 | typedef enum 97 | { 98 | DB_WEAPON_EXIT_OPTION, 99 | DB_WEAPON_LOGOFF_OPTION, 100 | DB_NUM_WEAPON_OPTIONS, 101 | 102 | }DB_WEAPON_OPTIONS; 103 | 104 | typedef enum 105 | { 106 | DB_MESSAGE_PLAY_OPTION, 107 | DB_MESSAGE_STOP_OPTION, 108 | DB_MESSAGE_EXIT_OPTION, 109 | DB_MESSAGE_LOGOFF_OPTION, 110 | DB_NUM_MESSAGE_OPTIONS, 111 | 112 | }DB_MESSAGE_OPTIONS; 113 | 114 | 115 | extern void DatabaseMenus(DATABASE_BLOCK*); 116 | 117 | extern void PlatformSpecificEnteringDatabase(); 118 | extern void PlatformSpecificExitingDatabase(); 119 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_plachier.h: -------------------------------------------------------------------------------- 1 | #ifndef _bh_plachier_h_ 2 | #define _bh_plachier_h_ 1 3 | 4 | #include "bh_track.h" //for the special_track_point structure 5 | 6 | #ifdef __cplusplus 7 | 8 | extern "C" { 9 | 10 | #endif 11 | 12 | 13 | typedef struct placed_hierarchy_sound 14 | { 15 | unsigned long inner_range; 16 | unsigned long outer_range; 17 | int max_volume; 18 | int pitch; 19 | 20 | struct loaded_sound const * sound_loaded; 21 | int activ_no; 22 | 23 | unsigned int loop:1; 24 | unsigned int playing:1; //sound should be playing (if in range) 25 | }PLACED_HIERARCHY_SOUND; 26 | 27 | typedef struct placed_hierarchy_sound_times 28 | { 29 | int start_time; 30 | int end_time; 31 | PLACED_HIERARCHY_SOUND* sound; 32 | }PLACED_HIERARCHY_SOUND_TIMES; 33 | 34 | typedef struct placed_hierarchy_sequence 35 | { 36 | int sequence_no; 37 | int sub_sequence_no; 38 | int time; 39 | unsigned int loop:1; 40 | 41 | int num_sound_times; 42 | PLACED_HIERARCHY_SOUND_TIMES* sound_times; 43 | }PLACED_HIERARCHY_SEQUENCE; 44 | 45 | 46 | typedef struct placed_hierarchy_behav_block 47 | { 48 | AVP_BEHAVIOUR_TYPE bhvr_type; 49 | 50 | HMODELCONTROLLER HModelController; 51 | 52 | PLACED_HIERARCHY_SEQUENCE* current_seq; 53 | int num_sequences; 54 | PLACED_HIERARCHY_SEQUENCE* sequences; 55 | 56 | VECTORCH* sound_location; 57 | 58 | int num_sounds; 59 | PLACED_HIERARCHY_SOUND* sounds; 60 | 61 | 62 | int num_special_track_points; 63 | SPECIAL_TRACK_POINT* special_track_points; 64 | 65 | }PLACED_HIERARCHY_BEHAV_BLOCK; 66 | 67 | 68 | typedef struct placed_hierarchy_tools_template 69 | { 70 | char nameID[SB_NAME_LENGTH]; 71 | 72 | VECTORCH position; 73 | EULER orientation; 74 | 75 | int num_sequences; 76 | PLACED_HIERARCHY_SEQUENCE* sequences; 77 | PLACED_HIERARCHY_SEQUENCE* first_sequence; 78 | BOOL playing; 79 | 80 | int num_sounds; 81 | PLACED_HIERARCHY_SOUND* sounds; 82 | 83 | int num_special_track_points; 84 | SPECIAL_TRACK_POINT* special_track_points; 85 | 86 | const char* file_name; 87 | const char* hier_name; 88 | }PLACED_HIERARCHY_TOOLS_TEMPLATE; 89 | 90 | extern void* PlacedHierarchyBehaveInit(void* bhdata,STRATEGYBLOCK* sbptr); 91 | void PlacedHierarchyBehaveFun(STRATEGYBLOCK* sbptr); 92 | void MakePlacedHierarchyNear(STRATEGYBLOCK* sbptr); 93 | void DeletePlacedHierarchy(PLACED_HIERARCHY_BEHAV_BLOCK*); 94 | void SendRequestToPlacedHierarchy(STRATEGYBLOCK* sbptr,BOOL state,int extended_data); 95 | 96 | 97 | #ifdef __cplusplus 98 | 99 | }; 100 | 101 | #endif 102 | 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /source/AvP_vc/3dc/avp/bh_track.h: -------------------------------------------------------------------------------- 1 | #ifndef _bh_track_h_ 2 | #define _bh_track_h_ 1 3 | 4 | #include "track.h" 5 | 6 | #ifdef __cplusplus 7 | 8 | extern "C" { 9 | 10 | #endif 11 | 12 | extern void* TrackObjectBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr); 13 | extern void TrackObjectBehaveFun(STRATEGYBLOCK* sbptr); 14 | extern void TrackObjectIsDamaged(STRATEGYBLOCK *sbPtr, DAMAGE_PROFILE *damage, int multiple); 15 | 16 | extern int TrackObjectGetSynchData(STRATEGYBLOCK* sbptr); 17 | extern void TrackObjectSetSynchData(STRATEGYBLOCK* sbptr,int status); 18 | 19 | typedef enum track_object_req_states 20 | { 21 | track_no_request, 22 | track_request_start, 23 | track_request_stop, 24 | track_request_startforward, 25 | track_request_startbackward, 26 | }TRACK_OBJECT_REQUEST_STATE; 27 | 28 | 29 | 30 | #ifndef TrackRequestFlag_ActiveForward 31 | #define TrackRequestFlag_ActiveForward 0x00000001 32 | #define TrackRequestFlag_ActiveBackward 0x00000002 33 | #define TrackRequestFlag_OppositeBackward 0x00000004 34 | #endif 35 | typedef struct track_point_target 36 | { 37 | 38 | char target_name [SB_NAME_LENGTH]; 39 | STRATEGYBLOCK * target_sbptr; 40 | int request; 41 | int flags; 42 | 43 | }TRACK_POINT_TARGET; 44 | 45 | typedef struct special_track_point 46 | { 47 | int track_point_no; 48 | int num_targets; 49 | 50 | TRACK_POINT_TARGET* targets; 51 | 52 | }SPECIAL_TRACK_POINT; 53 | 54 | typedef struct track_object_behav_block 55 | { 56 | AVP_BEHAVIOUR_TYPE bhvr_type; 57 | BOOL Indestructable; 58 | 59 | TRACK_CONTROLLER* to_track; 60 | 61 | TRACK_OBJECT_REQUEST_STATE request; 62 | 63 | TXACTRLBLK *to_tac;//for objects with anims on them 64 | 65 | int num_special_track_points; 66 | SPECIAL_TRACK_POINT* special_track_points; 67 | 68 | int destruct_target_request; 69 | char destruct_target_ID[SB_NAME_LENGTH]; 70 | STRATEGYBLOCK* destruct_target_sbptr; 71 | 72 | int TimeUntilNetSynchAllowed; 73 | }TRACK_OBJECT_BEHAV_BLOCK; 74 | 75 | 76 | typedef struct track_object_tools_template 77 | { 78 | char nameID[SB_NAME_LENGTH]; 79 | int shape_num; 80 | 81 | TRACK_CONTROLLER* track; 82 | 83 | VECTORCH position; 84 | EULER orientation; 85 | 86 | int num_special_track_points; 87 | SPECIAL_TRACK_POINT* special_track_points; 88 | 89 | 90 | int integrity; // 0-20 (>20 = indestructable) 91 | int destruct_target_request; 92 | char destruct_target_ID[SB_NAME_LENGTH]; 93 | 94 | }TRACK_OBJECT_TOOLS_TEMPLATE; 95 | 96 | 97 | #ifdef __cplusplus 98 | 99 | }; 100 | 101 | #endif 102 | 103 | 104 | #endif 105 | --------------------------------------------------------------------------------