joy fixing

This commit is contained in:
Rob Pearce 2008-11-12 05:52:21 +00:00
parent f5dc63e501
commit 64739a3707
1 changed files with 7 additions and 4 deletions

11
rc.c
View File

@ -8567,7 +8567,6 @@ void handleinput(void) {
getinput();
/* ************************************************************
These keys can always be pressed
************************************************************/
@ -8953,7 +8952,11 @@ void trytoshoot(sprite_t *pl) {
}
int keydown(int whichplayer, int checkfor) {
// adjust checkfor bsaed on player
int checkkey;
checkkey = checkfor;
// adjust checkkey based on player
if (whichplayer == 1) {
if (checkfor == SDLK_RIGHT) checkfor = SDLK_l;
if (checkfor == SDLK_LEFT) checkfor = SDLK_j;
@ -8962,10 +8965,9 @@ int keydown(int whichplayer, int checkfor) {
if (checkfor == SDLK_z) checkfor = SDLK_s;
if (checkfor == SDLK_x) checkfor = SDLK_d;
if (checkfor == SDLK_c) checkfor = SDLK_f;
}
// check for keypress
if (keys[checkfor]) {
if (keys[checkkey]) {
return B_TRUE;
}
@ -10321,6 +10323,7 @@ void drawhiscores(void) {
void getinput(void) {
int i,j;
keys = SDL_GetKeyState(NULL);
if (havejoysticks) {
for (j = 0; j < 2; j++) {
joyx[j] = SDL_JoystickGetAxis(joy[j],0);