1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-02 08:57:44 +00:00

bit of cleanup and sqpack fix

This commit is contained in:
NotAdam 2020-02-02 17:14:59 +11:00
parent 5b843c66dd
commit 39aa49f092

View file

@ -1,11 +1,19 @@
#include "SqPack.h"
namespace xiv {
namespace dat {
namespace xiv::dat {
enum PlatformId :
uint8_t
{
Win32,
PS3,
PS4
};
struct SqPackHeader
{
char magic[0x8];
uint32_t zero;
PlatformId platformId;
uint8_t padding0[3];
uint32_t size;
uint32_t version;
uint32_t type;
@ -17,10 +25,9 @@ namespace dat {
uint32_t type;
};
}
}
namespace xiv {
namespace utils {
namespace bparse {
namespace xiv::utils:: bparse
{
template<>
inline void reorder< xiv::dat::SqPackHeader >( xiv::dat::SqPackHeader& i_struct )
{
@ -28,7 +35,7 @@ namespace bparse {
{
xiv::utils::bparse::reorder( i_struct.magic[ i ] );
}
xiv::utils::bparse::reorder(i_struct.zero);
xiv::utils::bparse::reorder( i_struct.platformId );
xiv::utils::bparse::reorder( i_struct.size );
xiv::utils::bparse::reorder( i_struct.version );
xiv::utils::bparse::reorder( i_struct.type );
@ -41,18 +48,14 @@ namespace bparse {
xiv::utils::bparse::reorder( i_struct.type );
}
}
}
};
using xiv::utils::bparse::extract;
namespace xiv
{
namespace dat
namespace xiv::dat
{
SqPack::SqPack( const std::experimental::filesystem::path& path ) :
// Open the file
SqPack::SqPack( const std::experimental::filesystem::path& path ) :
m_handle( path.string(), std::ios_base::in | std::ios_base::binary )
{
// Extract the header
@ -73,4 +76,3 @@ namespace dat
}
}
}