bool game_cl_ArtefactHunt::NeedToSendReady_Spectator(int key, game_PlayerState* ps)
{
	CStringTable		st;
	bool res = ( GAME_PHASE_PENDING	== Phase() && kWPN_FIRE == key) || 
		( (kJUMP == key) && GAME_PHASE_INPROGRESS==Phase() && 
		CanBeReady());

	if ((Phase() == GAME_PHASE_INPROGRESS) &&  
		(kJUMP==key) &&
		m_cl_dwWarmUp_Time)
	{
		return res;
	}
	
	if ((GAME_PHASE_INPROGRESS==Phase()) && (kJUMP==key) &&
		(iReinforcementTime!=0) && 
		(!m_game_ui->m_pBuySpawnMsgBox->IsShown()) && 
		local_player && (local_player->money_for_round+m_iSpawn_Cost)>=0) 
	{
		string1024				BuySpawnText;
		xr_sprintf				(BuySpawnText, *st.translate("mp_press_yes2pay"), 
								abs(local_player->money_for_round), abs(m_iSpawn_Cost));
		m_game_ui->m_pBuySpawnMsgBox->SetText(BuySpawnText);

		if (m_bTeamSelected && m_bSkinSelected)
			m_game_ui->m_pBuySpawnMsgBox->ShowDialog(true);

		return false;
	};
	return res;
}
Esempio n. 2
0
/************** merge PWAD IWAD directory module ****************/
void ADDallSpriteFloor(const char *wadout, const char *doomwad, const char
    *wadres,NTRYB select)
{
  struct WADINFO iwad;
  struct WADINFO pwad;
  struct WADINFO rwad;
  Int16 n;
  ENTRY  *iiden;      /*identify entry in IWAD*/
  ENTRY  *piden;      /*identify entry in PWAD*/
  Int32 start,size,ostart,osize;
  Int16 pnm;char  *Pnam;Int32 Pnamsz;
  struct WADDIR  *NewDir;Int32 NewNtry;

  Phase("ME88", "Copying sprites and/or flats");
  Phase("ME88", " from iwad %s", fname (doomwad));
  Phase("ME88", " and  pwad %s", fname (wadres));
  Phase("ME88", " into pwad %s", fname (wadout));
  /* get iwad directory, and identify */
  iwad.ok=0;
  WADRopenR(&iwad,doomwad);
  /*find PNAMES*/
  pnm=WADRfindEntry(&iwad,"PNAMES");
  if(pnm<0) ProgError("ME91", "Can't find PNAMES in main WAD");
  Pnam=WADRreadEntry(&iwad,pnm,&Pnamsz);
  /* identify iwad*/
  iiden=IDENTentriesIWAD(&iwad, Pnam, Pnamsz,TRUE);
  /* get pwad directory, and identify*/
  pwad.ok=0;
  WADRopenR(&pwad,wadres);
  piden=IDENTentriesPWAD(&pwad, Pnam, Pnamsz);
  /**/
  Free(Pnam);
  /*where to put pwad? at pwadstart*/
  if((iwad.maxpos|pwad.maxpos)&EXTERNAL )Bug("ME94", "AddExt");
  /* merge the two directories */
  NewDir=LISmergeDir(&NewNtry,TRUE,TRUE,select,&iwad,iiden,EXTERNAL,&pwad,piden,0);
  /* create a new PWAD*/
  rwad.ok=0;
  WADRopenW(&rwad,wadout,PWAD, 1);
  for(n=0;n<NewNtry;n++)
  { ostart=NewDir[n].start;
    osize=NewDir[n].size;
    WADRalign4(&rwad);
    start=WADRposition(&rwad);
    if(ostart&EXTERNAL)
      size=WADRwriteWADbytes(&rwad,&iwad,ostart&(~EXTERNAL),osize);
    else
      size=WADRwriteWADbytes(&rwad,&pwad,ostart,osize);
    WADRdirAddEntry(&rwad,start,size,NewDir[n].name);
  }
  Free(NewDir);
  /*close files memory*/
  WADRclose(&iwad);
  WADRclose(&pwad);
  WADRwriteDir(&rwad, 1);
  WADRclose(&rwad);
  Phase("ME98", "Addition of sprites and floors is complete");
}
Esempio n. 3
0
/*verifica che la valutazione del bianco e del nero sia simmetrica*/
void test_eval() {
	/* Materiale:equal
	 KS:equal OK
	 PS:black (White isolated and hang)*/
	char p[] = "2rq1rk1/pb2bppp/1pn1p3/2p5/3P4/P1PBPN2/1B2QPPP/3R1RK1 w - - 0 1";
	/*char fp[]="3r1rk1/1b2qppp/p1pbpn2/3p4/2P5/1PN1P3/PB2BPPP/2RQ1RK1 w - - 0 1";*/
	/*char p[] = "8/PPP4k/8/8/8/8/4Kppp/8 w - - ";*/

/*	 Materiale:black (bishop pair)
	 KS:equal
	 PS:black (white weak white squares)*/
	 /*char p[]="rnbqkb1r/pppp1ppp/8/4P3/3P4/3Q4/PP3PPP/RNB1K1NR b KQkq - 0 1";*/

	/* Materiale:black (bishop pair)
	 KS:equal
	 PS:black (white weak white squares isol back)*/
	/*char p[]="r2qkb1r/1p1b3p/p3ppp1/2p5/2P5/4P2Q/PB1P1PPP/RN3RK1 b k - 0 1";*/
	

	/* Materiale:equal
	 KS:equal
	 PS:equal*/
	/*char p[]="r2q1rk1/pb1nbppp/1p2pn2/8/1P6/P4NP1/1B1NPPBP/R2Q1RK1 w - - 0 0";*/

	/* Materiale:
	 KS:black
	 PS:black--->sbagliato*/
	/*char p[]="2br1rk1/pp2bppp/3p2n1/3P4/4P1n1/1B3NN1/PP1B2PP/R3R1K1 w - - 0 0";*/

	/* Materiale:
	 KS:white
	 PS:*/
	/*char p[]="R1n5/5rkp/3p2p1/2rNpq2/1NP4b/7P/4QPP1/5RK1 b - - 0 1";*/

	int score;
	  
	set_position(p);
	init_data();
	print_board();
	print_bitboard();
	/*Precalcoliamo*/
	Phase(WHITE) = eval_phase(WHITE);
	Phase(BLACK) = eval_phase(BLACK);
	score = eval(0);
	printf("eval %d\n", score);

	/*set_position(fp);
	init_data();
	print_board();
	print_bitboard();
	Phase(WHITE)=eval_phase(WHITE);
	Phase(BLACK)=eval_phase(BLACK);
	score=eval(0);
	printf("eval %d",score);*/
}
TDSPVector* TDSPBlockOperation::Sum2PhaseDiff(Int_t       bl,
					      TDSPVector *in1, 
					      TDSPVector *in2, 
					      TDSPVector *result,
					      TComplex    scaler) {
  
  
  Int_t     len1  = in1->GetLen();
  TComplex  *iv1  = in1->GetVec();


  Int_t     len2  = in1->GetLen();
  TComplex  *iv2  = in2->GetVec();

  if (len1!=len2) {
    Warning("Sum2PhaseDiff","input length differ (%d<>%d)",len1,len2);
  }

  if (len1%bl) {
    Warning("Sum2PhaseDiff","length of input vector1 (%d) is not a multiple of the block len (%d)!",len1,bl);
  }

  if (len2%bl) {
    Warning("Sum2PhaseDiff","length of input vector2 (%d) is not a multiple of the block len (%d)!",len2,bl);
  }

  Int_t len=TMath::Min(len1,len2);

  if (!result) result = new TDSPVector();
  result->SetLen(bl);
  TComplex  *ov = result->GetVec();
  
  result->Zeros();
  Double_t tmp;
  if (scaler==1.) {
    for(register Int_t i=0;i<len;++i) {
      tmp       = Phase(iv1[i]%iv2[i]);
      ov[i%bl] += tmp*tmp;
    }
  } else {
    for(register Int_t i=0;i<len;++i) {
      tmp       = Phase(iv1[i]%(scaler*iv2[i]));
      ov[i%bl] += tmp*tmp;
    }
  }

  return result;
}
Esempio n. 5
0
void CGameGraphBuilder::build_graph			(
#ifdef PRIQUEL
		LPCSTR graph_name,
		LPCSTR cross_table_name,
#endif // PRIQUEL
		LPCSTR level_name
	)
{
	Phase					("Building level game graph");
	Msg						("level \"%s\"",level_name);

#ifdef PRIQUEL
	m_graph_name			= graph_name;
	m_cross_table_name		= cross_table_name;
#endif // PRIQUEL
	m_level_name			= level_name;
	
//	CTimer					timer;
//	timer.Start				();

	create_graph			(0.000000f,0.000047f);
//	Msg						("%f",timer.GetElapsed_sec());
	load_level_graph		(0.000047f,0.002470f);
//	Msg						("%f",timer.GetElapsed_sec());
	load_graph_points		(0.002517f,0.111812f);
//	Msg						("%f",timer.GetElapsed_sec());
	build_cross_table		(0.114329f,0.773423f);
//	Msg						("%f",timer.GetElapsed_sec());
	build_graph				(0.887752f,0.112248f);
//	Msg						("%f",timer.GetElapsed_sec());

	Msg						("Level graph is generated successfully");
}
BOOL game_cl_ArtefactHunt::CanCallBuyMenu			()
{
	if (!m_bBuyEnabled) return FALSE;
	if (Phase()!=GAME_PHASE_INPROGRESS) return false;

	if (!is_buy_menu_ready())
		return FALSE;
	
	if (m_game_ui->m_pUITeamSelectWnd && m_game_ui->m_pUITeamSelectWnd->IsShown())
	{
		return FALSE;
	};
	if (pCurSkinMenu && pCurSkinMenu->IsShown())
	{
		return FALSE;
	};
	if ( m_game_ui && m_game_ui->GetActorMenu().IsShown() )
	{
		return FALSE;
	}
	/*if (m_game_ui->m_pInventoryMenu && m_game_ui->m_pInventoryMenu->IsShown())
	{
		return FALSE;
	};*/

	CActor* pCurActor = smart_cast<CActor*> (Level().CurrentEntity());
	if (!pCurActor || !pCurActor->g_Alive()) return FALSE;

	return TRUE;
};
Esempio n. 7
0
BOOL game_cl_Deathmatch::CanCallBuyMenu			()
{
	if (Phase()!=GAME_PHASE_INPROGRESS) return false;

	if (!is_buy_menu_ready())
		return FALSE;

	if (Level().CurrentEntity() && !smart_cast<CSpectator*>(Level().CurrentEntity()))
	{
		return FALSE;
	};
	if (!m_bSkinSelected || m_bSpectatorSelected) return FALSE;
	if (pCurSkinMenu && pCurSkinMenu->IsShown())
	{
		return FALSE;
	};
	if ( m_game_ui && m_game_ui->ActorMenu().IsShown() )
	{
		return FALSE;
	}
	/*if (m_game_ui->m_pInventoryMenu && m_game_ui->m_pInventoryMenu->IsShown())
	{
		return FALSE;
	};*/
	return m_bBuyEnabled;
};
Esempio n. 8
0
 Phase BodyStateEquation::operator()(const Phase &y) const {
     glm::vec3 force = m_body.netForce();
     for (auto&& c : m_body.m_constraints) {
         force += c.force(y.position, c.attachedTo().position());
     }
     return Phase(y.momentum / m_body.mass(), force);
 }
