summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hdaps-tux.c15
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)
200'>2015-04-02samples/bpf: Add simple non-portable kprobe filter exampleAlexei Starovoitov1-1/+1 2015-03-17bpf: allow BPF programs access 'protocol' and 'vlan_tci' fieldsAlexei Starovoitov1-0/+9 2015-03-15samples: bpf: add skb->field examples and testsAlexei Starovoitov1-0/+70 2015-03-01ebpf: remove kernel test stubsDaniel Borkmann1-2/+3 2014-11-18bpf: remove test map scaffolding and user proper typesAlexei Starovoitov1-7/+7 2014-10-30samples: bpf: add a verifier test and summary lineAlexei Starovoitov1-1/+45 2014-10-21bpf: fix bug in eBPF verifierAlexei Starovoitov1-0/+11 2014-10-01bpf: add tests to verifier testsuiteAlexei Starovoitov1-0/+130 2014-09-26bpf: mini eBPF library, test stubs and verifier testsuiteAlexei Starovoitov1-0/+548