Many warnings cleaned up (Tim Beckmann)

Menus.
This commit is contained in:
Steven Fuller 2001-12-06 00:22:46 +00:00 committed by Patryk Obara
parent 4508748944
commit 9f006f18fe
115 changed files with 1651 additions and 581 deletions

20
TODO
View file

@ -1,19 +1,23 @@
[DONE] [08/24/01] Finish OpenGL code.
[DONE] [08/26/01] Fix sound code.
[DONE] [11/10/01] Save/Load Game support.
[DONE] [11/25/01] CD Audio.
* Menus.
* Progress bar.
* Make vidmodes work.
* Debug "pure virtual method called"
* Proper file loading/saving (ignore case, search certain directories) and
config handling (~/.avp/{ge, re, ad, md, pd}/?)
* Command line options.
* CD Audio.
* Joystick support.
* Save/Load Game support.
* Revisit sound code.
* GL_EXT_secondary_color
* Revisit sound code. (Try AL_PITCH support, etc)
* Try to get demos and regular edition to work.
* See what FOX/Rebellion has to say (if anything) about redistribution of the
demos and if its possible to create an installer for regular/gold edition
CDs.
* Do something with the ingame movies. Might just leave as-is.
* Disable Mutliplayer in the Main Menu.
* Possible Idea: implement demos?
* See if the build process can be made easier for those who download the
source.
@ -28,5 +32,15 @@
etc.)
* Release new version. And fix bugs, and release new version, and so on.
----
* Command line:
[-h | --help] Display this help message
[-v | --version] Display the game version
[-f | --fullscreen] Run the game fullscreen
[-w | --windowed] Run the game in a window
[-s | --nosound] Do not access the soundcard
[-c | --nocdrom] Do not access the CD-ROM
--debug enable debug mode
* Debug, verify, and reimplant the inline functions in mathline.c to
inline.h
* Remove unused files.
* Squelch any unnecessary debug output

View file

@ -1,258 +0,0 @@
char AAFontWidths[256] = {
0, /* 0 */
0, /* 1 */
0, /* 2 */
0, /* 3 */
0, /* 4 */
0, /* 5 */
0, /* 6 */
0, /* 7 */
0, /* 8 */
0, /* 9 */
0, /* 10 */
0, /* 11 */
0, /* 12 */
0, /* 13 */
0, /* 14 */
0, /* 15 */
0, /* 16 */
0, /* 17 */
0, /* 18 */
0, /* 19 */
0, /* 20 */
0, /* 21 */
0, /* 22 */
0, /* 23 */
0, /* 24 */
0, /* 25 */
0, /* 26 */
0, /* 27 */
0, /* 28 */
0, /* 29 */
0, /* 30 */
0, /* 31 */
3, /* 32 */
2, /* 33 */
5, /* 34 */
6, /* 35 */
6, /* 36 */
9, /* 37 */
8, /* 38 */
3, /* 39 */
4, /* 40 */
4, /* 41 */
4, /* 42 */
6, /* 43 */
3, /* 44 */
4, /* 45 */
3, /* 46 */
4, /* 47 */
6, /* 48 */
5, /* 49 */
6, /* 50 */
6, /* 51 */
6, /* 52 */
6, /* 53 */
6, /* 54 */
6, /* 55 */
6, /* 56 */
6, /* 57 */
2, /* 58 */
2, /* 59 */
6, /* 60 */
6, /* 61 */
6, /* 62 */
7, /* 63 */
11, /* 64 */
8, /* 65 */
8, /* 66 */
8, /* 67 */
8, /* 68 */
7, /* 69 */
7, /* 70 */
8, /* 71 */
7, /* 72 */
3, /* 73 */
6, /* 74 */
8, /* 75 */
7, /* 76 */
9, /* 77 */
8, /* 78 */
8, /* 79 */
7, /* 80 */
8, /* 81 */
8, /* 82 */
7, /* 83 */
7, /* 84 */
8, /* 85 */
7, /* 86 */
10, /* 87 */
7, /* 88 */
7, /* 89 */
7, /* 90 */
4, /* 91 */
4, /* 92 */
4, /* 93 */
6, /* 94 */
7, /* 95 */
5, /* 96 */
6, /* 97 */
7, /* 98 */
6, /* 99 */
7, /* 100 */
6, /* 101 */
4, /* 102 */
7, /* 103 */
6, /* 104 */
3, /* 105 */
4, /* 106 */
6, /* 107 */
3, /* 108 */
9, /* 109 */
6, /* 110 */
7, /* 111 */
7, /* 112 */
6, /* 113 */
5, /* 114 */
6, /* 115 */
4, /* 116 */
6, /* 117 */
6, /* 118 */
9, /* 119 */
6, /* 120 */
6, /* 121 */
6, /* 122 */
5, /* 123 */
2, /* 124 */
5, /* 125 */
6, /* 126 */
2, /* 127 */
2, /* 128 */
2, /* 129 */
2, /* 130 */
6, /* 131 */
2, /* 132 */
2, /* 133 */
2, /* 134 */
2, /* 135 */
6, /* 136 */
14, /* 137 */
16, /* 138 */
13, /* 139 */
16, /* 140 */
16, /* 141 */
15, /* 142 */
15, /* 143 */
2, /* 144 */
2, /* 145 */
2, /* 146 */
2, /* 147 */
2, /* 148 */
2, /* 149 */
2, /* 150 */
16, /* 151 */
15, /* 152 */
10, /* 153 */
14, /* 154 */
16, /* 155 */
14, /* 156 */
15, /* 157 */
15, /* 158 */
2, /* 159 */
2, /* 160 */
2, /* 161 */
6, /* 162 */
6, /* 163 */
6, /* 164 */
7, /* 165 */
2, /* 166 */
2, /* 167 */
6, /* 168 */
8, /* 169 */
4, /* 170 */
7, /* 171 */
2, /* 172 */
2, /* 173 */
8, /* 174 */
2, /* 175 */
14, /* 176 */
16, /* 177 */
14, /* 178 */
2, /* 179 */
6, /* 180 */
2, /* 181 */
2, /* 182 */
2, /* 183 */
2, /* 184 */
2, /* 185 */
4, /* 186 */
7, /* 187 */
9, /* 188 */
9, /* 189 */
2, /* 190 */
7, /* 191 */
8, /* 192 */
8, /* 193 */
8, /* 194 */
2, /* 195 */
8, /* 196 */
8, /* 197 */
11, /* 198 */
8, /* 199 */
7, /* 200 */
7, /* 201 */
7, /* 202 */
7, /* 203 */
3, /* 204 */
3, /* 205 */
4, /* 206 */
4, /* 207 */
8, /* 208 */
8, /* 209 */
8, /* 210 */
8, /* 211 */
8, /* 212 */
8, /* 213 */
8, /* 214 */
2, /* 215 */
8, /* 216 */
8, /* 217 */
8, /* 218 */
8, /* 219 */
8, /* 220 */
7, /* 221 */
2, /* 222 */
6, /* 223 */
6, /* 224 */
6, /* 225 */
6, /* 226 */
2, /* 227 */
6, /* 228 */
6, /* 229 */
10, /* 230 */
6, /* 231 */
6, /* 232 */
6, /* 233 */
6, /* 234 */
6, /* 235 */
3, /* 236 */
4, /* 237 */
4, /* 238 */
4, /* 239 */
6, /* 240 */
6, /* 241 */
7, /* 242 */
7, /* 243 */
7, /* 244 */
7, /* 245 */
7, /* 246 */
2, /* 247 */
9, /* 248 */
6, /* 249 */
6, /* 250 */
6, /* 251 */
6, /* 252 */
6, /* 253 */
2, /* 254 */
0 /* 255 */
};

