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/game.h

    r643 r657  
    6363class Game
    6464{
     65public:
     66    Game(int argc, char **argv);
     67    ~Game();
     68
    6569private:
    6670  JCFont *fnt;
     
    8993  int state,zoom;
    9094
    91   Game(int argc, char **argv);
    92   ~Game();
    93 
    9495  void step();
    9596  void show_help(char const *st);
     
    106107               return cache.foret(foretiles[x]); }
    107108
    108   void ftile_on(int screenx, int screeny, int32_t &x, int32_t &y);
    109   void btile_on(int screenx, int screeny, int32_t &x, int32_t &y);
     109    vec2i GetFgTile(vec2i pos);
     110    vec2i GetBgTile(vec2i pos);
    110111  void toggle_delay();
    111112  void set_delay(int on) { no_delay=!on; }
    112113  void pan(int xv, int yv);
    113114
    114   void mouse_to_game(int32_t x, int32_t y, int32_t &gamex, int32_t &gamey, view *v=NULL);
    115   void game_to_mouse(int32_t gamex, int32_t gamey, view *which, int32_t &x, int32_t &y);
    116   view *view_in(int mousex, int mousey);
     115    vec2i MouseToGame(vec2i pos, view *v = NULL);
     116    vec2i GameToMouse(vec2i pos, view *v);
     117    view *GetView(vec2i pos);
    117118
    118119  int calc_speed();
Note: See TracChangeset for help on using the changeset viewer.