First working compilation.

This commit is contained in:
Julian
2020-02-25 21:46:51 -03:00
parent 6cdc2ea18c
commit f2d8d91baf
88 changed files with 1959 additions and 13767 deletions

View File

@@ -19,12 +19,19 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "nodes.h"
#include "animation.h"
#include "doors.h"
//#if !defined ( _WIN32 )
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h> // mkdir
//#endif
#define HULL_STEP_SIZE 16// how far the test hull moves on each step
#define NODE_HEIGHT 8 // how high to lift nodes off the ground after we drop them all (make stair/ramp mapping easier)
@@ -610,7 +617,8 @@ int CGraph :: FindShortestPath ( int *piPath, int iStart, int iDest, int iHull,
// Mark all the nodes as unvisited.
//
for ( int i = 0; i < m_cNodes; i++)
int i;
for ( i = 0; i < m_cNodes; i++)
{
m_pNodes[ i ].m_flClosestSoFar = -1.0;
}
@@ -1411,12 +1419,12 @@ void CTestHull :: Spawn( entvars_t *pevMasterNode )
if ( WorldGraph.m_fGraphPresent )
{// graph loaded from disk, so we don't need the test hull
SetThink ( SUB_Remove );
SetThink ( &CTestHull::SUB_Remove );
pev->nextthink = gpGlobals->time;
}
else
{
SetThink ( DropDelay );
SetThink ( &CTestHull::DropDelay );
pev->nextthink = gpGlobals->time + 1;
}
@@ -1436,7 +1444,7 @@ void CTestHull::DropDelay ( void )
UTIL_SetOrigin ( VARS(pev), WorldGraph.m_pNodes[ 0 ].m_vecOrigin );
SetThink ( CallBuildNodeGraph );
SetThink ( &CTestHull::CallBuildNodeGraph );
pev->nextthink = gpGlobals->time + 1;
}
@@ -1584,7 +1592,7 @@ void CTestHull :: BuildNodeGraph( void )
float flDist;
int step;
SetThink ( SUB_Remove );// no matter what happens, the hull gets rid of itself.
SetThink ( &CTestHull::SUB_Remove );// no matter what happens, the hull gets rid of itself.
pev->nextthink = gpGlobals->time;
// malloc a swollen temporary connection pool that we trim down after we know exactly how many connections there are.
@@ -1696,7 +1704,7 @@ void CTestHull :: BuildNodeGraph( void )
{
ALERT ( at_aiconsole, "**ConnectVisibleNodes FAILED!\n" );
SetThink ( ShowBadNode );// send the hull off to show the offending node.
SetThink ( &CTestHull::ShowBadNode );// send the hull off to show the offending node.
//pev->solid = SOLID_NOT;
pev->origin = WorldGraph.m_pNodes[ iBadNode ].m_vecOrigin;
@@ -2685,7 +2693,9 @@ void CGraph::HashChoosePrimes(int TableSize)
// We divide this interval into 16 equal sized zones. We want to find
// one prime number that best represents that zone.
//
for (int iZone = 1, iPrime = 0; iPrime < 16; iZone += Spacing)
int iPrime;
int iZone;
for (iZone = 1, iPrime = 0; iPrime < 16; iZone += Spacing)
{
// Search for a prime number that is less than the target zone
// number given by iZone.
@@ -2742,8 +2752,9 @@ void CGraph::SortNodes(void)
// things and patchup the links.
//
int iNodeCnt = 0;
int i;
m_pNodes[0].m_iPreviousNode = iNodeCnt++;
for (int i = 1; i < m_cNodes; i++)
for (i = 1; i < m_cNodes; i++)
{
m_pNodes[i].m_iPreviousNode = UNNUMBERED_NODE;
}
@@ -2808,7 +2819,8 @@ void CGraph::BuildLinkLookups(void)
ALERT(at_aiconsole, "Couldn't allocated Link Lookup Table.\n");
return;
}
for (int i = 0; i < m_nHashLinks; i++)
int i;
for (i = 0; i < m_nHashLinks; i++)
{
m_pHashLinks[i] = ENTRY_STATE_EMPTY;
}
@@ -2848,7 +2860,8 @@ void CGraph::BuildRegionTables(void)
// Calculate regions for all the nodes.
//
//
for (int i = 0; i < 3; i++)
int i;
for (i = 0; i < 3; i++)
{
m_RegionMin[i] = 999999999.0; // just a big number out there;
m_RegionMax[i] = -999999999.0; // just a big number out there;
@@ -2875,10 +2888,11 @@ void CGraph::BuildRegionTables(void)
m_pNodes[i].m_Region[1] = CALC_RANGE(m_pNodes[i].m_vecOrigin.y, m_RegionMin[1], m_RegionMax[1]);
m_pNodes[i].m_Region[2] = CALC_RANGE(m_pNodes[i].m_vecOrigin.z, m_RegionMin[2], m_RegionMax[2]);
}
for (i = 0; i < 3; i++)
{
for (int j = 0; j < NUM_RANGES; j++)
int j;
for (j = 0; j < NUM_RANGES; j++)
{
m_RangeStart[i][j] = 255;
m_RangeEnd[i][j] = 0;
@@ -3012,7 +3026,8 @@ void CGraph :: ComputeStaticRoutingTables( void )
// Initialize Routing table to uncalculated.
//
for (int iFrom = 0; iFrom < m_cNodes; iFrom++)
int iFrom;
for (iFrom = 0; iFrom < m_cNodes; iFrom++)
{
for (int iTo = 0; iTo < m_cNodes; iTo++)
{
@@ -3228,7 +3243,8 @@ void CGraph :: ComputeStaticRoutingTables( void )
int nRoute = p - pRoute;
if (m_pRouteInfo)
{
for (int i = 0; i < m_nRouteInfo - nRoute; i++)
int i;
for (i = 0; i < m_nRouteInfo - nRoute; i++)
{
if (memcmp(m_pRouteInfo + i, pRoute, nRoute) == 0)
{
@@ -3320,7 +3336,8 @@ void CGraph :: TestRoutingTables( void )
//
#if 1
float flDistance1 = 0.0;
for (int i = 0; i < cPathSize1-1; i++)
int i;
for (i = 0; i < cPathSize1-1; i++)
{
// Find the link from pMyPath[i] to pMyPath[i+1]
//