From ab5897ec78e77e13d94fc3a74e56fc3a235e5f09 Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Sun, 26 Aug 2001 22:16:07 +0000 Subject: [PATCH] Removed more unused code. --- src/avp/bh_types.c | 67 ---- src/avp/bh_types.h | 6 +- src/avp/gameflow.c | 641 --------------------------------------- src/avp/gameflow.h | 126 -------- src/avp/win95/cheat.c | 1 - src/avp/win95/gflwplat.c | 235 -------------- src/mslhand.c | 187 ------------ src/mslhand.h | 28 -- 8 files changed, 2 insertions(+), 1289 deletions(-) delete mode 100644 src/avp/gameflow.c delete mode 100644 src/avp/gameflow.h delete mode 100644 src/avp/win95/gflwplat.c delete mode 100644 src/mslhand.c delete mode 100644 src/mslhand.h diff --git a/src/avp/bh_types.c b/src/avp/bh_types.c index f0f2d5a..e69f377 100644 --- a/src/avp/bh_types.c +++ b/src/avp/bh_types.c @@ -619,73 +619,6 @@ void AssignRunTimeBehaviours(STRATEGYBLOCK* sbptr) InitPlayer(sbptr, I_BehaviourMarinePlayer); } -#if Saturn || PSX - -int SetUpDoor(int shape1, int shape2, MODULE* mptr) -{ - DISPLAYBLOCK* dptr = mptr->m_dptr; - MODULEMAPBLOCK* momptr = mptr->m_mapptr; - MORPHCTRL* morphctrl; - MORPHHEADER* morphheader; - MORPHFRAME* morphframe; - STRATEGYBLOCK* sbptr; - - GLOBALASSERT(dptr); - GLOBALASSERT(momptr); - - sbptr = AttachNewStratBlock(mptr, momptr, dptr); - - // this code causes a memory leak - - morphctrl = (MORPHCTRL*)AllocateMem(sizeof(MORPHCTRL)); - if(!morphctrl) - { - memoryInitialisationFailure = 1; - return 0; - } - - morphheader = (MORPHHEADER*)AllocateMem(sizeof(MORPHHEADER)); - if(!morphheader) - { - memoryInitialisationFailure = 1; - return 0; - } - - morphframe = (MORPHFRAME*)AllocateMem(sizeof(MORPHFRAME)); - if(!morphframe) - { - memoryInitialisationFailure = 1; - return 0; - } - - #if Saturn - morphframe->mf_shape1 = shape2; - morphframe->mf_shape2 = shape1; - #else - morphframe->mf_shape1 = shape1; - morphframe->mf_shape2 = shape2; - #endif - - dptr->ObShapeData = GetShapeData(shape1); - - morphheader->mph_numframes = 1; - morphheader->mph_maxframes = ONE_FIXED; - morphheader->mph_frames = morphframe; - - morphctrl->ObMorphCurrFrame = 0; - morphctrl->ObMorphFlags = 0; - morphctrl->ObMorphSpeed = 0; - morphctrl->ObMorphHeader = morphheader; - - EnableBehaviourType(sbptr, I_BehaviourProximityDoor, (void*)morphctrl); - - return 0; -} - -#endif /*SupportSaturn*/ - - - /*---------------------------------------------------------------------- Use this function to initialise binary loaded objects ----------------------------------------------------------------------*/ diff --git a/src/avp/bh_types.h b/src/avp/bh_types.h index 46df080..67b0f2d 100644 --- a/src/avp/bh_types.h +++ b/src/avp/bh_types.h @@ -5,8 +5,6 @@ #include "equipmnt.h" #endif -#include "gameflow.h" - #include "pmove.h" @@ -269,8 +267,8 @@ typedef struct player_status int CloakingEffectiveness; // John 28/7/97 Game Flow stuff - PLAYERMISSION CurrentMission; - unsigned long StateChangeObjectFlags; + int UNUSED_Enum_CurrentMission; + unsigned long UNUSED_StateChangeObjectFlags; /* Encumberance */ ENCUMBERANCE_STATE Encumberance; diff --git a/src/avp/gameflow.c b/src/avp/gameflow.c deleted file mode 100644 index 842fb11..0000000 --- a/src/avp/gameflow.c +++ /dev/null @@ -1,641 +0,0 @@ -#include "3dc.h" -#include "module.h" -#include "inline.h" - -#include "stratdef.h" -#include "gamedef.h" -#include "bh_types.h" -#include "inventry.h" -#include "gameplat.h" - -#include "gameflow.h" - -#include "bh_types.h" -#include "bh_gener.h" - -#define UseLocalAssert Yes - -#include "ourasert.h" - -extern void ActivateSelfDestructSequence(int seconds); - -GAMEOBJECT GameObjects[] = -{ - GOT_LIFTOVERRIDE1, - //0x4b630a49,0xe6d1ca, - 0,0, - - GOT_LIFTOVERRIDE2, - //0xa90f8f50,0x252139, - 0,0, - - GOT_LIFTOVERRIDE3, - //0x32d82514,0x286a42, - 0,0, - - GOT_LIFTOVERRIDE4, - //0xa2befeb4,0xe2e009, - 0,0, - - GOT_SELFDESTRUCT, - //0xf2d0d89c,0x923401, - 0,0, - - GOT_PREDSHIP1, - //0x385fb8b9,0x7e14ad, - 0,0, - - GOT_PREDSHIP2, - 0,0, - - /* New stuff for Jules's level: 1/12/97 CDF */ - - GOT_FAKESWITCH_IN_GENERATOR, - 0x5caeb020,0x88620, - - GOT_DATALOG_1, - 0xbbfbd11a,0x1d34bf, - - GOT_DATALOG_2, - 0x68045d04,0x69092e, - - GOT_DATALOG_3, - 0x3d784e97,0x31a9c5, - - GOT_ENDLEVEL_EVENT, - 0x5655280,0xb5aef1, - - // This has to be last in the list - GOT_LASTGAMEOBJECT, - 0,0 - -}; - -GAME_STRATBLOCK_LIST_ENTRY GameStratblockList[] = { - - GT_YARD_DOOR_1, - {0xd9,0x15,0xd7,0xcc,0xa7,0xf4,0xb6,0x00,}, - GT_YARD_DOOR_2, - {0x01,0x0a,0x0f,0xf5,0x76,0x0b,0x5a,0x00,}, - GT_YARD_DOOR_3, - {0x7b,0x18,0x0f,0xa7,0x14,0xae,0x67,0x00,}, - GT_YARD_DOOR_4, - {0xd7,0x52,0x95,0x48,0xcc,0xf2,0x14,0x00,}, - - GT_LAST_TARGET_OBJECT, - {0,0,0,0,0,0,0,0,}, - -}; - -BOOL GameFlowOn = 1; - -static unsigned long MakeFlag (unsigned long num) -{ - return(1<CurrentMission) - { - case MarineMission_NoneAsYet: - { - GLOBALASSERT (current == I_Entrance && next == I_Gen1); - - DoStartMissionSequence (MarineMission_DisableLifts); - retval = 1; - PlayerStatusPtr->CurrentMission = MarineMission_DisableLifts; - PlayerStatusPtr->securityClearances = MakeFlag (LS_Gen1_Gen2) + - MakeFlag (LS_Gen3Internal) + - MakeFlag (LS_Gen2_Gen3); - - break; - } - - case MarineMission_DisableLifts: - { - GLOBALASSERT ((current == I_Gen1 || - current == I_Gen2 || - current == I_Gen3) - && - (next == I_Gen1 || - next == I_Gen2 || - next == I_Gen3) - ); - - if (next == I_Gen2) - { - PlayerStatusPtr->securityClearances &= ~MakeFlag (LS_Gen1_Gen2); - } - - if (current == I_Gen3 && next == I_Gen1) - { - DoStartMissionSequence (MarineMission_GoToSP2); - retval = 1; - PlayerStatusPtr->CurrentMission = MarineMission_GoToSP2; - PlayerStatusPtr->securityClearances = MakeFlag (LS_Gen1_SP2); - } - - break; - } - - case MarineMission_GoToSP2: - { - GLOBALASSERT (current == I_Gen1 && next == I_Sp2); - - DoStartMissionSequence (MarineMission_LeaveRnDs); - retval = 1; - PlayerStatusPtr->CurrentMission = MarineMission_LeaveRnDs; - PlayerStatusPtr->securityClearances = MakeFlag (LS_SP2_RnD2) + - MakeFlag (LS_RnD2_RnD3) + - MakeFlag (LS_Gen1_RnD4) + - MakeFlag (LS_RnD3_RnD4); - - break; - } - - case MarineMission_LeaveRnDs: - { - GLOBALASSERT ((current == I_Rnd4 || - current == I_Rnd2 || - current == I_Gen1 || - current == I_Sp2 || - current == I_Rnd3) - && - (next == I_Rnd4 || - next == I_Rnd2 || - next == I_Gen1 || - next == I_Sp2 || - next == I_Rnd3) - ); - - if (current == I_Rnd4 && next == I_Gen1) - { - DoStartMissionSequence (MarineMission_GoToCMC6); - retval = 1; - PlayerStatusPtr->CurrentMission = MarineMission_GoToCMC6; - PlayerStatusPtr->securityClearances = MakeFlag (LS_Gen1_CMC6); - } - - break; - } - - case MarineMission_GoToCMC6: - { - GLOBALASSERT (current == I_Gen1 && next == I_Cmc6); - - DoStartMissionSequence (MarineMission_GoToCMC2); - retval = 1; - PlayerStatusPtr->CurrentMission = MarineMission_GoToCMC2; - PlayerStatusPtr->securityClearances = MakeFlag (LS_CMC2_CMC4) + - MakeFlag (LS_CMC4_CMC6); - - break; - } - - case MarineMission_GoToCMC2: - { - GLOBALASSERT ((current == I_Cmc4 || - current == I_Cmc2 || - current == I_Cmc6) - && - (next == I_Cmc4 || - next == I_Cmc2 || - next == I_Cmc6) - ); - - if (current == I_Cmc4 && next == I_Cmc2) - { - DoStartMissionSequence (MarineMission_DestructBase); - retval = 1; - PlayerStatusPtr->CurrentMission = MarineMission_DestructBase; - PlayerStatusPtr->securityClearances = MakeFlag (LS_MPS2_MPS4) + - MakeFlag (LS_SP3_MPS2) + - MakeFlag (LS_Gen1_Medlab) + - MakeFlag (LS_Gen1_CMC2) + - MakeFlag (LS_Gen1_SP3); - } - - break; - } - - case MarineMission_DestructBase: - { - if (current == I_Mps4 && next == I_Surface) - { - DoStartMissionSequence (MarineMission_Won); - } - - break; - } - - case MarineMission_Won: - { - break; - } - - - default: - { - GLOBALASSERT (0 == "Mission not in marine list"); - break; - } - } - break; - } - - case I_Predator: - { - switch (PlayerStatusPtr->CurrentMission) - { - case PredMission_DestroyComputers: - { - if (current == I_Cmc4 && next == I_Cmc6) - { - PlayerStatusPtr->securityClearances = - MakeFlag (LS_Gen1_Entrance)+ - MakeFlag (LS_Gen1_Medlab)+ - MakeFlag (LS_Gen1_Gen2)+ - MakeFlag (LS_Gen1_Gen3)+ - MakeFlag (LS_Gen1_SP3)+ - MakeFlag (LS_Gen1_CMC6)+ - MakeFlag (LS_Gen1_CMC2)+ - MakeFlag (LS_Gen1_RnD4)+ - MakeFlag (LS_Gen1_SP2)+ - MakeFlag (LS_Gen2_Gen3)+ - MakeFlag (LS_CMC2_CMC4)+ - MakeFlag (LS_CMC4_CMC6)+ - MakeFlag (LS_SP3_MPS2)+ - MakeFlag (LS_MPS2_MPS4)+ - MakeFlag (LS_MPS4_SURFACE)+ - MakeFlag (LS_SP2_RnD2)+ - MakeFlag (LS_RnD2_RnD3)+ - MakeFlag (LS_RnD3_RnD4)+ - MakeFlag (LS_Gen3Internal)+ - MakeFlag (LS_MaxLifts); - - } - else if (current == I_Cmc6) - { - DoStartMissionSequence (PredMission_GetShipGen3); - PlayerStatusPtr->CurrentMission = PredMission_GetShipGen3; - retval = 1; - } - - break; - } - - case PredMission_GetShipGen3: - { - if (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_PREDSHIP1)) - { - if (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_PREDSHIP2)) - { - DoStartMissionSequence (PredMission_KillPredAlien); - PlayerStatusPtr->CurrentMission = PredMission_KillPredAlien; - retval = 1; - } - else - { - DoStartMissionSequence (PredMission_GetShipCMC2); - PlayerStatusPtr->CurrentMission = PredMission_GetShipCMC2; - retval = 1; - } - } - break; - } - - case PredMission_GetShipCMC2: - { - if (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_PREDSHIP2)) - { - DoStartMissionSequence (PredMission_KillPredAlien); - PlayerStatusPtr->CurrentMission = PredMission_KillPredAlien; - retval = 1; - } - break; - } - - case PredMission_KillPredAlien: - { - break; - } - - case PredMission_KillQueen: - { - break; - } - - case PredMission_ReturnToShip: - { - break; - } - - default: - { - GLOBALASSERT (0 == "Mission not in Predator list"); - break; - } - } - break; - } - - case I_Alien: - { - break; - } - - default: - { - GLOBALASSERT (0 == "Player type is wrong"); - break; - } - } - return(retval); - -} - -void InitGameFlowSystem (struct player_status * ps, INITGAMEFLOWTYPE igft) -{ - if (!GameFlowOn) - { - ps->securityClearances = 0xfffffff; - return; - } - if (igft == IGFT_NewGame) - { - switch (AvP.PlayerType) - { - case I_Marine: - { - ps->CurrentMission = MarineMission_NoneAsYet; - ps->StateChangeObjectFlags = 0; - //ps->securityClearances = MakeFlag (LS_Gen1_Entrance); - ps->securityClearances = 0; - - break; - } - - case I_Predator: - { - ps->CurrentMission = PredMission_DestroyComputers; - ps->StateChangeObjectFlags = 0; - ps->securityClearances = MakeFlag (LS_CMC4_CMC6); - break; - } - - case I_Alien: - { - ps->CurrentMission = AlienMission_DestroyMarines; - ps->StateChangeObjectFlags = 0; - - break; - } - - - default: - { - break; - } - } - } -} - -static GAMEOBJECT * GetGameObject (const char * id) -{ - GAMEOBJECT * goptr = &GameObjects[0]; - - while (goptr->StateChangeObjectNum != GOT_LASTGAMEOBJECT) - { - int id1, id2; - - id1 = *(int*)id; - id2 = *(((int*)id) + 1); - - if ((id1 == goptr->id1) && (id2 == goptr->id2)) - { - return(goptr); - } - - goptr++; - - } - return(0); -} - -STRATEGYBLOCK *GetMeThisStrategyBlock(GAMETARGETOBJECTS This_One) { - - int a,num; - - a=0; - num=-1; - - while (GameStratblockList[a].TargetObjectNum!=GT_LAST_TARGET_OBJECT) { - if (GameStratblockList[a].TargetObjectNum==This_One) { - num=a; - break; - } - a++; - } - - if (num==-1) { - return(NULL); - } - - return(FindSBWithName(GameStratblockList[num].SBname)); - -} - -BOOL GameFlowStateChangeObjectEncountered (STRATEGYBLOCK * sbPtr) -{ - //I don't hink any of these are necessary any more - Richard. - #if 0 - char * id = sbPtr->SBname; - - if (!(AvP.Network == I_No_Network) || !GameFlowOn) - { - return (0); - } - - switch (AvP.PlayerType) - { - case I_Marine: - { - switch (PlayerStatusPtr->CurrentMission) - { - case MarineMission_DisableLifts: - { - GAMEOBJECT * goptr = GetGameObject (id); - - GLOBALASSERT(0); - /* How could that happen??? */ - - if (goptr) - { - if (goptr->StateChangeObjectNum >= GOT_LIFTOVERRIDE1 && - goptr->StateChangeObjectNum <= GOT_LIFTOVERRIDE4) - { - PlayerStatusPtr->StateChangeObjectFlags |= MakeFlag (goptr->StateChangeObjectNum); - } - if (goptr->StateChangeObjectNum == GOT_LIFTOVERRIDE3) - { - PlayerStatusPtr->securityClearances &= ~MakeFlag (LS_Gen3Internal); - } - } - - if ( - (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_LIFTOVERRIDE1)) && - (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_LIFTOVERRIDE2)) && - (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_LIFTOVERRIDE3)) && - (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_LIFTOVERRIDE4)) - ) - { - PlayerStatusPtr->securityClearances |= MakeFlag (LS_Gen1_Gen3); - } - - break; - } - - case MarineMission_DestructBase: - { - GAMEOBJECT * goptr = GetGameObject (id); - - GLOBALASSERT(0); - /* How could that happen??? */ - - if (goptr) if (goptr->StateChangeObjectNum == GOT_SELFDESTRUCT) - { - ActivateSelfDestructSequence(150); - PlayerStatusPtr->securityClearances |= MakeFlag (LS_MPS4_SURFACE); - } - - break; - } - - case MarineMission_NoneAsYet: - { - /* This is Jules's level. CDF 1/12/97 */ - GAMEOBJECT * goptr = GetGameObject (id); - - if (goptr) { - switch (goptr->StateChangeObjectNum) { - case GOT_FAKESWITCH_IN_GENERATOR: - { - STRATEGYBLOCK *target; - - target=NULL; - target=GetMeThisStrategyBlock(GT_YARD_DOOR_1); - if (target) { - UnlockThisProxdoor(target); - } - target=NULL; - target=GetMeThisStrategyBlock(GT_YARD_DOOR_2); - if (target) { - UnlockThisProxdoor(target); - } - target=NULL; - target=GetMeThisStrategyBlock(GT_YARD_DOOR_3); - if (target) { - UnlockThisProxdoor(target); - } - target=NULL; - target=GetMeThisStrategyBlock(GT_YARD_DOOR_4); - if (target) { - UnlockThisProxdoor(target); - } - ActivateHive(); - - break; - } - case GOT_DATALOG_1: - case GOT_DATALOG_2: - case GOT_DATALOG_3: - PlayerStatusPtr->StateChangeObjectFlags |= MakeFlag (goptr->StateChangeObjectNum); - return(1); - break; - case GOT_ENDLEVEL_EVENT: - if ( - (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_DATALOG_1)) && - (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_DATALOG_2)) && - (PlayerStatusPtr->StateChangeObjectFlags & MakeFlag (GOT_DATALOG_3)) - ) { - /* I guess we'd better end the level, then. */ - textprint("\n\n\nEND OF LEVEL!\n\n\n"); - AvP.MainLoopRunning = 0; - } - break; - default: - textprint("Unknown gameflow object %d! I'm well confused!\n",goptr->StateChangeObjectNum); - GLOBALASSERT(0); - break; - } - } - - break; - } - - default: - { - break; - } - } - - break; - } - - case I_Predator: - { - #if 1 - return(1); - #else - switch (PlayerStatusPtr->CurrentMission) - { - case PredMission_GetShipGen3: - case PredMission_GetShipCMC2: - { - GAMEOBJECT * goptr = GetGameObject (id); - if (goptr) - if (goptr->StateChangeObjectNum == GOT_PREDSHIP1 || - goptr->StateChangeObjectNum == GOT_PREDSHIP2) - { - PlayerStatusPtr->StateChangeObjectFlags |= MakeFlag (goptr->StateChangeObjectNum); - return(1); - } - - break; - } - - default: - { - break; - } - } - #endif - break; - } - - default: - { - break; - } - } - #endif - return(0); -} - - - diff --git a/src/avp/gameflow.h b/src/avp/gameflow.h deleted file mode 100644 index 48ae21e..0000000 --- a/src/avp/gameflow.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef _gameflow_h -#define _gameflow_h 1 - -// allow a compile flag to switch system on and off -// otherwise assert frenzy may ensue -#include "gamedef.h" -#include "system.h" - -extern BOOL GameFlowOn; - -typedef enum -{ - IGFT_NewGame, - IGFT_ResumeGame, -}INITGAMEFLOWTYPE; - -typedef enum -{ - MarineMission_NoneAsYet, - MarineMission_DisableLifts, - MarineMission_GoToSP2, - MarineMission_LeaveRnDs, - MarineMission_GoToCMC6, - MarineMission_GoToCMC2, - MarineMission_DestructBase, - MarineMission_Won, - - PredMission_DestroyComputers, - PredMission_GetShipGen3, - PredMission_GetShipCMC2, - PredMission_KillPredAlien, - PredMission_KillQueen, - PredMission_ReturnToShip, - - AlienMission_DestroyMarines, - AlienMission_DestroyMarinesWithSpit, - AlienMission_DestoryOtherBaddies, - AlienMission_DestroyQueen, - - PlayerMissions_Last, - -} PLAYERMISSION; - -typedef enum -{ - LS_Gen1_Entrance = 1, - LS_Gen1_Medlab, - LS_Gen1_Gen2, - LS_Gen1_Gen3, - LS_Gen1_SP3, - LS_Gen1_CMC6, - LS_Gen1_CMC2, - LS_Gen1_RnD4, - LS_Gen1_SP2, - LS_Gen2_Gen3, - LS_CMC2_CMC4, - LS_CMC4_CMC6, - LS_SP3_MPS2, - LS_MPS2_MPS4, - LS_MPS4_SURFACE, - LS_SP2_RnD2, - LS_RnD2_RnD3, - LS_RnD3_RnD4, - LS_Gen3Internal, - LS_MaxLifts, - -} LIFTSECURITYNUMBERS; - -typedef enum -{ - GOT_LIFTOVERRIDE1, - GOT_LIFTOVERRIDE2, - GOT_LIFTOVERRIDE3, - GOT_LIFTOVERRIDE4, - GOT_SELFDESTRUCT, - GOT_COMPUTERSYSTEM, - GOT_PREDSHIP1, - GOT_PREDSHIP2, - /* New stuff for Jules's level: 1/12/97 CDF */ - GOT_FAKESWITCH_IN_GENERATOR, - GOT_DATALOG_1, - GOT_DATALOG_2, - GOT_DATALOG_3, - GOT_ENDLEVEL_EVENT, - - GOT_LASTGAMEOBJECT, -} GAMESTATECHANGEOBJECTS; - -typedef struct -{ - GAMESTATECHANGEOBJECTS StateChangeObjectNum; - int id1; - int id2; -} GAMEOBJECT; - -typedef enum { - GT_YARD_DOOR_1, - GT_YARD_DOOR_2, - GT_YARD_DOOR_3, - GT_YARD_DOOR_4, - - GT_LAST_TARGET_OBJECT, -} GAMETARGETOBJECTS; - -typedef struct { - GAMETARGETOBJECTS TargetObjectNum; - char SBname[SB_NAME_LENGTH]; -} GAME_STRATBLOCK_LIST_ENTRY; - -struct player_status; - -// Internal Platform independent fns. -extern int ChangingLevelGameFlowUpdate (I_AVP_ENVIRONMENTS current, I_AVP_ENVIRONMENTS next); -// returns 1 if it is playing an FMV, or 0 otherwise - -extern void InitGameFlowSystem (struct player_status * ps, INITGAMEFLOWTYPE igft); - -// returns 1 if the Object should be picked up, 0 otherwise -extern BOOL GameFlowStateChangeObjectEncountered (STRATEGYBLOCK * sbPtr); - -// Internal Platform dependent fns. -// see glfwplat.c -extern void DoStartMissionSequence (PLAYERMISSION mission); - - -#endif \ No newline at end of file diff --git a/src/avp/win95/cheat.c b/src/avp/win95/cheat.c index bdaebd5..bc427fd 100644 --- a/src/avp/win95/cheat.c +++ b/src/avp/win95/cheat.c @@ -12,7 +12,6 @@ #include "language.h" #include "cheat.h" #include "weapons.h" -#include "gameflow.h" #include "equipmnt.h" /* Extern for global keyboard buffer */ diff --git a/src/avp/win95/gflwplat.c b/src/avp/win95/gflwplat.c deleted file mode 100644 index b6598f1..0000000 --- a/src/avp/win95/gflwplat.c +++ /dev/null @@ -1,235 +0,0 @@ -#include "3dc.h" -#include "module.h" -#include "inline.h" - -#include "stratdef.h" -#include "gamedef.h" -#include "bh_types.h" -#include "gameplat.h" -#include "gameflow.h" - -static char * messages[PlayerMissions_Last]= -{ -"BASE COMMANDER:\n\ -WOAH, CAN'T SPEAK NOW, THERE'S \n\ -SOME MAJOR SHIT GOING DOWN. GET\n\ -YOUR ARSE TO GENERAL.", - -"BASE COMMANDER:\n\ -HEADS UP TROOP WE'RE IN SOME PRETTY \n\ -SHIT. TAKE OUT THE 4 VEHICLE LIFT \n\ -MANUAL OVERRIDE CONTROLS IN \n\ -LIVING QUARTERS AND HANGAR ONE. WE'LL \n\ -OPEN ACCESS TO THE LIFT OUT. THEY'RE\n\ -THE ONES WITH THE COMPUTER TERMINAL AT\n\ -THE TOP AND A YELLOW STRIPED PIPE AT\n\ -THE BOTTOM. OH, AND, WATCH YOUR BACK,\n\ -THERE IS SOME ER.. EXPERIMENTAL TECH\n\ -STUFF LOOSE IN THE BASE.", - -"BASE COMMANDER:\n\ -TROOP, FURTHER ORDERS FROM ON HIGH.\n\ -GET TO SECURITY 2, THERE'S SOME AMMO\n\ -WAITING. BASE COM OUT.", - -"BASE COMMANDER:\n\ -BASE COM HERE. I DON'T LIKE THIS MUCH, \n\ -BUT THIS PRETTY LI'L LADY WON'T TAKE\n\ -NO FOR AN ANSWER. THE SCI TECH STUFF,\n\ -ITS WORSE THAN WE THOUGHT, 'SPECIALLY\n\ -IN R'N'D LABS. WE CAN'T ALLOW ACCESS\n\ -TO THE LIFT. I GUESS THE ONLY OPTION\n\ -IS TO GO THE LONG WAY ROUND. WATCH\n\ -YOUR BACK, AND TRY TO KILL AS MANY AS\n\ -YOU CAN, OK?", - -"BASE COMMANDER:\n\ -AN ESCAPE SHIP IS PREPPED, WE'LL WAIT\n\ -AS LONG AS WE CAN. MEET POINT IS MY \n\ -OFFICE IN MAIN CONTROL, GET HERE ASAP.", - -"BASE COMMANDER:\n\ -SHIT, TROOP WE COULDN'T WAIT. WE'RE \n\ -NOW IN MAIN ARMOURY. ACCESS TO GENERAL \n\ -AND MAIN CONTROL IS SEALED OFF. WE'LL \n\ -HOLD DOWN IN HANGAR TWO FOR YOU.\n\ -WATCH OUT FOR SENTRY GUNS, WE'VE\n\ -PLACED THEM TO COVER OUR BACKS. THE\n\ -ARMOURY IS STILL FULL OF AMMO.", - -"CORPORATION WOMAN:\n\ -WE ARE NOW IN ORBIT. YOUR ONLY CHANCE\n\ -TO SURVIVE IS TO REACH THE EMERGENCY \n\ -SHUTTLE, BUT IT WILL ONLY WORK IF THE \n\ -BASE SELF-DESTRUCT IS SET. YOU CAN \n\ -REACH THE DESTRUCT CORE IN MAIN \n\ -REACTOR. ONCE YOU'VE SET IT, YOU \n\ -CAN GET OUT ACROSS THE SURFACE TO THE\n\ -SHUTTLE.", - -"CONGRATULATIONS, YOU HAVE WON.\n\ -ENJOY THE SURFACE LEVEL.", - - - - -"DESTROY THE COMPUTERS IN MAIN CONTROL\n", - -"RECOVER SHIP PART FROM HANGAR ONE\n", - -"RECOVER SHIP PART FROM HANGAR TWO\n", - -"KILL PREDATOR ALIENS\n", - -"KILL ALIEN QUEEN AND SET SELF-\n\ -DESTRUCT IN MAIN REACTOR\n", - -"RETURN TO SHIP IN NON-TERRESTRIAL\n\ -TECHNOLOGY LAB.\n", - - - - - 0, - 0, - 0, - 0, - -}; - -extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock; - - -void DoStartMissionSequence (PLAYERMISSION mission) -{ - - char buffer[1024]; - - sprintf(buffer, "%s\n\nPress Return\n", messages[mission]); - - ColourFillBackBuffer(0); -#if PreBeta - jtextprint ("%s", buffer); - FlipBuffers(); -#elif debug - textprint ("%s", buffer); - FlushTextprintBuffer(); - FlipBuffers(); -#endif - -} - -char * GetCurrentMissionString () -{ - if (PlayerStatusPtr->CurrentMission < PlayerMissions_Last) - { - return(messages[PlayerStatusPtr->CurrentMission]); - } - else - { - return(0); - } -} - -void ShowMissionMessage () -{ - char buffer[1024]; - - if (!messages[PlayerStatusPtr->CurrentMission]) - { - return; - } - - sprintf(buffer, "%s\nSecurity %x Flags %x\n", messages[PlayerStatusPtr->CurrentMission], - PlayerStatusPtr->securityClearances, - PlayerStatusPtr->StateChangeObjectFlags); - -#if PreBeta - jtextprint ("%s", buffer); -#elif debug - textprint ("%s", buffer); -#endif -} - -// this will only print one string from the top of the screen - -static int CharWidthInPixels(unsigned char Ch) -{ - if - ( - ( - (Ch>=FontStart) - && - (Ch<=FontEnd) - ) - || - (' '==Ch) - - ) - { - return CharWidth; - } - else - { - return 0; - } -} - -static int LastDisplayableXForChars(void) -{ - return ScreenDescriptorBlock.SDB_Width-CharWidth; -} - -void jtextprint (const char* t, ...) -{ - char buffer [1024]; - /* - Get message string from arguments into buffer... - */ - { - va_list ap; - - va_start(ap, t); - vsprintf(&buffer[0], t, ap); - va_end(ap); - } - - { - int x=0,y=0; - char * cptr = &buffer[0]; - - while (*cptr != 0) - { - switch (*cptr) - { - case '\n': - { - y += CharVertSep; - x = 0; - break; - } - - default: - { - BlitWin95Char (x, y, *cptr); - - x+=CharWidthInPixels(*cptr); - if (x>LastDisplayableXForChars()) - { - y += CharVertSep; - x = 0; - } - - break; - } - } - - cptr ++; - } - - - } - - - -} diff --git a/src/mslhand.c b/src/mslhand.c deleted file mode 100644 index fe1e8ca..0000000 --- a/src/mslhand.c +++ /dev/null @@ -1,187 +0,0 @@ -#include "3dc.h" - -#include "mslhand.h" - -#if PSX -#include "psx_inc.h" -#endif - -#define UseLocalAssert 1 -#include "ourasert.h" - -extern SHAPEHEADER * mainshapelist[]; - -static int begins[ MSLS_MAXSECTIONS ]; -static int ends[ MSLS_MAXSECTIONS ]; - -static int autodelete[ maxobjects ]; - -#define MSS_FREE (-1) - -static void EnsureInitialized(void) -{ - static int initialized = 0; - - if (!initialized) - { - int i; - - initialized = 1; - - for (i=0; i=0 ? ends[i] : 0; - } - - blockstart = ends[sect]; - /* can use a local assert here to fail on a mainshapelist overflow, otherwise return error code */ - LOCALASSERT(ends[sect] + num_shapes <= maxend); - if (ends[sect] + num_shapes > maxend ) return MSL_OVERFLOW; - ends[sect] += num_shapes; - - for (i=blockstart; ipoints) - { - if (*shp->points) free(*shp->points); - free(shp->points); - } - if (shp->sh_normals) - { - if (*shp->sh_normals) free(*shp->sh_normals); - free(shp->sh_normals); - } - if (shp->sh_vnormals) - { - if (*shp->sh_vnormals) free(*shp->sh_vnormals); - free(shp->sh_vnormals); - } - if (shp->sh_extraitemdata) - free(shp->sh_extraitemdata); - /* the items are allocated in one big bunch - // 9 int's per item (to make bsp simple) - // this should be changed if it is to be done - // a different way - */ - if (shp->items) - { - for (i=0; inumitems; i++) - { - if (shp->items[i][0] == 5 || shp->items[i][0] == 6) - { - int UVIndex = (shp->items[i][3] &0xffff0000) >> 16; - max_num_texs = max (max_num_texs, shp->items[i][3] &0x7fff); - if(shp->items[i][2]& iflag_txanim) - { - int j; - TXANIMHEADER** thlist=(TXANIMHEADER**)shp->sh_textures[UVIndex]; - for(j=1;thlist[j]!=0;j++) - { - int k; - TXANIMHEADER* th=thlist[j]; - for(k=0;ktxa_numframes;k++) - { - free(th->txa_framedata[k].txf_uvdata); - } - free (th->txa_framedata); - free (th); - } - free (thlist); - shp->sh_textures[UVIndex]=0; - } - else - { - free(shp->sh_textures[UVIndex]); - } - } - } - - free (*shp->items); - free (shp->items); - } - - if (shp->sh_textures) - { - free (shp->sh_textures); - } - - if (shp->sh_localtextures) - { - for (i=0; i<(max_num_texs+1); i++) - { - free (shp->sh_localtextures[i]); - } - free (shp->sh_localtextures); - } - - if (shp->sh_instruction) - free(shp->sh_instruction); - - free(shp); - } - mainshapelist[i]=0; - autodelete[i]=0; - } - - begins[sect]=MSS_FREE; - ends[sect]=MSS_FREE; - -#else - -printf("\nDo NOT call this function!\n"); -//GLOBALASSERT(1==0); - -#endif - -} diff --git a/src/mslhand.h b/src/mslhand.h deleted file mode 100644 index bb08334..0000000 --- a/src/mslhand.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _included_mslhand_h_ -#define _included_mslhand_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum MSL_Section -{ - MSLS_COMPILEDIN, - MSLS_CHARACTER, - MSLS_ENVIRONMENT, - - MSLS_MAXSECTIONS - -} MSL_SECTION; - -#define MSL_OVERFLOW (-1) - -int GetNextMSLEntry(MSL_SECTION, unsigned int num_shapes, int auto_delete); - -void FlushMSLSection(MSL_SECTION); - -#ifdef __cplusplus -} -#endif - -#endif /* !_included_mslhand_h_ */