Esempio n. 9
0
void game_sv_GameState::Update		()
{
	struct ping_filler
	{
		void operator()(IClient* client)
		{
			xrClientData*	C			= static_cast<xrClientData*>(client);
			if (!C->ps)
				return;
			C->ps->ping					= u16(C->stats.getPing());
		}
	};
	ping_filler tmp_functor;
	m_server->ForEachClientDo(tmp_functor);
	
	if (!IsGameTypeSingle() && (Phase() == GAME_PHASE_INPROGRESS))
	{
		m_item_respawner.update(Level().timeServer());
	}
	
	if (!g_dedicated_server)
	{
		if (Level().game) {
			CScriptProcess				*script_process = ai().script_engine().script_process(ScriptEngine::eScriptProcessorGame);
			if (script_process)
				script_process->update	();
		}
	}
}
Esempio n. 10
0
        void MovementInform(uint32 type, uint32 id) override
        {
            if (type != POINT_MOTION_TYPE)
                return;

            uint8 nextBossId = 0;
            switch (id)
            {
                case PHASE_FRENZIED_WORGEN:
                    nextBossId = DATA_FRENZIED_WORGEN;
                    break;
                case PHASE_RAVENOUS_FURLBORG:
                    nextBossId = DATA_RAVENOUS_FURBOLG;
                    break;
                case PHASE_MASSIVE_JORMUNGAR:
                    nextBossId = DATA_MASSIVE_JORMUNGAR;
                    break;
                case PHASE_FEROCIOUS_RHINO:
                    nextBossId = DATA_FEROCIOUS_RHINO;
                    break;
                case PHASE_GORTOK_PALEHOOF:
                    nextBossId = DATA_GORTOK_PALEHOOF;
                    break;
                default:
                    return;
            }

            if (Creature* nextBoss = ObjectAccessor::GetCreature(*me, instance->GetGuidData(nextBossId)))
                DoCast(nextBoss, SPELL_ORB_CHANNEL, false);

            currentPhase = Phase(id);
            SummonTimer = 5000;
        }
