Changeset 477


Ignore:
Timestamp:
Apr 15, 2011, 6:45:45 PM (6 years ago)
Author:
Sam Hocevar
Message:

sdlport: do not hardcode screen size in event handlers, patch courtesy
of Jochen Schleu.

Location:
abuse/trunk/src/sdlport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/sdlport/event.cpp

    r124 r477  
    374374    x = (x << 16) / mouse_xscale;
    375375    y = (y << 16) / mouse_yscale;
    376     if( x > 319 )
    377     {
    378         x = 319;
    379     }
    380     if( y > 199 )
    381     {
    382         y = 199;
     376    if( x > screen->width() - 1 )
     377    {
     378        x = screen->width() - 1;
     379    }
     380    if( y > screen->height() - 1 )
     381    {
     382        y = screen->height() - 1;
    383383    }
    384384    ev.mouse_move.x = x;
  • abuse/trunk/src/sdlport/mouse.cpp

    r134 r477  
    9797{
    9898    // Make sure the values we are given are sensible.
    99     if( new_mx > 319 )
     99    if( new_mx > screen->width() - 1 )
    100100    {
    101         new_mx = 319;
     101        new_mx = screen->width() - 1;
    102102    }
    103     if( new_my > 199 )
     103    if( new_my > screen->height() - 1 )
    104104    {
    105         new_my = 199;
     105        new_my = screen->height() - 1;
    106106    }
    107107
Note: See TracChangeset for help on using the changeset viewer.