HoverRace  2.0
LevelBuilder.h
Go to the documentation of this file.
1 // LevelBuilder.h
2 //
3 // Copyright (c) 1995-1998 - Richard Langlois and Grokksoft Inc.
4 //
5 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
6 // you may not use this file except in compliance with the License.
7 //
8 // A copy of the license should have been attached to the package from which
9 // you have taken this file. If you can not find the license you can not use
10 // this file.
11 //
12 //
13 // The author makes no representations about the suitability of
14 // this software for any purpose. It is provided "as is" "AS IS",
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16 // implied.
17 //
18 // See the License for the specific language governing permissions
19 // and limitations under the License.
20 //
21 
22 #pragma once
23 
24 #include "../Model/Level.h"
25 #include "../Util/OS.h"
26 #include "TrackCompilationLog.h"
27 
28 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
29 # ifdef MR_ENGINE
30 # define MR_DllDeclare __declspec( dllexport )
31 # else
32 # define MR_DllDeclare __declspec( dllimport )
33 # endif
34 #else
35 # define MR_DllDeclare
36 #endif
37 
38 namespace HoverRace {
39 namespace MazeCompiler {
40 
41 class VisibleStep;
42 
44 {
46 
47 public:
49  virtual ~LevelBuilder() {}
50 
51 protected:
52  static double ComputeShapeConst(Section * pSection);
53 
54  bool Parse(std::istream &in);
55  bool ComputeVisibleZones();
56  bool ComputeAudibleZones();
57 
58  void OrderVisibleSurfaces();
59 
60 private:
61  void TestForVisibility(VisibleStep *pPreviousStep, int *pDestArray,
62  int &pDestIndex, int pNewLeftNodeIndex);
63 
64  static int OrderFloor(const void *pSurface0, const void *pSurface1);
65  static int OrderCeiling(const void *pSurface0, const void *pSurface1);
66 
67 public:
68  bool InitFromFile(const Util::OS::path_t &filename);
69  bool InitFromStream(std::istream &in);
70 
71 private:
73 };
74 
75 } // namespace MazeCompiler
76 } // namespace HoverRace
77 
78 #undef MR_DllDeclare
boost::filesystem::path path_t
Definition: OS.h:57
Level
Definition: Log.h:62
Definition: LevelBuilderVisiblesZones.cpp:48
TrackCompilationLogPtr log
Definition: LevelBuilder.h:72
std::shared_ptr< TrackCompilationLog > TrackCompilationLogPtr
Definition: TrackCompilationLog.h:46
Definition: LevelBuilder.h:43
A track level.
Definition: Track.h:57
Definition: Level.h:87
Definition: Level.h:74
Definition: Announcement.h:24
virtual ~LevelBuilder()
Definition: LevelBuilder.h:49
#define MR_DllDeclare
Definition: LevelBuilder.h:35