示例#1
0
void US_Startup(void)
{
	// Initialize the random number generator (to the current time).
	US_InitRndT(true);

	// Load configuration file
	US_LoadConfig();

	// Check command line args.
	for (int i = 1; i < us_argc; ++i)
	{
		int parmIdx = US_CheckParm(us_argv[i], us_parmStrings);
		switch (parmIdx)
		{
		case 0:
			us_tedLevelNumber = atoi(us_argv[i + 1]);
			if (us_tedLevelNumber > -1)
				us_tedLevel = true;
			break;
		case 1:
			us_noWait = true;
			break;
		}
	}
	us_started = true;

}
示例#2
0
///////////////////////////////////////////////////////////////////////////
//
//      US_Startup() - Starts the User Mgr
//
///////////////////////////////////////////////////////////////////////////
void
US_Startup(void)
{
	int     i;

	if (US_Started)
		return;

	harderr(USL_HardError); // Install the fatal error handler

	US_InitRndT(true);              // Initialize the random number generator

	USL_ReadConfig();               // Read config file

	for (i = 1;i < _argc;i++)
	{
		switch (US_CheckParm(_argv[i],ParmStrings2))
		{
		case 0:
			if (grmode == EGAGR)
				compatability = true;
			break;
		case 1:
			compatability = false;
			break;
		}
	}

	US_Started = true;
}
示例#3
0
void
US_Startup(void)
{
	Sint16	n;

    // BBi
    int sdl_result;
    // BBi

	if (US_Started)
		return;

    // BBi
    SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
        "SDL: %s", "Initializing timer...");

    sdl_result = SDL_InitSubSystem(SDL_INIT_TIMER);

    if (sdl_result != 0)
        Quit("%s", SDL_GetError());

    sys_timer_id = SDL_AddTimer(1000 / 70, sys_timer_callback, NULL);

    if (sys_timer_id == 0)
        Quit("%s", SDL_GetError());
    // BBi

	US_InitRndT(true);		// Initialize the random number generator

	switch (::g_args.check_argument(US_ParmStrings2))
	{
	case 0:
		compatability = true;
		break;
	case 1:
		compatability = false;
		break;
	}

	// Check for TED launching here
	n = static_cast<int16_t>(g_args.check_argument(US_ParmStrings));
	switch(n)
	{
		case 0:
#if 0
		tedlevelnum = atoi(g_argv[i + 1]);
//		   if (tedlevelnum >= 0)
			tedlevel = true;
#endif
		break;

//		 case 1:
//			NoWait = true;
//			break;
	}

	US_Started = true;
}
示例#4
0
///////////////////////////////////////////////////////////////////////////
//
//  US_Startup() - Starts the User Mgr
//
///////////////////////////////////////////////////////////////////////////
void US_Startup(void)
{
   if (US_Started)
      return;

   US_InitRndT(true);      // Initialize the random number generator

   US_Started = true;
}
示例#5
0
///////////////////////////////////////////////////////////////////////////
//
//	US_Startup() - Starts the User Mgr
//
///////////////////////////////////////////////////////////////////////////
void US_Startup()
{
	if (US_Started)
		return;

	US_InitRndT(true);

	if (MS_CheckParm("nowait"))
		NoWait = true;

	US_Started = true;
}
示例#6
0
///////////////////////////////////////////////////////////////////////////
//
//	US_Startup() - Starts the User Mgr
//
///////////////////////////////////////////////////////////////////////////
void
US_Startup(void)
{
	int	i,n;

	if (US_Started)
		return;

	harderr(USL_HardError);	// Install the fatal error handler

	US_InitRndT(true);		// Initialize the random number generator

	for (i = 1;i < _argc;i++)
	{
		switch (US_CheckParm(_argv[i],ParmStrings2))
		{
		case 0:
			compatability = true;
			break;
		case 1:
			compatability = false;
			break;
		}
	}

	// Check for TED launching here
	for (i = 1;i < _argc;i++)
	{
		n = US_CheckParm(_argv[i],ParmStrings);
		switch(n)
		{
		 case 0:
		   tedlevelnum = atoi(_argv[i + 1]);
		   if (tedlevelnum >= 0)
		     tedlevel = true;
		   break;

		 case 1:
		   NoWait = true;
		   break;
		}
	}

	US_Started = true;
}
示例#7
0
void SetupGameLevel (void)
{
	int	x,y,i;
	unsigned	far *map,tile,spot;


	if (!loadedgame)
	{
	 gamestate.TimeCount=
	 gamestate.secrettotal=
	 gamestate.killtotal=
	 gamestate.treasuretotal=
	 gamestate.secretcount=
	 gamestate.killcount=
	 gamestate.treasurecount=0;
	}

	if (demoplayback || demorecord)
		US_InitRndT (false);
	else
		US_InitRndT (true);

//
// load the level
//
	CA_CacheMap (gamestate.mapon+10*gamestate.episode);
	mapon-=gamestate.episode*10;

	mapwidth = mapheaderseg[mapon]->width;
	mapheight = mapheaderseg[mapon]->height;

	if (mapwidth != 64 || mapheight != 64)
		Quit ("Map not 64*64!");


//
// copy the wall data to a data segment array
//
	memset (tilemap,0,sizeof(tilemap));
	memset (actorat,0,sizeof(actorat));
	map = mapsegs[0];
	for (y=0;y<mapheight;y++)
		for (x=0;x<mapwidth;x++)
		{
			tile = *map++;
			if (tile<AREATILE)
			{
			// solid wall
				tilemap[x][y] = tile;
				(unsigned)actorat[x][y] = tile;
			}
			else
			{
			// area floor
				tilemap[x][y] = 0;
				(unsigned)actorat[x][y] = 0;
			}
		}

//
// spawn doors
//
	InitActorList ();			// start spawning things with a clean slate
	InitDoorList ();
	InitStaticList ();

	map = mapsegs[0];
	for (y=0;y<mapheight;y++)
		for (x=0;x<mapwidth;x++)
		{
			tile = *map++;
			if (tile >= 90 && tile <= 101)
			{
			// door
				switch (tile)
				{
				case 90:
				case 92:
				case 94:
				case 96:
				case 98:
				case 100:
					SpawnDoor (x,y,1,(tile-90)/2);
					break;
				case 91:
				case 93:
				case 95:
				case 97:
				case 99:
				case 101:
					SpawnDoor (x,y,0,(tile-91)/2);
					break;
				}
			}
		}

//
// spawn actors
//
	ScanInfoPlane ();

//
// take out the ambush markers
//
	map = mapsegs[0];
	for (y=0;y<mapheight;y++)
		for (x=0;x<mapwidth;x++)
		{
			tile = *map++;
			if (tile == AMBUSHTILE)
			{
				tilemap[x][y] = 0;
				if ( (unsigned)actorat[x][y] == AMBUSHTILE)
					actorat[x][y] = NULL;

				if (*map >= AREATILE)
					tile = *map;
				if (*(map-1-mapwidth) >= AREATILE)
					tile = *(map-1-mapwidth);
				if (*(map-1+mapwidth) >= AREATILE)
					tile = *(map-1+mapwidth);
				if ( *(map-2) >= AREATILE)
					tile = *(map-2);

				*(map-1) = tile;
			}
		}



//
// have the caching manager load and purge stuff to make sure all marks
// are in memory
//
	CA_LoadAllSounds ();

}
示例#8
0
WLUser::WLUser()
{
    US_InitRndT(true);
}