-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCRenderer.h
More file actions
executable file
·58 lines (47 loc) · 1.55 KB
/
CRenderer.h
File metadata and controls
executable file
·58 lines (47 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/////////////////////////////////////////////////////////////////////////////////////////////////
// class renderer qui est donc le moteur de rendu //
// //
// 2003 Jibe DUSSEAUT //
/////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "ressources.h"
#include "CGos.h"
#include "d3dtools.h"
#include "TileSet.h"
#include "God.h"
#include "CGoList.h"
#define ISO_TURNRIGHT(dir, turn) (ISODIRECTION)(((int)(dir)+turn))&7)
#define ISO_TURNLEFT(dir, turn) (ISODIRECTION)(((int)(dir)+(turn)*7)&7)
const short MAPSIZE = 21;
class CRenderer {
protected:
CGos _tile[MAPSIZE][MAPSIZE];
CGoList *_dobjects;
CTileSet* _texture;
CTileSet* _units;
//IDirect3DSurface8* _texture[4];
//IDirect3DSurface8* _ground;
public:
// bool to test if we must render
unsigned char _render;
// the scrolling anchor
POINT ptScreenAnchor;
CRenderer();
//init DIRECT3D
bool initD3D();
//clear DIRECT3D
void clearD3D();
//render the next frame
void renderFrame(const RECT *src, const RECT *dest);
//change the resiolution
bool changeResolution(UINT mode);
// the tilwalker to walk around the map
void tileWalker(POINT *depart, short dir);
//loading a map
bool loadMap(LPCSTR path);
//mouse mapper: from a given mouse coordinate returns the map coordinate
POINT mouseMapper(POINT mouse);
~CRenderer();
//convertion from map coordinate to world coordinate
vertexCoord tilePlotter(POINT mouse);
};