-- [Add] Added two simple scripts, one to check for mem leaks, the other counts LOC's

This commit is contained in:
Rtch90 2011-11-06 00:43:25 +00:00
parent a0cc71972c
commit 8494e35d31
6 changed files with 19 additions and 12 deletions

3
Bin/leakcheck.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
valgrind --leak-check=yes --track-origins=yes ./Unuk

4
linecount.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "cpp - `find . -name '*.cpp' -print0 | wc -l --files0-from=- | tail -n1`"
echo "h - `find . -name '*.h' -print0 | wc -l --files0-from=- | tail -n1`"

View File

@ -17,8 +17,6 @@
Game::Game(void) {
m_assets = false;
//m_player = new Player();
//m_player->SetSprite();
m_rotationAngle = 0.0f;
}
@ -27,12 +25,10 @@ Game::~Game(void) {
}
bool Game::Init(void) {
LoadAssets();
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
LoadAssets();
m_assets = true;
return true;
}
@ -142,7 +138,6 @@ void Game::OnResize(int width, int height) {
void Game::LoadAssets(void) {
m_player = new Player();
m_player->SetSprite();
}
void Game::DeleteAssets(void) {

View File

@ -16,6 +16,8 @@ public:
void UpdateProjection();
void OnResize(int width, int height);
bool IsInit(void) { return m_assets; }
private:
void LoadAssets(void);
void DeleteAssets(void);

View File

@ -6,7 +6,7 @@
#include "Player.h"
Player::Player(void) : m_posx(0), m_posy(0) {
//m_player = new Sprite("../Data/Media/test.bmp");
m_player = new Sprite("../Data/Media/test.bmp");
}
Player::~Player(void) {
@ -37,9 +37,9 @@ void Player::Render(void) {
m_player->Render();
}
void Player::SetSprite(void) {
m_player = new Sprite("../Data/Media/test.bmp");
}
//void Player::SetSprite(void) {
// m_player = new Sprite("../Data/Media/test.bmp");
//}
void Player::SetPosition(GLdouble posx, GLdouble posy) {
// Set the position of the player sprite.

View File

@ -170,7 +170,6 @@ int main() {
// Initialize OpenGL.
InitGL();
game.Init();
Debug::logger->message("Game Initialize!");
Debug::logger->message("\n\n-----Engine Initialization Complete-----");
@ -206,11 +205,15 @@ int main() {
// Render the scene.
float elapsedTime = GetElapsedSeconds();
//game.ProcessEvents();
//game.Init();
if(!game.IsInit()) {
game.Init();
}
game.Prepare(elapsedTime);
game.Render();
SDL_GL_SwapBuffers();
}
game.Shutdown();
//game.Shutdown();
// Clean ourselves up and exit.
Quit(0);