Major rewrite. Abstracting graphics code completely and allowing new extensions via a consistent drawing interface

This commit is contained in:
Tiehuis
2015-02-21 15:36:15 +13:00
parent da0ff59971
commit 8cff1bb002
11 changed files with 506 additions and 406 deletions
+31
View File
@@ -0,0 +1,31 @@
#ifndef OPTIONS_H
#define OPTIONS_H
#include <getopt.h>
#define CONSTRAINT_GRID_MIN 4
#define CONSTRAINT_GRID_MAX 20
#define DEFAULT_GRID_HEIGHT 4
#define DEFAULT_GRID_WIDTH 4
#define DEFAULT_GOAL 2048
#define DEFAULT_SPAWN_VALUE 2
#define DEFAULT_SPAWN_RATE 1
#define DEFAULT_COLOR_TOGGLE 0
#define DEFAULT_ANIMATE_TOGGLE 1
struct gameoptions {
int grid_height;
int grid_width;
long goal;
long spawn_value;
int spawn_rate;
int enable_color;
int animate;
};
void print_usage(void);
struct gameoptions* parse_options(struct gameoptions*, int, char**);
struct gameoptions* gameoptions_default(void);
void gameoptions_destroy(struct gameoptions *opt);
#endif