Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Terrain.h
Go to the documentation of this file.
1
/* Project Starshatter 4.5
2
Destroyer Studios LLC
3
Copyright © 1997-2005. All Rights Reserved.
4
5
SUBSYSTEM: Stars.exe
6
FILE: Terrain.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Test pseudo-random terrain heightfield, based on Solid
13
*/
14
15
#ifndef Terrain_h
16
#define Terrain_h
17
18
#include "
Types.h
"
19
#include "
Graphic.h
"
20
#include "
Geometry.h
"
21
#include "
Bitmap.h
"
22
#include "
Text.h
"
23
24
// +--------------------------------------------------------------------+
25
26
class
Projector
;
27
class
Scene
;
28
class
TerrainApron
;
29
class
TerrainClouds
;
30
class
TerrainLayer
;
31
class
TerrainPatch
;
32
class
TerrainRegion
;
33
class
Water
;
34
35
// +--------------------------------------------------------------------+
36
37
struct
Vec3B
38
{
39
Vec3B
() { }
40
Vec3B
(BYTE a, BYTE b, BYTE c) :
x
(a),
y
(b),
z
(c) { }
41
42
BYTE
x
,
y
,
z
;
43
};
44
45
// +--------------------------------------------------------------------+
46
47
class
Terrain
48
{
49
public
:
50
Terrain
(
TerrainRegion
*
region
);
51
virtual
~Terrain
();
52
53
virtual
void
Activate
(
Scene
& scene);
54
virtual
void
Deactivate
(
Scene
& scene);
55
56
virtual
void
SelectDetail
(
Projector
* proj);
57
virtual
void
BuildTerrain
();
58
virtual
void
BuildNormals
();
59
60
virtual
void
ExecFrame
(
double
seconds);
61
62
double
Height
(
double
x,
double
y)
const
;
63
64
const
Vec3B
*
Normals
()
const
{
return
terrain_normals
; }
65
TerrainRegion
*
GetRegion
() {
return
region
; }
66
double
FogFade
()
const
{
return
fog_fade
; }
67
68
Bitmap
*
Texture
() {
return
terrain_texture
; }
69
Bitmap
*
ApronTexture
() {
return
apron_texture
; }
70
Bitmap
*
WaterTexture
() {
return
water_texture
; }
71
Bitmap
**
EnvironmentTexture
() {
return
env_texture
; }
72
Bitmap
*
TileTexture
(
int
n) {
return
tiles
[n]; }
73
Bitmap
*
CloudTexture
(
int
n) {
return
cloud_texture
[n]; }
74
Bitmap
*
ShadeTexture
(
int
n) {
return
shade_texture
[n]; }
75
Bitmap
*
DetailTexture
(
int
n) {
return
noise_texture
[n]; }
76
Water
*
GetWater
(
int
level) {
return
water
[level]; }
77
List<TerrainLayer>
&
GetLayers
() {
return
layers
; }
78
79
bool
IsFirstPatch
(
TerrainPatch
* p)
const
;
80
81
static
int
DetailLevel
() {
return
detail_level
; }
82
static
void
SetDetailLevel
(
int
detail);
83
84
protected
:
85
TerrainRegion
*
region
;
86
TerrainPatch
**
patches
;
87
TerrainPatch
**
water_patches
;
88
Water
**
water
;
89
TerrainApron
**
aprons
;
90
TerrainClouds
**
clouds
;
91
int
nclouds
;
92
93
Bitmap
terrain_patch
;
94
Bitmap
terrain_apron
;
95
Bitmap
*
terrain_texture
;
96
Bitmap
*
apron_texture
;
97
Bitmap
*
water_texture
;
98
Bitmap
*
env_texture
[6];
99
Bitmap
*
tiles
[256];
100
Bitmap
*
cloud_texture
[2];
101
Bitmap
*
shade_texture
[2];
102
Bitmap
*
noise_texture
[2];
103
104
Vec3B
*
terrain_normals
;
105
List<TerrainLayer>
layers
;
106
107
Text
datapath
;
108
double
scale
;
109
double
mtnscale
;
110
int
subdivisions
;
111
int
patch_size
;
112
DWORD
detail_frame
;
113
double
fog_fade
;
114
115
static
int
detail_level
;
116
};
117
118
#endif Terrain_h
119
Stars45
Terrain.h
Generated on Tue Jun 5 2012 20:47:15 for Starshatter_Open by
1.8.1