summaryrefslogtreecommitdiff
path: root/hdaps-tux.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2008-09-08 22:18:28 +0200
committerTobias Klauser <tklauser@xenon.tklauser.home>2008-09-08 22:18:28 +0200
commitef16dbc591bec9a8cc07f76d44d1b4e991c83b65 (patch)
treecc1adceb9b00fd168936c2b672bc6191a59a6e2d /hdaps-tux.c
parent7ce7e9f7904b9cfaedb735003e796456b9f6f3dc (diff)
Simplyfy calculation of screen centreHEADmaster
Diffstat (limited to 'hdaps-tux.c')
-rw-r--r--hdaps-tux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hdaps-tux.c b/hdaps-tux.c
index 1856040..9228883 100644
--- a/hdaps-tux.c
+++ b/hdaps-tux.c
@@ -99,15 +99,15 @@ int main(int argc, char *argv[])
SDL_SetColorKey(image, SDL_SRCCOLORKEY, SDL_MapRGB(image->format, 255, 255, 255));
/* Calculate and set initial position of tux (centre of the window) */
- tuxX = (W_WIDTH / 2) - (image->w / 2);
- tuxY = (W_HEIGHT / 2) - (image->h / 2);
+ tuxX = (W_WIDTH - image->w) / 2;
+ tuxY = (W_HEIGHT - image->h) / 2;
/* Get the hdaps position so we have something to start from */
get_pos(&hdapsX, &hdapsY);
while (!done) {
while (SDL_PollEvent(&event)) {
- switch(event.type) {
+ switch (event.type) {
case SDL_QUIT:
done = 1;
break;