3737UnsignedInt View::m_idNext = 1 ;
3838
3939// the tactical view singleton
40- View * TheTacticalView = nullptr ;
40+ View* TheTacticalView = nullptr ;
4141
4242
4343View::View ()
@@ -118,7 +118,7 @@ void View::reset()
118118/* *
119119 * Prepend this view to the given list, return the new list.
120120 */
121- View * View::prependViewToList ( View *list )
121+ View* View::prependViewToList (View* list )
122122{
123123 m_next = list;
124124 return this ;
@@ -132,7 +132,7 @@ void View::zoom(Real height)
132132/* *
133133 * Center the view on the given coordinate.
134134 */
135- void View::lookAt ( const Coord3D *o )
135+ void View::lookAt (const Coord3D* o )
136136{
137137
138138 // / @todo this needs to be changed to be 3D, this is still old 2D stuff
@@ -145,7 +145,7 @@ void View::lookAt( const Coord3D *o )
145145/* *
146146 * Shift the view by the given delta.
147147 */
148- void View::scrollBy ( const Coord2D *delta )
148+ void View::scrollBy (const Coord2D* delta )
149149{
150150 // update view's world position
151151 m_pos.x += delta->x ;
@@ -155,17 +155,17 @@ void View::scrollBy( const Coord2D *delta )
155155/* *
156156 * Rotate the view around the vertical axis to the given angle.
157157 */
158- void View::setAngle ( Real radians )
158+ void View::setAngle (Real radians)
159159{
160160 m_angle = WWMath::Normalize_Angle (radians);
161161}
162162
163163/* *
164164 * Rotate the view around the horizontal (X) axis to the given angle.
165165 */
166- void View::setPitch ( Real radians )
166+ void View::setPitch (Real radians)
167167{
168- constexpr Real limit = PI/ 5 .0f ;
168+ constexpr Real limit = PI / 5 .0f ;
169169 m_pitch = clamp (-limit, radians, limit);
170170}
171171
@@ -188,7 +188,7 @@ void View::setPitchToDefault()
188188void View::setHeightAboveGround (Real z)
189189{
190190 // if our zoom is limited, we will stay within a predefined distance from the terrain
191- if ( m_zoomLimited )
191+ if ( m_zoomLimited)
192192 {
193193 m_heightAboveGround = clamp (m_minHeightAboveGround, z, m_maxHeightAboveGround);
194194 }
@@ -201,21 +201,21 @@ void View::setHeightAboveGround(Real z)
201201/* *
202202 * write the view's current location in to the view location object
203203 */
204- void View::getLocation ( ViewLocation *location )
204+ void View::getLocation (ViewLocation* location )
205205{
206206
207- const Coord3D * pos = getPosition ();
208- location->init ( pos->x , pos->y , pos->z , getAngle (), getPitch (), getZoom () );
207+ const Coord3D* pos = getPosition ();
208+ location->init (pos->x , pos->y , pos->z , getAngle (), getPitch (), getZoom ());
209209
210210}
211211
212212
213213/* *
214214 * set the view's current location from to the view location object
215215 */
216- void View::setLocation ( const ViewLocation *location )
216+ void View::setLocation (const ViewLocation* location )
217217{
218- if ( location->m_valid )
218+ if (location->m_valid )
219219 {
220220 setPosition (&location->m_pos );
221221 setAngle (location->m_angle );
@@ -234,13 +234,13 @@ Bool View::isUserControlLocked() const
234234// -------------------------------------------------------------------------------------------------
235235/* * project the 4 corners of this view into the world and return each point as a parameter,
236236 the world points are at the requested Z */
237- // -------------------------------------------------------------------------------------------------
238- void View::getScreenCornerWorldPointsAtZ ( Coord3D * topLeft, Coord3D * topRight,
239- Coord3D * bottomRight, Coord3D * bottomLeft,
240- Real z )
237+ // -------------------------------------------------------------------------------------------------
238+ void View::getScreenCornerWorldPointsAtZ (Coord3D* topLeft, Coord3D* topRight,
239+ Coord3D* bottomRight, Coord3D* bottomLeft,
240+ Real z)
241241{
242242 // sanity
243- if ( topLeft == nullptr || topRight == nullptr || bottomRight == nullptr || bottomLeft == nullptr )
243+ if ( topLeft == nullptr || topRight == nullptr || bottomRight == nullptr || bottomLeft == nullptr )
244244 return ;
245245
246246 ICoord2D screenTopLeft;
@@ -252,7 +252,7 @@ void View::getScreenCornerWorldPointsAtZ( Coord3D *topLeft, Coord3D *topRight,
252252 const Int viewHeight = getHeight ();
253253
254254 // setup the screen coords for the 4 corners of the viewable display
255- getOrigin ( &origin.x , &origin.y );
255+ getOrigin (&origin.x , &origin.y );
256256
257257 screenTopLeft.x = origin.x ;
258258 screenTopLeft.y = origin.y ;
@@ -264,34 +264,34 @@ void View::getScreenCornerWorldPointsAtZ( Coord3D *topLeft, Coord3D *topRight,
264264 screenBottomLeft.y = origin.y + viewHeight;
265265
266266 // project
267- screenToWorldAtZ ( &screenTopLeft, topLeft, z );
268- screenToWorldAtZ ( &screenTopRight, topRight, z );
269- screenToWorldAtZ ( &screenBottomRight, bottomRight, z );
270- screenToWorldAtZ ( &screenBottomLeft, bottomLeft, z );
267+ screenToWorldAtZ (&screenTopLeft, topLeft, z);
268+ screenToWorldAtZ (&screenTopRight, topRight, z);
269+ screenToWorldAtZ (&screenBottomRight, bottomRight, z);
270+ screenToWorldAtZ (&screenBottomLeft, bottomLeft, z);
271271}
272272
273273// ------------------------------------------------------------------------------------------------
274274/* * Xfer method for a view */
275275// ------------------------------------------------------------------------------------------------
276- void View::xfer ( Xfer *xfer )
276+ void View::xfer (Xfer* xfer )
277277{
278278
279279 // version
280280 XferVersion currentVersion = 1 ;
281281 XferVersion version = currentVersion;
282- xfer->xferVersion ( &version, currentVersion );
282+ xfer->xferVersion (&version, currentVersion);
283283
284284 // camera angle
285285 Real angle = getAngle ();
286- xfer->xferReal ( &angle );
287- setAngle ( angle );
286+ xfer->xferReal (&angle);
287+ setAngle (angle);
288288
289289 // view position
290290 Coord3D viewPos;
291- getPosition ( &viewPos );
292- xfer->xferReal ( &viewPos.x );
293- xfer->xferReal ( &viewPos.y );
294- xfer->xferReal ( &viewPos.z );
295- lookAt ( &viewPos );
291+ getPosition (&viewPos);
292+ xfer->xferReal (&viewPos.x );
293+ xfer->xferReal (&viewPos.y );
294+ xfer->xferReal (&viewPos.z );
295+ lookAt (&viewPos);
296296
297297}
0 commit comments