glife: Initial style cleanup

This commit is contained in:
Alexander von Gluck IV
2012-04-06 20:04:26 -05:00
parent 3c94b5cb05
commit 8bc51bee4c
8 changed files with 20 additions and 3 deletions
@@ -7,13 +7,14 @@
*/ */
#include "GLifeConfig.h"
#include <stdio.h> #include <stdio.h>
#include <Slider.h> #include <Slider.h>
#include <StringView.h> #include <StringView.h>
#include <View.h> #include <View.h>
#include "GLifeState.h" #include "GLifeState.h"
#include "GLifeConfig.h"
// ------------------------------------------------------ // ------------------------------------------------------
@@ -42,4 +42,5 @@ public:
void MessageReceived( BMessage* ); void MessageReceived( BMessage* );
}; };
#endif /* _GLIFE_GLIFECONFIG_H */ #endif /* _GLIFE_GLIFECONFIG_H */
@@ -7,12 +7,12 @@
*/ */
#include "GLifeGrid.h"
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <SupportDefs.h> #include <SupportDefs.h>
#include "GLifeGrid.h"
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeGrid Class Neighbors Definition // GLifeGrid Class Neighbors Definition
@@ -28,6 +28,7 @@ inline int32 GLifeGrid::Neighbors( int32 iRow, int32 iColumn )
( Occupied( iRow + 1, iColumn + 1 ) ? 1 : 0 ); ( Occupied( iRow + 1, iColumn + 1 ) ? 1 : 0 );
} }
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeGrid Class Constructor Definition // GLifeGrid Class Constructor Definition
GLifeGrid::GLifeGrid( int32 iWidth, int32 iHeight ) GLifeGrid::GLifeGrid( int32 iWidth, int32 iHeight )
@@ -46,6 +47,7 @@ GLifeGrid::GLifeGrid( int32 iWidth, int32 iHeight )
} }
} }
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeGrid Class Destructor Definition // GLifeGrid Class Destructor Definition
GLifeGrid::~GLifeGrid( void ) GLifeGrid::~GLifeGrid( void )
@@ -53,6 +55,7 @@ GLifeGrid::~GLifeGrid( void )
delete m_pbGrid; delete m_pbGrid;
} }
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeGrid Class Generation Definition // GLifeGrid Class Generation Definition
void GLifeGrid::Generation( void ) void GLifeGrid::Generation( void )
@@ -75,6 +78,7 @@ void GLifeGrid::Generation( void )
m_pbGrid = pbTemp; m_pbGrid = pbTemp;
} }
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeGrid Class Occupied Definition // GLifeGrid Class Occupied Definition
bool GLifeGrid::Occupied( int32 iRow, int32 iColumn ) bool GLifeGrid::Occupied( int32 iRow, int32 iColumn )
@@ -9,6 +9,9 @@
#define _GLIFE_GLIFEGRID_H #define _GLIFE_GLIFEGRID_H
#include <OS.h>
// GLifeGrid Class Declaration // GLifeGrid Class Declaration
class GLifeGrid class GLifeGrid
{ {
@@ -29,4 +32,5 @@ public:
bool Occupied( int32, int32 ); bool Occupied( int32, int32 );
}; };
#endif /* _GLIFE_GLIFEGRID_H */ #endif /* _GLIFE_GLIFEGRID_H */
@@ -4,6 +4,7 @@
* *
* Authors: * Authors:
* Aaron Hill <[email protected]> * Aaron Hill <[email protected]>
* Alexander von Gluck <[email protected]>
*/ */
@@ -14,6 +14,7 @@ const int32 c_iDefGridWidth = 60;
const int32 c_iDefGridHeight = 40; const int32 c_iDefGridHeight = 40;
const int32 c_iDefBorder = 0; const int32 c_iDefBorder = 0;
// GLifeState Class Declaration & Definition // GLifeState Class Declaration & Definition
class GLifeState class GLifeState
{ {
@@ -50,6 +50,7 @@ GLifeView::GLifeView(BRect rect, const char* name, ulong resizingMode,
UnlockGL(); UnlockGL();
} }
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeView Class Destructor Definition // GLifeView Class Destructor Definition
GLifeView::~GLifeView( void ) GLifeView::~GLifeView( void )
@@ -57,6 +58,7 @@ GLifeView::~GLifeView( void )
delete m_pglgGrid; delete m_pglgGrid;
} }
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeView Class AttachedToWindow Definition // GLifeView Class AttachedToWindow Definition
void GLifeView::AttachedToWindow( void ) void GLifeView::AttachedToWindow( void )
@@ -66,6 +68,7 @@ void GLifeView::AttachedToWindow( void )
UnlockGL(); UnlockGL();
} }
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeView Class Draw Definition // GLifeView Class Draw Definition
void GLifeView::Draw(BRect updateRect) void GLifeView::Draw(BRect updateRect)
@@ -164,6 +167,7 @@ void GLifeView::Draw(BRect updateRect)
glPopMatrix(); glPopMatrix();
} }
// ------------------------------------------------------ // ------------------------------------------------------
// GLifeView Class Advance Definition // GLifeView Class Advance Definition
void GLifeView::Advance( void ) void GLifeView::Advance( void )
@@ -33,4 +33,5 @@ private:
int32 m_iStep; int32 m_iStep;
}; };
#endif /* _GLIFE_GLIFEVIEW_H */ #endif /* _GLIFE_GLIFEVIEW_H */