Ignore:
Timestamp:
May 15, 2011, 6:22:17 AM (11 years ago)
Author:
Sam Hocevar
Message:

game: refactor the mouse/game coordinate conversion logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/view.cpp

    r651 r657  
    341341{
    342342    int sug_x,sug_y,sug_b1,sug_b2,sug_b3,sug_b4;
    343     int32_t sug_px,sug_py;
     343    vec2i sug_p(0, 0);
    344344
    345345// NOTE:(AK) I have commented this out so we don't use the lisp
     
    384384        if( focus )
    385385        {
    386             the_game->mouse_to_game( last_demo_mx, last_demo_my, sug_px, sug_py, this );
    387             if( last_demo_mbut & 1 )
     386            sug_p = the_game->MouseToGame(vec2i(last_demo_mx, last_demo_my));
     387            if(last_demo_mbut & 1)
    388388                sug_b2 = 1;
    389             if( last_demo_mbut & 2 )
     389            if(last_demo_mbut & 2)
    390390                sug_b1 = 1;
    391391        }
    392         else
    393             sug_px = sug_py = 0;
    394392    }
    395393
     
    439437        mflags |= 128;
    440438
    441     base->packet.write_uint8( mflags );
    442     base->packet.write_uint16((uint16_t)((int16_t)sug_px));
    443     base->packet.write_uint16((uint16_t)((int16_t)sug_py));
     439    base->packet.write_uint8(mflags);
     440    base->packet.write_uint16((uint16_t)sug_p.x);
     441    base->packet.write_uint16((uint16_t)sug_p.y);
    444442}
    445443
Note: See TracChangeset for help on using the changeset viewer.