1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreBspLevel.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
4 | <link type="text/css" rel="stylesheet" href="style.css"> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body> |
---|
8 | <!-- Generated by Doxygen 1.3.6 --> |
---|
9 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> |
---|
10 | <h1>OgreBspLevel.h</h1><a href="OgreBspLevel_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> |
---|
11 | 00002 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
12 | 00003 <span class="comment">This source file is part of OGRE</span> |
---|
13 | 00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> |
---|
14 | 00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> |
---|
15 | 00006 <span class="comment"></span> |
---|
16 | 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> |
---|
17 | 00008 <span class="comment">Also see acknowledgements in Readme.html</span> |
---|
18 | 00009 <span class="comment"></span> |
---|
19 | 00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span> |
---|
20 | 00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span> |
---|
21 | 00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span> |
---|
22 | 00013 <span class="comment">version.</span> |
---|
23 | 00014 <span class="comment"></span> |
---|
24 | 00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span> |
---|
25 | 00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> |
---|
26 | 00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span> |
---|
27 | 00018 <span class="comment"></span> |
---|
28 | 00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span> |
---|
29 | 00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span> |
---|
30 | 00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span> |
---|
31 | 00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span> |
---|
32 | 00023 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
33 | 00024 <span class="comment">*/</span> |
---|
34 | 00025 <span class="preprocessor">#ifndef _BspLevel_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define _BspLevel_H__</span> |
---|
36 | 00027 <span class="preprocessor"></span> |
---|
37 | 00028 <span class="preprocessor">#include "<a class="code" href="OgreBspPrerequisites_8h.html">OgreBspPrerequisites.h</a>"</span> |
---|
38 | 00029 <span class="preprocessor">#include "<a class="code" href="OgreResource_8h.html">OgreResource.h</a>"</span> |
---|
39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreStaticFaceGroup_8h.html">OgreStaticFaceGroup.h</a>"</span> |
---|
40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreSceneManager_8h.html">OgreSceneManager.h</a>"</span> |
---|
41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreBspNode_8h.html">OgreBspNode.h</a>"</span> |
---|
42 | 00033 <span class="preprocessor">#include "<a class="code" href="OgreHardwareBufferManager_8h.html">OgreHardwareBufferManager.h</a>"</span> |
---|
43 | 00034 <span class="preprocessor">#include "<a class="code" href="OgreDefaultHardwareBufferManager_8h.html">OgreDefaultHardwareBufferManager.h</a>"</span> |
---|
44 | 00035 <span class="preprocessor">#include "<a class="code" href="OgreQuake3Level_8h.html">OgreQuake3Level.h</a>"</span> |
---|
45 | 00036 |
---|
46 | 00037 |
---|
47 | 00038 <span class="keyword">namespace </span>Ogre { |
---|
48 | 00039 |
---|
49 | <a name="l00053"></a><a class="code" href="classOgre_1_1BspLevel.html">00053</a> <span class="keyword">class </span><a class="code" href="classOgre_1_1BspLevel.html">BspLevel</a> : <span class="keyword">public</span> <a class="code" href="classOgre_1_1Resource.html">Resource</a> |
---|
50 | 00054 { |
---|
51 | <a name="l00055"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLeveln0">00055</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOgre_1_1BspSceneManager.html">BspSceneManager</a>; |
---|
52 | 00056 <span class="keyword">public</span>: |
---|
53 | 00058 <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela0">BspLevel</a>(<a class="code" href="classOgre_1_1ResourceManager.html">ResourceManager</a>* creator, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& name, <a class="code" href="namespaceOgre.html#a485">ResourceHandle</a> handle, |
---|
54 | 00059 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& group, <span class="keywordtype">bool</span> isManual = <span class="keyword">false</span>, <a class="code" href="classOgre_1_1ManualResourceLoader.html">ManualResourceLoader</a>* loader = 0); |
---|
55 | 00060 <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela1">~BspLevel</a>(); |
---|
56 | 00061 |
---|
57 | 00063 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela2">isLeafVisible</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1BspNode.html">BspNode</a>* from, <span class="keyword">const</span> <a class="code" href="classOgre_1_1BspNode.html">BspNode</a>* to) <span class="keyword">const</span>; |
---|
58 | 00064 |
---|
59 | 00066 <span class="keyword">const</span> <a class="code" href="classOgre_1_1BspNode.html">BspNode</a>* <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela3">getRootNode</a>(<span class="keywordtype">void</span>); |
---|
60 | 00067 |
---|
61 | 00071 <a class="code" href="classOgre_1_1BspNode.html">BspNode</a>* <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela4">findLeaf</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>& point) <span class="keyword">const</span>; |
---|
62 | 00072 |
---|
63 | 00076 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela5">_notifyObjectMoved</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1MovableObject.html">MovableObject</a>* mov, |
---|
64 | 00077 <span class="keyword">const</span> <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>& pos); |
---|
65 | 00079 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela6">_notifyObjectDetached</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1MovableObject.html">MovableObject</a>* mov); |
---|
66 | <a name="l00081"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela7">00081</a> <a class="code" href="classOgre_1_1BspNode.html">BspNode</a>* <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela7">getLeafStart</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> &mRootNode[<a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp3">mLeafStart</a>]; } |
---|
67 | <a name="l00083"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela8">00083</a> <span class="keywordtype">int</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevela8">getNumLeaves</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp2">mNumLeaves</a>; } |
---|
68 | 00084 |
---|
69 | 00086 <span class="keyword">static</span> size_t <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevele0">calculateLoadingStages</a>(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& levelName); |
---|
70 | 00087 |
---|
71 | 00089 <span class="keyword">protected</span>: |
---|
72 | 00091 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb0">loadImpl</a>(<span class="keywordtype">void</span>); |
---|
73 | 00093 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb1">unloadImpl</a>(<span class="keywordtype">void</span>); |
---|
74 | 00095 size_t <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb2">calculateSize</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
75 | <a name="l00102"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp0">00102</a> <a class="code" href="classOgre_1_1BspNode.html">BspNode</a>* mRootNode; |
---|
76 | <a name="l00103"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp1">00103</a> <span class="keywordtype">int</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp1">mNumNodes</a>; |
---|
77 | <a name="l00104"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp2">00104</a> <span class="keywordtype">int</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp2">mNumLeaves</a>; |
---|
78 | <a name="l00105"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp3">00105</a> <span class="keywordtype">int</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp3">mLeafStart</a>; <span class="comment">// the index at which leaf nodes begin</span> |
---|
79 | 00106 |
---|
80 | <a name="l00114"></a><a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html">00114</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html">BspVertex</a> |
---|
81 | 00115 { |
---|
82 | <a name="l00116"></a><a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html#Ogre_1_1BspLevel_1_1BspVertexo0">00116</a> <span class="keywordtype">float</span> position[3]; |
---|
83 | <a name="l00117"></a><a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html#Ogre_1_1BspLevel_1_1BspVertexo1">00117</a> <span class="keywordtype">float</span> normal[3]; |
---|
84 | <a name="l00118"></a><a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html#Ogre_1_1BspLevel_1_1BspVertexo2">00118</a> <span class="keywordtype">int</span> colour; |
---|
85 | <a name="l00119"></a><a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html#Ogre_1_1BspLevel_1_1BspVertexo3">00119</a> <span class="keywordtype">float</span> <a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html#Ogre_1_1BspLevel_1_1BspVertexo3">texcoords</a>[2]; |
---|
86 | <a name="l00120"></a><a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html#Ogre_1_1BspLevel_1_1BspVertexo4">00120</a> <span class="keywordtype">float</span> <a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html#Ogre_1_1BspLevel_1_1BspVertexo4">lightmap</a>[2]; |
---|
87 | 00121 }; |
---|
88 | 00122 <span class="comment">/*</span> |
---|
89 | 00124 <span class="comment"> BspVertex* mVertices;</span> |
---|
90 | 00125 <span class="comment"> int mNumVertices;</span> |
---|
91 | 00126 <span class="comment"> */</span> |
---|
92 | <a name="l00128"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp4">00128</a> <a class="code" href="classOgre_1_1VertexData.html">VertexData</a>* mVertexData; |
---|
93 | 00129 |
---|
94 | <a name="l00133"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp5">00133</a> <span class="keywordtype">int</span>* <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp5">mLeafFaceGroups</a>; |
---|
95 | <a name="l00134"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp6">00134</a> <span class="keywordtype">int</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp6">mNumLeafFaceGroups</a>; |
---|
96 | 00135 |
---|
97 | <a name="l00137"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp7">00137</a> <a class="code" href="structOgre_1_1StaticFaceGroup.html">StaticFaceGroup</a>* <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp7">mFaceGroups</a>; |
---|
98 | <a name="l00138"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp8">00138</a> <span class="keywordtype">int</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp8">mNumFaceGroups</a>; |
---|
99 | 00139 |
---|
100 | 00140 |
---|
101 | 00141 <span class="comment">/*</span> |
---|
102 | 00143 <span class="comment"> int* mElements;</span> |
---|
103 | 00144 <span class="comment"> int mNumElements;</span> |
---|
104 | 00145 <span class="comment"> */</span> |
---|
105 | 00146 |
---|
106 | <a name="l00148"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp9">00148</a> size_t mNumIndexes; |
---|
107 | 00149 <span class="comment">// system-memory buffer</span> |
---|
108 | <a name="l00150"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp10">00150</a> <a class="code" href="classOgre_1_1HardwareIndexBufferSharedPtr.html">HardwareIndexBufferSharedPtr</a> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp10">mIndexes</a>; |
---|
109 | 00151 |
---|
110 | <a name="l00153"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp11">00153</a> <a class="code" href="structOgre_1_1BspNode_1_1Brush.html">BspNode::Brush</a> *<a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp11">mBrushes</a>; |
---|
111 | 00154 |
---|
112 | <a name="l00156"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp12">00156</a> std::vector<ViewPoint> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp12">mPlayerStarts</a>; |
---|
113 | 00157 |
---|
114 | 00159 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb3">loadQuake3Level</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Quake3Level.html">Quake3Level</a>& q3lvl); |
---|
115 | <a name="l00175"></a><a class="code" href="structOgre_1_1BspLevel_1_1VisData.html">00175</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1BspLevel_1_1VisData.html">VisData</a> |
---|
116 | 00176 { |
---|
117 | <a name="l00177"></a><a class="code" href="structOgre_1_1BspLevel_1_1VisData.html#Ogre_1_1BspLevel_1_1VisDatao0">00177</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *<a class="code" href="structOgre_1_1BspLevel_1_1VisData.html#Ogre_1_1BspLevel_1_1VisDatao0">tableData</a>; |
---|
118 | <a name="l00178"></a><a class="code" href="structOgre_1_1BspLevel_1_1VisData.html#Ogre_1_1BspLevel_1_1VisDatao1">00178</a> <span class="keywordtype">int</span> <a class="code" href="structOgre_1_1BspLevel_1_1VisData.html#Ogre_1_1BspLevel_1_1VisDatao1">numClusters</a>; <span class="comment">// Number of clusters, therefore number of rows</span> |
---|
119 | <a name="l00179"></a><a class="code" href="structOgre_1_1BspLevel_1_1VisData.html#Ogre_1_1BspLevel_1_1VisDatao2">00179</a> <span class="keywordtype">int</span> <a class="code" href="structOgre_1_1BspLevel_1_1VisData.html#Ogre_1_1BspLevel_1_1VisDatao2">rowLength</a>; <span class="comment">// Length in bytes of each row (num clusters / 8 rounded up)</span> |
---|
120 | 00180 }; |
---|
121 | 00181 |
---|
122 | <a name="l00182"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp13">00182</a> <a class="code" href="structOgre_1_1BspLevel_1_1VisData.html">VisData</a> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp13">mVisData</a>; |
---|
123 | 00183 |
---|
124 | 00184 |
---|
125 | 00186 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb4">loadEntities</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Quake3Level.html">Quake3Level</a>& q3lvl); |
---|
126 | 00187 |
---|
127 | <a name="l00188"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelx0">00188</a> <span class="keyword">typedef</span> std::map<const MovableObject*, std::list<BspNode*> > <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelx0">MovableToNodeMap</a>; |
---|
128 | <a name="l00190"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp14">00190</a> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelx0">MovableToNodeMap</a> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp14">mMovableToNodeMap</a>; |
---|
129 | 00191 |
---|
130 | 00192 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb5">tagNodesWithMovable</a>(<a class="code" href="classOgre_1_1BspNode.html">BspNode</a>* node, <span class="keyword">const</span> <a class="code" href="classOgre_1_1MovableObject.html">MovableObject</a>* mov, <span class="keyword">const</span> <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>& pos); |
---|
131 | 00193 |
---|
132 | 00194 <span class="comment">// Storage of patches </span> |
---|
133 | <a name="l00195"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelx1">00195</a> <span class="keyword">typedef</span> std::map<int, PatchSurface*> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelx1">PatchMap</a>; |
---|
134 | <a name="l00196"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp15">00196</a> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelx1">PatchMap</a> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp15">mPatches</a>; |
---|
135 | 00197 <span class="comment">// Total number of vertices required for all patches</span> |
---|
136 | <a name="l00198"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp16">00198</a> size_t <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp16">mPatchVertexCount</a>; |
---|
137 | 00199 <span class="comment">// Total number of indexes required for all patches</span> |
---|
138 | <a name="l00200"></a><a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp17">00200</a> size_t <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelp17">mPatchIndexCount</a>; |
---|
139 | 00201 |
---|
140 | 00202 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb6">initQuake3Patches</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Quake3Level.html">Quake3Level</a> & q3lvl, <a class="code" href="classOgre_1_1VertexDeclaration.html">VertexDeclaration</a>* decl); |
---|
141 | 00203 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb7">buildQuake3Patches</a>(size_t vertOffset, size_t indexOffset); |
---|
142 | 00204 |
---|
143 | 00205 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1BspLevel.html#Ogre_1_1BspLevelb8">quakeVertexToBspVertex</a>(<span class="keyword">const</span> <a class="code" href="structbsp__vertex__t.html">bsp_vertex_t</a>* src, <a class="code" href="structOgre_1_1BspLevel_1_1BspVertex.html">BspVertex</a>* dest); |
---|
144 | 00206 |
---|
145 | 00207 |
---|
146 | 00208 }; |
---|
147 | <a name="l00215"></a><a class="code" href="classOgre_1_1BspLevelPtr.html">00215</a> <span class="keyword">class </span><a class="code" href="classOgre_1_1BspLevelPtr.html">BspLevelPtr</a> : <span class="keyword">public</span> <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><BspLevel> |
---|
148 | 00216 { |
---|
149 | 00217 <span class="keyword">public</span>: |
---|
150 | <a name="l00218"></a><a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra0">00218</a> <a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra0">BspLevelPtr</a>() : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><<a class="code" href="classOgre_1_1BspLevel.html">BspLevel</a>>() {} |
---|
151 | <a name="l00219"></a><a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra1">00219</a> <span class="keyword">explicit</span> <a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra0">BspLevelPtr</a>(<a class="code" href="classOgre_1_1BspLevel.html">BspLevel</a>* rep) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><<a class="code" href="classOgre_1_1BspLevel.html">BspLevel</a>>(rep) {} |
---|
152 | <a name="l00220"></a><a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra2">00220</a> <a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra0">BspLevelPtr</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1BspLevelPtr.html">BspLevelPtr</a>& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><<a class="code" href="classOgre_1_1BspLevel.html">BspLevel</a>>(r) {} |
---|
153 | <a name="l00221"></a><a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra3">00221</a> <a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra0">BspLevelPtr</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><<a class="code" href="classOgre_1_1BspLevel.html">BspLevel</a>>() |
---|
154 | 00222 { |
---|
155 | 00223 <span class="comment">// lock & copy other mutex pointer</span> |
---|
156 | 00224 <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
157 | 00225 <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
158 | 00226 pRep = static_cast<BspLevel*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
159 | 00227 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
160 | 00228 <span class="keywordflow">if</span> (pUseCount) |
---|
161 | 00229 { |
---|
162 | 00230 ++(*pUseCount); |
---|
163 | 00231 } |
---|
164 | 00232 } |
---|
165 | 00233 |
---|
166 | <a name="l00235"></a><a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra4">00235</a> <a class="code" href="classOgre_1_1BspLevelPtr.html">BspLevelPtr</a>& <a class="code" href="classOgre_1_1BspLevelPtr.html#Ogre_1_1BspLevelPtra4">operator=</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>& r) |
---|
167 | 00236 { |
---|
168 | 00237 <span class="keywordflow">if</span> (pRep == static_cast<BspLevel*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>())) |
---|
169 | 00238 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
170 | 00239 <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>(); |
---|
171 | 00240 <span class="comment">// lock & copy other mutex pointer</span> |
---|
172 | 00241 <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
173 | 00242 <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
174 | 00243 pRep = static_cast<BspLevel*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
175 | 00244 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
176 | 00245 <span class="keywordflow">if</span> (pUseCount) |
---|
177 | 00246 { |
---|
178 | 00247 ++(*pUseCount); |
---|
179 | 00248 } |
---|
180 | 00249 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
181 | 00250 } |
---|
182 | 00251 }; |
---|
183 | 00252 |
---|
184 | 00253 } |
---|
185 | 00254 |
---|
186 | 00255 <span class="preprocessor">#endif</span> |
---|
187 | </pre></div><hr> |
---|
188 | <p> |
---|
189 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
190 | <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/> |
---|
191 | This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/> |
---|
192 | <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
---|
193 | <Work rdf:about=""> |
---|
194 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
195 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
196 | </Work> |
---|
197 | <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> |
---|
198 | |
---|
199 | Last modified Sun Feb 12 12:59:42 2006 |
---|
200 | </p> |
---|
201 | </body> |
---|
202 | </html> |
---|