Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bomblik committed Jul 11, 2016
0 parents commit d809bfa
Show file tree
Hide file tree
Showing 226 changed files with 72,158 additions and 0 deletions.
697 changes: 697 additions & 0 deletions BlockOut/BlockOrientation.h

Large diffs are not rendered by default.

577 changes: 577 additions & 0 deletions BlockOut/BlockOut.cpp

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions BlockOut/BlockOut.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
File: BlockOut.h
Description: Main application class
Program: BlockOut
Author: Jean-Luc PONS
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/

#include "Game.h"
#include "Menu.h"
#include "SetupManager.h"
#include "SoundManager.h"

#include "Http.h"

#define MENU_MODE 1
#define GAME_MODE 2

class BlockOut : public GLApplication
{

GLFont2D m_pSmallFont;
char extendedTitle[256];

// Navigation
BYTE m_bKey[SDLK_LAST];

// Global mode
BOOL inited;
int mode;
int lastSleepTime;

protected:
int OneTimeSceneInit();
int RestoreDeviceObjects();
int InvalidateDeviceObjects();
int Render();
int FrameMove();
int EventProc(SDL_Event *event);

int UpdateFullScreen();

public:
BlockOut();

// Global handles
Game theGame;
Menu theMenu;
SetupManager theSetup;
SoundManager theSound;
Http theHttp;

};
1 change: 1 addition & 0 deletions BlockOut/BlockOut.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IDI_BLOCKICON ICON "block_icon.ico"
201 changes: 201 additions & 0 deletions BlockOut/BotMatrix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
/*
File: BotMatrix.cpp
Description: Handle bot matrix (A.I. player)
Program: BlockOut
Author: Jean-Luc PONS
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/

// -------------------------------------
#include "BotMatrix.h"
#include <math.h>

// -------------------------------------

BotMatrix::BotMatrix() {
Identity();
}

// -------------------------------------

void BotMatrix::Init33(float _11,float _12,float _13,float _21,float _22,float _23,float _31,float _32,float _33) {

this->_11 = _11; this->_12 = _12; this->_13 = _13;
this->_21 = _21; this->_22 = _22; this->_23 = _23;
this->_31 = _31; this->_32 = _32; this->_33 = _33;

}

// -------------------------------------

void BotMatrix::Identity() {

_11=1.0f; _12=0.0f; _13=0.0f;
_21=0.0f; _22=1.0f; _23=0.0f;
_31=0.0f; _32=0.0f; _33=1.0f;

}

// -------------------------------------

void BotMatrix::RotateOX() {

//matRotOx= 1.0f , 0.0f , 0.0f
// 0.0f , 0.0f , 1.0f
// 0.0f ,-1.0f , 0.0f

BotMatrix m1 = *this;

//this->_11 = m1._11;
this->_12 = -m1._13;
this->_13 = m1._12;

//this->_21 = m1._21;
this->_22 = -m1._23;
this->_23 = m1._22;

//this->_31 = m1._31;
this->_32 = -m1._33;
this->_33 = m1._32;

}

// -------------------------------------

void BotMatrix::RotateOY() {

// matRotOy= 0.0f , 0.0f , 1.0f
// 0.0f , 1.0f , 0.0f
// -1.0f , 0.0f , 0.0f

BotMatrix m1 = *this;

this->_11 = -m1._13;
//this->_12 = m1._12;
this->_13 = m1._11;

this->_21 = -m1._23;
//this->_22 = m1._22;
this->_23 = m1._21;

this->_31 = -m1._33;
//this->_32 = m1._32;
this->_33 = m1._31;

}

// -------------------------------------

void BotMatrix::Transpose() {

BotMatrix m1 = *this;
this->_11 = m1._11; this->_12 = m1._21; this->_13 = m1._31;
this->_21 = m1._12; this->_22 = m1._22; this->_23 = m1._32;
this->_31 = m1._13; this->_32 = m1._23; this->_33 = m1._33;

}

// -------------------------------------

void BotMatrix::RotateOZ() {

// matRotOz= 0.0f , 1.0f , 0.0f
// -1.0f , 0.0f , 0.0f
// 0.0f , 0.0f , 1.0f

BotMatrix m1 = *this;

this->_11 = -m1._12;
this->_12 = m1._11;
//this->_13 = m1._13;

this->_21 = -m1._22;
this->_22 = m1._21;
//this->_23 = m1._23;

this->_31 = -m1._32;
this->_32 = m1._31;
//this->_33 = m1._33;

}

// -------------------------------------

void BotMatrix::RotateNOX() {

// matRotNOx= 1.0f , 0.0f , 0.0f
// 0.0f , 0.0f ,-1.0f
// 0.0f , 1.0f , 0.0f

BotMatrix m1 = *this;

//this->_11 = m1._11;
this->_12 = m1._13;
this->_13 = -m1._12;

//this->_21 = m1._21;
this->_22 = m1._23;
this->_23 = -m1._22;

//this->_31 = m1._31;
this->_32 = m1._33;
this->_33 = -m1._32;

}

// -------------------------------------

void BotMatrix::RotateNOY() {

//matRotNOy= 0.0f , 0.0f ,-1.0f
// 0.0f , 1.0f , 0.0f
// 1.0f , 0.0f , 0.0f

BotMatrix m1 = *this;

this->_11 = m1._13;
//this->_12 = m1._12;
this->_13 = -m1._11;

this->_21 = m1._23;
//this->_22 = m1._22;
this->_23 = -m1._21;

this->_31 = m1._33;
//this->_32 = m1._32;
this->_33 = -m1._31;

}

// -------------------------------------

void BotMatrix::RotateNOZ() {

//matRotNOz= 0.0f ,-1.0f , 0.0f
// 1.0f , 0.0f , 0.0f
// 0.0f , 0.0f , 1.0f

BotMatrix m1 = *this;

this->_11 = m1._12;
this->_12 = -m1._11;
//this->_13 = m1._13;

this->_21 = m1._22;
this->_22 = -m1._21;
//this->_23 = m1._23;

this->_31 = m1._32;
this->_32 = -m1._31;
//this->_33 = m1._33;

}
48 changes: 48 additions & 0 deletions BlockOut/BotMatrix.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
File: BotMatrix.h
Description: Handle bot matrix (A.I. player)
Program: BlockOut
Author: Jean-Luc PONS
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/


#ifndef _BOTMATRIXH_
#define _BOTMATRIXH_

class BotMatrix {

public:

BotMatrix();

void Init33(float _11,float _12,float _13,
float _21,float _22,float _23,
float _31,float _32,float _33);

void Identity();

void RotateOX();
void RotateOY();
void RotateOZ();
void RotateNOX();
void RotateNOY();
void RotateNOZ();
void Transpose();

float _11;float _12;float _13;
float _21;float _22;float _23;
float _31;float _32;float _33;

};

#endif /* _BOTMATRIXH_ */
Loading

0 comments on commit d809bfa

Please sign in to comment.