workaround for wiimote mouse movement issue
This commit is contained in:
parent
b935d83ec9
commit
72fef99548
|
@ -41,6 +41,7 @@ static SDLKey keymap[232];
|
||||||
static s32 stat;
|
static s32 stat;
|
||||||
static s32 mstat;
|
static s32 mstat;
|
||||||
static WPADData *wd;
|
static WPADData *wd;
|
||||||
|
static int lastx = 0, lasty = 0;
|
||||||
|
|
||||||
static keyboard_event ke;
|
static keyboard_event ke;
|
||||||
static mouse_event me;
|
static mouse_event me;
|
||||||
|
@ -61,7 +62,14 @@ void PumpEvents()
|
||||||
|
|
||||||
if (wd->ir.valid)
|
if (wd->ir.valid)
|
||||||
{
|
{
|
||||||
posted += SDL_PrivateMouseMotion(0, 0, (int)wd->ir.x, (int)wd->ir.y);
|
int newx = wd->ir.x;
|
||||||
|
int newy = wd->ir.y;
|
||||||
|
int diffx = newx - lastx;
|
||||||
|
int diffy = newy - lasty;
|
||||||
|
lastx = newx;
|
||||||
|
lasty = newy;
|
||||||
|
|
||||||
|
posted += SDL_PrivateMouseMotion(0, 1, diffx, diffy);
|
||||||
|
|
||||||
Uint8 stateA = SDL_RELEASED;
|
Uint8 stateA = SDL_RELEASED;
|
||||||
Uint8 stateB = SDL_RELEASED;
|
Uint8 stateB = SDL_RELEASED;
|
||||||
|
@ -99,7 +107,7 @@ void PumpEvents()
|
||||||
|
|
||||||
if (mstat)
|
if (mstat)
|
||||||
{
|
{
|
||||||
posted += SDL_PrivateMouseMotion(me.button, 1, me.rx, me.ry);
|
posted += SDL_PrivateMouseMotion(0, 1, me.rx*2, me.ry*2);
|
||||||
|
|
||||||
u8 button = me.button;
|
u8 button = me.button;
|
||||||
|
|
||||||
|
|
|
@ -435,7 +435,7 @@ SDL_Surface *WII_SetVideoMode(_THIS, SDL_Surface *current,
|
||||||
currentwidth = current->w;
|
currentwidth = current->w;
|
||||||
currentheight = current->h;
|
currentheight = current->h;
|
||||||
currentbpp = bpp;
|
currentbpp = bpp;
|
||||||
WPAD_SetVRes(WPAD_CHAN_ALL, currentwidth, currentheight);
|
WPAD_SetVRes(WPAD_CHAN_ALL, currentwidth*2, currentheight*2);
|
||||||
draw_init();
|
draw_init();
|
||||||
StartVideoThread();
|
StartVideoThread();
|
||||||
/* We're done */
|
/* We're done */
|
||||||
|
@ -754,6 +754,7 @@ void WII_VideoStart()
|
||||||
SetupGX();
|
SetupGX();
|
||||||
draw_init();
|
draw_init();
|
||||||
StartVideoThread();
|
StartVideoThread();
|
||||||
|
WPAD_SetVRes(WPAD_CHAN_ALL, currentwidth*2, currentheight*2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WII_VideoStop()
|
void WII_VideoStop()
|
||||||
|
|
Reference in a new issue