diff --git a/bin/pack/root/ui.py b/bin/pack/root/ui.py index 2b68375c..e43e9d0f 100644 --- a/bin/pack/root/ui.py +++ b/bin/pack/root/ui.py @@ -131,7 +131,6 @@ class Window(object): self.parentWindow=proxy(parent) wndMgr.SetParent(self.hWnd, parent.hWnd) - def GetParentProxy(self): return self.parentWindow @@ -221,11 +220,18 @@ class Window(object): def SetOnMouseLeftButtonUpEvent(self, event): self.onMouseLeftButtonUpEvent = event - + def OnMouseLeftButtonUp(self): if self.onMouseLeftButtonUpEvent: self.onMouseLeftButtonUpEvent() + if app.__BL_CLIP_MASK__: + def SetClippingMaskRect(self, left, top, right, bottom): + wndMgr.SetClippingMaskRect(self.hWnd, left, top, right, bottom) + + def SetClippingMaskWindow(self, clipping_mask_window): + wndMgr.SetClippingMaskWindow(self.hWnd, clipping_mask_window.hWnd) + class ListBoxEx(Window): class Item(Window): @@ -870,7 +876,7 @@ class ExpandedImageBox(ImageBox): def SetRenderingMode(self, mode): wndMgr.SetRenderingMode(self.hWnd, mode) - # [0.0, 1.0] »çÀÌÀÇ °ª¸¸Å­ ÆÛ¼¾Æ®·Î ±×¸®Áö ¾Ê´Â´Ù. + # [0.0, 1.0] ������ ����ŭ �ۼ�Ʈ�� �׸��� �ʴ´�. def SetRenderingRect(self, left, top, right, bottom): wndMgr.SetRenderingRect(self.hWnd, left, top, right, bottom) @@ -1359,11 +1365,11 @@ class SlotWindow(Window): return wndMgr.GetSlotCount(self.hWnd) def SetUseMode(self, flag): - "TrueÀ϶§¸¸ ItemToItem ÀÌ °¡´ÉÇÑÁö º¸¿©ÁØ´Ù" + "True�϶��� ItemToItem �� �������� �����ش�" wndMgr.SetUseMode(self.hWnd, flag) def SetUsableItem(self, flag): - "True¸é ÇöÀç °¡¸®Å² ¾ÆÀÌÅÛÀÌ ItemToItem Àû¿ë °¡´ÉÇÏ´Ù" + "True�� ���� ����Ų �������� ItemToItem ���� �����ϴ�" wndMgr.SetUsableItem(self.hWnd, flag) ## Slot @@ -1521,7 +1527,7 @@ class TitleBar(Window): def MakeTitleBar(self, width, color): - ## ÇöÀç Color´Â »ç¿ëÇÏ°í ÀÖÁö ¾ÊÀ½ + ## ���� Color�� ����ϰ� ���� ���� width = max(64, width) @@ -2752,8 +2758,8 @@ class PythonScriptLoader(object): print "===== Load Script File : %s" % (FileName) try: - # chr, player µîÀº sandbox ³»¿¡¼­ import°¡ Çã¿ëµÇÁö ¾Ê±â ¶§¹®¿¡,(º¿ÀÌ ¾Ç¿ëÇÒ ¿©Áö°¡ ¸Å¿ì Å­.) - # ¹Ì¸® script dictionary¿¡ ÇÊ¿äÇÑ »ó¼ö¸¦ ³Ö¾î³õ´Â´Ù. + # chr, player ���� sandbox ������ import�� ������ �ʱ� ������,(���� �ǿ��� ������ �ſ� Å­.) + # �̸� script dictionary�� �ʿ��� ����� �־���´�. import chr import player import app diff --git a/src/EterLib/GrpExpandedImageInstance.cpp b/src/EterLib/GrpExpandedImageInstance.cpp index a634a506..0baae611 100644 --- a/src/EterLib/GrpExpandedImageInstance.cpp +++ b/src/EterLib/GrpExpandedImageInstance.cpp @@ -26,7 +26,11 @@ void CGraphicExpandedImageInstance::Delete(CGraphicExpandedImageInstance* pkImgI ms_kPool.Free(pkImgInst); } +#if defined(__BL_CLIP_MASK__) +void CGraphicExpandedImageInstance::OnRender(RECT* pClipRect) +#else void CGraphicExpandedImageInstance::OnRender() +#endif { CGraphicImage * pImage = m_roImage.GetPointer(); CGraphicTexture * pTexture = pImage->GetTexturePointer(); @@ -116,7 +120,7 @@ void CGraphicExpandedImageInstance::OnRender() break; } - // 2004.11.18.myevan.ctrl+alt+del ¹Ýº¹ »ç¿ë½Ã ƨ±â´Â ¹®Á¦ + // 2004.11.18.myevan.ctrl+alt+del �ݺ� ���� ƨ��� ���� if (CGraphicBase::SetPDTStream(vertices, 4)) { CGraphicBase::SetDefaultIndexBuffer(CGraphicBase::DEFAULT_IB_FILL_RECT); diff --git a/src/EterLib/GrpExpandedImageInstance.h b/src/EterLib/GrpExpandedImageInstance.h index b22ff006..2b7c0282 100644 --- a/src/EterLib/GrpExpandedImageInstance.h +++ b/src/EterLib/GrpExpandedImageInstance.h @@ -37,7 +37,11 @@ class CGraphicExpandedImageInstance : public CGraphicImageInstance protected: void Initialize(); +#if defined(__BL_CLIP_MASK__) + void OnRender(RECT* pClipRect); +#else void OnRender(); +#endif void OnSetImagePointer(); BOOL OnIsType(DWORD dwType); diff --git a/src/EterLib/GrpImageInstance.cpp b/src/EterLib/GrpImageInstance.cpp index 023f9c98..05475b5e 100644 --- a/src/EterLib/GrpImageInstance.cpp +++ b/src/EterLib/GrpImageInstance.cpp @@ -31,17 +31,29 @@ void CGraphicImageInstance::Delete(CGraphicImageInstance* pkImgInst) ms_kPool.Free(pkImgInst); } +#if defined(__BL_CLIP_MASK__) +void CGraphicImageInstance::Render(RECT* pClipRect) +#else void CGraphicImageInstance::Render() +#endif { if (IsEmpty()) return; assert(!IsEmpty()); +#if defined(__BL_CLIP_MASK__) + OnRender(pClipRect); +#else OnRender(); +#endif } +#if defined(__BL_CLIP_MASK__) +void CGraphicImageInstance::OnRender(RECT* pClipRect) +#else void CGraphicImageInstance::OnRender() +#endif { CGraphicImage * pImage = m_roImage.GetPointer(); CGraphicTexture * pTexture = pImage->GetTexturePointer(); @@ -56,34 +68,109 @@ void CGraphicImageInstance::OnRender() float sv = c_rRect.top * texReverseHeight; float eu = (c_rRect.left + (c_rRect.right-c_rRect.left)) * texReverseWidth; float ev = (c_rRect.top + (c_rRect.bottom-c_rRect.top)) * texReverseHeight; - - - TPDTVertex vertices[4]; - vertices[0].position.x = m_v2Position.x-0.5f; - vertices[0].position.y = m_v2Position.y-0.5f; - vertices[0].position.z = 0.0f; - vertices[0].texCoord = TTextureCoordinate(su, sv); - vertices[0].diffuse = m_DiffuseColor; - vertices[1].position.x = m_v2Position.x + fimgWidth-0.5f; - vertices[1].position.y = m_v2Position.y-0.5f; - vertices[1].position.z = 0.0f; - vertices[1].texCoord = TTextureCoordinate(eu, sv); - vertices[1].diffuse = m_DiffuseColor; +#if defined(__BL_CLIP_MASK__) + float sx = m_v2Position.x - 0.5f; + float sy = m_v2Position.y - 0.5f; + float ex = m_v2Position.x + fimgWidth - 0.5f; + float ey = m_v2Position.y + fimgHeight - 0.5f; - vertices[2].position.x = m_v2Position.x-0.5f; - vertices[2].position.y = m_v2Position.y + fimgHeight-0.5f; - vertices[2].position.z = 0.0f; - vertices[2].texCoord = TTextureCoordinate(su, ev); - vertices[2].diffuse = m_DiffuseColor; + if (pClipRect) + { + const float width = ex - sx; + const float height = ey - sy; + const float uDiff = eu - su; + const float vDiff = ev - sv; - vertices[3].position.x = m_v2Position.x + fimgWidth-0.5f; - vertices[3].position.y = m_v2Position.y + fimgHeight-0.5f; - vertices[3].position.z = 0.0f; - vertices[3].texCoord = TTextureCoordinate(eu, ev); - vertices[3].diffuse = m_DiffuseColor; + if (ex < pClipRect->left) + return; - // 2004.11.18.myevan.ctrl+alt+del ¹Ýº¹ »ç¿ë½Ã ƨ±â´Â ¹®Á¦ + if (ey < pClipRect->top) + return; + + if (sx > pClipRect->right) + return; + + if (sy > pClipRect->bottom) + return; + + if (sx < pClipRect->left) + { + su += (pClipRect->left - sx) / width * uDiff; + sx = pClipRect->left; + } + + if (sy < pClipRect->top) + { + sv += (pClipRect->top - sy) / height * vDiff; + sy = pClipRect->top; + } + + if (ex > pClipRect->right) + { + eu -= (ex - pClipRect->right) / width * uDiff; + ex = pClipRect->right; + } + + if (ey > pClipRect->bottom) + { + ev -= (ey - pClipRect->bottom) / height * vDiff; + ey = pClipRect->bottom; + } + } + + TPDTVertex vertices[4]; + vertices[0].position.x = sx; + vertices[0].position.y = sy; + vertices[0].position.z = 0.0f; + vertices[0].texCoord = TTextureCoordinate(su, sv); + vertices[0].diffuse = m_DiffuseColor; + + vertices[1].position.x = ex; + vertices[1].position.y = sy; + vertices[1].position.z = 0.0f; + vertices[1].texCoord = TTextureCoordinate(eu, sv); + vertices[1].diffuse = m_DiffuseColor; + + vertices[2].position.x = sx; + vertices[2].position.y = ey; + vertices[2].position.z = 0.0f; + vertices[2].texCoord = TTextureCoordinate(su, ev); + vertices[2].diffuse = m_DiffuseColor; + + vertices[3].position.x = ex; + vertices[3].position.y = ey; + vertices[3].position.z = 0.0f; + vertices[3].texCoord = TTextureCoordinate(eu, ev); + vertices[3].diffuse = m_DiffuseColor; +#else + TPDTVertex vertices[4]; + vertices[0].position.x = m_v2Position.x - 0.5f; + vertices[0].position.y = m_v2Position.y - 0.5f; + vertices[0].position.z = 0.0f; + vertices[0].texCoord = TTextureCoordinate(su, sv); + vertices[0].diffuse = m_DiffuseColor; + + vertices[1].position.x = m_v2Position.x + fimgWidth - 0.5f; + vertices[1].position.y = m_v2Position.y - 0.5f; + vertices[1].position.z = 0.0f; + vertices[1].texCoord = TTextureCoordinate(eu, sv); + vertices[1].diffuse = m_DiffuseColor; + + vertices[2].position.x = m_v2Position.x - 0.5f; + vertices[2].position.y = m_v2Position.y + fimgHeight - 0.5f; + vertices[2].position.z = 0.0f; + vertices[2].texCoord = TTextureCoordinate(su, ev); + vertices[2].diffuse = m_DiffuseColor; + + vertices[3].position.x = m_v2Position.x + fimgWidth - 0.5f; + vertices[3].position.y = m_v2Position.y + fimgHeight - 0.5f; + vertices[3].position.z = 0.0f; + vertices[3].texCoord = TTextureCoordinate(eu, ev); + vertices[3].diffuse = m_DiffuseColor; +#endif + + // 2004.11.18.myevan.ctrl+alt+del �ݺ� ���� ƨ��� ���� if (CGraphicBase::SetPDTStream(vertices, 4)) { CGraphicBase::SetDefaultIndexBuffer(CGraphicBase::DEFAULT_IB_FILL_RECT); @@ -207,7 +294,7 @@ void CGraphicImageInstance::Initialize() void CGraphicImageInstance::Destroy() { - m_roImage.SetPointer(NULL); // CRef ¿¡¼­ ·¹ÆÛ·±½º Ä«¿îÆ®°¡ ¶³¾îÁ®¾ß ÇÔ. + m_roImage.SetPointer(NULL); // CRef ���� ���۷��� ī��Ʈ�� �������� ��. Initialize(); } diff --git a/src/EterLib/GrpImageInstance.h b/src/EterLib/GrpImageInstance.h index 4826d587..c1f6ffa2 100644 --- a/src/EterLib/GrpImageInstance.h +++ b/src/EterLib/GrpImageInstance.h @@ -4,6 +4,7 @@ #include "GrpIndexBuffer.h" #include "GrpVertexBufferDynamic.h" #include "Pool.h" +#include "../UserInterface/Locale_inc.h" class CGraphicImageInstance { @@ -17,7 +18,11 @@ class CGraphicImageInstance void Destroy(); +#if defined(__BL_CLIP_MASK__) + void Render(RECT* pClipRect = NULL); +#else void Render(); +#endif void SetDiffuseColor(float fr, float fg, float fb, float fa); void SetPosition(float fx, float fy); @@ -38,7 +43,11 @@ class CGraphicImageInstance protected: void Initialize(); +#if defined(__BL_CLIP_MASK__) + virtual void OnRender(RECT* pClipRect); +#else virtual void OnRender(); +#endif virtual void OnSetImagePointer(); virtual BOOL OnIsType(DWORD dwType); diff --git a/src/EterLib/GrpTextInstance.cpp b/src/EterLib/GrpTextInstance.cpp index 0b3e4145..c7dd169e 100644 --- a/src/EterLib/GrpTextInstance.cpp +++ b/src/EterLib/GrpTextInstance.cpp @@ -6,6 +6,7 @@ #include "../EterLocale/StringCodec.h" #include "../EterBase/Utils.h" #include "../EterLocale/Arabic.h" +#include "../UserInterface/Locale_inc.h" extern DWORD GetDefaultCodePage(); @@ -121,12 +122,12 @@ int ReadToken(const char* token) void CGraphicTextInstance::Update() { - if (m_isUpdate) // ¹®ÀÚ¿­ÀÌ ¹Ù²î¾úÀ» ¶§¸¸ ¾÷µ¥ÀÌÆ® ÇÑ´Ù. + if (m_isUpdate) // ���ڿ��� �ٲ���� ���� ������Ʈ �Ѵ�. return; if (m_roText.IsNull()) { - Tracef("CGraphicTextInstance::Update - ÆùÆ®°¡ ¼³Á¤µÇÁö ¾Ê¾Ò½À´Ï´Ù\n"); + Tracef("CGraphicTextInstance::Update - ��Ʈ�� �������� �ʾҽ��ϴ�\n"); return; } @@ -139,7 +140,7 @@ void CGraphicTextInstance::Update() UINT defCodePage = GetDefaultCodePage(); - UINT dataCodePage = defCodePage; // ¾Æ¶ø ¹× º£Æ®³² ³»ºÎ µ¥ÀÌÅ͸¦ UTF8 À» »ç¿ëÇÏ·Á ÇßÀ¸³ª ½ÇÆÐ + UINT dataCodePage = defCodePage; // �ƶ� �� ��Ʈ�� ���� �����͸� UTF8 �� ����Ϸ� ������ ���� CGraphicFontTexture::TCharacterInfomation* pSpaceInfo = pFontTexture->GetCharacterInfomation(dataCodePage, ' '); @@ -185,7 +186,7 @@ void CGraphicTextInstance::Update() bool isEnglish = true; int nEnglishBase = wArabicTextLen - 1; - //<<ÇÏÀÌÆÛ ¸µÅ©>> + //<<������ ��ũ>> int x = 0; int len; @@ -194,7 +195,7 @@ void CGraphicTextInstance::Update() std::wstring hyperlinkBuffer; int no_hyperlink = 0; - // ½Éº¼·Î ³¡³ª¸é ¾Æ¶ø¾î ¸ðµå·Î ½ÃÀÛÇؾßÇÑ´Ù + // �ɺ��� ������ �ƶ��� ���� �����ؾ��Ѵ� if (Arabic_IsInSymbol(wArabicText[wArabicTextLen - 1])) { isEnglish = false; @@ -208,24 +209,24 @@ void CGraphicTextInstance::Update() if (isEnglish) { - // <<½Éº¼ÀÇ °æ¿ì (ex. ±âÈ£, °ø¹é)>> -> ¿µ¾î ¸ðµå À¯Áö. - // <<(½Éº¼ÀÌ ¾Æ´Ñ °Íµé : ¼ýÀÚ, ¿µ¾î, ¾Æ¶ø¾î)>> - // (1) ¸Ç ¾ÕÀÇ ½Éº¼ or + // <<�ɺ��� ��� (ex. ��ȣ, ����)>> -> ���� ��� ����. + // <<(�ɺ��� �ƴ� �͵� : ����, ����, �ƶ���)>> + // (1) �� ���� �ɺ� or // (2) - // 1) ¾Õ ±ÛÀÚ°¡ ¾Æ¶ø¾î ¾Æ´Ô && - // 2) µÞ ±ÛÀÚ°¡ ¾Æ¶ø¾î ¾Æ´Ô && - // 3) µÞ ±ÛÀÚ°¡ ½Éº¼'|'ÀÌ ¾Æ´Ô && + // 1) �� ���ڰ� �ƶ��� �ƴ� && + // 2) �� ���ڰ� �ƶ��� �ƴ� && + // 3) �� ���ڰ� �ɺ�'|'�� �ƴ� && // or - // (3) ÇöÀç ½Éº¼ÀÌ '|' - // <<¾Æ¶ø¾î ¸ðµå·Î ³Ñ¾î°¡´Â °æ¿ì : ½Éº¼¿¡¼­.>> - // 1) ¾Õ±ÛÀÚ ¾Æ¶ø¾î - // 2) µÞ±ÛÀÚ ¾Æ¶ø¾î + // (3) ���� �ɺ��� '|' + // <<�ƶ��� ���� �Ѿ�� ��� : �ɺ�����.>> + // 1) �ձ��� �ƶ��� + // 2) �ޱ��� �ƶ��� // // if (Arabic_IsInSymbol(wArabicChar) && ( (i == 0) || (i > 0 && - !(Arabic_HasPresentation(wArabicText, i - 1) || Arabic_IsInPresentation(wArabicText[i + 1])) && //¾Õ±ÛÀÚ, µÞ±ÛÀÚ°¡ ¾Æ¶ø¾î ¾Æ´Ô. + !(Arabic_HasPresentation(wArabicText, i - 1) || Arabic_IsInPresentation(wArabicText[i + 1])) && //�ձ���, �ޱ��ڰ� �ƶ��� �ƴ�. wArabicText[i+1] != '|' ) || wArabicText[i] == '|' @@ -234,10 +235,10 @@ void CGraphicTextInstance::Update() // pass int temptest = 1; } - // (1)¾Æ¶ø¾îÀ̰ųª (2)¾Æ¶ø¾î ´ÙÀ½ÀÇ ½Éº¼À̶ó¸é ¾Æ¶ø¾î ¸ðµå Àüȯ + // (1)�ƶ����̰ų� (2)�ƶ��� ������ �ɺ��̶�� �ƶ��� ��� ��ȯ else if (Arabic_IsInPresentation(wArabicChar) || Arabic_IsInSymbol(wArabicChar)) { - //±× Àü±îÁöÀÇ ¿µ¾î¸¦ ±×¸°´Ù. + //�� �������� ��� �׸���. for (int e = i + 1; e <= nEnglishBase;) { int ret = GetTextTag(&wArabicText[e], wArabicTextLen - e, len, hyperlinkBuffer); @@ -251,7 +252,7 @@ void CGraphicTextInstance::Update() kHyperlink.ex += charWidth; //x += charWidth; - //±âÁ¸ Ãß°¡ÇÑ ÇÏÀÌÆÛ¸µÅ©ÀÇ ÁÂÇ¥ ¼öÁ¤. + //���� �߰��� �����۸�ũ�� ��ǥ ����. for (int j = 1; j <= no_hyperlink; j++) { if(m_hyperlinkVector.size() < j) @@ -279,7 +280,7 @@ void CGraphicTextInstance::Update() if (hyperlinkStep == 1) { ++hyperlinkStep; - kHyperlink.ex = kHyperlink.sx = 0; // ½ÇÁ¦ ÅؽºÆ®°¡ ½ÃÀ۵Ǵ À§Ä¡ + kHyperlink.ex = kHyperlink.sx = 0; // ���� �ؽ�Ʈ�� ���۵Ǵ� ��ġ } else { @@ -299,7 +300,7 @@ void CGraphicTextInstance::Update() int charWidth = __DrawCharacter(pFontTexture, dataCodePage, Arabic_ConvSymbol(wArabicText[i]), dwColor); kHyperlink.ex += charWidth; - //±âÁ¸ Ãß°¡ÇÑ ÇÏÀÌÆÛ¸µÅ©ÀÇ ÁÂÇ¥ ¼öÁ¤. + //���� �߰��� �����۸�ũ�� ��ǥ ����. for (int j = 1; j <= no_hyperlink; j++) { if(m_hyperlinkVector.size() < j) @@ -313,16 +314,16 @@ void CGraphicTextInstance::Update() isEnglish = false; } } - else //[[[¾Æ¶ø¾î ¸ðµå]]] + else //[[[�ƶ��� ���]]] { - // ¾Æ¶ø¾îÀ̰ųª ¾Æ¶ø¾î Ãâ·ÂÁß ³ª¿À´Â ½Éº¼À̶ó¸é + // �ƶ����̰ų� �ƶ��� ����� ������ �ɺ��̶�� if (Arabic_IsInPresentation(wArabicChar) || Arabic_IsInSymbol(wArabicChar)) { int charWidth = __DrawCharacter(pFontTexture, dataCodePage, Arabic_ConvSymbol(wArabicText[i]), dwColor); kHyperlink.ex += charWidth; x += charWidth; - //±âÁ¸ Ãß°¡ÇÑ ÇÏÀÌÆÛ¸µÅ©ÀÇ ÁÂÇ¥ ¼öÁ¤. + //���� �߰��� �����۸�ũ�� ��ǥ ����. for (int j = 1; j <= no_hyperlink; j++) { if(m_hyperlinkVector.size() < j) @@ -333,7 +334,7 @@ void CGraphicTextInstance::Update() tempLink.sx += charWidth; } } - else //¿µ¾îÀ̰ųª, ¿µ¾î ´ÙÀ½¿¡ ³ª¿À´Â ½Éº¼À̶ó¸é, + else //�����̰ų�, ���� ������ ������ �ɺ��̶��, { nEnglishBase = i; isEnglish = true; @@ -355,7 +356,7 @@ void CGraphicTextInstance::Update() int charWidth = __DrawCharacter(pFontTexture, dataCodePage, wArabicText[e], dwColor); kHyperlink.ex += charWidth; - //±âÁ¸ Ãß°¡ÇÑ ÇÏÀÌÆÛ¸µÅ©ÀÇ ÁÂÇ¥ ¼öÁ¤. + //���� �߰��� �����۸�ũ�� ��ǥ ����. for (int j = 1; j <= no_hyperlink; j++) { if(m_hyperlinkVector.size() < j) @@ -383,7 +384,7 @@ void CGraphicTextInstance::Update() if (hyperlinkStep == 1) { ++hyperlinkStep; - kHyperlink.ex = kHyperlink.sx = 0; // ½ÇÁ¦ ÅؽºÆ®°¡ ½ÃÀ۵Ǵ À§Ä¡ + kHyperlink.ex = kHyperlink.sx = 0; // ���� �ؽ�Ʈ�� ���۵Ǵ� ��ġ } else { @@ -401,7 +402,7 @@ void CGraphicTextInstance::Update() } } - else // ¾Æ¶ø¿Ü ´Ù¸¥ Áö¿ª. + else // �ƶ��� �ٸ� ����. { int x = 0; int len; @@ -440,7 +441,7 @@ void CGraphicTextInstance::Update() if (hyperlinkStep == 1) { ++hyperlinkStep; - kHyperlink.ex = kHyperlink.sx = x; // ½ÇÁ¦ ÅؽºÆ®°¡ ½ÃÀ۵Ǵ À§Ä¡ + kHyperlink.ex = kHyperlink.sx = x; // ���� �ؽ�Ʈ�� ���۵Ǵ� ��ġ } else { @@ -460,7 +461,7 @@ void CGraphicTextInstance::Update() if (token < end) { int newCodePage = ReadToken(token); - dataCodePage = newCodePage; // ¾Æ¶ø ¹× º£Æ®³² ³»ºÎ µ¥ÀÌÅ͸¦ UTF8 À» »ç¿ëÇÏ·Á ÇßÀ¸³ª ½ÇÆÐ + dataCodePage = newCodePage; // �ƶ� �� ��Ʈ�� ���� �����͸� UTF8 �� ����Ϸ� ������ ���� begin = token + 5; } else @@ -570,7 +571,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) CGraphicFontTexture::TCharacterInfomation* pCurCharInfo; - // Å׵θ® + // �׵θ� if (m_isOutline) { fCurX=fStanX; @@ -586,7 +587,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) fFontHeight=float(pCurCharInfo->height); fFontAdvance=float(pCurCharInfo->advance); - // NOTE : ÆùÆ® Ãâ·Â¿¡ Width Á¦ÇÑÀ» µÓ´Ï´Ù. - [levites] + // NOTE : ��Ʈ ��¿� Width ������ �Ӵϴ�. - [levites] if ((fCurX+fFontWidth)-m_v3Position.x > m_fLimitWidth) { if (m_isMultiLine) @@ -600,6 +601,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) } } +#if !defined(__BL_CLIP_MASK__) if (pClipRect) { if (fCurY <= pClipRect->top) @@ -608,23 +610,97 @@ void CGraphicTextInstance::Render(RECT * pClipRect) continue; } } +#endif fFontSx = fCurX - 0.5f; fFontSy = fCurY - 0.5f; fFontEx = fFontSx + fFontWidth; fFontEy = fFontSy + fFontHeight; +#if defined(__BL_CLIP_MASK__) + float su = pCurCharInfo->left; + float sv = pCurCharInfo->top; + float eu = pCurCharInfo->right; + float ev = pCurCharInfo->bottom; + + if (pClipRect) + { + const float width = pCurCharInfo->right - pCurCharInfo->left; + const float height = pCurCharInfo->bottom - pCurCharInfo->top; + + if (fFontEx <= pClipRect->left) + { + fCurX += fFontAdvance; + continue; + } + + if (fFontSx < pClipRect->left) + { + su += (pClipRect->left - fFontSx) / fFontWidth * width; + fFontSx = pClipRect->left; + } + + if (fFontEy <= pClipRect->top) + { + fCurX += fFontAdvance; + continue; + } + + if (fFontSy < pClipRect->top) + { + sv += (pClipRect->top - fFontSy) / fFontHeight * height; + fFontSy = pClipRect->top; + } + + if (fFontSx >= pClipRect->right) + { + fCurX += fFontAdvance; + continue; + } + + if (fFontEx > pClipRect->right) + { + eu -= (fFontEx - pClipRect->right) / fFontWidth * width; + fFontEx = pClipRect->right; + } + + if (fFontSy >= pClipRect->bottom) + { + fCurX += fFontAdvance; + continue; + } + + if (fFontEy > pClipRect->bottom) + { + ev -= (fFontEy - pClipRect->bottom) / fFontHeight * height; + fFontEy = pClipRect->bottom; + } + } + 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[0].u = su; + akVertex[0].v = sv; + akVertex[1].u = su; + akVertex[1].v = ev; + akVertex[2].u = eu; + akVertex[2].v = sv; + akVertex[3].u = eu; + akVertex[3].v = ev; +#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; @@ -636,7 +712,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) 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; @@ -646,7 +722,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); - // ¿À¸¥ + // ���� akVertex[0].x=fFontSx+fFontHalfWeight-feather; akVertex[1].x=fFontSx+fFontHalfWeight-feather; akVertex[2].x=fFontEx+fFontHalfWeight+feather; @@ -660,7 +736,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) 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; @@ -670,7 +746,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) 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; @@ -684,7 +760,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) } } - // ¸ÞÀÎ ÆùÆ® + // ���� ��Ʈ fCurX=fStanX; fCurY=fStanY; fFontMaxHeight=0.0f; @@ -698,7 +774,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) fFontMaxHeight=max(fFontHeight, pCurCharInfo->height); fFontAdvance=float(pCurCharInfo->advance); - // NOTE : ÆùÆ® Ãâ·Â¿¡ Width Á¦ÇÑÀ» µÓ´Ï´Ù. - [levites] + // NOTE : ��Ʈ ��¿� Width ������ �Ӵϴ�. - [levites] if ((fCurX+fFontWidth)-m_v3Position.x > m_fLimitWidth) { if (m_isMultiLine) @@ -712,6 +788,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) } } +#if !defined(__BL_CLIP_MASK__) if (pClipRect) { if (fCurY <= pClipRect->top) @@ -720,12 +797,96 @@ void CGraphicTextInstance::Render(RECT * pClipRect) continue; } } +#endif fFontSx = fCurX-0.5f; fFontSy = fCurY-0.5f; fFontEx = fFontSx + fFontWidth; fFontEy = fFontSy + fFontHeight; +#if defined(__BL_CLIP_MASK__) + float su = pCurCharInfo->left; + float sv = pCurCharInfo->top; + float eu = pCurCharInfo->right; + float ev = pCurCharInfo->bottom; + + if (pClipRect) + { + const float width = pCurCharInfo->right - pCurCharInfo->left; + const float height = pCurCharInfo->bottom - pCurCharInfo->top; + + if (fFontEx <= pClipRect->left) + { + fCurX += fFontAdvance; + continue; + } + + if (fFontSx < pClipRect->left) + { + su += (pClipRect->left - fFontSx) / fFontWidth * width; + fFontSx = pClipRect->left; + } + + if (fFontEy <= pClipRect->top) + { + fCurX += fFontAdvance; + continue; + } + + if (fFontSy < pClipRect->top) + { + sv += (pClipRect->top - fFontSy) / fFontHeight * height; + fFontSy = pClipRect->top; + } + + if (fFontSx >= pClipRect->right) + { + fCurX += fFontAdvance; + continue; + } + + if (fFontEx > pClipRect->right) + { + eu -= (fFontEx - pClipRect->right) / fFontWidth * width; + fFontEx = pClipRect->right; + } + + if (fFontSy >= pClipRect->bottom) + { + fCurX += fFontAdvance; + continue; + } + + if (fFontEy > pClipRect->bottom) + { + ev -= (fFontEy - pClipRect->bottom) / fFontHeight * height; + fFontEy = pClipRect->bottom; + } + } + + pFontTexture->SelectTexture(pCurCharInfo->index); + STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture()); + + akVertex[0].x = fFontSx; + akVertex[0].y = fFontSy; + akVertex[0].u = su; + akVertex[0].v = sv; + + akVertex[1].x = fFontSx; + akVertex[1].y = fFontEy; + akVertex[1].u = su; + akVertex[1].v = ev; + + akVertex[2].x = fFontEx; + akVertex[2].y = fFontSy; + akVertex[2].u = eu; + akVertex[2].v = sv; + + akVertex[3].x = fFontEx; + akVertex[3].y = fFontEy; + akVertex[3].u = eu; + akVertex[3].v = ev; +#else pFontTexture->SelectTexture(pCurCharInfo->index); STATEMANAGER.SetTexture(0, pFontTexture->GetD3DTexture()); @@ -748,6 +909,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect) akVertex[3].y=fFontEy; akVertex[3].u=pCurCharInfo->right; akVertex[3].v=pCurCharInfo->bottom; +#endif //m_dwColorInfoVector[i]; //m_dwTextColor; @@ -811,9 +973,9 @@ void CGraphicTextInstance::Render(RECT * pClipRect) sy -= float(m_textHeight) / 2.0f; break; } - // ÃÖÀûÈ­ »çÇ× - // °°ÀºÅؽºÃĸ¦ »ç¿ëÇÑ´Ù¸é... STRIPÀ» ±¸¼ºÇÏ°í, ÅؽºÃÄ°¡ º¯°æµÇ°Å³ª ³¡³ª¸é DrawPrimitive¸¦ È£ÃâÇØ - // ÃÖ´ëÇÑ ¼ýÀÚ¸¦ ÁÙÀ̵µ·ÏÇÏÀÚ! + // ����ȭ ���� + // �����ؽ��ĸ� ����Ѵٸ�... STRIP�� �����ϰ�, �ؽ��İ� ����ǰų� ������ DrawPrimitive�� ȣ���� + // �ִ��� ���ڸ� ���̵�������! TPDTVertex vertices[4]; vertices[0].diffuse = diffuse; @@ -865,13 +1027,13 @@ void CGraphicTextInstance::Render(RECT * pClipRect) 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; @@ -1063,7 +1225,7 @@ WORD CGraphicTextInstance::GetTextLineCount() float fFontAdvance=float(pCurCharInfo->advance); //float fFontHeight=float(pCurCharInfo->height); - // NOTE : ÆùÆ® Ãâ·Â¿¡ Width Á¦ÇÑÀ» µÓ´Ï´Ù. - [levites] + // NOTE : ��Ʈ ��¿� Width ������ �Ӵϴ�. - [levites] if (fx+fFontWidth > m_fLimitWidth) { fx = 0.0f; @@ -1110,7 +1272,7 @@ void CGraphicTextInstance::__Initialize() m_vAlign = VERTICAL_ALIGN_TOP; m_iMax = 0; - m_fLimitWidth = 1600.0f; // NOTE : ÇØ»óµµÀÇ ÃÖ´ëÄ¡. À̺¸´Ù ±æ°Ô ¾µ ÀÏÀÌ ÀÖÀ»±î? - [levites] + m_fLimitWidth = 1600.0f; // NOTE : �ػ��� �ִ�ġ. �̺��� ��� �� ���� ������? - [levites] m_isCursor = false; m_isSecret = false; diff --git a/src/EterPythonLib/PythonWindow.cpp b/src/EterPythonLib/PythonWindow.cpp index fd273253..6096df41 100644 --- a/src/EterPythonLib/PythonWindow.cpp +++ b/src/EterPythonLib/PythonWindow.cpp @@ -8,7 +8,6 @@ BOOL g_bOutlineBoxEnable = FALSE; namespace UI { - CWindow::CWindow(PyObject * ppyObject) : m_x(0), m_y(0), @@ -30,6 +29,11 @@ namespace UI m_HorizontalAlign = HORIZONTAL_ALIGN_LEFT; m_VerticalAlign = VERTICAL_ALIGN_TOP; m_rect.bottom = m_rect.left = m_rect.right = m_rect.top = 0; +#if defined(__BL_CLIP_MASK__) + m_bEnableMask = false; + m_pMaskWindow = NULL; + memset(&m_rMaskRect, 0, sizeof(m_rMaskRect)); +#endif m_limitBiasRect.bottom = m_limitBiasRect.left = m_limitBiasRect.right = m_limitBiasRect.top = 0; } @@ -66,10 +70,13 @@ namespace UI void CWindow::Clear() { - // FIXME : ChildrenÀ» Áï½Ã DeleteÇÏÁö´Â ¾Ê´Â´Ù. - // ¾îÂ÷ÇÇ PythonÂÊ¿¡¼­ Destroy°¡ Çϳª¾¿ ´Ù½Ã È£Ãâ µÉ °ÍÀ̹ǷÎ.. - // ÇÏÁö¸¸ ¸¸¾àÀ» À§ÇØ ¸µÅ©´Â ²÷¾î ³õ´Â´Ù. - // ´õ ÁÁÀº ÇüÅ´ Àִ°¡? - [levites] +#if defined(__BL_CLIP_MASK__) + m_pMaskWindow = NULL; +#endif + // FIXME : Children�� ��� Delete������ �ʴ´�. + // ������ Python�ʿ��� Destroy�� �ϳ��� �ٽ� ȣ�� �� ���̹Ƿ�.. + // ������ ������ ���� ��ũ�� ���� ���´�. + // �� ���� ���´� �ִ°�? - [levites] std::for_each(m_pChildList.begin(), m_pChildList.end(), FClear()); m_pChildList.clear(); @@ -93,8 +100,8 @@ namespace UI m_bShow = false; } - // NOTE : IsShow´Â "ÀÚ½ÅÀÌ º¸À̴°¡?" ÀÌÁö¸¸, __IsShowingÀº "ÀÚ½ÅÀÌ ±×·ÁÁö°í Àִ°¡?" ¸¦ üũÇÑ´Ù - // ÀÚ½ÅÀº Show Áö¸¸ Tree À§ÂÊÀÇ Parent Áß Çϳª´Â Hide ÀÏ ¼ö ÀÖÀ¸¹Ç·Î.. - [levites] + // NOTE : IsShow�� "�ڽ��� ���̴°�?" ������, __IsShowing�� "�ڽ��� �׷����� �ִ°�?" �� üũ�Ѵ� + // �ڽ��� Show ���� Tree ������ Parent �� �ϳ��� Hide �� �� �����Ƿ�.. - [levites] bool CWindow::IsRendering() { if (!IsShow()) @@ -427,6 +434,41 @@ namespace UI PyCallClassMemberFunc(m_poHandler, "OnIMEUpdate", BuildEmptyTuple()); } +#if defined(__BL_CLIP_MASK__) + void CWindow::SetClippingMaskRect(const RECT& rMask) + { + m_bEnableMask = true; + m_rMaskRect = rMask; + + TWindowContainer::const_reverse_iterator itor; + for (itor = m_pChildList.rbegin(); itor != m_pChildList.rend(); ++itor) + { + CWindow* pWindow = *itor; + + if (pWindow) + pWindow->SetClippingMaskRect(rMask); + } + } + + void CWindow::SetClippingMaskWindow(CWindow* pMaskWindow) + { + if (!pMaskWindow) + return; + + m_bEnableMask = true; + m_pMaskWindow = pMaskWindow; + + TWindowContainer::const_reverse_iterator itor; + for (itor = m_pChildList.rbegin(); itor != m_pChildList.rend(); ++itor) + { + CWindow* pWindow = *itor; + + if (pWindow) + pWindow->SetClippingMaskWindow(pMaskWindow); + } + } +#endif + BOOL CWindow::RunIMETabEvent() { if (!IsRendering()) @@ -577,7 +619,7 @@ namespace UI BOOL CWindow::OnMouseLeftButtonUp() { PyCallClassMemberFunc(m_poHandler, "OnMouseLeftButtonUp", BuildEmptyTuple()); - return TRUE; // NOTE : ButtonUpÀº ¿¹¿Ü·Î ¹«Á¶°Ç TRUE + return TRUE; // NOTE : ButtonUp�� ���ܷ� ������ TRUE } BOOL CWindow::OnMouseLeftButtonDoubleClick() @@ -1027,6 +1069,23 @@ namespace UI m_TextInstance.Update(); } +#if defined(__BL_CLIP_MASK__) + void CTextLine::OnUpdate() + { + if (!IsShow()) + return; + + if (m_bEnableMask && m_pMaskWindow) + m_rMaskRect = m_pMaskWindow->GetRect(); + + m_TextInstance.Update(); + } + void CTextLine::OnRender() + { + if (IsShow()) + m_TextInstance.Render(m_bEnableMask ? &m_rMaskRect : NULL); + } +#else void CTextLine::OnUpdate() { if (IsShow()) @@ -1037,6 +1096,7 @@ namespace UI if (IsShow()) m_TextInstance.Render(); } +#endif void CTextLine::OnChangePosition() { @@ -1271,9 +1331,37 @@ namespace UI return m_pImageInstance->GetHeight(); } +#if defined(__BL_CLIP_MASK__) + void CImageBox::OnUpdate() + { + if (!m_pImageInstance) + return; + + if (!IsShow()) + return; + + if (!m_bEnableMask) + return; + + if (!m_pMaskWindow) + return; + + m_rMaskRect = m_pMaskWindow->GetRect(); + } + + void CImageBox::OnRender() + { + if (!m_pImageInstance) + return; + + if (IsShow()) + m_pImageInstance->Render(m_bEnableMask ? &m_rMaskRect : NULL); + } +#else void CImageBox::OnUpdate() { } + void CImageBox::OnRender() { if (!m_pImageInstance) @@ -1282,6 +1370,8 @@ namespace UI if (IsShow()) m_pImageInstance->Render(); } +#endif + void CImageBox::OnChangePosition() { if (!m_pImageInstance) @@ -1291,7 +1381,7 @@ namespace UI } /////////////////////////////////////////////////////////////////////////////////////////////// - // MarkBox - ¸¶Å© Ãâ·Â¿ë UI À©µµ¿ì + // MarkBox - ��ũ ��¿� UI ������ /////////////////////////////////////////////////////////////////////////////////////////////// CMarkBox::CMarkBox(PyObject * ppyObject) : CWindow(ppyObject) { @@ -1742,9 +1832,41 @@ namespace UI PyCallClassMemberFunc(m_poHandler, "DownEvent", BuildEmptyTuple()); } +#if defined(__BL_CLIP_MASK__) + void CButton::OnUpdate() + { + if (!m_bEnableMask) + return; + + if (!m_pMaskWindow) + return; + + m_rMaskRect = m_pMaskWindow->GetRect(); + } + + void CButton::OnRender() + { + if (!IsShow()) + return; + + if (m_pcurVisual) + { + if (m_isFlash) + if (!IsIn()) + if (int(timeGetTime() / 500) % 2) + { + return; + } + m_pcurVisual->Render(m_bEnableMask ? &m_rMaskRect : NULL); + } + + PyCallClassMemberFunc(m_poHandler, "OnRender", BuildEmptyTuple()); + } +#else void CButton::OnUpdate() { } + void CButton::OnRender() { if (!IsShow()) @@ -1764,6 +1886,8 @@ namespace UI PyCallClassMemberFunc(m_poHandler, "OnRender", BuildEmptyTuple()); } +#endif + void CButton::OnChangePosition() { if (m_pcurVisual) diff --git a/src/EterPythonLib/PythonWindow.h b/src/EterPythonLib/PythonWindow.h index ef8cb8ad..102220a3 100644 --- a/src/EterPythonLib/PythonWindow.h +++ b/src/EterPythonLib/PythonWindow.h @@ -1,6 +1,7 @@ #pragma once #include "../eterBase/Utils.h" +#include "../UserInterface/Locale_inc.h" namespace UI { @@ -28,16 +29,16 @@ namespace UI enum EFlags { - FLAG_MOVABLE = (1 << 0), // ¿òÁ÷ÀÏ ¼ö Àִ â - FLAG_LIMIT = (1 << 1), // âÀÌ È­¸éÀ» ¹þ¾î³ªÁö ¾ÊÀ½ - FLAG_SNAP = (1 << 2), // ½º³À µÉ ¼ö Àִ â + FLAG_MOVABLE = (1 << 0), // ������ �� �ִ� â + FLAG_LIMIT = (1 << 1), // � ȭ���� ����� ���� + FLAG_SNAP = (1 << 2), // ���� �� �� �ִ� â FLAG_DRAGABLE = (1 << 3), - FLAG_ATTACH = (1 << 4), // ¿ÏÀüÈ÷ ºÎ¸ð¿¡ ºÙ¾î Àִ â (For Drag / ex. ScriptWindow) - FLAG_RESTRICT_X = (1 << 5), // Á¿ì À̵¿ Á¦ÇÑ - FLAG_RESTRICT_Y = (1 << 6), // »óÇÏ À̵¿ Á¦ÇÑ + FLAG_ATTACH = (1 << 4), // ������ �θ� �پ� �ִ� â (For Drag / ex. ScriptWindow) + FLAG_RESTRICT_X = (1 << 5), // �¿� �̵� ���� + FLAG_RESTRICT_Y = (1 << 6), // ���� �̵� ���� FLAG_NOT_CAPTURE = (1 << 7), - FLAG_FLOAT = (1 << 8), // °øÁß¿¡ ¶°À־ ¼ø¼­ Àç¹èÄ¡°¡ µÇ´Â â - FLAG_NOT_PICK = (1 << 9), // ¸¶¿ì½º¿¡ ÀÇÇØ PickµÇÁö ¾Ê´Â â + FLAG_FLOAT = (1 << 8), // ���߿� ���־ ���� ���ġ�� �Ǵ� â + FLAG_NOT_PICK = (1 << 9), // ���콺�� ���� Pick���� �ʴ� â FLAG_IGNORE_SIZE = (1 << 10), FLAG_RTL = (1 << 11), // Right-to-left }; @@ -91,8 +92,8 @@ namespace UI bool IsIn(long x, long y); bool IsIn(); CWindow * PickWindow(long x, long y); - CWindow * PickTopWindow(long x, long y); // NOTE : ChildrenÀ¸·Î ³»·Á°¡Áö ¾Ê°í »óÀ§¿¡¼­¸¸ - // üũ Çϴ ƯȭµÈ ÇÔ¼ö + CWindow * PickTopWindow(long x, long y); // NOTE : Children���� �������� �ʰ� ���������� + // üũ �ϴ� Ưȭ�� �Լ� void __RemoveReserveChildren(); @@ -159,6 +160,10 @@ namespace UI ///////////////////////////////////// virtual BOOL IsWindow() { return TRUE; } +#if defined(__BL_CLIP_MASK__) + virtual void SetClippingMaskRect(const RECT& rMask); + virtual void SetClippingMaskWindow(CWindow* pMaskWindow); +#endif ///////////////////////////////////// protected: @@ -166,10 +171,10 @@ namespace UI EHorizontalAlign m_HorizontalAlign; EVerticalAlign m_VerticalAlign; - long m_x, m_y; // X,Y »ó´ëÁÂÇ¥ - long m_lWidth, m_lHeight; // Å©±â - RECT m_rect; // Global ÁÂÇ¥ - RECT m_limitBiasRect; // limit bias °ª + long m_x, m_y; // X,Y �����ǥ + long m_lWidth, m_lHeight; // ũ�� + RECT m_rect; // Global ��ǥ + RECT m_limitBiasRect; // limit bias �� bool m_bMovable; bool m_bShow; @@ -183,7 +188,12 @@ namespace UI BOOL m_isUpdatingChildren; TWindowContainer m_pReserveChildList; - +#if defined(__BL_CLIP_MASK__) + bool m_bEnableMask; + CWindow* m_pMaskWindow; + RECT m_rMaskRect; +#endif + #ifdef _DEBUG public: DWORD DEBUG_dwCounter; diff --git a/src/EterPythonLib/PythonWindowManager.cpp b/src/EterPythonLib/PythonWindowManager.cpp index 1b48e84e..aee2bf73 100644 --- a/src/EterPythonLib/PythonWindowManager.cpp +++ b/src/EterPythonLib/PythonWindowManager.cpp @@ -534,7 +534,7 @@ namespace UI if (m_pActiveWindow) m_pActiveWindow->OnKillFocus(); - // ÀÌ¹Ì ¶ôµÈ À©µµ¿ì¸®½ºÆ®¾È¿¡ ÀÖ´Ù¸é Á¦°ÅÇÑ´Ù.. + // �̹� ���� �����츮��Ʈ�ȿ� �ִٸ� �����Ѵ�.. m_LockWindowList.remove(pWin); if (m_pLockWindow) @@ -575,8 +575,8 @@ namespace UI if (m_pActiveWindow) { - // NOTE : ´©ÀûµÈ Window°¡ ¸¹¾ÆÁö¸é Clear¸¦ ÇØÁà¾ß ÇÒ±î? - // ÀÏ´ÜÀº Áߺ¹ ´©ÀûÀÌ ¾ÈµÇ¸ç Æ÷Ä¿½º µÇ´Â °¹¼ö ÀÚü°¡ 5°³ ¹Ì¸¸ÀÌ´Ï ±»ÀÌ ÇÊ¿äÇÏÁö´Â ¾ÊÀ» µí.. - [levites] + // NOTE : ������ Window�� �������� Clear�� ����� �ұ�? + // �ϴ��� �ߺ� ������ �ȵǸ� ��Ŀ�� �Ǵ� ���� ��ü�� 5�� �̸��̴� ���� �ʿ������� ���� ��.. - [levites] m_ActiveWindowList.push_back(m_pActiveWindow); m_pActiveWindow->OnKillFocus(); } @@ -618,8 +618,8 @@ namespace UI CWindow * pParentWindow = pWin->GetParent(); pParentWindow->SetTop(pWin); - // NOTE : Capture°¡ ¸®¼ÂµÈ´Ù..? - [levites] - // NOTE : Àκ¥Å丮¿¡¼­ ¾ÆÀÌÅÛÀ» µå·¡±× Çؼ­ ¹Û¿¡´Ù ³õÀ»¶§ ĸÃç°¡ ³²¾Æ¼­ âÀÇ ¹öÆ°À» µÎ¹ø ´­·¯¾ß ÇÏ´Â ¹ö±×¸¦ À§ÇØ Ãß°¡ + // NOTE : Capture�� ���µȴ�..? - [levites] + // NOTE : �κ��丮���� �������� �巡�� �ؼ� �ۿ��� ������ ĸ�簡 ���Ƽ� � ��ư�� �ι� ������ �ϴ� ���׸� ���� �߰� // ResetCapture(); } @@ -628,7 +628,7 @@ namespace UI if (m_pLockWindow) return; - // GameLayer¿¡ ¼ÓÇØ ÀÖ´Â À©µµ¿ì°¡ ÇÇÅ· µÆ´Ù¸é ¹«Á¶°Ç SetTopÀ» ÇØÁØ´Ù. + // GameLayer�� ���� �ִ� �����찡 ��ŷ �ƴٸ� ������ SetTop�� ���ش�. TLayerContainer::iterator itor = m_LayerWindowMap.find("UI"); if (itor == m_LayerWindowMap.end()) return; @@ -896,7 +896,7 @@ namespace UI { if (m_pLeftCaptureWindow->OnMouseLeftButtonUp()) { - // NOTE : ¿©±â¼­ m_pLeftCaptureWindow°¡ NULL ÀÏ ¼ö ÀÖ½À´Ï´Ù!! - [levites] + // NOTE : ���⼭ m_pLeftCaptureWindow�� NULL �� �� �ֽ��ϴ�!! - [levites] m_pLeftCaptureWindow = NULL; return; } @@ -1099,7 +1099,7 @@ namespace UI return; } - // NOTE : Àüü·Î µ¹¸®Áö ¾Ê°í ActivateµÇ¾îÀÖ´Â EditLine¿¡¸¸ º¸³»´Â À̺¥Æ® + // NOTE : ��ü�� ������ �ʰ� Activate�Ǿ��ִ� EditLine���� ������ �̺�Ʈ } void CWindowManager::RunChangeCodePage() diff --git a/src/EterPythonLib/PythonWindowManagerModule.cpp b/src/EterPythonLib/PythonWindowManagerModule.cpp index 4e9fb4dc..fcbd8571 100644 --- a/src/EterPythonLib/PythonWindowManagerModule.cpp +++ b/src/EterPythonLib/PythonWindowManagerModule.cpp @@ -3,6 +3,42 @@ #include "PythonSlotWindow.h" #include "PythonGridSlotWindow.h" +#if defined(__BL_CLIP_MASK__) +PyObject* wndMgrSetClippingMaskRect(PyObject* poSelf, PyObject* poArgs) +{ + UI::CWindow* pWindow; + if (!PyTuple_GetWindow(poArgs, 0, &pWindow)) + return Py_BuildException(); + + RECT r; + if (!PyTuple_GetLong(poArgs, 1, &r.left)) + return Py_BuildException(); + if (!PyTuple_GetLong(poArgs, 2, &r.top)) + return Py_BuildException(); + if (!PyTuple_GetLong(poArgs, 3, &r.right)) + return Py_BuildException(); + if (!PyTuple_GetLong(poArgs, 4, &r.bottom)) + return Py_BuildException(); + + pWindow->SetClippingMaskRect(r); + return Py_BuildNone(); +} + +PyObject* wndMgrSetClippingMaskWindow(PyObject* poSelf, PyObject* poArgs) +{ + UI::CWindow* pWindow; + if (!PyTuple_GetWindow(poArgs, 0, &pWindow)) + return Py_BuildException(); + + UI::CWindow* pMaskWindow; + if (!PyTuple_GetWindow(poArgs, 1, &pMaskWindow)) + return Py_BuildException(); + + pWindow->SetClippingMaskWindow(pMaskWindow); + return Py_BuildNone(); +} +#endif + bool PyTuple_GetWindow(PyObject* poArgs, int pos, UI::CWindow ** ppRetWindow) { int iHandle; @@ -1260,7 +1296,7 @@ PyObject * wndMgrSetSlotCoolTime(PyObject * poSelf, PyObject * poArgs) PyObject * wndMgrSetToggleSlot(PyObject * poSelf, PyObject * poArgs) { - assert(!"wndMgrSetToggleSlot - »ç¿ëÇÏÁö ¾Ê´Â ÇÔ¼ö"); + assert(!"wndMgrSetToggleSlot - ������� �ʴ� �Լ�"); return Py_BuildNone(); } @@ -1883,13 +1919,13 @@ PyObject * wndMarkBox_SetImageFilename(PyObject * poSelf, PyObject * poArgs) PyObject * wndMarkBox_SetImage(PyObject * poSelf, PyObject * poArgs) { - // ¾Æ¹«°Íµµ ÇÏÁö ¾ÊÀ½ + // �ƹ��͵� ���� ���� return Py_BuildNone(); } PyObject * wndMarkBox_Load(PyObject * poSelf, PyObject * poArgs) { - // ¾Æ¹«°Íµµ ÇÏÁö ¾ÊÀ½ + // �ƹ��͵� ���� ���� return Py_BuildNone(); } @@ -2300,6 +2336,11 @@ void initwndMgr() { static PyMethodDef s_methods[] = { +#if defined(__BL_CLIP_MASK__) + { "SetClippingMaskRect", wndMgrSetClippingMaskRect, METH_VARARGS }, + { "SetClippingMaskWindow", wndMgrSetClippingMaskWindow, METH_VARARGS }, +#endif + // WindowManager { "SetMouseHandler", wndMgrSetMouseHandler, METH_VARARGS }, { "SetScreenSize", wndMgrSetScreenSize, METH_VARARGS }, @@ -2495,7 +2536,7 @@ void initwndMgr() PyObject * poModule = Py_InitModule("wndMgr", s_methods); -// ÇϳªÀÇ µñ¼Å³Ê¸®¿¡ ³Ê¹« ¸¹Àº FunctionÀÌ Æ÷ÇÔ µÇ´Â °Í °°¾Æ ÀÌ·±½ÄÀ¸·Î µñ¼Å³Ê¸®¸¦ ³ª´©´Â °ÍÀ» °í·Á Áß - [levites] +// �ϳ��� ��ųʸ��� �ʹ� ���� Function�� ���� �Ǵ� �� ���� �̷������� ��ųʸ��� ������ ���� ���� �� - [levites] // PyObject * poMgrModule = Py_InitModule("wndMgr", s_methods); // PyObject * poTextModule = Py_InitModule("wndText", s_methods); // PyObject * poSlotModule = Py_InitModule("wndSlot", s_methods); diff --git a/src/UserInterface/Locale.h b/src/UserInterface/Locale.h index 229ea6ec..35c60cc2 100644 --- a/src/UserInterface/Locale.h +++ b/src/UserInterface/Locale.h @@ -5,8 +5,8 @@ #define ENABLE_COSTUME_SYSTEM #define ENABLE_ENERGY_SYSTEM #define ENABLE_DRAGON_SOUL_SYSTEM -#define ENABLE_NEW_EQUIPMENT_SYSTEM - +#define ENABLE_NEW_EQUIPMENT_SYSTEM +#define __BL_CLIP_MASK__ bool LocaleService_IsYMIR(); bool LocaleService_IsJAPAN(); diff --git a/src/UserInterface/PythonApplicationModule.cpp b/src/UserInterface/PythonApplicationModule.cpp index 17d47dd9..98b1a7e7 100644 --- a/src/UserInterface/PythonApplicationModule.cpp +++ b/src/UserInterface/PythonApplicationModule.cpp @@ -1507,6 +1507,12 @@ void initapp() PyModule_AddIntConstant(poModule, "ENABLE_DRAGON_SOUL_SYSTEM", 0); #endif +#if defined(__BL_CLIP_MASK__) + PyModule_AddIntConstant(poModule, "__BL_CLIP_MASK__", true); +#else + PyModule_AddIntConstant(poModule, "__BL_CLIP_MASK__", false); +#endif + #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM PyModule_AddIntConstant(poModule, "ENABLE_NEW_EQUIPMENT_SYSTEM", 1); #else diff --git a/src/UserInterface/PythonChat.cpp b/src/UserInterface/PythonChat.cpp index 28acd7e8..29ed826a 100644 --- a/src/UserInterface/PythonChat.cpp +++ b/src/UserInterface/PythonChat.cpp @@ -474,7 +474,7 @@ void CPythonChat::AppendChat(int iType, const char * c_szChat) TChatSet * pChatSet = &(itor->second); //pChatLine->SetColor(itor->first, GetChatColor(iType)); - // Edit Mode ¸¦ ¾ïÁö·Î ³¢¿ö ¸ÂÃß±â À§ÇØ Ãß°¡ + // Edit Mode �� ������ ���� ���߱� ���� �߰� if (BOARD_STATE_EDIT == pChatSet->m_iBoardState) { ArrangeShowingChat(itor->first); @@ -512,12 +512,12 @@ DWORD CPythonChat::GetChatColor(int iType) void CPythonChat::IgnoreCharacter(const char * c_szName) { TIgnoreCharacterSet::iterator itor = m_IgnoreCharacterSet.find(c_szName); - // NOTE : ÀÌ¹Ì Â÷´Ü ÁßÀ̶ó¸é.. + // NOTE : �̹� ���� ���̶��.. if (m_IgnoreCharacterSet.end() != itor) { m_IgnoreCharacterSet.erase(itor); } - // NOTE : Â÷´ÜÀÌ µÇÁö ¾ÊÀº ij¸¯ÅͶó¸é.. + // NOTE : ������ ���� ���� ij���Ͷ��.. else { m_IgnoreCharacterSet.insert(c_szName); @@ -771,6 +771,14 @@ void CWhisper::Render(float fx, float fy) RECT Rect = { fx, fy, fx+m_fWidth, fy+m_fHeight }; +#if defined(__BL_CLIP_MASK__) + if (GetDefaultCodePage() == CP_ARABIC) + { + Rect.left = fx - m_fWidth; + Rect.right = fx; + } +#endif + for (int i = iStartLine; i >= 0; --i) { assert(i >= 0 && i < int(m_ChatLineDeque.size()));