Skip to content

Commit 25faf38

Browse files
committed
Updated to SFML 2.4
1 parent 4116fdf commit 25faf38

12 files changed

+20
-20
lines changed

src/Gui/Label.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Label::Label(const sf::String& string)
88
{
99
m_text.setFont(Theme::getFont());
1010
m_text.setPosition(Theme::PADDING, Theme::PADDING);
11-
m_text.setColor(Theme::click.textColor);
11+
m_text.setFillColor(Theme::click.textColor);
1212
m_text.setCharacterSize(Theme::textSize);
1313
setSelectable(false);
1414
setText(string);
@@ -28,15 +28,15 @@ const sf::String& Label::getText() const
2828
}
2929

3030

31-
void Label::setColor(const sf::Color& color)
31+
void Label::setFillColor(const sf::Color& color)
3232
{
33-
m_text.setColor(color);
33+
m_text.setFillColor(color);
3434
}
3535

3636

37-
const sf::Color& Label::getColor() const
37+
const sf::Color& Label::getFillColor() const
3838
{
39-
return m_text.getColor();
39+
return m_text.getFillColor();
4040
}
4141

4242

src/Gui/Label.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class Label: public Widget
2525
/**
2626
* Label's color
2727
*/
28-
void setColor(const sf::Color& color);
29-
const sf::Color& getColor() const;
28+
void setFillColor(const sf::Color& color);
29+
const sf::Color& getFillColor() const;
3030

3131
void setTextSize(size_t size);
3232
size_t getTextSize() const;

src/Gui/OptionsBox.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class OptionsBox: public Widget
2323
* @param label: displayed label when selected
2424
* @param value: value associated
2525
*/
26-
void addItem(const sf::String& label, const T& value, bool select = false);
26+
void addItem(const sf::String& label, const T& value);
2727

2828
/**
2929
* Make an item the current one

src/Gui/OptionsBox.inl

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OptionsBox<T>::OptionsBox():
3030

3131

3232
template <class T>
33-
void OptionsBox<T>::addItem(const sf::String& label, const T& value, bool select)
33+
void OptionsBox<T>::addItem(const sf::String& label, const T& value)
3434
{
3535
m_items.push_back(Item(label, value));
3636

src/Gui/ProgressBar.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ProgressBar::ProgressBar(float width):
1212
{
1313
m_box.setSize(width, Theme::getBoxHeight());
1414
m_text.setFont(Theme::getFont());
15-
m_text.setColor(Theme::input.textColor);
15+
m_text.setFillColor(Theme::input.textColor);
1616
m_text.setCharacterSize(Theme::textSize);
1717

1818
// Build bar

src/Gui/Slider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void Slider::onMouseMoved(float x, float y)
183183
}
184184

185185

186-
void Slider::onMouseReleased(float x, float y)
186+
void Slider::onMouseReleased(float, float)
187187
{
188188
m_handle.release();
189189
}

src/Gui/TextBox.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ TextBox::TextBox(float width):
1818
int offset = Theme::borderSize + Theme::PADDING;
1919
m_text.setFont(Theme::getFont());
2020
m_text.setPosition(offset, offset);
21-
m_text.setColor(Theme::input.textColor);
21+
m_text.setFillColor(Theme::input.textColor);
2222
m_text.setCharacterSize(Theme::textSize);
2323

2424
// Build cursor
@@ -149,7 +149,7 @@ void TextBox::onKeyPressed(sf::Keyboard::Key key)
149149
}
150150

151151

152-
void TextBox::onMousePressed(float x, float y)
152+
void TextBox::onMousePressed(float x, float)
153153
{
154154
for (int i = m_text.getString().getSize(); i >= 0; --i)
155155
{

src/Gui/Utils/Arrow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Arrow::Arrow(Direction direction):
1717
}
1818

1919

20-
void Arrow::setColor(const sf::Color& color)
20+
void Arrow::setFillColor(const sf::Color& color)
2121
{
2222
for (int i = 0; i < 4; ++i)
2323
m_vertices[i].color = color;

src/Gui/Utils/Arrow.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Arrow: public sf::Drawable
1313

1414
Arrow(Direction direction);
1515

16-
void setColor(const sf::Color& color);
16+
void setFillColor(const sf::Color& color);
1717

1818
void move(float dx, float dy);
1919
void setPosition(float x, float y);

src/Gui/Utils/Cross.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void Cross::move(float dx, float dy)
3232
}
3333

3434

35-
void Cross::setSize(float size)
35+
void Cross::setSize(float)
3636
{
3737

3838
}

src/Gui/Utils/ItemBox.inl

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ void ItemBox<T>::applyState(State state)
2626
switch (state)
2727
{
2828
case StateDefault:
29-
m_item.setColor(m_type == Click ? Theme::click.textColor : Theme::input.textColor);
29+
m_item.setFillColor(m_type == Click ? Theme::click.textColor : Theme::input.textColor);
3030
break;
3131
case StateHovered:
32-
m_item.setColor(m_type == Click ? Theme::click.textColorHover : Theme::input.textColorHover);
32+
m_item.setFillColor(m_type == Click ? Theme::click.textColorHover : Theme::input.textColorHover);
3333
break;
3434
case StatePressed:
3535
case StateFocused:
36-
m_item.setColor(m_type == Click ? Theme::click.textColorFocus : Theme::input.textColorFocus);
36+
m_item.setFillColor(m_type == Click ? Theme::click.textColorFocus : Theme::input.textColorFocus);
3737
break;
3838

3939
}

src/demo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int main()
149149
text.setOrigin(text.getLocalBounds().width / 2, text.getLocalBounds().height / 2);
150150
break;
151151
case C_COLOR:
152-
text.setColor(opt->getSelectedValue());
152+
text.setFillColor(opt->getSelectedValue());
153153
break;
154154
case C_ROTATION:
155155
text.setRotation(sliderRotation->getValue() * 360 / 100.f);

0 commit comments

Comments
 (0)