ModelsAndAnimationsDb.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 "ModelsAndAnimationsDb.h"
  16. #include <set>
  17. #include <string>
  18. #include <Ogre.h>
  19. #include "common/FinalFantasy7/FF7NameLookup.h"
  20. std::string ModelsAndAnimationsDb::NormalizeAnimationName(const std::string& name){
  21. Ogre::String base_name;
  22. VGears::StringUtil::splitBase(name, base_name);
  23. std::transform(base_name.begin(), base_name.end(), base_name.begin(), ::tolower);
  24. return base_name + ".a";
  25. }
  26. std::set<std::string>& ModelsAndAnimationsDb::ModelAnimations(const std::string model){
  27. // HACK FIX LGP READING.
  28. std::string model_lower = model;
  29. std::transform(model_lower.begin(), model_lower.end(), model_lower.begin(), ::tolower);
  30. return map[model_lower];
  31. }
  32. std::string ModelsAndAnimationsDb::ModelMetaDataName(const std::string& model_name){
  33. // If not in meta data then just replace .hrc with .mesh.
  34. Ogre::String base_name;
  35. VGears::StringUtil::splitBase(model_name, base_name);
  36. return VGears::NameLookup::model(base_name) + ".mesh";
  37. }