2014-06-18 04:51:18 +00:00
|
|
|
#ifndef ATHENA_NO_ZQUEST
|
2014-04-20 09:14:15 +00:00
|
|
|
// This file is part of libAthena.
|
2013-07-21 07:49:07 +00:00
|
|
|
//
|
2014-04-20 09:14:15 +00:00
|
|
|
// libAthena is free software: you can redistribute it and/or modify
|
2013-07-21 07:49:07 +00:00
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
2014-04-20 09:14:15 +00:00
|
|
|
// libAthena is distributed in the hope that it will be useful,
|
2013-07-21 07:49:07 +00:00
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
2014-04-20 09:14:15 +00:00
|
|
|
// along with libAthena. If not, see <http://www.gnu.org/licenses/>
|
2013-07-21 07:49:07 +00:00
|
|
|
|
2013-07-21 03:51:26 +00:00
|
|
|
#ifndef ZQUEST_HPP
|
|
|
|
#define ZQUEST_HPP
|
|
|
|
|
2014-06-18 04:51:18 +00:00
|
|
|
|
2014-04-20 09:14:15 +00:00
|
|
|
#include "Athena/Global.hpp"
|
2013-07-21 03:51:26 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2015-08-05 22:20:15 +00:00
|
|
|
#include <memory>
|
2013-07-21 03:51:26 +00:00
|
|
|
|
2014-04-19 01:36:46 +00:00
|
|
|
#define ZQUEST_VERSION_CHECK(major, minor, revision) \
|
|
|
|
(major | (minor << 8) | (revision << 16))
|
|
|
|
|
2014-04-20 09:14:15 +00:00
|
|
|
namespace Athena
|
2013-07-21 03:51:26 +00:00
|
|
|
{
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
2014-04-19 01:36:46 +00:00
|
|
|
* \brief ZQuestFile is an export format for save data.
|
2013-07-21 07:49:07 +00:00
|
|
|
*/
|
2013-07-22 03:06:54 +00:00
|
|
|
class ZQuestFile
|
2013-07-21 03:51:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
2013-07-22 03:06:54 +00:00
|
|
|
* \brief The current major version of the ZQuest format
|
2013-07-21 07:49:07 +00:00
|
|
|
*/
|
2014-06-18 04:51:18 +00:00
|
|
|
static const atUint32 Major;
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
2013-07-22 03:06:54 +00:00
|
|
|
* \brief The current minor version of the ZQuest format
|
2013-07-21 07:49:07 +00:00
|
|
|
*/
|
2014-06-18 04:51:18 +00:00
|
|
|
static const atUint32 Minor;
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
2013-07-22 03:06:54 +00:00
|
|
|
* \brief The current revision of the ZQuest format
|
2013-07-21 07:49:07 +00:00
|
|
|
*/
|
2014-06-18 04:51:18 +00:00
|
|
|
static const atUint32 Revision;
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
2013-07-22 03:06:54 +00:00
|
|
|
* \brief The current version of the ZQuest format
|
2013-07-21 07:49:07 +00:00
|
|
|
*/
|
2014-06-18 04:51:18 +00:00
|
|
|
static const atUint32 Version;
|
2013-07-21 03:51:26 +00:00
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
2013-07-22 03:06:54 +00:00
|
|
|
* \brief The magic number used to identify the file e.g. "ZQS1"
|
2013-07-21 07:49:07 +00:00
|
|
|
*/
|
2014-06-18 04:51:18 +00:00
|
|
|
static const atUint32 Magic;
|
2013-07-21 03:51:26 +00:00
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
2013-07-22 03:06:54 +00:00
|
|
|
* \enum Game
|
|
|
|
* \brief The list of games currently supported by ZQuest
|
2013-07-21 07:49:07 +00:00
|
|
|
*/
|
2013-07-21 03:51:26 +00:00
|
|
|
enum Game
|
|
|
|
{
|
2013-07-22 03:06:54 +00:00
|
|
|
NoGame, //!< None or Unsupported
|
|
|
|
LoZ, //!< Legend of Zelda
|
|
|
|
AoL, //!< Adventure of Link
|
|
|
|
ALttP, //!< A Link to the Past
|
|
|
|
LA, //!< Links Awakening
|
|
|
|
OoT, //!< Ocarin of Time
|
|
|
|
OoT3D, //!< Ocarina of Time 3D
|
|
|
|
MM, //!< Majora's Mask
|
|
|
|
OoS, //!< Oracle of Season
|
|
|
|
OoA, //!< Oracle of Ages
|
|
|
|
FS, //!< Four Swords
|
|
|
|
WW, //!< Wind Waker
|
|
|
|
FSA, //!< Four Swords Adventures
|
|
|
|
MC, //!< Minish Cap
|
|
|
|
TP, //!< Twilight Princess
|
|
|
|
PH, //!< Phantom Hourglass
|
|
|
|
ST, //!< Spirit Tracks
|
|
|
|
SS, //!< Skyward Sword
|
|
|
|
ALBW, //!< A Link Between Worlds
|
|
|
|
// Add more games here
|
|
|
|
|
|
|
|
// This must always be last
|
|
|
|
GameCount //!< Total number of supported games
|
2013-07-21 03:51:26 +00:00
|
|
|
};
|
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
|
|
|
* \brief ZQuest
|
|
|
|
*/
|
2013-07-22 03:06:54 +00:00
|
|
|
ZQuestFile();
|
2013-07-21 07:49:07 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief ZQuest
|
|
|
|
* \param game
|
|
|
|
* \param endian
|
|
|
|
* \param data
|
|
|
|
* \param length
|
|
|
|
*/
|
2015-08-05 22:20:15 +00:00
|
|
|
ZQuestFile(Game game, Endian endian, std::unique_ptr<atUint8[]>&& data, atUint32 length, const std::string& gameString = std::string());
|
2013-07-21 03:51:26 +00:00
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
|
|
|
* \brief setGame
|
|
|
|
* \param game
|
|
|
|
*/
|
2013-07-21 03:51:26 +00:00
|
|
|
void setGame(Game game);
|
2013-07-21 07:49:07 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief game
|
|
|
|
* \return
|
|
|
|
*/
|
2013-07-21 03:51:26 +00:00
|
|
|
Game game() const;
|
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
|
|
|
* \brief setEndian
|
|
|
|
* \param endian
|
|
|
|
*/
|
2013-07-21 03:51:26 +00:00
|
|
|
void setEndian(Endian endian);
|
2013-07-21 07:49:07 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief endian
|
|
|
|
* \return
|
|
|
|
*/
|
2013-07-21 03:51:26 +00:00
|
|
|
Endian endian() const;
|
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
|
|
|
* \brief setData
|
2013-07-22 03:06:54 +00:00
|
|
|
* \param data The data to assign
|
|
|
|
* \param length The length of the data
|
2013-07-21 07:49:07 +00:00
|
|
|
*/
|
2015-08-05 22:20:15 +00:00
|
|
|
void setData(std::unique_ptr<atUint8[]>&& data, atUint32 length);
|
2013-07-21 07:49:07 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief data
|
|
|
|
* \return
|
|
|
|
*/
|
2014-06-18 04:51:18 +00:00
|
|
|
atUint8* data() const;
|
2013-07-21 03:51:26 +00:00
|
|
|
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
|
|
|
* \brief length
|
|
|
|
* \return
|
|
|
|
*/
|
2014-06-18 04:51:18 +00:00
|
|
|
atUint32 length() const;
|
2013-07-21 03:51:26 +00:00
|
|
|
|
2014-04-19 01:36:46 +00:00
|
|
|
void setGameString(const std::string& gameString);
|
2013-07-21 07:49:07 +00:00
|
|
|
/*!
|
|
|
|
* \brief gameString
|
|
|
|
* \return
|
|
|
|
*/
|
2013-07-21 03:51:26 +00:00
|
|
|
std::string gameString() const;
|
2014-04-19 01:36:46 +00:00
|
|
|
|
|
|
|
static const std::vector<std::string> gameStringList();
|
2014-11-29 03:32:37 +00:00
|
|
|
protected:
|
2014-04-19 01:36:46 +00:00
|
|
|
Game m_game;
|
|
|
|
std::string m_gameString;
|
|
|
|
Endian m_endian;
|
2015-08-05 22:20:15 +00:00
|
|
|
std::unique_ptr<atUint8[]> m_data;
|
2014-11-29 03:32:37 +00:00
|
|
|
atUint32 m_length;
|
2013-07-21 03:51:26 +00:00
|
|
|
|
|
|
|
// Game strings support
|
|
|
|
};
|
|
|
|
} // zelda
|
|
|
|
|
|
|
|
#endif // ZQUEST_HPP
|
2014-06-18 04:51:18 +00:00
|
|
|
#endif // ATHENA_NO_ZQUEST
|