Tennix 0.7.0 "Deine Eltern sind auf einem Tennixturnier"
[tennix.git] / tennix.h
blobcb405225b2fe84e98810f5e8a3b16277348bef02
2 /**
4 * Tennix! SDL Port
5 * Copyright (C) 2003, 2007, 2008, 2009 Thomas Perl <thp@thpinfo.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 * MA 02110-1301, USA.
22 **/
24 #ifndef __TENNIX_H
25 #define __TENNIX_H
27 #include <sys/param.h>
29 #include "SDL.h"
31 #ifdef DELUXE_EDITION
32 # define HAVE_VOICE_FILES
33 # define EXTENDED_REFEREE
34 #endif
36 #define ARCHIVE_FILE "tennix.tnx"
37 #define ARCHIVE_FILE_INSTALLED "/" PREFIX "share/tennix/" ARCHIVE_FILE
39 #define COPYRIGHT "Copyright 2003, 2007, 2008, 2009 Thomas Perl"
40 #define URL "http://icculus.org/tennix/"
42 #define WIDTH 640
43 #define HEIGHT 480
45 #define BENCHMARK_TIMELIMIT 60 /* in seconds */
46 #define MENU_BUTTON_HEIGHT 62
47 #define MENU_BUTTON_WIDTH 185
49 #define MENU_START_YPOS 150
50 #define MENU_RESUME_YPOS 230
51 #define MENU_QUIT_YPOS 350
53 #define M_POS_XPOS(x) (x>WIDTH-MENU_BUTTON_WIDTH)
54 #define M_POS_START(y) (y>MENU_START_YPOS && y<MENU_START_YPOS+MENU_BUTTON_HEIGHT)
55 #define M_POS_RESUME(y) (y>MENU_RESUME_YPOS && y<MENU_RESUME_YPOS+MENU_BUTTON_HEIGHT)
56 #define M_POS_QUIT(y) (y>MENU_QUIT_YPOS && y<MENU_QUIT_YPOS+MENU_BUTTON_HEIGHT)
58 #define MENU_OPTIONS_BORDER 20
59 #define MENU_OPTIONS_BUTTON_HEIGHT 50
60 #define MENU_OPTIONS_BUTTON_WIDTH 150
62 /* Menu items */
63 enum {
64 MENU_NONE = 0,
65 MENU_START = 1,
66 MENU_RESUME = 2,
67 MENU_COURT_CHANGE = 4,
68 MENU_PLAYER1 = 8,
69 MENU_PLAYER2 = 16,
70 MENU_QUIT = 32
73 #define M_POS_DECODE(x,y) (M_POS_XPOS(x)?((M_POS_START(y))?(MENU_START):((M_POS_QUIT(y))?(MENU_QUIT):((M_POS_RESUME(y))?(MENU_RESUME):(MENU_NONE)))):(MENU_NONE))
75 /* Menu states */
76 enum {
77 MENU_STATE_STARTED = 0,
78 MENU_STATE_SLIDE_TO_MAINMENU,
79 MENU_STATE_SLIDE_TO_MAINMENU_IN_PROGRESS,
80 MENU_STATE_MAINMENU,
81 MENU_STATE_SLIDE_TO_OPTIONS,
82 MENU_STATE_SLIDE_TO_OPTIONS_IN_PROGRESS,
83 MENU_STATE_OPTIONS,
84 MENU_STATE_SLIDE_TO_GAME,
85 MENU_STATE_SLIDE_TO_GAME_IN_PROGRESS,
86 MENU_STATE_GAME,
87 MENU_STATE_SLIDE_TO_RESUME,
88 MENU_STATE_SLIDE_TO_RESUME_IN_PROGRESS,
89 MENU_STATE_RESUME,
90 MENU_STATE_SLIDE_TO_QUIT,
91 MENU_STATE_SLIDE_TO_QUIT_IN_PROGRESS,
92 MENU_STATE_QUIT
95 /* Comment the following #define to disable FPS limiting */
96 /*#define ENABLE_FPS_LIMIT*/
97 #define DEFAULT_FPS 33
100 extern SDL_Surface *screen;
102 typedef struct {
103 char *text;
104 int x;
105 int y;
106 int w;
107 int h;
108 Uint8 r;
109 Uint8 g;
110 Uint8 b;
111 } MenuButton;
113 #define M_POS_BUTTON(button,mx,my) (mx>=button.x && mx<=button.x+button.w && my>=button.y && my<=button.y+button.h)
115 #endif