View file

@ -3521,7 +3521,6 @@ int New_GetAvoidanceDirection(STRATEGYBLOCK *sbPtr, NPC_AVOIDANCEMANAGER *manage
{
// What follows is an attempt to make sure we don't jump off any cliffs...
VECTORCH test_location;
int test_distance = this_distance / 2;
testDirn.vx *= this_distance;
testDirn.vy *= this_distance;
testDirn.vz *= this_distance;

View file

@ -776,8 +776,6 @@ void PlotFaceHugger(STRATEGYBLOCK *sbPtr) {
static void Execute_FHNS_Attack(STRATEGYBLOCK *sbPtr)
{
extern VIEWDESCRIPTORBLOCK *ActiveVDBList[];
DYNAMICSBLOCK *dynPtr;
FACEHUGGER_STATUS_BLOCK *facehuggerStatusPointer;

View file

@ -41,6 +41,3 @@ typedef struct lift_door_tools_template
extern void* LiftDoorBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr);
extern void LiftDoorBehaveFun(STRATEGYBLOCK* sbptr);

View file

@ -830,7 +830,6 @@ static void AlienNearState_Approach(STRATEGYBLOCK *sbPtr)
/* target acquisition ? */
{
extern DISPLAYBLOCK *Player;
if(VectorDistance(&(alienStatusPointer->Target->DynPtr->Position),&(dynPtr->Position)) < ALIEN_CURVETOPLAYERDIST)
{
curveToPlayer = 1;
@ -1327,7 +1326,6 @@ static void AlienNearState_Wander(STRATEGYBLOCK *sbPtr)
{
ALIEN_STATUS_BLOCK *alienStatusPointer;
DYNAMICSBLOCK *dynPtr;
int approachingAirDuct = 0;
VECTORCH velocityDirection = {0,0,0};
LOCALASSERT(sbPtr);
@ -1604,7 +1602,6 @@ static void AlienNearState_Retreat(STRATEGYBLOCK *sbPtr)
{
ALIEN_STATUS_BLOCK *alienStatusPointer;
DYNAMICSBLOCK *dynPtr;
int approachingAirDuct = 0;
VECTORCH velocityDirection = {0,0,0};
LOCALASSERT(sbPtr);

View file

@ -4860,7 +4860,6 @@ static BOOL TargetIsFiringFlamethrowerAtQueen(STRATEGYBLOCK *sbPtr)
static void MakeNonFragable_Recursion(SECTION_DATA *this_section_data)
{
SECTION_DATA *sdptr;
int health_increment;
sdptr=NULL;

View file

@ -364,8 +364,6 @@ static STRATEGYBLOCK* InitialiseFrisbeeBehaviour_ForLoad() {
DISPLAYBLOCK *dispPtr;
DYNAMICSBLOCK *dynPtr;
FRISBEE_BEHAV_BLOCK *bblk;
int a;
/* make displayblock with correct shape, etc */
dispPtr = MakeObject(I_BehaviourFrisbee,&zeroVect);
@ -3103,8 +3101,6 @@ static STRATEGYBLOCK* InitialiseDiscBehaviour_ForLoad() {
DISPLAYBLOCK *dispPtr;
DYNAMICSBLOCK *dynPtr;
PC_PRED_DISC_BEHAV_BLOCK *bblk;
int a;
/* make displayblock with correct shape, etc */
dispPtr = MakeObject(I_BehaviourPredatorDisc_SeekTrack,&zeroVect);

View file

@ -1886,7 +1886,6 @@ void Xeno_TurnAndTarget(STRATEGYBLOCK *sbPtr, int *ref_anglex,int *ref_angley) {
void Xeno_Limbs_ShootTheRoof(STRATEGYBLOCK *sbPtr) {
XENO_STATUS_BLOCK *xenoStatusPointer;
int anglex,angley;
LOCALASSERT(sbPtr);
xenoStatusPointer = (XENO_STATUS_BLOCK *)(sbPtr->SBdataptr);

View file

@ -18,7 +18,7 @@ extern MAPBLOCK6 Term_Type6;
extern MODULEMAPBLOCK AvpCompiledMaps[];
MAPHEADER Map[]={
{
0,
0,
0,
@ -26,7 +26,8 @@ MAPHEADER Map[]={
0,
0,
0,
&Player_and_Camera_Type8[0],
&Player_and_Camera_Type8[0]
}
};
@ -91,8 +92,8 @@ MAPBLOCK6 Empty_Landscape_Type6 = {
-1, /* No shape */
0,0,0, /* Loc */
0,0,0, /* Orient */
{0,0,0}, /* Loc */
{0,0,0}, /* Orient */
ObFlag_MultLSrc
/*| ObFlag_BFCRO*/
@ -125,8 +126,8 @@ MAPBLOCK6 Empty_Object_Type6 = {
-1, /* No shape */
0,0,0, /* Loc */
0,0,0, /* Orient */
{0,0,0}, /* Loc */
{0,0,0}, /* Orient */
ObFlag_MultLSrc |
/*| ObFlag_BFCRO*/
@ -157,8 +158,8 @@ MAPBLOCK6 Term_Type6 = {
MapType_Term,
0,
0,0,0,
0,0,0,
{0,0,0},
{0,0,0},
0, /* Flags */
#if StandardStrategyAndCollisions
@ -352,8 +353,8 @@ MODULEMAPBLOCK AvpCompiledMaps[] = {
{
MapType_Term, /* Map Type Function */
0, /* Shape */
0,0,0, /* Loc */
0,0,0, /* Orient */
{0,0,0}, /* Loc */
{0,0,0}, /* Orient */
0, /* Flags 1 */
0, /* Flags 2 */
0, /* Flags 3 */
@ -371,12 +372,12 @@ MODULEMAPBLOCK AvpCompiledMaps[] = {
0, /* MapMass */
0,0,0, /* MapNewtonV */
#endif
0,0,0, /* MapOrigin */
{0,0,0}, /* MapOrigin */
0, /* MapSimShapes */
0, /* MapViewType */
0, /* MapMPtr */
0, /* MapDPtr */
0,0,0, /* MapMOffset */
{0,0,0}, /* MapMOffset */
}
};
@ -388,8 +389,8 @@ MODULE Empty_Module = {
"null", /* char m_name[] */
0, /* int m_index */
0, /* int m_flags */
0,0,0, /* VECTOR m_world */
"null", /* MREF m_ext */
{0,0,0}, /* VECTOR m_world */
{"null"}, /* MREF m_ext */
0, /* int m_ext_scale */
0, /* int m_maxx */
0, /* int m_minx */
@ -399,22 +400,22 @@ MODULE Empty_Module = {
0, /* int m_minz */
0, /* MODULEMAPBLOCK *m_mapptr */
0, /* struct displayblock *m_dptr */
"null", /* MREF m_vptr */
{"null"}, /* MREF m_vptr */
0, /* VMODULE *m_v_ptrs */
0, /* struct module **m_link_ptrs */
// 0, /* VIEWPORT *m_viewports */
0, /* MODULETABLEHEADER *m_table */
mfun_null, /* MFUNCTION m_ifvisible */
mfun_null, /* MFUNCTION m_ifvinside */
"null", /* MREF m_funref */
{"null"}, /* MREF m_funref */
0, /* Strategy block * */
0, /* num lights*/
NULL, /* pointer to light blocks*/
NULL, /* pointer to extraitemdata */
{0,0,0,
0,0,0,
0,0,0,
0,0,0,
0,0,0},
#if SupportWindows95
0,
@ -437,8 +438,8 @@ MODULEMAPBLOCK Empty_Module_Map =
MapType_Default, /* MapType */
-1, /* MapShape */
0, 0, 0, /* MapWorld */
0, 0, 0, /* MapEuler */ /* Orient */
{0, 0, 0}, /* MapWorld */
{0, 0, 0}, /* MapEuler */ /* Orient */
0
| ObFlag_MultLSrc /* MapFlags */
@ -461,13 +462,13 @@ MODULEMAPBLOCK Empty_Module_Map =
0, /* Interior Type */
LightType_PerVertex, /* MapLightType */
0,0,0, /* MapOrigin */
{0,0,0}, /* MapOrigin */
0, /* MapSimShapes */
0, /* MapViewType */
0, /* MapMPtr */
0, /* MapDPtr */
0,0,0, /* MapMOffset */
{0,0,0}, /* MapMOffset */
};
@ -488,8 +489,8 @@ MODULEMAPBLOCK TempModuleMap = \
MapType_Default, /* MapType */
-1, /* MapShape */
0, 0, 0, /* MapWorld */
0, 0, 0, /* MapEuler */ /* Orient */
{0, 0, 0}, /* MapWorld */
{0, 0, 0}, /* MapEuler */ /* Orient */
0 /* flags 1*/
| ObFlag_NoInfLSrc
@ -510,12 +511,12 @@ MODULEMAPBLOCK TempModuleMap = \
#else
LightType_PerVertex, /* MapLightType */
#endif
0,0,0, /* MapOrigin */
{0,0,0}, /* MapOrigin */
0, /* MapSimShapes */
0, /* MapViewType */
0, /* MapMPtr */
0, /* MapDPtr */
0,0,0 /* MapMOffset */
{0,0,0} /* MapMOffset */
};

View file

@ -1726,7 +1726,9 @@ ATTACK_DATA Alien_Attacks[] = {
0, /* Multiplayer_Code */
0, /* Unique_Code */
0, /* wound_flags */
AMMO_NONE, /* damage_type */
{
AMMO_NONE /* damage_type */
},
0, /* Crouching */
0, /* Pouncing */
},
@ -1807,7 +1809,9 @@ ATTACK_DATA Wristblade_Attacks[] = {
0, /* Multiplayer_Code */
0, /* Unique_Code */
0, /* wound_flags */
AMMO_NONE, /* damage_type */
{
AMMO_NONE /* damage_type */
},
0, /* Crouching */
0, /* Pouncing */
},
@ -1904,7 +1908,9 @@ ATTACK_DATA PredStaff_Attacks[] = {
0, /* Multiplayer_Code */
0, /* Unique_Code */
0, /* wound_flags */
AMMO_NONE, /* damage_type */
{
AMMO_NONE /* damage_type */
},
0, /* Crouching */
0, /* Pouncing */
},

View file

@ -1388,8 +1388,6 @@ void Process_Section(HMODELCONTROLLER *controller,SECTION_DATA *this_section_dat
&&(render)) {
/* Unreal things don't get plotted, either. */
extern MATRIXCH IdentityMatrix;
DISPLAYBLOCK dummy_displayblock;
SHAPEHEADER *shape_to_use;
@ -2118,8 +2116,6 @@ static void HMTimer_Kernel(HMODELCONTROLLER *controller) {
void DoHModel(HMODELCONTROLLER *controller, DISPLAYBLOCK *dptr) {
extern int NormalFrameTime;
GLOBALASSERT(controller);
GLOBALASSERT(dptr);
@ -2245,8 +2241,6 @@ void DoHModelTimer_Recursion(HMODELCONTROLLER *controller,SECTION_DATA *this_sec
void DoHModelTimer(HMODELCONTROLLER *controller) {
extern int NormalFrameTime;
/* Be VERY careful with this function - it can put the timer and the
position computations out of step. Once you've called this, call NO
OTHER HMODEL FUNCTIONS on this model until the next frame! */

View file

@ -2070,7 +2070,6 @@ static void DrawAlienTeeth(void)
if (AlienTeethOffset)
{
extern int CloakingPhase;
int offsetY;
DISPLAYBLOCK displayblock;

View file

@ -5290,7 +5290,6 @@ extern void RenderParticlesInMirror(void)
while(numOfObjects)
{
DISPLAYBLOCK *objectPtr = OnScreenBlockList[--numOfObjects];
STRATEGYBLOCK *sbPtr = objectPtr->ObStrategyBlock;
if (!objectPtr->ObShape && objectPtr->SfxPtr)
{

View file

@ -1702,7 +1702,6 @@ extern void ThrowAFlare(void)
if (NumberOfFlaresActive<4)
{
extern VECTORCH CentreOfMuzzleOffset;
extern VIEWDESCRIPTORBLOCK *ActiveVDBList[];
VIEWDESCRIPTORBLOCK *VDBPtr = ActiveVDBList[0];
MATRIXCH mat = VDBPtr->VDB_Mat;

View file

@ -73,7 +73,7 @@ MODULEMAPBLOCK VisibilityDefaultObjectMap =
{
MapType_Default,
I_ShapeCube, /* this is a default value */
0,0,0,
0,0,0,
0,0,0,
#if StandardStrategyAndCollisions
ObFlag_Dynamic|ObFlag_NewtonMovement|ObFlag_MatMul,

View file

@ -2617,7 +2617,6 @@ void HandleEffectsOfExplosion(STRATEGYBLOCK *objectToIgnorePtr, VECTORCH *centre
}
/* effect of explosion on object's dynamics */
{
VECTORCH directionOfForce;
EULER rotation;
int magnitudeOfForce = 5000*damage/dynPtr->Mass;
@ -8504,8 +8503,6 @@ void PlasmaCaster_Recoil(void *playerStatus, PLAYER_WEAPON_DATA *weaponPtr) {
if (weaponPtr->StateTimeOutCounter == WEAPONSTATE_INITIALTIMEOUTCOUNT) {
int multiplyer,a;
if (playerStatusPtr->PlasmaCasterCharge<Caster_MinCharge) {
/* Don't fire at all! */
Sound_Play(SID_PREDATOR_PLASMACASTER_EMPTY,"h");
@ -8514,6 +8511,7 @@ void PlasmaCaster_Recoil(void *playerStatus, PLAYER_WEAPON_DATA *weaponPtr) {
/* Fix plasmacaster damage. */
#if 0
int multiplyer,a;
a=playerStatusPtr->PlasmaCasterCharge;
/* These values computed by hand! */
@ -11019,7 +11017,6 @@ int PlayerFirePredPistolFlechettes(PLAYER_WEAPON_DATA *weaponPtr) {
int PredPistolSecondaryFire(PLAYER_WEAPON_DATA *weaponPtr) {
TEMPLATE_WEAPON_DATA *twPtr=&TemplateWeapon[weaponPtr->WeaponIDNumber];
TEMPLATE_AMMO_DATA *templateAmmoPtr = &TemplateAmmo[twPtr->SecondaryAmmoID];
PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr);
LOCALASSERT(playerStatusPtr);
@ -11691,9 +11688,6 @@ int FireMarineTwoPistols(PLAYER_WEAPON_DATA *weaponPtr, int secondary)
DELTA_CONTROLLER *FireRight;
DELTA_CONTROLLER *FireLeft;
EULER judder;
MATRIXCH juddermat;
/* Deduce which pistol can fire, if either? */
FireRight=Get_Delta_Sequence(&PlayersWeaponHModelController,"FireRight");

View file

@ -293,4 +293,3 @@ size_t Placed_Hierarchy_Sequence_Chunk::size_chunk()
chunk_size+=4+4*num_extra_data;
return chunk_size;
}

View file

@ -26,6 +26,8 @@ extern void ThisFramesRenderingHasFinished(void);
extern int AAFontImageNumber;
extern int FadingGameInAfterLoading;
extern void RenderBriefingText(int centreY, int brightness);
extern void InGameFlipBuffers();
};
static int CurrentPosition=0;
@ -179,7 +181,8 @@ void Start_Progress_Bar()
#endif
ThisFramesRenderingHasFinished();
FlipBuffers();
/* FlipBuffers(); */
InGameFlipBuffers();
}
#if 0 /* TODO: disabled for port */
@ -217,7 +220,8 @@ void Set_Progress_Bar_Position(int pos)
#if 0 /* TODO: disabled for port */
if (LoadingBarFull) lpDDSBack->Blt(&LoadingBarFull_DestRect,LoadingBarFull,&LoadingBarFull_SrcRect,DDBLT_WAIT,0);
#endif
FlipBuffers();
/* FlipBuffers(); */
InGameFlipBuffers();
/*
If this is a network game , then check the received network messages from
@ -264,7 +268,7 @@ void Game_Has_Loaded(void)
CheckForWindowsMessages();
ReadUserInput();
// FlipBuffers();
// InGameFlipBuffers();
ColourFillBackBufferQuad
(
@ -305,7 +309,9 @@ void Game_Has_Loaded(void)
ThisFramesRenderingHasFinished();
}
FlipBuffers();
/* FlipBuffers(); */
InGameFlipBuffers();
FrameCounterHandler();

View file

@ -1271,5 +1271,3 @@ int TriangleWithinFrustrum(void)
/* yes, we need to draw poly */
return 1;
}

View file

@ -92,22 +92,14 @@ void SetupShapePipeline(void);
void ShapePipeline(SHAPEHEADER *shapePtr);
static void GouraudPolygon_Construct(POLYHEADER *polyPtr);
static void GouraudPolygon_Output(POLYHEADER *inputPolyPtr, RENDERVERTEX *renderVerticesPtr);
static void TexturedPolygon_Construct(POLYHEADER *polyPtr);
static void TexturedPolygon_Output(POLYHEADER *inputPolyPtr, RENDERVERTEX *renderVerticesPtr);
static void GouraudTexturedPolygon_Construct(POLYHEADER *polyPtr);
static void (*VertexIntensity)(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_Hierarchical(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_PreLit(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_Pred_Thermal(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_Pred_SeeAliens(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_Pred_SeePredatorTech(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_ImageIntensifier(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_Standard(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_Alien_Sense(RENDERVERTEX *renderVertexPtr);
static void VertexIntensity_Standard_Opt(RENDERVERTEX *renderVertexPtr);
@ -157,7 +149,7 @@ VECTORCH Global_LightVector={1,};
Global variables and arrays
*/
VECTORCH RotatedPts[maxrotpts]={1,};
VECTORCH RotatedPts[maxrotpts]={{1,}};
int ItemColour=1;
@ -180,9 +172,9 @@ static COLOURINTENSITIES ColourIntensityArray[maxrotpts];
RENDERPOLYGON RenderPolygon={1,};
RENDERVERTEX VerticesBuffer[9]={1,};
static RENDERVERTEX TriangleVerticesBuffer[3]={1,};
RENDERPOLYGON RenderPolygon;
RENDERVERTEX VerticesBuffer[9]={{1,}};
static RENDERVERTEX TriangleVerticesBuffer[3]={{1,}};
static int *VertexNumberPtr=(int*)1;
@ -5875,7 +5867,7 @@ void RenderSmokeTest(void)
{45300,0+ 1000, 26000+-1000},
};
extern int CurrentLightAtPlayer;
int i;
if (image) a = 255-a;
@ -6501,7 +6493,6 @@ void RenderLightFlare(VECTORCH *positionPtr, unsigned int colour)
// int particleSize = particlePtr->Size;
z=ONE_FIXED;
{
extern int SmartTargetSightX, SmartTargetSightY;
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
centreX = DIV_FIXED(point.vx,point.vz);
centreY = DIV_FIXED(point.vy,point.vz);

View file

@ -1,9 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include "fixer.h"
@ -42,7 +44,29 @@ extern unsigned char KeyboardInput[MAX_NUMBER_OF_INPUT_KEYS];
extern unsigned char GotAnyKey;
extern int NormalFrameTime;
static SDL_Surface *surface;
SDL_Surface *surface;
#if GL_EXT_secondary_color
PFNGLSECONDARYCOLORPOINTEREXTPROC pglSecondaryColorPointerEXT;
#endif
/* ** */
int CheckToken(const char *str, const char *item)
{
const char *p;
int len = strlen(item);
p = str;
while ((p = strstr(p, item)) != NULL) {
char x = *(p + len);
if ( (x == 0) || (isspace(x)) )
return 1;
p += len;
}
return 0;
}
/* ** */
@ -63,6 +87,7 @@ void ReadJoysticks()
unsigned char *GetScreenShot24(int *width, int *height)
{
unsigned char *buf;
// Uint16 redtable[256], greentable[256], bluetable[256];
if (surface == NULL) {
return NULL;
@ -80,6 +105,20 @@ unsigned char *GetScreenShot24(int *width, int *height)
*width = surface->w;
*height = surface->h;
#if 0
if (SDL_GetGammaRamp(redtable, greentable, bluetable) != -1) {
unsigned char *ptr;
int i;
ptr = buf;
for (i = 0; i < surface->w*surface->h; i++) {
ptr[i*3+0] = redtable[ptr[i*3+0]];
ptr[i*3+1] = greentable[ptr[i*3+1]];
ptr[i*3+2] = bluetable[ptr[i*3+2]];
ptr += 3;
}
}
#endif
return buf;
}
@ -109,7 +148,7 @@ int SetSoftVideoMode(int Width, int Height, int Depth)
}
if ((surface = SDL_SetVideoMode(Width, Height, Depth, SDL_SWSURFACE|SDL_DOUBLEBUF)) == NULL) {
fprintf(stderr, "SDL SetVideoMode failed: %s\n", SDL_GetError());
fprintf(stderr, "(Software) SDL SetVideoMode failed: %s\n", SDL_GetError());
SDL_Quit();
exit(EXIT_FAILURE);
}
@ -149,16 +188,18 @@ int SetSoftVideoMode(int Width, int Height, int Depth)
return 0;
}
int SetOGLVideoMode(int Width, int Height)
{
SDL_GrabMode isgrab;
int isfull;
char *ext;
ScanDrawMode = ScanDrawD3DHardwareRGB;
GotMouse = 1;
if (surface != NULL) {
isfull = (surface->flags & SDL_FULLSCREEN);
isfull = (surface->flags & SDL_FULLSCREEN) ? 1 : 0;
isgrab = SDL_WM_GrabInput(SDL_GRAB_QUERY);
SDL_FreeSurface(surface);
@ -167,6 +208,8 @@ int SetOGLVideoMode(int Width, int Height)
isgrab = SDL_GRAB_OFF;
}
fprintf(stderr, "SDL: isfull = %d, isgrab = %d\n", isfull, isgrab);
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
@ -174,7 +217,7 @@ int SetOGLVideoMode(int Width, int Height)
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if ((surface = SDL_SetVideoMode(Width, Height, 0, SDL_OPENGL)) == NULL) {
fprintf(stderr, "SDL SetVideoMode failed: %s\n", SDL_GetError());
fprintf(stderr, "(OpenGL) SDL SetVideoMode failed: %s\n", SDL_GetError());
SDL_Quit();
exit(EXIT_FAILURE);
}
@ -190,12 +233,14 @@ int SetOGLVideoMode(int Width, int Height)
// SDL_WM_GrabInput(SDL_GRAB_ON);
// SDL_ShowCursor(0);
fprintf(stderr, "SDL: before %08X\n", surface->flags);
if (isfull && !(surface->flags & SDL_FULLSCREEN)) {
fprintf(stderr, "SDL: doing the fullscreen toggle\n");
SDL_WM_ToggleFullScreen(surface);
if (surface->flags & SDL_FULLSCREEN)
SDL_ShowCursor(0);
}
fprintf(stderr, "SDL: after %08X\n", surface->flags);
if (isgrab == SDL_GRAB_ON) {
SDL_WM_GrabInput(SDL_GRAB_ON);
}
@ -213,6 +258,7 @@ int SetOGLVideoMode(int Width, int Height)
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glDepthMask(GL_TRUE);
glDepthRange(0.0, 1.0);
glEnable(GL_TEXTURE_2D);
@ -236,6 +282,29 @@ int SetOGLVideoMode(int Width, int Height)
ScreenDescriptorBlock.SDB_ClipUp = 0;
ScreenDescriptorBlock.SDB_ClipDown = Height;
ext = (char *)glGetString(GL_EXTENSIONS);
printf("OpenGL Extensions: %s\n", ext);
#if GL_EXT_secondary_color
pglSecondaryColorPointerEXT = NULL;
if (CheckToken(ext, "GL_EXT_seconary_color")) {
printf("Found GL_EXT_seconary_color... ");
pglSecondaryColorPointerEXT = SDL_GL_GetProcAddress("glSecondaryColorPointerEXT");
if (pglSecondaryColorPointerEXT == NULL) {
printf("but the driver lied...\n");
} else {
printf("and it's good!\n");
}
} else {
printf("GL_EXT_seconary_color not found...\n");
}
#endif
InitOpenGL();
return 0;
}
@ -631,7 +700,7 @@ void CheckForWindowsMessages()
if ((KeyboardInput[KEY_LEFTALT]||KeyboardInput[KEY_RIGHTALT]) && DebouncedKeyboardInput[KEY_CR]) {
SDL_GrabMode gm;
printf("SDL: before %08X (toggle)\n", surface->flags);
SDL_WM_ToggleFullScreen(surface);
gm = SDL_WM_GrabInput(SDL_GRAB_QUERY);
@ -639,6 +708,7 @@ void CheckForWindowsMessages()
SDL_ShowCursor(1);
else
SDL_ShowCursor(0);
printf("SDL: after %08X (toggle)\n", surface->flags);
}
if (KeyboardInput[KEY_LEFTCTRL] && DebouncedKeyboardInput[KEY_G]) {
@ -668,7 +738,7 @@ void InGameFlipBuffers()
void FlipBuffers()
{
SDL_GL_SwapBuffers();
SDL_Flip(surface);
}
int ExitWindowsSystem()
@ -716,14 +786,13 @@ int InitSDL()
int main(int argc, char *argv[])
{
InitSDL();
LoadCDTrackList();
SetFastRandom();
/* WeWantAnIntro(); */
GetPathFromRegistry();
#if 0
{
@ -741,7 +810,8 @@ int main(int argc, char *argv[])
#endif
InitGame();
SetOGLVideoMode(640, 480);
SetSoftVideoMode(640, 480, 16);
// SetOGLVideoMode(640, 480);
InitialVideoMode();
@ -977,7 +1047,8 @@ while(AvP_MainMenus())
ClearMemoryPool();
SetOGLVideoMode(640, 480);
SetSoftVideoMode(640, 480, 16);
// SetOGLVideoMode(640, 480);
}
SoundSys_StopAll();

File diff suppressed because it is too large Load diff

View file

@ -21,9 +21,6 @@ int QuickStartMultiplayer=1;
DPNAME AVPDPplayerName;
int glpDP; /* directplay object */
static pthread_t NetThread;
static pthread_mutex_t NetMutex;
BOOL DpExtInit(DWORD cGrntdBufs, DWORD cBytesPerBuf, BOOL bErrChcks)
{
fprintf(stderr, "DpExtInit(%d, %d, %d)\n", cGrntdBufs, cBytesPerBuf, bErrChcks);

View file

@ -381,10 +381,12 @@ int PlatPlaySound(int activeIndex)
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_BUFFER,
GameSounds[si].dsBufferP);
#if 1 /* PLEASE REMOVE IFDEF! */
if (ActiveSounds[activeIndex].loop)
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING, AL_TRUE);
else
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING, AL_FALSE);
#endif
if (1 || ActiveSounds[activeIndex].pitch != GameSounds[si].pitch) {
PlatChangeSoundPitch(activeIndex, ActiveSounds[activeIndex].pitch);
@ -539,12 +541,12 @@ int PlatDo3dSound(int activeIndex)
if (ActiveSounds[activeIndex].paused) {
if (distance < (ActiveSounds[activeIndex].threedeedata.outer_range + SOUND_DEACTIVATERANGE)) {
PlatStopSound (activeIndex);
#if 1 /* PLEASE REMOVE IFDEF! */
if (ActiveSounds[activeIndex].loop)
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING, AL_TRUE);
else
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING, AL_FALSE);
#endif
alSourcePlay (ActiveSounds[activeIndex].ds3DBufferP);
newVolume = 0;
ActiveSounds[activeIndex].paused = 0;
@ -697,8 +699,9 @@ void PlatEndGameSound(SOUNDINDEX index)
unsigned int PlatMaxHWSounds()
{
/*
printf("PlatMaxHWSounds()\n");
*/
return 32;
}

View file

@ -54,6 +54,10 @@ static D3DTexture *CurrentlyBoundTexture = NULL;
#define TA_MAXVERTICES 2048
#define TA_MAXTRIANGLES 2048
#if GL_EXT_secondary_color
extern PFNGLSECONDARYCOLORPOINTEREXTPROC pglSecondaryColorPointerEXT;
#endif
typedef struct VertexArray
{
GLfloat v[4];
@ -80,8 +84,6 @@ static VertexArray *svarr = &varr[TA_MAXVERTICES], *svarrp = &varr[TA_MAXVERTICE
static TriangleArray *starr = &tarr[TA_MAXTRIANGLES], *starrp = &tarr[TA_MAXTRIANGLES];
static int svarrc, starrc;
static int haslocked = 0;
/* Do not call this directly! */
static void SetTranslucencyMode(enum TRANSLUCENCY_TYPE mode)
{
@ -90,8 +92,7 @@ static void SetTranslucencyMode(enum TRANSLUCENCY_TYPE mode)
if (TRIPTASTIC_CHEATMODE||MOTIONBLUR_CHEATMODE) {
glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);
} else {
//glDisable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ZERO); /* this *should* be optimized */
glBlendFunc(GL_ONE, GL_ZERO);
}
break;
case TRANSLUCENCY_NORMAL:
@ -116,9 +117,6 @@ static void SetTranslucencyMode(enum TRANSLUCENCY_TYPE mode)
fprintf(stderr, "RenderPolygon.TranslucencyMode: invalid %d\n", RenderPolygon.TranslucencyMode);
return;
}
//if (mode != TRANSLUCENCY_OFF && CurrentTranslucencyMode == TRANSLUCENCY_OFF)
// glEnable(GL_BLEND);
}
/*
@ -126,25 +124,58 @@ A few things:
- Vertices with a specular color are done twice.
Might want to try spitting apart the three arrays and using the same vertex
array for both passes.
- Fix code for separate color support.
*/
void InitOpenGL()
{
CurrentTranslucencyMode = TRANSLUCENCY_OFF;
glBlendFunc(GL_ONE, GL_ZERO);
CurrentFilteringMode = FILTERING_BILINEAR_OFF;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
CurrentlyBoundTexture = NULL;
glBindTexture(GL_TEXTURE_2D, 0);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(4, GL_FLOAT, sizeof(varr[0]), varr[0].v);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof(varr[0]), varr[0].t);
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(varr[0]), varr[0].c);
#if 0
#if GL_EXT_secondary_color
if (useseparate) {
glEnableClientState(GL_SEPARATE_COLOR_ARRAY_EXT);
pglSecondaryColorPointerEXT(4, GL_UNSIGNED_BYTE, sizeof(svarr[0]), svarr[0].c);
} else {
glDisableClientState(GL_SEPARATE_COLOR_ARRAY_EXT);
}
#endif
#endif
tarrc = 0;
tarrp = tarr;
varrc = 0;
varrp = varr;
starrc = 0;
starrp = starr;
svarrc = 0;
svarrp = svarr;
}
static void FlushTriangleBuffers(int backup)
{
int i;
if (haslocked == 0) {
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(4, GL_FLOAT, sizeof(varr[0]), varr[0].v);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof(varr[0]), varr[0].t);
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(varr[0]), varr[0].c);
haslocked = 1;
}
if (tarrc) {
#if 1
glBegin(GL_TRIANGLES);
@ -242,6 +273,7 @@ static void CheckBoundTextureIsCorrect(D3DTexture *tex)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
break;
default:
break;
}
tex->filter = CurrentFilteringMode;
@ -267,6 +299,7 @@ static void CheckFilteringModeIsCorrect(enum FILTERING_MODE_ID filter)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
break;
default:
break;
}
CurrentlyBoundTexture->filter = CurrentFilteringMode;
@ -1717,8 +1750,6 @@ if (stringPtr == NULL) return;
void RenderString(char *stringPtr, int x, int y, int colour)
{
if (stringPtr == NULL) return;
D3D_RenderHUDString(stringPtr,x,y,colour);
}
@ -1727,8 +1758,6 @@ void RenderStringCentred(char *stringPtr, int centreX, int y, int colour)
int length = 0;
char *ptr = stringPtr;
if (stringPtr == NULL) return;
while(*ptr)
{
length+=AAFontWidths[(int)*ptr++];
@ -1741,8 +1770,6 @@ void RenderStringVertically(char *stringPtr, int centreX, int bottomY, int colou
struct VertexTag quadVertices[4];
int y = bottomY;
if (stringPtr == NULL) return;
quadVertices[0].X = centreX - (HUD_FONT_HEIGHT/2) - 1;
quadVertices[1].X = quadVertices[0].X;
quadVertices[2].X = quadVertices[0].X+2+HUD_FONT_HEIGHT*1;

View file

@ -78,14 +78,12 @@ void StartMenuBackgroundBink()
fprintf(stderr, "StartMenuBackgroundBink()\n");
}
#if 0
int PlayMenuBackgroundBink()
{
fprintf(stderr, "PlayMenuBackgroundBink()\n");
return 0;
}
#endif
void EndMenuBackgroundBink()
{
@ -281,7 +279,22 @@ void UnlockSurface()
void ReleaseDDSurface(void* DDSurface)
{
/*
fprintf(stderr, "ReleaseDDSurface(%p)\n", DDSurface);
*/
D3DTexture *t = (D3DTexture *)DDSurface;
if (t->id > 0) {
fprintf(stderr, "ReleaseDDSurface(%p) - OpenGL Object (tex = %d, %d, %d)\n", DDSurface, t->id, t->w, t->h);
} else {
if (t->buf) {
free(t->buf);
} else {
fprintf(stderr, "ReleaseDDSurface(%p) - What is This? (tex = %d, %d, %d)\n", DDSurface, t->id, t->w, t->h);
}
}
free(t);
}
BOOL ChangeDirectDrawObject()

View file

@ -19,6 +19,8 @@ typedef DIRECTDRAWSURFACE DDSurface;
typedef struct DIRECT3DTEXTURE
{
unsigned char *buf;
int id;
int w;

View file

@ -500,6 +500,7 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR
pixelFormat.alphaB = 1;
pixelFormat.validB = 1;
pixelFormat.texB = 1;
pixelFormat.bitsPerPixel = 32;
pixelFormat.redLeftShift = 0;
pixelFormat.greenLeftShift = 8;
@ -513,6 +514,7 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR
extern "C" {
extern int CreateOGLTexture(D3DTexture *, unsigned char *);
extern int CreateIMGSurface(D3DTexture *, unsigned char *);
};
AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const & _parmsR)
@ -521,7 +523,10 @@ AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const &
// fprintf(stderr, "AwBackupTexture::CreateTexture(...) This is where we could convert the image to RGB/RGBA, and so on\n");
D3DTexture *Tex = new D3DTexture;
if (_parmsR.originalWidthP) *_parmsR.originalWidthP = m_nWidth;
if (_parmsR.originalHeightP) *_parmsR.originalHeightP = m_nHeight;
D3DTexture *Tex = (D3DTexture *)malloc(sizeof(D3DTexture));
unsigned char *buf = (unsigned char *)malloc(m_nWidth * m_nHeight * 4);
@ -571,8 +576,14 @@ AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const &
/* temp junk */
Tex->w = m_nWidth;
Tex->h = m_nHeight;
CreateOGLTexture(Tex, buf); /* this will set the id */
free(buf);
if (pixelFormat.texB) {
Tex->buf = NULL; /* not used */
CreateOGLTexture(Tex, buf); /* this will set the id */
free(buf);
} else {
Tex->buf = buf; /* hey, I need this! */
CreateIMGSurface(Tex, buf);
}
return static_cast<SurfUnion>(Tex);
#if 0
@ -2154,6 +2165,7 @@ DDSurface * AwCreateSurface(char const * _argFormatS, ...)
pixelFormat.alphaB = 1;
pixelFormat.validB = 1;
pixelFormat.texB = 0;
pixelFormat.bitsPerPixel = 32;
pixelFormat.redLeftShift = 0;
pixelFormat.greenLeftShift = 8;

View file

@ -23,6 +23,7 @@ namespace AwTl {
bool palettizedB : 1;
bool alphaB : 1;
bool validB : 1;
bool texB : 1;
unsigned bitsPerPixel;
unsigned redLeftShift;