Exemplo n.º 1
0
void CreateHulls (void)
{
	int	i;

	// Hull 0 is always point-sized
	VectorClear(hullinfo.hullsizes[0][0]);
	VectorClear(hullinfo.hullsizes[0][1]);

	CreateSingleHull(0);

	// Commanded to ignore the hulls altogether
	if(noclip)
	{
		hullinfo.numhulls	=
		hullinfo.filehulls	= 1;
		return;
	}

	// create the hulls sequentially
	printf("building hulls sequentially...\n");

	hullinfo.numhulls	=
	hullinfo.filehulls	= BSP_MAX_HULLS;
	for (i = 1; i < BSP_MAX_HULLS; i++)
	{
		VectorCopy(vHullSizes[i][0], hullinfo.hullsizes[i][0]);
		VectorCopy(vHullSizes[i][1], hullinfo.hullsizes[i][1]);
	}

	for(i = 1; i < hullinfo.numhulls; i++)
		CreateSingleHull(i);
}
Exemplo n.º 2
0
/*
=================
CreateHulls
=================
*/
void CreateHulls (void)
{
	// commanded to ignore the hulls altogether
	if (noclip)
    {
		CreateSingleHull ( 0, quake_hull_sizes[0] );
		return;
    }

	// create all the hulls

	// create the hulls sequentially
	printf ("building hulls sequentially...\n");

	if (ismcbsp)
	{
		CreateSingleHull ( 0, mc_hull_sizes[0] );
		CreateSingleHull ( 1, mc_hull_sizes[1] );
		CreateSingleHull ( 2, mc_hull_sizes[2] );
	}
	else
	{
		CreateSingleHull ( 0, quake_hull_sizes[0] );
		CreateSingleHull ( 1, quake_hull_sizes[1] );
		CreateSingleHull ( 2, quake_hull_sizes[2] );
	}
}
Exemplo n.º 3
0
Arquivo: qbsp.c Projeto: dommul/super8
/*
=================
CreateHulls
=================
*/
void CreateHulls (void)
{
	int	i;

// hull 0 is always point-sized
	VectorClear (hullinfo.hullsizes[0][0]);
	VectorClear (hullinfo.hullsizes[0][1]);
	CreateSingleHull (0);

	// commanded to ignore the hulls altogether
	if (noclip)
    {
		hullinfo.numhulls = 1;
		hullinfo.filehulls = (ismcbsp ? 1 : 4);
		return;
    }

	// create the hulls sequentially
	printf ("building hulls sequentially...\n");

	// get the hull sizes
	if (ismcbsp)
	{
		entity_t	*world;
		char		keymins[16], keymaxs[16];
		vec3_t		v;
		int			i;

	// read hull values from _hull# fields in worldspawn
		world = FindEntityWithKeyPair ("classname", "worldspawn");

		for (hullinfo.numhulls = 1; hullinfo.numhulls < MAX_MAP_HULLS; hullinfo.numhulls++)
		{
			sprintf (keymins, "_hull%d_mins", hullinfo.numhulls);
			sprintf (keymaxs, "_hull%d_maxs", hullinfo.numhulls);

			if ((ValueForKey(world, keymins))[0] && (ValueForKey(world, keymaxs))[0])
			{
				GetVectorForKey (world, keymins, v);
				VectorCopy (v, hullinfo.hullsizes[hullinfo.numhulls][0]);
				GetVectorForKey (world, keymaxs, v);
				VectorCopy (v, hullinfo.hullsizes[hullinfo.numhulls][1]);
			}
			else
				break;
		}
		hullinfo.filehulls = hullinfo.numhulls;

		printf ("Map has %d hulls:\n", hullinfo.numhulls);
		for (i = 0; i < hullinfo.numhulls; i++)
			printf ("%2d: %.1f %.1f %.1f, %.1f %.1f %.1f\n", i, hullinfo.hullsizes[i][0][0], hullinfo.hullsizes[i][0][1], hullinfo.hullsizes[i][0][2], hullinfo.hullsizes[i][1][0], hullinfo.hullsizes[i][1][1], hullinfo.hullsizes[i][1][2]);
	}
	else
	{
		hullinfo.numhulls = 3;
		hullinfo.filehulls = 4;
		VectorSet (hullinfo.hullsizes[1][0], -16, -16, -24);
		VectorSet (hullinfo.hullsizes[1][1], 16, 16, 32);
		VectorSet (hullinfo.hullsizes[2][0], -32, -32, -24);
		VectorSet (hullinfo.hullsizes[2][1], 32, 32, 64);
	}

	for (i = 1; i < hullinfo.numhulls; i++)
		CreateSingleHull (i);
}
Exemplo n.º 4
0
/*
=================
CreateHulls

=================
*/
void CreateHulls (void)
{
// commanded to create a single hull only
	if (hullnum)
	{
		CreateSingleHull ();
		exit (0);
	}
	
// commanded to use the allready existing hulls 1 and 2
	if (usehulls)
	{
		CreateSingleHull ();
		return;
	}
	
// commanded to ignore the hulls altogether
	if (noclip)
	{
		CreateSingleHull ();
		return;
	}


// create all the hulls

#ifdef __alpha
	printf ("forking hull processes...\n");
// fork a process for each clipping hull
	fflush (stdout);
	if (!fork ())
	{
		hullnum = 1;
		verbose = false;
		drawflag = false;
		sprintf (argv0, "HUL%i", hullnum);
	}
	else if (!fork ())
	{
		hullnum = 2;
		verbose = false;
		drawflag = false;
		sprintf (argv0, "HUL%i", hullnum);
	}
	CreateSingleHull ();

	if (hullnum)
		exit (0);
	
	wait (NULL);		// wait for clip hull process to finish
	wait (NULL);		// wait for clip hull process to finish

#else
// create the hulls sequentially
	printf ("building hulls sequentially...\n");

	hullnum = 1;
	CreateSingleHull ();
	
	nummodels = 0;
	numplanes = 0;
	numclipnodes = 0;
	hullnum = 2;
	CreateSingleHull ();
	
	nummodels = 0;
	numplanes = 0;
	numclipnodes = 0;
	hullnum = 0;
	CreateSingleHull ();
#endif	

}
Exemplo n.º 5
0
/*
=================
CreateHulls

=================
*/
static void CreateHulls (void)
{
#if defined(__alpha) && defined(PLATFORM_WINDOWS)
    STARTUPINFO	StartupInfo;
    char	myargs[512];
    PROCESS_INFORMATION	ProcH1Info;
    PROCESS_INFORMATION	ProcH2Info;
    PROCESS_INFORMATION	ProcH3Info;
    PROCESS_INFORMATION	ProcH4Info;
    PROCESS_INFORMATION	ProcH5Info;

    GetStartupInfo(&StartupInfo);
#endif

// commanded to create a single hull only
    if (hullnum)
    {
        CreateSingleHull ();
        exit (0);
    }

// commanded to use the already existing hulls 1 and 2
    if (usehulls)
    {
        CreateSingleHull ();
        return;
    }

// commanded to ignore the hulls altogether
    if (noclip)
    {
        CreateSingleHull ();
        return;
    }

// create all the hulls

#ifdef __alpha

#  ifdef PLATFORM_WINDOWS
    // fork a process for each clipping hull
    printf ("Creating hull processes...\n");
    fflush (stdout);

    sprintf (myargs,"%s -hullnum 1 %s",argv0,gargs);
    CreateProcess(
        NULL,	// pointer to name of executable module
        myargs,	// pointer to command line string
        NULL,	// pointer to process security attributes
        NULL,	// pointer to thread security attributes
        FALSE,	// handle inheritance flag
        0,	// creation flags
        NULL,	// pointer to new environment block
        NULL,	// pointer to current directory name
        &StartupInfo,	// pointer to STARTUPINFO
        &ProcH1Info	// pointer to PROCESS_INFORMATION
    );

    CloseHandle(ProcH1Info.hThread);

    sprintf (myargs,"%s -hullnum 2 %s",argv0,gargs);
    CreateProcess(
        NULL,	// pointer to name of executable module
        myargs,	// pointer to command line string
        NULL,	// pointer to process security attributes
        NULL,	// pointer to thread security attributes
        FALSE,	// handle inheritance flag
        0,	// creation flags
        NULL,	// pointer to new environment block
        NULL,	// pointer to current directory name
        &StartupInfo,	// pointer to STARTUPINFO
        &ProcH2Info	// pointer to PROCESS_INFORMATION
    );
    CloseHandle(ProcH2Info.hThread);

    //hullnum = 0;
    // wait for clip hull process to finish
    WaitForSingleObject(ProcH1Info.hProcess, INFINITE);
    WaitForSingleObject(ProcH2Info.hProcess, INFINITE);

    sprintf (myargs,"%s -hullnum 3 %s",argv0,gargs);
    CreateProcess(
        NULL,	// pointer to name of executable module
        myargs,	// pointer to command line string
        NULL,	// pointer to process security attributes
        NULL,	// pointer to thread security attributes
        FALSE,	// handle inheritance flag
        0,	// creation flags
        NULL,	// pointer to new environment block
        NULL,	// pointer to current directory name
        &StartupInfo,	// pointer to STARTUPINFO
        &ProcH3Info	// pointer to PROCESS_INFORMATION
    );
    CloseHandle(ProcH3Info.hThread);

    sprintf (myargs,"%s -hullnum 4 %s",argv0,gargs);
    CreateProcess(
        NULL,	// pointer to name of executable module
        myargs,	// pointer to command line string
        NULL,	// pointer to process security attributes
        NULL,	// pointer to thread security attributes
        FALSE,	// handle inheritance flag
        0,	// creation flags
        NULL,	// pointer to new environment block
        NULL,	// pointer to current directory name
        &StartupInfo,	// pointer to STARTUPINFO
        &ProcH4Info	// pointer to PROCESS_INFORMATION
    );
    CloseHandle(ProcH4Info.hThread);

    sprintf (myargs,"%s -hullnum 5 %s",argv0,gargs);
    CreateProcess(
        NULL,	// pointer to name of executable module
        myargs,	// pointer to command line string
        NULL,	// pointer to process security attributes
        NULL,	// pointer to thread security attributes
        FALSE,	// handle inheritance flag
        0,	// creation flags
        NULL,	// pointer to new environment block
        NULL,	// pointer to current directory name
        &StartupInfo,	// pointer to STARTUPINFO
        &ProcH5Info	// pointer to PROCESS_INFORMATION
    );
    CloseHandle(ProcH5Info.hThread);

    sprintf (StartupInfo.lpTitle, "HUL0");
    CreateSingleHull ();

    WaitForSingleObject(ProcH3Info.hProcess, INFINITE);
    WaitForSingleObject(ProcH4Info.hProcess, INFINITE);
    WaitForSingleObject(ProcH5Info.hProcess, INFINITE);

    CloseHandle(ProcH1Info.hProcess);
    CloseHandle(ProcH2Info.hProcess);
    CloseHandle(ProcH3Info.hProcess);
    CloseHandle(ProcH4Info.hProcess);
    CloseHandle(ProcH5Info.hProcess);

#  else	/* __alpha, but not windows */
    // fork a process for each clipping hull
    printf ("forking hull processes...\n");
    fflush (stdout);
    if (!fork ())
    {
        hullnum = 1;
        verbose = false;
        drawflag = false;
        sprintf (argv0, "HUL%i", hullnum);
    }
    else if (!fork ())
    {
        hullnum = 2;
        verbose = false;
        drawflag = false;
        sprintf (argv0, "HUL%i", hullnum);
    }
    CreateSingleHull ();

    if (hullnum)
        exit (0);

    wait (NULL);		// wait for clip hull process to finish
    wait (NULL);		// wait for clip hull process to finish

#  endif  /* end of __alpha */

#else	/* not _alpha */

    // create the hulls sequentially
    printf ("building hulls sequentially...\n");

    hullnum = 1;
    CreateSingleHull ();

    nummodels = 0;
    numplanes = 0;
    numclipnodes = 0;
    hullnum = 2;
    CreateSingleHull ();

    nummodels = 0;
    numplanes = 0;
    numclipnodes = 0;
    hullnum = 3;
    CreateSingleHull ();

    nummodels = 0;
    numplanes = 0;
    numclipnodes = 0;
    hullnum = 4;
    CreateSingleHull ();

    nummodels = 0;
    numplanes = 0;
    numclipnodes = 0;
    hullnum = 5;
    CreateSingleHull ();

    nummodels = 0;
    numplanes = 0;
    numclipnodes = 0;
    hullnum = 0;
    CreateSingleHull ();
#endif

}