diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/files/westwood/ADLFile.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/files/westwood/ADLFile.cpp index 65894631..b905ed42 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/files/westwood/ADLFile.cpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/files/westwood/ADLFile.cpp @@ -111,6 +111,7 @@ namespace HyperSonicDrivers::files::westwood readDataFromFile_(m_meta_version.data_offset, m_meta_version.data_header_size); + // TODO: count_loop_ for version 3 is wrong to be 8 bit i think m_num_tracks = count_loop_(0, m_header); m_num_track_offsets = count_loop_(m_meta_version.offset_start, m_track_offsets); m_num_instrument_offsets = count_loop_(m_meta_version.offset_start, m_instrument_offsets); @@ -262,6 +263,8 @@ namespace HyperSonicDrivers::files::westwood void ADLFile::readHeaderFromFile_(const int header_size, std::function read) { m_header.resize(header_size); + // TODO: pass the byte size instead of a function read and read at once, + // and do read in LE when is greter than 1, basically if version 3 for (int i = 0; i < header_size; i++) { m_header[i] = read(); diff --git a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/files/westwood/TestADLFile.cpp b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/files/westwood/TestADLFile.cpp index d425daa4..6acdb674 100644 --- a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/files/westwood/TestADLFile.cpp +++ b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/files/westwood/TestADLFile.cpp @@ -56,7 +56,7 @@ namespace HyperSonicDrivers::files::westwood ADLFileMock f("../fixtures/DUNE0.ADL"); EXPECT_EQ(f.getVersion(), 2); - EXPECT_EQ(f.getNumTracks(), 18); + EXPECT_EQ(f.getNumTracks(), 200); EXPECT_EQ(f.getNumTrackOffsets(), 52); EXPECT_EQ(f.getNumInstrumentOffsets(), 63); EXPECT_EQ(f.parentSize(), 14473);