Esempio n. 11
0
        void Reset() override
        {
            _Reset();

            /// There is a good reason to store them like this, we are going to shuffle the order.
            for (uint32 i = PHASE_FRENZIED_WORGEN; i < PHASE_GORTOK_PALEHOOF; ++i)
                Sequence[i] = Phase(i);

            /// This ensures a random order and only executes each phase once.
            std::random_shuffle(Sequence, Sequence + PHASE_GORTOK_PALEHOOF);

            uiArcingSmashTimer = 15000;
            uiImpaleTimer = 12000;
            uiWhiteringRoarTimer = 10000;

            me->GetMotionMaster()->MoveTargetedHome();

            AddCount = 0;

            currentPhase = PHASE_NONE;

            for (uint8 i = DATA_FRENZIED_WORGEN; i <= DATA_FEROCIOUS_RHINO; ++i)
                if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetData64(i)))
                    if (!temp->IsAlive())
                        temp->Respawn();

            if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_GORTOK_PALEHOOF_SPHERE)))
            {
                go->SetGoState(GO_STATE_READY);
                go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
            }
        }
Esempio n. 12
0
void game_cl_Deathmatch::net_import_state	(NET_Packet& P)
{
	inherited::net_import_state	(P);

	m_s32FragLimit				= P.r_s32();
	m_s32TimeLimit				= P.r_s32() * 60000;
	m_u32ForceRespawn			= P.r_u32() * 1000;
	m_cl_dwWarmUp_Time			= P.r_u32();
	m_bDamageBlockIndicators	= !!P.r_u8();
	// Teams
	u16							t_count;
	P.r_u16						(t_count);
	teams.clear					();

	for (u16 t_it=0; t_it<t_count; ++t_it)
	{
		game_TeamState	ts;
		P.r				(&ts,sizeof(game_TeamState));
		teams.push_back	(ts);
	};

	switch (Phase())
	{
	case GAME_PHASE_PLAYER_SCORES:
		{
			P.r_stringZ(WinnerName);
			bool NeedSndMessage = (xr_strlen(WinnerName) != 0);
			if (NeedSndMessage && local_player && !xr_strcmp(WinnerName, local_player->getName()))
			{
				PlaySndMessage(ID_YOU_WON);
			}
		}break;
	}
}
Esempio n. 13
0
 Medium(std::vector<std::size_t> const& phases_)
     : property(MPL::number_of_properties)
 {
     for (auto p : phases_)
     {
         phases.push_back(Phase(p));
     }
 }
