// Search
{
const float fFontHalfWeight=1.0f;
{}.............
// Replace
#define _REWORK_OUTLINE
#ifdef _REWORK_OUTLINE
CGraphicFontTexture::TPCharacterInfomationVector::iterator i;
int y;
for (y = 0, i = m_pCharInfoVector.begin(); i != m_pCharInfoVector.end(); ++i, ++y)
{
pCurCharInfo = *i;
fFontWidth=float(pCurCharInfo->width);
fFontHeight=float(pCurCharInfo->height);
if (!m_isOutline)
fFontMaxHeight = max(fFontHeight, pCurCharInfo->height);
fFontAdvance=float(pCurCharInfo->advance);
// NOTE : ÆùÆ® Ãâ·Â¿¡ Width Á¦ÇÑÀ» µÓ´Ï´Ù. - [levites]
if ((fCurX+fFontWidth)-m_v3Position.x > m_fLimitWidth)
{
if (m_isMultiLine)
{
fCurX=fStanX;
fCurY+=fFontMaxHeight;
}
else
{
break;
}
}
if (pClipRect)
{
if (fCurY <= pClipRect->top)
{
fCurX += fFontAdvance;
continue;
}
}
if (m_isOutline)
{
fFontSx = fCurX - 0.5f;
fFontSy = fCurY - 0.5f;
fFontEx = fFontSx + fFontWidth;
fFontEy = fFontSy + fFontHeight;
pFontTexture->SelectTexture(pCurCharInfo->index);
STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture());
akVertex[0].u = pCurCharInfo->left;
akVertex[0].v = pCurCharInfo->top;
akVertex[1].u = pCurCharInfo->left;
akVertex[1].v = pCurCharInfo->bottom;
akVertex[2].u = pCurCharInfo->right;
akVertex[2].v = pCurCharInfo->top;
akVertex[3].u = pCurCharInfo->right;
akVertex[3].v = pCurCharInfo->bottom;
akVertex[3].color = akVertex[2].color = akVertex[1].color = akVertex[0].color = m_dwOutLineColor;
float feather = 0.0f; // m_fFontFeather
akVertex[0].y = fFontSy - feather;
akVertex[1].y = fFontEy + feather;
akVertex[2].y = fFontSy - feather;
akVertex[3].y = fFontEy + feather;
akVertex[0].x = fFontSx - fFontHalfWeight - feather;
akVertex[1].x = fFontSx - fFontHalfWeight - feather;
akVertex[2].x = fFontEx - fFontHalfWeight + feather;
akVertex[3].x = fFontEx - fFontHalfWeight + feather;
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
akVertex[0].x = fFontSx + fFontHalfWeight - feather;
akVertex[1].x = fFontSx + fFontHalfWeight - feather;
akVertex[2].x = fFontEx + fFontHalfWeight + feather;
akVertex[3].x = fFontEx + fFontHalfWeight + feather;
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
akVertex[0].x = fFontSx - feather;
akVertex[1].x = fFontSx - feather;
akVertex[2].x = fFontEx + feather;
akVertex[3].x = fFontEx + feather;
// ˤ
akVertex[0].y = fFontSy - fFontHalfWeight - feather;
akVertex[1].y = fFontEy - fFontHalfWeight + feather;
akVertex[2].y = fFontSy - fFontHalfWeight - feather;
akVertex[3].y = fFontEy - fFontHalfWeight + feather;
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
akVertex[0].y = fFontSy + fFontHalfWeight - feather;
akVertex[1].y = fFontEy + fFontHalfWeight + feather;
akVertex[2].y = fFontSy + fFontHalfWeight - feather;
akVertex[3].y = fFontEy + fFontHalfWeight + feather;
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
//fCurX += fFontAdvance;
}
fFontSx = fCurX - 0.5f;
fFontSy = fCurY - 0.5f;
fFontEx = fFontSx + fFontWidth;
fFontEy = fFontSy + fFontHeight;
pFontTexture->SelectTexture(pCurCharInfo->index);
STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture());
akVertex[0].x = fFontSx;
akVertex[0].y = fFontSy;
akVertex[0].u = pCurCharInfo->left;
akVertex[0].v = pCurCharInfo->top;
akVertex[1].x = fFontSx;
akVertex[1].y = fFontEy;
akVertex[1].u = pCurCharInfo->left;
akVertex[1].v = pCurCharInfo->bottom;
akVertex[2].x = fFontEx;
akVertex[2].y = fFontSy;
akVertex[2].u = pCurCharInfo->right;
akVertex[2].v = pCurCharInfo->top;
akVertex[3].x = fFontEx;
akVertex[3].y = fFontEy;
akVertex[3].u = pCurCharInfo->right;
akVertex[3].v = pCurCharInfo->bottom;
akVertex[0].color = akVertex[1].color = akVertex[2].color = akVertex[3].color = m_dwColorInfoVector[y];
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
fCurX += fFontAdvance;
}
#else
{
const float fFontHalfWeight=1.0f;
float fCurX;
float fCurY;
float fFontSx;
float fFontSy;
float fFontEx;
float fFontEy;
float fFontWidth;
float fFontHeight;
float fFontMaxHeight;
float fFontAdvance;
SVertex akVertex[4];
akVertex[0].z=m_v3Position.z;
akVertex[1].z=m_v3Position.z;
akVertex[2].z=m_v3Position.z;
akVertex[3].z=m_v3Position.z;
CGraphicFontTexture::TCharacterInfomation* pCurCharInfo;
// Å׵θ®
if (m_isOutline)
{
fCurX=fStanX;
fCurY=fStanY;
fFontMaxHeight=0.0f;
CGraphicFontTexture::TPCharacterInfomationVector::iterator i;
for (i=m_pCharInfoVector.begin(); i!=m_pCharInfoVector.end(); ++i)
{
pCurCharInfo = *i;
fFontWidth=float(pCurCharInfo->width);
fFontHeight=float(pCurCharInfo->height);
fFontAdvance=float(pCurCharInfo->advance);
// NOTE : ÆùÆ® Ãâ·Â¿¡ Width Á¦ÇÑÀ» µÓ´Ï´Ù. - [levites]
if ((fCurX+fFontWidth)-m_v3Position.x > m_fLimitWidth)
{
if (m_isMultiLine)
{
fCurX=fStanX;
fCurY+=fFontMaxHeight;
}
else
{
break;
}
}
if (pClipRect)
{
if (fCurY <= pClipRect->top)
{
fCurX += fFontAdvance;
continue;
}
}
fFontSx = fCurX - 0.5f;
fFontSy = fCurY - 0.5f;
fFontEx = fFontSx + fFontWidth;
fFontEy = fFontSy + fFontHeight;
pFontTexture->SelectTexture(pCurCharInfo->index);
STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture());
akVertex[0].u=pCurCharInfo->left;
akVertex[0].v=pCurCharInfo->top;
akVertex[1].u=pCurCharInfo->left;
akVertex[1].v=pCurCharInfo->bottom;
akVertex[2].u=pCurCharInfo->right;
akVertex[2].v=pCurCharInfo->top;
akVertex[3].u=pCurCharInfo->right;
akVertex[3].v=pCurCharInfo->bottom;
akVertex[3].color = akVertex[2].color = akVertex[1].color = akVertex[0].color = m_dwOutLineColor;
float feather = 0.0f; // m_fFontFeather
akVertex[0].y=fFontSy-feather;
akVertex[1].y=fFontEy+feather;
akVertex[2].y=fFontSy-feather;
akVertex[3].y=fFontEy+feather;
// ¿Ş
akVertex[0].x=fFontSx-fFontHalfWeight-feather;
akVertex[1].x=fFontSx-fFontHalfWeight-feather;
akVertex[2].x=fFontEx-fFontHalfWeight+feather;
akVertex[3].x=fFontEx-fFontHalfWeight+feather;
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
// ¿À¸¥
akVertex[0].x=fFontSx+fFontHalfWeight-feather;
akVertex[1].x=fFontSx+fFontHalfWeight-feather;
akVertex[2].x=fFontEx+fFontHalfWeight+feather;
akVertex[3].x=fFontEx+fFontHalfWeight+feather;
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
akVertex[0].x=fFontSx-feather;
akVertex[1].x=fFontSx-feather;
akVertex[2].x=fFontEx+feather;
akVertex[3].x=fFontEx+feather;
// ˤ
akVertex[0].y=fFontSy-fFontHalfWeight-feather;
akVertex[1].y=fFontEy-fFontHalfWeight+feather;
akVertex[2].y=fFontSy-fFontHalfWeight-feather;
akVertex[3].y=fFontEy-fFontHalfWeight+feather;
// 20041216.myevan.DrawPrimitiveUP
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
// ¾Æ·¡
akVertex[0].y=fFontSy+fFontHalfWeight-feather;
akVertex[1].y=fFontEy+fFontHalfWeight+feather;
akVertex[2].y=fFontSy+fFontHalfWeight-feather;
akVertex[3].y=fFontEy+fFontHalfWeight+feather;
// 20041216.myevan.DrawPrimitiveUP
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
fCurX += fFontAdvance;
}
}
// ¸ŞÀÎ ÆùÆ®
fCurX=fStanX;
fCurY=fStanY;
fFontMaxHeight=0.0f;
for (int i = 0; i < m_pCharInfoVector.size(); ++i)
{
pCurCharInfo = m_pCharInfoVector[i];
fFontWidth=float(pCurCharInfo->width);
fFontHeight=float(pCurCharInfo->height);
fFontMaxHeight=max(fFontHeight, pCurCharInfo->height);
fFontAdvance=float(pCurCharInfo->advance);
// NOTE : ÆùÆ® Ãâ·Â¿¡ Width Á¦ÇÑÀ» µÓ´Ï´Ù. - [levites]
if ((fCurX+fFontWidth)-m_v3Position.x > m_fLimitWidth)
{
if (m_isMultiLine)
{
fCurX=fStanX;
fCurY+=fFontMaxHeight;
}
else
{
break;
}
}
if (pClipRect)
{
if (fCurY <= pClipRect->top)
{
fCurX += fFontAdvance;
continue;
}
}
fFontSx = fCurX-0.5f;
fFontSy = fCurY-0.5f;
fFontEx = fFontSx + fFontWidth;
fFontEy = fFontSy + fFontHeight;
pFontTexture->SelectTexture(pCurCharInfo->index);
STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture());
akVertex[0].x=fFontSx;
akVertex[0].y=fFontSy;
akVertex[0].u=pCurCharInfo->left;
akVertex[0].v=pCurCharInfo->top;
akVertex[1].x=fFontSx;
akVertex[1].y=fFontEy;
akVertex[1].u=pCurCharInfo->left;
akVertex[1].v=pCurCharInfo->bottom;
akVertex[2].x=fFontEx;
akVertex[2].y=fFontSy;
akVertex[2].u=pCurCharInfo->right;
akVertex[2].v=pCurCharInfo->top;
akVertex[3].x=fFontEx;
akVertex[3].y=fFontEy;
akVertex[3].u=pCurCharInfo->right;
akVertex[3].v=pCurCharInfo->bottom;
//m_dwColorInfoVector[i];
//m_dwTextColor;
akVertex[0].color = akVertex[1].color = akVertex[2].color = akVertex[3].color = m_dwColorInfoVector[i];
// 20041216.myevan.DrawPrimitiveUP
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
//STATEMANAGER.DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, akVertex, sizeof(SVertex));
fCurX += fFontAdvance;
}
}
#endif