X-Git-Url: http://git.mutantstargoat.com?p=winnie;a=blobdiff_plain;f=src%2Fsdl%2Fmouse.cc;h=3ba98a062f82613af7d5f0c97e3734ff9d0381c3;hp=db39d4a89fa77974ba4394f6d170738dcd24390f;hb=9261ecb0ad85bdf8b21e17b7309ddaeb76a57d96;hpb=e2626c41c841dbbfb64ddf6341b4e23089036299 diff --git a/src/sdl/mouse.cc b/src/sdl/mouse.cc index db39d4a..3ba98a0 100644 --- a/src/sdl/mouse.cc +++ b/src/sdl/mouse.cc @@ -24,8 +24,9 @@ Author: Eleni Maria Stea #include "mouse.h" #include "shalloc.h" -#include "window.h" #include "wm.h" +#include "window.h" +#include "winnie.h" extern SDL_Event sdl_event; @@ -42,6 +43,8 @@ bool init_mouse() if(!(mouse = (Mouse*)sh_malloc(sizeof *mouse))) { return false; } + get_subsys()->mouse_offset = (int)((char*)mouse - (char*)get_pool()); + memset(mouse, 0, sizeof *mouse); return true; }