FF7ModelListFile.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 "formats/model/FF7ModelListFile.h"
  16. #include "formats/model/FF7ModelListFileSerializer.h"
  17. namespace VGears{
  18. const String ModelListFile::RESOURCE_TYPE("FF7ModelListFile");
  19. ModelListFile::ModelListFile(
  20. Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle,
  21. const String &group, bool is_manual, Ogre::ManualResourceLoader *loader
  22. ): Resource(creator, name, handle, group, is_manual, loader), scale_(0){}
  23. ModelListFile::~ModelListFile(){unload();}
  24. void ModelListFile::loadImpl(){
  25. ModelListFileSerializer serializer;
  26. Ogre::DataStreamPtr stream(openResource());
  27. serializer.ImportModelListFile(stream, this);
  28. }
  29. void ModelListFile::unloadImpl(){
  30. scale_ = 0;
  31. models_.clear();
  32. }
  33. size_t ModelListFile::calculateSize() const{return 0;}
  34. ModelListFile::ModelList&ModelListFile::GetModels(){return models_;}
  35. void ModelListFile::SetScale(uint16 scale){scale_ = scale;}
  36. }