summaryrefslogtreecommitdiffstats
path: root/globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'globals.h')
-rw-r--r--globals.h46
1 files changed, 27 insertions, 19 deletions
diff --git a/globals.h b/globals.h
index 65b8aaa..b28bf18 100644
--- a/globals.h
+++ b/globals.h
@@ -3,50 +3,57 @@
#define FRAMERATE 14
#define BUF_SZ 1024
-/* The amount to offset the rainbow off the center of the cat */
+/* the amount to offset the rainbow off the center of the cat */
#define OFFSET 25
#define PI 3.14159265
-/* Type definitions */
+/* type definitions */
typedef struct {
int x, y;
} coords;
-typedef struct cat_instance cat_instance;
-struct cat_instance
+typedef struct cat cat_instance;
+struct cat
{
coords loc;
- struct list_head list;
+ /* magic to handle the linked list */
+ LIST_ENTRY(cat) entries;
};
+struct head_cat cat_list;
-typedef struct rainbow_instance rainbow_instance;
-struct rainbow_instance
+typedef struct rainbow rainbow_instance;
+struct rainbow
{
coords loc;
unsigned sprite;
- struct list_head list;
+ /* magic to handle the linked list */
+ LIST_ENTRY(rainbow) entries;
};
+struct head_rainbow rainbow_list;
-typedef struct sparkle_instance sparkle_instance;
-struct sparkle_instance
+typedef struct sparkle sparkle_instance;
+struct sparkle
{
- unsigned int frame, speed;
- int frame_mov;
- unsigned int layer;
+ unsigned short frame, speed;
+ short frame_mov;
+ unsigned short layer;
coords loc;
- struct list_head list;
+ /* magic to handle the linked list */
+ LIST_ENTRY(sparkle) entries;
};
+struct head_sparkle sparkle_list;
SDL_Event event;
bool running = true, sound = true, fullscreen = true, cursor = false, sine = false;
-int sound_volume = 128, catsize = 0, sparkle_spawn_counter = 0;
+int sound_volume = 128, sparkle_spawn_counter = 0;
Mix_Music *music;
#define BASE_PATH "res"
char *cat_dir;
-LIST_HEAD(sparkle_list);
-LIST_HEAD(cat_list);
-LIST_HEAD(rainbow_list);
+
+LIST_HEAD(head_cat, cat);
+LIST_HEAD(head_rainbow, rainbow);
+LIST_HEAD(head_sparkle, sparkle);
int cat_width, cat_height, rainbow_width, rainbow_height, sparkle_width, sparkle_height;
SDL_Renderer *renderer;
@@ -54,12 +61,13 @@ SDL_Texture *cat_texture, *rainbow_texture, *sparkle_texture;
uint32_t cat_sprite, rainbow_sprite, sparkle_sprite;
int cat_count, sparkle_count, rainbow_count;
int sparkle_pos;
-/* For sine */
+/* for sine */
unsigned t;
unsigned cat_num = 1;
double cat_size = 1;
+/* default screen size for windowed */
unsigned SCREEN_WIDTH = 1200;
unsigned SCREEN_HEIGHT = 800;