TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
grscreen.h
Go to the documentation of this file.
1/***************************************************************************
2
3 file : grscreen.h
4 created : Thu May 15 22:11:19 CEST 2003
5 copyright : (C) 2003 by Eric EspiƩ
6 email : eric.espie@torcs.org
7 version : $Id$
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19
20#ifndef _GRSCREEN_H_
21#define _GRSCREEN_H_
22
23#include <car.h>
24#include "grcam.h"
25#include "grboard.h"
26
27class cGrScreen {
28 protected:
29 int id;
30
31 tCarElt *curCar; // Current car viewed.
32 tCarElt **cars; // List of cars.
33
34 int curCamHead; // The current camera list.
35 tGrCamHead cams[10]; // From F2 to F11.
36
37 class cGrPerspCamera *curCam; // The current camera.
38 class cGrCarCamMirror *mirrorCam; // The mirror camera.
39 class cGrPerspCamera *dispCam; // The display camera.
40 class cGrOrthoCamera *boardCam; // The board camera.
41 class cGrBackgroundCam *bgCam; // The background camera.
42
43 class cGrBoard *board; // The board.
44
45 int drawCurrent; // Should the current car be drawn.
46
48 float viewRatio;
49
50 int active; // Is the screen activated.
51
55
56 void loadParams(tSituation *s); // Load from parameters files.
57
58 public:
59 cGrScreen(int id);
60 ~cGrScreen();
61
62 void activate(int x, int y, int w, int h);
63 void desactivate(void);
64 void setZoom(long zoom);
65 int isInScreen(int x, int y);
66 void update(tSituation *s, float Fps);
67 void camDraw(tSituation *s);
69
70 void selectCamera(long cam);
71 void selectBoard(long brd);
72 void selectTrackMap();
73
74 void setCurrentCar(tCarElt *newCurCar);
75 void initCams(tSituation *s);
76 void initBoard(void);
77
78 void selectNextCar(void);
79 void selectPrevCar(void);
80 void switchMirror(void);
81
82 tCarElt *getCurrentCar(void) { return curCar; }
83 cGrCamera* getCurCamera(void) { return curCam; }
84 float getViewRatio(void) { return viewRatio; }
85 int getCurCamHead(void) { return curCamHead; }
86 int isActive(void) { return active; }
87 int getId(void) { return id; }
88 int getScrX (void) { return scrx; }
89 int getScrY (void) { return scry; }
90 int getScrW (void) { return scrw; }
91 int getScrH (void) { return scrh; }
92};
93
94
95#endif /* _GRSCREEN_H_ */
96
97
98
99
static Vector y[4]
Definition Convex.cpp:56
struct CarElt tCarElt
Car structure (tCarElt).
int scrx
Definition grscreen.h:47
float viewRatio
Definition grscreen.h:48
tCarElt ** cars
Definition grscreen.h:32
void desactivate(void)
Definition grscreen.cpp:133
class cGrCarCamMirror * mirrorCam
Definition grscreen.h:38
int mirrorFlag
Definition grscreen.h:54
class cGrBackgroundCam * bgCam
Definition grscreen.h:41
int scrh
Definition grscreen.h:47
int selectPrevFlag
Definition grscreen.h:53
cGrCamera * getCurCamera(void)
Definition grscreen.h:83
tCarElt * getCurrentCar(void)
Definition grscreen.h:82
void initBoard(void)
Definition grscreen.cpp:508
void selectTrackMap()
Definition grscreen.cpp:159
int isActive(void)
Definition grscreen.h:86
tCarElt * curCar
Definition grscreen.h:31
int scry
Definition grscreen.h:47
void camDraw(tSituation *s)
Definition grscreen.cpp:258
void initCams(tSituation *s)
Definition grscreen.cpp:455
int getId(void)
Definition grscreen.h:87
class cGrBoard * board
Definition grscreen.h:43
void switchMirror(void)
Definition grscreen.cpp:179
class cGrPerspCamera * dispCam
Definition grscreen.h:39
void setZoom(long zoom)
Definition grscreen.cpp:139
class cGrOrthoCamera * boardCam
Definition grscreen.h:40
void loadParams(tSituation *s)
Definition grscreen.cpp:392
int curCamHead
Definition grscreen.h:34
int scrw
Definition grscreen.h:47
int getScrY(void)
Definition grscreen.h:89
cGrScreen(int id)
Definition grscreen.cpp:41
void update(tSituation *s, float Fps)
Definition grscreen.cpp:304
int isInScreen(int x, int y)
Definition grscreen.cpp:90
int getScrW(void)
Definition grscreen.h:90
void activate(int x, int y, int w, int h)
Definition grscreen.cpp:113
int active
Definition grscreen.h:50
void selectNextCar(void)
Definition grscreen.cpp:144
void updateCurrent(tSituation *s)
int getCurCamHead(void)
Definition grscreen.h:85
float getViewRatio(void)
Definition grscreen.h:84
tGrCamHead cams[10]
Definition grscreen.h:35
void selectCamera(long cam)
Definition grscreen.cpp:198
int drawCurrent
Definition grscreen.h:45
void selectPrevCar(void)
Definition grscreen.cpp:149
int getScrH(void)
Definition grscreen.h:91
int selectNextFlag
Definition grscreen.h:52
int getScrX(void)
Definition grscreen.h:88
class cGrPerspCamera * curCam
Definition grscreen.h:37
void setCurrentCar(tCarElt *newCurCar)
Definition grscreen.cpp:107
void selectBoard(long brd)
Definition grscreen.cpp:154
struct Situation tSituation
cars situation used to inform the GUI and the drivers