diff options
author | LAMMJohnson <john_anthony@lavabit.com> | 2011-04-27 13:28:22 +0100 |
---|---|---|
committer | LAMMJohnson <john_anthony@lavabit.com> | 2011-04-27 13:28:22 +0100 |
commit | 750ca50401ebca0b85914ec99f853819b03898d9 (patch) | |
tree | 292d0acf58a12115f54e2b2952213e949c7aa80c | |
parent | 3d85d5e9f260eb1a00e76736dbac6d9bba77f7e1 (diff) | |
download | nyancat-750ca50401ebca0b85914ec99f853819b03898d9.tar.gz nyancat-750ca50401ebca0b85914ec99f853819b03898d9.tar.bz2 nyancat-750ca50401ebca0b85914ec99f853819b03898d9.zip |
Tidying. First Xinerama touches
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | nyan.c | 20 |
2 files changed, 13 insertions, 8 deletions
@@ -2,4 +2,3 @@ -- Add Xinerama support (one cat per monitor) -- Add command-line args -- Add rc file --- Make a proper install @@ -14,9 +14,13 @@ #include <stdio.h>
#include <stdlib.h>
#include <time.h>
+#ifdef XINERAMA
+#include <X11/extensions/Xinerama.h>
+#endif /* XINERAMA */
#define CLEARSCR() (fillsquare(screen, 0, 0, screen->w, screen->h, bgcolor))
+/* Type definitions */
typedef struct {
int x, y;
} coords;
@@ -36,13 +40,7 @@ struct sparkle_instance { sparkle_instance* next;
};
-SDL_Surface* cat_img[5];
-SDL_Surface* sparkle_img[5];
-Mix_Music* music;
-sparkle_instance* sparkles_list = NULL;
-cat_instance* cat_list = NULL;
-Uint32 bgcolor;
-
+/* Predecs */
void add_sparkle(void);
void add_cat(unsigned int x, unsigned int y);
void draw_cats(unsigned int frame);
@@ -57,6 +55,7 @@ void remove_sparkle(sparkle_instance* s); void start_music(void);
void update_sparkles(void);
+/* Globals */
unsigned int FRAMERATE = 14;
unsigned int SCREEN_BPP = 32;
@@ -65,6 +64,13 @@ static SDL_Event event; static int running = 1;
static int SURF_TYPE = SDL_HWSURFACE;
+static SDL_Surface* cat_img[5];
+static SDL_Surface* sparkle_img[5];
+static Mix_Music* music;
+static sparkle_instance* sparkles_list = NULL;
+static cat_instance* cat_list = NULL;
+static Uint32 bgcolor;
+
void
add_sparkle(void) {
sparkle_instance* s = sparkles_list;
|