-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pathfinder.h
97 lines (76 loc) · 2.54 KB
/
Pathfinder.h
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//------------------------------------------------------------------------------
// File: Pathfinder.h
// Desc: Program to generate a simple A* path solver
//
// Created: 05 December 2002 12:19:45
//
// (c)2002 Neil Wakefield
//------------------------------------------------------------------------------
#ifndef INCLUSIONGUARD_PATHFINDER_H
#define INCLUSIONGUARD_PATHFINDER_H
//------------------------------------------------------------------------------
// Included files:
//------------------------------------------------------------------------------
#define WIN32_LEAN_AND_MEAN
#include "Grid.h"
#include "Player.h"
#include "Constants.h"
#include "resource.h"
#include <windows.h>
#include <d3dx8.h>
#include <tchar.h>
#include "d3dapp.h"
//------------------------------------------------------------------------------
// Macros:
//------------------------------------------------------------------------------
#define SAFE_RELEASE_VS(s) if(s!= 0xffffffff){m_pd3dDevice->DeleteVertexShader(s);s=0xffffffff;}
#define SAFE_RELEASE(x) if(x){x->Release();x=NULL;}
//-----------------------------------------------------------------------------
// Name: struct MESH_VERTEX
// Desc: A single vertex in a mesh
//-----------------------------------------------------------------------------
struct MESH_VERTEX
{
D3DXVECTOR3 p; // Position
D3DXVECTOR3 n; // Normal
};
//------------------------------------------------------------------------------
// Name: class App
// Desc: The main application class
//------------------------------------------------------------------------------
class App : public CD3DApplication
{
public:
App();
~App();
HRESULT OneTimeSceneInit();
HRESULT FinalCleanup();
HRESULT InitDeviceObjects();
HRESULT DeleteDeviceObjects();
HRESULT RestoreDeviceObjects();
HRESULT InvalidateDeviceObjects();
HRESULT Render();
HRESULT FrameMove();
HRESULT ConfirmDevice( D3DCAPS8*, DWORD, D3DFORMAT );
private:
void SetUpLights();
Grid* m_pGrid;
bool m_newMaze;
bool m_chaseCam;
Player* m_pPlayer;
DWORD m_dwMeshFVF;
LPD3DXMESH m_pPlayerMesh;
LPDIRECT3DVERTEXBUFFER8 m_pPlayerVB;
DWORD m_dwNumPlayerVertices;
LPDIRECT3DINDEXBUFFER8 m_pPlayerIB;
DWORD m_dwNumPlayerPrims;
LPD3DXMESH m_pCubeMesh;
LPDIRECT3DVERTEXBUFFER8 m_pCubeVB;
DWORD m_dwNumCubeVertices;
LPDIRECT3DINDEXBUFFER8 m_pCubeIB;
DWORD m_dwNumCubePrims;
D3DMATERIAL8 m_wallMaterial;
D3DMATERIAL8 m_borderMaterial;
D3DMATERIAL8 m_playerMaterial;
};
#endif //INCLUSIONGUARD_PATHFINDER_H