コード例 #1
0
ファイル: World.cpp プロジェクト: whitelight2134/spacewar
void World::initResource()
{
	// skybox
	skybox.init("SkyBox", Const::SKYBOX_SIZE);
	// ring
	ring.init("Ring", Const::RING_SCALE);
	// particles
	Particles::loadResource();
	initPlanets();
	initShips();
	initBullets();
}
コード例 #2
0
ファイル: simulation.c プロジェクト: b00s1/NewtonWars
void reinitialize(void)
{
   int pl;
   initPlanets();
   for(pl = 0; pl < conf.maxPlayers; ++pl)
   {
      if(player[pl].active)
      {
         initPlayer(pl, 1);
         allSendPlayerPos(pl);
      }
   }
}
コード例 #3
0
ファイル: redraw.c プロジェクト: timothyzillion/netrek
intrupt(fd_set * readfds)
{
  time_t  time(time_t *);
  unsigned long t;

  udcounter++;

#ifdef RECORDGAME
  if (playback)
    needredraw |= readFromFile();
  else
#endif

    needredraw |=

  readFromServer(readfds);

  t = msetime();
  if (needredraw && (t >= lastredraw + redrawDelay * 100))
    {
      lastredraw = t;
      needredraw = 0;
      lastread = time(NULL);
      redraw();

      updateMaxStats(0);       /* Update the max stats * *
              * <isae> */

#ifdef WIN32
      W_FlushScrollingWindow(messwa);
      W_FlushScrollingWindow(messwt);
      W_FlushScrollingWindow(messwi);
      W_FlushScrollingWindow(messwk);
      W_FlushScrollingWindow(reviewWin);
      W_FlushScrollingWindow(phaserwin);
#endif

      UpdatePlayerList();
    }

  if (reinitPlanets)
    {
      initPlanets();
      reinitPlanets = 0;
    }

  if (me->p_status == POUTFIT)
    {
      death();
    }
}
コード例 #4
0
ファイル: simulation.c プロジェクト: b00s1/NewtonWars
void initSimulation(void)
{
   int sh, pl;
   
   planet = malloc(conf.numPlanets * sizeof(SimPlanet));
   initPlanets();
   player = malloc(conf.maxPlayers * sizeof(SimPlayer));
   for(pl = 0; pl < conf.maxPlayers; ++pl)
   {
      SimPlayer* p = &(player[pl]);
      p->shot = malloc(conf.numShots * sizeof(SimShot));
      for(sh = 0; sh < conf.numShots; ++sh)
      {
         SimShot* s = &(p->shot[sh]);
         s->dot = malloc(conf.maxSegments * sizeof(Vec2f));
         s->missile.live = 0;
         s->length = 0;
      }
      p->active = 0;
   }
   killflash = 0.0;
}