![]() |
torcs - 1.2.2 | ![]() |
00001 /*************************************************************************** 00002 00003 file : grscreen.h 00004 created : Thu May 15 22:11:19 CEST 2003 00005 copyright : (C) 2003 by Eric Espié 00006 email : eric.espie@torcs.org 00007 version : $Id: grscreen.h,v 1.8 2003/09/21 15:02:03 torcs Exp $ 00008 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 ***************************************************************************/ 00019 00026 #ifndef _GRSCREEN_H_ 00027 #define _GRSCREEN_H_ 00028 00029 #include <car.h> 00030 #include "grcam.h" 00031 #include "grboard.h" 00032 00033 class cGrScreen 00034 { 00035 protected: 00036 int id; 00037 00038 tCarElt *curCar; /* Current car viewed */ 00039 tCarElt **cars; /* list of cars */ 00040 00041 00042 int curCamHead; /* the current camera list */ 00043 tGrCamHead cams[10]; /* from F2 to F11 */ 00044 00045 class cGrPerspCamera *curCam; /* the current camera */ 00046 class cGrCarCamMirror *mirrorCam; /* the mirror camera */ 00047 class cGrPerspCamera *dispCam; /* the display camera */ 00048 class cGrOrthoCamera *boardCam; /* the board camera */ 00049 class cGrBackgroundCam *bgCam; /* the background camera */ 00050 00051 class cGrBoard *board; /* the board */ 00052 00053 int drawCurrent; /* Should the current car be drawn */ 00054 00055 int scrx, scry, scrw, scrh; 00056 float viewRatio; 00057 00058 int active; /* Is the screen activated */ 00059 00060 int selectNextFlag; 00061 int selectPrevFlag; 00062 int mirrorFlag; 00063 00064 void loadParams(tSituation *s); /* load from parameters files */ 00065 00066 public: 00067 00068 cGrScreen(int id); 00069 00070 ~cGrScreen(); 00071 00072 void activate(int x, int y, int w, int h); 00073 void desactivate(void); 00074 00075 void setZoom(int zoom); 00076 00077 int isInScreen(int x, int y); 00078 00079 void update(tSituation *s, float Fps); 00080 00081 void cGrScreen::camDraw(tSituation *s); 00082 00083 void updateCurrent(tSituation *s); 00084 00085 void selectCamera(int cam); 00086 00087 void selectBoard(int brd); 00088 00089 void selectTrackMap(); 00090 00091 void setCurrentCar(tCarElt *newCurCar); 00092 00093 void initCams(tSituation *s); 00094 00095 void initBoard(void); 00096 00097 void selectNextCar(void); 00098 void selectPrevCar(void); 00099 void switchMirror(void); 00100 00101 tCarElt *getCurrentCar(void) { 00102 return curCar; 00103 } 00104 00105 float getViewRatio(void) { 00106 return viewRatio; 00107 } 00108 00109 int getCurCamHead(void) { 00110 return curCamHead; 00111 } 00112 00113 int isActive(void) { 00114 return active; 00115 } 00116 00117 int getId(void) { 00118 return id; 00119 } 00120 int getScrX (void) { 00121 return scrx; 00122 } 00123 int getScrY (void) { 00124 return scry; 00125 } 00126 int getScrW (void) { 00127 return scrw; 00128 } 00129 int getScrH (void) { 00130 return scrh; 00131 } 00132 00133 }; 00134 00135 00136 #endif /* _GRSCREEN_H_ */ 00137 00138 00139