void OnStart() { asd::Engine::GetFile()->AddRootDirectory(asd::ToAString("Data/Texture.pack").c_str()); for (auto loop = 0; loop < 2; loop++) { //普通に読み込んだバイナリ BinaryReader reader; auto data = GetBinaryData(asd::ToAString("Data/Texture/Surface/Tile_Normal.png")); reader.ReadIn(data.begin(), data.end()); //ファイル機能で読み込んだバイナリ auto staticFile = asd::Engine::GetFile()->CreateStaticFile(asd::ToAString("Surface/Tile_Normal.png").c_str()); auto staticFileData = staticFile->GetBuffer(); int cnt = 0; while (!reader.IsEmpty()) { int8_t byteFromRaw = reader.Get<int8_t>(); int8_t byteFromFile = staticFileData[cnt++]; ASSERT_EQ(byteFromRaw, byteFromFile); } ASSERT_EQ(cnt, staticFileData.size()); } }
void OnStart() { //普通に読み込んだバイナリ BinaryReader reader; auto data = GetBinaryData(asd::ToAString("Data/Texture/Surface/Tile_Normal.png")); reader.ReadIn(data.begin(), data.end()); //ファイル機能で読み込んだバイナリ asd::Engine::GetFile()->AddRootPackage(asd::ToAString("Data/Texture.pack").c_str()); auto streamFile = asd::Engine::GetFile()->CreateStreamFile(asd::ToAString("Surface/Tile_Normal.png").c_str()); std::vector<uint8_t> buffer; streamFile->Read(buffer, streamFile->GetSize()); int cnt = 0; while (!reader.IsEmpty()) { auto byteFromRaw = reader.Get<uint8_t>(); auto byteFromFile = buffer[cnt++]; ASSERT_EQ(byteFromRaw, byteFromFile); } ASSERT_EQ(cnt, buffer.size()); }