V-Gears 0
Free Final Fantasy VII engine.
VGearsHRCFileSerializer.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 "VGearsHRCFile.h"
19#include "VGearsSerializer.h"
20
21namespace VGears{
22
27
28 public:
29
34
38 virtual ~HRCFileSerializer();
39
46 virtual void ImportHRCFile(
47 Ogre::DataStreamPtr &stream, HRCFile* dest
48 );
49
50 protected:
51
55 static const String TAG_COMMENT;
56
60 static const String TAG_VERSION;
61
65 static const String TAG_NAME;
66
70 static const String TAG_BONE_COUNT;
71
72 typedef std::vector<String> Block;
73
75
81 virtual void ReadFileHeader(Ogre::DataStreamPtr &stream);
82
89 virtual void ReadBlock(Ogre::DataStreamPtr &stream, Block& dest);
90
97 virtual void readObject(Ogre::DataStreamPtr &stream, Bone &dest);
98
99 template<typename ValueType> void ReadVector(
100 Ogre::DataStreamPtr &stream, std::vector<ValueType> &dest,
101 size_t count
102 );
103
107 struct Header{
108
113
118
123 };
124
125 private:
126
131 };
132}
Handles the serialization of HRC files.
Definition: VGearsHRCFileSerializer.h:26
static const String TAG_BONE_COUNT
The bone count tag.
Definition: VGearsHRCFileSerializer.h:70
virtual void ReadFileHeader(Ogre::DataStreamPtr &stream)
Reads a file header and sets the instance data.
Definition: VGearsHRCFileSerializer.cpp:52
virtual void ReadBlock(Ogre::DataStreamPtr &stream, Block &dest)
Reads an object as a block.
Definition: VGearsHRCFileSerializer.cpp:46
HRCFile::Bone Bone
Definition: VGearsHRCFileSerializer.h:74
static const String TAG_VERSION
File version tag.
Definition: VGearsHRCFileSerializer.h:60
HRCFileSerializer()
Constructor.
Definition: VGearsHRCFileSerializer.cpp:29
static const String TAG_COMMENT
A comment tag.
Definition: VGearsHRCFileSerializer.h:55
virtual void ImportHRCFile(Ogre::DataStreamPtr &stream, HRCFile *dest)
Imports a HRC file.
Definition: VGearsHRCFileSerializer.cpp:130
virtual ~HRCFileSerializer()
Destructor.
Definition: VGearsHRCFileSerializer.cpp:31
virtual void readObject(Ogre::DataStreamPtr &stream, Bone &dest)
Reads an object as a bone.
Definition: VGearsHRCFileSerializer.cpp:88
static const String TAG_NAME
The name tag.
Definition: VGearsHRCFileSerializer.h:65
Header header_
The file header.
Definition: VGearsHRCFileSerializer.h:130
std::vector< String > Block
Definition: VGearsHRCFileSerializer.h:72
void ReadVector(Ogre::DataStreamPtr &stream, std::vector< ValueType > &dest, size_t count)
Definition: VGearsHRCFileSerializer.cpp:33
Handles HRC files.
Definition: VGearsHRCFile.h:34
Handles file serialization.
Definition: VGearsSerializer.h:30
Definition: FF7NameLookup.h:24
Ogre::String String
Definition: TypeDefine.h:37
An HRC file header.
Definition: VGearsHRCFileSerializer.h:107
long bone_count
Number of bones in the file.
Definition: VGearsHRCFileSerializer.h:117
String name
Name of the skeleton in the file.
Definition: VGearsHRCFileSerializer.h:122
long version
File format version.
Definition: VGearsHRCFileSerializer.h:112
A bone in a skeleton.
Definition: VGearsHRCFile.h:77