Fix intro FLIC brightness, 120/9 fps A/V sync, and authentic INTRO.EXE audio script
This commit is contained in:
1 parent
7673e25883
commit
5c2ac8e70f
9 files changed
+264
-38
No files matched your search
+19
-2
@@ -11,6 +11,7 @@
|
||||
#include "core/vfs.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <filesystem>
|
||||
@@ -263,12 +264,28 @@ int main() {
|
||||
CHECK(flic.open(vfs));
|
||||
CHECK(flic.width() == 320 && flic.height() == 200);
|
||||
CHECK(flic.num_frames() == 548);
|
||||
int decoded_frames = 0;
|
||||
CHECK(std::abs(flic.fps() - (120.0f / 9.0f)) < 1e-4f);
|
||||
|
||||
CHECK(flic.step_frame());
|
||||
const std::vector<uint8_t> frame1_rgba = flic.rgba();
|
||||
uint8_t max_rgb = 0;
|
||||
for (size_t i = 0; i + 3 < frame1_rgba.size(); i += 4) {
|
||||
max_rgb = std::max({max_rgb, frame1_rgba[i], frame1_rgba[i + 1], frame1_rgba[i + 2]});
|
||||
}
|
||||
CHECK(max_rgb >= 200);
|
||||
|
||||
int decoded_frames = 1;
|
||||
while (flic.step_frame()) {
|
||||
++decoded_frames;
|
||||
}
|
||||
CHECK(decoded_frames == 548);
|
||||
std::cout << "[PASS] Intro FLIC decoded all " << decoded_frames << " frames\n";
|
||||
|
||||
flic.reset();
|
||||
CHECK(flic.step_frame());
|
||||
CHECK(flic.current_frame() == 1);
|
||||
CHECK(flic.rgba() == frame1_rgba);
|
||||
std::cout << "[PASS] Intro FLIC decoded all " << decoded_frames
|
||||
<< " frames (fps=" << flic.fps() << ", max_rgb=" << int(max_rgb) << ")\n";
|
||||
} else {
|
||||
std::cout << "[INFO] Optional DATA/INTRO.DAT not present; skipping intro FLIC check\n";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user