Skip to content

Commit

Permalink
FIX - useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrusBzh committed Jun 14, 2020
1 parent d71b949 commit 0bf3b93
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 45 deletions.
8 changes: 4 additions & 4 deletions Application/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#include <exception>

/* Win32: Remove the console application */
//#ifdef _IRR_WINDOWS_
//#pragma comment(lib, "Irrlicht.lib")
//#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
//#endif
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif

int main(void) {

Expand Down
5 changes: 0 additions & 5 deletions GameScene/SceneManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,8 @@ void SceneManager::LoadScene(const std::string name) {
if (i->get()->GetId() == name) {
if (_current_scene) {
if (_ctrl->_scene_mgr->getSceneLoaderCount() > 0) {
std::cout << "name " << name << std::endl;
std::cout << _current_scene->GetId() << std::endl;
// if (_current_scene->GetId() != "gameScene" && name != "pauseScene" || _current_scene->GetId() != "pauseScene" && name != "gameScene") {
// _ctrl->_scene_mgr->clear();
_ctrl->_scene_mgr->clear();
_ctrl->_env->clear();
// }
}
}
_current_scene = i->get();
Expand Down
17 changes: 3 additions & 14 deletions Menu/EndScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,7 @@ void EndScene::Init(void)
}
void EndScene::Update(void)
{
int idx = 0;

_ctrl->_driver->beginScene(true, true, SColor(100, 150, 150, 150));
for (auto i = _obj_list.begin(); i != _obj_list.end(); i++) {
if (i->get()->GetStatus() == IGameObject::status_e::DELETED)
_obj_list.erase(i);
}

for (auto i = _obj_list.begin(); i != _obj_list.end(); i++) {
i->get()->Update(_obj_list);
}

if (this->_exit->updateButton(this->_ctrl->_context))
this->_buttonSound->Play();
if (this->_restart->updateButton(this->_ctrl->_context))
Expand All @@ -56,9 +45,9 @@ void EndScene::Update(void)
void EndScene::Render(void)
{
_ctrl->_driver->draw2DImage(_background, core::position2d<s32>(0,0), core::rect<s32>(0,0,1280,720), 0, video::SColor(255,255,255,255), true);
for (auto i = _obj_list.begin(); i != _obj_list.end(); i++)
if (i->get()->GetStatus() != IGameObject::status_e::DELETED)
i->get()->Render();
// for (auto i = _obj_list.begin(); i != _obj_list.end(); i++)
// if (i->get()->GetStatus() != IGameObject::status_e::DELETED)
// i->get()->Render();
_ctrl->_scene_mgr->drawAll();
this->_ctrl->_env->drawAll();
}
Expand Down
11 changes: 0 additions & 11 deletions Menu/SelectSkin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,7 @@ void SelectSkin::Init(void)
void SelectSkin::Update(void)
{
SelectPlayer();
int idx = 0;

_ctrl->_driver->beginScene(true, true, SColor(100, 150, 150, 150));
/* for (auto i = _obj_list.begin(); i != _obj_list.end(); i++) {
if (i->get()->GetStatus() == IGameObject::status_e::DELETED)
_obj_list.erase(i);
}
for (auto i = _obj_list.begin(); i != _obj_list.end(); i++) {
i->get()->Update(_obj_list);
}*/

if (this->_first_skin->updateButton(this->_ctrl->_context))
this->_buttonSound->Play();
if (this->_second_skin->updateButton(this->_ctrl->_context))
Expand Down
11 changes: 0 additions & 11 deletions Menu/SelectSkins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,7 @@ void SelectSkins::Update(void)
{
SelectPlayerOne();
SelectPlayerTwo();
int idx = 0;

_ctrl->_driver->beginScene(true, true, SColor(100, 150, 150, 150));
/* for (auto i = _obj_list.begin(); i != _obj_list.end(); i++) {
if (i->get()->GetStatus() == IGameObject::status_e::DELETED)
_obj_list.erase(i);
}
for (auto i = _obj_list.begin(); i != _obj_list.end(); i++) {
i->get()->Update(_obj_list);
}*/

if (this->_first_skin_one->updateButton(this->_ctrl->_context))
this->_buttonSound->Play();
if (this->_second_skin_one->updateButton(this->_ctrl->_context))
Expand Down

0 comments on commit 0bf3b93

Please sign in to comment.