ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

directorysubentry.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef MYST3_DIRECTORYSUBENTRY_H
00024 #define MYST3_DIRECTORYSUBENTRY_H
00025 
00026 #include "common/array.h"
00027 #include "common/memstream.h"
00028 #include "math/vector3d.h"
00029 
00030 namespace Myst3 {
00031 
00032 struct SpotItemData {
00033     uint32 u;
00034     uint32 v;
00035 };
00036 
00037 struct VideoData {
00038     Math::Vector3d v1;
00039     Math::Vector3d v2;
00040     int32 u;
00041     int32 v;
00042     int32 width;
00043     int32 height;
00044 };
00045 
00046 typedef Common::Array<uint32> MiscData;
00047 
00048 class Archive;
00049 
00050 class DirectorySubEntry {
00051     public:
00052         enum ResourceType {
00053             kCubeFace = 0,
00054             kWaterEffectMask = 1,
00055             kLavaEffectMask = 2,
00056             kMagneticEffectMask = 3,
00057             kShieldEffectMask = 4,
00058             kSpotItem = 5,
00059             kFrame = 6,
00060             kRawData = 7,
00061             kMovie = 8,
00062             kStillMovie = 10,
00063             kText = 11,
00064             kTextMetadata = 12,
00065             kNumMetadata = 13,
00066             kLocalizedSpotItem = 69,
00067             kLocalizedFrame = 70,
00068             kMultitrackMovie = 72,
00069             kDialogMovie = 74
00070         };
00071 
00072         DirectorySubEntry(Archive *archive);
00073 
00074         void readFromStream(Common::SeekableReadStream &inStream);
00075         void dumpToFile(Common::SeekableReadStream &inStream, const char* room, uint32 index);
00076         Common::MemoryReadStream *getData() const;
00077         uint16 getFace() const { return _face; }
00078         ResourceType getType() const { return _type; }
00079         const SpotItemData &getSpotItemData() const { return _spotItemData; }
00080         const VideoData &getVideoData() const { return _videoData; }
00081         uint32 getMiscData(uint index) const;
00082         Common::String getTextData(uint index) const;
00083 
00084     private:
00085         uint32 _offset;
00086         uint32 _size;
00087         uint16 _metadataSize;
00088         byte _face;
00089         ResourceType _type;
00090 
00091         // Metadata
00092         SpotItemData _spotItemData;
00093         VideoData _videoData;
00094         MiscData _miscData;
00095 
00096         Archive *_archive;
00097 };
00098 
00099 typedef Common::Array<const DirectorySubEntry *> DirectorySubEntryList;
00100 
00101 } // End of namespace Myst3
00102 
00103 #endif // MYST3_DIRECTORYSUBENTRY_H


Generated on Sat Aug 17 2019 05:00:39 for ResidualVM by doxygen 1.7.1
curved edge   curved edge