00001
00009 #ifndef _MAIN_H
00010 #define _MAIN_H
00011
00012 #include "psi3d/macros.h"
00013 #include "userkeys.h"
00014
00015 #include "cPad.h"
00016 #include "cController.h"
00017 #include "cBackground.h"
00018 #include "cMission.h"
00019 #include "cWorld.h"
00020 #include "cObject.h"
00021 #include "cWeapon.h"
00022 #include "cMech.h"
00023 #include "cBuilding.h"
00024 #include "cTree.h"
00025
00026 #define DEFAULT_FULLSCREEN true
00027 #define DEFAULT_FPS 29
00028 #define DEFAULT_XRES 800
00029 #define DEFAULT_YRES 600
00030 #define DEFAULT_BPP 16
00031 #define DEFAULT_FOV 60
00032
00038 struct cGame {
00040 cPad* pad1;
00041
00043 int* map1;
00044
00046 cObject* camera;
00047
00049 cWorld *world;
00050
00052 int mission;
00053
00055 string bgm;
00056
00058 bool paused;
00059
00061 bool fullscreen;
00062
00064 bool wireframe;
00065
00067 bool nightvision;
00068
00070 bool printpad;
00071
00073 float fps;
00074
00076 int width;
00077
00079 int height;
00080
00082 int depth;
00083
00085 int fov;
00086
00090 cGame();
00091
00095 void printHelp();
00096
00102 int parseArgs(int argc, char** args);
00103
00107 void initMission();
00108
00109 };
00110
00111
00112
00113 #include <SDL/SDL.h>
00114 #include <SDL/SDL_timer.h>
00115 #include <GL/gl.h>
00116 #include <GL/glu.h>
00117 #include <AL/al.h>
00118 #include <AL/alc.h>
00119 #ifndef __WIN32
00120 #include <AL/alext.h>
00121 #endif
00122 #include <AL/alut.h>
00123 #include <iostream>
00124
00125
00130 struct cMain {
00131 static cGame game;
00132
00134 static void initGL(int width, int height);
00135
00137 static void drawFrame(int elapsed_msec);
00138
00140 static void updateKey(Uint8 keysym);
00141
00143 static void updatePad(cPad* pad, SDL_Joystick* joy, int* mapping);
00144
00146 static int sdlmain(int argc, char** args);
00147 };
00148
00149
00150 #endif