summaryrefslogtreecommitdiff
path: root/hdaps-tux.c
diff options
context:
space:
mode:
Diffstat (limited to 'hdaps-tux.c')
-rw-r--r--hdaps-tux.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/hdaps-tux.c b/hdaps-tux.c
index 0ef145b..38ddf1a 100644
--- a/hdaps-tux.c
+++ b/hdaps-tux.c
@@ -63,9 +63,10 @@ int main(int argc, char *argv[])
SDL_Rect dst, dstwhite;
SDL_Event event;
Uint8 *keys;
- int tuxX = 270, tuxY = 170;
+ int tuxX = 180, tuxY = 170;
int hdapsX = 0, hdapsY = 0;
int hdapsXprev = 0, hdapsYprev = 0;
+ int vel = 4;
unsigned int timeout = TIMEOUT_VAL;
char done = 0;
@@ -78,7 +79,7 @@ int main(int argc, char *argv[])
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);
+ screen = SDL_SetVideoMode(W_WIDTH, W_HEIGHT, 16, SDL_HWSURFACE | SDL_DOUBLEBUF);
SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 255, 255, 255));
if (!screen) {
printf("Can't set video mode: %s\n", SDL_GetError());
@@ -124,8 +125,8 @@ int main(int argc, char *argv[])
dprintf("xdiff/ydiff: %d/%d\n", xdiff, ydiff);
- tuxX += xdiff * 3;
- tuxY += ydiff * 3;
+ tuxX += xdiff * vel;
+ tuxY += ydiff * vel;
timeout = TIMEOUT_VAL;
}
@@ -135,10 +136,10 @@ int main(int argc, char *argv[])
if (tuxY > 5)
tuxY--;
if (keys[SDLK_DOWN]) /* Manually move tux down */
- if (tuxY < 475 - image->h)
+ if (tuxY < W_HEIGHT - 5 - image->h)
tuxY++;
if (keys[SDLK_RIGHT]) /* Manually move tux right */
- if (tuxX < 635 - image->w)
+ if (tuxX < W_WIDTH - 5 - image->w)
tuxX++;
if (keys[SDLK_LEFT]) /* Manually move tux left */
if (tuxX > 5)
@@ -148,12 +149,12 @@ int main(int argc, char *argv[])
if (tuxX < 5)
tuxX = 5;
- if (tuxX > 635 - image->w)
- tuxX = 635 - image->w;
+ if (tuxX > W_WIDTH - image->w)
+ tuxX = W_WIDTH - image->w;
if (tuxY < 5)
tuxY = 5;
- if (tuxY > 475 - image->h)
- tuxY = 475 - image->h;
+ if (tuxY > W_HEIGHT - image->h)
+ tuxY = W_HEIGHT - image->h;
dprintf("tuxX/tuxY: %d/%d\n", tuxX, tuxY);
4591b72f5b05fd6923bc8cdcae92f2e5'>initramfs: Fix initramfs size for 32-bit archesGeert Uytterhoeven1-3/+3 2010-10-28Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek...Linus Torvalds6-125/+18