/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Utilities/AssetFileHeader.h
46 строк
2 KB
Jan Krassnigg
TexConv.exe can now do image comparison and output diff images and HTML (#1157)
14 янв 2024, 13:50
Не верифицирован
14 янв 2024, 13:50
5f162b0
Код
Авторство
О чём код?
#pragma once #include <Foundation/IO/Stream.h> #include <Foundation/Strings/HashedString.h> /// \brief Simple class to handle asset file headers (the very first bytes in all transformed asset files) class EZ_FOUNDATION_DLL ezAssetFileHeader { public: ezAssetFileHeader(); /// \brief Reads the hash from file. If the file is outdated, the hash is set to 0xFFFFFFFFFFFFFFFF. ezResult Read(ezStreamReader& inout_stream); /// \brief Writes the asset hash to file (plus a little version info) ezResult Write(ezStreamWriter& inout_stream) const; /// \brief Checks whether the stored file contains the same hash. bool IsFileUpToDate(ezUInt64 uiExpectedHash, ezUInt16 uiVersion) const { return (m_uiHash == uiExpectedHash && m_uiVersion == uiVersion); } /// \brief Returns the asset file hash ezUInt64 GetFileHash() const { return m_uiHash; } /// \brief Sets the asset file hash void SetFileHashAndVersion(ezUInt64 uiHash, ezUInt16 v) { m_uiHash = uiHash; m_uiVersion = v; } /// \brief Returns the asset type version ezUInt16 GetFileVersion() const { return m_uiVersion; } /// \brief Returns the generator which was used to produce the asset file const ezHashedString& GetGenerator() { return m_sGenerator; } /// \brief Allows to set the generator string void SetGenerator(ezStringView sGenerator) { m_sGenerator.Assign(sGenerator); } private: // initialize to a 'valid' hash // this may get stored, unless someone sets the hash ezUInt64 m_uiHash = 0; ezUInt16 m_uiVersion = 0; ezHashedString m_sGenerator; };