Index: ps/trunk/binaries/data/mods/mod/gui/gui.rng =================================================================== --- ps/trunk/binaries/data/mods/mod/gui/gui.rng +++ ps/trunk/binaries/data/mods/mod/gui/gui.rng @@ -838,11 +838,6 @@ - - - - - Index: ps/trunk/source/gui/CGUI.h =================================================================== --- ps/trunk/source/gui/CGUI.h +++ ps/trunk/source/gui/CGUI.h @@ -101,11 +101,10 @@ * * @param Sprite Object referring to the sprite (which also caches * calculations for faster rendering) - * @param Z Drawing order, depth value * @param Rect Position and Size * @param Clipping The sprite shouldn't be drawn outside this rectangle */ - void DrawSprite(const CGUISpriteInstance& Sprite, const float& Z, const CRect& Rect, const CRect& Clipping = CRect()); + void DrawSprite(const CGUISpriteInstance& Sprite, const CRect& Rect, const CRect& Clipping = CRect()); /** * The replacement of Process(), handles an SDL_Event_ Index: ps/trunk/source/gui/CGUI.cpp =================================================================== --- ps/trunk/source/gui/CGUI.cpp +++ ps/trunk/source/gui/CGUI.cpp @@ -345,7 +345,7 @@ visibleObject.object->Draw(); } -void CGUI::DrawSprite(const CGUISpriteInstance& Sprite, const float& Z, const CRect& Rect, const CRect& UNUSED(Clipping)) +void CGUI::DrawSprite(const CGUISpriteInstance& Sprite, const CRect& Rect, const CRect& UNUSED(Clipping)) { // If the sprite doesn't exist (name == ""), don't bother drawing anything if (!Sprite) @@ -353,7 +353,7 @@ // TODO: Clipping? - Sprite.Draw(*this, Rect, m_Sprites, Z); + Sprite.Draw(*this, Rect, m_Sprites); } void CGUI::UpdateResolution() @@ -1081,14 +1081,6 @@ else LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name, utf8_from_wstring(attr_value)); } - else if (attr_name == "z_level") - { - float z_level; - if (!ParseString(this, attr_value, z_level)) - LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name, utf8_from_wstring(attr_value)); - else - Image->m_DeltaZ = z_level/100.f; - } else if (attr_name == "backcolor") { if (!ParseString(this, attr_value, Image->m_BackColor)) Index: ps/trunk/source/gui/CGUIScrollBarVertical.cpp =================================================================== --- ps/trunk/source/gui/CGUIScrollBarVertical.cpp +++ ps/trunk/source/gui/CGUIScrollBarVertical.cpp @@ -61,7 +61,6 @@ m_pGUI.DrawSprite( GetStyle()->m_SpriteBackVertical, - m_Z+0.1f, CRect( outline.left, outline.top + (GetStyle()->m_UseEdgeButtons ? GetStyle()->m_Width : 0), @@ -97,7 +96,6 @@ m_pGUI.DrawSprite( *button_top, - m_Z+0.2f, CRect( outline.left, outline.top, @@ -108,7 +106,6 @@ m_pGUI.DrawSprite( *button_bottom, - m_Z+0.2f, CRect( outline.left, outline.bottom-GetStyle()->m_Width, @@ -120,7 +117,6 @@ m_pGUI.DrawSprite( GetStyle()->m_SpriteBarVertical, - m_Z + 0.2f, GetBarRect() ); } Index: ps/trunk/source/gui/CGUISprite.h =================================================================== --- ps/trunk/source/gui/CGUISprite.h +++ ps/trunk/source/gui/CGUISprite.h @@ -56,7 +56,6 @@ m_WrapMode(GL_REPEAT), m_Effects(), m_Border(false), - m_DeltaZ(0.f), m_Size(CGUISize::Full()), m_TextureSize(CGUISize::Full()) { @@ -102,13 +101,6 @@ // 0 or 1 pixel border is the only option bool m_Border; - - /** - * Z value modification of the image. - * Inputted in XML as x-level, although it just an easier and safer - * way of declaring delta-z. - */ - float m_DeltaZ; }; /** @@ -150,7 +142,7 @@ CGUISpriteInstance(); CGUISpriteInstance(const CStr& SpriteName); - void Draw(CGUI& pGUI, const CRect& Size, std::map& Sprites, float Z) const; + void Draw(CGUI& pGUI, const CRect& Size, std::map& Sprites) const; /** * Whether this Sprite has no texture name set. Index: ps/trunk/source/gui/CGUISprite.cpp =================================================================== --- ps/trunk/source/gui/CGUISprite.cpp +++ ps/trunk/source/gui/CGUISprite.cpp @@ -30,14 +30,14 @@ m_Images.push_back(image); } -void CGUISpriteInstance::Draw(CGUI& pGUI, const CRect& Size, std::map& Sprites, float Z) const +void CGUISpriteInstance::Draw(CGUI& pGUI, const CRect& Size, std::map& Sprites) const { if (m_CachedSize != Size) { GUIRenderer::UpdateDrawCallCache(pGUI, m_DrawCallCache, m_SpriteName, Size, Sprites); m_CachedSize = Size; } - GUIRenderer::Draw(m_DrawCallCache, Z); + GUIRenderer::Draw(m_DrawCallCache); } // Plus a load of constructors / assignment operators, which don't copy the Index: ps/trunk/source/gui/CGUIText.h =================================================================== --- ps/trunk/source/gui/CGUIText.h +++ ps/trunk/source/gui/CGUIText.h @@ -168,7 +168,7 @@ /** * Draw this CGUIText object */ - void Draw(CGUI& pGUI, const CGUIColor& DefaultColor, const CVector2D& pos, const float z, const CRect& clipping) const; + void Draw(CGUI& pGUI, const CGUIColor& DefaultColor, const CVector2D& pos, const CRect& clipping) const; const CSize2D& GetSize() const { return m_Size; } Index: ps/trunk/source/gui/CGUIText.cpp =================================================================== --- ps/trunk/source/gui/CGUIText.cpp +++ ps/trunk/source/gui/CGUIText.cpp @@ -428,7 +428,7 @@ return done; } -void CGUIText::Draw(CGUI& pGUI, const CGUIColor& DefaultColor, const CVector2D& pos, const float z, const CRect& clipping) const +void CGUIText::Draw(CGUI& pGUI, const CGUIColor& DefaultColor, const CVector2D& pos, const CRect& clipping) const { CShaderTechniquePtr tech = g_Renderer.GetShaderManager().LoadEffect(str_gui_text); @@ -447,7 +447,7 @@ CTextRenderer textRenderer(tech->GetShader()); textRenderer.SetClippingRect(clipping); - textRenderer.Translate(0.0f, 0.0f, z); + textRenderer.Translate(0.0f, 0.0f, 0.0f); for (const STextCall& tc : m_TextCalls) { @@ -463,7 +463,7 @@ textRenderer.Render(); for (const SSpriteCall& sc : m_SpriteCalls) - pGUI.DrawSprite(sc.m_Sprite, z, sc.m_Area + pos); + pGUI.DrawSprite(sc.m_Sprite, sc.m_Area + pos); if (isClipped) glDisable(GL_SCISSOR_TEST); Index: ps/trunk/source/gui/GUIRenderer.h =================================================================== --- ps/trunk/source/gui/GUIRenderer.h +++ ps/trunk/source/gui/GUIRenderer.h @@ -53,7 +53,6 @@ CColor m_ShaderColorParameter; CRect m_Vertices; - float m_DeltaZ; CGUIColor* m_BorderColor; // == nullptr for no border CGUIColor* m_BackColor; @@ -70,7 +69,7 @@ void UpdateDrawCallCache(const CGUI& pGUI, DrawCalls& Calls, const CStr8& SpriteName, const CRect& Size, std::map& Sprites); - void Draw(DrawCalls& Calls, float Z); + void Draw(DrawCalls& Calls); } #endif // INCLUDED_GUIRENDERER Index: ps/trunk/source/gui/GUIRenderer.cpp =================================================================== --- ps/trunk/source/gui/GUIRenderer.cpp +++ ps/trunk/source/gui/GUIRenderer.cpp @@ -229,7 +229,6 @@ Call.m_BackColor = &(*cit)->m_BackColor; Call.m_BorderColor = (*cit)->m_Border ? &(*cit)->m_BorderColor : nullptr; - Call.m_DeltaZ = (*cit)->m_DeltaZ; if (!Call.m_HasTexture) { @@ -329,7 +328,7 @@ return TexCoords; } -void GUIRenderer::Draw(DrawCalls& Calls, float Z) +void GUIRenderer::Draw(DrawCalls& Calls) { if (Calls.empty()) return; @@ -377,13 +376,13 @@ std::vector data; #define ADD(u, v, x, y, z) STMT(data.push_back(u); data.push_back(v); data.push_back(x); data.push_back(y); data.push_back(z)) - ADD(TexCoords.left, TexCoords.bottom, Verts.left, Verts.bottom, Z + cit->m_DeltaZ); - ADD(TexCoords.right, TexCoords.bottom, Verts.right, Verts.bottom, Z + cit->m_DeltaZ); - ADD(TexCoords.right, TexCoords.top, Verts.right, Verts.top, Z + cit->m_DeltaZ); - - ADD(TexCoords.right, TexCoords.top, Verts.right, Verts.top, Z + cit->m_DeltaZ); - ADD(TexCoords.left, TexCoords.top, Verts.left, Verts.top, Z + cit->m_DeltaZ); - ADD(TexCoords.left, TexCoords.bottom, Verts.left, Verts.bottom, Z + cit->m_DeltaZ); + ADD(TexCoords.left, TexCoords.bottom, Verts.left, Verts.bottom, 0.0f); + ADD(TexCoords.right, TexCoords.bottom, Verts.right, Verts.bottom, 0.0f); + ADD(TexCoords.right, TexCoords.top, Verts.right, Verts.top, 0.0f); + + ADD(TexCoords.right, TexCoords.top, Verts.right, Verts.top, 0.0f); + ADD(TexCoords.left, TexCoords.top, Verts.left, Verts.top, 0.0f); + ADD(TexCoords.left, TexCoords.bottom, Verts.left, Verts.bottom, 0.0f); #undef ADD shader->TexCoordPointer(GL_TEXTURE0, 2, GL_FLOAT, 5*sizeof(float), &data[0]); @@ -409,13 +408,13 @@ std::vector data; #define ADD(x, y, z) STMT(data.push_back(x); data.push_back(y); data.push_back(z)) - ADD(Verts.left, Verts.bottom, Z + cit->m_DeltaZ); - ADD(Verts.right, Verts.bottom, Z + cit->m_DeltaZ); - ADD(Verts.right, Verts.top, Z + cit->m_DeltaZ); - - ADD(Verts.right, Verts.top, Z + cit->m_DeltaZ); - ADD(Verts.left, Verts.top, Z + cit->m_DeltaZ); - ADD(Verts.left, Verts.bottom, Z + cit->m_DeltaZ); + ADD(Verts.left, Verts.bottom, 0.0f); + ADD(Verts.right, Verts.bottom, 0.0f); + ADD(Verts.right, Verts.top, 0.0f); + + ADD(Verts.right, Verts.top, 0.0f); + ADD(Verts.left, Verts.top, 0.0f); + ADD(Verts.left, Verts.bottom, 0.0f); shader->VertexPointer(3, GL_FLOAT, 3*sizeof(float), &data[0]); glDrawArrays(GL_TRIANGLES, 0, 6); @@ -425,10 +424,10 @@ shader->Uniform(str_color, *cit->m_BorderColor); data.clear(); - ADD(Verts.left + 0.5f, Verts.top + 0.5f, Z + cit->m_DeltaZ); - ADD(Verts.right - 0.5f, Verts.top + 0.5f, Z + cit->m_DeltaZ); - ADD(Verts.right - 0.5f, Verts.bottom - 0.5f, Z + cit->m_DeltaZ); - ADD(Verts.left + 0.5f, Verts.bottom - 0.5f, Z + cit->m_DeltaZ); + ADD(Verts.left + 0.5f, Verts.top + 0.5f, 0.0f); + ADD(Verts.right - 0.5f, Verts.top + 0.5f, 0.0f); + ADD(Verts.right - 0.5f, Verts.bottom - 0.5f, 0.0f); + ADD(Verts.left + 0.5f, Verts.bottom - 0.5f, 0.0f); shader->VertexPointer(3, GL_FLOAT, 3*sizeof(float), &data[0]); glDrawArrays(GL_LINE_LOOP, 0, 4); Index: ps/trunk/source/gui/ObjectBases/IGUITextOwner.h =================================================================== --- ps/trunk/source/gui/ObjectBases/IGUITextOwner.h +++ ps/trunk/source/gui/ObjectBases/IGUITextOwner.h @@ -82,11 +82,10 @@ * @param index Index value of text. Mostly this will be 0 * @param color * @param pos Position - * @param z Z value * @param clipping Clipping rectangle, don't even add a parameter * to get no clipping. */ - virtual void DrawText(size_t index, const CGUIColor& color, const CVector2D& pos, float z, const CRect& clipping = CRect()); + virtual void DrawText(size_t index, const CGUIColor& color, const CVector2D& pos, const CRect& clipping = CRect()); protected: /** Index: ps/trunk/source/gui/ObjectBases/IGUITextOwner.cpp =================================================================== --- ps/trunk/source/gui/ObjectBases/IGUITextOwner.cpp +++ ps/trunk/source/gui/ObjectBases/IGUITextOwner.cpp @@ -91,13 +91,13 @@ } } -void IGUITextOwner::DrawText(size_t index, const CGUIColor& color, const CVector2D& pos, float z, const CRect& clipping) +void IGUITextOwner::DrawText(size_t index, const CGUIColor& color, const CVector2D& pos, const CRect& clipping) { UpdateText(); ENSURE(index < m_GeneratedTexts.size() && "Trying to draw a Text Index within a IGUITextOwner that doesn't exist"); - m_GeneratedTexts.at(index).Draw(m_pObject.GetGUI(), color, pos, z, clipping); + m_GeneratedTexts.at(index).Draw(m_pObject.GetGUI(), color, pos, clipping); } void IGUITextOwner::CalculateTextPosition(CRect& ObjSize, CVector2D& TextPos, CGUIText& Text) Index: ps/trunk/source/gui/ObjectTypes/CButton.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CButton.cpp +++ ps/trunk/source/gui/ObjectTypes/CButton.cpp @@ -82,14 +82,11 @@ void CButton::Draw() { - const float bz = GetBufferedZ(); - m_pGUI.DrawSprite( GetButtonSprite(m_Sprite, m_SpriteOver, m_SpritePressed, m_SpriteDisabled), - bz, m_CachedActualSize); - DrawText(0, ChooseColor(), m_TextPos, bz + 0.1f); + DrawText(0, ChooseColor(), m_TextPos); } bool CButton::IsMouseOver() const Index: ps/trunk/source/gui/ObjectTypes/CChart.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CChart.cpp +++ ps/trunk/source/gui/ObjectTypes/CChart.cpp @@ -95,11 +95,10 @@ void CChart::DrawAxes(const CShaderProgramPtr& shader) const { - const float bz = GetBufferedZ(); CRect rect = GetChartRect(); std::vector vertices; vertices.reserve(30); -#define ADD(x, y) vertices.push_back(x); vertices.push_back(y); vertices.push_back(bz + 0.5f); +#define ADD(x, y) vertices.push_back(x); vertices.push_back(y); vertices.push_back(0.0f); ADD(m_CachedActualSize.right, m_CachedActualSize.bottom); ADD(rect.right + m_AxisWidth, rect.bottom); ADD(m_CachedActualSize.left, m_CachedActualSize.bottom); @@ -117,7 +116,6 @@ if (m_Series.empty()) return; - const float bz = GetBufferedZ(); CRect rect = GetChartRect(); const float width = rect.GetWidth(); const float height = rect.GetHeight(); @@ -143,7 +141,7 @@ { vertices.push_back(rect.left + (point.X - m_LeftBottom.X) * scale.X); vertices.push_back(rect.bottom - (point.Y - m_LeftBottom.Y) * scale.Y); - vertices.push_back(bz + 0.5f); + vertices.push_back(0.0f); } else { @@ -161,7 +159,7 @@ tech->EndPass(); for (size_t i = 0; i < m_TextPositions.size(); ++i) - DrawText(i, CGUIColor(1.f, 1.f, 1.f, 1.f), m_TextPositions[i], bz + 0.5f); + DrawText(i, CGUIColor(1.f, 1.f, 1.f, 1.f), m_TextPositions[i]); } CRect CChart::GetChartRect() const Index: ps/trunk/source/gui/ObjectTypes/CCheckBox.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CCheckBox.cpp +++ ps/trunk/source/gui/ObjectTypes/CCheckBox.cpp @@ -70,6 +70,5 @@ m_Checked ? GetButtonSprite(m_SpriteChecked, m_SpriteCheckedOver, m_SpriteCheckedPressed, m_SpriteCheckedDisabled) : GetButtonSprite(m_SpriteUnchecked, m_SpriteUncheckedOver, m_SpriteUncheckedPressed, m_SpriteUncheckedDisabled), - GetBufferedZ(), m_CachedActualSize); } Index: ps/trunk/source/gui/ObjectTypes/CDropDown.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CDropDown.cpp +++ ps/trunk/source/gui/ObjectTypes/CDropDown.cpp @@ -422,10 +422,9 @@ void CDropDown::Draw() { - const float bz = GetBufferedZ(); const CGUISpriteInstance& sprite = m_Enabled ? m_Sprite : m_SpriteDisabled; - m_pGUI.DrawSprite(sprite, bz, m_CachedActualSize); + m_pGUI.DrawSprite(sprite, m_CachedActualSize); if (m_ButtonWidth > 0.f) { @@ -434,18 +433,18 @@ if (!m_Enabled) { - m_pGUI.DrawSprite(*m_Sprite2Disabled ? m_Sprite2Disabled : m_Sprite2, bz + 0.05f, rect); + m_pGUI.DrawSprite(*m_Sprite2Disabled ? m_Sprite2Disabled : m_Sprite2, rect); } else if (m_Open) { - m_pGUI.DrawSprite(*m_Sprite2Pressed ? m_Sprite2Pressed : m_Sprite2, bz + 0.05f, rect); + m_pGUI.DrawSprite(*m_Sprite2Pressed ? m_Sprite2Pressed : m_Sprite2, rect); } else if (m_MouseHovering) { - m_pGUI.DrawSprite(*m_Sprite2Over ? m_Sprite2Over : m_Sprite2, bz + 0.05f, rect); + m_pGUI.DrawSprite(*m_Sprite2Over ? m_Sprite2Over : m_Sprite2, rect); } else - m_pGUI.DrawSprite(m_Sprite2, bz + 0.05f, rect); + m_pGUI.DrawSprite(m_Sprite2, rect); } if (m_Selected != -1) // TODO: Maybe check validity completely? @@ -454,7 +453,7 @@ m_CachedActualSize.right - m_ButtonWidth, m_CachedActualSize.bottom); CVector2D pos(m_CachedActualSize.left, m_CachedActualSize.top); - DrawText(m_Selected, m_Enabled ? m_TextColorSelected : m_TextColorDisabled, pos, bz + 0.1f, cliparea); + DrawText(m_Selected, m_Enabled ? m_TextColorSelected : m_TextColorDisabled, pos, cliparea); } if (m_Open) Index: ps/trunk/source/gui/ObjectTypes/CImage.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CImage.cpp +++ ps/trunk/source/gui/ObjectTypes/CImage.cpp @@ -33,5 +33,5 @@ void CImage::Draw() { - m_pGUI.DrawSprite(m_Sprite, GetBufferedZ(), m_CachedActualSize); + m_pGUI.DrawSprite(m_Sprite, m_CachedActualSize); } Index: ps/trunk/source/gui/ObjectTypes/CInput.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CInput.h +++ ps/trunk/source/gui/ObjectTypes/CInput.h @@ -116,7 +116,7 @@ * @param clipping Clipping rectangle, don't even add a parameter * to get no clipping. */ - virtual void DrawPlaceholderText(float z, const CRect& clipping = CRect()); + virtual void DrawPlaceholderText(const CRect& clipping = CRect()); /** * Delete the current selection. Also places the pointer at the Index: ps/trunk/source/gui/ObjectTypes/CInput.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CInput.cpp +++ ps/trunk/source/gui/ObjectTypes/CInput.cpp @@ -1188,8 +1188,6 @@ void CInput::Draw() { - float bz = GetBufferedZ(); - if (m_CursorBlinkRate > 0.0) { // check if the cursor visibility state needs to be changed @@ -1214,7 +1212,7 @@ if (m_Mask && m_MaskChar->length() > 0) mask_char = (*m_MaskChar)[0]; - m_pGUI.DrawSprite(m_Sprite, bz, m_CachedActualSize); + m_pGUI.DrawSprite(m_Sprite, m_CachedActualSize); float scroll = 0.f; if (m_ScrollBar && m_MultiLine) @@ -1279,7 +1277,7 @@ textRenderer.Translate( (float)(int)(m_CachedActualSize.left) + m_BufferZone, (float)(int)(m_CachedActualSize.top+h) + m_BufferZone, - bz+0.1f); + 0.0f); // U+FE33: PRESENTATION FORM FOR VERTICAL LOW LINE // (sort of like a | which is aligned to the left of most characters) @@ -1403,7 +1401,7 @@ rect.right = m_CachedActualSize.right; } - m_pGUI.DrawSprite(m_SpriteSelectArea, bz + 0.05f, rect); + m_pGUI.DrawSprite(m_SpriteSelectArea, rect); } if (i < (int)it->m_ListOfX.size()) @@ -1530,15 +1528,15 @@ tech->EndPass(); if (m_Caption->empty() && !m_PlaceholderText->GetRawString().empty()) - DrawPlaceholderText(bz, cliparea); + DrawPlaceholderText(cliparea); } -void CInput::DrawPlaceholderText(float z, const CRect& clipping) +void CInput::DrawPlaceholderText(const CRect& clipping) { if (!m_GeneratedPlaceholderTextValid) SetupGeneratedPlaceholderText(); - m_GeneratedPlaceholderText.Draw(m_pGUI, m_PlaceholderColor, m_CachedActualSize.TopLeft(), z, clipping); + m_GeneratedPlaceholderText.Draw(m_pGUI, m_PlaceholderColor, m_CachedActualSize.TopLeft(), clipping); } void CInput::UpdateText(int from, int to_before, int to_after) Index: ps/trunk/source/gui/ObjectTypes/CList.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CList.cpp +++ ps/trunk/source/gui/ObjectTypes/CList.cpp @@ -304,69 +304,66 @@ void CList::DrawList(const int& selected, const CGUISpriteInstance& sprite, const CGUISpriteInstance& sprite_selectarea, const CGUIColor& textcolor) { - float bz = GetBufferedZ(); + CRect rect = GetListRect(); - { - CRect rect = GetListRect(); + m_pGUI.DrawSprite(sprite, rect); - m_pGUI.DrawSprite(sprite, bz, rect); + float scroll = 0.f; + if (m_ScrollBar) + scroll = GetScrollBar(0).GetPos(); - float scroll = 0.f; - if (m_ScrollBar) - scroll = GetScrollBar(0).GetPos(); + if (selected >= 0 && selected+1 < (int)m_ItemsYPositions.size()) + { + // Get rectangle of selection: + CRect rect_sel( + rect.left, rect.top + m_ItemsYPositions[selected] - scroll, + rect.right, rect.top + m_ItemsYPositions[selected+1] - scroll); - if (selected >= 0 && selected+1 < (int)m_ItemsYPositions.size()) + if (rect_sel.top <= rect.bottom && + rect_sel.bottom >= rect.top) { - // Get rectangle of selection: - CRect rect_sel(rect.left, rect.top + m_ItemsYPositions[selected] - scroll, - rect.right, rect.top + m_ItemsYPositions[selected+1] - scroll); + if (rect_sel.bottom > rect.bottom) + rect_sel.bottom = rect.bottom; + if (rect_sel.top < rect.top) + rect_sel.top = rect.top; - if (rect_sel.top <= rect.bottom && - rect_sel.bottom >= rect.top) + if (m_ScrollBar) { - if (rect_sel.bottom > rect.bottom) - rect_sel.bottom = rect.bottom; - if (rect_sel.top < rect.top) - rect_sel.top = rect.top; - - if (m_ScrollBar) - { - // Remove any overlapping area of the scrollbar. - if (rect_sel.right > GetScrollBar(0).GetOuterRect().left && - rect_sel.right <= GetScrollBar(0).GetOuterRect().right) - rect_sel.right = GetScrollBar(0).GetOuterRect().left; - - if (rect_sel.left >= GetScrollBar(0).GetOuterRect().left && - rect_sel.left < GetScrollBar(0).GetOuterRect().right) - rect_sel.left = GetScrollBar(0).GetOuterRect().right; - } - - m_pGUI.DrawSprite(sprite_selectarea, bz + 0.05f, rect_sel); + // Remove any overlapping area of the scrollbar. + if (rect_sel.right > GetScrollBar(0).GetOuterRect().left && + rect_sel.right <= GetScrollBar(0).GetOuterRect().right) + rect_sel.right = GetScrollBar(0).GetOuterRect().left; + + if (rect_sel.left >= GetScrollBar(0).GetOuterRect().left && + rect_sel.left < GetScrollBar(0).GetOuterRect().right) + rect_sel.left = GetScrollBar(0).GetOuterRect().right; } - } - for (size_t i = 0; i < m_List->m_Items.size(); ++i) - { - if (m_ItemsYPositions[i+1] - scroll < 0 || - m_ItemsYPositions[i] - scroll > rect.GetHeight()) - continue; + m_pGUI.DrawSprite(sprite_selectarea, rect_sel); + } + } - // Clipping area (we'll have to substract the scrollbar) - CRect cliparea = GetListRect(); + for (size_t i = 0; i < m_List->m_Items.size(); ++i) + { + if (m_ItemsYPositions[i+1] - scroll < 0 || + m_ItemsYPositions[i] - scroll > rect.GetHeight()) + continue; - if (m_ScrollBar) - { - if (cliparea.right > GetScrollBar(0).GetOuterRect().left && - cliparea.right <= GetScrollBar(0).GetOuterRect().right) - cliparea.right = GetScrollBar(0).GetOuterRect().left; - - if (cliparea.left >= GetScrollBar(0).GetOuterRect().left && - cliparea.left < GetScrollBar(0).GetOuterRect().right) - cliparea.left = GetScrollBar(0).GetOuterRect().right; - } + // Clipping area (we'll have to substract the scrollbar) + CRect cliparea = GetListRect(); - DrawText(i, textcolor, rect.TopLeft() - CVector2D(0.f, scroll - m_ItemsYPositions[i]), bz + 0.1f, cliparea); + if (m_ScrollBar) + { + if (cliparea.right > GetScrollBar(0).GetOuterRect().left && + cliparea.right <= GetScrollBar(0).GetOuterRect().right) + cliparea.right = GetScrollBar(0).GetOuterRect().left; + + if (cliparea.left >= GetScrollBar(0).GetOuterRect().left && + cliparea.left < GetScrollBar(0).GetOuterRect().right) + cliparea.left = GetScrollBar(0).GetOuterRect().right; } + + DrawText(i, textcolor, rect.TopLeft() - CVector2D(0.f, scroll - m_ItemsYPositions[i]), cliparea); } if (m_ScrollBar) Index: ps/trunk/source/gui/ObjectTypes/CMiniMap.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CMiniMap.h +++ ps/trunk/source/gui/ObjectTypes/CMiniMap.h @@ -102,7 +102,7 @@ float m_WaterHeight; - void DrawTexture(CShaderProgramPtr shader, float coordMax, float angle, float x, float y, float x2, float y2, float z) const; + void DrawTexture(CShaderProgramPtr shader, float coordMax, float angle, float x, float y, float x2, float y2) const; void DrawViewRect(const CMatrix3D& transform) const; Index: ps/trunk/source/gui/ObjectTypes/CMiniMap.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CMiniMap.cpp +++ ps/trunk/source/gui/ObjectTypes/CMiniMap.cpp @@ -383,7 +383,7 @@ } -void CMiniMap::DrawTexture(CShaderProgramPtr shader, float coordMax, float angle, float x, float y, float x2, float y2, float z) const +void CMiniMap::DrawTexture(CShaderProgramPtr shader, float coordMax, float angle, float x, float y, float x2, float y2) const { // Rotate the texture coordinates (0,0)-(coordMax,coordMax) around their center point (m,m) // Scale square maps to fit in circular minimap area @@ -401,13 +401,13 @@ m*(-c + s + 1.f), m*(-c + -s + 1.f) }; float quadVerts[] = { - x, y, z, - x2, y, z, - x2, y2, z, - - x2, y2, z, - x, y2, z, - x, y, z + x, y, 0.0f, + x2, y, 0.0f, + x2, y2, 0.0f, + + x2, y2, 0.0f, + x, y2, 0.0f, + x, y, 0.0f }; shader->TexCoordPointer(GL_TEXTURE0, 2, GL_FLOAT, 0, quadTex); @@ -464,7 +464,6 @@ const float x = m_CachedActualSize.left, y = m_CachedActualSize.bottom; const float x2 = m_CachedActualSize.right, y2 = m_CachedActualSize.top; - const float z = GetBufferedZ(); const float texCoordMax = (float)(m_MapSize - 1) / (float)m_TextureSize; const float angle = GetAngle(); const float unitScale = (cmpRangeManager->GetLosCircular() ? 1.f : m_MapScale/2.f); @@ -506,7 +505,7 @@ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } - DrawTexture(shader, texCoordMax, angle, x, y, x2, y2, z); + DrawTexture(shader, texCoordMax, angle, x, y, x2, y2); if (!m_Mask) { @@ -527,7 +526,7 @@ shader->Uniform(str_transform, baseTransform); shader->Uniform(str_textureTransform, *territoryTransform); - DrawTexture(shader, 1.0f, angle, x, y, x2, y2, z); + DrawTexture(shader, 1.0f, angle, x, y, x2, y2); tech->EndPass(); // Draw the LOS quad in black, using alpha values from the LOS texture @@ -544,7 +543,7 @@ shader->Uniform(str_transform, baseTransform); shader->Uniform(str_textureTransform, *losTransform); - DrawTexture(shader, 1.0f, angle, x, y, x2, y2, z); + DrawTexture(shader, 1.0f, angle, x, y, x2, y2); tech->EndPass(); } @@ -571,7 +570,7 @@ // Move the minimap back to it's starting position. unitMatrix.Translate((x2 - x) / 2.f, (y2 - y) / 2.f, 0.f); // Move the minimap to it's final location. - unitMatrix.Translate(x, y, z); + unitMatrix.Translate(x, y, 0.0f); // Apply the gui matrix. unitMatrix *= GetDefaultGuiMatrix(); // Load the transform into the shader. Index: ps/trunk/source/gui/ObjectTypes/COList.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/COList.cpp +++ ps/trunk/source/gui/ObjectTypes/COList.cpp @@ -282,14 +282,12 @@ void COList::DrawList(const int& selected, const CGUISpriteInstance& sprite, const CGUISpriteInstance& sprite_selected, const CGUIColor& textcolor) { - const float bz = GetBufferedZ(); - if (m_ScrollBar) IGUIScrollBarOwner::Draw(); CRect rect = GetListRect(); - m_pGUI.DrawSprite(sprite, bz, rect); + m_pGUI.DrawSprite(sprite, rect); float scroll = 0.f; if (m_ScrollBar) @@ -325,14 +323,14 @@ } // Draw item selection - m_pGUI.DrawSprite(sprite_selected, bz + 0.05f, rect_sel); + m_pGUI.DrawSprite(sprite_selected, rect_sel); } } // Draw line above column header CRect rect_head(m_CachedActualSize.left, m_CachedActualSize.top, m_CachedActualSize.right, m_CachedActualSize.top + m_HeadingHeight); - m_pGUI.DrawSprite(m_SpriteHeading, bz, rect_head); + m_pGUI.DrawSprite(m_SpriteHeading, rect_head); // Draw column headers float xpos = 0; @@ -369,11 +367,11 @@ else pSprite = &*m_SpriteNotSorted; - m_pGUI.DrawSprite(*pSprite, bz + 0.1f, CRect(leftTopCorner + CVector2D(width - SORT_SPRITE_DIM, 0), leftTopCorner + CVector2D(width, SORT_SPRITE_DIM))); + m_pGUI.DrawSprite(*pSprite, CRect(leftTopCorner + CVector2D(width - SORT_SPRITE_DIM, 0), leftTopCorner + CVector2D(width, SORT_SPRITE_DIM))); } // Draw column header text - DrawText(col, textcolor, leftTopCorner + COLUMN_SHIFT, bz + 0.1f, rect_head); + DrawText(col, textcolor, leftTopCorner + COLUMN_SHIFT, rect_head); xpos += width; ++col; } @@ -424,7 +422,7 @@ cliparea2.bottom = std::min(cliparea2.bottom, textPos.Y + rowHeight); // Draw list item - DrawText(objectsCount * (i +/*Heading*/1) + colIdx, column.m_TextColor, textPos, bz + 0.1f, cliparea2); + DrawText(objectsCount * (i +/*Heading*/1) + colIdx, column.m_TextColor, textPos, cliparea2); xpos += width; } } Index: ps/trunk/source/gui/ObjectTypes/CProgressBar.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CProgressBar.cpp +++ ps/trunk/source/gui/ObjectTypes/CProgressBar.cpp @@ -55,12 +55,10 @@ void CProgressBar::Draw() { - float bz = GetBufferedZ(); - - m_pGUI.DrawSprite(m_SpriteBackground, bz, m_CachedActualSize); + m_pGUI.DrawSprite(m_SpriteBackground, m_CachedActualSize); // Get size of bar (notice it is drawn slightly closer, to appear above the background) CRect size = m_CachedActualSize; size.right = size.left + m_CachedActualSize.GetWidth() * (m_Progress / 100.f), - m_pGUI.DrawSprite(m_SpriteBar, bz + 0.01f, size); + m_pGUI.DrawSprite(m_SpriteBar, size); } Index: ps/trunk/source/gui/ObjectTypes/CSlider.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CSlider.cpp +++ ps/trunk/source/gui/ObjectTypes/CSlider.cpp @@ -107,9 +107,8 @@ CRect slider_line(m_CachedActualSize); slider_line.left += m_ButtonSide / 2.0f; slider_line.right -= m_ButtonSide / 2.0f; - float bz = GetBufferedZ(); - m_pGUI.DrawSprite(m_SpriteBar, bz, slider_line); - m_pGUI.DrawSprite(m_Sprite, bz, GetButtonRect()); + m_pGUI.DrawSprite(m_SpriteBar, slider_line); + m_pGUI.DrawSprite(m_Sprite, GetButtonRect()); } void CSlider::UpdateValue() Index: ps/trunk/source/gui/ObjectTypes/CText.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CText.cpp +++ ps/trunk/source/gui/ObjectTypes/CText.cpp @@ -184,12 +184,10 @@ void CText::Draw() { - float bz = GetBufferedZ(); - if (m_ScrollBar) IGUIScrollBarOwner::Draw(); - m_pGUI.DrawSprite(m_Sprite, bz, m_CachedActualSize); + m_pGUI.DrawSprite(m_Sprite, m_CachedActualSize); float scroll = 0.f; if (m_ScrollBar) @@ -217,7 +215,7 @@ const CGUIColor& color = m_Enabled ? m_TextColor : m_TextColorDisabled; if (m_ScrollBar) - DrawText(0, color, m_CachedActualSize.TopLeft() - CVector2D(0.f, scroll), bz + 0.1f, cliparea); + DrawText(0, color, m_CachedActualSize.TopLeft() - CVector2D(0.f, scroll), cliparea); else - DrawText(0, color, m_TextPos, bz + 0.1f, cliparea); + DrawText(0, color, m_TextPos, cliparea); } Index: ps/trunk/source/gui/ObjectTypes/CTooltip.cpp =================================================================== --- ps/trunk/source/gui/ObjectTypes/CTooltip.cpp +++ ps/trunk/source/gui/ObjectTypes/CTooltip.cpp @@ -133,9 +133,8 @@ m_GeneratedTextsValid = true; } - const float z = GetBufferedZ(); - m_pGUI.DrawSprite(m_Sprite, z, m_CachedActualSize); - DrawText(0, m_TextColor, m_CachedActualSize.TopLeft(), z + 0.1f); + m_pGUI.DrawSprite(m_Sprite, m_CachedActualSize); + DrawText(0, m_TextColor, m_CachedActualSize.TopLeft()); } float CTooltip::GetBufferedZ() const