Esempio n. 14
0
void CBuild::Light()
{
	//****************************************** Implicit
	{
		FPU::m64r		();
		Phase			("LIGHT: Implicit...");
		mem_Compact		();
		ImplicitLighting();
	}

	//****************************************** Lmaps
	{
		FPU::m64r		();
		Phase			("LIGHT: LMaps...");
		mem_Compact		();

		// Randomize deflectors
		std::random_shuffle	(g_deflectors.begin(),g_deflectors.end());
		for					(u32 dit = 0; dit<g_deflectors.size(); dit++)	task_pool.push_back(dit);

		// Main process (4 threads)
		Status			("Lighting...");
		CThreadManager	threads;
		const	u32	thNUM	= 6;
		CTimer	start_time;	start_time.Start();				
		for				(int L=0; L<thNUM; L++)	threads.start(xr_new<CLMThread> (L));
		threads.wait	(500);
		clMsg			("%f seconds",start_time.GetElapsed_sec());
	}

	//****************************************** Vertex
	FPU::m64r		();
	Phase			("LIGHT: Vertex...");
	mem_Compact		();

	LightVertex		();

	//****************************************** Merge LMAPS
	{
		FPU::m64r		();
		Phase			("LIGHT: Merging lightmaps...");
		mem_Compact		();

		xrPhase_MergeLM	();
	}
}
Esempio n. 15
0
Phase game_phase(const Position& pos) {

  Value npm = pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK);

  return  npm >= MidgameLimit ? PHASE_MIDGAME
        : npm <= EndgameLimit ? PHASE_ENDGAME
        : Phase(((npm - EndgameLimit) * 128) / (MidgameLimit - EndgameLimit));
}
Esempio n. 16
0
void CFontControl::UpdateModelL()
	{
	// set up zoom factor & graphics device map for getting fonts and drawing text
	iZoomFactor.SetGraphicsDeviceMap(iCoeEnv->ScreenDevice());
	iZoomFactor.SetZoomFactor(TZoomFactor::EZoomOneToOne);
	iDeviceMap = &iZoomFactor;

	// find the font to display this phase
	TTypefaceSupport* myTypefaceSupport = new TTypefaceSupport;
	iCoeEnv->ScreenDevice()->TypefaceSupport(*myTypefaceSupport, Phase());
	iCurrentFont = myTypefaceSupport->iTypeface.iName.Des();
	// set up descriptor for commentary area
	_LIT(KFormat,"Typeface index=%d. Name=%S. Num heights=%d. (Num typefaces=%d)");
	TBuf<128> commentaryText;
	commentaryText.Format(KFormat, Phase(), &iCurrentFont,
			myTypefaceSupport->iNumHeights, iNumTypefaces);
	iGraphObserver->NotifyStatus(commentaryText);
	delete myTypefaceSupport;
	}
