WorldMapManager.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #include <algorithm>
  16. #include <iostream>
  17. #include <cmath>
  18. #include <OgreEntity.h>
  19. #include <OgreRoot.h>
  20. #include <OgreViewport.h>
  21. #include "FF7Character.h"
  22. #include "core/AudioManager.h"
  23. #include "core/WorldMapManager.h"
  24. #include "core/WorldMapManager.h"
  25. #include "core/CameraManager.h"
  26. #include "core/Console.h"
  27. #include "core/DialogsManager.h"
  28. #include "core/EntityManager.h"
  29. #include "core/ConfigVar.h"
  30. #include "core/InputManager.h"
  31. #include "core/Logger.h"
  32. #include "core/ScriptManager.h"
  33. #include "core/TextHandler.h"
  34. #include "core/UiManager.h"
  35. /**
  36. * World Map manager singleton.
  37. */
  38. template<>WorldMapManager *Ogre::Singleton<WorldMapManager>::msSingleton = nullptr;
  39. WorldMapManager::WorldMapManager(){
  40. LOG_TRIVIAL("WorldMapManager created.");
  41. scene_node_ = Ogre::Root::getSingleton().getSceneManager("Scene")
  42. ->getRootSceneNode()->createChildSceneNode("WorldMapManager");
  43. }
  44. WorldMapManager::~WorldMapManager(){
  45. Clear();
  46. Ogre::Root::getSingleton().getSceneManager("Scene")->getRootSceneNode()->removeAndDestroyChild(
  47. "WorldMapManager"
  48. );
  49. LOG_TRIVIAL("WorldMapManager destroyed.");
  50. }
  51. void WorldMapManager::Input(const VGears::Event& event){}
  52. void WorldMapManager::UpdateDebug(){}
  53. void WorldMapManager::OnResize(){}
  54. void WorldMapManager::ClearField(){}
  55. void WorldMapManager::ClearBattle(){}
  56. void WorldMapManager::ClearWorld(){
  57. // TODO
  58. }
  59. void WorldMapManager::AddTerrain(
  60. const unsigned int index, const Ogre::String mesh, const Ogre::Vector3 pos
  61. ){
  62. if (module_ != Module::WORLD){
  63. LOG_ERROR(
  64. "Tried to add terrain to the WorldMapManager, but the manager was not in world map mode."
  65. );
  66. return;
  67. }
  68. /*Enemy* enemy = new Enemy(id, pos, front, visible, targeteable, active, cover);
  69. enemies_.push_back(*enemy);
  70. EntityManager::getSingleton().AddEntity(
  71. enemy->GetName() + "_" + std::to_string(enemies_.size() - 1),
  72. "enemies/" + enemy->GetModel() + ".mesh", enemy->GetPos(), Ogre::Degree(1),
  73. Ogre::Vector3(ENEMY_SCALE, ENEMY_SCALE, ENEMY_SCALE), Ogre::Quaternion(1, 1, 0, 0), id
  74. );
  75. EntityManager::getSingleton().GetEntity(
  76. enemy->GetName() + "_" + std::to_string(enemies_.size() - 1)
  77. )->SetRotation(Ogre::Degree(180));
  78. */
  79. }
  80. void WorldMapManager::UpdateField(){}
  81. void WorldMapManager::UpdateBattle(){}
  82. void WorldMapManager::UpdateWorld(){}