summaryrefslogtreecommitdiff
path: root/src/gui/userpalette.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/gui/userpalette.h
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmanaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/gui/userpalette.h')
-rw-r--r--src/gui/userpalette.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/gui/userpalette.h b/src/gui/userpalette.h
index 49c9fce31..9f0566198 100644
--- a/src/gui/userpalette.h
+++ b/src/gui/userpalette.h
@@ -60,7 +60,7 @@ class UserPalette final : public Palette, public ListModel
inline const Color &getCommittedColor(const UserColorIdT type)
const A_WARN_UNUSED
{
- return mColors[static_cast<size_t>(type)].committedColor;
+ return mColors[CAST_SIZE(type)].committedColor;
}
/**
@@ -72,7 +72,7 @@ class UserPalette final : public Palette, public ListModel
*/
inline const Color &getTestColor(const UserColorIdT type)
const A_WARN_UNUSED
- { return mColors[static_cast<size_t>(type)].testColor; }
+ { return mColors[CAST_SIZE(type)].testColor; }
/**
* Sets the test color associated with the specified type.
@@ -82,7 +82,7 @@ class UserPalette final : public Palette, public ListModel
*/
inline void setTestColor(const UserColorIdT type,
const Color &color)
- { mColors[static_cast<size_t>(type)].testColor = color; }
+ { mColors[CAST_SIZE(type)].testColor = color; }
/**
* Sets the color for the specified type.
@@ -112,7 +112,7 @@ class UserPalette final : public Palette, public ListModel
*/
void setGradientDelay(const UserColorIdT type,
const int delay)
- { mColors[static_cast<size_t>(type)].delay = delay; }
+ { mColors[CAST_SIZE(type)].delay = delay; }
/**
* Returns the number of colors known.
@@ -120,7 +120,7 @@ class UserPalette final : public Palette, public ListModel
* @return the number of colors known
*/
inline int getNumberOfElements() override final A_WARN_UNUSED
- { return static_cast<int>(mColors.size()); }
+ { return CAST_S32(mColors.size()); }
/**
* Returns the name of the ith color.
@@ -165,14 +165,14 @@ class UserPalette final : public Palette, public ListModel
const unsigned int alpha = 255U)
A_WARN_UNUSED
{
- if (static_cast<size_t>(type) >= mColors.size())
+ if (CAST_SIZE(type) >= mColors.size())
{
logger->log("incorrect color request type: %d from %u",
- static_cast<int>(type),
- static_cast<unsigned int>(mColors.size()));
+ CAST_S32(type),
+ CAST_U32(mColors.size()));
type = UserColorId::BEING;
}
- Color* col = &mColors[static_cast<size_t>(type)].color;
+ Color* col = &mColors[CAST_SIZE(type)].color;
col->a = alpha;
return *col;
}
@@ -188,7 +188,7 @@ class UserPalette final : public Palette, public ListModel
*/
inline GradientTypeT getGradientType(const UserColorIdT type)
const A_WARN_UNUSED
- { return mColors[static_cast<size_t>(type)].grad; }
+ { return mColors[CAST_SIZE(type)].grad; }
/**
* Gets the gradient delay for the specified type.
@@ -199,14 +199,14 @@ class UserPalette final : public Palette, public ListModel
*/
inline int getGradientDelay(const UserColorIdT type)
const A_WARN_UNUSED
- { return mColors[static_cast<size_t>(type)].delay; }
+ { return mColors[CAST_SIZE(type)].delay; }
inline const Color &getColorWithAlpha(const UserColorIdT type)
A_WARN_UNUSED
{
- Color *const col = &mColors[static_cast<size_t>(type)].color;
- col->a = static_cast<unsigned int>(
- mColors[static_cast<size_t>(type)].delay);
+ Color *const col = &mColors[CAST_SIZE(type)].color;
+ col->a = CAST_U32(
+ mColors[CAST_SIZE(type)].delay);
return *col;
}