- Mesaj
- 29
- Beğeni
- 3
- Puan
- 405
- Ticaret Puanı
- 0
merhaba [1] [REVERSED] [Clip Masking] Official sistemler serisi. bu sistemi eklerken bi yerde takıldım
GrpTextInstance.cpp de bende başka sisteme ait kod var if def içinde bu sisteminkini nasıl entegre edebilirim acaba bakabilecek olur mu örnek
GrpTextInstance.cpp de bende başka sisteme ait kod var if def içinde bu sisteminkini nasıl entegre edebilirim acaba bakabilecek olur mu örnek
GrpTextInstance.cpp bendeki kod:
#ifdef ENABLE_FIX_MOBS_LAG
const auto tex = pFontTexture->GetTexture(pCurCharInfo->index);
auto& batchVertices = verticesMap[tex];
#else
pFontTexture->SelectTexture(pCurCharInfo->index);
STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture());
#endif
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;
#ifdef ENABLE_FIX_MOBS_LAG
akVertex[3].diffuse = akVertex[2].diffuse = akVertex[1].diffuse = akVertex[0].diffuse = m_dwOutLineColor;
#else
akVertex[3].color = akVertex[2].color = akVertex[1].color = akVertex[0].color = m_dwOutLineColor;
#endif
float feather = 0.0f; // m_fFontFeather
#ifdef ENABLE_FIX_MOBS_LAG
akVertex[0].py = fFontSy - feather;
akVertex[1].py = fFontEy + feather;
akVertex[2].py = fFontSy - feather;
akVertex[3].py = fFontEy + feather;
akVertex[0].px = fFontSx - fFontHalfWeight - feather;
akVertex[1].px = fFontSx - fFontHalfWeight - feather;
akVertex[2].px = fFontEx - fFontHalfWeight + feather;
akVertex[3].px = fFontEx - fFontHalfWeight + feather;
#else
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;
#endif
#ifdef ENABLE_FIX_MOBS_LAG
batchVertices.insert(batchVertices.end(),
std::begin(akVertex), std::end(akVertex));
akVertex[0].px = fFontSx + fFontHalfWeight - feather;
akVertex[1].px = fFontSx + fFontHalfWeight - feather;
akVertex[2].px = fFontEx + fFontHalfWeight + feather;
akVertex[3].px = fFontEx + fFontHalfWeight + feather;
#else
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;
#endif
#ifdef ENABLE_FIX_MOBS_LAG
batchVertices.insert(batchVertices.end(),
std::begin(akVertex), std::end(akVertex));
akVertex[0].px = fFontSx - feather;
akVertex[1].px = fFontSx - feather;
akVertex[2].px = fFontEx + feather;
akVertex[3].px = fFontEx + feather;
akVertex[0].py = fFontSy - fFontHalfWeight - feather;
akVertex[1].py = fFontEy - fFontHalfWeight + feather;
akVertex[2].py = fFontSy - fFontHalfWeight - feather;
akVertex[3].py = fFontEy - fFontHalfWeight + feather;
#else
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;
#endif
#ifdef ENABLE_FIX_MOBS_LAG
batchVertices.insert(batchVertices.end(),
std::begin(akVertex), std::end(akVertex));
akVertex[0].py = fFontSy + fFontHalfWeight - feather;
akVertex[1].py = fFontEy + fFontHalfWeight + feather;
akVertex[2].py = fFontSy + fFontHalfWeight - feather;
akVertex[3].py = fFontEy + fFontHalfWeight + feather;
#else
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;
#endif
#ifdef ENABLE_FIX_MOBS_LAG
batchVertices.insert(batchVertices.end(),
std::begin(akVertex), std::end(akVertex));
fCurX += fFontAdvance;
}
}
for (auto& p : verticesMap)
{
STATEMANAGER.SetTexture(0, p.first->GetD3DTexture());
for (auto f = p.second.begin(), l = p.second.end(); f != l; )
{
const auto batchCount = std::min<std::size_t>(LARGE_PDT_VERTEX_BUFFER_SIZE,
l - f);
if (CGraphicBase::SetPDTStream(&*f, batchCount))
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0,
batchCount - 2);
f += batchCount;
}
}
#else
if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4))
{
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
}
fCurX += fFontAdvance;
}
}
#endif