From 8898ad9b25fca6afe2374d293a981db02a83d7e9 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 31 May 2012 14:46:27 +0000 Subject: Committing the documentation to svn to have it accessible online --- Doc/doxygen/html/_ship_solid_8cpp_source.html | 213 ++++++++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 Doc/doxygen/html/_ship_solid_8cpp_source.html (limited to 'Doc/doxygen/html/_ship_solid_8cpp_source.html') diff --git a/Doc/doxygen/html/_ship_solid_8cpp_source.html b/Doc/doxygen/html/_ship_solid_8cpp_source.html new file mode 100644 index 0000000..4d9e6cb --- /dev/null +++ b/Doc/doxygen/html/_ship_solid_8cpp_source.html @@ -0,0 +1,213 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/ShipSolid.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
ShipSolid.cpp
+
+
+Go to the documentation of this file.
1 /* Project Starshatter 4.5
+
2  Destroyer Studios LLC
+
3  Copyright © 1997-2004. All Rights Reserved.
+
4 
+
5  SUBSYSTEM: Stars.exe
+
6  FILE: ShipSolid.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12 */
+
13 
+
14 #include "MemDebug.h"
+
15 #include "ShipSolid.h"
+
16 #include "Ship.h"
+
17 #include "Sim.h"
+
18 #include "StarSystem.h"
+
19 #include "TerrainRegion.h"
+
20 
+
21 #include "Game.h"
+
22 #include "Skin.h"
+
23 
+
24 // +--------------------------------------------------------------------+
+
25 
+ +
27 : ship(s), skin(0), in_soup(false)
+
28 {
+
29 }
+
30 
+
31 // +--------------------------------------------------------------------+
+
32 
+ +
34 {
+
35 }
+
36 
+
37 // +--------------------------------------------------------------------+
+
38 
+
39 void
+ +
41 {
+
42  true_eye_point = ref;
+
43  Solid::TranslateBy(ref);
+
44 }
+
45 
+
46 // +--------------------------------------------------------------------+
+
47 
+
48 void
+
49 ShipSolid::Render(Video* video, DWORD flags)
+
50 {
+
51  if (hidden || !visible || !video || Depth() > 5e6)
+
52  return;
+
53 
+
54  const Skin* s = 0;
+
55 
+
56  if (ship)
+
57  s = ship->GetSkin();
+
58  else
+
59  s = skin;
+
60 
+
61  if (s)
+
62  s->ApplyTo(model);
+
63 
+
64  bool fog = false;
+
65 
+
66  if (ship && ship->IsAirborne()) {
+
67  fog = true;
+
68 
+ +
70  double visibility = rgn->GetWeather().Visibility();
+
71  FLOAT fog_density = (FLOAT) (rgn->FogDensity() * 2.5e-5 * 1/visibility);
+
72  Color fog_color = rgn->FogColor();
+
73 
+
74  // Use BLACK fog on secondary lighting pass
+
75  // This will effectively "filter out" the highlights
+
76  // with distance...
+
77 
+
78  if (flags & Graphic::RENDER_ADD_LIGHT)
+
79  fog_color = Color::Black;
+
80 
+
81  video->SetRenderState(Video::FOG_ENABLE, true);
+
82  video->SetRenderState(Video::FOG_COLOR, fog_color.Value());
+
83  video->SetRenderState(Video::FOG_DENSITY, *((DWORD*) &fog_density));
+
84  }
+
85 
+
86  if (!fog) video->SetRenderState(Video::FOG_ENABLE, false);
+
87 
+
88  Solid::Render(video, flags);
+
89 
+
90  if (fog) video->SetRenderState(Video::FOG_ENABLE, false);
+
91 
+
92  if (s)
+
93  s->Restore(model);
+
94 }
+
95 
+
96 
+
+
+ + + + -- cgit v1.1