diff options
author | spiff_ <spiff_@svn> | 2010-01-08 23:47:11 +0000 |
---|---|---|
committer | spiff_ <spiff_@svn> | 2010-01-08 23:47:11 +0000 |
commit | d5c23e36410e2570b1089da505acb2b69d53262a (patch) | |
tree | e38ac6cc8d36b323a3e800bb399585a014b3ea4f /guilib | |
parent | ccea07a5a4229a0f7ebb7ff58e034820751a744a (diff) |
cosmetics
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26558 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
52 files changed, 220 insertions, 220 deletions
diff --git a/guilib/AnimatedGif.cpp b/guilib/AnimatedGif.cpp index 30363b69fd..45d3cdb153 100644 --- a/guilib/AnimatedGif.cpp +++ b/guilib/AnimatedGif.cpp @@ -335,7 +335,7 @@ int CAnimatedGifSet::LoadGIF (const char * szFileName) } else nLoops = 0; - + if (nLoops) nLoops++; getbyte(fd); } @@ -415,7 +415,7 @@ int CAnimatedGifSet::LoadGIF (const char * szFileName) bool isPalRead = false; if (LocalColorMap && fread((char*)NextImage->Palette, 1, palSize, fd) == palSize) isPalRead = true; - + // Copy global, if no palette if (!isPalRead) memcpy(NextImage->Palette, GlobalColorMap, palSize); @@ -576,7 +576,7 @@ int LZWDecoder (char * bufIn, char * bufOut, // - Table Suffices contain the raw codes to be output while (OutCode >= FirstEntry) { - if (OutIndex > 4096 || OutCode >= 4096) + if (OutIndex > 4096 || OutCode >= 4096) return 0; OutStack[OutIndex++] = Suffix[OutCode]; // Add suffix to Output Stack OutCode = Prefix[OutCode]; // Loop with preffix diff --git a/guilib/AnimatedGif.h b/guilib/AnimatedGif.h index 4cfc322b87..1f77fb5fbd 100644 --- a/guilib/AnimatedGif.h +++ b/guilib/AnimatedGif.h @@ -77,7 +77,7 @@ GUIBITMAPINFOHEADER; \ingroup textures \brief */ -typedef struct tagGUIBITMAPINFO +typedef struct tagGUIBITMAPINFO { GUIBITMAPINFOHEADER bmiHeader; GUIRGBQUAD bmiColors[1]; diff --git a/guilib/GUIActionDescriptor.h b/guilib/GUIActionDescriptor.h index 80109a6106..a2a8ce1250 100644 --- a/guilib/GUIActionDescriptor.h +++ b/guilib/GUIActionDescriptor.h @@ -19,17 +19,17 @@ public: CGUIActionDescriptor(CStdString& action) { m_lang = LANG_XBMC; - m_action = action; + m_action = action; m_sourceWindowId = -1; } - + CGUIActionDescriptor(ActionLang lang, CStdString& action) { m_lang = lang; m_action = action; m_sourceWindowId = -1; } - + CStdString m_action; ActionLang m_lang; int m_sourceWindowId; // the id of the window that was a source of an action diff --git a/guilib/GUIAudioManager.cpp b/guilib/GUIAudioManager.cpp index 8be427e379..51f9d18a3f 100644 --- a/guilib/GUIAudioManager.cpp +++ b/guilib/GUIAudioManager.cpp @@ -57,7 +57,7 @@ void CGUIAudioManager::Initialize(int iDevice) if (g_guiSettings.GetString("lookandfeel.soundskin")=="OFF") return; - + if (iDevice==CAudioContext::DEFAULT_DEVICE) { CSingleLock lock(m_cs); diff --git a/guilib/GUIAudioManager.h b/guilib/GUIAudioManager.h index ef73abc11d..afe15097f5 100644 --- a/guilib/GUIAudioManager.h +++ b/guilib/GUIAudioManager.h @@ -80,7 +80,7 @@ private: CStdString m_strMediaDir; bool m_bEnabled; bool m_bInitialized; - + CCriticalSection m_cs; }; diff --git a/guilib/GUIBaseContainer.cpp b/guilib/GUIBaseContainer.cpp index 525d6c4415..bee83b5f20 100644 --- a/guilib/GUIBaseContainer.cpp +++ b/guilib/GUIBaseContainer.cpp @@ -735,7 +735,7 @@ void CGUIBaseContainer::UpdateVisibility(const CGUIListItem *item) if (item.get() == lastItem) m_lastItem = lastItem; } - if (updateItems && item->HasProperties()) + if (updateItems && item->HasProperties()) { // has info, so update it CStdString info = item->GetProperty("label"); if (!info.IsEmpty()) item->SetLabel(CGUIInfoLabel::GetLabel(info)); @@ -932,7 +932,7 @@ void CGUIBaseContainer::LoadContent(TiXmlElement *content) { newItem->m_strPath += " , "; } - newItem->m_strPath += (*it).m_action; + newItem->m_strPath += (*it).m_action; } newItem->SetLabel2(CGUIInfoLabel::GetLabel(label2)); newItem->SetThumbnailImage(CGUIInfoLabel::GetLabel(thumb, true)); diff --git a/guilib/GUIControl.cpp b/guilib/GUIControl.cpp index e9611a2764..6bc24acdc5 100644 --- a/guilib/GUIControl.cpp +++ b/guilib/GUIControl.cpp @@ -185,13 +185,13 @@ bool CGUIControl::OnAction(const CAction &action) OnRight(); return true; break; - + case ACTION_NEXT_CONTROL: if (!HasFocus()) return false; OnNextControl(); return true; break; - + case ACTION_PREV_CONTROL: if (!HasFocus()) return false; OnPrevControl(); diff --git a/guilib/GUIControl.h b/guilib/GUIControl.h index 6cc6783be4..267d9a3609 100644 --- a/guilib/GUIControl.h +++ b/guilib/GUIControl.h @@ -290,7 +290,7 @@ protected: int m_controlDown; int m_controlNext; int m_controlPrev; - + std::vector<CGUIActionDescriptor> m_leftActions; std::vector<CGUIActionDescriptor> m_rightActions; std::vector<CGUIActionDescriptor> m_upActions; diff --git a/guilib/GUIControlFactory.cpp b/guilib/GUIControlFactory.cpp index 26ded2d04b..124d84908e 100644 --- a/guilib/GUIControlFactory.cpp +++ b/guilib/GUIControlFactory.cpp @@ -157,7 +157,7 @@ bool CGUIControlFactory::GetAction(const TiXmlElement* pElement, CGUIActionDescr action.m_lang = CGUIActionDescriptor::LANG_PYTHON; else action.m_lang = CGUIActionDescriptor::LANG_XBMC; - + if (pElement->FirstChild()) { action.m_action = pElement->FirstChild()->Value(); @@ -1058,7 +1058,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl if (bPassword) ((CGUIEditControl *) control)->SetInputType(CGUIEditControl::INPUT_TYPE_PASSWORD, 0); - ((CGUIEditControl *) control)->SetTextChangeActions(textChangeActions); + ((CGUIEditControl *) control)->SetTextChangeActions(textChangeActions); } else if (strType == "videowindow") { diff --git a/guilib/GUIControlProfiler.cpp b/guilib/GUIControlProfiler.cpp index 121e5be566..16142f3b72 100644 --- a/guilib/GUIControlProfiler.cpp +++ b/guilib/GUIControlProfiler.cpp @@ -34,7 +34,7 @@ CGUIControlProfilerItem::CGUIControlProfilerItem(CGUIControlProfiler *pProfiler, m_ControlType = m_pControl->GetControlType(); m_strDescription = m_pControl->GetDescription(); } - else + else { m_controlID = 0; m_ControlType = CGUIControl::GUICONTROL_UNKNOWN; @@ -73,7 +73,7 @@ void CGUIControlProfilerItem::EndVisibility(void) } void CGUIControlProfilerItem::BeginRender(void) -{ +{ m_i64RenderStart = CurrentHostCounter(); } @@ -86,42 +86,42 @@ void CGUIControlProfilerItem::SaveToXML(TiXmlElement *parent) { TiXmlElement *xmlControl = new TiXmlElement("control"); parent->LinkEndChild(xmlControl); - + const char *lpszType = NULL; switch (m_ControlType) { - case CGUIControl::GUICONTROL_BUTTON: + case CGUIControl::GUICONTROL_BUTTON: lpszType = "button"; break; - case CGUIControl::GUICONTROL_CHECKMARK: + case CGUIControl::GUICONTROL_CHECKMARK: lpszType = "checkmark"; break; - case CGUIControl::GUICONTROL_FADELABEL: + case CGUIControl::GUICONTROL_FADELABEL: lpszType = "fadelabel"; break; - case CGUIControl::GUICONTROL_IMAGE: - case CGUIControl::GUICONTROL_BORDEREDIMAGE: + case CGUIControl::GUICONTROL_IMAGE: + case CGUIControl::GUICONTROL_BORDEREDIMAGE: lpszType = "image"; break; - case CGUIControl::GUICONTROL_LARGE_IMAGE: + case CGUIControl::GUICONTROL_LARGE_IMAGE: lpszType = "largeimage"; break; - case CGUIControl::GUICONTROL_LABEL: + case CGUIControl::GUICONTROL_LABEL: lpszType = "label"; break; - case CGUIControl::GUICONTROL_LISTGROUP: + case CGUIControl::GUICONTROL_LISTGROUP: lpszType = "group"; break; - case CGUIControl::GUICONTROL_PROGRESS: + case CGUIControl::GUICONTROL_PROGRESS: lpszType = "progress"; break; - case CGUIControl::GUICONTROL_RADIO: + case CGUIControl::GUICONTROL_RADIO: lpszType = "radiobutton"; break; - case CGUIControl::GUICONTROL_RSS: + case CGUIControl::GUICONTROL_RSS: lpszType = "rss"; break; - case CGUIControl::GUICONTROL_SELECTBUTTON: + case CGUIControl::GUICONTROL_SELECTBUTTON: lpszType = "selectbutton"; break; - case CGUIControl::GUICONTROL_SLIDER: + case CGUIControl::GUICONTROL_SLIDER: lpszType = "slider"; break; - case CGUIControl::GUICONTROL_SETTINGS_SLIDER: + case CGUIControl::GUICONTROL_SETTINGS_SLIDER: lpszType = "sliderex"; break; - case CGUIControl::GUICONTROL_SPIN: + case CGUIControl::GUICONTROL_SPIN: lpszType = "spincontrol"; break; - case CGUIControl::GUICONTROL_SPINEX: + case CGUIControl::GUICONTROL_SPINEX: lpszType = "spincontrolex"; break; - case CGUIControl::GUICONTROL_TEXTBOX: + case CGUIControl::GUICONTROL_TEXTBOX: lpszType = "textbox"; break; case CGUIControl::GUICONTROL_TOGGLEBUTTON: lpszType = "togglebutton"; break; @@ -157,11 +157,11 @@ void CGUIControlProfilerItem::SaveToXML(TiXmlElement *parent) lpszType = "fixedlist"; break; case CGUIControl::GUICONTAINER_PANEL: lpszType = "panel"; break; - //case CGUIControl::GUICONTROL_LIST: - //case CGUIControl::GUICONTROL_UNKNOWN: - //case CGUIControl::GUICONTROL_LISTEX: - //case CGUIControl::GUICONTROL_SPINBUTTON: - //case CGUIControl::GUICONTROL_THUMBNAIL: + //case CGUIControl::GUICONTROL_LIST: + //case CGUIControl::GUICONTROL_UNKNOWN: + //case CGUIControl::GUICONTROL_LISTEX: + //case CGUIControl::GUICONTROL_SPINBUTTON: + //case CGUIControl::GUICONTROL_THUMBNAIL: //case CGUIControl::GUICONTROL_CONSOLE: default: break; @@ -169,7 +169,7 @@ void CGUIControlProfilerItem::SaveToXML(TiXmlElement *parent) if (lpszType) xmlControl->SetAttribute("type", lpszType); - if (m_controlID != 0) + if (m_controlID != 0) { CStdString str; str.Format("%u", m_controlID); @@ -188,7 +188,7 @@ void CGUIControlProfilerItem::SaveToXML(TiXmlElement *parent) { TiXmlElement *elem = new TiXmlElement("description"); xmlControl->LinkEndChild(elem); - TiXmlText *text = new TiXmlText(m_strDescription.c_str()); + TiXmlText *text = new TiXmlText(m_strDescription.c_str()); elem->LinkEndChild(text); } @@ -203,7 +203,7 @@ void CGUIControlProfilerItem::SaveToXML(TiXmlElement *parent) val.Format("%u", rend); TiXmlText *text = new TiXmlText(val.c_str()); elem->LinkEndChild(text); - + elem = new TiXmlElement("visibletime"); xmlControl->LinkEndChild(elem); val.Format("%u", vis); @@ -240,7 +240,7 @@ CGUIControlProfilerItem *CGUIControlProfilerItem::FindOrAddControl(CGUIControl * } if (pControl->GetParentControl() == m_pControl) - return AddControl(pControl); + return AddControl(pControl); return NULL; } @@ -258,8 +258,8 @@ CGUIControlProfiler &CGUIControlProfiler::Instance(void) return _instance; } -bool CGUIControlProfiler::IsRunning(void) -{ +bool CGUIControlProfiler::IsRunning(void) +{ return m_bIsRunning; } @@ -303,7 +303,7 @@ CGUIControlProfilerItem *CGUIControlProfiler::FindOrAddControl(CGUIControl *pCon // the one we want again next time if (m_pLastItem->m_pControl == pControl) return m_pLastItem; - // If that control is not a match, usually the one we want is the next + // If that control is not a match, usually the one we want is the next // sibling of that control, or the parent of that control so check // the parent first as it is more convenient m_pLastItem = m_pLastItem->m_pParent; diff --git a/guilib/GUIControlProfiler.h b/guilib/GUIControlProfiler.h index 7443c795ec..a9f0613943 100644 --- a/guilib/GUIControlProfiler.h +++ b/guilib/GUIControlProfiler.h @@ -44,12 +44,12 @@ public: int64_t m_i64RenderStart; CGUIControlProfilerItem(CGUIControlProfiler *pProfiler, CGUIControlProfilerItem *pParent, CGUIControl *pControl); - ~CGUIControlProfilerItem(void); + ~CGUIControlProfilerItem(void); void Reset(CGUIControlProfiler *pProfiler); void BeginVisibility(void); void EndVisibility(void); - void BeginRender(void); + void BeginRender(void); void EndRender(void); void SaveToXML(TiXmlElement *parent); unsigned int GetTotalTime(void) const { return m_visTime + m_renderTime; }; diff --git a/guilib/GUIEditControl.cpp b/guilib/GUIEditControl.cpp index 8246dce882..bf3f3cf349 100644 --- a/guilib/GUIEditControl.cpp +++ b/guilib/GUIEditControl.cpp @@ -290,7 +290,7 @@ void CGUIEditControl::UpdateText(bool sendUpdate) if (sendUpdate) { SEND_CLICK_MESSAGE(GetID(), GetParentID(), 0); - + vector<CGUIActionDescriptor> textChangeActions = m_textChangeActions; for (unsigned int i = 0; i < textChangeActions.size(); i++) { @@ -355,7 +355,7 @@ void CGUIEditControl::RenderText() { if (m_smsTimer.GetElapsedMilliseconds() > smsDelay) UpdateText(); - + if (m_bInvalidated) { m_textLayout.Update(m_info.GetLabel(GetParentID())); @@ -488,7 +488,7 @@ void CGUIEditControl::OnSMSCharacter(unsigned int key) assert(key < 10); bool sendUpdate = false; if (m_smsTimer.IsRunning()) - { + { // we're already entering an SMS character if (key != m_smsLastKey || m_smsTimer.GetElapsedMilliseconds() > smsDelay) { // a different key was clicked than last time, or we have timed out @@ -508,9 +508,9 @@ void CGUIEditControl::OnSMSCharacter(unsigned int key) m_smsLastKey = key; m_smsKeyIndex = 0; } - + m_smsKeyIndex = m_smsKeyIndex % strlen(smsLetters[key]); - + m_text2.insert(m_text2.begin() + m_cursorPos++, smsLetters[key][m_smsKeyIndex]); UpdateText(sendUpdate); m_smsTimer.StartZero(); @@ -533,13 +533,13 @@ void CGUIEditControl::OnPasteClipboard() { hglb = GetClipboardData(CF_TEXT); if (hglb != NULL) - { + { lptstr = (LPTSTR)GlobalLock(hglb); if (lptstr != NULL) - { + { m_text2 = (char*)lptstr; GlobalUnlock(hglb); - } + } } CloseClipboard(); UpdateText(); diff --git a/guilib/GUIEditControl.h b/guilib/GUIEditControl.h index 69a27048c9..59e1368e02 100644 --- a/guilib/GUIEditControl.h +++ b/guilib/GUIEditControl.h @@ -71,11 +71,11 @@ public: void SetCursorPosition(unsigned int iPosition); void SetInputType(INPUT_TYPE type, int heading); - + void SetTextChangeActions(const std::vector<CGUIActionDescriptor>& textChangeActions) { m_textChangeActions = textChangeActions; }; - + bool HasTextChangeActions() { return m_textChangeActions.size() > 0; }; - + protected: virtual void RenderText(); CStdStringW GetDisplayedText() const; @@ -97,14 +97,14 @@ protected: int m_inputHeading; INPUT_TYPE m_inputType; - - std::vector<CGUIActionDescriptor> m_textChangeActions; - + std::vector<CGUIActionDescriptor> m_textChangeActions; + + unsigned int m_smsKeyIndex; unsigned int m_smsLastKey; CStopWatch m_smsTimer; - + static const char* smsLetters[10]; static const unsigned int smsDelay; }; diff --git a/guilib/GUIFontTTF.h b/guilib/GUIFontTTF.h index 1c05641ff9..e2a89afa82 100644 --- a/guilib/GUIFontTTF.h +++ b/guilib/GUIFontTTF.h @@ -54,7 +54,7 @@ typedef std::vector<color_t> vecColors; typedef struct _SVertex { float u, v; - unsigned char r, g, b, a; + unsigned char r, g, b, a; float x, y, z; } SVertex; @@ -62,7 +62,7 @@ typedef struct _SVertex class CGUIFontTTFBase { friend class CGUIFont; - + public: CGUIFontTTFBase(const CStdString& strFileName); diff --git a/guilib/GUIFontTTFGL.h b/guilib/GUIFontTTFGL.h index b23a9d3af3..c4dc88ec6a 100644 --- a/guilib/GUIFontTTFGL.h +++ b/guilib/GUIFontTTFGL.h @@ -50,7 +50,7 @@ protected: virtual bool CopyCharToTexture(FT_BitmapGlyph bitGlyph, Character *ch); virtual void DeleteHardwareTexture(); virtual void RenderInternal(SVertex* v) {} - + }; #endif diff --git a/guilib/GUIFontTTFGLES.cpp b/guilib/GUIFontTTFGLES.cpp index 8adcefebc2..a6bc5f28da 100644 --- a/guilib/GUIFontTTFGLES.cpp +++ b/guilib/GUIFontTTFGLES.cpp @@ -44,12 +44,12 @@ using namespace std; CGUIFontTTFGLES::CGUIFontTTFGLES(const CStdString& strFileName) : CGUIFontTTFBase(strFileName) { - + } CGUIFontTTFGLES::~CGUIFontTTFGLES(void) { - + } void CGUIFontTTFGLES::Begin() diff --git a/guilib/GUIFontTTFGLES.h b/guilib/GUIFontTTFGLES.h index 207da8c57f..17939729fb 100644 --- a/guilib/GUIFontTTFGLES.h +++ b/guilib/GUIFontTTFGLES.h @@ -50,7 +50,7 @@ protected: virtual bool CopyCharToTexture(FT_BitmapGlyph bitGlyph, Character *ch); virtual void DeleteHardwareTexture(); virtual void RenderInternal(SVertex* v) {} - + }; #endif diff --git a/guilib/GUIImage.cpp b/guilib/GUIImage.cpp index 4cb8711dc6..7cf90622da 100644 --- a/guilib/GUIImage.cpp +++ b/guilib/GUIImage.cpp @@ -100,7 +100,7 @@ void CGUIImage::Render() // check whether our image failed to allocate, and if so drop back to the fallback image if (m_texture.FailedToAlloc() && !m_texture.GetFileName().Equals(m_info.GetFallback())) m_texture.SetFileName(m_info.GetFallback()); - + if (m_crossFadeTime) { // make sure our texture has started allocating diff --git a/guilib/GUIListContainer.cpp b/guilib/GUIListContainer.cpp index 86026bc1fd..c127760ae7 100644 --- a/guilib/GUIListContainer.cpp +++ b/guilib/GUIListContainer.cpp @@ -248,7 +248,7 @@ bool CGUIListContainer::SelectItemFromPoint(const CPoint &point) { if (!m_focusedLayout || !m_layout) return false; - + int row = 0; float pos = (m_orientation == VERTICAL) ? point.y : point.x; while (row < m_itemsPerPage + 1) // 1 more to ensure we get the (possible) half item at the end. @@ -258,7 +258,7 @@ bool CGUIListContainer::SelectItemFromPoint(const CPoint &point) { // found correct "row" -> check horizontal if (!InsideLayout(layout, point)) return false; - + SetContainerMoving(row - m_cursor); m_cursor = row; CGUIListItemLayout *focusedLayout = GetFocusedLayout(); diff --git a/guilib/GUIListContainer.h b/guilib/GUIListContainer.h index 5d3418e2b6..2f667127b1 100644 --- a/guilib/GUIListContainer.h +++ b/guilib/GUIListContainer.h @@ -58,6 +58,6 @@ protected: virtual bool MoveUp(bool wrapAround); virtual void ValidateOffset(); virtual void SelectItem(int item); - virtual bool SelectItemFromPoint(const CPoint &point); + virtual bool SelectItemFromPoint(const CPoint &point); }; diff --git a/guilib/GUIListItem.cpp b/guilib/GUIListItem.cpp index 912fb35c91..4e201a685f 100644 --- a/guilib/GUIListItem.cpp +++ b/guilib/GUIListItem.cpp @@ -234,11 +234,11 @@ void CGUIListItem::Serialize(CArchive &ar) ar >> m_strThumbnailImage; ar >> m_strIcon; ar >> m_bSelected; - + int overlayIcon; ar >> overlayIcon; m_overlayIcon = GUIIconOverlay(overlayIcon); - + int mapSize; ar >> mapSize; for (int i = 0; i < mapSize; i++) diff --git a/guilib/GUIMessage.h b/guilib/GUIMessage.h index ba3fb5867c..79242a5fca 100644 --- a/guilib/GUIMessage.h +++ b/guilib/GUIMessage.h @@ -301,7 +301,7 @@ private: int m_param1; int m_param2; CGUIListItemPtr m_item; - + static CStdString empty_string; }; #endif diff --git a/guilib/GUIPanelContainer.cpp b/guilib/GUIPanelContainer.cpp index 3a2ce4b452..17b73b99d2 100644 --- a/guilib/GUIPanelContainer.cpp +++ b/guilib/GUIPanelContainer.cpp @@ -88,7 +88,7 @@ void CGUIPanelContainer::Render() if (m_orientation == VERTICAL) RenderItem(m_posX + col * m_layout->Size(HORIZONTAL), pos, item.get(), false); else - RenderItem(pos, m_posY + col * m_layout->Size(VERTICAL), item.get(), false); + RenderItem(pos, m_posY + col * m_layout->Size(VERTICAL), item.get(), false); } } // increment our position diff --git a/guilib/GUIRSSControl.cpp b/guilib/GUIRSSControl.cpp index f756ce214d..d222f94672 100644 --- a/guilib/GUIRSSControl.cpp +++ b/guilib/GUIRSSControl.cpp @@ -96,8 +96,8 @@ void CGUIRSSControl::Render() if (m_pReader == NULL) { if (g_rssManager.GetReader(GetID(), GetParentID(), this, m_pReader)) - m_scrollInfo.characterPos = m_pReader->m_SavedScrollPos; - else + m_scrollInfo.characterPos = m_pReader->m_SavedScrollPos; + else { if (m_strRSSTags != "") { diff --git a/guilib/GUITextLayout.cpp b/guilib/GUITextLayout.cpp index 191abdbfe1..0ae01e49d8 100644 --- a/guilib/GUITextLayout.cpp +++ b/guilib/GUITextLayout.cpp @@ -211,9 +211,9 @@ void CGUITextLayout::SetText(const CStdStringW &text, float maxWidth, bool force // remove any trailing blank lines while (!m_lines.empty() && m_lines.back().m_text.empty()) m_lines.pop_back(); - + BidiTransform(m_lines, forceLTRReadingOrder); - + // and cache the width and height for later reading CalcTextExtent(); } @@ -226,18 +226,18 @@ void CGUITextLayout::BidiTransform(vector<CGUIString> &lines, bool forceLTRReadi CGUIString &line = lines[i]; // reserve enough space in the flipped text - vecText flippedText; + vecText flippedText; flippedText.reserve(line.m_text.size()); character_t sectionStyle = 0xffff0000; // impossible to achieve CStdStringW sectionText; for (vecText::iterator it = line.m_text.begin(); it != line.m_text.end(); ++it) - { + { character_t style = *it & 0xffff0000; - if (style != sectionStyle) + if (style != sectionStyle) { if (!sectionText.IsEmpty()) - { // style has changed, bidi flip text + { // style has changed, bidi flip text CStdStringW sectionFlipped = BidiFlip(sectionText, forceLTRReadingOrder); for (unsigned int j = 0; j < sectionFlipped.size(); j++) flippedText.push_back(sectionStyle | sectionFlipped[j]); diff --git a/guilib/GUITextLayout.h b/guilib/GUITextLayout.h index 2633731637..9fa101d03d 100644 --- a/guilib/GUITextLayout.h +++ b/guilib/GUITextLayout.h @@ -96,7 +96,7 @@ protected: void BidiTransform(std::vector<CGUIString> &lines, bool forceLTRReadingOrder); CStdStringW BidiFlip(const CStdStringW &text, bool forceLTRReadingOrder); void CalcTextExtent(); - + // our text to render vecColors m_colors; std::vector<CGUIString> m_lines; diff --git a/guilib/GUITexture.cpp b/guilib/GUITexture.cpp index 500a872ee7..654ed820d2 100644 --- a/guilib/GUITexture.cpp +++ b/guilib/GUITexture.cpp @@ -196,14 +196,14 @@ void CGUITextureBase::Render() Render(m_vertex.x1, m_vertex.y1, m_vertex.x1 + m_info.border.x1, m_vertex.y1 + m_info.border.y1, 0, 0, u1, v1, u3, v3); Render(m_vertex.x1, m_vertex.y1 + m_info.border.y1, m_vertex.x1 + m_info.border.x1, m_vertex.y2 - m_info.border.y2, 0, v1, u1, v2, u3, v3); if (m_info.border.y2) - Render(m_vertex.x1, m_vertex.y2 - m_info.border.y2, m_vertex.x1 + m_info.border.x1, m_vertex.y2, 0, v2, u1, v3, u3, v3); + Render(m_vertex.x1, m_vertex.y2 - m_info.border.y2, m_vertex.x1 + m_info.border.x1, m_vertex.y2, 0, v2, u1, v3, u3, v3); } // middle segment (u1,0,u2,v3) if (m_info.border.y1) Render(m_vertex.x1 + m_info.border.x1, m_vertex.y1, m_vertex.x2 - m_info.border.x2, m_vertex.y1 + m_info.border.y1, u1, 0, u2, v1, u3, v3); Render(m_vertex.x1 + m_info.border.x1, m_vertex.y1 + m_info.border.y1, m_vertex.x2 - m_info.border.x2, m_vertex.y2 - m_info.border.y2, u1, v1, u2, v2, u3, v3); if (m_info.border.y2) - Render(m_vertex.x1 + m_info.border.x1, m_vertex.y2 - m_info.border.y2, m_vertex.x2 - m_info.border.x2, m_vertex.y2, u1, v2, u2, v3, u3, v3); + Render(m_vertex.x1 + m_info.border.x1, m_vertex.y2 - m_info.border.y2, m_vertex.x2 - m_info.border.x2, m_vertex.y2, u1, v2, u2, v3, u3, v3); // right segment if (m_info.border.x2) { // have a left border @@ -211,8 +211,8 @@ void CGUITextureBase::Render() Render(m_vertex.x2 - m_info.border.x2, m_vertex.y1, m_vertex.x2, m_vertex.y1 + m_info.border.y1, u2, 0, u3, v1, u3, v3); Render(m_vertex.x2 - m_info.border.x2, m_vertex.y1 + m_info.border.y1, m_vertex.x2, m_vertex.y2 - m_info.border.y2, u2, v1, u3, v2, u3, v3); if (m_info.border.y2) - Render(m_vertex.x2 - m_info.border.x2, m_vertex.y2 - m_info.border.y2, m_vertex.x2, m_vertex.y2, u2, v2, u3, v3, u3, v3); - } + Render(m_vertex.x2 - m_info.border.x2, m_vertex.y2 - m_info.border.y2, m_vertex.x2, m_vertex.y2, u2, v2, u3, v3, u3, v3); + } // close off our renderer End(); @@ -260,7 +260,7 @@ void CGUITextureBase::Render(float left, float top, float right, float bottom, f x[3] = ROUND_TO_PIXEL(g_graphicsContext.ScaleFinalXCoord(vertex.x1, vertex.y2)); y[3] = ROUND_TO_PIXEL(g_graphicsContext.ScaleFinalYCoord(vertex.x1, vertex.y2)); z[3] = ROUND_TO_PIXEL(g_graphicsContext.ScaleFinalZCoord(vertex.x1, vertex.y2)); - + if (y[2] == y[0]) y[2] += 1.0f; if (x[2] == x[0]) x[2] += 1.0f; if (y[3] == y[1]) y[3] += 1.0f; if (x[3] == x[1]) x[3] += 1.0f; @@ -303,7 +303,7 @@ void CGUITextureBase::AllocResources() if (g_largeTextureManager.GetImage(m_info.filename, texture, !IsAllocated())) { m_isAllocated = LARGE; - + if (!texture.size()) // not ready as yet return; diff --git a/guilib/GUITexture.h b/guilib/GUITexture.h index 1cd53362d3..bdb760ff04 100644 --- a/guilib/GUITexture.h +++ b/guilib/GUITexture.h @@ -1,6 +1,6 @@ /*! \file GUITexture.h -\brief +\brief */ #ifndef GUILIB_GUITEXTURE_H diff --git a/guilib/GUITextureD3D.h b/guilib/GUITextureD3D.h index b168f685eb..98eaee3d4d 100644 --- a/guilib/GUITextureD3D.h +++ b/guilib/GUITextureD3D.h @@ -1,6 +1,6 @@ /*! \file GUITextureD3D.h -\brief +\brief */ #ifndef GUILIB_GUITEXTURED3D_H diff --git a/guilib/GUITextureGL.cpp b/guilib/GUITextureGL.cpp index 8af30ff291..e26d54d468 100644 --- a/guilib/GUITextureGL.cpp +++ b/guilib/GUITextureGL.cpp @@ -41,11 +41,11 @@ void CGUITextureGL::Begin() glBindTexture(GL_TEXTURE_2D, texture->GetTextureObject()); glEnable(GL_TEXTURE_2D); - + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); // Turn Blending On glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - + // diffuse coloring glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); @@ -97,7 +97,7 @@ void CGUITextureGL::Draw(float *x, float *y, float *z, const CRect &texture, con if (m_diffuse.size()) glMultiTexCoord2fARB(GL_TEXTURE1_ARB, diffuse.x1, diffuse.y1); glVertex3f(x[0], y[0], z[0]); - + // Top-right vertex (corner) glColor4ub(r, g, b, a); if (orientation & 4) @@ -119,7 +119,7 @@ void CGUITextureGL::Draw(float *x, float *y, float *z, const CRect &texture, con if (m_diffuse.size()) glMultiTexCoord2fARB(GL_TEXTURE1_ARB, diffuse.x2, diffuse.y2); glVertex3f(x[2], y[2], z[2]); - + // Bottom-left vertex (corner) glColor4ub(r, g, b, a); if (orientation & 4) diff --git a/guilib/GUITextureGL.h b/guilib/GUITextureGL.h index bf349f05dd..c3d0baa336 100644 --- a/guilib/GUITextureGL.h +++ b/guilib/GUITextureGL.h @@ -1,6 +1,6 @@ /*! \file GUITextureGL.h -\brief +\brief */ #ifndef GUILIB_GUITEXTUREGL_H diff --git a/guilib/GUITextureGLES.cpp b/guilib/GUITextureGLES.cpp index 7f1458e22d..52fc0c86cd 100644 --- a/guilib/GUITextureGLES.cpp +++ b/guilib/GUITextureGLES.cpp @@ -48,7 +48,7 @@ void CGUITextureGLES::Draw(float *x, float *y, float *z, const CRect &texture, c void CGUITextureGLES::DrawQuad(const CRect &rect, DWORD color) { - // TODO: OpenGLES + // TODO: OpenGLES } #endif diff --git a/guilib/GUITextureGLES.h b/guilib/GUITextureGLES.h index cbfce6ee4c..2b2d046a97 100644 --- a/guilib/GUITextureGLES.h +++ b/guilib/GUITextureGLES.h @@ -1,6 +1,6 @@ /*! \file GUITextureGLES.h -\brief +\brief */ #ifndef GUILIB_GUITEXTUREGLES_H diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp index fb6830178b..492aee999f 100644 --- a/guilib/GUIWindow.cpp +++ b/guilib/GUIWindow.cpp @@ -141,10 +141,10 @@ bool CGUIWindow::Load(TiXmlDocument &xmlDoc) // now load in the skin file SetDefaults(); - + CGUIControlFactory::GetMultipleString(pRootElement, "onload", m_loadActions); CGUIControlFactory::GetMultipleString(pRootElement, "onunload", m_unloadActions); - + TiXmlElement *pChild = pRootElement->FirstChildElement(); while (pChild) { @@ -490,7 +490,7 @@ void CGUIWindow::OnInitWindow() SetInitialVisibility(); QueueAnimation(ANIM_TYPE_WINDOW_OPEN); g_windowManager.ShowOverlay(m_overlayState); - + if (!m_manualRunActions) { RunLoadActions(); @@ -507,7 +507,7 @@ void CGUIWindow::OnDeinitWindow(int nextWindowID) { RunUnloadActions(); } - + if (nextWindowID != WINDOW_FULLSCREEN_VIDEO) { // Dialog animations are handled in Close() rather than here @@ -1000,10 +1000,10 @@ void CGUIWindow::SetRunActionsManually() void CGUIWindow::RunLoadActions() { - RunActions(m_loadActions); + RunActions(m_loadActions); } - + void CGUIWindow::RunUnloadActions() { - RunActions(m_unloadActions); + RunActions(m_unloadActions); } diff --git a/guilib/GUIWindow.h b/guilib/GUIWindow.h index 6f499eca87..512e844609 100644 --- a/guilib/GUIWindow.h +++ b/guilib/GUIWindow.h @@ -141,7 +141,7 @@ public: void SetRunActionsManually(); void RunLoadActions(); void RunUnloadActions(); - + bool HasProperty(const CStdString &strKey) const; void SetProperty(const CStdString &strKey, const char *strValue); void SetProperty(const CStdString &strKey, const CStdString &strValue); @@ -202,7 +202,7 @@ protected: //#endif void RunActions(std::vector<CGUIActionDescriptor>& actions); - + int m_idRange; bool m_bRelativeCoords; OVERLAY_STATE m_overlayState; @@ -242,7 +242,7 @@ protected: std::vector<CGUIActionDescriptor> m_loadActions; std::vector<CGUIActionDescriptor> m_unloadActions; - + bool m_manualRunActions; }; diff --git a/guilib/GraphicContext.cpp b/guilib/GraphicContext.cpp index bc63e0587f..be74eeb8b5 100644 --- a/guilib/GraphicContext.cpp +++ b/guilib/GraphicContext.cpp @@ -64,7 +64,7 @@ void CGraphicContext::SetOrigin(float x, float y) m_origins.push(CPoint(x,y) + m_origins.top()); else m_origins.push(CPoint(x,y)); - + AddTransform(TransformMatrix::CreateTranslation(x, y)); } @@ -81,19 +81,19 @@ bool CGraphicContext::SetClipRegion(float x, float y, float w, float h) CPoint origin; if (m_origins.size()) origin = m_origins.top(); - + // ok, now intersect with our old clip region CRect rect(x, y, x + w, y + h); rect += origin; if (m_clipRegions.size()) - { + { // intersect with original clip region rect.Intersect(m_clipRegions.top()); } - + if (rect.IsEmpty()) return false; - + m_clipRegions.push(rect); // here we could set the hardware clipping, if applicable @@ -268,7 +268,7 @@ void CGraphicContext::SetFullScreenVideo(bool bOnOff) else if(g_guiSettings.m_LookAndFeelResolution > RES_DESKTOP) g_graphicsContext.SetVideoResolution(g_guiSettings.m_LookAndFeelResolution); else - g_graphicsContext.SetVideoResolution(RES_DESKTOP); + g_graphicsContext.SetVideoResolution(RES_DESKTOP); } else g_graphicsContext.SetVideoResolution(RES_WINDOW); @@ -299,14 +299,14 @@ bool CGraphicContext::IsValidResolution(RESOLUTION res) { return true; } - + return false; } void CGraphicContext::SetVideoResolution(RESOLUTION res, bool forceUpdate) { RESOLUTION lastRes = m_Resolution; - + // If the user asked us to guess, go with desktop if (res == RES_AUTORES || !IsValidResolution(res)) { @@ -318,7 +318,7 @@ void CGraphicContext::SetVideoResolution(RESOLUTION res, bool forceUpdate) { return; } - + if (res >= RES_DESKTOP) { g_advancedSettings.m_fullScreen = true; @@ -331,12 +331,12 @@ void CGraphicContext::SetVideoResolution(RESOLUTION res, bool forceUpdate) } Lock(); - + m_iScreenWidth = g_settings.m_ResInfo[res].iWidth; m_iScreenHeight = g_settings.m_ResInfo[res].iHeight; m_iScreenId = g_settings.m_ResInfo[res].iScreen; m_Resolution = res; - + if (g_advancedSettings.m_fullScreen) { #if defined (__APPLE__) || defined (_WIN32) @@ -766,7 +766,7 @@ void CGraphicContext::ClipToViewWindow() void CGraphicContext::GetAllowedResolutions(vector<RESOLUTION> &res) { - res.clear(); + res.clear(); res.push_back(RES_WINDOW); res.push_back(RES_DESKTOP); diff --git a/guilib/Shader.cpp b/guilib/Shader.cpp index 5eb35a653c..89c5ddd706 100644 --- a/guilib/Shader.cpp +++ b/guilib/Shader.cpp @@ -64,13 +64,13 @@ bool CGLSLVertexShader::Compile() Free(); -#ifdef HAS_GL +#ifdef HAS_GL if(!GLEW_VERSION_2_0) { CLog::Log(LOGERROR, "GL: GLSL vertex shaders not supported"); return false; } -#endif +#endif m_vertexShader = glCreateShader(GL_VERTEX_SHADER); const char *ptr = m_source.c_str(); @@ -101,10 +101,10 @@ bool CGLSLVertexShader::Compile() void CGLSLVertexShader::Free() { -#ifdef HAS_GL +#ifdef HAS_GL if(!GLEW_VERSION_2_0) return; -#endif +#endif if (m_vertexShader) glDeleteShader(m_vertexShader); @@ -163,14 +163,14 @@ void CARBVertexShader::Free() ////////////////////////////////////////////////////////////////////// bool CGLSLPixelShader::Compile() { -#ifdef HAS_GL +#ifdef HAS_GL if(!GLEW_VERSION_2_0) { CLog::Log(LOGERROR, "GL: GLSL pixel shaders not supported"); return false; } #endif - + GLint params[4]; Free(); @@ -210,7 +210,7 @@ bool CGLSLPixelShader::Compile() void CGLSLPixelShader::Free() { -#ifdef HAS_GL +#ifdef HAS_GL if(!GLEW_VERSION_2_0) return; #endif @@ -272,7 +272,7 @@ void CARBPixelShader::Free() ////////////////////////////////////////////////////////////////////// void CGLSLShaderProgram::Free() { -#ifdef HAS_GL +#ifdef HAS_GL if(!GLEW_VERSION_2_0) return; #endif @@ -291,7 +291,7 @@ void CGLSLShaderProgram::Free() bool CGLSLShaderProgram::CompileAndLink() { -#ifdef HAS_GL +#ifdef HAS_GL // check that we support shaders if(!GLEW_VERSION_2_0) { @@ -299,7 +299,7 @@ bool CGLSLShaderProgram::CompileAndLink() return false; } #endif - + GLint params[4]; // free resources @@ -378,11 +378,11 @@ bool CGLSLShaderProgram::CompileAndLink() bool CGLSLShaderProgram::Enable() { -#ifdef HAS_GL +#ifdef HAS_GL if(!GLEW_VERSION_2_0) return false; #endif - + if (OK()) { glUseProgram(m_shaderProgram); @@ -403,11 +403,11 @@ bool CGLSLShaderProgram::Enable() void CGLSLShaderProgram::Disable() { -#ifdef HAS_GL +#ifdef HAS_GL if(!GLEW_VERSION_2_0) return; #endif - + if (OK()) { glUseProgram(0); diff --git a/guilib/Shader.h b/guilib/Shader.h index d12e971cdb..a415dde579 100644 --- a/guilib/Shader.h +++ b/guilib/Shader.h @@ -185,7 +185,7 @@ namespace Shaders { }; - class CGLSLShaderProgram + class CGLSLShaderProgram : virtual public CShaderProgram { public: @@ -221,7 +221,7 @@ namespace Shaders { #ifndef HAS_GLES - class CARBShaderProgram + class CARBShaderProgram : virtual public CShaderProgram { public: diff --git a/guilib/Texture.cpp b/guilib/Texture.cpp index f686d21f79..9b3f8ca131 100644 --- a/guilib/Texture.cpp +++ b/guilib/Texture.cpp @@ -79,7 +79,7 @@ void CBaseTexture::Allocate(unsigned int width, unsigned int height, unsigned in m_pixels = new unsigned char[GetPitch() * GetRows()]; } -void CBaseTexture::Update(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, const unsigned char *pixels, bool loadToGPU) +void CBaseTexture::Update(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, const unsigned char *pixels, bool loadToGPU) { if (pixels == NULL) return; @@ -233,7 +233,7 @@ bool CBaseTexture::LoadPaletted(unsigned int width, unsigned int height, unsigne return true; } -unsigned int CBaseTexture::PadPow2(unsigned int x) +unsigned int CBaseTexture::PadPow2(unsigned int x) { --x; x |= x >> 1; diff --git a/guilib/Texture.h b/guilib/Texture.h index 128a697d78..1e659c4931 100644 --- a/guilib/Texture.h +++ b/guilib/Texture.h @@ -21,7 +21,7 @@ /*! \file Texture.h -\brief +\brief */ #ifndef GUILIB_TEXTURE_H diff --git a/guilib/TextureBundle.cpp b/guilib/TextureBundle.cpp index e8f2694a66..006660fea4 100644 --- a/guilib/TextureBundle.cpp +++ b/guilib/TextureBundle.cpp @@ -42,12 +42,12 @@ bool CTextureBundle::HasFile(const CStdString& Filename) { return m_tbXPR.HasFile(Filename); } - else if (m_tbXBT.HasFile(Filename)) + else if (m_tbXBT.HasFile(Filename)) { m_useXBT = true; return true; - } - else if (m_tbXPR.HasFile(Filename)) + } + else if (m_tbXPR.HasFile(Filename)) { m_useXPR = true; return true; @@ -67,7 +67,7 @@ void CTextureBundle::GetTexturesFromPath(const CStdString &path, std::vector<CSt else if (m_useXPR) { m_tbXPR.GetTexturesFromPath(path, textures); - } + } } bool CTextureBundle::LoadTexture(const CStdString& Filename, CBaseTexture** ppTexture, @@ -84,7 +84,7 @@ bool CTextureBundle::LoadTexture(const CStdString& Filename, CBaseTexture** ppTe else { return false; - } + } } int CTextureBundle::LoadAnim(const CStdString& Filename, CBaseTexture*** ppTextures, @@ -101,7 +101,7 @@ int CTextureBundle::LoadAnim(const CStdString& Filename, CBaseTexture*** ppTextu else { return 0; - } + } } void CTextureBundle::Cleanup() @@ -117,7 +117,7 @@ void CTextureBundle::Cleanup() m_useXPR = m_useXBT = false; } - + void CTextureBundle::SetThemeBundle(bool themeBundle) { m_tbXPR.SetThemeBundle(themeBundle); diff --git a/guilib/TextureBundle.h b/guilib/TextureBundle.h index d9584dd5f8..9867a5688f 100644 --- a/guilib/TextureBundle.h +++ b/guilib/TextureBundle.h @@ -41,11 +41,11 @@ public: bool LoadTexture(const CStdString& Filename, CBaseTexture** ppTexture, int &width, int &height); int LoadAnim(const CStdString& Filename, CBaseTexture*** ppTextures, int &width, int &height, int& nLoops, int** ppDelays); - + private: CTextureBundleXPR m_tbXPR; CTextureBundleXBT m_tbXBT; - + bool m_useXPR; bool m_useXBT; }; diff --git a/guilib/TextureBundleXBT.cpp b/guilib/TextureBundleXBT.cpp index beac56a831..76009d12da 100644 --- a/guilib/TextureBundleXBT.cpp +++ b/guilib/TextureBundleXBT.cpp @@ -45,7 +45,7 @@ CTextureBundleXBT::CTextureBundleXBT(void) { - m_themeBundle = false; + m_themeBundle = false; } CTextureBundleXBT::~CTextureBundleXBT(void) @@ -81,25 +81,25 @@ bool CTextureBundleXBT::OpenBundle() } strPath = PTH_IC(strPath); - + // Load the texture file if (!m_XBTFReader.Open(strPath)) { return false; } - + m_TimeStamp = m_XBTFReader.GetLastModificationTimestamp(); - + if (lzo_init() != LZO_E_OK) { return false; } - + return true; } bool CTextureBundleXBT::HasFile(const CStdString& Filename) -{ +{ if (!m_XBTFReader.IsOpen() && !OpenBundle()) return false; @@ -125,7 +125,7 @@ void CTextureBundleXBT::GetTexturesFromPath(const CStdString &path, std::vector< CStdString testPath = Normalize(path); CUtil::AddSlashAtEnd(testPath); int testLength = testPath.GetLength(); - + std::vector<CXBTFFile>& files = m_XBTFReader.GetFiles(); for (size_t i = 0; i < files.size(); i++) { @@ -143,19 +143,19 @@ bool CTextureBundleXBT::LoadTexture(const CStdString& Filename, CBaseTexture** p CXBTFFile* file = m_XBTFReader.Find(name); if (!file) return false; - + if (file->GetFrames().size() == 0) return false; - + CXBTFFrame& frame = file->GetFrames().at(0); if (!ConvertFrameToTexture(Filename, frame, ppTexture)) { return false; } - + width = frame.GetWidth(); height = frame.GetHeight(); - + return true; } @@ -167,30 +167,30 @@ int CTextureBundleXBT::LoadAnim(const CStdString& Filename, CBaseTexture*** ppTe CXBTFFile* file = m_XBTFReader.Find(name); if (!file) return false; - + if (file->GetFrames().size() == 0) return false; - + size_t nTextures = file->GetFrames().size(); *ppTextures = new CBaseTexture*[nTextures]; *ppDelays = new int[nTextures]; - + for (size_t i = 0; i < nTextures; i++) { CXBTFFrame& frame = file->GetFrames().at(i); - + if (!ConvertFrameToTexture(Filename, frame, &((*ppTextures)[i]))) { return false; } - + (*ppDelays)[i] = frame.GetDuration(); } - + width = file->GetFrames().at(0).GetWidth(); - height = file->GetFrames().at(0).GetHeight(); + height = file->GetFrames().at(0).GetHeight(); nLoops = file->GetLoop(); - + return nTextures; } @@ -271,16 +271,16 @@ void CTextureBundleXBT::Cleanup() if (m_XBTFReader.IsOpen()) { m_XBTFReader.Close(); - } + } } - + void CTextureBundleXBT::SetThemeBundle(bool themeBundle) { m_themeBundle = themeBundle; } // normalize to how it's stored within the bundle -// lower case + using forward slash rather than back slash +// lower case + using forward slash rather than back slash CStdString CTextureBundleXBT::Normalize(const CStdString &name) { CStdString newName(name); diff --git a/guilib/TextureBundleXBT.h b/guilib/TextureBundleXBT.h index a9b033c2d4..a2e44f5489 100644 --- a/guilib/TextureBundleXBT.h +++ b/guilib/TextureBundleXBT.h @@ -44,10 +44,10 @@ public: int LoadAnim(const CStdString& Filename, CBaseTexture*** ppTextures, int &width, int &height, int& nLoops, int** ppDelays); - -private: + +private: bool OpenBundle(); - bool ConvertFrameToTexture(const CStdString& name, CXBTFFrame& frame, CBaseTexture** ppTexture); + bool ConvertFrameToTexture(const CStdString& name, CXBTFFrame& frame, CBaseTexture** ppTexture); time_t m_TimeStamp; diff --git a/guilib/TextureBundleXPR.cpp b/guilib/TextureBundleXPR.cpp index 69d7462b7c..25764151dd 100644 --- a/guilib/TextureBundleXPR.cpp +++ b/guilib/TextureBundleXPR.cpp @@ -257,7 +257,7 @@ bool CTextureBundleXPR::LoadFile(const CStdString& Filename, CAutoTexBuffer& Unp // found texture - allocate the necessary buffers DWORD ReadSize = (file->second.PackedSize + (ALIGN - 1)) & ~(ALIGN - 1); BYTE *buffer = (BYTE*)malloc(ReadSize); - + if (!buffer || !UnpackedBuf.Set((BYTE*)XPhysicalAlloc(file->second.UnpackedSize, MAXULONG_PTR, 128, PAGE_READWRITE))) { // failed due to lack of memory #ifndef _LINUX diff --git a/guilib/TextureDX.h b/guilib/TextureDX.h index ce15d5bcb7..6dabeaac35 100644 --- a/guilib/TextureDX.h +++ b/guilib/TextureDX.h @@ -21,7 +21,7 @@ /*! \file TextureDX.h -\brief +\brief */ #ifndef GUILIB_TEXTUREDX_H diff --git a/guilib/TextureGL.cpp b/guilib/TextureGL.cpp index 8075e36a7d..3ce4299868 100644 --- a/guilib/TextureGL.cpp +++ b/guilib/TextureGL.cpp @@ -95,17 +95,17 @@ void CGLTexture::LoadToGPU() switch (m_format) { - case XB_FMT_DXT1: + case XB_FMT_DXT1: format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - break; - case XB_FMT_DXT3: + break; + case XB_FMT_DXT3: format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - break; - case XB_FMT_DXT5: + break; + case XB_FMT_DXT5: case XB_FMT_DXT5_YCoCg: format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - break; - case XB_FMT_A8R8G8B8: + break; + case XB_FMT_A8R8G8B8: default: #ifdef HAS_GL format = GL_BGRA; @@ -123,7 +123,7 @@ void CGLTexture::LoadToGPU() else { // changed from glCompressedTexImage2D to support GL < 1.3 - glCompressedTexImage2DARB(GL_TEXTURE_2D, 0, format, + glCompressedTexImage2DARB(GL_TEXTURE_2D, 0, format, m_textureWidth, m_textureHeight, 0, GetPitch() * GetRows(), m_pixels); } diff --git a/guilib/TextureGL.h b/guilib/TextureGL.h index 4197601563..e208c725f3 100644 --- a/guilib/TextureGL.h +++ b/guilib/TextureGL.h @@ -21,7 +21,7 @@ /*! \file TextureManager.h -\brief +\brief */ #ifndef GUILIB_TEXTUREGL_H diff --git a/guilib/TextureManager.cpp b/guilib/TextureManager.cpp index d41ec38d8c..3038980ef5 100644 --- a/guilib/TextureManager.cpp +++ b/guilib/TextureManager.cpp @@ -145,9 +145,9 @@ CTextureMap::~CTextureMap() bool CTextureMap::Release() { - if (!m_texture.m_textures.size()) + if (!m_texture.m_textures.size()) return true; - if (!m_referenceCount) + if (!m_referenceCount) return true; m_referenceCount--; @@ -206,7 +206,7 @@ void CTextureMap::Add(CBaseTexture* texture, int delay) m_texture.Add(texture, delay); if (texture) - m_memUsage += sizeof(CTexture) + (texture->GetTextureWidth() * texture->GetTextureHeight() * 4); + m_memUsage += sizeof(CTexture) + (texture->GetTextureWidth() * texture->GetTextureHeight() * 4); } /************************************************************************/ @@ -392,7 +392,7 @@ int CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleO int width = 0, height = 0; if (bundle >= 0) { - if (FAILED(m_TexBundle[bundle].LoadTexture(strTextureName, &pTexture, width, height))) + if (FAILED(m_TexBundle[bundle].LoadTexture(strTextureName, &pTexture, width, height))) { CLog::Log(LOGERROR, "Texture manager unable to load bundled file: %s", strTextureName.c_str()); return 0; @@ -413,7 +413,7 @@ int CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleO } if (!pTexture) return 0; - + CTextureMap* pMap = new CTextureMap(strTextureName, width, height, 0); pMap->Add(pTexture, 100); m_vecTextures.push_back(pMap); diff --git a/guilib/XBTF.cpp b/guilib/XBTF.cpp index 839cfe4e0e..82c17f19dc 100644 --- a/guilib/XBTF.cpp +++ b/guilib/XBTF.cpp @@ -161,7 +161,7 @@ std::vector<CXBTFFrame>& CXBTFFile::GetFrames() uint64_t CXBTFFile::GetHeaderSize() const { - uint64_t result = + uint64_t result = sizeof(m_path) + sizeof(m_loop) + sizeof(uint32_t); /* Number of frames */ diff --git a/guilib/XBTFReader.cpp b/guilib/XBTFReader.cpp index 7ec435de85..523f053039 100644 --- a/guilib/XBTFReader.cpp +++ b/guilib/XBTFReader.cpp @@ -45,35 +45,35 @@ bool CXBTFReader::IsOpen() const bool CXBTFReader::Open(const CStdString& fileName) { m_fileName = fileName; - + #ifdef _WIN32 CStdStringW strPathW; g_charsetConverter.utf8ToW(_P(m_fileName), strPathW, false); m_file = _wfopen(strPathW.c_str(), L"rb"); #else m_file = fopen(m_fileName.c_str(), "rb"); -#endif +#endif if (m_file == NULL) { return false; } - + char magic[4]; READ_STR(magic, 4, m_file); - + if (strncmp(magic, XBTF_MAGIC, sizeof(magic)) != 0) { return false; } - + char version[1]; READ_STR(version, 1, m_file); - + if (strncmp(version, XBTF_VERSION, sizeof(version)) != 0) { return false; } - + unsigned int nofFiles; READ_U32(nofFiles, m_file); for (unsigned int i = 0; i < nofFiles; i++) @@ -81,18 +81,18 @@ bool CXBTFReader::Open(const CStdString& fileName) CXBTFFile file; unsigned int u32; uint64_t u64; - + READ_STR(file.GetPath(), 256, m_file); READ_U32(u32, m_file); file.SetLoop(u32); - + unsigned int nofFrames; READ_U32(nofFrames, m_file); - + for (unsigned int j = 0; j < nofFrames; j++) { CXBTFFrame frame; - + READ_U32(u32, m_file); frame.SetWidth(u32); READ_U32(u32, m_file); @@ -107,23 +107,23 @@ bool CXBTFReader::Open(const CStdString& fileName) frame.SetDuration(u32); READ_U64(u64, m_file); frame.SetOffset(u64); - + file.GetFrames().push_back(frame); } - + m_xbtf.GetFiles().push_back(file); - + m_filesMap[file.GetPath()] = file; - } - + } + // Sanity check int64_t pos = ftell(m_file); if (pos != (int64_t)m_xbtf.GetHeaderSize()) { printf("Expected header size (%"PRId64") != actual size (%"PRId64")\n", m_xbtf.GetHeaderSize(), pos); return false; - } - + } + return true; } @@ -134,7 +134,7 @@ void CXBTFReader::Close() fclose(m_file); m_file = NULL; } - + m_xbtf.GetFiles().clear(); m_filesMap.clear(); } @@ -145,13 +145,13 @@ time_t CXBTFReader::GetLastModificationTimestamp() { return 0; } - + struct stat fileStat; if (fstat(fileno(m_file), &fileStat) == -1) { return 0; } - + return fileStat.st_mtime; } @@ -167,7 +167,7 @@ CXBTFFile* CXBTFReader::Find(const CStdString& name) { return NULL; } - + return &(iter->second); } @@ -185,12 +185,12 @@ bool CXBTFReader::Load(const CXBTFFrame& frame, unsigned char* buffer) { return false; } - + if (fread(buffer, 1, (size_t)frame.GetPackedSize(), m_file) != frame.GetPackedSize()) { return false; } - + return true; } diff --git a/guilib/XBTFReader.h b/guilib/XBTFReader.h index 27264d3333..3233efc2b7 100644 --- a/guilib/XBTFReader.h +++ b/guilib/XBTFReader.h @@ -39,7 +39,7 @@ public: CXBTFFile* Find(const CStdString& name); bool Load(const CXBTFFrame& frame, unsigned char* buffer); std::vector<CXBTFFile>& GetFiles(); - + private: CXBTF m_xbtf; CStdString m_fileName; |