Esempio n. 17
0
 Phase
 ConfigFlagsTable::GetPhase(__in LPCWSTR str)
 {
     for(int i=0; i < PhaseCount; i++)
     {
         if(0 == _wcsicmp(str, PhaseNames[i]))
         {
             return Phase(i);
         }
     }
     return InvalidPhase;
 }
Esempio n. 18
0
void CHelloControl::UpdateModelL()
	{
	switch (Phase())
		{
		case 0:
			{
			iGraphObserver->NotifyStatus(KTxtUpdateModelEnglish);
			}
			break;
			
		case 1:
			{
			iGraphObserver->NotifyStatus(KTxtUpdateModelFrench);
			}
			break;
			
		case 2:
			{
			iGraphObserver->NotifyStatus(KTxtUpdateModelGerman);
			}
			break;
			
		case 3:
			{
			iGraphObserver->NotifyStatus(KTxtUpdateModelItalian);
			}
			break;
			
		case 4:
			{
			iGraphObserver->NotifyStatus(KTxtUpdateModelTurkish);
			}
			break;
			
		case 5:
			{
			iGraphObserver->NotifyStatus(KTxtUpdateModelJapanese);
			}
			break;
			
		case 6:
			{
			iGraphObserver->NotifyStatus(KTxtUpdateModelShakespearian);
			}
			break;
			
		default:
			{
			iGraphObserver->NotifyStatus(KTxtUpdateModelOverrun);
			}
			break;
		};
	}
