Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Grid.h
Go to the documentation of this file.
1 /* Project Magic 2.0
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Magic.exe
6  FILE: Grid.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Interface of the Grid class
13 */
14 
15 
16 #ifndef Grid_h
17 #define Grid_h
18 
19 #include "Bitmap.h"
20 #include "Graphic.h"
21 
22 // +--------------------------------------------------------------------+
23 
24 class Grid : public Graphic
25 {
26 public:
28 
29  Grid();
30  virtual ~Grid();
31 
32  CPoint& Snap(CPoint& p);
33 
34  bool IsSnap() const { return snap; }
35  bool IsShow() const { return show; }
36  void SetSnap(bool s) { snap = s; }
37  void SetShow(bool s) { show = s; }
38  void SetSize(int x, int y = 0);
39  void SetSkip(int x, int y = 0);
40  void ShowMinor(bool show) { minor = show; }
41  void ShowPlane(int p) { plane = p; }
42  void ShowReference(bool show) { show_ref = show; }
43 
44  const char* GetReferencePlan() const;
45  void SetReferencePlan(const char* fname);
46  const char* GetReferenceFront() const;
47  void SetReferenceFront(const char* fname);
48  const char* GetReferenceSide() const;
49  void SetReferenceSide(const char* fname);
50 
51  int GetSize() const { return x_size; }
52 
53  // operations
54  virtual void Render(Video* video, DWORD flags);
55  virtual void RenderReference(Video* video);
56 
57 protected:
58  int snapto(int i, int dim);
59 
60  bool show;
61  bool show_ref;
62  bool snap;
63  bool minor;
64 
65  int x_size, y_size;
66  int x_skip, y_skip;
67  int plane;
68 
73 
77 };
78 
79 // +--------------------------------------------------------------------+
80 
81 #endif Grid_h