Skip to content
Permalink
Browse files

Add flag to post mouse button events or not, and use defined function…

… to post them
  • Loading branch information
pmandin committed Jan 31, 2006
1 parent 5bdff77 commit 3b06a363eebb44e6ff14ff9fb0bb1e99bc2fc16f
@@ -153,7 +153,7 @@ void AtariBios_PumpEvents(_THIS)
TranslateKey(i, bios_currentascii[i], &keysym, SDL_FALSE));
}

SDL_AtariXbios_PostMouseEvents(this);
SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);

/* Will be previous table */
memcpy(bios_previouskeyboard, bios_currentkeyboard, ATARIBIOS_MAXKEYS);
@@ -158,7 +158,7 @@ void AtariGemdos_PumpEvents(_THIS)
TranslateKey(i, gemdos_currentascii[i], &keysym, SDL_FALSE));
}

SDL_AtariXbios_PostMouseEvents(this);
SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);

/* Will be previous table */
memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard, ATARIBIOS_MAXKEYS);
@@ -122,7 +122,7 @@ static int atari_GetButton(int button)
}
}

void SDL_AtariXbios_PostMouseEvents(_THIS)
void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents)
{
if (SDL_AtariXbios_enabled==0) {
return;
@@ -135,7 +135,7 @@ void SDL_AtariXbios_PostMouseEvents(_THIS)
}

/* Mouse button ? */
if (SDL_AtariXbios_mouseb != atari_prevmouseb) {
if (buttonEvents && (SDL_AtariXbios_mouseb != atari_prevmouseb)) {
int i;

for (i=0;i<2;i++) {
@@ -46,6 +46,6 @@ extern int SDL_AtariXbios_enabled;

extern void SDL_AtariXbios_InstallVectors(int vectors_mask);
extern void SDL_AtariXbios_RestoreVectors(void);
extern void SDL_AtariXbios_PostMouseEvents(_THIS);
extern void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents);

#endif /* _SDL_XBIOSEVENTS_H_ */
@@ -45,7 +45,7 @@ static char rcsid =
#include "SDL_gemevents_c.h"
#include "SDL_atarikeys.h" /* for keyboard scancodes */
#include "SDL_atarievents_c.h"
#include "SDL_xbiosinterrupt_s.h"
#include "SDL_xbiosevents_c.h"

/* Defines */

@@ -383,10 +383,7 @@ static void do_mouse(_THIS, short mx, short my, short mb, short ks)

/* Mouse motion ? */
if (GEM_mouse_relative) {
if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
}
SDL_AtariXbios_PostMouseEvents(this, SDL_FALSE);
} else {
if ((prevmousex!=mx) || (prevmousey!=my)) {
int posx, posy;

0 comments on commit 3b06a36

Please sign in to comment.