1 /***************************************************************************
2                           gamerenderer.h  -  Renderer using world object
3                              -------------------
4     begin                : di apr 8 2003
5     copyright            : (C) 2003 by CJP
6     email                : cornware-cjp@users.sourceforge.net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef GAMERENDERER_H
19 #define GAMERENDERER_H
20 
21 #include "renderer.h"
22 #include "gamecamera.h"
23 
24 #include "graphicworld.h"
25 #include "movingobject.h"
26 
27 /**
28   *@author CJP
29   */
30 
31 class CGameRenderer : public CRenderer  {
32 public:
33 	CGameRenderer();
34 	virtual ~CGameRenderer();
35 
36 	virtual bool reloadConfiguration();
37 
38 	bool loadTrackData();
39 	void unloadTrackData();
40 	bool loadObjData();
41 	void unloadObjData();
42 
43 	//DON't use setCamera with CGameRenderer, use this instead!
44 	void setCameras(CGameCamera **cams, unsigned int num);
45 
46 	virtual void update();
47 
48 	CGraphicWorld *m_GraphicWorld; //TODO: place in CUSCore
49 
50 protected:
51 	CGameCamera **m_Cameras;
52 	unsigned int m_NumCameras;
53 	unsigned int m_CurrentCamera;
54 	int camx, camy, camz;
55 
56 	//Clipping plane of active camera
57 	//Used for faster, object-level clipping
58 	//(compared to OpenGL face-based clipping)
59 	CVector m_CamPlaneNor;
60 	float   m_CamPlaneDist;
61 
62 	void clearScreen();
63 	void updateShadows();
64 	void updateReflections();
65 	void updateParticleSystems();
66 	void selectCamera(unsigned int n, bool threed = true);
67 	void renderScene();
68 
69 	void viewBackground();
70 	void viewMovObj(unsigned int n);
71 
72 	void viewDashboard(unsigned int n);
73 	void viewLensFlare();
74 
75 	void viewTrack_normal();
76 	void viewTrack_displaylist();
77 
78 	void viewTrackPart(
79 		int xmin,int ymin,
80 		int xmax,int ymax,
81 		int dx,  int dy,
82 		int cur_zpos);
83 	void viewPilaar(int x, int y, int cur_zpos);
84 
85 	int m_UpdateBodyReflection;
86 
87 	int m_ViewportW, m_ViewportH; //pixel size of the current viewport
88 };
89 
90 #endif
91