Changeset 1149


Ignore:
Timestamp:
Mar 2, 2012, 2:00:45 PM (8 years ago)
Author:
gary
Message:

math: minor compilation fixes for Visual Studio. Still does not link.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/math/vector.h

    r1148 r1149  
    9595    inline T const& operator[](int n) const { return *(&this->x + n); } \
    9696    \
    97     void printf() const; \
     97    /* Visual Studio insists on having an assignment operator. */ \
     98    inline tname<T> const & operator =(tname<T> const &that) \
     99    { \
     100        for (size_t n = 0; n < sizeof(*this) / sizeof(T); n++) \
     101            (*this)[n] = that[n]; \
     102        return *this; \
     103    } \
    98104    \
    99105    template<typename U> \
     
    104110            ret[n] = static_cast<U>((*this)[n]); \
    105111        return ret; \
    106     }
     112    } \
     113    \
     114    void printf() const;
    107115
    108116/*
  • trunk/src/vector.cpp

    r1139 r1149  
    313313    else if (m[0][0] > m[1][1] && m[0][0] > m[2][2])
    314314    {
    315         x = 0.5f * sqrt(1.0f + m[0][0] - m[1][1] - m[2][2]);
     315        x = 0.5f * sqrtf(1.0f + m[0][0] - m[1][1] - m[2][2]);
    316316        float s = 0.25f / x;
    317317        y = s * (m[1][0] + m[0][1]);
Note: See TracChangeset for help on using the changeset viewer.