mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-12-19 17:37:42 -05:00
lib: replace (*x). by x->
Use established C/C++ syntax.
This commit is contained in:
@@ -687,8 +687,8 @@ void ConfigItem::Add(int count, ...) {
|
||||
// make sure allocation ok
|
||||
ASSERT(m_tiList[i]);
|
||||
uitemp = va_arg(marker, UITextItem *);
|
||||
(*m_tiList[i]) = *uitemp;
|
||||
(*m_tiList[i]).set_alpha(255);
|
||||
*m_tiList[i] = *uitemp;
|
||||
m_tiList[i]->set_alpha(255);
|
||||
// allocate radio button
|
||||
m_rbList[i] = new UIRadioButton;
|
||||
// make sure allocation ok
|
||||
@@ -700,11 +700,11 @@ void ConfigItem::Add(int count, ...) {
|
||||
m_rbList[i]->Create(m_hWnd, NULL, m_iID[i], m_tiList[i], m_X + curr_x, m_Y + curr_y, m_tiList[i]->width(),
|
||||
m_tiList[i]->height(), UIF_FIT | UIRB_NOBUTTON);
|
||||
|
||||
(*m_tiList[i]).set_color(UICOL_HOTSPOT_HI);
|
||||
m_tiList[i]->set_color(UICOL_HOTSPOT_HI);
|
||||
m_rbList[i]->SetStateItem(UI_BTS_ACTIVATED, m_tiList[i]);
|
||||
(*m_tiList[i]).set_color(UICOL_HOTSPOT_LO);
|
||||
m_tiList[i]->set_color(UICOL_HOTSPOT_LO);
|
||||
m_rbList[i]->SetStateItem(UI_BTS_INACTIVE, m_tiList[i]);
|
||||
(*m_tiList[i]).set_color(UICOL_HOTSPOT_HI);
|
||||
m_tiList[i]->set_color(UICOL_HOTSPOT_HI);
|
||||
m_rbList[i]->SetStateItem(UI_BTS_HILITE, m_tiList[i]);
|
||||
|
||||
// adjust curr x/y
|
||||
|
||||
@@ -145,11 +145,11 @@ constexpr inline const vec<T,3,A_DST> hbp() const { return vec<T,3,A_DST>{ h(),
|
||||
template<enum align A_DST = align::adaptive>
|
||||
constexpr inline const vec<T,3,A_DST> bph() const { return vec<T,3,A_DST>{ b(), p(), h() }; }
|
||||
|
||||
constexpr inline T sum() const { return std::accumulate((*this).cbegin(), (*this).cend(), T{}); }
|
||||
constexpr inline T sum() const { return std::accumulate(this->cbegin(), this->cend(), T{}); }
|
||||
constexpr inline vec<T,N,A> operator-() const
|
||||
{
|
||||
vec<T,N,A> dst;
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + N, dst.begin(), std::negate<>{});
|
||||
std::transform(this->cbegin(), this->cbegin() + N, dst.begin(), std::negate<>{});
|
||||
return dst;
|
||||
}
|
||||
|
||||
@@ -158,28 +158,28 @@ template<typename T_OTHER, size_t N_OTHER, enum align A_OTHER = align::adaptive,
|
||||
constexpr inline vec<T_DST,N,A> operator+(const vec<T_OTHER,N_OTHER,A_OTHER> &other) const
|
||||
{
|
||||
vec<T_DST,N,A> dst = {};
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), dst.begin(), std::plus<>{});
|
||||
std::transform(this->cbegin(), this->cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), dst.begin(), std::plus<>{});
|
||||
return dst;
|
||||
}
|
||||
template<typename T_OTHER, size_t N_OTHER, enum align A_OTHER = align::adaptive, typename T_DST = decltype((T)1 - (T_OTHER)1)>
|
||||
constexpr inline vec<T_DST,N,A> operator-(const vec<T_OTHER,N_OTHER,A_OTHER> &other) const
|
||||
{
|
||||
vec<T_DST,N,A> dst = {};
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), dst.begin(), std::minus<>{});
|
||||
std::transform(this->cbegin(), this->cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), dst.begin(), std::minus<>{});
|
||||
return dst;
|
||||
}
|
||||
template<typename T_OTHER, size_t N_OTHER, enum align A_OTHER = align::adaptive, typename T_DST = decltype((T)1 * (T_OTHER)1)>
|
||||
constexpr inline vec<T_DST,N,A> operator*(const vec<T_OTHER,N_OTHER,A_OTHER> &other) const
|
||||
{
|
||||
vec<T_DST,N,A> dst = {};
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), dst.begin(), std::multiplies<>{});
|
||||
std::transform(this->cbegin(), this->cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), dst.begin(), std::multiplies<>{});
|
||||
return dst;
|
||||
}
|
||||
template<typename T_OTHER, size_t N_OTHER, enum align A_OTHER = align::adaptive, typename T_DST = decltype((T)1 / (T_OTHER)1)>
|
||||
constexpr inline vec<T_DST,N,A> operator/(const vec<T_OTHER,N_OTHER,A_OTHER> &other) const
|
||||
{
|
||||
vec<T_DST,N,A> dst = {};
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), dst.begin(), [](const T& a, const T& b) { return (T)a*(T)1/b; });
|
||||
std::transform(this->cbegin(), this->cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), dst.begin(), [](const T& a, const T& b) { return (T)a*(T)1/b; });
|
||||
return dst;
|
||||
}
|
||||
/* arithmetic scalar */
|
||||
@@ -188,7 +188,7 @@ constexpr inline vec<T_DST,N,A> operator+(const T_OTHER &other) const
|
||||
{
|
||||
vec<T_DST,N,A> dst = {};
|
||||
dst.fill((T)other);
|
||||
std::transform((*this).cbegin(), (*this).cend(), dst.cbegin(), dst.begin(), std::plus<>{});
|
||||
std::transform(this->cbegin(), this->cend(), dst.cbegin(), dst.begin(), std::plus<>{});
|
||||
return dst;
|
||||
}
|
||||
template<typename T_OTHER, typename T_DST = decltype((T)1 - (T_OTHER)1)>
|
||||
@@ -196,7 +196,7 @@ constexpr inline vec<T_DST,N,A> operator-(const T_OTHER &other) const
|
||||
{
|
||||
vec<T_DST,N,A> dst = {};
|
||||
dst.fill((T)other);
|
||||
std::transform((*this).cbegin(), (*this).cend(), dst.cbegin(), dst.begin(), std::minus<>{});
|
||||
std::transform(this->cbegin(), this->cend(), dst.cbegin(), dst.begin(), std::minus<>{});
|
||||
return dst;
|
||||
}
|
||||
template<typename T_OTHER, typename T_DST = decltype((T)1 * (T_OTHER)1)>
|
||||
@@ -204,7 +204,7 @@ constexpr inline vec<T_DST,N,A> operator*(const T_OTHER &other) const
|
||||
{
|
||||
vec<T_DST,N,A> dst = {};
|
||||
dst.fill((T)other);
|
||||
std::transform((*this).cbegin(), (*this).cend(), dst.cbegin(), dst.begin(), std::multiplies<>{});
|
||||
std::transform(this->cbegin(), this->cend(), dst.cbegin(), dst.begin(), std::multiplies<>{});
|
||||
return dst;
|
||||
}
|
||||
template<typename T_OTHER, typename T_DST = decltype((T)1 / (T_OTHER)1)>
|
||||
@@ -212,7 +212,7 @@ constexpr inline vec<T_DST,N,A> operator/(const T_OTHER &other) const
|
||||
{
|
||||
vec<T_DST,N,A> dst = {};
|
||||
dst.fill((T)1/other);
|
||||
std::transform((*this).cbegin(), (*this).cend(), dst.cbegin(), dst.begin(), std::multiplies<>{});
|
||||
std::transform(this->cbegin(), this->cend(), dst.cbegin(), dst.begin(), std::multiplies<>{});
|
||||
return dst;
|
||||
}
|
||||
|
||||
@@ -220,25 +220,25 @@ constexpr inline vec<T_DST,N,A> operator/(const T_OTHER &other) const
|
||||
template<typename T_OTHER, size_t N_OTHER, enum align A_OTHER = align::adaptive>
|
||||
constexpr inline vec<T,N,A> operator+=(const vec<T_OTHER,N_OTHER,A_OTHER> &other)
|
||||
{
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), (*this).begin(), std::plus<>{});
|
||||
std::transform(this->cbegin(), this->cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), this->begin(), std::plus<>{});
|
||||
return (*this);
|
||||
}
|
||||
template<typename T_OTHER, size_t N_OTHER, enum align A_OTHER = align::adaptive>
|
||||
constexpr inline vec<T,N,A> operator-=(const vec<T_OTHER,N_OTHER,A_OTHER> &other)
|
||||
{
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), (*this).begin(), std::minus<>{});
|
||||
std::transform(this->cbegin(), this->cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), this->begin(), std::minus<>{});
|
||||
return (*this);
|
||||
}
|
||||
template<typename T_OTHER, size_t N_OTHER, enum align A_OTHER = align::adaptive>
|
||||
constexpr inline vec<T,N,A> operator*=(const vec<T_OTHER,N_OTHER,A_OTHER> &other)
|
||||
{
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), (*this).begin(), std::multiplies<>{});
|
||||
std::transform(this->cbegin(), this->cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), this->begin(), std::multiplies<>{});
|
||||
return (*this);
|
||||
}
|
||||
template<typename T_OTHER, size_t N_OTHER, enum align A_OTHER = align::adaptive>
|
||||
constexpr inline vec<T,N,A> operator/=(const vec<T_OTHER,N_OTHER,A_OTHER> &other)
|
||||
{
|
||||
std::transform((*this).cbegin(), (*this).cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), (*this).begin(), [](const T& a, const T& b) { return (T)a*(T)1/b; });
|
||||
std::transform(this->cbegin(), this->cbegin() + std::min<size_t>(N_OTHER,N), other.cbegin(), this->begin(), [](const T& a, const T& b) { return (T)a*(T)1/b; });
|
||||
return (*this);
|
||||
}
|
||||
/* arithmetic assign scalar */
|
||||
@@ -247,7 +247,7 @@ constexpr inline vec<T,N,A> operator+=(const T_OTHER &other)
|
||||
{
|
||||
vec<T,N,A> dst = {};
|
||||
dst.fill((T)other);
|
||||
std::transform((*this).cbegin(), (*this).cend(), dst.cbegin(), (*this).begin(), std::plus<>{});
|
||||
std::transform(this->cbegin(), this->cend(), dst.cbegin(), this->begin(), std::plus<>{});
|
||||
return (*this);
|
||||
}
|
||||
template<typename T_OTHER>
|
||||
@@ -255,7 +255,7 @@ constexpr inline vec<T,N,A> operator-=(const T_OTHER &other)
|
||||
{
|
||||
vec<T,N,A> dst = {};
|
||||
dst.fill((T)other);
|
||||
std::transform((*this).cbegin(), (*this).cend(), dst.cbegin(), (*this).begin(), std::minus<>{});
|
||||
std::transform(this->cbegin(), this->cend(), dst.cbegin(), this->begin(), std::minus<>{});
|
||||
return (*this);
|
||||
}
|
||||
template<typename T_OTHER>
|
||||
@@ -263,7 +263,7 @@ constexpr inline vec<T,N,A> operator*=(const T_OTHER &other)
|
||||
{
|
||||
vec<T,N,A> dst = {};
|
||||
dst.fill((T)other);
|
||||
std::transform((*this).cbegin(), (*this).cend(), dst.cbegin(), (*this).begin(), std::multiplies<>{});
|
||||
std::transform(this->cbegin(), this->cend(), dst.cbegin(), this->begin(), std::multiplies<>{});
|
||||
return (*this);
|
||||
}
|
||||
template<typename T_OTHER>
|
||||
@@ -271,7 +271,7 @@ constexpr inline vec<T,N,A> operator/=(const T_OTHER &other)
|
||||
{
|
||||
vec<T,N,A> dst = {};
|
||||
dst.fill((T)1/other);
|
||||
std::transform((*this).cbegin(), (*this).cend(), dst.cbegin(), (*this).begin(), std::multiplies<>{});
|
||||
std::transform(this->cbegin(), this->cend(), dst.cbegin(), this->begin(), std::multiplies<>{});
|
||||
return (*this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user