V-Gears 0
Free Final Fantasy VII engine.
VGearsRSDFile.h
Go to the documentation of this file.
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
16#pragma once
17
18#include <OgreResource.h>
19#include <OgreMaterial.h>
20#include "common/TypeDefine.h"
21
22namespace VGears{
23
36 class RSDFile : public Ogre::Resource{
37
38 public:
39
58 RSDFile(
59 Ogre::ResourceManager* creator, const String &name,
60 Ogre::ResourceHandle handle, const String& group,
61 bool is_manual = false,
62 Ogre::ManualResourceLoader* loader = nullptr
63 );
64
68 virtual ~RSDFile();
69
73 static const String RESOURCE_TYPE;
74
75 typedef std::vector<String> TextureNameList;
76
77 typedef std::vector<Ogre::MaterialPtr> MaterialList;
78
84 virtual void SetPolygonName(const String &polygon_name);
85
91 virtual void SetMaterialName(const String &material_name);
92
98 virtual void SetGroupName(const String &group_name);
99
105 virtual const String& GetPolygonName() const;
106
112 virtual const String& GetMaterialName() const;
113
119 virtual const String& GetGroupName() const;
120
126 virtual size_t GetTextureNameCount() const;
127
134
140 virtual String GetMaterialBaseName() const;
141
142 protected:
143
147 virtual void loadImpl() override;
148
152 virtual void unloadImpl() override;
153
160 virtual size_t calculateSize() const;
161
168 virtual void AddTexture(Ogre::Pass *pass, const size_t index) const;
169
170 private:
171
176
181
186
191
196 };
197
198 typedef Ogre::SharedPtr<RSDFile> RSDFilePtr;
199}
Handles RDS files.
Definition: VGearsRSDFile.h:36
virtual void SetGroupName(const String &group_name)
Sets the group name.
Definition: VGearsRSDFile.cpp:144
TextureNameList texture_names_
The texture name.
Definition: VGearsRSDFile.h:190
String polygon_name_
The polygon names.
Definition: VGearsRSDFile.h:175
virtual size_t GetTextureNameCount() const
Counts the texture names.
Definition: VGearsRSDFile.cpp:154
virtual void unloadImpl() override
Unloads the file.
Definition: VGearsRSDFile.cpp:71
MaterialList materials_
The lsit of materials.
Definition: VGearsRSDFile.h:195
virtual const String & GetMaterialName() const
Retrieves the material name.
Definition: VGearsRSDFile.cpp:150
String group_name_
The group name.
Definition: VGearsRSDFile.h:185
virtual size_t calculateSize() const
Calculates the size of the palette.
Definition: VGearsRSDFile.cpp:86
virtual void AddTexture(Ogre::Pass *pass, const size_t index) const
Adds a texture.
Definition: VGearsRSDFile.cpp:108
static const String RESOURCE_TYPE
The resource type.
Definition: VGearsRSDFile.h:73
virtual const String & GetPolygonName() const
Retrieves the polygon name.
Definition: VGearsRSDFile.cpp:148
virtual const String & GetGroupName() const
Retrieves the group name.
Definition: VGearsRSDFile.cpp:152
virtual void SetPolygonName(const String &polygon_name)
Sets the name of the polygon.
Definition: VGearsRSDFile.cpp:136
String material_name_
The material type.
Definition: VGearsRSDFile.h:180
virtual ~RSDFile()
Destructor.
Definition: VGearsRSDFile.cpp:35
std::vector< String > TextureNameList
Definition: VGearsRSDFile.h:75
virtual void SetMaterialName(const String &material_name)
Sets the material type.
Definition: VGearsRSDFile.cpp:140
virtual void loadImpl() override
Loads the file.
Definition: VGearsRSDFile.cpp:37
virtual TextureNameList & GetTextureNames()
Retrieves the list of texture names.
Definition: VGearsRSDFile.cpp:156
virtual String GetMaterialBaseName() const
Retrieves the material base.
Definition: VGearsRSDFile.cpp:100
RSDFile(Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=nullptr)
Constructor.
Definition: VGearsRSDFile.cpp:28
std::vector< Ogre::MaterialPtr > MaterialList
Definition: VGearsRSDFile.h:77
Definition: FF7NameLookup.h:24
Ogre::String String
Definition: TypeDefine.h:37
Ogre::SharedPtr< RSDFile > RSDFilePtr
Definition: VGearsRSDFile.h:198