void SRRasterization::HandleFragment(int x0, int y0, SRVertex & vertex0, int xEnd, int yEnd, SRVertex & vertex1, int x, int y)
{
	// todo : 做好规范体裁剪后应该不用判定这一步
	if (IsInScreen(x, y))
	{
		float weight = GetWeight(x0, y0, xEnd, yEnd, x, y);
		float distance = Lerp(vertex0.m_pos.z, vertex1.m_pos.z, weight);
		float cacheDistance = m_depthBuffer->GetDepth(x, y);

// 		if (cacheDistance != FLT_MAX)
// 		{
// 			int test = 0;
// 		}
		if (x == 281 && y == 203)
		{
			int test = 0;
		}

		if (distance > cacheDistance)
		{
			SRColor srColor = SRColor::Lerp(vertex0.m_color, vertex1.m_color, weight);
			SRFragment srFragment;
			srFragment.m_color = srColor;
			SRColor color = PixelShader(srFragment);
			m_colorBuffer->SetPixel(x, y, color);
			m_depthBuffer->SetDepth(x, y, distance);
		}
		else
		{
			int test = 0;
		}
	}
}
示例#2
0
void	Enemy_01_01::OnWipped()
{
	Enemy::OnWipped();
	if (IsInScreen())
	{
		gm.AddObject(new EffectEnemyDead(GetCenter()));
		dsMgr.playSound(rm.GetSoundBuffer(SOUND_ENEP));
	}
}
示例#3
0
void	Enemy_01_02::OnWipped()
{

	Enemy::OnWipped();
	if (IsInScreen())
	{
		EffectEnemyDead01 *pEffect = new EffectEnemyDead01();
		pEffect->SetCenter(this->GetCenter());
		gm.AddObject(pEffect);
		dsMgr.playSound(rm.GetSoundBuffer(SOUND_ENEP));
	}
}
示例#4
0
void CLayerMap::DrawCharText(PCImg32 pDst, int nDrawY/*-1*/)
{
	BOOL bResult, bDraw, bDrawChat;
	int i, j, nCount, nCount2, x, y, xx, yy, cy, nMaxX, nMaxY, nWidth, nHeight, nDrawMode;
	POINT ptViewCharPos;
	PCInfoCharCli pChar;
	PCInfoTextEffect pInfoTextEffect;

	bDraw		= TRUE;
	nMaxX		= SCRSIZEX + 32;
	nMaxY		= SCRSIZEY + 32;
	nDrawMode	= m_pMgrData->GetDrawMode ();
	if (nDrawMode == 0) {
		bDraw = FALSE;
	}
	bDrawChat = m_pMgrData->GetOptionViewChat ();

	nCount = m_pLibInfoChar->GetCount ();
	for (i = nCount - 1; i >= 0; i --) {
		pChar = (PCInfoCharCli)m_pLibInfoChar->GetPtr (i);

		if (pChar->m_nMoveType == CHARMOVETYPE_PUTNPC) {
			if (m_pMgrData->GetAdminLevel () == ADMINLEVEL_NONE) {
				continue;
			}
		}
		bResult = IsInScreen (pChar->m_nMapX, pChar->m_nMapY);
		if (bResult == FALSE) {
			continue;
		}
		x = y = 32;
		GetDrawPos (pChar, x, y);
		x += pChar->m_ptMove.x;
		y += pChar->m_ptMove.y;
		pChar->GetViewCharPos (ptViewCharPos);

		/* 文字エフェクト */
		nCount2 = pChar->GetTextEffectCount ();
		for (j = 0; j < nCount2; j ++) {
			pInfoTextEffect = pChar->GetTextEffect (j);
			m_pMgrDraw->DrawTextEffect (pDst, x + pChar->m_nGrpSize, y - 20 - ptViewCharPos.y, pInfoTextEffect);
		}

		/* 噴出し */
		cy = m_pMgrGrpData->GetGrpSize (GRPIDMAIN_EFCBALLOON);
		m_pMgrDraw->DrawBalloon (pDst, x, y - (cy * 2) - ptViewCharPos.y, pChar->GetBalloonGrpID ());

		/* キャラ名の表示 */
		if (bDraw) {
			nWidth	= pChar->m_pDibName->Width ();
			nHeight	= pChar->m_pDibName->Height ();
			xx = x + pChar->m_nGrpSize - (nWidth / 2);
			xx = (xx < 32) ? 32 : xx;
			xx = (xx + nWidth >= nMaxX) ? nMaxX - nWidth : xx;
			yy = y + nHeight;
			yy = (yy < 32) ? 32 : yy;
			yy = (yy + nHeight >= nMaxY) ? nMaxY - nHeight : yy;
			pDst->Blt (xx, yy, nWidth, nHeight, pChar->m_pDibName, 0, 0, TRUE);
		}

		/* 発言内容の表示 */
		if (bDrawChat && pChar->m_strSpeak.GetLength ()) {
			nWidth	= pChar->m_pDibSpeak->Width ();
			nHeight	= pChar->m_pDibSpeak->Height ();

			xx = x + pChar->m_nGrpSize - (nWidth / 2) + 3;
			xx = (xx < 32) ? 32: xx;
			xx = (xx + nWidth >= nMaxX) ? nMaxX - nWidth: xx;
			yy = y - nHeight;
			yy -= ptViewCharPos.y;
			yy = (yy < 32) ? 32 : yy;
			yy = (yy + nHeight >= nMaxY) ? nMaxY - nHeight : yy;
			pDst->Blt (xx, yy, nWidth, nHeight, pChar->m_pDibSpeak, 0, 0, TRUE);
		}
	}
}