#define PONG_VERSION "SpacePong v2.02"
#define GFX_RESOURCE "gfx.dpf"
#define MUS_RESOURCE "audio.dpf"
#define Y_POSITION_1 568
#define Y_POSITION_2 16
#define Y_SIZE_PADDER 16
#define X_SIZE_BALL 16
#define Y_SIZE_BALL 16
#define LEFT_BAR 151
#define RIGHT_BAR 648
#define UP_LIMIT -8
#define DOWN_LIMIT 600
#define MAX_BALL_SPEED 2.0f
#define MODE_COMPUTER 0
#define MODE_1PLAYER 2
#define MODE_2PLAYER 4
#define MODE_2NET 8
#define GAME_TIME 0
#define GAME_GOAL 2
#define GAME_NORMAL 4
#define PADDER_ACEL 1.0f
#define PADDER_MAXSPEED 8.0f
#define PONG_ENTRY 0
#define PONG_LOOP 1
#define PONG_QUIT 2
#define PONG_ENDMATCH 3
struct _sBall
{
float x,y;
float sx,sy;
float speed;
} sBall;
struct _sPadder
{
float x,y;
float speed;
short size,random;
} sPadder[2];
struct _sGameDat
{
Uint32 iWinP1;
Uint32 iWinP2;
char iModo;
char iTipo;
} sGameDat;
SDL_Rect rRect;
SDL_Surface *sGameBg, *sRestoreBg[2];
SDL_Surface *sMenuBg, *sMenuTitle, *sMenuInfo;
Uint32 iAux = 0;
Uint32 cCursor;
Uint32 bExitID, bPlayer1ID, bPlayer2ID;
Uint32 bTimeID, bGoalID, bNormalID, bAutoID, bID;
char sCad[10];
int music_menu;
int music_game;
int click, click2, thunder;
int p1, p2, pared, gol, end;
void LoadAudio();
void FreeAudio();
void LoadGraphics();
void FreeGraphics();
void RenderInGame(int bLogicUpdate);
void RenderInMenu(int bLogicUpdate);
void InitBall(int);
void AIPadder(int);
void PadderHitBall(int);
void GameLoop(void);
void DrawInterfaz(int);
void InfoEngine(int);
#define SET_SPEED(a,b)\
{ \
if(b==1) sPadder[a].speed+=PADDER_ACEL; \
else sPadder[a].speed-=PADDER_ACEL; \
if(b==1) { if(sPadder[a].speed<0.0f) sPadder[a].speed+=PADDER_ACEL*2; } \
else { if(sPadder[a].speed>0.0f) sPadder[a].speed-=PADDER_ACEL*2; } \
}