• Main Page
  • Data Structures
  • Files
  • File List
  • Globals

include/general.h

Go to the documentation of this file.
00001 
00186 // -----------------------------------------------------------
00187 // DEFINES
00188 // -----------------------------------------------------------
00189 
00190 #define LAN(X) X
00191 
00192 #define PROGRAM_NAME            "Pong2"
00193 #define PROGRAM_VERSION    "1.00"
00194 #define RELEASE_DATE       "31-03-2010" 
00195 #define MAX_SCORE          10
00196 #define MAX_LEVEL          5
00197 #define MAX_LEN                    256
00198 #define MAX_BARS                        2
00199 #define MAX_PADDLES                2
00200 #define MAX_BUTTONS        10
00201 #define MAX_BUFFER_SIZE    8196
00202 #define MAX_NOTE_LINES     11
00203 #define START_DELAY        0
00204 #define MUSIC_MULTIPLER    5
00205 
00206 // Check latest available version 
00207 #define URL1                "http://www.plaatsoft.nl/service/releasenotes1.html"
00208 #define ID1                             "UA-6887062-1"
00209 
00210 // Fetch Release notes
00211 #define URL2                "http://www.plaatsoft.nl/service/releasenotes1.html"
00212 #define ID2                                 "UA-6887062-1"
00213 
00214 // Set Get Today HighScore
00215 #define URL3                "http://www.plaatsoft.nl/service/score_set_today.php"
00216 #define ID3                                 "UA-6887062-1"
00217 
00218 // Set Get Global HighScore
00219 #define URL4                "http://www.plaatsoft.nl/service/score_set_global.php"
00220 #define ID4                                 "UA-6887062-1"
00221 
00222 #define URL_TOKEN           " Version "
00223 #define HIGHSCORE_FILENAME  "sd:/apps/pong2/highscore.xml"
00224 
00225 // Local trace (debug) file
00226 #define TRACE_FILENAME      "sd:/apps/pong2/pong2.trc"
00227 
00228 #define BUTTON_ANY      (WPAD_BUTTON_A     | WPAD_BUTTON_B)
00229 #define BUTTON_A        (WPAD_BUTTON_A     | WPAD_CLASSIC_BUTTON_A)
00230 #define BUTTON_B        (WPAD_BUTTON_B     | WPAD_CLASSIC_BUTTON_B)
00231 #define BUTTON_1        (WPAD_BUTTON_1     | WPAD_CLASSIC_BUTTON_X)
00232 #define BUTTON_2        (WPAD_BUTTON_2     | WPAD_CLASSIC_BUTTON_Y)
00233 #define BUTTON_HOME     (WPAD_BUTTON_HOME  | WPAD_CLASSIC_BUTTON_HOME)
00234 #define BUTTON_UP       (WPAD_BUTTON_UP    | WPAD_CLASSIC_BUTTON_UP)
00235 #define BUTTON_DOWN     (WPAD_BUTTON_DOWN  | WPAD_CLASSIC_BUTTON_DOWN)
00236 #define BUTTON_LEFT     (WPAD_BUTTON_LEFT  | WPAD_CLASSIC_BUTTON_LEFT)
00237 #define BUTTON_RIGHT    (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT)
00238 #define BUTTON_PLUS     (WPAD_BUTTON_PLUS  | WPAD_CLASSIC_BUTTON_PLUS)
00239 #define BUTTON_MINUS    (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS)
00240 
00241 // -----------------------------------------------------------
00242 // TYPEDEFS
00243 // -----------------------------------------------------------
00244 
00245 typedef struct
00246 {
00247    time_t localTime;
00248    time_t levelTime; 
00249    int    player1Score; 
00250    int    player2Score;
00251 } 
00252 score;
00253 
00254 score scores[MAX_LEVEL+1];
00255 score highscores[MAX_LEVEL+1];
00256 
00257 struct
00258 {
00259    int    x;
00260    int    xPrev;
00261    bool   xMove; 
00262    int    y;
00263    int    yPrev;
00264    bool   yMove;    
00265    int    counter;
00266 }
00267 ball;
00268 
00269 typedef struct 
00270 {
00271    int    x;
00272    int    xPrev;
00273    int    y;
00274    int    yPrev;
00275    int    len;
00276 }
00277 paddle;
00278 
00279 paddle paddles[MAX_PADDLES];
00280 
00281 typedef struct
00282 {
00283    int    x;
00284    int    y;
00285    int    len;
00286 }
00287 bar;
00288 
00289 bar bars[MAX_BARS];
00290    
00291 typedef struct
00292 {
00293    int   x;
00294    int   y;
00295    char  label[MAX_LEN];
00296 }
00297 button;
00298 
00299 button buttons[MAX_BUTTONS];
00300 
00301 struct
00302 {
00303    int    prevSecond;  
00304    int    delay;
00305    int    leftScore;
00306    int    rightScore;
00307    int    level;
00308    time_t startTime;
00309    bool   multiplayer;
00310 }
00311 game;
00312      
00313 struct
00314 {
00315    char data[MAX_BUFFER_SIZE];
00316    int  len;
00317    int  maxLines;
00318    int  scrollIndex;
00319    bool enabled;
00320 }
00321 releasenotes;
00322 
00323 // -----------------------------------------------------------
00324 // ENUMS
00325 // -----------------------------------------------------------
00326  
00327 enum
00328 {
00329    stateMenu=0,
00330    stateGame=1,
00331    stateLevel=2,
00332    stateGameOver=3,
00333    stateGamePause=4,
00334    stateScore=5,
00335    stateHighScore=6,
00336    stateHelp=7,
00337    stateCredits=8,
00338    stateReleaseNotes=9,
00339    stateGoodbye=10,
00340    stateNone=11
00341 };
00342 
00343 // -----------------------------------------------------------
00344 // The End
00345 // -----------------------------------------------------------

Generated by  doxygen 1.7.1