diff options
Diffstat (limited to 'apps/plugins/xracer/xracer.h')
| -rw-r--r-- | apps/plugins/xracer/xracer.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/apps/plugins/xracer/xracer.h b/apps/plugins/xracer/xracer.h new file mode 100644 index 0000000..967f948 --- /dev/null +++ b/apps/plugins/xracer/xracer.h @@ -0,0 +1,69 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2015 Franklin Wei + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ + +#ifndef _XRACER_H_ +#define _XRACER_H_ + +/* miscellaneous #defines and data types */ + +#include "plugin.h" + +/* colors */ +#define SKY_COLOR1 LCD_RGBPACK(0, 0x96, 0xff) /* top of sky gradient */ +#define SKY_COLOR2 LCD_RGBPACK(0xfe, 0xfe, 0xfe) /* bottom of sky gradient */ +#define GRASS_COLOR1 LCD_RGBPACK(0, 0xc5, 0) +#define GRASS_COLOR2 LCD_RGBPACK(0, 0x9a, 0) +#define ROAD_COLOR1 LCD_RGBPACK(120, 120, 120) +#define ROAD_COLOR2 LCD_RGBPACK(80, 80, 80) +#define BORDER_COLOR1 LCD_RGBPACK(240, 0, 0) +#define BORDER_COLOR2 LCD_RGBPACK(240, 240, 240) +#define LANE_COLOR LCD_RGBPACK(0xcc, 0xcc, 0xcc) + +/* road parameters */ +#define ROAD_WIDTH (LCD_WIDTH/2) /* actually half the road width for easier math */ +#define MAX_ROAD_LENGTH 4096 +#define SEGMENT_LENGTH (LCD_WIDTH * 12) + +/* road generator parameters */ +#define HILLS true +#define CURVES true + +/* this specifies the length of each road and border color in segments */ +#define RUMBLE_LENGTH 3 +#define LANES 3 + +/* camera parameters */ +#define DRAW_DIST 512 +#define CAMERA_FOV 120 /* in degrees */ +#define CAMERA_HEIGHT 100 + +/* game parameters */ +/* currently this is how far the camera moves per keypress */ +#define MANUAL_SPEED 50 + +/* number of bits to use for the fractional part of fixed-point numbers */ +/* note that FOV calculation always uses 14 by default */ +#define FRACBITS 8 + +/* the number of fractional bits to use for high-precision numbers */ +#define HIPREC_FRACBITS 24 + +#endif |