forum80 18 Posted March 4, 2023 Share Posted March 4, 2023 (edited) i have a problem 1: buttons and textboxes pop out of the clipboard when I scroll Edited March 4, 2023 by forum80 wrong 1 Link to comment Share on other sites More sharing options...
flexivk 0 Posted March 6, 2023 Share Posted March 6, 2023 can't pick up anything when ENABLE_PREMIUM_LOOT_FILTER is disabled. When enabled, everything works. Link to comment Share on other sites More sharing options...
Developer1321 32 Posted March 29, 2023 Share Posted March 29, 2023 (edited) On 4/3/2023 at 19:47, forum80 said: tengo un problema 1: los botones y cuadros de texto salen del portapapeles cuando me desplazo Same problem: https://metin2.download/picture/8u80sRQ741ZQzPv20RvMejR1diJ2g4aT/.gif Edited March 29, 2023 by Metin2 Dev International Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
forum80 18 Posted March 29, 2023 Share Posted March 29, 2023 2 hours ago, Developer1321 said: Same problem: https://metin2.download/picture/8u80sRQ741ZQzPv20RvMejR1diJ2g4aT/.gif bro i fixed use experimental Link to comment Share on other sites More sharing options...
Jimmermania 27 Posted March 30, 2023 Share Posted March 30, 2023 17 hours ago, forum80 said: bro i fixed use experimental Same problem. Link to comment Share on other sites More sharing options...
Debloat 88 Posted April 15, 2023 Share Posted April 15, 2023 On 3/5/2023 at 1:47 AM, forum80 said: i have a problem 1: buttons and textboxes pop out of the clipboard when I scroll install clip masking by mali first. Link to comment Share on other sites More sharing options...
posti 2 Posted June 5, 2023 Share Posted June 5, 2023 (edited) for me it doesnt pick up the items. Edited June 5, 2023 by posti Link to comment Share on other sites More sharing options...
Debloat 88 Posted June 6, 2023 Share Posted June 6, 2023 6 hours ago, posti said: for me it doesnt pick up the items. That's exactly what this system is for Link to comment Share on other sites More sharing options...
posti 2 Posted June 6, 2023 Share Posted June 6, 2023 (edited) so it doesnt pick it up on its own? my bad then! Does anyone know how to change it so i dont have to activate the filter with the filter pass? Edited June 6, 2023 by posti Link to comment Share on other sites More sharing options...
Premium Ulthar 3086 Posted August 22, 2023 Premium Share Posted August 22, 2023 (edited) Hello. I need help i added the clip masking and my problem is: https://metin2.download/picture/Fl5C9ca0X88WFIjMWnYw3kXLbqO95FkQ/.gif I dont know why is it like this :c Edited August 22, 2023 by Metin2 Dev International Core X - External 2 Internal Ulthar Link to comment Share on other sites More sharing options...
posti 2 Posted August 23, 2023 Share Posted August 23, 2023 18 hours ago, Ulthar said: Hello. I need help i added the clip masking and my problem is: https://metin2.download/picture/Fl5C9ca0X88WFIjMWnYw3kXLbqO95FkQ/.gif I dont know why is it like this :c install clip masking by mali first Link to comment Share on other sites More sharing options...
Premium Ulthar 3086 Posted August 23, 2023 Premium Share Posted August 23, 2023 18 minutes ago, posti said: install clip masking by mali first man... xD without it, you cant start the client... im not retard i did install it. Ulthar Link to comment Share on other sites More sharing options...
Kazuhiri 25 Posted August 26, 2023 Share Posted August 26, 2023 On 8/23/2023 at 8:24 PM, Ulthar said: man... xD without it, you cant start the client... im not retard i did install it. i have the same problem with quest renewall,reinstall clip masking Link to comment Share on other sites More sharing options...
Premium Ulthar 3086 Posted August 27, 2023 Premium Share Posted August 27, 2023 4 hours ago, Kazuhiri said: i have the same problem with quest renewall,reinstall clip masking reinstalled it with the latest version, and still same problem. xD but i will do it again and again.... 1 Ulthar Link to comment Share on other sites More sharing options...
b6d4a82c15 104 Posted December 10, 2023 Share Posted December 10, 2023 On 8/27/2023 at 4:32 AM, Ulthar said: reinstalled it with the latest version, and still same problem. xD but i will do it again and again.... It works perfectly fine I just installed it Link to comment Share on other sites More sharing options...
Debloat 88 Posted December 13, 2023 Share Posted December 13, 2023 On 12/10/2023 at 8:03 AM, b6d4a82c15 said: It works perfectly fine I just installed it Me too. Works perfectly fine for me. 1 Link to comment Share on other sites More sharing options...
Premium ?????? 3 Posted April 11 Premium Share Posted April 11 (edited) Hey @Mali, I am trying to install the system, without success as it is out of range of the window.: https://metin2.download/picture/d81sF028VJR9PoXOazvvE81KDaTIa5u6/.gif Here is my code, to see if anyone can give me some ideas -> EterLib\GrpTextInstance.cpp Spoiler void CGraphicTextInstance::Render(RECT* pClipRect) { if (!m_isUpdate) return; CGraphicText* pkText = m_roText.GetPointer(); if (!pkText) return; CGraphicFontTexture* pFontTexture = pkText->GetFontTexturePointer(); if (!pFontTexture) return; #ifdef INGAME_WIKI float textureWidth, textureHeight; pFontTexture->GetTextureSize(textureWidth, textureHeight); #endif float fStanX = m_v3Position.x; float fStanY = m_v3Position.y + 1.0f; UINT defCodePage = GetDefaultCodePage(); if (defCodePage == CP_ARABIC) { switch (m_hAlign) { case HORIZONTAL_ALIGN_LEFT: fStanX -= m_textWidth; break; case HORIZONTAL_ALIGN_CENTER: fStanX -= float(m_textWidth / 2); break; } } else { switch (m_hAlign) { case HORIZONTAL_ALIGN_RIGHT: fStanX -= m_textWidth; break; case HORIZONTAL_ALIGN_CENTER: fStanX -= float(m_textWidth / 2); break; } } switch (m_vAlign) { case VERTICAL_ALIGN_BOTTOM: fStanY -= m_textHeight; break; case VERTICAL_ALIGN_CENTER: fStanY -= float(m_textHeight) / 2.0f; break; } //WORD FillRectIndices[6] = { 0, 2, 1, 2, 3, 1 }; STATEMANAGER.SaveRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); STATEMANAGER.SaveRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); DWORD dwFogEnable = STATEMANAGER.GetRenderState(D3DRS_FOGENABLE); DWORD dwLighting = STATEMANAGER.GetRenderState(D3DRS_LIGHTING); STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, false); STATEMANAGER.SetRenderState(D3DRS_LIGHTING, false); STATEMANAGER.SetVertexShader(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1); STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); { const float fFontHalfWeight = 1.0f; float fCurX, fCurXoutLine; float fCurY, fCurYoutline; #ifdef INGAME_WIKI float fCurLocalX; #endif float fFontSx, fFontSy, fFontEx, fFontEy; float fFontWidth, fFontHeight, fFontMaxHeight; float fFontAdvance; fCurX = fStanX; fCurY = fStanY; fFontMaxHeight = 0.0f; fFontHeight = 0.0f; fCurXoutLine = fStanX; fCurYoutline = fStanY; 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; int iActualVertexIdx = 0; #ifdef INGAME_WIKI m_startPos = max(0, m_startPos); // m_endPos = min(m_endPos, WORD(m_pCharInfoVector.size())); m_endPos = min(m_endPos, m_pCharInfoVector.size()); if (!m_isFixedRenderPos && (m_startPos >= m_endPos || m_isMultiLine || !m_isCursor || !m_isOutline)) { m_startPos = 0; m_endPos = m_pCharInfoVector.size(); } #endif #if defined(WJ_MULTI_TEXTLINE) if (HasEnterToken()) { ReAdjustedStanXY(0, fStanX, fStanY); fCurX = fStanX; fCurY += fFontHeight; fCurXoutLine = fStanX; fCurYoutline += fFontMaxHeight; } #endif #ifdef INGAME_WIKI for (WORD i = m_startPos; i < m_endPos; ++i) #else for (int i = 0; i < m_pCharInfoVector.size(); ++i) #endif { if (m_isOutline) { pCurCharInfo = m_pCharInfoVector[i]; fFontWidth = float(pCurCharInfo->width); fFontHeight = float(pCurCharInfo->height); fFontAdvance = float(pCurCharInfo->advance); #ifdef INGAME_WIKI float fXRenderLeft = 0.0f; float fXRenderRight = 0.0f; if (m_bUseRenderingRect) { if (fCurX - fStanX < m_RenderingRect.left) { if (fCurX - fStanX + fFontWidth <= m_RenderingRect.left) { fCurX += fFontAdvance; continue; } fXRenderLeft = -((float)(m_RenderingRect.left - (fCurX - fStanX)) / fFontWidth); } else if ((fCurX - fStanX) + fFontWidth > m_RenderingRect.right) { if ((fCurX - fStanX) >= m_RenderingRect.right) { fCurX += fFontAdvance; continue; } fXRenderRight = -((float)((fCurX - fStanX) + fFontWidth - m_RenderingRect.right) / fFontWidth); } } if ((fCurX + fFontWidth) - fStanX > m_fLimitWidth) #else if ((fCurX + fFontWidth) - m_v3Position.x > m_fLimitWidth) #endif { if (m_isMultiLine) { fCurXoutLine = fStanX; fCurYoutline += fFontMaxHeight; } else { #ifdef INGAME_WIKI m_endPos = i; #endif break; } } #if defined(WJ_MULTI_TEXTLINE) if (m_bEnterTokenVector[i] && !m_bDisableEnterToken) { fCurX = fStanX; fCurY += fFontHeight; fCurXoutLine = fStanX; fCurYoutline += fFontMaxHeight; continue; } #endif #if !defined(__BL_CLIP_MASK__) if (pClipRect) { if (fCurY <= pClipRect->top) { fCurX += fFontAdvance; continue; } } #endif fFontSx = fCurX - 0.5f; fFontSy = fCurY - 0.5f; fFontEx = fFontSx + fFontWidth; fFontEy = fFontSy + fFontHeight; #if defined(__BL_CLIP_MASK__) float pleft = pCurCharInfo->left; float ptop = pCurCharInfo->top; float pright = pCurCharInfo->right; float pbottom = pCurCharInfo->bottom; if (pClipRect) { const float v1 = pCurCharInfo->right - pCurCharInfo->left; const float v2 = pCurCharInfo->bottom - pCurCharInfo->top; if (fFontEx <= pClipRect->left) { fCurX += fFontAdvance; continue; } if (fFontSx < pClipRect->left) { const float fCal = pClipRect->left - fFontSx; fFontSx += fCal; pleft += fCal / fFontWidth * v1; } if (fFontEy <= pClipRect->top) { fCurX += fFontAdvance; continue; } if (fFontSy < pClipRect->top) { const float fCal = pClipRect->top - fFontSy; fFontSy += fCal; ptop += fCal / fFontHeight * v2; } if (fFontSx >= pClipRect->right) { fCurX += fFontAdvance; continue; } if (fFontEx > pClipRect->right) { const float fCal = fFontEx - pClipRect->right; fFontEx -= fCal; pright -= fCal / fFontWidth * v1; } if (fFontSy >= pClipRect->bottom) { fCurX += fFontAdvance; continue; } if (fFontEy > pClipRect->bottom) { const float fCal = fFontEy - pClipRect->bottom; fFontEy -= fCal; pbottom -= fCal / fFontHeight * v2; } } pFontTexture->SelectTexture(pCurCharInfo->index); STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture()); akVertex[0].u = pleft; akVertex[0].v = ptop; akVertex[1].u = pleft; akVertex[1].v = pbottom; akVertex[2].u = pright; akVertex[2].v = ptop; akVertex[3].u = pright; akVertex[3].v = pbottom; #else 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; #endif akVertex[3].color = akVertex[2].color = akVertex[1].color = akVertex[0].color = m_dwOutlineColor; float feather = 0.0f; //m_fFontFeather akVertex[0].y = akVertex[2].y = fFontSy; akVertex[1].y = akVertex[3].y = fFontEy; // ¿Þ akVertex[0].x = akVertex[1].x = fFontSx - fFontHalfWeight - feather; akVertex[2].x = akVertex[3].x = fFontEx - fFontHalfWeight + feather; if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4)) STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); // ¿À¸¥ akVertex[0].x = akVertex[1].x = fFontSx + fFontHalfWeight - feather; akVertex[2].x = akVertex[3].x = fFontEx + fFontHalfWeight + feather; if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4)) STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); akVertex[0].x = akVertex[1].x = fFontSx; akVertex[2].x = akVertex[3].x = fFontEx; // À§ akVertex[0].y = akVertex[2].y = fFontSy - fFontHalfWeight - feather; akVertex[1].y = akVertex[3].y = fFontEy - fFontHalfWeight + feather; // 2004.12.16.myevan DrawPrimitiveUP if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4)) STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); // ¾Æ·¡ akVertex[0].y = akVertex[2].y = fFontSy + fFontHalfWeight - feather; akVertex[1].y = akVertex[3].y = fFontEy + fFontHalfWeight + feather; // 2004.12.16.myevan DrawPrimitiveUP if (CGraphicBase::SetPDTStream((SPDTVertex*)akVertex, 4)) STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); fCurX += fFontAdvance; } } // ¸ÞÀÎ ÆùÆ® fCurX = fStanX; fCurY = fStanY; fFontMaxHeight = 0.0f; #ifdef INGAME_WIKI float fCountX = 0.0f; float fCountY = 0.0f; float addXL, addYT, addXR, addYB; for (WORD i = m_startPos; i < m_endPos; ++i) #else for (int i = 0; i < m_pCharInfoVector.size(); ++i) #endif { #if defined(WJ_MULTI_TEXTLINE) if (m_bEnterTokenVector[i] && !m_bDisableEnterToken) { fCurX = fStanX; fCurY += fFontMaxHeight; continue; } #endif pCurCharInfo = m_pCharInfoVector[i]; #ifdef INGAME_WIKI fCurLocalX = fCurX - fStanX; #endif fFontWidth = float(pCurCharInfo->width); fFontHeight = float(pCurCharInfo->height); fFontMaxHeight = max(fFontHeight, pCurCharInfo->height); fFontAdvance = float(pCurCharInfo->advance); // NOTE : ÆùÆ® Ãâ·Â¿¡ Width Á¦ÇÑÀ» µÓ´Ï´Ù. - [levites] #ifdef INGAME_WIKI float fXRenderLeft = 0.0f; float fXRenderRight = 0.0f; float fYRenderTop = 0.0f; float fYRenderBottom = 0.0f; if (m_bUseRenderingRect) { if (fCurLocalX < m_RenderingRect.left && !m_isMultiLine) { if (fCurLocalX + fFontWidth <= m_RenderingRect.left) { fCurX += fFontAdvance; continue; } fXRenderLeft = ((float)(m_RenderingRect.left - fCurLocalX) / fFontWidth); } else if (fCurLocalX + fFontWidth > m_RenderingRect.right && !m_isMultiLine) { if (fCurLocalX >= m_RenderingRect.right) { fCurX += fFontAdvance; continue; } fXRenderRight = ((float)(fCurLocalX + fFontWidth - m_RenderingRect.right) / fFontWidth); } if (m_RenderingRect.top) fYRenderTop = m_RenderingRect.top / fFontHeight; if (m_RenderingRect.bottom < fFontHeight) fYRenderBottom = 1.0f - (m_RenderingRect.bottom / fFontHeight); } if (fCurLocalX + fFontWidth > m_fLimitWidth) #else if ((fCurX + fFontWidth) - m_v3Position.x > m_fLimitWidth) #endif { if (m_isMultiLine) { fCurX = fStanX; #ifdef INGAME_WIKI fCountX = 0.0f; #endif fCurY += fFontMaxHeight; #ifdef INGAME_WIKI fCountY += fFontMaxHeight; #endif } else { break; } } #ifdef INGAME_WIKI fFontSx = fCurX - 0.5f + fFontWidth * fXRenderLeft; fFontSy = fCurY - 0.5f + fFontHeight * fYRenderTop; fFontEx = fFontSx + fFontWidth * (1.0 - fXRenderRight - fXRenderLeft); fFontEy = fFontSy + fFontHeight * (1.0 - fYRenderBottom - fYRenderTop); addXR = addXL = addYT = addYB = 0.0f; if (!m_isMultiLine) { if (fCountX + fFontWidth < float(m_renderBox.left)) { fCurX += fFontAdvance; fCountX += fFontAdvance; continue; } else if (fCountX < float(m_renderBox.left)) addXL = float(m_renderBox.left) - fCountX; if (fCountY + fFontHeight < float(m_renderBox.top)) { fCurX += fFontAdvance; fCountX += fFontAdvance; continue; } else if (fCountY < float(m_renderBox.top)) addYT = float(m_renderBox.top) - fCountY; if (fCountX > m_textWidth - float(m_renderBox.right)) { fCurX += fFontAdvance; fCountX += fFontAdvance; continue; } else if (fCountX + fFontWidth > m_textWidth - float(m_renderBox.right)) addXR = fCountX + fFontWidth - m_textWidth + float(m_renderBox.right); if (fCountY > m_textHeight - float(m_renderBox.bottom)) { fCurX += fFontAdvance; fCountX += fFontAdvance; continue; } else if (fCountY + fFontHeight > m_textHeight - float(m_renderBox.bottom)) addYB = fCountY + fFontHeight - m_textHeight + float(m_renderBox.bottom); } #endif #if !defined(__BL_CLIP_MASK__) if (pClipRect) { if (fCurY <= pClipRect->top) { fCurX += fFontAdvance; continue; } } #endif fFontSx = fCurX-0.5f; fFontSy = fCurY-0.5f; fFontEx = fFontSx + fFontWidth; fFontEy = fFontSy + fFontHeight; #if defined(__BL_CLIP_MASK__) float pleft = pCurCharInfo->left; float ptop = pCurCharInfo->top; float pright = pCurCharInfo->right; float pbottom = pCurCharInfo->bottom; if (pClipRect) { const float v1 = pCurCharInfo->right - pCurCharInfo->left; const float v2 = pCurCharInfo->bottom - pCurCharInfo->top; if (fFontEx <= pClipRect->left) { fCurX += fFontAdvance; continue; } if (fFontSx < pClipRect->left) { const float fCal = pClipRect->left - fFontSx; fFontSx += fCal; pleft += fCal / fFontWidth * v1; } if (fFontEy <= pClipRect->top) { fCurX += fFontAdvance; continue; } if (fFontSy < pClipRect->top) { const float fCal = pClipRect->top - fFontSy; fFontSy += fCal; ptop += fCal / fFontHeight * v2; } if (fFontSx >= pClipRect->right) { fCurX += fFontAdvance; continue; } if (fFontEx > pClipRect->right) { const float fCal = fFontEx - pClipRect->right; fFontEx -= fCal; pright -= fCal / fFontWidth * v1; } if (fFontSy >= pClipRect->bottom) { fCurX += fFontAdvance; continue; } if (fFontEy > pClipRect->bottom) { const float fCal = fFontEy - pClipRect->bottom; fFontEy -= fCal; pbottom -= fCal / fFontHeight * v2; } } pFontTexture->SelectTexture(pCurCharInfo->index); STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture()); akVertex[0].x = fFontSx; akVertex[0].y = fFontSy; akVertex[0].u = pleft; akVertex[0].v = ptop; akVertex[1].x = fFontSx; akVertex[1].y = fFontEy; akVertex[1].u = pleft; akVertex[1].v = pbottom; akVertex[2].x = fFontEx; akVertex[2].y = fFontSy; akVertex[2].u = pright; akVertex[2].v = ptop; akVertex[3].x = fFontEx; akVertex[3].y = fFontEy; akVertex[3].u = pright; akVertex[3].v = pbottom; #else 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; #endif //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; #ifdef INGAME_WIKI fCountX += fFontAdvance; #endif } } if (m_isCursor) { // Draw Cursor float sx, sy, ex, ey; TDiffuse diffuse; int curpos = CIME::GetCurPos(); int compend = curpos + CIME::GetCompLen(); __GetTextPos(curpos, &sx, &sy); // If Composition if (curpos < compend) { diffuse = 0x7fffffff; __GetTextPos(compend, &ex, &sy); } else { diffuse = 0xffffffff; ex = sx + 2; } // FOR_ARABIC_ALIGN if (defCodePage == CP_ARABIC) { sx += m_v3Position.x - m_textWidth; ex += m_v3Position.x - m_textWidth; sy += m_v3Position.y; ey = sy + m_textHeight; } else { sx += m_v3Position.x; sy += m_v3Position.y; ex += m_v3Position.x; ey = sy + m_textHeight; } switch (m_vAlign) { case VERTICAL_ALIGN_BOTTOM: sy -= m_textHeight; break; case VERTICAL_ALIGN_CENTER: sy -= float(m_textHeight) / 2.0f; break; } #if defined(__BL_CLIP_MASK__) if (pClipRect) { if (sx < pClipRect->left) sx += pClipRect->left - sx; if (sy < pClipRect->top) sy += pClipRect->top - sy; if (ex > pClipRect->right) ex -= ex - pClipRect->right; if (ey > pClipRect->bottom) ey -= ey - pClipRect->bottom; } #endif TPDTVertex vertices[4]; vertices[0].diffuse = diffuse; vertices[1].diffuse = diffuse; vertices[2].diffuse = diffuse; vertices[3].diffuse = diffuse; vertices[0].position = TPosition(sx, sy, 0.0f); vertices[1].position = TPosition(ex, sy, 0.0f); vertices[2].position = TPosition(sx, ey, 0.0f); vertices[3].position = TPosition(ex, ey, 0.0f); STATEMANAGER.SetTexture(0, NULL); // 2004.11.18.myevan.DrawIndexPrimitiveUP -> DynamicVertexBuffer CGraphicBase::SetDefaultIndexBuffer(CGraphicBase::DEFAULT_IB_FILL_RECT); if (CGraphicBase::SetPDTStream(vertices, 4)) STATEMANAGER.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 4, 0, 2); int ulbegin = CIME::GetULBegin(); int ulend = CIME::GetULEnd(); if (ulbegin < ulend) { __GetTextPos(curpos + ulbegin, &sx, &sy); __GetTextPos(curpos + ulend, &ex, &sy); sx += m_v3Position.x; sy += m_v3Position.y + m_textHeight; ex += m_v3Position.x; ey = sy + 2; #if defined(__BL_CLIP_MASK__) if (pClipRect) { if (sx < pClipRect->left) sx += pClipRect->left - sx; if (sy < pClipRect->top) sy += pClipRect->top - sy; if (ex > pClipRect->right) ex -= ex - pClipRect->right; if (ey > pClipRect->bottom) ey -= ey - pClipRect->bottom; } #endif vertices[0].diffuse = 0xFFFF0000; vertices[1].diffuse = 0xFFFF0000; vertices[2].diffuse = 0xFFFF0000; vertices[3].diffuse = 0xFFFF0000; vertices[0].position = TPosition(sx, sy, 0.0f); vertices[1].position = TPosition(ex, sy, 0.0f); vertices[2].position = TPosition(sx, ey, 0.0f); vertices[3].position = TPosition(ex, ey, 0.0f); STATEMANAGER.DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, c_FillRectIndices, D3DFMT_INDEX16, vertices, sizeof(TPDTVertex)); } } STATEMANAGER.RestoreRenderState(D3DRS_SRCBLEND); STATEMANAGER.RestoreRenderState(D3DRS_DESTBLEND); STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, dwFogEnable); STATEMANAGER.SetRenderState(D3DRS_LIGHTING, dwLighting); // ±Ý°°æ ¸µÅ© ¶ç¿öÁÖ´Â ºÎºÐ. if (m_hyperlinkVector.size() != 0) { int lx = gs_mx - m_v3Position.x; int ly = gs_my - m_v3Position.y; // ¾Æ¶øÀº ÁÂÇ¥ ºÎÈ£¸¦ ¹Ù²ãÁØ´Ù. if (GetDefaultCodePage() == CP_ARABIC) { lx = -lx; ly = -ly + m_textHeight; } if (lx >= 0 && ly >= 0 && lx < m_textWidth && ly < m_textHeight) { std::vector<SHyperlink>::iterator it = m_hyperlinkVector.begin(); while (it != m_hyperlinkVector.end()) { SHyperlink& link = *it++; if (lx >= link.sx && lx < link.ex) { gs_hyperlinkText = link.text; /* OutputDebugStringW(link.text.c_str()); OutputDebugStringW(L"\n"); */ break; } } } } #ifdef ENABLE_TEXT_IMAGE_LINE if (m_imageVector.size() != 0) { for (std::vector<SImage>::iterator itor = m_imageVector.begin(); itor != m_imageVector.end(); ++itor) { SImage& rImg = *itor; if (rImg.pInstance) { rImg.pInstance->SetPosition(fStanX + rImg.x, (fStanY + 7.0) - (rImg.pInstance->GetHeight() / 2)); rImg.pInstance->Render(); } } } #endif } Thanks... Edited April 13 by Metin2 Dev International Core X - External 2 Internal ░▒▓█►─═ Ⓕⓘⓖⓗⓣ ⓕⓞⓡ ⓨⓞⓤⓡ ⓓⓡⓔⓐⓜⓢ ,⃝ ⓝⓔⓥⓔⓡ ⓢⓣⓞⓟ .⃝ ═─◄█▓▒░ Link to comment Share on other sites More sharing options...
sss221 0 Posted April 30 Share Posted April 30 On 12/22/2022 at 10:22 AM, Mali said: I think you made a mistake in CGraphicTextInstance::Render. Can you try this? Reveal hidden contents void CGraphicTextInstance::Render(RECT * pClipRect) { if (!m_isUpdate) return; CGraphicText* pkText=m_roText.GetPointer(); if (!pkText) return; CGraphicFontTexture* pFontTexture = pkText->GetFontTexturePointer(); if (!pFontTexture) return; float fStanX = m_v3Position.x; float fStanY = m_v3Position.y + 1.0f; UINT defCodePage = GetDefaultCodePage(); if (defCodePage == CP_ARABIC) { switch (m_hAlign) { case HORIZONTAL_ALIGN_LEFT: fStanX -= m_textWidth; break; case HORIZONTAL_ALIGN_CENTER: fStanX -= float(m_textWidth / 2); break; } } else { switch (m_hAlign) { case HORIZONTAL_ALIGN_RIGHT: fStanX -= m_textWidth; break; case HORIZONTAL_ALIGN_CENTER: fStanX -= float(m_textWidth / 2); break; } } switch (m_vAlign) { case VERTICAL_ALIGN_BOTTOM: fStanY -= m_textHeight; break; case VERTICAL_ALIGN_CENTER: fStanY -= float(m_textHeight) / 2.0f; break; } //WORD FillRectIndices[6] = { 0, 2, 1, 2, 3, 1 }; STATEMANAGER.SaveRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); STATEMANAGER.SaveRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); DWORD dwFogEnable = STATEMANAGER.GetRenderState(D3DRS_FOGENABLE); DWORD dwLighting = STATEMANAGER.GetRenderState(D3DRS_LIGHTING); STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, FALSE); STATEMANAGER.SetRenderState(D3DRS_LIGHTING, FALSE); STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1); STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); { 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 !defined(__BL_CLIP_MASK__) if (pClipRect) { if (fCurY <= pClipRect->top) { fCurX += fFontAdvance; continue; } } #endif fFontSx = fCurX - 0.5f; fFontSy = fCurY - 0.5f; fFontEx = fFontSx + fFontWidth; fFontEy = fFontSy + fFontHeight; #if defined(__BL_CLIP_MASK__) float pleft = pCurCharInfo->left; float ptop = pCurCharInfo->top; float pright = pCurCharInfo->right; float pbottom = pCurCharInfo->bottom; if (pClipRect) { const float v1 = pCurCharInfo->right - pCurCharInfo->left; const float v2 = pCurCharInfo->bottom - pCurCharInfo->top; if (fFontEx <= pClipRect->left) { fCurX += fFontAdvance; continue; } if (fFontSx < pClipRect->left) { const float fCal = pClipRect->left - fFontSx; fFontSx += fCal; pleft += fCal / fFontWidth * v1; } if (fFontEy <= pClipRect->top) { fCurX += fFontAdvance; continue; } if (fFontSy < pClipRect->top) { const float fCal = pClipRect->top - fFontSy; fFontSy += fCal; ptop += fCal / fFontHeight * v2; } if (fFontSx >= pClipRect->right) { fCurX += fFontAdvance; continue; } if (fFontEx > pClipRect->right) { const float fCal = fFontEx - pClipRect->right; fFontEx -= fCal; pright -= fCal / fFontWidth * v1; } if (fFontSy >= pClipRect->bottom) { fCurX += fFontAdvance; continue; } if (fFontEy > pClipRect->bottom) { const float fCal = fFontEy - pClipRect->bottom; fFontEy -= fCal; pbottom -= fCal / fFontHeight * v2; } } pFontTexture->SelectTexture(pCurCharInfo->index); STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture()); akVertex[0].u = pleft; akVertex[0].v = ptop; akVertex[1].u = pleft; akVertex[1].v = pbottom; akVertex[2].u = pright; akVertex[2].v = ptop; akVertex[3].u = pright; akVertex[3].v = pbottom; #else 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; #endif 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 !defined(__BL_CLIP_MASK__) if (pClipRect) { if (fCurY <= pClipRect->top) { fCurX += fFontAdvance; continue; } } #endif fFontSx = fCurX-0.5f; fFontSy = fCurY-0.5f; fFontEx = fFontSx + fFontWidth; fFontEy = fFontSy + fFontHeight; #if defined(__BL_CLIP_MASK__) float pleft = pCurCharInfo->left; float ptop = pCurCharInfo->top; float pright = pCurCharInfo->right; float pbottom = pCurCharInfo->bottom; if (pClipRect) { const float v1 = pCurCharInfo->right - pCurCharInfo->left; const float v2 = pCurCharInfo->bottom - pCurCharInfo->top; if (fFontEx <= pClipRect->left) { fCurX += fFontAdvance; continue; } if (fFontSx < pClipRect->left) { const float fCal = pClipRect->left - fFontSx; fFontSx += fCal; pleft += fCal / fFontWidth * v1; } if (fFontEy <= pClipRect->top) { fCurX += fFontAdvance; continue; } if (fFontSy < pClipRect->top) { const float fCal = pClipRect->top - fFontSy; fFontSy += fCal; ptop += fCal / fFontHeight * v2; } if (fFontSx >= pClipRect->right) { fCurX += fFontAdvance; continue; } if (fFontEx > pClipRect->right) { const float fCal = fFontEx - pClipRect->right; fFontEx -= fCal; pright -= fCal / fFontWidth * v1; } if (fFontSy >= pClipRect->bottom) { fCurX += fFontAdvance; continue; } if (fFontEy > pClipRect->bottom) { const float fCal = fFontEy - pClipRect->bottom; fFontEy -= fCal; pbottom -= fCal / fFontHeight * v2; } } pFontTexture->SelectTexture(pCurCharInfo->index); STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture()); akVertex[0].x = fFontSx; akVertex[0].y = fFontSy; akVertex[0].u = pleft; akVertex[0].v = ptop; akVertex[1].x = fFontSx; akVertex[1].y = fFontEy; akVertex[1].u = pleft; akVertex[1].v = pbottom; akVertex[2].x = fFontEx; akVertex[2].y = fFontSy; akVertex[2].u = pright; akVertex[2].v = ptop; akVertex[3].x = fFontEx; akVertex[3].y = fFontEy; akVertex[3].u = pright; akVertex[3].v = pbottom; #else 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; #endif //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; } } if (m_isCursor) { // Draw Cursor float sx, sy, ex, ey; TDiffuse diffuse; int curpos = CIME::GetCurPos(); int compend = curpos + CIME::GetCompLen(); __GetTextPos(curpos, &sx, &sy); // If Composition if(curpos<compend) { diffuse = 0x7fffffff; __GetTextPos(compend, &ex, &sy); } else { diffuse = 0xffffffff; ex = sx + 2; } // FOR_ARABIC_ALIGN if (defCodePage == CP_ARABIC) { sx += m_v3Position.x - m_textWidth; ex += m_v3Position.x - m_textWidth; sy += m_v3Position.y; ey = sy + m_textHeight; } else { sx += m_v3Position.x; sy += m_v3Position.y; ex += m_v3Position.x; ey = sy + m_textHeight; } switch (m_vAlign) { case VERTICAL_ALIGN_BOTTOM: sy -= m_textHeight; break; case VERTICAL_ALIGN_CENTER: sy -= float(m_textHeight) / 2.0f; break; } #if defined(__BL_CLIP_MASK__) if (pClipRect) { if (sx < pClipRect->left) sx += pClipRect->left - sx; if (sy < pClipRect->top) sy += pClipRect->top - sy; if (ex > pClipRect->right) ex -= ex - pClipRect->right; if (ey > pClipRect->bottom) ey -= ey - pClipRect->bottom; } #endif // ÃÖÀûÈ »çÇ× // °°ÀºÅؽºÃĸ¦ »ç¿ëÇÑ´Ù¸é... STRIPÀ» ±¸¼ºÇÏ°í, ÅؽºÃÄ°¡ º¯°æµÇ°Å³ª ³¡³ª¸é DrawPrimitive¸¦ È£ÃâÇØ // ÃÖ´ëÇÑ ¼ıÀÚ¸¦ ÁÙÀ̵µ·ÏÇÏÀÚ! TPDTVertex vertices[4]; vertices[0].diffuse = diffuse; vertices[1].diffuse = diffuse; vertices[2].diffuse = diffuse; vertices[3].diffuse = diffuse; vertices[0].position = TPosition(sx, sy, 0.0f); vertices[1].position = TPosition(ex, sy, 0.0f); vertices[2].position = TPosition(sx, ey, 0.0f); vertices[3].position = TPosition(ex, ey, 0.0f); STATEMANAGER.SetTexture(0, NULL); // 2004.11.18.myevan.DrawIndexPrimitiveUP -> DynamicVertexBuffer CGraphicBase::SetDefaultIndexBuffer(CGraphicBase::DEFAULT_IB_FILL_RECT); if (CGraphicBase::SetPDTStream(vertices, 4)) STATEMANAGER.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 4, 0, 2); int ulbegin = CIME::GetULBegin(); int ulend = CIME::GetULEnd(); if(ulbegin < ulend) { __GetTextPos(curpos+ulbegin, &sx, &sy); __GetTextPos(curpos+ulend, &ex, &sy); sx += m_v3Position.x; sy += m_v3Position.y + m_textHeight; ex += m_v3Position.x; ey = sy + 2; #if defined(__BL_CLIP_MASK__) if (pClipRect) { if (sx < pClipRect->left) sx += pClipRect->left - sx; if (sy < pClipRect->top) sy += pClipRect->top - sy; if (ex > pClipRect->right) ex -= ex - pClipRect->right; if (ey > pClipRect->bottom) ey -= ey - pClipRect->bottom; } #endif vertices[0].diffuse = 0xFFFF0000; vertices[1].diffuse = 0xFFFF0000; vertices[2].diffuse = 0xFFFF0000; vertices[3].diffuse = 0xFFFF0000; vertices[0].position = TPosition(sx, sy, 0.0f); vertices[1].position = TPosition(ex, sy, 0.0f); vertices[2].position = TPosition(sx, ey, 0.0f); vertices[3].position = TPosition(ex, ey, 0.0f); STATEMANAGER.DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, c_FillRectIndices, D3DFMT_INDEX16, vertices, sizeof(TPDTVertex)); } } STATEMANAGER.RestoreRenderState(D3DRS_SRCBLEND); STATEMANAGER.RestoreRenderState(D3DRS_DESTBLEND); STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, dwFogEnable); STATEMANAGER.SetRenderState(D3DRS_LIGHTING, dwLighting); //±İ°°æ ¸µÅ© ¶ç¿öÁÖ´Â ºÎºĞ. if (m_hyperlinkVector.size() != 0) { int lx = gs_mx - m_v3Position.x; int ly = gs_my - m_v3Position.y; //¾Æ¶øÀº ÁÂÇ¥ ºÎÈ£¸¦ ¹Ù²ãÁØ´Ù. if (GetDefaultCodePage() == CP_ARABIC) { lx = -lx; ly = -ly + m_textHeight; } if (lx >= 0 && ly >= 0 && lx < m_textWidth && ly < m_textHeight) { std::vector<SHyperlink>::iterator it = m_hyperlinkVector.begin(); while (it != m_hyperlinkVector.end()) { SHyperlink & link = *it++; if (lx >= link.sx && lx < link.ex) { gs_hyperlinkText = link.text; /* OutputDebugStringW(link.text.c_str()); OutputDebugStringW(L"\n"); */ break; } } } } } I tried everything, it doesn't work and that's it. the text flies somewhere! Link to comment Share on other sites More sharing options...
Recommended Posts