Esempio n. 19
0
/*
** -app complete a PWAD with DOOM entries
**
*/
void ADDappendSpriteFloor(const char *doomwad, const char *wadres,NTRYB select)
{
  struct WADINFO iwad;
  struct WADINFO pwad;
  ENTRY  *iiden;      /*identify entry in IWAD*/
  ENTRY  *piden;      /*identify entry in PWAD*/
  Int16 pnm;char  *Pnam;Int32 Pnamsz;
  Int32 dirpos,ntry,psize,time;
  struct WADDIR  *NewDir;Int32 NewNtry;
  Phase("ME52", "Appending sprites and/or flats");
  Phase("ME52", " from iwad %s", fname (doomwad));
  Phase("ME52", " to   pwad %s", fname (wadres));
  /* get iwad directory, and identify */
  iwad.ok=0;
  WADRopenR(&iwad,doomwad);
  /*find PNAMES*/
  pnm=WADRfindEntry(&iwad,"PNAMES");
  if(pnm<0) ProgError("ME61", "Can't find PNAMES in iwad");
  Pnam=WADRreadEntry(&iwad,pnm,&Pnamsz);
  /* identify iwad*/
  iiden=IDENTentriesIWAD(&iwad, Pnam, Pnamsz,TRUE);
  /* get pwad directory, and identify*/
  pwad.ok=0;
  WADRopenR(&pwad,wadres);
  piden=IDENTentriesPWAD(&pwad, Pnam, Pnamsz);
  /**/
  Free(Pnam);
  /* merge the two directories */
  NewDir=LISmergeDir(&NewNtry,TRUE,TRUE,select,&iwad,iiden,EXTERNAL,&pwad,piden,0);
  /* prepare for append*/
  time=WADRprepareAppend(wadres,&pwad,NewDir,NewNtry,&dirpos,&ntry,&psize);
  /* append DOOM sprites to PWAD*/
  HDRplunderWad(&pwad,&iwad);
  /* set dir */
  HDRsetDir(&pwad,FALSE,FALSE,time,dirpos,ntry,psize,-1,-1,doomwad);
  /* close */
  WADRclose(&iwad);
  WADRclose(&pwad);
}
Esempio n. 20
0
 Phase
 Phases::GetFirstPhase()
 {
     int i= -1;
     while(!this->phaseList[++i].valid)
     {
         if(i >= PhaseCount - 1)
         {
             return InvalidPhase;
         }
     }
     return Phase(i);
 }
