Ignore:
Timestamp:
May 14, 2011, 4:00:48 PM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: merge JCMouse into EventHandler?.

File:
1 edited

Legend:

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

    r643 r652  
    2727#include "event.h"
    2828#include "video.h"
     29#include "filter.h"
     30
     31//
     32// Constructor
     33//
     34EventHandler::EventHandler(image *screen, palette *pal)
     35{
     36    CHECK(screen && pal);
     37    last_keystat = get_key_flags();
     38    m_pending = 0;
     39
     40    m_screen = screen;
     41
     42    // Mouse stuff
     43    uint8_t mouse_sprite[]=
     44    {
     45        0, 2, 0, 0, 0, 0, 0, 0,
     46        2, 1, 2, 0, 0, 0, 0, 0,
     47        2, 1, 1, 2, 0, 0, 0, 0,
     48        2, 1, 1, 1, 2, 0, 0, 0,
     49        2, 1, 1, 1, 1, 2, 0, 0,
     50        2, 1, 1, 1, 1, 1, 2, 0,
     51        0, 2, 1, 1, 2, 2, 0, 0,
     52        0, 0, 2, 1, 1, 2, 0, 0,
     53        0, 0, 2, 1, 1, 2, 0, 0,
     54        0, 0, 0, 2, 2, 0, 0, 0
     55    };
     56
     57    Filter f;
     58    f.Set(1, pal->brightest(1));
     59    f.Set(2, pal->darkest(1));
     60    image *im = new image(vec2i(8, 10), mouse_sprite);
     61    f.Apply(im);
     62
     63    m_sprite = new sprite(screen, im, 100, 100);
     64    m_pos = m_lastpos = screen->Size() / 2;
     65    m_button = m_lastbutton = 0;
     66    m_center = vec2i(0, 0);
     67
     68    // Platform-specific stuff
     69    SysInit();
     70}
    2971
    3072//
     
    3375EventHandler::~EventHandler()
    3476{
    35     delete mouse;
     77    ;
    3678}
    3779
Note: See TracChangeset for help on using the changeset viewer.