Step 2 of removing PanicAlert

This commit is contained in:
Henrik Rydgård committed 2020-07-19 20:34:02 +02:00
1 parent 617bbcfb87
commit 47a3bf1dd7
7 files changed
+21 -37

No files matched your search

+8 -17
View File
@@ -23,19 +23,14 @@ WaveFileWriter::~WaveFileWriter()
bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRate)
{
// Check if the file is already open
if (file)
{
PanicAlert("The file %s was already open, the file header will not be written.",
filename.c_str());
if (file) {
ERROR_LOG(SYSTEM, "The file %s was already open, the file header will not be written.", filename.c_str());
return false;
}
file.Open(filename, "wb");
if (!file)
{
PanicAlert("The file %s could not be opened for writing. Please check if it's already opened "
"by another program.",
filename.c_str());
if (!file) {
ERROR_LOG(SYSTEM, "The file %s could not be opened for writing. Please check if it's already opened by another program.", filename.c_str());
return false;
}
@@ -61,9 +56,8 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
Write(100 * 1000 * 1000 - 32);
// We are now at offset 44
if (file.Tell() != 44)
PanicAlert("Wrong offset: %lld", (long long)file.Tell());
u64 offset = file.Tell();
_assert_msg_(offset == 44, "Wrong offset: %lld", (long long)offset);
return true;
}
@@ -91,11 +85,8 @@ void WaveFileWriter::Write4(const char* ptr)
void WaveFileWriter::AddStereoSamples(const short* sample_data, u32 count)
{
if (!file)
PanicAlert("WaveFileWriter - file not open.");
if (count > BUFFER_SIZE * 2)
PanicAlert("WaveFileWriter - buffer too small (count = %u).", count);
_assert_msg_(file, "WaveFileWriter - file not open.");
_assert_msg_(count <= BUFFER_SIZE * 2, "WaveFileWriter - buffer too small (count = %u).", count);
if (skip_silence)
{