diff options
author | Tobias Klauser <tklauser@xenon.tklauser.home> | 2006-07-04 00:03:18 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2006-07-04 00:03:18 +0200 |
commit | dc2bf2156c398734445a6d2fd237f52a81093853 (patch) | |
tree | 288745d143b49560a1acdedac0dd18ccd14527e6 | |
parent | 0017297a2437c5b334c979c9691bafc06389664f (diff) |
Reenable keys to move tux
-rw-r--r-- | hdaps-tux.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/hdaps-tux.c b/hdaps-tux.c index 5ca4751..0ef145b 100644 --- a/hdaps-tux.c +++ b/hdaps-tux.c @@ -40,7 +40,6 @@ int get_pos(int *xpos, int *ypos) memset(&buf, 0, BUF_SIZ); - /* Check wheter we have hdaps available */ fd = open(POSITION_FILE, O_RDONLY); if (fd < 0) { fprintf(stderr, "Could not open hdaps position file.\n"); @@ -77,7 +76,7 @@ int main(int argc, char *argv[]) } atexit(SDL_Quit); - SDL_WM_SetCaption ("hdaps_tux - Move tux with your Thinkpad (press q to exit)", "hdaps_tux"); + SDL_WM_SetCaption ("hdaps-tux - Move tux with your Thinkpad (press q to exit)", "hdaps-tux"); screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE | SDL_DOUBLEBUF); SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 255, 255, 255)); @@ -98,6 +97,7 @@ int main(int argc, char *argv[]) dstwhite.h = image->h + 1; SDL_SetColorKey(image, SDL_SRCCOLORKEY, SDL_MapRGB(image->format, 255, 255, 255)); + /* Get the hdaps position so we have something to start from */ get_pos(&hdapsX, &hdapsY); while (!done) { @@ -131,20 +131,19 @@ int main(int argc, char *argv[]) } keys = SDL_GetKeyState(NULL); -/* if (keys[SDLK_UP]) + if (keys[SDLK_UP]) /* Manually move tux up */ if (tuxY > 5) tuxY--; - if (keys[SDLK_DOWN]) + if (keys[SDLK_DOWN]) /* Manually move tux down */ if (tuxY < 475 - image->h) tuxY++; - if (keys[SDLK_RIGHT]) + if (keys[SDLK_RIGHT]) /* Manually move tux right */ if (tuxX < 635 - image->w) tuxX++; - if (keys[SDLK_LEFT]) + if (keys[SDLK_LEFT]) /* Manually move tux left */ if (tuxX > 5) tuxX--; -*/ - if (keys[SDLK_q]) + if (keys[SDLK_q]) /* Quit */ done = 1; if (tuxX < 5) |