示例#1
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CUICreateChar::Reset()
{	
	Lock(FALSE);
	m_iSelectedJob	= 0;	
	m_fZDelta		= 0.0f;
	m_fRotDelta		= 0.0f;

	m_ebCharName.ResetString();

	// 카메라 설정, 캐릭터 위치 설정.	
	for(int i = 0; i < MAXJOB; ++i)
	{
		const int iMarker			= _aiMarkerEntities[i];
		CEntity *penMarker			= m_pWorld->EntityFromID(iMarker);	
		penMarker->SetSkaModel(JobInfo().GetFileName(i));
		g_CharacterAngle[i] = penMarker->GetPlacement().pl_OrientationAngle(1);
		
		CModelInstance* pMI	= penMarker->GetModelInstance();
		if(pMI)
		{		
			INDEX idAttackIdle = ska_GetIDFromStringTable( JobInfo().GetAnimationName( i, ANIM_IDLE ) );
			pMI->AddAnimation(idAttackIdle, AN_LOOPING|AN_NORESTART|AN_CLEAR, 1, 0);
		}
	}
	
#if defined(G_BRAZIL) 
		CharWearing();
#endif
	ChangeSelJob();

	m_bIsShowMessageInfo = _pGameState->IsCreatableNightShadow();
}
 // Terminate thread
 void setTerminated() {
     terminate();
     // notify the thread so it dies.
     m_jobs.push( JobInfo() );
     delete m_processor;
     m_processor = NULL;
 }
