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/_stars45_2_grid_8cpp_source.html | 209 ++++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 Doc/doxygen/html/_stars45_2_grid_8cpp_source.html (limited to 'Doc/doxygen/html/_stars45_2_grid_8cpp_source.html') diff --git a/Doc/doxygen/html/_stars45_2_grid_8cpp_source.html b/Doc/doxygen/html/_stars45_2_grid_8cpp_source.html new file mode 100644 index 0000000..0e80008 --- /dev/null +++ b/Doc/doxygen/html/_stars45_2_grid_8cpp_source.html @@ -0,0 +1,209 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/Grid.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
Grid.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: Grid.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  Tactical Grid class
+
13 */
+
14 
+
15 #include "MemDebug.h"
+
16 #include "Grid.h"
+
17 
+
18 #include "Game.h"
+
19 #include "Video.h"
+
20 #include "Window.h"
+
21 
+
22 static const Color DARK_LINE( 8, 8, 8);
+
23 static const Color LITE_LINE(16, 16, 16);
+
24 
+
25 // +--------------------------------------------------------------------+
+
26 
+
27 Grid::Grid(int asize, int astep)
+
28 : size(asize), step(astep), drawn(0)
+
29 {
+
30  radius = (float) (size * 1.414);
+
31 }
+
32 
+ +
34 { }
+
35 
+
36 // +--------------------------------------------------------------------+
+
37 
+
38 int Grid::CollidesWith(Graphic& o) { return 0; }
+
39 
+
40 // +--------------------------------------------------------------------+
+
41 
+
42 void Grid::Render(Video* video, DWORD flags)
+
43 {
+
44  if (!video || hidden) return;
+
45 
+
46  int c = 0;
+
47  Color line;
+
48 
+
49  for (int i = 0; i <= size; i += step) {
+
50  Point p1( i, 0, -size); p1 += Location();
+
51  Point p2( i, 0, size); p2 += Location();
+
52  Point p3(-i, 0, -size); p3 += Location();
+
53  Point p4(-i, 0, size); p4 += Location();
+
54 
+
55  if (c) line = DARK_LINE;
+
56  else line = LITE_LINE;
+
57 
+
58  DrawLine(video, p1,p2,line);
+
59  DrawLine(video, p3,p4,line);
+
60 
+
61  c++;
+
62  if (c > 3) c = 0;
+
63  }
+
64 
+
65  c = 0;
+
66 
+
67  for (int i = 0; i <= size; i += step) {
+
68  Point p1(-size, 0, i); p1 += Location();
+
69  Point p2( size, 0, i); p2 += Location();
+
70  Point p3(-size, 0, -i); p3 += Location();
+
71  Point p4( size, 0, -i); p4 += Location();
+
72 
+
73  if (c) line = DARK_LINE;
+
74  else line = LITE_LINE;
+
75 
+
76  DrawLine(video, p1,p2,line);
+
77  DrawLine(video, p3,p4,line);
+
78 
+
79  c++;
+
80  if (c > 3) c = 0;
+
81  }
+
82 }
+
83 
+
84 void Grid::DrawLine(Video* video, Point& p1, Point& p2, Color grid_color)
+
85 {
+
86  Vec3 v[2];
+
87 
+
88  v[0] = p1;
+
89  v[1] = p2;
+
90 
+
91  video->DrawLines(1, v, grid_color, Video::BLEND_ADDITIVE);
+
92 }
+
+
+ + + + -- cgit v1.1