From 361c1319328308341d00a8c6dacc28e6096dd041 Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Sun, 4 May 2008 13:51:57 -0700 Subject: [PATCH] Removed most references to PSX, Saturn and E3 Demo. --- Makefile | 2 +- src/avp/bh_ais.c | 9 +- src/avp/bh_alien.h | 7 +- src/avp/bh_binsw.c | 2 - src/avp/bh_debri.h | 11 +- src/avp/bh_far.c | 4 - src/avp/bh_far.h | 11 +- src/avp/bh_lift.c | 31 +---- src/avp/bh_ltfx.c | 14 -- src/avp/bh_marin.c | 12 -- src/avp/bh_paq.c | 2 - src/avp/bh_pred.c | 2 - src/avp/bh_spcl.c | 9 +- src/avp/bh_spcl.h | 5 - src/avp/comp_map.c | 5 +- src/avp/equipmnt.h | 179 -------------------------- src/avp/gamedef.h | 44 +------ src/avp/hud.c | 131 +------------------ src/avp/huddefs.h | 3 +- src/avp/maps.c | 78 ------------ src/avp/pfarlocs.c | 38 +----- src/avp/pvisible.c | 25 ++-- src/avp/triggers.c | 22 +--- src/avp/win95/ddplat.cpp | 77 ----------- src/avp/win95/kzsort.c | 8 -- src/avp/win95/system.h | 2 - src/include/mem3dc.h | 6 +- src/include/prototyp.h | 231 --------------------------------- src/include/shape.h | 13 -- src/kshape.c | 6 - src/maths.c | 147 +-------------------- src/mem3dc.c | 268 +-------------------------------------- src/win95/ltchunk.hpp | 1 - src/win95/plat_shp.c | 2 - src/win95/platform.h | 2 - 35 files changed, 47 insertions(+), 1362 deletions(-) delete mode 100644 src/avp/maps.c diff --git a/Makefile b/Makefile index 06cc70c..df47412 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ CXXFLAGS = $(CFLAGS) LDLIBS = -m32 $(shell sdl-config --libs) $(shell openal-config --libs) ROOT = main.c files.c winapi.c stubs.c version.c mathline.c opengl.c oglfunc.c openal.c cdplayer.c menus.c net.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c object.c shpanim.c sphere.c tables.c vdb.c -AVP = ai_sight.c avpview.c bh_agun.c bh_ais.c bh_alien.c bh_binsw.c bh_cable.c bh_corpse.c bh_deathvol.c bh_debri.c bh_dummy.c bh_fan.c bh_far.c bh_fhug.c bh_gener.c bh_ldoor.c bh_lift.c bh_light.c bh_lnksw.c bh_ltfx.c bh_marin.c bh_mission.c bh_near.c bh_pargen.c bh_plachier.c bh_plift.c bh_pred.c bh_queen.c bh_rubberduck.c bh_selfdest.c bh_snds.c bh_spcl.c bh_swdor.c bh_track.c bh_types.c bh_videoscreen.c bh_waypt.c bh_weap.c bh_xeno.c bonusabilities.c cconvars.cpp cdtrackselection.cpp cheatmodes.c comp_map.c comp_shp.c consolelog.cpp davehook.cpp deaths.c decal.c detaillevels.c dynamics.c dynblock.c equipmnt.c equiputl.cpp extents.c game.c game_statistics.c gamecmds.cpp gamevars.cpp hmodel.c hud.c inventry.c language.c lighting.c load_shp.c los.c maps.c mempool.c messagehistory.c missions.cpp movement.c paintball.c particle.c pfarlocs.c pheromon.c player.c pmove.c psnd.c psndproj.c pvisible.c savegame.c scream.cpp secstats.c sfx.c stratdef.c targeting.c track.c triggers.c weapons.c +AVP = ai_sight.c avpview.c bh_agun.c bh_ais.c bh_alien.c bh_binsw.c bh_cable.c bh_corpse.c bh_deathvol.c bh_debri.c bh_dummy.c bh_fan.c bh_far.c bh_fhug.c bh_gener.c bh_ldoor.c bh_lift.c bh_light.c bh_lnksw.c bh_ltfx.c bh_marin.c bh_mission.c bh_near.c bh_pargen.c bh_plachier.c bh_plift.c bh_pred.c bh_queen.c bh_rubberduck.c bh_selfdest.c bh_snds.c bh_spcl.c bh_swdor.c bh_track.c bh_types.c bh_videoscreen.c bh_waypt.c bh_weap.c bh_xeno.c bonusabilities.c cconvars.cpp cdtrackselection.cpp cheatmodes.c comp_map.c comp_shp.c consolelog.cpp davehook.cpp deaths.c decal.c detaillevels.c dynamics.c dynblock.c equipmnt.c equiputl.cpp extents.c game.c game_statistics.c gamecmds.cpp gamevars.cpp hmodel.c hud.c inventry.c language.c lighting.c load_shp.c los.c mempool.c messagehistory.c missions.cpp movement.c paintball.c particle.c pfarlocs.c pheromon.c player.c pmove.c psnd.c psndproj.c pvisible.c savegame.c scream.cpp secstats.c sfx.c stratdef.c targeting.c track.c triggers.c weapons.c SHAPES = cube.c SUPPORT = consbind.cpp consbtch.cpp coordstr.cpp daemon.cpp indexfnt.cpp r2base.cpp r2pos666.cpp reflist.cpp refobj.cpp rentrntq.cpp scstring.cpp strtab.cpp strutil.c trig666.cpp wrapstr.cpp AVPWIN95 = avpchunk.cpp cheat.c chtcodes.cpp d3d_hud.cpp ddplat.cpp endianio.c ffread.cpp ffstdio.cpp gammacontrol.cpp hierplace.cpp iofocus.cpp jsndsup.cpp kzsort.c langplat.c modcmds.cpp npcsetup.cpp objsetup.cpp pathchnk.cpp platsup.c pldghost.c pldnet.c progress_bar.cpp projload.cpp scrshot.cpp strachnk.cpp system.c usr_io.c vision.c diff --git a/src/avp/bh_ais.c b/src/avp/bh_ais.c index 76361f6..1db2e9f 100644 --- a/src/avp/bh_ais.c +++ b/src/avp/bh_ais.c @@ -968,8 +968,7 @@ int NPCOrientateToVector(STRATEGYBLOCK *sbPtr, VECTORCH *zAxisVector,int turnspe mat.mat33 = cos; // NOTE : It seems like OrientMat is not being set per frame which - // leads to inaccuracy build-up from the matrix multiplies. When this - // is fixed, the following PSXAccurateMatrixMultiply can be removed + // leads to inaccuracy build-up from the matrix multiplies. if (offset) { VECTORCH new_offset,delta_offset; @@ -1000,11 +999,7 @@ int NPCOrientateToVector(STRATEGYBLOCK *sbPtr, VECTORCH *zAxisVector,int turnspe } - #if PSX - PSXAccurateMatrixMultiply(&sbPtr->DynPtr->OrientMat,&mat,&sbPtr->DynPtr->OrientMat); - #else MatrixMultiply(&sbPtr->DynPtr->OrientMat,&mat,&sbPtr->DynPtr->OrientMat); - #endif MatrixToEuler(&sbPtr->DynPtr->OrientMat, &sbPtr->DynPtr->OrientEuler); } @@ -1415,9 +1410,7 @@ void NPCGetMovementDirection(STRATEGYBLOCK *sbPtr, VECTORCH *velocityDirection, (GMD_myPolyPoints[point1].vy == GMD_myPolyPoints[point2].vy) && (GMD_myPolyPoints[point1].vz == GMD_myPolyPoints[point2].vz)) { - #if (!Saturn) LOCALASSERT(1==0); - #endif myPolyEdgeMoveDistances[i] = 0; } } diff --git a/src/avp/bh_alien.h b/src/avp/bh_alien.h index 5a7d814..2778a81 100644 --- a/src/avp/bh_alien.h +++ b/src/avp/bh_alien.h @@ -180,11 +180,8 @@ #define WOUNDING_SPEED_EFFECTS 1 #define ALIEN_STARTING_HEALTH (30) - #if PSX||Saturn - #define NO_OF_FRAGMENTS_FROM_DEAD_ALIEN (5) - #else - #define NO_OF_FRAGMENTS_FROM_DEAD_ALIEN (10) - #endif + #define NO_OF_FRAGMENTS_FROM_DEAD_ALIEN (10) + /* random time between 1.5 and 2 seconds,in fixed point, with granularity 1/32th second */ #if ULTRAVIOLENCE #define ALIEN_FAR_MOVE_TIME ((48+(FastRandom()&0xF))*(ONE_FIXED>>7)) diff --git a/src/avp/bh_binsw.c b/src/avp/bh_binsw.c index 9c5028f..6a53c4a 100644 --- a/src/avp/bh_binsw.c +++ b/src/avp/bh_binsw.c @@ -192,9 +192,7 @@ void* BinarySwitchBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr) } } -#if !Saturn // GLOBALASSERT(bs_bhv->bs_dtype != binswitch_no_display); -#endif // fill in the rest ourselves diff --git a/src/avp/bh_debri.h b/src/avp/bh_debri.h index 320242b..3888922 100644 --- a/src/avp/bh_debri.h +++ b/src/avp/bh_debri.h @@ -1,3 +1,6 @@ +#ifndef BH_DEBRI_H +#define BH_DEBRI_H + typedef struct OneShotAnimBehaviourType { int counter; @@ -37,12 +40,4 @@ extern void OneShotBehaveFun(STRATEGYBLOCK* sptr); extern void OneShot_Anim_BehaveFun(STRATEGYBLOCK* sptr); extern void MakeFragments (STRATEGYBLOCK *sbptr); - -#define EXPLOSION_LIFETIME (ONE_FIXED/4) -#define EXPLOSION_ANIM_SPEED (ONE_FIXED*16) -#define EXPLOSION_LIGHTING_SCALE (ONE_FIXED*16/3) -#if PSX || Saturn -#define NO_OF_SPRITES_IN_BIG_EXPLOSION 5 -#else -#define NO_OF_SPRITES_IN_BIG_EXPLOSION 10 #endif diff --git a/src/avp/bh_far.c b/src/avp/bh_far.c index a1cb0e4..165a179 100644 --- a/src/avp/bh_far.c +++ b/src/avp/bh_far.c @@ -191,7 +191,6 @@ void FarAlienBehaviour(STRATEGYBLOCK *sbPtr) if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR ALIEN MODULE CONTAINMENT FAILURE \n"); LOGDXFMT(("Alien containment failure: %s alien is in %s, position is %d,%d,%d:\nModule extents are: %d:%d, %d:%d, %d:%d", @@ -201,7 +200,6 @@ void FarAlienBehaviour(STRATEGYBLOCK *sbPtr) thisModule->m_maxz,thisModule->m_minz)); LOCALASSERT(1==0); - #endif } } #endif @@ -922,7 +920,6 @@ void LocateFarNPCInAIModule(STRATEGYBLOCK *sbPtr, AIMODULE *targetModule) if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR ALIEN MODULE CONTAINMENT FAILURE \n"); LOGDXFMT(("Alien containment failure: alien is in %s, position is %d,%d,%d:\nModule extents are: %d:%d, %d:%d, %d:%d", @@ -931,7 +928,6 @@ void LocateFarNPCInAIModule(STRATEGYBLOCK *sbPtr, AIMODULE *targetModule) thisModule->m_maxz,thisModule->m_minz)); LOCALASSERT(1==0); - #endif } } #endif diff --git a/src/avp/bh_far.h b/src/avp/bh_far.h index b6bf21d..7c8f81d 100644 --- a/src/avp/bh_far.h +++ b/src/avp/bh_far.h @@ -45,15 +45,8 @@ extern AIMODULE *FarNPC_GetTargetAIModuleForMarineRespond(STRATEGYBLOCK *sbPtr); extern void FarNpc_FlipAround(STRATEGYBLOCK *sbPtr); /* this define to help stop aliens coagulating in the environment */ -#if SupportWindows95 - #define MAX_GENERATORNPCSPERMODULE 5 - #define MAX_VISIBLEGENERATORNPCS 8 //12 -#else - /* PSX & Saturn*/ - #define MAX_GENERATORNPCSPERMODULE 5 - #define MAX_VISIBLEGENERATORNPCS 6 -#endif - +#define MAX_GENERATORNPCSPERMODULE 5 +#define MAX_VISIBLEGENERATORNPCS 8 //12 #ifdef __cplusplus diff --git a/src/avp/bh_lift.c b/src/avp/bh_lift.c index ca34e4d..b674788 100644 --- a/src/avp/bh_lift.c +++ b/src/avp/bh_lift.c @@ -304,32 +304,15 @@ void LiftBehaveFun(STRATEGYBLOCK* sbptr) { // if there is a dest, set the lift to go // close current stations - #if PC_E3DEMO - LIFT_STATION* dest_stn = lift_ctrl->lift_stations[lift_ctrl->dest_station]; - #endif - lift_stn = lift_ctrl->lift_stations[lift_ctrl->curr_station]; - #if PC_E3DEMO - if(dest_stn->env != AvP.CurrentEnv) - { - // turn off inter env lifts - NewOnScreenMessage(GetTextString(TEXTSTRING_DB_ACCESSDENIED)); - RequestState(dest_stn->lift_floor_switch, 0, 0); - lift_ctrl->dest_station = -1; - dest_stn->called = 0; - } - else - #endif - { - lift_ctrl->prev_station = lift_ctrl->curr_station; - if(lift_stn->lift_door) - { - // no door - must be on another env - RequestState(lift_stn->lift_door, 0, 0); - } - lift_ctrl->state = I_ls_closing_door; - } + lift_ctrl->prev_station = lift_ctrl->curr_station; + if(lift_stn->lift_door) + { + // no door - must be on another env + RequestState(lift_stn->lift_door, 0, 0); + } + lift_ctrl->state = I_ls_closing_door; } break; diff --git a/src/avp/bh_ltfx.c b/src/avp/bh_ltfx.c index 5ae5b82..847dbc8 100644 --- a/src/avp/bh_ltfx.c +++ b/src/avp/bh_ltfx.c @@ -18,19 +18,6 @@ extern int NormalFrameTime; -#if PSX - -void * LightFXBehaveInit (void * bhdata, STRATEGYBLOCK* sbptr) -{ - -} -void LightFXBehaveFun (STRATEGYBLOCK* sbptr) -{ - -} - -#else - void * LightFXBehaveInit (void * bhdata, STRATEGYBLOCK* sbptr) { LIGHT_FX_BEHAV_BLOCK * lfxbb; @@ -641,4 +628,3 @@ void SaveStrategy_LightFx(STRATEGYBLOCK* sbPtr) COPYELEMENT_SAVE(timer2) COPYELEMENT_SAVE(time_to_next_flicker_state) } -#endif diff --git a/src/avp/bh_marin.c b/src/avp/bh_marin.c index 71c85e8..f67c266 100644 --- a/src/avp/bh_marin.c +++ b/src/avp/bh_marin.c @@ -3219,10 +3219,8 @@ void WanderMission_Control(STRATEGYBLOCK *sbPtr) { if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR MARINE MODULE CONTAINMENT FAILURE \n"); LOCALASSERT(1==0); - #endif } } #endif @@ -3573,10 +3571,8 @@ void PathfinderMission_Control(STRATEGYBLOCK *sbPtr) { if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR MARINE MODULE CONTAINMENT FAILURE \n"); LOCALASSERT(1==0); - #endif } } #endif @@ -3897,10 +3893,8 @@ void GuardMission_Control(STRATEGYBLOCK *sbPtr) { if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR MARINE MODULE CONTAINMENT FAILURE \n"); LOCALASSERT(1==0); - #endif } } #endif @@ -4247,10 +4241,8 @@ void LocalGuardMission_Control(STRATEGYBLOCK *sbPtr) { if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR MARINE MODULE CONTAINMENT FAILURE \n"); LOCALASSERT(1==0); - #endif } } #endif @@ -4544,10 +4536,8 @@ void LoiterMission_Control(STRATEGYBLOCK *sbPtr) { if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR MARINE MODULE CONTAINMENT FAILURE \n"); LOCALASSERT(1==0); - #endif } } #endif @@ -13627,10 +13617,8 @@ void RunAroundOnFireMission_Control(STRATEGYBLOCK *sbPtr) { if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR MARINE MODULE CONTAINMENT FAILURE \n"); LOCALASSERT(1==0); - #endif } } #endif diff --git a/src/avp/bh_paq.c b/src/avp/bh_paq.c index 382a85f..f0bd604 100644 --- a/src/avp/bh_paq.c +++ b/src/avp/bh_paq.c @@ -246,10 +246,8 @@ void PAQBehaviour(STRATEGYBLOCK *sbPtr) if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("PAQ MODULE CONTAINMENT FAILURE \n"); LOCALASSERT(1==0); - #endif } } #endif diff --git a/src/avp/bh_pred.c b/src/avp/bh_pred.c index f8edf96..ca1caed 100644 --- a/src/avp/bh_pred.c +++ b/src/avp/bh_pred.c @@ -1350,10 +1350,8 @@ void PredatorBehaviour(STRATEGYBLOCK *sbPtr) if(PointIsInModule(thisModule, &localCoords)==0) { - #if (!PSX) textprint("FAR PREDATOR MODULE CONTAINMENT FAILURE \n"); LOCALASSERT(1==0); - #endif } } #endif diff --git a/src/avp/bh_spcl.c b/src/avp/bh_spcl.c index d365404..ccc9efc 100644 --- a/src/avp/bh_spcl.c +++ b/src/avp/bh_spcl.c @@ -395,14 +395,9 @@ void XenoMorphRoomBehaviour (STRATEGYBLOCK * sbptr) pis->items = ms->items; pis->sh_textures = ms->sh_textures; -#if PSX -#else pis->sh_instruction[4].sh_instr_data = ms->sh_instruction[4].sh_instr_data; -#endif -#if SupportWindows95 sbptr->SBdptr->ObTxAnimCtrlBlks = xmrd->tacb; -#endif sbptr->SBdptr->ObShape = xmrd->ProbesInShape; sbptr->SBdptr->ObShapeData = GetShapeData(xmrd->ProbesInShape); @@ -499,10 +494,8 @@ void XenoMorphRoomBehaviour (STRATEGYBLOCK * sbptr) pis->items = xmrd->pis_items_str; pis->sh_textures = xmrd->pis_sht_str; -#if PSX -#else pis->sh_instruction[4].sh_instr_data = xmrd->pis_items_str; -#endif + xmrd->XMR_State = XMRS_Idle; } break; diff --git a/src/avp/bh_spcl.h b/src/avp/bh_spcl.h index 83d0657..25ec9ba 100644 --- a/src/avp/bh_spcl.h +++ b/src/avp/bh_spcl.h @@ -61,13 +61,8 @@ typedef struct xeno_morph_room_data int timer; -#if PSX - struct polyheader ** pis_items_str; - struct psx_texture ** pis_sht_str; -#else int ** pis_items_str; int ** pis_sht_str; -#endif char doorID[SB_NAME_LENGTH]; STRATEGYBLOCK* DoorToRoom; diff --git a/src/avp/comp_map.c b/src/avp/comp_map.c index 3f937e0..254408b 100644 --- a/src/avp/comp_map.c +++ b/src/avp/comp_map.c @@ -507,11 +507,8 @@ MODULEMAPBLOCK TempModuleMap = \ 0, /* VDB Definition */ 0, /* Interior Type */ -#if Saturn - LightType_PerObject, /* MapLightType */ -#else LightType_PerVertex, /* MapLightType */ -#endif + {0,0,0}, /* MapOrigin */ 0, /* MapSimShapes */ 0, /* MapViewType */ diff --git a/src/avp/equipmnt.h b/src/avp/equipmnt.h index 24720c8..09a95f4 100644 --- a/src/avp/equipmnt.h +++ b/src/avp/equipmnt.h @@ -398,182 +398,3 @@ extern BOOL AreDamageProfilesEqual(DAMAGE_PROFILE* profile1,DAMAGE_PROFILE* prof #endif #endif - - -/*KJL***************************************************************************************** -* Roxby's old stuff follows. I'm keeping it here 'cos it's very useful as reference material * -*****************************************************************************************KJL*/ - -#if 0 -/* - Hmmm. Weapons need to be treated differnetly to Other Objects - Such as AMMO and Tools. They have things like Info Screen data - (Text and schematics) range, damage, weight, incumberance, DM - status, Jam status, reliabilty, Vulnerablity. - - This contains the data sturcture and the weapons information - for the marine weapons - It may be extended to cover all - the predator weapons as well -*/ - -/* - The player can carry up to 100 kg.. Strong huh. - - encumberance - a measure of how `encumbering' the weapon may - actually be. It is an abstrcted measure of how much it slows - the player down - It shouldnt effect the players fatigue - and - how difficult it is to change to another weapon. - - To use a weapon it the players total `USING' encumberance has to - less than 50 in a normal corridor and less the 30 in an airduct - -*/ - - -/* Ammo - - Ammo - this is where the weight is.... - All this rounding... lets play - with integers only - - These are only the initial specs, I imagine dramatic alterations. - Partic if we want to swap to weights to use shifts rather than divs - - - 10 mm culw rounds (Ceramic - Ultra Light Weight) 0.05 Kg each. (1.5 oz!!) - 20 mm culw rounds (Ceramic - Ultra Light Weight) 0.08 Kg each. (1.5 oz!!) - standard grenades 0.2 Kg each . - Heavy grenades 0.4 Kg each. - shotgun rounds 0.1 each - - 0 standard grenade 1 Kg - 1 99x10 mm magizines of culw rounds. 5 Kg - 2 500x10 mm magazines of culw rounds. 25 Kg - 3 5xstandard grenades 1 Kg - 4 5 Heavy grenades HE 2 Kg - 5 5 Heavy grenades Napalm 2 Kg - 6 5 HEavy grenades Canister 2 Kg - 7 5 Heavy Grenades Cluster 2 Kg - 8 5 Heavy Grenades WP 2 Kg - 9 20x shotgun rounds 2 Kg - 10 20 litres of fuel 18 Kg - 11 500x20 mm magizines of culw rounds 40 Kg - 12 Sonic Gun Power Packs 5 Kg - - -*/ - -/* - Weapons Information - - Weight Kilos - Incumberance - Abstract use difficulty. - -*/ - -#define MAX_PLAYER_WEAPONS 10 -#define MAX_AMMO_TYPES 20 - -typedef struct ammo_data{ - unsigned char weight; /*in 10ths of KG*/ - unsigned char num_magazines; - unsigned short magazine_size; - unsigned short spread_radius; - unsigned short damage; - unsigned char damage_flags; - unsigned char flight_flags; -} AMMO_DATA; - - - -/*damage flags*/ - -#define DAMAGE_POINT 0x01 /*point pixel damage*/ -#define DAMAGE_SPREAD 0x02 /*Equal damage along radius*/ -#define DAMAGE_TAPER 0x04 /*Decreasing damge on radius*/ -#define DAMAGE_EXPLOSIVE1 0x08 /*explodes*/ -#define DAMAGE_EXPLOSIVE2 0x10 /*big explodes*/ -#define DAMAGE_DELAY 0x20 /*limpet*/ -#define DAMAGE_FLAME 0x40 /*sets things on fire*/ - - -/*Flight Flags*/ - -#define FLIGHT_HAND_GRENADE 0x01 -#define FLIGHT_BULLET 0x02 -#define FLIGHT_GRENADE_LNCH 0x04 - - -typedef struct weapon_ammo_attributes{ - unsigned char ammotype; - unsigned char remaining_ammo; - unsigned char targeting_flags; - unsigned char rate_of_fire; /*frames Between rounds */ - unsigned char magazine_reload_time; /*frames to reload magazine*/ - unsigned short failure_risk; /*0 - 2**16*/ - unsigned char failure_flags; - -} WEAP_AMMO_ATTR; - -/* WEapon data contains the data to maintain, draw weapons - generation of these objects comes via the entity*/ - -/* - *schematic --- for the data retrival - *hudata - for drawing the HUD graphic . Note that this is PLATFORM dependent - *descriptive text --- to print up in the data retrival -*/ - -typedef struct weapon_data{ - - char weapon_flags; - char name[8]; /* can be made into something else if ness*/ - /* YES the address of the platform spec data - structure*/ - void *schematic; /* these contain the file name before the */ - HUDGRAPHIC *huddata; /* graphic is loaded into here -- LPDDS*/ - - char *descriptivetext; - - unsigned char weight; /*in 10ths of KG*/ - unsigned char encumbrance; /*time it takes to swap the - weapon in pixels per sec*/ - - - WEAP_AMMO_ATTR primary; - WEAP_AMMO_ATTR secondary; - - #if Saturn - char* WDroxptr; - #endif - -} WEAPON_DATA; - - -/*weapon_flags */ - -/*targeting flags*/ - -#define TARGETING_MANUAL 0x01 -#define TARGETING_XHAIR 0x02 -#define TARGETING_SMART 0x04 -#define TARGETING_XTOS 0x08 /*targeting depends on equip*/ -#define TARGETING_FAF_TRACK 0x10 /*Fire and forget....!*/ -#define TARGETING_THROWN 0x20 - -/* failure flags */ - -#endif - - - - - - - - - - - - - diff --git a/src/avp/gamedef.h b/src/avp/gamedef.h index e888635..d07085f 100644 --- a/src/avp/gamedef.h +++ b/src/avp/gamedef.h @@ -117,8 +117,7 @@ typedef enum environments I_Mps4, I_Surface, I_Entrance, -#if PSX || Saturn -#else + I_Dml1, // 25- Vertigo.rif for Al // #ifndef MPLAYER_DEMO I_Dml2, // KJL 16:59:58 05/1/97 - fruitbat.rif for Al @@ -131,7 +130,7 @@ typedef enum environments I_Dml9, // KJL 16:59:58 05/19/97 - mu.rif for Jake I_Dml10, // KJL 16:59:58 05/19/97 - mu.rif for Jake // #endif -#endif + I_Num_Environments // 34 }I_AVP_ENVIRONMENTS; @@ -249,39 +248,6 @@ extern int Destroy_CurrentEnvironment(); extern void LoadGameFromFile(); extern void SaveGameToFile(); extern void InitCharacter(); -/*************************************************************/ - -/* KJL 15:42:46 10/02/96 - Okay, I don't use HUDGRAPHIC on the PC anymore and I suggest -you don't use it on your platform either 'cos it's a mess. (Sorry Roxby, no offense...) */ - -/************ HUD GRAPHIC STUFF *********************/ - -typedef struct -{ - void* data; /* just about anything you feel like points to the file name*/ - char* filename; - int xdest, ydest; /*screen x y*/ - int width, height; /*depth and height of dest incase of shrink*/ - RECT_AVP *srcRect; - int hg_flags; - -}HUDGRAPHIC; - -/* where to put the grahic*/ - -#define HGflag_NotInVRAM 0x0000001 /*saturn only*/ -#define HGflag_LoadIntoVDP2 0x0000002 /*saturn only*/ -#define HGflag_LoadIntoVDP1 0x0000004 /*saturn only*/ - -/* how to get the graphic */ - -#define HGflag_AlwaysLoadOffDisk 0x00000200 /*cd or HD*/ -#define HGflag_LoadedIntoMemory 0x00000400 /*loaded into memory*/ - -/* source directory for the graphic */ - -#define HGflag_MenuDir 0x00010000 - /********************************************************/ @@ -304,9 +270,6 @@ extern int UsingDataBase; #define NUM_CREDIT_SCREENS 2 -extern HUDGRAPHIC Menu[]; -extern HUDGRAPHIC CreditScreen[]; - typedef enum { UNLIT, @@ -337,6 +300,3 @@ extern volatile char StillFading; #define GAMEDEF_INCLUDED #endif - - - diff --git a/src/avp/hud.c b/src/avp/hud.c index 6934ec8..cdf35f5 100644 --- a/src/avp/hud.c +++ b/src/avp/hud.c @@ -153,7 +153,6 @@ static void DisplayMarinesAmmo(void); static void DoMotionTracker(void); static int DoMotionTrackerBlips(void); -//static void UpdateMarineStatusValues(void); static void HandleMarineWeapon(void); static void AimGunSight(int aimingSpeed, TEMPLATE_WEAPON_DATA *twPtr); @@ -359,7 +358,7 @@ void MaintainHUD(void) HandleMarineWeapon(); if (CurrentVisionMode==VISION_MODE_NORMAL) DoMotionTracker(); -// UpdateMarineStatusValues(); + CheckWireFrameMode(0); //flash health if invulnerable if((playerStatusPtr->invulnerabilityTimer/12000 %2)==0) @@ -1039,135 +1038,7 @@ static void DisplayMarinesAmmo(void) } } -#if 0 -static void UpdateMarineStatusValues(void) -{ - PLAYER_WEAPON_DATA *weaponPtr; - /* access the extra data hanging off the strategy block */ - PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr); - GLOBALASSERT(playerStatusPtr); - - { - /* player's current weapon */ - GLOBALASSERT(playerStatusPtr->SelectedWeaponSlotWeaponSlot[playerStatusPtr->SelectedWeaponSlot]); - } - - - { - int value=playerStatusPtr->Health>>16; /* stored in 16.16 so shift down */ - ValueOfHUDDigit[MARINE_HUD_HEALTH_UNITS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_HEALTH_TENS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_HEALTH_HUNDREDS]=value%10; - } - { - #if PC_E3DEMO - int value=playerStatusPtr->Energy>>16; /* stored in 16.16 so shift down */ - #else - extern int FrameRate; - int value=FrameRate; - #endif - ValueOfHUDDigit[MARINE_HUD_ENERGY_UNITS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_ENERGY_TENS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_ENERGY_HUNDREDS]=value%10; - } - { - int value=playerStatusPtr->Armour>>16; /* stored in 16.16 so shift down */ - ValueOfHUDDigit[MARINE_HUD_ARMOUR_UNITS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_ARMOUR_TENS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_ARMOUR_HUNDREDS]=value%10; - } - - { - int value=weaponPtr->PrimaryRoundsRemaining>>16; - /* ammo is in 16.16. we want the integer part, rounded up */ - if ( (weaponPtr->PrimaryRoundsRemaining&0xffff) ) value+=1; - - ValueOfHUDDigit[MARINE_HUD_PRIMARY_AMMO_ROUNDS_UNITS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_PRIMARY_AMMO_ROUNDS_TENS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_PRIMARY_AMMO_ROUNDS_HUNDREDS]=value%10; - } - { - int value=weaponPtr->PrimaryMagazinesRemaining; - ValueOfHUDDigit[MARINE_HUD_PRIMARY_AMMO_MAGAZINES_UNITS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_PRIMARY_AMMO_MAGAZINES_TENS]=value%10; - } - - /* KJL 14:54:39 03/26/97 - secondary ammo */ - if ( (weaponPtr->WeaponIDNumber == WEAPON_PULSERIFLE) - ||(weaponPtr->WeaponIDNumber == WEAPON_MYSTERYGUN) ) - { - int value=weaponPtr->SecondaryRoundsRemaining>>16; - /* ammo is in 16.16. we want the integer part, rounded up */ - if ( (weaponPtr->SecondaryRoundsRemaining&0xffff) ) value+=1; - - ValueOfHUDDigit[MARINE_HUD_SECONDARY_AMMO_ROUNDS_UNITS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_SECONDARY_AMMO_ROUNDS_TENS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_SECONDARY_AMMO_ROUNDS_HUNDREDS]=value%10; - - value=weaponPtr->SecondaryMagazinesRemaining; - ValueOfHUDDigit[MARINE_HUD_SECONDARY_AMMO_MAGAZINES_UNITS]=value%10; - value/=10; - ValueOfHUDDigit[MARINE_HUD_SECONDARY_AMMO_MAGAZINES_TENS]=value%10; - - BLTMarineNumericsToHUD(MARINE_HUD_SECONDARY_AMMO_MAGAZINES_TENS); - } - else if (weaponPtr->WeaponIDNumber == WEAPON_GRENADELAUNCHER) - { - /* KJL 11:46:57 04/09/97 - use to display your ammo type */ - int value; - switch(GrenadeLauncherData.SelectedAmmo) - { - case AMMO_GRENADE: - { - value=1; - break; - } - case AMMO_FLARE_GRENADE: - { - value=2; - break; - } - case AMMO_FRAGMENTATION_GRENADE: - { - value=3; - break; - } - case AMMO_PROXIMITY_GRENADE: - { - value=4; - break; - } - default: - { - LOCALASSERT(0); - break; - } - } - ValueOfHUDDigit[MARINE_HUD_SECONDARY_AMMO_ROUNDS_UNITS]=value; - BLTMarineNumericsToHUD(MARINE_HUD_SECONDARY_AMMO_ROUNDS_UNITS); - } - else - { - BLTMarineNumericsToHUD(MARINE_HUD_PRIMARY_AMMO_MAGAZINES_TENS); - } - -} -#endif static void HandleMarineWeapon(void) { PLAYER_WEAPON_DATA *weaponPtr; diff --git a/src/avp/huddefs.h b/src/avp/huddefs.h index bd28f2e..c1e81ee 100644 --- a/src/avp/huddefs.h +++ b/src/avp/huddefs.h @@ -164,8 +164,7 @@ extern void PlatformSpecificInitAlienHUD(void); ******************REH*/ extern void PlatformSpecificExitingHUD(void); /*KJL****************************************************************************************** -* This is for the PSX (& possibly Saturn). Use this to pass your list of graphics to be drawn * -* to your GPU. * +* Use this to pass your list of graphics to be drawn to your GPU. * ******************************************************************************************KJL*/ extern void PlatformSpecificEnteringHUD(void); diff --git a/src/avp/maps.c b/src/avp/maps.c deleted file mode 100644 index 747272f..0000000 --- a/src/avp/maps.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - this now contains only the map processing - functions for the PC and saturn - compiled in maos - have been moved to comp_map -*/ -#include "3dc.h" -#include "module.h" -#include "inline.h" - -#include "stratdef.h" -#include "gamedef.h" - -#define UseLocalAssert Yes - -#include "ourasert.h" - - -/************ GLOBALS **********/ - - -DISPLAYBLOCK *Player; - - -/***************************************************************/ - - /* MAP TYPE PROCESSING FUNCTIONS*/ - -/**************************************************************/ -/* - The functions require a pointer to a display block. It uses "ObType" - in the block to select the function. -*/ - -static void Process_Default_MapType(DISPLAYBLOCK *dblockptr); -static void Process_Player_MapType(DISPLAYBLOCK *dblockptr); -static void Process_PlayerShipCamera_MapType(DISPLAYBLOCK *dblockptr); -static void Process_Sprite_MapType(DISPLAYBLOCK *dblockptr); -static void Process_Term_MapType(DISPLAYBLOCK *dblockptr); - - -void (*MapTypeFunctions[])(DISPLAYBLOCK *dblockptr) = -{ - Process_Default_MapType, - Process_Player_MapType, - Process_PlayerShipCamera_MapType, /* Player ship camera */ - Process_Sprite_MapType, - Process_Term_MapType -}; - - -static void Process_Default_MapType(DISPLAYBLOCK *dptr) -{ - dptr->ObLightType = LightType_PerVertex; - dptr->ObFlags |= ObFlag_MultLSrc; -} - - -static void Process_Player_MapType(DISPLAYBLOCK *dptr) -{ - Player = dptr; -} - - -static void Process_PlayerShipCamera_MapType(DISPLAYBLOCK *dptr) -{ -} - - - -static void Process_Sprite_MapType(DISPLAYBLOCK *dblockptr) -{ -} - - -static void Process_Term_MapType(DISPLAYBLOCK *dptr) -{} - - diff --git a/src/avp/pfarlocs.c b/src/avp/pfarlocs.c index 203c23c..3ae0195 100644 --- a/src/avp/pfarlocs.c +++ b/src/avp/pfarlocs.c @@ -21,10 +21,6 @@ #define UseLocalAssert Yes #include "ourasert.h" -#if PSX -#include "psx_cdf.h" -#endif - /* prototypes for this file */ //static void BuildFM_EntryPoints(MODULE *thisModule); //static void BuildFM_ASingleEP(MODULE *thisModule, MODULE *targetModule); @@ -41,13 +37,8 @@ extern int ModuleArraySize; /* prototypes for external functions */ int SetupPolygonAccessFromShapeIndex(int shapeIndex); int SetupPointAccessFromShapeIndex(int shapeIndex); -#if PSX - SVECTOR* AccessNextPoint(void); - SVECTOR* AccessPointFromIndex(int index); -#else - VECTORCH* AccessNextPoint(void); - VECTORCH* AccessPointFromIndex(int index); -#endif +VECTORCH* AccessNextPoint(void); +VECTORCH* AccessPointFromIndex(int index); int *GetPolygonVertexIndices(void); /* globals for this file */ @@ -166,12 +157,6 @@ void BuildFarModuleLocs(void) LOCALASSERT(ThisModuleIndex >= 0); LOCALASSERT(ThisModuleIndex < ModuleArraySize); - #if PSX - #ifndef CDEMUL - pollhost(); - #endif - #endif - #if logFarLocData fprintf(logfile, "********************************* \n"); fprintf(logfile, "Module Index: %d %s\n", ThisModuleIndex,thisModule->name); @@ -216,12 +201,6 @@ void BuildFarModuleLocs(void) fprintf(logfile, "Module Z range: %d %d \n \n", thisModule->m_minz, thisModule->m_maxz); #endif - #if PSX - #ifndef CDEMUL - pollhost(); - #endif - #endif - /* check for entry points into this module if there aren't any, don't bother with auxilary locations */ @@ -1008,13 +987,8 @@ static int GetModulePointBox(MODULE *thisModule, EPBBEXTENTS *extents) pointCounter = SetupPointAccessFromShapeIndex(thisModule->m_mapptr->MapShape); while(pointCounter>0) { - #if PSX - SVECTOR* thisPt = AccessNextPoint(); - VECTORCH thisWorldPoint; - #else - VECTORCH* thisPt = AccessNextPoint(); - VECTORCH thisWorldPoint; - #endif + VECTORCH* thisPt = AccessNextPoint(); + VECTORCH thisWorldPoint; thisWorldPoint.vx = thisPt->vx + thisModule->m_world.vx; thisWorldPoint.vy = thisPt->vy + thisModule->m_world.vy; @@ -1279,10 +1253,6 @@ static void BuildFM_AuxilaryLocs(MODULE *thisModule) the location iiiiis inside the shape): if there is no up & down polygon, the location is invalidated, and an error code returned (either no up poly, no down poly, no up-or-down poly) - - NB PSX!!!: uses kevin's shape access functions in platsup.c - I have added a new short one for Win95 - PSX needs it's own - version. ----------------------------------------------------------------*/ static void GetFarLocHeight(FARVALIDATEDLOCATION *location, MODULE *thisModule) { diff --git a/src/avp/pvisible.c b/src/avp/pvisible.c index bcb4dd8..ce1d10d 100644 --- a/src/avp/pvisible.c +++ b/src/avp/pvisible.c @@ -475,14 +475,14 @@ void DoObjectVisibility(STRATEGYBLOCK *sbPtr) } case(I_BehaviourPlatform): { - PLATFORMLIFT_BEHAVIOUR_BLOCK *platformliftdata = (PLATFORMLIFT_BEHAVIOUR_BLOCK *)sbPtr->SBdataptr; - //don't make platform lift far if it is currently moving - //(otherwise the lift won't be able to move) - if(platformliftdata->state!=PLBS_GoingUp && - platformliftdata->state!=PLBS_GoingDown) - { - MakeObjectFar(sbPtr); - } + PLATFORMLIFT_BEHAVIOUR_BLOCK *platformliftdata = (PLATFORMLIFT_BEHAVIOUR_BLOCK *)sbPtr->SBdataptr; + //don't make platform lift far if it is currently moving + //(otherwise the lift won't be able to move) + if(platformliftdata->state!=PLBS_GoingUp && + platformliftdata->state!=PLBS_GoingDown) + { + MakeObjectFar(sbPtr); + } break; } case(I_BehaviourBinarySwitch): @@ -539,11 +539,7 @@ void DoObjectVisibility(STRATEGYBLOCK *sbPtr) } case(I_BehaviourNetGhost): { - #if PSX - GLOBALASSERT(1==2); - #else - MakeGhostFar(sbPtr); - #endif + MakeGhostFar(sbPtr); break; } case(I_BehaviourTrackObject): @@ -1092,8 +1088,7 @@ void InitInanimateObject(void* bhdata, STRATEGYBLOCK *sbPtr) /* set the default inanimate object dynamics template: Inanimate for single player, and Static for multiplayer NB some objects are always static, and initialised using - the static dynamics template directly - NB2 PSX: all objects are static */ + the static dynamics template directly */ #if SupportWindows95 // if(AvP.Network==I_No_Network) inanimateDynamicsInitialiser = DYNAMICS_TEMPLATE_INANIMATE; // else inanimateDynamicsInitialiser = DYNAMICS_TEMPLATE_STATIC; diff --git a/src/avp/triggers.c b/src/avp/triggers.c index df68ab9..d516868 100644 --- a/src/avp/triggers.c +++ b/src/avp/triggers.c @@ -111,28 +111,8 @@ void OperateObjectInLineOfSight(void) } case I_BehaviourDatabase: { - #if PC_E3DEMO||PSX_DEMO - /* KJL 10:56:39 05/28/97 - E3DEMO change */ - /* KJL 10:55:44 05/28/97 - display 'Access Denied' message */ - NewOnScreenMessage(GetTextString(TEXTSTRING_DB_ACCESSDENIED)); - #else AvP.GameMode = I_GM_Menus; - - #if PSX - { - extern int Global_Database_Num; - Global_Database_Num=((DATABASE_BLOCK *)nearestObjectPtr->ObStrategyBlock->SBdataptr)->num; - } - #else - AvP.DatabaseAccessNum=((DATABASE_BLOCK *)nearestObjectPtr->ObStrategyBlock->SBdataptr)->num; - #endif - - - /* KJL 16:43:01 03/19/97 - CHANGE ME! Need to pass database number */ - // RJHG - would be ((*DATABASEBLOCK)nearestObjectPtr->ObStrategyBlock->SBDataPtr)->num - // CDF - I think it would be ((DATABASE_BLOCK *)nearestObjectPtr->ObStrategyBlock->SBdataptr)->num - #endif - + AvP.DatabaseAccessNum=((DATABASE_BLOCK *)nearestObjectPtr->ObStrategyBlock->SBdataptr)->num; break; } default: diff --git a/src/avp/win95/ddplat.cpp b/src/avp/win95/ddplat.cpp index 1a12b91..7a7901a 100644 --- a/src/avp/win95/ddplat.cpp +++ b/src/avp/win95/ddplat.cpp @@ -1131,83 +1131,6 @@ void RestoreAllDDGraphics(void) } -void ReleaseHUDGraphic(HUDGRAPHIC* hgptr) -{ - GLOBALASSERT(hgptr); - GLOBALASSERT(hgptr->data); - ReleaseDDSurface((void*)(*(int*)hgptr->data)); -} - - - -/* - Windows externs. See win_func -*/ - - -void BLTGraphicToScreen(HUDGRAPHIC* hgptr) -{ - /* - sets up the drawing of general hud graphics. Bltted - to full screen if there is no width and heiht information in - the DD HUDGRAPHIC - */ - - RECT destRect; - - GLOBALASSERT(hgptr != NULL); - - GLOBALASSERT(1 > 0); - -// HRESULT ddrval; - - LPDIRECTDRAWSURFACE wdds = *((LPDIRECTDRAWSURFACE*)hgptr->data); - - GLOBALASSERT(hgptr->srcRect->top < hgptr->srcRect->bottom); - GLOBALASSERT(hgptr->srcRect->left < hgptr->srcRect->right); - -#if 0 - textprint("%d TOP %d BOTTOM\n", hgptr->srcRect->top , hgptr->srcRect->bottom); - textprint("%d LEFT %d RIGHT\n", hgptr->srcRect->left , hgptr->srcRect->right); - - textprint("/n%d TOP %d BOTTOM\n", screenRect.top , screenRect.bottom); - textprint("%d LEFT %d RIGHT\n", screenRect.left , screenRect.right); - - WaitForReturn(); -#endif - - - if((hgptr->width == 0) || (hgptr->height == 0)) - { -// ddrval = lpDDSBack->Blt(NULL, wdds, hgptr->srcRect, DDBLT_WAIT, NULL); - fprintf(stderr, "BLTGraphicToScreen: w = %d, h = %d\n", hgptr->width, hgptr->height); - } - else - { - /* fill in the structure for the dest rect*/ - - destRect.top = hgptr->ydest; - destRect.bottom = hgptr->ydest + hgptr->height; - - destRect.left = hgptr->xdest; - destRect.right = hgptr->xdest + hgptr->width; -/* - ddrval = lpDDSBack->Blt(&destRect, wdds, hgptr->srcRect, DDBLT_WAIT, NULL); -*/ - fprintf(stderr, "BLTGraphicToScreen: w = %d, h = %d\n", hgptr->width, hgptr->height); - - } -/* - if(ddrval != DD_OK) - { - ReleaseDirect3D(); - exit(0x666009); - } -*/ -} - - - /************************** FONTS *************************/ /**********************************************************/ /**********************************************************/ diff --git a/src/avp/win95/kzsort.c b/src/avp/win95/kzsort.c index 848bc5a..39e5caf 100644 --- a/src/avp/win95/kzsort.c +++ b/src/avp/win95/kzsort.c @@ -974,14 +974,6 @@ void KShapeItemsInstr(SHAPEINSTR *shapeinstrptr) if(pheaderPtr->PolyItemType == I_3dTexturedPolygon) pheaderPtr->PolyItemType = I_2dTexturedPolygon; - /* KJL 12:57:43 05/29/97 - E3DEMO hack to draw everything in 3d */ - #if PC_E3DEMO - pheaderPtr->PolyFlags &= ~iflag_tx2dor3d; - if(pheaderPtr->PolyItemType == I_Gouraud2dTexturedPolygon) - pheaderPtr->PolyItemType = I_Gouraud3dTexturedPolygon; - #endif - - if(ItemOCSBlock.ocs_clipstate == ocs_cs_totally_on) { CreateItemPtsArray[*shapeitemptr](shapeitemptr, &PointsArray[0]); diff --git a/src/avp/win95/system.h b/src/avp/win95/system.h index c1c262e..eb36609 100644 --- a/src/avp/win95/system.h +++ b/src/avp/win95/system.h @@ -32,8 +32,6 @@ extern "C" { #define SuppressWarnings Yes #define SupportWindows95 Yes -#define Saturn No -#define PSX No #define platform_pc Yes #define InterfaceEngine No diff --git a/src/include/mem3dc.h b/src/include/mem3dc.h index dbc9089..4bc4450 100644 --- a/src/include/mem3dc.h +++ b/src/include/mem3dc.h @@ -12,10 +12,6 @@ #include /* defines */ -#if Saturn -#define DBGMALLOC 1 -#endif - #if SupportWindows95 #if 1 #define DBGMALLOC 0 @@ -47,7 +43,7 @@ a separate copy of the string for each malloc - just store the pointer. So, on PC this reduces the data size for the malloc records from 1.04Mb to 320K ! */ -#if SupportWindows95 || PSX +#if SupportWindows95 #define COPY_FILENAME 0 /* new behavior */ #else #define COPY_FILENAME 1 /* previous behavior */ diff --git a/src/include/prototyp.h b/src/include/prototyp.h index 265960b..5a84c89 100644 --- a/src/include/prototyp.h +++ b/src/include/prototyp.h @@ -2311,212 +2311,8 @@ void UpdateParallelStrategy(void); unsigned char* AllocateScreenBuffer(int sbuffersize); - -#if 0 - -#if 0 -void *AllocateMem(size_t __size); -void DeallocateMem(void *__ptr); -#endif - -#if PSX - #ifdef DBGMALLOC - extern void *record_malloc(long size, char string[], unsigned long lineno); - extern void record_free(void *ptr,char string[], unsigned long lineno); - #define AllocateMem(x) record_malloc(x,__FILE__, __LINE__) - #define DeallocateMem(x) record_free(x,__FILE__, __LINE__) - #else - void *AllocateMem(size_t __size); - void DeallocateMem(void *__ptr); - #endif -#else -void *AllocateMem(size_t __size); -void DeallocateMem(void *__ptr); -#endif - -#endif - - -void ScanDraw_Item_Polygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_Polygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_Polygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_Polygon_VideoModeType_8T(int *itemptr); - -#if (ZBufferTest || SupportZBuffering) -void ScanDraw_Item_Polygon_ZBuffer_VideoModeType_8(int *itemptr); -void ScanDraw_Item_Polygon_ZBuffer_VideoModeType_15(int *itemptr); -void ScanDraw_Item_Polygon_ZBuffer_VideoModeType_24(int *itemptr); -void ScanDraw_Item_Polygon_ZBuffer_VideoModeType_8T(int *itemptr); -#endif - -void ScanDraw_Item_GouraudPolygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_GouraudPolygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_GouraudPolygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_GouraudPolygon_VideoModeType_8T(int *itemptr); - -void ScanDraw_Item_GouraudPolygon_HPV_VideoModeType_15(int *itemptr); -void ScanDraw_Item_GouraudPolygon_HPV_VideoModeType_24(int *itemptr); -void ScanDraw_Item_GouraudPolygon_HPV_VideoModeType_8T(int *itemptr); - -#if ZBufferTest -void ScanDraw_Item_GouraudPolygon_ZBuffer_VideoModeType_8(int *itemptr); -void ScanDraw_Item_GouraudPolygon_ZBuffer_VideoModeType_15(int *itemptr); -void ScanDraw_Item_GouraudPolygon_ZBuffer_VideoModeType_24(int *itemptr); -void ScanDraw_Item_GouraudPolygon_ZBuffer_VideoModeType_8T(int *itemptr); -#endif - -#if SupportZBuffering -void ScanDraw_ZB_Item_GouraudPolygon_VideoModeType_8(int *itemptr); -void ScanDraw_ZB_Item_GouraudPolygon_VideoModeType_15(int *itemptr); -void ScanDraw_ZB_Item_GouraudPolygon_VideoModeType_24(int *itemptr); -void ScanDraw_ZB_Item_GouraudPolygon_VideoModeType_8T(int *itemptr); -#endif - -void ScanDraw_Item_2dTexturePolygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_2dTexturePolygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_2dTexturePolygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_2dTexturePolygon_VideoModeType_8T(int *itemptr); - -#if SupportZBuffering -void ScanDraw_ZB_Item_2dTexturePolygon_VideoModeType_8(int *itemptr); -void ScanDraw_ZB_Item_2dTexturePolygon_VideoModeType_15(int *itemptr); -void ScanDraw_ZB_Item_2dTexturePolygon_VideoModeType_24(int *itemptr); -void ScanDraw_ZB_Item_2dTexturePolygon_VideoModeType_8T(int *itemptr); -#endif - -void ScanDraw_Item_Gouraud2dTexturePolygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_Gouraud2dTexturePolygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_Gouraud2dTexturePolygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_Gouraud2dTexturePolygon_VideoModeType_8T(int *itemptr); - -void ScanDraw_Item_ZB_Gouraud2dTexturePolygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_ZB_Gouraud2dTexturePolygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_ZB_Gouraud2dTexturePolygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_ZB_Gouraud2dTexturePolygon_VideoModeType_8T(int *itemptr); - - -#if support3dtextures -void ScanDraw_Item_3dTexturePolygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_VideoModeType_8T(int *itemptr); -#endif - -#if SupportGouraud3dTextures - -void ScanDraw_Item_Gouraud3dTexturePolygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_VideoModeType_8T(int *itemptr); - -void ScanDraw_Item_Gouraud3dTexturePolygon_Linear_VideoModeType_8(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_Linear_VideoModeType_15(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_Linear_VideoModeType_24(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_Linear_VideoModeType_8T(int *itemptr); - -void ScanDraw_Item_Gouraud3dTexturePolygon_Linear_S_VideoModeType_8(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_Linear_S_VideoModeType_15(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_Linear_S_VideoModeType_24(int *itemptr); -void ScanDraw_Item_Gouraud3dTexturePolygon_Linear_S_VideoModeType_8T(int *itemptr); - -#if SupportZBuffering - -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_VideoModeType_8T(int *itemptr); - -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_Linear_VideoModeType_8(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_Linear_VideoModeType_15(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_Linear_VideoModeType_24(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_Linear_VideoModeType_8T(int *itemptr); - -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_Linear_S_VideoModeType_8(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_Linear_S_VideoModeType_15(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_Linear_S_VideoModeType_24(int *itemptr); -void ScanDraw_Item_ZB_Gouraud3dTexturePolygon_Linear_S_VideoModeType_8T(int *itemptr); - -#endif /* SupportZBuffering */ - -#endif /* SupportGouraud3dTextures */ - -#if support3dtextures - -#if SupportZBuffering -void ScanDraw_Item_ZB_3dTexturePolygon_VideoModeType_8(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_VideoModeType_15(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_VideoModeType_24(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_VideoModeType_8T(int *itemptr); -#endif - -void ScanDraw_Item_3dTexturePolygon_QuadI_VideoModeType_8(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_QuadI_VideoModeType_15(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_QuadI_VideoModeType_24(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_QuadI_VideoModeType_8T(int *itemptr); - -#if SupportZBuffering -void ScanDraw_ZB_Item_3dTexturePolygon_QuadI_VideoModeType_8(int *itemptr); -void ScanDraw_ZB_Item_3dTexturePolygon_QuadI_VideoModeType_15(int *itemptr); -void ScanDraw_ZB_Item_3dTexturePolygon_QuadI_VideoModeType_24(int *itemptr); -void ScanDraw_ZB_Item_3dTexturePolygon_QuadI_VideoModeType_8T(int *itemptr); -#endif - -void ScanDraw_Item_3dTexturePolygon_Linear_VideoModeType_8(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_Linear_VideoModeType_15(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_Linear_VideoModeType_24(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_Linear_VideoModeType_8T(int *itemptr); - -#if SupportZBuffering -void ScanDraw_Item_ZB_3dTexturePolygon_Linear_VideoModeType_8(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_Linear_VideoModeType_15(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_Linear_VideoModeType_24(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_Linear_VideoModeType_8T(int *itemptr); -#endif - -void ScanDraw_Item_3dTexturePolygon_Linear_S_VideoModeType_8(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_Linear_S_VideoModeType_15(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_Linear_S_VideoModeType_24(int *itemptr); -void ScanDraw_Item_3dTexturePolygon_Linear_S_VideoModeType_8T(int *itemptr); - -#if SupportZBuffering -void ScanDraw_Item_ZB_3dTexturePolygon_Linear_S_VideoModeType_8(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_Linear_S_VideoModeType_15(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_Linear_S_VideoModeType_24(int *itemptr); -void ScanDraw_Item_ZB_3dTexturePolygon_Linear_S_VideoModeType_8T(int *itemptr); -#endif - -#endif /* support3dtextures */ - -void ScanDraw_Item_Polyline_VideoModeType_8(int *itemptr); -void ScanDraw_Item_Polyline_VideoModeType_15(int *itemptr); -void ScanDraw_Item_Polyline_VideoModeType_24(int *itemptr); -void ScanDraw_Item_Polyline_VideoModeType_8T(int *itemptr); - -void ScanDraw_Item_FilledPolyline_VideoModeType_8(int *itemptr); -void ScanDraw_Item_FilledPolyline_VideoModeType_15(int *itemptr); -void ScanDraw_Item_FilledPolyline_VideoModeType_24(int *itemptr); -void ScanDraw_Item_FilledPolyline_VideoModeType_8T(int *itemptr); - -void ScanDraw_Item_Wireframe_VideoModeType_8(int *itemptr); -void ScanDraw_Item_Wireframe_VideoModeType_15(int *itemptr); -void ScanDraw_Item_Wireframe_VideoModeType_24(int *itemptr); -void ScanDraw_Item_Wireframe_VideoModeType_8T(int *itemptr); - -#if 0 -void ScanDraw_Item_HUDPolyline_VideoModeType_8(int *itemptr); -void ScanDraw_Item_HUDPolyline_VideoModeType_15(int *itemptr); -void ScanDraw_Item_HUDPolyline_VideoModeType_24(int *itemptr); -void ScanDraw_Item_HUDPolyline_VideoModeType_8T(int *itemptr); -#endif - void SetPalette(unsigned char *palette); -void MakeTextureLightingTable6(void); -void MakeTextureLightingTable6G(void); -void MakeTextureLightingTable15(void); -void MakeTextureLightingTable24(void); -void MakeTextureLightingTable8T(void); - void CreatePaletteRemapTable(unsigned char *palette); unsigned char GetRemappedPaletteColour(int r, int g, int b, int bitsize); @@ -2574,7 +2370,6 @@ TEXTURE* LoadBMP(char *fname, IMAGEHEADER *iheader); TEXTURE* LoadPGM(char *fname, IMAGEHEADER *iheader); int LoadPGMPalette(char *fname, unsigned char *palette); int LoadPGMPaletteLightingTable(char *filename, unsigned char *palette); -void MakeTextureLightingTableRaw256(unsigned char *palette); void Create_MIP_Map(IMAGEHEADER *iheader); @@ -2605,32 +2400,6 @@ typedef struct mousedata { void ReadKeyboard(void); -#if 0 -void ReadEmulatedSaturnControlPad(void); -unsigned int CheckPad(void); -void ExaminePad(void); -/* - Saturn Control Pad - See pad.h - Model S Pad, direct mode -*/ -#define PAD_DOWN 0x0001 -#define PAD_UP 0x0002 -#define PAD_LEFT 0x0004 -#define PAD_RIGHT 0x0008 -#define PAD_BUTC 0x0010 -#define PAD_BUTB 0x0020 -#define PAD_BUTA 0x0040 -#define PAD_START 0x0080 -#define PAD_BUTZ 0x0100 -#define PAD_BUTY 0x0200 -#define PAD_BUTX 0x0400 -#define PAD_MODE 0x0800 -#define PAD_R 0x0800 -#define PAD_L 0x1000 -#endif - - void WaitForReturn(void); void CursorHome(void); diff --git a/src/include/shape.h b/src/include/shape.h index 3f3057b..5ef5c10 100644 --- a/src/include/shape.h +++ b/src/include/shape.h @@ -527,10 +527,6 @@ typedef struct merged_poly #else - #if Saturn - #define iflag_sattexture 0x00000080 /* Outcode if outside frame buffer or behind z plane, else just draw */ - #endif - #if platform_pc #define iflag_zbuffer_w 0x00000080 /* Z-Buffer, Write-Only */ #endif @@ -578,11 +574,6 @@ typedef struct merged_poly #define iflag_sortfarz 0x04000000 /* Use maxz for depth value */ -#define iflag_bufferxy 0x08000000 /* Internal - Saturn Only - - for xy clamped item */ - -#define iflag_clampz 0x10000000 /* Internal - Saturn Only - - for z clamped item */ #define iflag_light_corona 0x20000000 /* For use by the placed light strategy */ @@ -781,11 +772,7 @@ typedef struct texelgtx3d { typedef unsigned char TEXTURE; -#if Saturn -#define ImageNameSize 16 -#else #define ImageNameSize 128+1 -#endif typedef struct imageheader { diff --git a/src/kshape.c b/src/kshape.c index dd20815..299b3b8 100644 --- a/src/kshape.c +++ b/src/kshape.c @@ -139,8 +139,6 @@ void DrawWaterFallPoly(VECTORCH *v); * they will end up in high memory on the Saturn. * ************************************************************************************KJL*/ -VECTORCH Global_LightVector={1,}; - /* Global variables and arrays */ @@ -160,10 +158,6 @@ VECTORCH MorphedPts[maxmorphPts]; #endif /* SupportMorphing */ -#if Saturn -extern int PolygonSubdivideEntry(POLYHEADER* itemptr); -#endif - static COLOURINTENSITIES ColourIntensityArray[maxrotpts]; diff --git a/src/maths.c b/src/maths.c index 77e4101..71a1389 100644 --- a/src/maths.c +++ b/src/maths.c @@ -333,27 +333,8 @@ int MinInt(int *iarray, int iarraysize) */ -void CreateEulerMatrix(e, m1) - - EULER *e; - MATRIXCH *m1; - +void CreateEulerMatrix(EULER *e, MATRIXCH *m1) { - -#if 0 - - SVECTOR eulers; - - eulers.vx=(e->EulerX)&4095; - eulers.vy=(e->EulerY)&4095; - eulers.vz=(e->EulerZ)&4095; - - RotMatrix(&eulers,(MATRIX *)scratchp); - - psx2ch((MATRIX *)scratchp,m1); - -#else - int t, sx, sy, sz, cx, cy, cz; @@ -428,9 +409,6 @@ void CreateEulerMatrix(e, m1) /* m33 = cx*cy */ m1->mat33=MUL_FIXED(cx,cy); - -#endif - } @@ -513,27 +491,9 @@ void CreateEulerVector(EULER *e, VECTORCH *v) */ -void MatrixMultiply(m1, m2, m3) - - struct matrixch *m1, *m2, *m3; +void MatrixMultiply(struct matrixch *m1, struct matrixch *m2, struct matrixch *m3) { - - #if 0 - - PushMatrix(); - - ch2psx(m1,(MATRIX *)scratchp); - ch2psx(m2,(MATRIX *)(scratchp+(sizeof(MATRIX)))); - - MulMatrix0((MATRIX *)scratchp,(MATRIX *)(scratchp+(sizeof(MATRIX))),(MATRIX *)(scratchp+((sizeof(MATRIX)<<1)))); - - psx2ch((MATRIX *)(scratchp+((sizeof(MATRIX)<<1))),m3); - - PopMatrix(); - - #else - MATRIXCH TmpMat; /* m11'' = c1.r1' */ @@ -593,93 +553,16 @@ void MatrixMultiply(m1, m2, m3) /* Finally, copy TmpMat to m3 */ CopyMatrix(&TmpMat, m3); - - #endif - } -void PSXAccurateMatrixMultiply(m1, m2, m3) - - struct matrixch *m1, *m2, *m3; - -{ - - MATRIXCH TmpMat; - -/* m11'' = c1.r1' */ - - TmpMat.mat11=MUL_FIXED(m1->mat11,m2->mat11); - TmpMat.mat11+=MUL_FIXED(m1->mat21,m2->mat12); - TmpMat.mat11+=MUL_FIXED(m1->mat31,m2->mat13); - -/* m12'' = c2.r1' */ - - TmpMat.mat12=MUL_FIXED(m1->mat12,m2->mat11); - TmpMat.mat12+=MUL_FIXED(m1->mat22,m2->mat12); - TmpMat.mat12+=MUL_FIXED(m1->mat32,m2->mat13); - -/* m13'' = c3.r1' */ - - TmpMat.mat13=MUL_FIXED(m1->mat13,m2->mat11); - TmpMat.mat13+=MUL_FIXED(m1->mat23,m2->mat12); - TmpMat.mat13+=MUL_FIXED(m1->mat33,m2->mat13); - -/* m21'' = c1.r2' */ - - TmpMat.mat21=MUL_FIXED(m1->mat11,m2->mat21); - TmpMat.mat21+=MUL_FIXED(m1->mat21,m2->mat22); - TmpMat.mat21+=MUL_FIXED(m1->mat31,m2->mat23); - -/* m22'' = c2.r2' */ - - TmpMat.mat22=MUL_FIXED(m1->mat12,m2->mat21); - TmpMat.mat22+=MUL_FIXED(m1->mat22,m2->mat22); - TmpMat.mat22+=MUL_FIXED(m1->mat32,m2->mat23); - -/* m23'' = c3.r2' */ - - TmpMat.mat23=MUL_FIXED(m1->mat13,m2->mat21); - TmpMat.mat23+=MUL_FIXED(m1->mat23,m2->mat22); - TmpMat.mat23+=MUL_FIXED(m1->mat33,m2->mat23); - -/* m31'' = c1.r3' */ - - TmpMat.mat31=MUL_FIXED(m1->mat11,m2->mat31); - TmpMat.mat31+=MUL_FIXED(m1->mat21,m2->mat32); - TmpMat.mat31+=MUL_FIXED(m1->mat31,m2->mat33); - -/* m32'' = c2.r3' */ - - TmpMat.mat32=MUL_FIXED(m1->mat12,m2->mat31); - TmpMat.mat32+=MUL_FIXED(m1->mat22,m2->mat32); - TmpMat.mat32+=MUL_FIXED(m1->mat32,m2->mat33); - -/* m33'' = c3.r3' */ - - TmpMat.mat33=MUL_FIXED(m1->mat13,m2->mat31); - TmpMat.mat33+=MUL_FIXED(m1->mat23,m2->mat32); - TmpMat.mat33+=MUL_FIXED(m1->mat33,m2->mat33); - -/* Finally, copy TmpMat to m3 */ - - CopyMatrix(&TmpMat, m3); - -} - - - - - /* Transpose Matrix */ -void TransposeMatrixCH(m1) - - MATRIXCH *m1; +void TransposeMatrixCH(MATRIXCH *m1) { @@ -892,11 +775,7 @@ void _RotateVector(VECTORCH *v, MATRIXCH* m) */ -void _RotateAndCopyVector(v1, v2, m) - - VECTORCH *v1; - VECTORCH *v2; - MATRIXCH *m; +void _RotateAndCopyVector(VECTORCH *v1, VECTORCH *v2, MATRIXCH *m) { @@ -916,9 +795,6 @@ void _RotateAndCopyVector(v1, v2, m) - - - /* Matrix to Euler Angles @@ -1240,12 +1116,6 @@ void MatrixToEuler(MATRIXCH *m, EULER *e) } - -#if 1 - - - - #define j_and_r_change_2 Yes void MatrixToEuler2(MATRIXCH *m, EULER *e) @@ -1479,10 +1349,6 @@ void MatrixToEuler2(MATRIXCH *m, EULER *e) -#endif - - - /* Normalise a Matrix @@ -1749,9 +1615,7 @@ int ArcSin(int s) */ -int ArcTan(height_x, width_z) - - int height_x,width_z; +int ArcTan(int height_x, int width_z) { @@ -2854,4 +2718,3 @@ void QuatToMat(QUAT *q,MATRIXCH *m) m->mat33=ONE_FIXED-q_2xx-q_2yy; } - diff --git a/src/mem3dc.c b/src/mem3dc.c index d0da027..0a3152b 100644 --- a/src/mem3dc.c +++ b/src/mem3dc.c @@ -46,13 +46,9 @@ #include "ourasert.h" -#if PSX || Saturn - #define MAXMALLOCS 600 -#else - #define MAXMALLOCS 2500000 - /* assertion fires if max exceeded */ - /* changed to 1000000 by DHM 7/4/98; was 70001 */ -#endif +#define MAXMALLOCS 2500000 + /* assertion fires if max exceeded */ + /* changed to 1000000 by DHM 7/4/98; was 70001 */ #define MALLOC_FILL_VALUE 0x21 #define FREE_FILL_VALUE 0x89 @@ -113,15 +109,7 @@ extern int textprint(const char* string, ...); extern void ExitSystem(void); extern void WaitForReturn(void); -/* textprint on psx impacts frame rate massively if not -used just for error messages, so it is often turned off. -Hence the use of textprint2 below */ - -#if PSX -#define textprint2 printf -#else #define textprint2 textprint -#endif /* function declarations */ #if COPY_FILENAME @@ -173,148 +161,6 @@ void record_free(void *ptr, char const * string, unsigned long lineno) return; } -#if PSX || Saturn - -#if COPY_FILENAME -static int AdjustMallocRecord(unsigned long addr, long size, char string[], unsigned long lineno) -#else -static int AdjustMallocRecord(unsigned long addr, long size, char const * string, unsigned long lineno) -#endif - -{ - - int i=0; - char *ptr = (char *)addr; - static int no_record_init = 1; - MALLOC_RECORD *recordPtr = MallocRecord; - - if(no_record_init) - { - InitMallocRecords(); - no_record_init = 0; - } - - - if(size==FREEING_MEMORY) /* must be freeing memory */ - { - GLOBALASSERT(addr); /* ensure not null addr */ - - while(iaddr==addr) - { - TotalMallocNum--; - - size = recordPtr->size; - - while (size--) - { - *ptr++ = FREE_FILL_VALUE; - } - #ifdef OVERRUN_SIZE - { - char const * overrun_ptr = overrun_code; - int ov_cnt = OVERRUN_SIZE(recordPtr->size); - do /* a memcmp - dunno if its supported on all platforms */ - { - if (!*overrun_ptr) overrun_ptr = overrun_code; /* repeat */ - if (*overrun_ptr++ != *ptr++) - { - textprint2("\nOut of Bounds!\n%lu bytes allocated to %p\nat %s, line %lu\n", recordPtr->size,(void *)recordPtr->addr,recordPtr->filename,recordPtr->linenum); - GLOBALASSERT(!"OUT OF BOUNDS detected in FREE"); - } - } - while (--ov_cnt); - } - #endif - - recordPtr->addr = 0; - TotalMemAllocated -= recordPtr->size; - recordPtr->size = 0; - #if COPY_FILENAME - recordPtr->filename[0] = 0; - #else - recordPtr->filename = ""; - #endif - recordPtr->linenum = 0; - break; /* exit while loop */ - } - i++; - recordPtr++; - } - - if(i>=MAXMALLOCS) - { - textprint2("\n\n\n\nFree Error! %s, line %d\n", string, (int)lineno); - GLOBALASSERT(0); - return(0); - } - - } - - else /* must be mallocing memory */ - { - TotalMallocNum++; - GLOBALASSERT(TotalMallocNumaddr == addr) - { - GLOBALASSERT(0); - } - i++; - recordPtr++; - } - i = 0; - recordPtr = MallocRecord; - while(iaddr==0) - { - recordPtr->addr = addr; - recordPtr->size = size; - TotalMemAllocated += size; - #if COPY_FILENAME - strcpy(recordPtr->filename, string); - #else - recordPtr->filename = string; - #endif - recordPtr->linenum = lineno; - while (size--) - { - *ptr++ = MALLOC_FILL_VALUE; - } - #ifdef OVERRUN_SIZE - { - char const * overrun_ptr = overrun_code; - int ov_cnt = OVERRUN_SIZE(recordPtr->size); - do /* a memcpy */ - { - if (!*overrun_ptr) overrun_ptr = overrun_code; /* repeat */ - *ptr++ = *overrun_ptr++; - } - while (--ov_cnt); - } - #endif - break; /* exit while loop */ - } - i++; - recordPtr++; - } - - GLOBALASSERT(iaddr + recordPtr->size; - int ov_cnt = OVERRUN_SIZE(recordPtr->size); - do /* a memcmp - dunno if its supported on all platforms */ - { - if (!*overrun_ptr) overrun_ptr = overrun_code; /* repeat */ - if (*overrun_ptr++ != *ptr++) - { - sprintf(stringbuf,"\nOut of Bounds!\n%lu bytes allocated to %p\nat %s, line %lu\n", recordPtr->size,(void *)recordPtr->addr,recordPtr->filename,recordPtr->linenum); - PCwrite(fd,stringbuf,strlen(stringbuf)); - break; - } - } - while (--ov_cnt); - } - } - - PCclose(fd); - - - } - - #endif - } #endif diff --git a/src/win95/ltchunk.hpp b/src/win95/ltchunk.hpp index 3b7de43..444f0f4 100644 --- a/src/win95/ltchunk.hpp +++ b/src/win95/ltchunk.hpp @@ -239,7 +239,6 @@ private: }; -#define PSXLightMode 0 //details of how light data should be altered for different platforms. //currently just playstation class Light_Scale_Chunk : public Chunk diff --git a/src/win95/plat_shp.c b/src/win95/plat_shp.c index 8a67984..d8cf69e 100644 --- a/src/win95/plat_shp.c +++ b/src/win95/plat_shp.c @@ -248,7 +248,6 @@ int SetupPolygonAccessFromShapeIndex(int shapeIndex) /*--------------------Patrick 17/12/96---------------------------- I have added some more shape data access functions...... - PSX versions are required. ----------------------------------------------------------------*/ static VECTORCH patPointData; @@ -353,7 +352,6 @@ int *GetPolygonVertexIndices(void) /*--------------------Roxby 3/7/97---------------------------- I have added some more shape data access functions...... - taken from PSX versions ----------------------------------------------------------------*/ diff --git a/src/win95/platform.h b/src/win95/platform.h index 5e6bf93..d49d4f6 100644 --- a/src/win95/platform.h +++ b/src/win95/platform.h @@ -16,8 +16,6 @@ extern "C" { #endif #define platform_pc Yes -#define Saturn No - /* Types */