fixed PRINT_LOG in samples
Signed-off-by: h4570 <sandro.sobczynski@gmail.com>
This commit is contained in:
@@ -21,9 +21,9 @@ const float CAMERA_Y = 30.0F;
|
||||
|
||||
Camera::Camera(ScreenSettings *t_screen) : CameraBase(t_screen, &position)
|
||||
{
|
||||
PRINT_LOG("Initializing camera");
|
||||
consoleLog("Initializing camera");
|
||||
verticalLevel = 80.0F;
|
||||
PRINT_LOG("Camera initialized!");
|
||||
consoleLog("Camera initialized!");
|
||||
}
|
||||
|
||||
Camera::~Camera() {}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
Cubes::Cubes(Engine *t_engine)
|
||||
: engine(t_engine), camera(&t_engine->screen)
|
||||
{
|
||||
PRINT_LOG("Initing cubes sample");
|
||||
consoleLog("Initing cubes sample");
|
||||
}
|
||||
|
||||
Cubes::~Cubes()
|
||||
@@ -21,14 +21,16 @@ Cubes::~Cubes()
|
||||
return;
|
||||
}
|
||||
|
||||
void Cubes::onInit(){
|
||||
void Cubes::onInit()
|
||||
{
|
||||
texRepo = engine->renderer->getTextureRepository();
|
||||
cube = new Cube(texRepo);
|
||||
setBgColorAndAmbientColor();
|
||||
engine->renderer->setCameraDefinitions(&camera.view, &camera.unitCirclePosition, camera.planes);
|
||||
}
|
||||
|
||||
void Cubes::onUpdate(){
|
||||
void Cubes::onUpdate()
|
||||
{
|
||||
camera.update(engine->pad, cube->mesh);
|
||||
cube->update(engine->pad, camera);
|
||||
engine->renderer->draw(cube->mesh);
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
PRINT_LOG("INIT");
|
||||
Engine engine = Engine();
|
||||
Cubes game = Cubes(&engine);
|
||||
game.engine->init(&game, 128);
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
// Constructors/Destructors
|
||||
// ----
|
||||
|
||||
Cube::Cube( TextureRepository *t_texRepo )
|
||||
Cube::Cube(TextureRepository *t_texRepo)
|
||||
{
|
||||
PRINT_LOG("Creating cube");
|
||||
consoleLog("Creating cube");
|
||||
texRepo = t_texRepo;
|
||||
speed = 1.2F;
|
||||
|
||||
@@ -30,7 +30,7 @@ Cube::Cube( TextureRepository *t_texRepo )
|
||||
|
||||
texRepo->addByMesh("meshes/cube/", mesh, PNG);
|
||||
|
||||
PRINT_LOG("Cube object created!");
|
||||
consoleLog("Cube object created!");
|
||||
}
|
||||
|
||||
void Cube::update(const Pad &t_pad, const Camera &t_camera)
|
||||
@@ -68,10 +68,11 @@ Vector3 *Cube::getNextPosition(const Pad &t_pad, const Camera &t_camera)
|
||||
return result;
|
||||
}
|
||||
|
||||
void Cube::rotate(const Pad &t_pad){
|
||||
void Cube::rotate(const Pad &t_pad)
|
||||
{
|
||||
//if (t_pad.rJoyH >= 200)
|
||||
//else if (t_pad.rJoyH <= 100)
|
||||
mesh.rotation.x += (0.01 * speed);
|
||||
mesh.rotation.y += (0.01 * speed);
|
||||
mesh.rotation.z += (0.01 * speed);
|
||||
mesh.rotation.x += (0.01 * speed);
|
||||
mesh.rotation.y += (0.01 * speed);
|
||||
mesh.rotation.z += (0.01 * speed);
|
||||
}
|
||||
@@ -21,9 +21,9 @@ const float CAMERA_Y = 30.0F;
|
||||
|
||||
Camera::Camera(ScreenSettings *t_screen) : CameraBase(t_screen, &position)
|
||||
{
|
||||
PRINT_LOG("Initializing camera");
|
||||
consoleLog("Initializing camera");
|
||||
verticalLevel = 80.0F;
|
||||
PRINT_LOG("Camera initialized!");
|
||||
consoleLog("Camera initialized!");
|
||||
}
|
||||
|
||||
Camera::~Camera() {}
|
||||
|
||||
@@ -51,7 +51,7 @@ FloorManager::~FloorManager()
|
||||
*/
|
||||
void FloorManager::calcSpiral(int X, int Y)
|
||||
{
|
||||
PRINT_LOG("Calculating square spiral for floors");
|
||||
consoleLog("Calculating square spiral for floors");
|
||||
int x, y, dx;
|
||||
x = y = dx = 0;
|
||||
int dy = -1;
|
||||
@@ -73,7 +73,7 @@ void FloorManager::calcSpiral(int X, int Y)
|
||||
x += dx;
|
||||
y += dy;
|
||||
}
|
||||
PRINT_LOG("Square spiral calculated!");
|
||||
consoleLog("Square spiral calculated!");
|
||||
}
|
||||
|
||||
/** Initialize all floors by:
|
||||
@@ -82,7 +82,7 @@ void FloorManager::calcSpiral(int X, int Y)
|
||||
*/
|
||||
void FloorManager::initFloors()
|
||||
{
|
||||
PRINT_LOG("Initializing floors");
|
||||
consoleLog("Initializing floors");
|
||||
floors[0].mesh.loadObj("meshes/floor/", "floor", 3.0F, false);
|
||||
floors[0].mesh.shouldBeFrustumCulled = true;
|
||||
floors[0].mesh.shouldBeLighted = true;
|
||||
@@ -95,7 +95,7 @@ void FloorManager::initFloors()
|
||||
texRepo->getBySpriteOrMesh(floors[0].mesh.getMaterial(0).getId())->addLink(floors[i].mesh.getMaterial(0).getId());
|
||||
meshes[i] = &floors[i].mesh;
|
||||
}
|
||||
PRINT_LOG("Floors initialized!");
|
||||
consoleLog("Floors initialized!");
|
||||
}
|
||||
|
||||
/** Main floor loop.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
LightManager::LightManager()
|
||||
{
|
||||
PRINT_LOG("Creating light manager!");
|
||||
consoleLog("Creating light manager!");
|
||||
bulbsCount = 2;
|
||||
|
||||
bulbs = new LightBulb[2];
|
||||
@@ -31,7 +31,7 @@ LightManager::LightManager()
|
||||
|
||||
audioOffset = audioTick = 0;
|
||||
|
||||
PRINT_LOG("Light manager created!");
|
||||
consoleLog("Light manager created!");
|
||||
}
|
||||
|
||||
LightManager::~LightManager()
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
Enemy::Enemy(TextureRepository *t_texRepo)
|
||||
{
|
||||
PRINT_LOG("Creating enemy object");
|
||||
consoleLog("Creating enemy object");
|
||||
|
||||
meshes = new Mesh[getMeshesCount()];
|
||||
drawMeshes = new Mesh *[getMeshesCount()];
|
||||
@@ -48,7 +48,7 @@ Enemy::Enemy(TextureRepository *t_texRepo)
|
||||
|
||||
isKilled = true;
|
||||
|
||||
PRINT_LOG("Enemy object created!");
|
||||
consoleLog("Enemy object created!");
|
||||
}
|
||||
|
||||
Enemy::~Enemy()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
Player::Player(Audio *t_audio, TextureRepository *t_texRepo)
|
||||
{
|
||||
PRINT_LOG("Creating player object");
|
||||
consoleLog("Creating player object");
|
||||
texRepo = t_texRepo;
|
||||
audio = t_audio;
|
||||
gravity = 0.1F;
|
||||
@@ -53,7 +53,7 @@ Player::Player(Audio *t_audio, TextureRepository *t_texRepo)
|
||||
boomAdpcm = audio->loadADPCM("sounds/boom.adpcm");
|
||||
audio->setADPCMVolume(70, 0);
|
||||
|
||||
PRINT_LOG("Player object created!");
|
||||
consoleLog("Player object created!");
|
||||
}
|
||||
|
||||
Player::~Player()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
Ui::Ui(TextureRepository *t_texRepo)
|
||||
{
|
||||
PRINT_LOG("Initializing ui");
|
||||
consoleLog("Initializing ui");
|
||||
|
||||
isTask1Done = false;
|
||||
isTask2Done = false;
|
||||
@@ -52,7 +52,7 @@ Ui::Ui(TextureRepository *t_texRepo)
|
||||
grayCheckboxTex->addLink(task1Checkbox.getId());
|
||||
grayCheckboxTex->addLink(task2Checkbox.getId());
|
||||
|
||||
PRINT_LOG("Ui initialized!");
|
||||
consoleLog("Ui initialized!");
|
||||
}
|
||||
|
||||
Ui::~Ui() {}
|
||||
|
||||
Reference in New Issue
Block a user