Ignore:
Timestamp:
Sep 12, 2011, 10:17:23 PM (8 years ago)
Author:
Sam Hocevar
Message:

core: rename vec2i to ivec2 and update matrix.h from Lol Engine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/lol/matrix.h

    r660 r682  
    1818
    1919#include <cmath>
     20#if !defined __ANDROID__
     21#   include <iostream>
     22#endif
    2023
    2124namespace lol
     
    6770        for (int n = 0; n < elems && n < dest; n++) \
    6871            ret[n] = (*this)[n]; \
     72        for (int n = elems; n < dest; n++) \
     73            ret[n] = 0; \
    6974        return ret; \
    7075    }
     
    138143    OPERATORS(2)
    139144
     145#if !defined __ANDROID__
     146    template<typename U>
     147    friend std::ostream &operator<<(std::ostream &stream, Vec2<U> const &v);
     148#endif
     149
    140150    union { T x; T a; T i; };
    141151    union { T y; T b; T j; };
     
    143153
    144154typedef Vec2<float> vec2;
    145 typedef Vec2<int> vec2i;
     155typedef Vec2<int> ivec2;
    146156
    147157template <typename T> struct Vec3
     
    152162
    153163    OPERATORS(3)
     164
     165#if !defined __ANDROID__
     166    template<typename U>
     167    friend std::ostream &operator<<(std::ostream &stream, Vec3<U> const &v);
     168#endif
    154169
    155170    union { T x; T a; T i; };
     
    159174
    160175typedef Vec3<float> vec3;
    161 typedef Vec3<int> vec3i;
     176typedef Vec3<int> ivec3;
    162177
    163178template <typename T> struct Vec4
     
    168183
    169184    OPERATORS(4)
     185
     186#if !defined __ANDROID__
     187    template<typename U>
     188    friend std::ostream &operator<<(std::ostream &stream, Vec4<U> const &v);
     189#endif
    170190
    171191    union { T x; T a; T i; };
     
    176196
    177197typedef Vec4<float> vec4;
    178 typedef Vec4<int> vec4i;
     198typedef Vec4<int> ivec4;
    179199
    180200#define SCALAR_GLOBAL(elems, op, U) \
     
    230250
    231251    void printf() const;
     252
     253#if !defined __ANDROID__
     254    template<class U>
     255    friend std::ostream &operator<<(std::ostream &stream, Mat4<U> const &m);
     256#endif
    232257
    233258    inline Mat4<T> operator +(Mat4<T> const val) const
     
    295320
    296321typedef Mat4<float> mat4;
    297 typedef Mat4<int> mat4i;
     322typedef Mat4<int> imat4;
    298323
    299324} /* namespace lol */
Note: See TracChangeset for help on using the changeset viewer.