File fix-gcc15.patch of Package orbital
diff --git a/src/ac3d.c b/src/ac3d.c
index 8a10051..5f4ea1c 100644
--- a/src/ac3d.c
+++ b/src/ac3d.c
@@ -104,6 +104,8 @@ struct Tag top_tags [] =
{"OBJECT" , DoObject },
};
+int Search (struct Tag *tags, char *s);
+
void InitTextures()
{
int t;
@@ -117,7 +119,7 @@ void InitTextures()
ntex = 0;
}
-LoadAC3D (name)
+int LoadAC3D (name)
char *name;
{
char buffer[1024], *s, fn[256];
@@ -634,7 +636,7 @@ int DoTexrep (char *s)
int DoRot (char *s)
{
- float mat[4][4];
+ GLfloat mat[4][4];
mat[0][3] = mat[1][3] = mat[2][3] = mat[3][0] = mat[3][1] = mat[3][2] = 0.0f;
mat[3][3] = 1.0f;
@@ -647,7 +649,7 @@ int DoRot (char *s)
Log ("DoRot: Illegal rot record: %s", s);
}
- glMultMatrixf (mat);
+ glMultMatrixf (mat[0]);
return PARSE_CONT ;
}
diff --git a/src/boom.c b/src/boom.c
index 27be9bb..000fb7e 100644
--- a/src/boom.c
+++ b/src/boom.c
@@ -21,6 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "orbit.h"
+void DestroyLight (int l);
+void DrawBoom (int b);
+int FindLight();
+
void InitBooms()
/*
* Initiliaze explosions
diff --git a/src/client.c b/src/client.c
index 1ac4bf3..70cbdf3 100644
--- a/src/client.c
+++ b/src/client.c
@@ -37,7 +37,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/*
* All sorts of stuff a client needs
*/
-
+int BecomeClient (char *s);
+void BinaryPositionLong (unsigned char *pkt);
+void BinaryPositionShort (unsigned char *pkt);
+void NetDestroyTarget (int t, int m);
+void ServerBinaryPing (char *pkt);
+void ServerBinaryVacant (char *pkt);
+void PositionLong (int c, double pos[3], double vel[3], double view[3], double up[3], double move_up, double move_down, double move_right, double move_left, double move_pitchright, double move_pitchleft);
+void PositionPlanets();
+void PositionShort (int c, double pos[3], double vel[3]);
int FindClient()
/*
* Find an unused client
diff --git a/src/event.c b/src/event.c
index e869f85..7194313 100644
--- a/src/event.c
+++ b/src/event.c
@@ -25,6 +25,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Stuff to implement events
*/
+void EventTrigAlarm (int e);
+void EventTrigApproach (int e);
+void EventTrigDepart (int e);
+void EventTrigDestroy (int e);
+void EventTrigScore (int e);
+void EventTrigShields (int e);
+void EventTrigStopnear (int e);
+int FindTargetByName (char *name);
+
void InitEvents ()
/*
* Initialize events
diff --git a/src/hud.c b/src/hud.c
index aa21898..08ffb2c 100644
--- a/src/hud.c
+++ b/src/hud.c
@@ -21,6 +21,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "orbit.h"
+void DisplayConsole();
+void DrawLock();
+void DrawMessage();
+void DrawMotionCursors();
+void DrawPlanetLock();
+void DrawRadarCircle();
+void DrawWaypoint();
+void InitRadar();
+void MakeRadarCircleList();
+void PlanetStuff();
+void PlayerVel();
+void Radar();
+void RadarMissiles();
+void RadarPlanets();
+void RadarTargets();
+void RadarWaypoint();
+void Shields();
+void ShowWeapon();
+void TargetStuff();
+void TargetShields (int t);
+void Throttle();
+void WaypointStuff();
+
static GLubyte throt_stipple[] = {
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
diff --git a/src/keyboard.c b/src/keyboard.c
index 9117bb4..6f7f6b4 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -21,6 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "orbit.h"
+void GetText (char *prompt, void (*func)(void));
+void PrintCompression();
+void ShowClients ();
+
+
char key[256], spec[256];
static void Key (unsigned char k, int x, int y)
diff --git a/src/log.c b/src/log.c
index c71794c..90f14fe 100644
--- a/src/log.c
+++ b/src/log.c
@@ -65,7 +65,7 @@ void Log (char *fmt, ...)
*/
{
va_list ap;
- int tm;
+ time_t tm;
char buf[64];
time_t * ptr_tmp;
diff --git a/src/missile.c b/src/missile.c
index 5d24d57..dd1e601 100644
--- a/src/missile.c
+++ b/src/missile.c
@@ -21,6 +21,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "orbit.h"
+void DestroyMissile (int m);
+void DrawMissile (int m);
+void DrawMissile0 (int m);
+void DrawMissile1 (int m);
+void DrawMissile2 (int m);
+void DrawMissile3 (int m);
+void DrawMissile4 (int m);
+int HitTarget(int t);
+void MissileHitPlayer (int m);
+void MissileHitTarget (int m, int t);
+
void InitMissiles()
/*
* Set up missile structures
diff --git a/src/mission.c b/src/mission.c
index 5616c4c..0761a0f 100644
--- a/src/mission.c
+++ b/src/mission.c
@@ -21,6 +21,49 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "orbit.h"
+void AddWaypoint (double v[3]);
+int CursorObject();
+int CursorPlanet();
+void EvAction (int e);
+void EvName (int e);
+void EvValue (int e);
+void EvTrigger (int e);
+int FindEvent();
+void Include();
+void MakePlanetList (int p);
+void Object ();
+void ObjFriendly (int t);
+void ObjInvisible (int t);
+void ObjHidden (int t);
+void ObjMaxshields (int t);
+void ObjModel (int t);
+void ObjName (int t);
+void ObjScore (int t);
+void ObjShieldregen (int t);
+void ObjSpeed (int t);
+void ObjStrategy (int t);
+void ObjTurnrate (int t);
+void ObjWeapon (int t);
+void Planet();
+void PlanetHidden();
+void PlanetMap();
+void PlanetName();
+void PlanetNewname();
+void PlanetOblicity();
+void PlanetRadius();
+void PlanetReposition();
+int PushFD();
+void ReadPlanetTexture (int p);
+void WeaponColor();
+void WeaponExpire();
+void WeaponIdle();
+void WeaponIndex();
+void WeaponName();
+void WeaponRanges();
+void WeaponRenderer();
+void WeaponSpeed();
+void WeaponYield();
+
/* File descriptor stack */
#define NFDS (16)
FILE *fd[NFDS];
@@ -262,7 +305,7 @@ void Cursor()
}
}
-CursorPlanet()
+int CursorPlanet()
{
int p;
@@ -279,7 +322,7 @@ CursorPlanet()
return 0;
}
-CursorObject()
+int CursorObject()
{
int t;
@@ -509,7 +552,7 @@ int t;
t, target[t].score);
}
-void ObjName (t)
+void ObjName (int t)
{
GetRequiredToken();
diff --git a/src/model.c b/src/model.c
index 2f7e4d1..c0a1700 100644
--- a/src/model.c
+++ b/src/model.c
@@ -464,7 +464,7 @@ int m;
model[m].radius2 = model[m].radius * model[m].radius;
}
-void ScaleModel (m)
+void ScaleModel (int m)
/*
* Make models a uniform size
*/
diff --git a/src/network.c b/src/network.c
index bf09eec..6b8d24f 100644
--- a/src/network.c
+++ b/src/network.c
@@ -43,6 +43,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* All sorts of stuff for network communication
*/
+void XmitBinaryPacket (SOCKET socket, char *buf, int len);
+
int endian; /* Endian for transmitting network values */
void InitNetwork()
@@ -665,7 +667,7 @@ int t, p;
CheckLock();
}
-FindClientByTarget (t)
+int FindClientByTarget (t)
int t;
/*
* Figure out what client belongs to this target
@@ -775,7 +777,7 @@ double v[3];
return 1;
}
-FindEndian()
+int FindEndian()
/*
* Try to figure out the endianness of this machine, especially with
* regard to floats. Kinda kludgy but it's been working great.
diff --git a/src/orbit.c b/src/orbit.c
index 8f12ec2..297c2dd 100644
--- a/src/orbit.c
+++ b/src/orbit.c
@@ -25,10 +25,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ALLOCATE
#include "orbit.h"
+void InitBooms();
+void InitConsole();
+void InitEvents();
+void InitJoy(void);
+void InitLights();
+void InitMessage();
+void InitMissiles();
+void InitModels();
+void InitTargets();
+void PieceOfJunk(double x, double y, double z);
+void ReadPrefs();
+void ReadStars();
+void ShowPlanetNames();
+void ShowTargetNames();
int tm, frames, total_frames;
-main (argc, argv)
+int main (argc, argv)
int argc;
char *argv[];
{
diff --git a/src/orbit.h b/src/orbit.h
index c5066d5..b3a17c5 100644
--- a/src/orbit.h
+++ b/src/orbit.h
@@ -79,13 +79,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void DrawScene(void);
void Reshape(int, int);
void MovePlayer();
-double Dist2();
-double rnd();
+double Dist2(double x1, double y1, double z1, double x2, double y2, double z2);
+double rnd(double in);
double Time();
-double Theta();
-double Dotp();
-double Mag();
-double Mag2();
+double Theta(double v[3]);
+double Dotp(double a[3], double b[3]);
+double Mag(double a[3]);
+double Mag2(double *a);
void Log (char *fmt, ...);
void Mprint (char *msg, ...);
void Cprint (char *c, ...);
@@ -94,6 +94,197 @@ void DoChat (void);
void DoDrop (void);
void DoLoad (void);
void DoName (void);
+void InitWeapons();
+void Vadd (double a[3], double b[3], double c[3]);
+void Vsub (double a[3], double b[3], double c[3]);
+void Vmul (double a[3], double b[3], double s);
+void Vdiv (double a[3], double b[3], double s);
+void NetPlayerDies();
+void CheckLock();
+void RotateAbout (double vp[3], double v[3], double n[3], double theta);
+void Normalize (double v[3]);
+void Crossp (double a[3], double b[3], double c[3]);
+void Vset (double a[3], double b[3]);
+void NetClientFires (int clnt, int wep);
+int Aim (double vtarg[3], double pos0[3], double vel0[3], double pos1[3], double vel1[3], double vel);
+void FireMissile (double pos[3], double vel[3], double dir[3], int friendly, int wep, int owner);
+int LoadModel(char *buf);
+void OutOfMemory();
+int InitClientTarget();
+int FindPlanetByName (char *c);
+void ReadMission (char *msn);
+void Boom (double v[3], double size);
+void DecodeBinaryPacket (char *pkt, char *fmt, ...);
+void Print (void *font, char *string);
+void DestroyTarget (int t);
+void CloseLog();
+void ShutdownClient();
+int BecomeServer();
+void ShutdownServer();
+void PrevWaypoint();
+void NextWaypoint();
+void LoadGame();
+void PlayerFires();
+void InitMouse();
+void LockPrev();
+void LockNext();
+void SendFlags();
+void QueuePositionReport();
+void WritePrefs();
+void ShutdownNetwork();
+void LoadGameByKey (int k);
+void LockNearest();
+void ScreenShot();
+void NetDestroyTarget (int t, int m);
+void NetHitTarget (int t, int m);
+void EventAction (int e);
+void InitPlayer();
+int FindClientByTarget (int t);
+void NetDestroyClient (int cv, int ck);
+void Gravity (double deltav[3], double pos[3]);
+int InsidePlanet (double v[3]);
+int FindTarget();
+void Weapon();
+void Event();
+void Briefing();
+void Waypoint();
+void Player();
+void Cursor();
+int PopFD();
+int GetToken();
+void RotateTokens();
+void InitTargets();
+void ResetEvents();
+void ResetPlanets();
+void InitWaypoints();
+void UnrecognizedToken();
+void AddSave (char *fn);
+void Vertex (int v);
+void Normal (int t);
+int FindTriangle();
+int FindAdjacent(int t);
+void flop (int t);
+void MakeStrips();
+int AddVertex (double v[3]);
+int LoadAC3D (char *name);
+void ScaleModel (int m);
+void ModelBounds (int m);
+void InitLog();
+void ShowNames();
+void Junk();
+void DrawRings();
+void DrawBooms ();
+void DrawTargets();
+void DrawMissiles ();
+void DrawPlanets();
+void DrawWorld();
+void Hud();
+void DrawStars();
+void DoEvents();
+void MoveMissiles ();
+void MoveTargets ();
+void UpdatePlayer ();
+void MovePlanets();
+void DoMouse();
+void JoyStick();
+void Keyboard();
+void DoNetwork();
+void DeltaTime();
+void InitKeyboard();
+void InitNetwork();
+void InitHud();
+void InitRings();
+void InitTextures();
+void InitPlanets();
+void MakeStarList();
+void Lights();
+void InitTimer();
+void InitStuff();
+void OpenWindow (int argc, char *argv[]);
+void PositionPlanets();
+void RandomPlanets();
+void DrawSplash();
+void MakeOrbitLists();
+void DrawOrbits();
+void MakeSunList();
+void DrawPlanet (int p);
+void MakePlanetList (int p);
+void Sphere (double r, int slices, int sectors);
+void ReadRingTexture (int r);
+void MakeRingList (int r);
+void NetTargetCratered (int t, int p);
+void LookAt (double view[3], double up[3]);
+void MoveTarget (int t);
+void DrawTarget (int t);
+void ThinkTarget (int t);
+void ThinkSit1 (int t);
+void ThinkSit2 (int t);
+void ThinkSit3 (int t);
+void ThinkSit4 (int t);
+void ThinkHunt1 (int t);
+void ThinkHunt2 (int t);
+void ThinkHunt3 (int t);
+void ThinkHunt4 (int t);
+void TargetFiresMissile (int t);
+void MoveToward (int t, double pos[3]);
+void TurnToward (int t, double pos[3]);
+int FindEnemy (int t, double pos[3], double vel[3]);
+void WeaponRanges();
+void ViewLock();
+int EncUnitFloat (double v);
+int RespawnOkay(double v[3]);
+void DropClient (int c);
+void DoClient();
+void DoServer();
+int FindClient();
+void ResetModels();
+int FindEndian();
+void ReportPosition();
+void ServerResetPlanets (char * pkt);
+void ServerPlanet (char * pkt);
+void ServerWelcome (char * pkt);
+void ServerGbye (char * pkt);
+void ServerHelo (char * pkt);
+void ServerCMSG (char * pkt);
+void ServerCrater (char * pkt);
+void ServerFlag (char * pkt);
+void ServerModel (char * pkt);
+void ServerVacant (char * pkt);
+void ServerName (char * pkt);
+void ServerBinaryPacket (unsigned char * pkt);
+void ServerPositionShort (char * pkt);
+void ServerPositionLong (char * pkt);
+void ServerPing (char * pkt);
+void ServerFire (char * pkt);
+void ServerMHit (char * pkt);
+void ServerMDie (char * pkt);
+void ServerMessage (char * pkt);
+void ServerPacket (char * pkt);
+void ServerByte (char c);
+void ServerData (char *buf, int n);
+void ClientBinaryPing (int c, char *pkt);
+void ClientBinaryPosition (int c, unsigned char *pkt, int urgent);
+void ClientVersion (int c, char *pkt);
+void ClientModel (int c, char *pkt);
+void ClientName (int c, char *pkt);
+void ClientPing (int c, char *pkt);
+void ClientFire (int c, char *pkt);
+void ClientPosition (int c, char *pkt, int n);
+void ClientBinaryPacket (int c, unsigned char *pkt);
+void ClientByte (int c, char byte);
+void ClientData (int c, char *buf, int n);
+void ClientPacket (int c, char *pkt);
+void SendPosition (int c, int cc);
+void SendToClient (int c);
+void ReadFromClient (int c);
+void DoThisClient (int c);
+void CheckForClient();
+void MaintainNormal (int i, float n[3]);
+void ScanForTextures();
+void LoadTexture (char *s);
+int FindModel();
+
+
EXTERN int ScreenWidth, ScreenHeight;
EXTERN double fov;
diff --git a/src/save.c b/src/save.c
index 3f5939a..87ec67a 100644
--- a/src/save.c
+++ b/src/save.c
@@ -175,15 +175,15 @@ void LoadGame()
/* Construct the selection list */
strcpy (buf, "Select mission to load:\\\\");
- time_t * ptr_tmp;
+ time_t tmp_time;
for (s=0; s<nsaves; s++)
{
sprintf (buf2, "%d) ", s);
strcat (buf, buf2);
strcat (buf, save[s].fn);
strcat (buf, " ");
- ptr_tmp = &save[s].time;
- sprintf (buf2, "%s", ctime(ptr_tmp));
+ tmp_time = save[s].time;
+ sprintf (buf2, "%s", ctime(&tmp_time));
strcat (buf, buf2);
strcat (buf, "\\");
}
diff --git a/src/server.c b/src/server.c
index dbd5c8b..379a92e 100644
--- a/src/server.c
+++ b/src/server.c
@@ -38,6 +38,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/*
* All sorts of stuff the server does
*/
+void ClientChat (int c, char *pkt);
+void SendBinaryVacant (int c);
+void SendFlags();
+void SendPositionLong (int clnt, int c);
+void SendPositionShort (int clnt, int c);
+void SendRollCall (int c);
+
void DoServer()
/*
@@ -977,7 +984,7 @@ int c;
SendASCIIPacket (client[c].socket, "RPLN");
}
-void SendRollCall (c)
+void SendRollCall (int c)
/*
* Send roll call to client c
*/
@@ -1029,13 +1036,13 @@ void SendRollCall (c)
#endif
/* Send flags while we're here */
- SendFlags (c);
+ SendFlags ();
/* Oh and what the heck, let's send planet positions too */
SendPlanets (c);
}
-void SendBinaryVacant (c)
+void SendBinaryVacant (int c)
/*
* Send binary vacancy report to client c
*/
diff --git a/src/timer.c b/src/timer.c
index 712f6c3..37cfdcd 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -45,7 +45,7 @@ void InitTimer()
last_ticks = 0;
}
-DeltaTime()
+void DeltaTime() \
/*
* Figure out how much time has elapsed since the last time we were called
*/
@@ -59,7 +59,7 @@ DeltaTime()
if (paused)
{
deltaT = 0.0;
- return 0;
+ return;
}
#ifdef WIN32
@@ -88,7 +88,5 @@ DeltaTime()
absT += deltaT;
last_ticks = ticks;
-
- return 0;
}
diff --git a/src/util.c b/src/util.c
index 72419c0..9a4b4e6 100644
--- a/src/util.c
+++ b/src/util.c
@@ -23,6 +23,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdlib.h>
#include <math.h>
+double Mag(double a[3]);
+double Mag2(double *a);
+void Log (char *fmt, ...);
+void CloseLog();
+void FinishSound (void);
+void Vset (double a[3], double b[3]);
+void Vdiv (double a[3], double b[3], double s);
+
void RotateAbout (vp, v, n, theta)
double vp[3], v[3], n[3], theta;
/*
@@ -91,7 +99,7 @@ double vp[3], v[3], n[3], theta;
void Normalize (v)
double v[3];
{
- double Mag(), vt[3];
+ double vt[3];
Vdiv (vt, v, Mag(v));
Vset (v, vt);
}
@@ -192,7 +200,7 @@ double r;
return (f);
}
-OutOfMemory()
+void OutOfMemory()
{
Log ("OutOfMemory: Out of memory! Panicking!!");
FinishSound();