fixed PRINT_LOG in samples

Signed-off-by: h4570 <sandro.sobczynski@gmail.com>
This commit is contained in:
h4570
2021-05-28 19:30:45 +02:00
parent 0816f522bb
commit dd8499abad
13 changed files with 44 additions and 42 deletions
+2 -2
View File
@@ -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() {}
+5 -3
View File
@@ -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);
-1
View File
@@ -12,7 +12,6 @@
int main()
{
PRINT_LOG("INIT");
Engine engine = Engine();
Cubes game = Cubes(&engine);
game.engine->init(&game, 128);
+8 -7
View File
@@ -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);
}
+2 -2
View File
@@ -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()
+2 -2
View File
@@ -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()
+2 -2
View File
@@ -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()
+2 -2
View File
@@ -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() {}