示例#3
0
void JobQueue::schedule(IJob* job, const bool transfer_ownership)
{
    assert(job);

    Spinlock::ScopedLock lock(impl->m_spinlock);

    impl->m_scheduled_jobs.push_back(JobInfo(job, transfer_ownership));
}
示例#4
0
void JobQueue::schedule(IJob* job, const bool transfer_ownership)
{
    assert(job);

    boost::mutex::scoped_lock lock(impl->m_mutex);

    impl->m_scheduled_jobs.push_back(JobInfo(job, transfer_ownership));

    // Notify worker threads that a new scheduled job is available.
    impl->m_event.notify_all();
}
示例#5
0
JobQueue::RunningJobInfo JobQueue::acquire_scheduled_job()
{
    Spinlock::ScopedLock lock(impl->m_spinlock);

    // Bail out if there is no scheduled job.
    if (impl->m_scheduled_jobs.empty())
        return RunningJobInfo(JobInfo(0, false), impl->m_running_jobs.end());

    // Move the next scheduled job to the end of the queue of running jobs.
    const JobInfo job_info = impl->m_scheduled_jobs.front();
    impl->m_scheduled_jobs.pop_front();
    impl->m_running_jobs.push_back(job_info);

    return RunningJobInfo(job_info, pred(impl->m_running_jobs.end()));
}
示例#6
0
JobQueue::RunningJobInfo JobQueue::acquire_scheduled_job_unlocked()
{
    // Bail out if there is no scheduled job.
    if (impl->m_scheduled_jobs.empty())
        return RunningJobInfo(JobInfo(0, false), impl->m_running_jobs.end());

    // Move the next scheduled job to the end of the queue of running jobs.
    const JobInfo job_info = impl->m_scheduled_jobs.front();
    impl->m_scheduled_jobs.pop_front();
    impl->m_running_jobs.push_back(job_info);

    // Notify worker threads that a job has moved from the scheduled to the running state.
    impl->m_event.notify_all();

    return RunningJobInfo(job_info, pred(impl->m_running_jobs.end()));
}
示例#7
0
// ----------------------------------------------------------------------------
// Name : Render()
// Desc :
// ----------------------------------------------------------------------------
void CUICreateChar::Render()
{	
	extern INDEX	sam_bWideScreen;
	CDrawPort* pDrawPort = CUIManager::getSingleton()->GetDrawPort();

	// Set create character textire
	pDrawPort->InitTextureData( m_ptdBaseTexture );
	
	// Character information
	// Top
	pDrawPort->AddTexture( m_rcCharInfo.Left, m_rcCharInfo.Top,
										m_rcCharInfo.Right, m_rcCharInfo.Top + CREATECHAR_INFO_HEIGHT,
										m_rtCharInfoTop.U0, m_rtCharInfoTop.V0,
										m_rtCharInfoTop.U1, m_rtCharInfoTop.V1,
										0xFFFFFFFF );
	// Bottom
	pDrawPort->AddTexture( m_rcCharInfo.Left, m_rcCharInfo.Top + CREATECHAR_INFO_HEIGHT,
										m_rcCharInfo.Right, m_rcCharInfo.Bottom,
										m_rtCharInfoBottom.U0, m_rtCharInfoBottom.V0,
										m_rtCharInfoBottom.U1, m_rtCharInfoBottom.V1,
										0xFFFFFFFF );

	// Character name input box
	m_ebCharName.Render();

	// Job button
	m_btnJobPrev.Render();
	m_btnJobNext.Render();

	// Head button
	m_btnFacePrev.Render();
	m_btnFaceNext.Render();

	// Hair button
	m_btnHairPrev.Render();
	m_btnHairNext.Render();

	// Face button
	//m_btnHeadPrev.Render();
	//m_btnHeadNext.Render();

	// OK button
	m_btnOK.Render();

	// Cancel button
	m_btnCancel.Render();

	// Character control
	/*
	// Zoom in button
	m_btnZoomIn.Render();

	// Zoom out button
	m_btnZoomOut.Render();

	// Rotate to left button
	m_btnRotateToLeft.Render();

	// Rotate to right
	m_btnRotateToRight.Render();
	*/

	// Render all elements
	pDrawPort->FlushRenderingQueue();

	// Render character information
	int	nX = m_rcCharInfo.Left + CREATECHAR_DESC_SX;
	int	nY = m_rcCharInfo.Top + CREATECHAR_DESC_SY;
	for( int iInfo = 0; iInfo < m_nCurInfoLines; iInfo++ )
	{
		pDrawPort->PutTextEx( m_strCharInfo[iInfo], nX, nY, m_colCharInfo[iInfo] );
		nY += _pUIFontTexMgr->GetLineHeight();
	}
	
	// Prepare Rendering Text
	nX = m_rcCharInfo.Left;
	nY = m_rcCharInfo.Top;
	pDrawPort->PutTextEx( _S( 140, "캐릭터 생성" ),
										nX + CREATECHAR_TITLE_OFFSETX, nY + CREATECHAR_TITLE_OFFSETY );
	pDrawPort->PutTextExRX( _S( 71, "이름" ),
											nX + CREATECHAR_NAME_RX, nY + CREATECHAR_NAME_SY );
	pDrawPort->PutTextExRX( _S( 141, "직업" ),
											nX + CREATECHAR_NAME_RX, nY + CREATECHAR_JOB_SY );
	pDrawPort->PutTextExRX( _S( 144, "얼굴" ),		// 얼굴
											nX + CREATECHAR_NAME_RX, nY + CREATECHAR_FACE_SY );
	pDrawPort->PutTextExRX( _S( 143, "헤어" ),		// 헤어
											nX + CREATECHAR_NAME_RX, nY + CREATECHAR_HAIR_SY );
	//pDrawPort->PutTextExRX( _S( 142, "머리" ),		// 머리
	//										nX + CREATECHAR_NAME_RX, nY + CREATECHAR_HEAD_SY );

	// Print Job
	pDrawPort->PutTextExCX( JobInfo().GetName(m_iSelectedJob),
											nX + CREATECHAR_JOB_MAIN_CY, nY + CREATECHAR_JOB_SY );
	// Print Face
	CTString strTemp;
	strTemp.PrintF("%d", m_sbSelectedFace + 1);
	pDrawPort->PutTextExCX( strTemp,
											nX + CREATECHAR_JOB_MAIN_CY, nY + CREATECHAR_FACE_SY );

	strTemp.PrintF("%d", m_sbSelectedHair + 1);
	// Print Hair
	pDrawPort->PutTextExCX( strTemp,
											nX + CREATECHAR_JOB_MAIN_CY, nY + CREATECHAR_HAIR_SY );

	// Print Head
	//pDrawPort->PutTextExCX( CTString( "1" ),
	//										nX + CREATECHAR_JOB_MAIN_CY, nY + CREATECHAR_FACE_SY );

	// Flush all render text queue
	pDrawPort->EndTextEx();

	// Reading window
	if( m_ebCharName.DoesShowReadingWindow() )
	{
		// Set texture
		pDrawPort->InitTextureData( m_ptdBaseTexture );

		// Reading window
		m_ebCharName.RenderReadingWindow();

		// Render all elements
		pDrawPort->FlushRenderingQueue();

		// Flush all render text queue
		pDrawPort->EndTextEx();
	}

	// show night shadow message [11/6/2009 rumist]
	if( m_bIsShowMessageInfo )
	{
		pDrawPort->InitTextureData( m_ptdMsgTexture );
		m_bxNoticeMsg.SetBoxPos(m_rcMessageInfo);
		m_bxNoticeMsg.Render();
		
		// Render all elements
		pDrawPort->FlushRenderingQueue();
		
		m_msgNCText.SetRenderPos( m_rcMessageInfo.Left, m_rcMessageInfo.Top );
		m_msgNCText.Render();
	}
}
示例#8
0
JobInfo dispatchJob(JobFunction job, void* data)
{
   return JobInfo();
}
示例#9
0
void JobList::AddJob(const std::string & jobid, const std::string & workerip, const unsigned int workerport, const unsigned long long maxtime)
{
    TRACE_FLAG_FOR_CLASS_JobList Traces() << "\n" << "LOG: void JobList::AddJob(const std::string & jobid, const std::string & workerip, const unsigned int workerport, const unsigned long long maxtime)";

    jobMap.Insert(jobid, JobInfo(jobid, workerip, workerport, maxtime));
}