| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- /*
- * Copyright (C) 2022 The V-Gears Team
- *
- * This file is part of V-Gears
- *
- * V-Gears is free software: you can redistribute it and/or modify it under
- * terms of the GNU General Public License as published by the Free Software
- * Foundation, version 3.0 (GPLv3) of the License.
- *
- * V-Gears is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
- #pragma once
- #include <OgreColourValue.h>
- #include "common/QGearsResource.h"
- namespace QGears{
- namespace FF7{
- /**
- * Handles model list files.
- */
- class ModelListFile : public Resource{
- public:
- /**
- * Constructor.
- *
- * @param creator[in] Pointer to the ResourceManager that is
- * creating this resource.
- * @param name[in] The unique name of the resource.
- * @param handle[in] @todo Understand and document.
- * @param group[in] The name of the resource group to which this
- * resource belong.
- * @param is_manual[in] True if the resource is manually loaded,
- * false otherwise.
- * @param loader[in] Pointer to a ManualResourceLoader
- * implementation which will be called when the Resource wishes to
- * load (should be supplied if is_manual is set to true). It can be
- * null, but the Resource will never be able to reload if anything
- * ever causes it to unload. Therefore provision of a proper
- * ManualResourceLoader instance is strongly recommended.
- */
- ModelListFile(
- Ogre::ResourceManager* creator, const String &name,
- Ogre::ResourceHandle handle, const String& group,
- bool is_manual = false,
- Ogre::ManualResourceLoader* loader = NULL
- );
- /**
- * Destructor.
- */
- virtual ~ModelListFile();
- /**
- * The type of resource.
- */
- static const String RESOURCE_TYPE;
- /**
- * An animation description.
- */
- struct AnimationDescription{
- /**
- * The animation name.
- */
- String name;
- /**
- * Unknown data.
- */
- uint16 unknown;
- };
- typedef std::vector<AnimationDescription> AnimationList;
- /**
- * Types of models.
- */
- enum ModelType{
- /**
- * Playable character.
- */
- PLAYER = 0,
- /**
- * Non playable character.
- */
- NPC = 1,
- /**
- * Unknown character type
- */
- UNKNOWN
- };
- /**
- * A model.
- */
- struct ModelDescription{
- /**
- * The model name.
- */
- String name;
- /**
- * The model type.
- */
- ModelType type;
- /**
- * HRC file name.
- *
- * HRC files describe bone hierarchy.
- */
- String hrc_name;
- /**
- * Scale for the model.
- */
- String scale;
- Ogre::ColourValue light_colors[10];
- /**
- * List of animations assigned to the model.
- */
- AnimationList animations;
- };
- typedef std::vector<ModelDescription> ModelList;
- /**
- * Retrieves the scale for the models.
- *
- * @return The scale.
- */
- virtual uint16 GetScale() const;
- /**
- * Sets the scale for the models.
- *
- * @param scale[in] The scale.
- */
- virtual void SetScale(uint16 scale);
- /**
- * Retrieves the model list.
- */
- virtual ModelList& GetModels();
- protected:
- /**
- * Loads the file.
- */
- virtual void loadImpl() override;
- /**
- * Unloads the file.
- */
- virtual void unloadImpl() override;
- /**
- * Calculates the size of the palette.
- *
- * @return The size of the palette.
- * @todo Units?
- */
- virtual size_t calculateSize( void ) const;
- private:
- /**
- * The models scale.
- *
- * @todo Each model has it's own scale. Is this some kind of
- * global scale? If so, is it to be applied over each model
- * scale, or instead of it?
- */
- uint16 scale_;
- /**
- * The list of models.
- */
- ModelList models_;
- };
- typedef Ogre::SharedPtr<ModelListFile> ModelListFilePtr;
- }
- }
|