Changeset 121 for trunk/nv/position.hh


Ignore:
Timestamp:
06/15/13 17:47:57 (12 years ago)
Author:
epyon
Message:
  • Nova builds with -Weverything/-Wall/-pedantic/etc on: on MSVC 2012 on GCC 4.6.3 on clang 3.2
  • ... without a single fucking warning.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/position.hh

    r120 r121  
    1414#define NV_POSITION_HH
    1515
    16 #include <glm/glm.hpp>
    1716#include <nv/common.hh>
     17#include <nv/math.hh>
    1818#include <utility>
    1919
    2020namespace nv
    2121{
    22         typedef glm::ivec2 position;
    23         typedef glm::ivec2 dimension;
     22        typedef ivec2 position;
     23        typedef ivec2 dimension;
    2424
    2525        struct rectangle
     
    4646                 *Creates a new rectangle given an upper-left and lower-right position.
    4747                 *
    48                  *@param ul The position of the upper-left corner of the rectangle.
    49                  *@param lr The position of the lower-right corner of the rectangle.
    50                  */
    51                 rectangle( position ul, position lr ) : ul(ul), lr(lr) {}
     48                 *@param aul The position of the upper-left corner of the rectangle.
     49                 *@param alr The position of the lower-right corner of the rectangle.
     50                 */
     51                rectangle( position aul, position alr ) : ul(aul), lr(alr) {}
    5252               
    5353                /**
    5454                 *Creates a new rectangle given an upper-left position, width, and height.
    5555                 *
    56                  *@param ul The position of the upper-left corner of the rectangle.
     56                 *@param aul The position of the upper-left corner of the rectangle.
    5757                 *@param width The width of the rectangle.
    5858                 *@param height The height of the rectangle.
    5959                 */
    60                 rectangle( position ul, value_type width, value_type height ) : ul(ul), lr(ul + position(width,height)) {}
     60                rectangle( position aul, value_type width, value_type height ) : ul(aul), lr(aul + position(width,height)) {}
    6161       
    6262        /**
     
    269269                {
    270270                        if (r.contains(*this)) return false;
    271                         ul = glm::max( ul, r.ul );
    272                         lr = glm::min( lr, r.lr );
    273                         ul = glm::min( ul, lr );
     271                        ul = nv::max( ul, r.ul );
     272                        lr = nv::min( lr, r.lr );
     273                        ul = nv::min( ul, lr );
    274274                        return true;
    275275                }
     
    284284                {
    285285                        if ( r.get_width() < get_width() || r.get_height() < get_height() ) return false;
    286                         (*this) += glm::min( r.ul - ul, position() );
    287                         (*this) -= glm::min( lr - r.lr, position() );
     286                        (*this) += nv::min( r.ul - ul, position() );
     287                        (*this) -= nv::min( lr - r.lr, position() );
    288288                        return true;
    289289                }
     
    305305                void include_point( position p )
    306306                {
    307                         lr = glm::max( lr, p );
    308                         ul = glm::min( ul, p );
     307                        lr = nv::max( lr, p );
     308                        ul = nv::min( ul, p );
    309309                }
    310310
Note: See TracChangeset for help on using the changeset viewer.