This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | absval(v) (((v) < 0) ? -(v) : (v)) |
A simple absolute value function. | |
#define | bitarraylen(bits, datatype) rounddivup(bits, sizeof(datatype) * 8) |
Computes the length of an array, in elements, that can store a minimum number of bits. | |
#define | bitflag(bitid, datatype) (1 << ((bitid) & (sizeof(datatype) * 8 - 1))) |
Produces the bit flag for a particular bit at its location in an array. | |
#define | bitindex(bitid, datatype) (((unsigned)bitid) / ((unsigned)sizeof(datatype) * (unsigned)8)) |
Finds the index into an array for a particular bit. | |
#define | BOTTOM_MARGIN 4 |
The margin, in pixels, between the GPL or menu items and the bottom of the window. | |
#define | DEAD_TIME 180 |
The number of frames a player stays dead after being hit. | |
#define | FMOTION_0_0 0.0f |
#define | FMOTION_0_1 1.0f |
#define | FMOTION_22_0 0.374606593f |
#define | FMOTION_22_1 0.927183855f |
#define | FMOTION_45_0 0.707106781f |
#define | FMOTION_45_1 0.707106781f |
#define | FRAME_DURATION 16 |
The intended duration of each frame in milliseconds. | |
#define | MAX_NAME_LEN 32 |
The maximum number of characters allowed in a player's name. | |
#define | MAX_PLAYERS 32 |
The maximum number of players allowed to participate in a single game. | |
#define | MOTION_0_0 0 |
#define | MOTION_0_1 256 |
#define | MOTION_22_0 98 |
#define | MOTION_22_1 237 |
#define | MOTION_45_0 181 |
#define | MOTION_45_1 181 |
#define | MOTION_DIV 4 |
#define | MOTION_SHELL_FACTOR 5 |
The constant multiplied to the values in the motion table to produce the motion values for shells. | |
#define | rounddiv(n, d) ((((n) % (d)) > ((int)(d) / 2)) ? ((int)(n) / (d) + 1) : ((int)(n) / (d))) |
Divides and rounds up if the fractional part of the result is greater than 0.5. | |
#define | rounddivup(n, d) ((((n) % (d)) > 0) ? ((int)(n) / (d) + 1) : ((int)(n) / (d))) |
Divides integers and rounds up any fractional part of the result. | |
#define | SHELL_GUIDED_DIST 96 |
The maximum distance a guided shell can travel. | |
#define | SHELL_PONG_DIST 192 |
The maximum distance a pong shell can travel. | |
#define | SRV_FRAME_OFFSET 6 |
The server's time offset of each frame in milliseconds relative to the client's frame. | |
#define | TOP_MARGIN 8 |
The margin, in pixels, between the game's title and the top of the window. | |
Enumerations | |
enum | { TEAM_RED, TEAM_BLUE, TEAM_GREEN, TEAM_PURPLE, TEAM_MAX, TEAM_UNDEC = 0xFF } |
The valid team codes. More... | |
enum | EVENT_TYPES { EC_FORWARD, EC_BACKWARD, EC_ROTRIGHT, EC_ROTLEFT, EC_FIRE, EC_FS_TOGGLE, EC_CHARACTER, EC_MAX } |
The high-level event types used in the game and the menus to abstract the different inputs that can trigger the events. More... | |
enum | LAYERS { LAYER_BACKGROUND, LAYER_OBSTACLES, LAYER_TEXT, LAYER_NAMES, LAYER_TANKS, LAYER_MAX } |
The layer codes. More... | |
Variables | |
Uint8 | eventState [EC_MAX] |
The event codes that are used to process user input in a way that separates the exact input used from the code that responds to the input. |
Copyright (C) 2007 Jeff Jackowski
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 program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Or visit their website at: http://www.gnu.org/
Definition in file genconmac.h.
#define absval | ( | v | ) | (((v) < 0) ? -(v) : (v)) |
A simple absolute value function.
Avoids having to inculde math libraries that would be underused by this program.
v | The value who's magnetude will be returned. |
Definition at line 269 of file genconmac.h.
#define bitarraylen | ( | bits, | |||
datatype | ) | rounddivup(bits, sizeof(datatype) * 8) |
Computes the length of an array, in elements, that can store a minimum number of bits.
This macro is a constant when given parameters with constant values.
bits | The minimum number of bits the array must hold. | |
datatype | The array element data type. |
Definition at line 260 of file genconmac.h.
#define bitflag | ( | bitid, | |||
datatype | ) | (1 << ((bitid) & (sizeof(datatype) * 8 - 1))) |
Produces the bit flag for a particular bit at its location in an array.
bitid | The number of the bit in the array. | |
datatype | The array element data type. |
Definition at line 251 of file genconmac.h.
Referenced by FlagCfgMsg().
#define bitindex | ( | bitid, | |||
datatype | ) | (((unsigned)bitid) / ((unsigned)sizeof(datatype) * (unsigned)8)) |
Finds the index into an array for a particular bit.
bitid | The number of the bit in the array. | |
datatype | The array element data type. |
Definition at line 242 of file genconmac.h.
Referenced by FlagCfgMsg().
#define BOTTOM_MARGIN 4 |
The margin, in pixels, between the GPL or menu items and the bottom of the window.
Definition at line 63 of file genconmac.h.
Referenced by BfldErrResize(), and SplashResize().
#define DEAD_TIME 180 |
The number of frames a player stays dead after being hit.
Definition at line 209 of file genconmac.h.
Referenced by AddPlayer(), HandleInput(), HandlePlayerSpawn(), ReadPlayer(), and UpdatePlayers().
#define FMOTION_0_0 0.0f |
Definition at line 181 of file genconmac.h.
#define FMOTION_0_1 1.0f |
Definition at line 182 of file genconmac.h.
#define FMOTION_22_0 0.374606593f |
Definition at line 183 of file genconmac.h.
#define FMOTION_22_1 0.927183855f |
Definition at line 184 of file genconmac.h.
#define FMOTION_45_0 0.707106781f |
Definition at line 185 of file genconmac.h.
#define FMOTION_45_1 0.707106781f |
Definition at line 186 of file genconmac.h.
#define FRAME_DURATION 16 |
The intended duration of each frame in milliseconds.
Definition at line 46 of file genconmac.h.
Referenced by ClientSync(), GameUninit(), main(), and UpdatePlayers().
#define MAX_NAME_LEN 32 |
The maximum number of characters allowed in a player's name.
Definition at line 30 of file genconmac.h.
Referenced by AppendPlayerData(), ReadPlayer(), SetLocalPlayerName(), and SetUsername().
#define MAX_PLAYERS 32 |
The maximum number of players allowed to participate in a single game.
Increasing the value can cause an exponential increase in the iterations through some loops.
Definition at line 41 of file genconmac.h.
Referenced by AddScoreNotice(), AddToConfigList(), BatchRender(), DisablePlayerLabels(), EnablePlayerLabels(), GameInit(), GameRun(), GameUninit(), HandleConnAccept(), HandleConnDisconn(), HandleConnReq(), HandleScoreUpdate(), MessageCliToSrv(), NetCliToSrv(), ReadPlayer(), ReceiveMessages(), Send(), SpawnTank(), TeamSelUninit(), TeamSelUpdate(), UpdatePlayers(), and ValidateClient().
#define MOTION_0_0 0 |
Definition at line 174 of file genconmac.h.
#define MOTION_0_1 256 |
Definition at line 175 of file genconmac.h.
#define MOTION_22_0 98 |
Definition at line 176 of file genconmac.h.
#define MOTION_22_1 237 |
Definition at line 177 of file genconmac.h.
#define MOTION_45_0 181 |
Definition at line 178 of file genconmac.h.
#define MOTION_45_1 181 |
Definition at line 179 of file genconmac.h.
#define MOTION_DIV 4 |
Definition at line 188 of file genconmac.h.
#define MOTION_SHELL_FACTOR 5 |
The constant multiplied to the values in the motion table to produce the motion values for shells.
Definition at line 194 of file genconmac.h.
Referenced by MoveShell().
#define rounddiv | ( | n, | |||
d | ) | ((((n) % (d)) > ((int)(d) / 2)) ? ((int)(n) / (d) + 1) : ((int)(n) / (d))) |
Divides and rounds up if the fractional part of the result is greater than 0.5.
Only integer instructions are used. Implemented as a macro. Any compiler should be able to reduce this to a constant if both parameters are constants.
n | The numerator. | |
d | The denominator. |
Definition at line 221 of file genconmac.h.
#define rounddivup | ( | n, | |||
d | ) | ((((n) % (d)) > 0) ? ((int)(n) / (d) + 1) : ((int)(n) / (d))) |
Divides integers and rounds up any fractional part of the result.
Any compiler should be able to reduce this to a constant if both parameters are constants.
n | The numerator. | |
d | The denominator. |
Definition at line 233 of file genconmac.h.
Referenced by BatchRender(), FlagCfgMsg(), ReceiveMessages(), and ResizeWindow().
#define SHELL_GUIDED_DIST 96 |
The maximum distance a guided shell can travel.
Definition at line 199 of file genconmac.h.
Referenced by MoveShell().
#define SHELL_PONG_DIST 192 |
The maximum distance a pong shell can travel.
For these shells to be effective, they must travel notably further than guided shells.
Definition at line 204 of file genconmac.h.
Referenced by MoveShell().
#define SRV_FRAME_OFFSET 6 |
The server's time offset of each frame in milliseconds relative to the client's frame.
Definition at line 52 of file genconmac.h.
Referenced by GameInit().
#define TOP_MARGIN 8 |
The margin, in pixels, between the game's title and the top of the window.
Definition at line 57 of file genconmac.h.
Referenced by BfldErrResize(), SetupMenu(), SplashResize(), and UpdateNotices().
anonymous enum |
The valid team codes.
Definition at line 120 of file genconmac.h.
enum EVENT_TYPES |
The high-level event types used in the game and the menus to abstract the different inputs that can trigger the events.
Definition at line 69 of file genconmac.h.
enum LAYERS |
The layer codes.
Definition at line 150 of file genconmac.h.