Fix in Vector conversion.
No need for a conversion overload. Conversion constructor should cast whatever it's assigning.
This commit is contained in:
parent
19ad7a77ea
commit
ed4e73f0d9
3 changed files with 2 additions and 17 deletions
|
@ -45,7 +45,7 @@ namespace cloonel {
|
|||
if (m_texture) {
|
||||
int width, height;
|
||||
SDL_QueryTexture(m_texture, nullptr, nullptr, &width, &height);
|
||||
m_size = int2(width, height);
|
||||
m_size = static_cast<ushort2>(int2(width, height));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,6 @@ namespace cloonel {
|
|||
template <typename U> const Vector& operator*= ( U parOther );
|
||||
template <typename U> const Vector& operator/= ( U parOther );
|
||||
|
||||
template <typename U>
|
||||
operator Vector<U, S> ( void );
|
||||
|
||||
T& operator[] ( uint32_t parIndex ) { return m_mem[parIndex]; }
|
||||
const T& operator[] ( uint32_t parIndex ) const { return m_mem[parIndex]; }
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace cloonel {
|
|||
template <typename U>
|
||||
Vector<T, S>::Vector (const Vector<U, S>& parOther) {
|
||||
for (uint32_t z = 0; z < S; ++z) {
|
||||
m_mem[z] = parOther.m_mem[z];
|
||||
m_mem[z] = static_cast<T>(parOther.m_mem[z]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,18 +87,6 @@ namespace cloonel {
|
|||
return *this;
|
||||
}
|
||||
|
||||
///-------------------------------------------------------------------------
|
||||
///-------------------------------------------------------------------------
|
||||
template <typename T, uint32_t S>
|
||||
template <typename U>
|
||||
Vector<T, S>::operator Vector<U, S>() {
|
||||
Vector<U, S> retVal;
|
||||
for (uint32_t z = 0; z < S; ++z) {
|
||||
retVal[z] = m_mem[z];
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
///-------------------------------------------------------------------------
|
||||
///-------------------------------------------------------------------------
|
||||
template <typename T, typename U, uint32_t S>
|
||||
|
|
Loading…
Reference in a new issue