Esempio n. 21
0
void xrCompiler	(LPCSTR name, bool draft_mode, LPCSTR out_name)
{
	Phase		("Loading level...");
	xrLoad		(name,draft_mode);
	mem_Optimize();

//	Phase("Building nodes...");
//	xrBuildNodes();
//	Msg("%d nodes created",int(g_nodes.size()));
//	mem_Optimize();
//	
//	Phase("Smoothing nodes...");
//	xrSmoothNodes();
//	mem_Optimize();
	
	if (!draft_mode) {
		Phase("Lighting nodes...");
		xrLight		();
		//	xrDisplay	();
		mem_Optimize();

		Phase("Calculating coverage...");
		xrCover		();
		mem_Optimize();
	}
	/////////////////////////////////////

//	Phase("Palettizing cover values...");
//	xrPalettizeCovers();
//	mem_Optimize();

//	Phase("Visualizing nodes...");
//	xrDisplay	();

	Phase("Saving nodes...");
	xrSaveNodes	(name,out_name);
	mem_Optimize();
}
Esempio n. 22
0
void CHelloControl::Draw(const TRect& /* aRect */) const
	{
	// draw surrounding rectangle
	SystemGc().DrawRect(Rect());
	// calculate rectangle to draw into
	TRect rect = Rect();
	rect.Shrink(1, 1);
	// calculate vertical centering
	CFont *font = iMessageFont;
	TInt ascent = (rect.Height() - font->HeightInPixels()) / 2
			+ font->AscentInPixels();
	// draw text in rectangle
	CWindowGc& gc = SystemGc();
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
	gc.UseFont(iMessageFont);
	switch (Phase())
		{
		case 0:
			gc.DrawText(KTxtDrawCase0, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 1:
			gc.DrawText(KTxtDrawCase1, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 2:
			gc.DrawText(KTxtDrawCase2, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 3:
			gc.DrawText(KTxtDrawCase3, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 4:
			gc.DrawText(KTxtDrawCase4, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 5:
			gc.DrawText(KTxtDrawCase5, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 6:
			gc.DrawText(KTxtDrawCase6, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		default:
			break;
		};
	}
Esempio n. 23
0
/* This function returns 0, or -1 if the sprite died */
int 
Object::Move(int Frozen)		// This is called every timestep.
{
	if ( ! Frozen )
		SetPos(x+xvec, y+yvec);

	/* Phase, but don't draw our new position */
	Phase();

	/* Does this object have a lifetime? */
	if ( TTL && (--TTL == 0) ) {	// This sprite died...
		return(BeenTimedOut());
	}
	return(0);
}
Esempio n. 24
0
        void Initialize()
        {
            /// There is a good reason to store them like this, we are going to shuffle the order.
            for (uint32 i = PHASE_FRENZIED_WORGEN; i < PHASE_GORTOK_PALEHOOF; ++i)
                Sequence[i] = Phase(i);

            /// This ensures a random order and only executes each phase once.
            std::random_shuffle(Sequence, Sequence + PHASE_GORTOK_PALEHOOF);

            uiArcingSmashTimer = 15000;
            uiImpaleTimer = 12000;
            uiWhiteringRoarTimer = 10000;

            AddCount = 0;

            currentPhase = PHASE_NONE;
        }
Esempio n. 25
0
void game_sv_TeamDeathmatch::Update()
{
    inherited::Update();
    switch(Phase())
    {
    case GAME_PHASE_TEAM1_SCORES :
    case GAME_PHASE_TEAM2_SCORES :
    case GAME_PHASE_TEAMS_IN_A_DRAW :
    {
        if ( m_delayedRoundEnd && m_roundEndDelay < Device.TimerAsync() )
        {
            OnRoundEnd(); // eRoundEnd_Finish
        }
    }
    break;
    };
}
Esempio n. 26
0
BOOL game_cl_Deathmatch::CanCallInventoryMenu			()
{
	if (Phase()!=GAME_PHASE_INPROGRESS) return false;
	if (Level().CurrentEntity() && !smart_cast<CActor*>(Level().CurrentEntity()))
	{
		return FALSE;
	}
	if (pCurSkinMenu && pCurSkinMenu->IsShown())
	{
		return FALSE;
	};
	if (local_player->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD))
	{
		return FALSE;
	}
	return TRUE;
};
Esempio n. 27
0
/*
**  Take some entries from a WAD
*/
static void HDRplunderWad(struct WADINFO *rwad,struct WADINFO *ewad)
{ char  *data;
  Int32 wsize,sz=0;
  Int32 ostart,osize;
  Int16 n;
  Int32 oldfilesz;
  /*
  ** calculate required size
  */
  oldfilesz=WADRposition(rwad); /*old file size*/
  /*
  ** copy entries from WAD
  */
  Phase("ME10", "Copying entries from wad (please wait)");
  data = (char  *)Malloc(MEMORYCACHE);
  for(n=0;n<(rwad->ntry);n++)
  {
    /*if((n&0x7F)==0) Phase("."); FIXME need /dev/tty output */
    ostart=rwad->dir[n].start;
    osize=rwad->dir[n].size;
    /*detect external entries */
    if(ostart&EXTERNAL)
    { /*update new directory*/
      WADRalign4(rwad);
      rwad->dir[n].start=WADRposition(rwad);
      /*get entry size*/
      if(osize>0)
      { /*copy old entry */
	WADRseek(ewad,ostart&(~EXTERNAL));
	for(wsize=0;wsize<osize;wsize+=sz)
	{ sz=(osize-wsize>MEMORYCACHE)? MEMORYCACHE:osize-wsize;
	  WADRreadBytes(ewad,data,sz);
	  if(WADRwriteBytes2(rwad,data,sz)<0)
	  { WADRchsize(rwad,oldfilesz);
	    ProgError("ME13", "Not enough disk space");
	    break;
	  }
	}
      }
    }
  }
  /*Phase("\n"); FIXME need /dev/tty output */
  Free(data);
}
Esempio n. 28
0
void SinusFitter::FindPhaseAndAmplitude(num_t &phase, num_t &amplitude, const num_t *dataX, const num_t *dataT, const size_t dataSize, const num_t frequency) const throw()
{
	// calculate 1/N * \sum_t x(t) e^{-i * frequency * t}
	num_t sumR = 0.0L, sumI = 0.0L;
	for(unsigned i=0;i<dataSize;++i)
	{
		const num_t t = dataT[i];
		const num_t x = dataX[i];
		
		sumR += x * cosn(-t * frequency);
		sumI += x * sinn(-t * frequency);
	}

	sumR /= (num_t) dataSize;
	sumI /= (num_t) dataSize;

	phase = Phase(sumR, sumI);
	amplitude = 2.0L * sqrtn(sumR*sumR + sumI*sumI);
}
Esempio n. 29
0
BOOL game_cl_TeamDeathmatch::CanCallTeamSelectMenu			()
{
	if (Phase()!=GAME_PHASE_INPROGRESS) return false;
	if (!local_player) return false;
	if (m_game_ui->m_pInventoryMenu && m_game_ui->m_pInventoryMenu->IsShown())
	{
		return FALSE;
	};
	if (pCurBuyMenu && pCurBuyMenu->IsShown())
	{
		return FALSE;
	};
	if (pCurSkinMenu && pCurSkinMenu->IsShown())
	{
		return FALSE;
	};

	m_game_ui->m_pUITeamSelectWnd->SetCurTeam(ModifyTeam(local_player->team));
	return TRUE;	
};
Esempio n. 30
0
AFComplexVector<fftw_complex, double>& AFComplexVector<fftw_complex, double>::ToPolar()
{
    assert(!m_bIsPolar);
    /*
     * It overwrites the input vector U with its own polar
     * complex coordinates.
     * Here the fftwf_complex type is reinterpretated from Re,Im, to Mag,Phase
     */
    fftw_complex cpxTmp;
    
    for(AFSampleCount i = 1; i < (m_smpcLength-1); i++)
    {
        Mag(cpxTmp) = Magnitude(m_pcpxUf[i]);
        Ph(cpxTmp)  = -Phase(m_pcpxUf[i]);
        Mag(m_pcpxUf[i]) = Mag(cpxTmp);
        Ph(m_pcpxUf[i])  = Ph(cpxTmp);
    }
    m_bIsPolar = true;
    return *this;
}