Changeset 516


Ignore:
Timestamp:
Apr 20, 2011, 9:02:25 PM (7 years ago)
Author:
Sam Hocevar
Message:

lol: import newer matrix.h from Lol Engine.

File:
1 edited

Legend:

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

    r509 r516  
    3838    }
    3939
    40 #define BOOL_OP(elems, op, ret) \
     40#define BOOL_OP(elems, op, op2, ret) \
    4141    inline bool operator op(Vec##elems<T> const &val) const \
    4242    { \
    4343        for (int n = 0; n < elems; n++) \
    44             if ((*this)[n] != val[n]) \
    45                 return ret; \
    46         return !ret; \
     44            if (!((*this)[n] op2 val[n])) \
     45                return !ret; \
     46        return ret; \
    4747    }
    4848
     
    7979    VECTOR_OP(elems, /) \
    8080    \
    81     BOOL_OP(elems, ==, false) \
    82     BOOL_OP(elems, !=, true) \
     81    BOOL_OP(elems, ==, ==, true) \
     82    BOOL_OP(elems, !=, ==, false) \
     83    BOOL_OP(elems, <=, <=, true) \
     84    BOOL_OP(elems, >=, >=, true) \
     85    BOOL_OP(elems, <, <, true) \
     86    BOOL_OP(elems, >, >, true) \
    8387    \
    8488    SCALAR_OP(elems, -) \
Note: See TracChangeset for help on using the changeset viewer.