diff --git a/Source/Core/AudioCommon/XAudio2Stream.cpp b/Source/Core/AudioCommon/XAudio2Stream.cpp index 76db61e9a8..6e8762b4e9 100644 --- a/Source/Core/AudioCommon/XAudio2Stream.cpp +++ b/Source/Core/AudioCommon/XAudio2Stream.cpp @@ -78,7 +78,7 @@ StreamingVoiceContext::StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer, HRESULT hr; if (FAILED(hr = pXAudio2->CreateSourceVoice(&m_source_voice, &wfx.Format, XAUDIO2_VOICE_NOSRC, 1.0f, this))) { - PanicAlertT("XAudio2 CreateSourceVoice failed: %#X", hr); + PanicAlert("XAudio2 CreateSourceVoice failed: %#X", hr); return; } @@ -177,7 +177,7 @@ bool XAudio2::Start() IXAudio2* xaudptr; if (FAILED(hr = ((XAudio2Create_t)PXAudio2Create)(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR))) { - PanicAlertT("XAudio2 init failed: %#X", hr); + PanicAlert("XAudio2 init failed: %#X", hr); Stop(); return false; } @@ -187,7 +187,7 @@ bool XAudio2::Start() // XAUDIO2_DEFAULT_CHANNELS instead of 2 for expansion? if (FAILED(hr = m_xaudio2->CreateMasteringVoice(&m_mastering_voice, 2, m_mixer->GetSampleRate()))) { - PanicAlertT("XAudio2 master voice creation failed: %#X", hr); + PanicAlert("XAudio2 master voice creation failed: %#X", hr); Stop(); return false; } diff --git a/Source/Core/AudioCommon/XAudio2_7Stream.cpp b/Source/Core/AudioCommon/XAudio2_7Stream.cpp index bbef5c30d9..853bc2289e 100644 --- a/Source/Core/AudioCommon/XAudio2_7Stream.cpp +++ b/Source/Core/AudioCommon/XAudio2_7Stream.cpp @@ -78,7 +78,7 @@ StreamingVoiceContext2_7::StreamingVoiceContext2_7(IXAudio2 *pXAudio2, CMixer *p HRESULT hr; if (FAILED(hr = pXAudio2->CreateSourceVoice(&m_source_voice, &wfx.Format, XAUDIO2_VOICE_NOSRC, 1.0f, this))) { - PanicAlertT("XAudio2_7 CreateSourceVoice failed: %#X", hr); + PanicAlert("XAudio2_7 CreateSourceVoice failed: %#X", hr); return; } @@ -165,7 +165,7 @@ bool XAudio2_7::Start() IXAudio2* xaudptr; if (FAILED(hr = XAudio2Create(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR))) { - PanicAlertT("XAudio2_7 init failed: %#X", hr); + PanicAlert("XAudio2_7 init failed: %#X", hr); Stop(); return false; } @@ -175,7 +175,7 @@ bool XAudio2_7::Start() // XAUDIO2_DEFAULT_CHANNELS instead of 2 for expansion? if (FAILED(hr = m_xaudio2->CreateMasteringVoice(&m_mastering_voice, 2, m_mixer->GetSampleRate()))) { - PanicAlertT("XAudio2_7 master voice creation failed: %#X", hr); + PanicAlert("XAudio2_7 master voice creation failed: %#X", hr); Stop(); return false; } diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 31914dbed6..b941cf1c32 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -179,13 +179,14 @@ bool CBoot::Load_BS2(const std::string& _rBootROMFilename) ipl_region = EUR_DIR; break; default: - PanicAlert("IPL with unknown hash %x", ipl_hash); + PanicAlertT("IPL with unknown hash %x", ipl_hash); break; } std::string BootRegion = _rBootROMFilename.substr(_rBootROMFilename.find_last_of(DIR_SEP) - 3, 3); if (BootRegion != ipl_region) - PanicAlert("%s IPL found in %s directory. The disc may not be recognized", ipl_region.c_str(), BootRegion.c_str()); + PanicAlertT("%s IPL found in %s directory. The disc might not be recognized", + ipl_region.c_str(), BootRegion.c_str()); // Run the descrambler over the encrypted section containing BS1/BS2 CEXIIPL::Descrambler((u8*)data.data() + 0x100, 0x1AFE00); diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 5182ce31ec..e08c3f58d2 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -430,7 +430,7 @@ void EmuThread() { HW::Shutdown(); g_video_backend->Shutdown(); - PanicAlert("Failed to initialize DSP emulator!"); + PanicAlert("Failed to initialize DSP emulation!"); Host_Message(WM_USER_STOP); return; } @@ -614,7 +614,7 @@ void SetState(EState _State) Wiimote::Resume(); break; default: - PanicAlertT("Invalid state"); + PanicAlert("Invalid state"); break; } } diff --git a/Source/Core/Core/CoreTiming.cpp b/Source/Core/Core/CoreTiming.cpp index e45b72a478..8ee739caad 100644 --- a/Source/Core/Core/CoreTiming.cpp +++ b/Source/Core/Core/CoreTiming.cpp @@ -128,7 +128,7 @@ int RegisterEvent(const std::string& name, TimedCallback callback) void UnregisterAllEvents() { if (first) - PanicAlertT("Cannot unregister events with events pending"); + PanicAlert("Cannot unregister events with events pending"); event_types.clear(); } diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp index 2b2b57d41f..f3c17a69e2 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp @@ -87,12 +87,14 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE* dsphle, bool wii) default: if (wii) { - PanicAlert("DSPHLE: Unknown ucode (CRC = %08x) - forcing AXWii.\n\nTry LLE emulator if this is homebrew.", crc); + PanicAlertT("This title might be incompatible with DSP HLE emulation. Try using LLE if this is homebrew.\n\n" + "Unknown ucode (CRC = %08x) - forcing AXWii.", crc); return new AXWiiUCode(dsphle, crc); } else { - PanicAlert("DSPHLE: Unknown ucode (CRC = %08x) - forcing AX.\n\nTry LLE emulator if this is homebrew.", crc); + PanicAlertT("This title might be incompatible with DSP HLE emulation. Try using LLE if this is homebrew.\n\n" + "DSPHLE: Unknown ucode (CRC = %08x) - forcing AX.", crc); return new AXUCode(dsphle, crc); } diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp index 21e767e9d3..48f11072e4 100644 --- a/Source/Core/Core/HW/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVDInterface.cpp @@ -332,7 +332,7 @@ static void FinishExecuteReadCommand(u64 userdata, int cyclesLate) { if (!current_read_command.is_valid) { - PanicAlertT("DVDInterface tried to execute non-existing command"); + PanicAlert("DVDInterface: There is no command to execute!"); } else { @@ -532,7 +532,8 @@ void ChangeDisc(const std::string& newFileName) auto sizeofpath = fileName.find_last_of("/\\") + 1; if (fileName.substr(sizeofpath).length() > 40) { - PanicAlert("Saving iso filename to .dtm failed; max file name length is 40 characters."); + PanicAlertT("The disc change to \"newFileName\" could not be saved in the .dtm.\n" + "The filename of the disc image must not be longer than 40 characters."); } Movie::g_discChange = fileName.substr(sizeofpath); } diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp index 9a96b5fcbc..caf28e6342 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_DI.cpp @@ -115,7 +115,7 @@ void CWII_IPC_HLE_Device_di::FinishIOCtl(DVDInterface::DIInterruptType interrupt { if (m_commands_to_execute.empty()) { - PanicAlertT("WII_IPC_HLE_Device_DI tried to reply to non-existing command"); + PanicAlert("WII_IPC_HLE_Device_DI: There is no command to execute!"); return; } diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp index 5e300ce120..573f698021 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp @@ -143,7 +143,7 @@ File::IOFile CWII_IPC_HLE_Device_FileIO::OpenFile() break; default: - PanicAlertT("FileIO: Unknown open mode : 0x%02x", m_Mode); + PanicAlert("FileIO: Unknown open mode : 0x%02x", m_Mode); break; } diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp index 3d611088e7..3567b25aba 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -427,7 +427,7 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) } rContent.m_Position += Size; } else { - PanicAlertT("IOCTL_ES_READCONTENT - bad destination"); + PanicAlert("IOCTL_ES_READCONTENT - bad destination"); } } diff --git a/Source/Core/Core/MemTools.cpp b/Source/Core/Core/MemTools.cpp index 5992578d76..e028b40faa 100644 --- a/Source/Core/Core/MemTools.cpp +++ b/Source/Core/Core/MemTools.cpp @@ -100,7 +100,7 @@ static void CheckKR(const char* name, kern_return_t kr) { if (kr) { - PanicAlertT("%s failed: kr=%x", name, kr); + PanicAlert("%s failed: kr=%x", name, kr); } } @@ -153,13 +153,13 @@ static void ExceptionThread(mach_port_t port) if (msg_in.Head.msgh_id != 2406) { - PanicAlertT("unknown message received"); + PanicAlert("unknown message received"); return; } if (msg_in.flavor != x86_THREAD_STATE64) { - PanicAlertT("unknown flavor %d (expected %d)", msg_in.flavor, x86_THREAD_STATE64); + PanicAlert("unknown flavor %d (expected %d)", msg_in.flavor, x86_THREAD_STATE64); return; } diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 3177dd193e..3bf6e743c3 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -929,7 +929,7 @@ bool NetPlayClient::WiimoteUpdate(int _number, u8* data, const u8 size) // If it still mismatches, it surely desynced if (size != nw.size()) { - PanicAlert("Netplay has desynced. There is no way to recover from this."); + PanicAlertT("Netplay has desynced. There is no way to recover from this."); return false; } } diff --git a/Source/Core/Core/PowerPC/MMU.cpp b/Source/Core/Core/PowerPC/MMU.cpp index 8de2d9c87e..71be1e2f11 100644 --- a/Source/Core/Core/PowerPC/MMU.cpp +++ b/Source/Core/Core/PowerPC/MMU.cpp @@ -888,7 +888,7 @@ static void GenerateDSIException(u32 effectiveAddress, bool write) // DSI exceptions are only supported in MMU mode. if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU) { - PanicAlertT("Invalid %s to 0x%08x, PC = 0x%08x ", write ? "Write to" : "Read from", effectiveAddress, PC); + PanicAlert("Invalid %s to 0x%08x, PC = 0x%08x ", write ? "Write to" : "Read from", effectiveAddress, PC); return; } diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index 3ef7ba4f8f..d53cba084e 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -683,12 +683,12 @@ void UndoLoadState() } else { - PanicAlert("No undo.dtm found, aborting undo load state to prevent movie desyncs"); + PanicAlertT("No undo.dtm found, aborting undo load state to prevent movie desyncs"); } } else { - PanicAlert("There is nothing to undo!"); + PanicAlertT("There is nothing to undo!"); } } diff --git a/Source/Core/DiscIO/CompressedBlob.cpp b/Source/Core/DiscIO/CompressedBlob.cpp index 9be86c18ef..04304b7613 100644 --- a/Source/Core/DiscIO/CompressedBlob.cpp +++ b/Source/Core/DiscIO/CompressedBlob.cpp @@ -107,10 +107,10 @@ void CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr) // First, check hash. u32 block_hash = HashAdler32(source, comp_block_size); if (block_hash != m_hashes[block_num]) - PanicAlert("Hash of block %" PRIu64 " is %08x instead of %08x.\n" - "Your ISO, \"%s\", is corrupt.", - block_num, block_hash, m_hashes[block_num], - m_file_name.c_str()); + PanicAlertT("The disc image \"%s\" is corrupt.\n" + "Hash of block %" PRIu64 " is %08x instead of %08x.", + m_file_name.c_str(), + block_num, block_hash, m_hashes[block_num]); if (uncompressed) { diff --git a/Source/Core/DolphinWX/MemcardManager.cpp b/Source/Core/DolphinWX/MemcardManager.cpp index 71123a14db..8d64a51cdb 100644 --- a/Source/Core/DolphinWX/MemcardManager.cpp +++ b/Source/Core/DolphinWX/MemcardManager.cpp @@ -421,7 +421,7 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot) if (slot != -1) { memoryCard[slot]->FixChecksums(); - if (!memoryCard[slot]->Save()) PanicAlertT(E_SAVEFAILED); + if (!memoryCard[slot]->Save()) PanicAlertT("File write failed"); page[slot] = FIRSTPAGE; ReloadMemcard(WxStrToStr(m_MemcardPath[slot]->GetPath()), slot); } @@ -435,7 +435,7 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot) case OUTOFBLOCKS: if (slot == -1) { - WxUtils::ShowErrorDialog(_(E_UNK)); + WxUtils::ShowErrorDialog(_("Unknown memory card error")); break; } wxMessageBox(wxString::Format(_("Only %d blocks available"), memoryCard[slot]->GetFreeBlocks())); @@ -467,14 +467,14 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot) WxUtils::ShowErrorDialog(_("Invalid bat.map or dir entry.")); break; case WRITEFAIL: - WxUtils::ShowErrorDialog(_(E_SAVEFAILED)); + WxUtils::ShowErrorDialog(_("File write failed")); break; case DELETE_FAIL: WxUtils::ShowErrorDialog(_("Order of files in the File Directory do not match the block order\n" "Right click and export all of the saves,\nand import the saves to a new memcard\n")); break; default: - WxUtils::ShowErrorDialog(_(E_UNK)); + WxUtils::ShowErrorDialog(_("Unknown memory card error")); break; } SetFocus(); @@ -515,7 +515,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event) } else { - WxUtils::ShowErrorDialog(_(E_SAVEFAILED)); + WxUtils::ShowErrorDialog(_("File write failed")); } break; case ID_CONVERTTOGCI: diff --git a/Source/Core/DolphinWX/MemcardManager.h b/Source/Core/DolphinWX/MemcardManager.h index 8316f3b854..382f3efbdb 100644 --- a/Source/Core/DolphinWX/MemcardManager.h +++ b/Source/Core/DolphinWX/MemcardManager.h @@ -21,8 +21,6 @@ class wxStaticText; #define MEMCARD_MANAGER_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX | wxRESIZE_BORDER | wxMAXIMIZE_BOX #define MEMCARDMAN_TITLE _trans("Memory Card Manager WARNING-Make backups before using, should be fixed but could mangle stuff!") -#define E_SAVEFAILED "File write failed" -#define E_UNK "Unknown error" #define FIRSTPAGE 0 class CMemcardManager : public wxDialog diff --git a/Source/Core/VideoBackends/D3D/D3DShader.cpp b/Source/Core/VideoBackends/D3D/D3DShader.cpp index 0d2c2c7a8f..665c0cf644 100644 --- a/Source/Core/VideoBackends/D3D/D3DShader.cpp +++ b/Source/Core/VideoBackends/D3D/D3DShader.cpp @@ -54,10 +54,8 @@ bool CompileVertexShader(const std::string& code, D3DBlob** blob) file << code; file.close(); - PanicAlert("Failed to compile vertex shader!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%s):\n%s", - filename.c_str(), - D3D::VertexShaderVersionString(), - (const char*)errorBuffer->GetBufferPointer()); + PanicAlert("Failed to compile vertex shader: %s\nDebug info (%s):\n%s", + filename.c_str(), D3D::VertexShaderVersionString(), (const char*)errorBuffer->GetBufferPointer()); *blob = nullptr; errorBuffer->Release(); @@ -110,10 +108,8 @@ bool CompileGeometryShader(const std::string& code, D3DBlob** blob, const D3D_SH file << code; file.close(); - PanicAlert("Failed to compile geometry shader!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%s):\n%s", - filename.c_str(), - D3D::GeometryShaderVersionString(), - (const char*)errorBuffer->GetBufferPointer()); + PanicAlert("Failed to compile geometry shader: %s\nDebug info (%s):\n%s", + filename.c_str(), D3D::GeometryShaderVersionString(), (const char*)errorBuffer->GetBufferPointer()); *blob = nullptr; errorBuffer->Release(); @@ -168,10 +164,8 @@ bool CompilePixelShader(const std::string& code, D3DBlob** blob, const D3D_SHADE file << code; file.close(); - PanicAlert("Failed to compile pixel shader!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%s):\n%s", - filename.c_str(), - D3D::PixelShaderVersionString(), - (const char*)errorBuffer->GetBufferPointer()); + PanicAlert("Failed to compile pixel shader: %s\nDebug info (%s):\n%s", + filename.c_str(), D3D::PixelShaderVersionString(), (const char*)errorBuffer->GetBufferPointer()); *blob = nullptr; errorBuffer->Release(); diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index 9bb0a72014..4ff8bf28de 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -312,12 +312,10 @@ bool ProgramShaderCache::CompileShader(SHADER& shader, const char* vcode, const if (linkStatus != GL_TRUE) { - PanicAlert("Failed to link shaders!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%s, %s, %s):\n%s", - filename.c_str(), - g_ogl_config.gl_vendor, - g_ogl_config.gl_renderer, - g_ogl_config.gl_version, - infoLog); + PanicAlert("Failed to link shaders: %s\n" + "Debug info (%s, %s, %s):\n%s", + filename.c_str(), + g_ogl_config.gl_vendor, g_ogl_config.gl_renderer, g_ogl_config.gl_version, infoLog); } delete [] infoLog; @@ -371,13 +369,11 @@ GLuint ProgramShaderCache::CompileSingleShader(GLuint type, const char* code) if (compileStatus != GL_TRUE) { - PanicAlert("Failed to compile %s shader!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%s, %s, %s):\n%s", - type == GL_VERTEX_SHADER ? "vertex" : type==GL_FRAGMENT_SHADER ? "pixel" : "geometry", - filename.c_str(), - g_ogl_config.gl_vendor, - g_ogl_config.gl_renderer, - g_ogl_config.gl_version, - infoLog); + PanicAlert("Failed to compile %s shader: %s\n" + "Debug info (%s, %s, %s):\n%s", + type == GL_VERTEX_SHADER ? "vertex" : type==GL_FRAGMENT_SHADER ? "pixel" : "geometry", + filename.c_str(), + g_ogl_config.gl_vendor, g_ogl_config.gl_renderer, g_ogl_config.gl_version, infoLog); } delete[] infoLog; diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp index 4a37d2cf22..fe5b0050e7 100644 --- a/Source/Core/VideoCommon/AVIDump.cpp +++ b/Source/Core/VideoCommon/AVIDump.cpp @@ -192,9 +192,9 @@ void AVIDump::StoreFrame(const void* data) else { free(s_stored_frame); - PanicAlert("Something has gone seriously wrong.\n" - "Stopping video recording.\n" - "Your video will likely be broken."); + PanicAlertT("Something has gone seriously wrong.\n" + "Stopping video recording.\n" + "Your video will likely be broken."); Stop(); } s_stored_frame_size = s_bitmap.biSizeImage; @@ -219,9 +219,9 @@ void AVIDump::AddFrame(const u8* data, int w, int h) static bool shown_error = false; if ((w != s_bitmap.biWidth || h != s_bitmap.biHeight) && !shown_error) { - PanicAlert("You have resized the window while dumping frames.\n" - "Nothing sane can be done to handle this.\n" - "Your video will likely be broken."); + PanicAlertT("You have resized the window while dumping frames.\n" + "Nothing can be done to handle this properly.\n" + "Your video will likely be broken."); shown_error = true; s_bitmap.biWidth = w; diff --git a/Source/Core/VideoCommon/ImageWrite.cpp b/Source/Core/VideoCommon/ImageWrite.cpp index 8c5284eb57..38ca509c3e 100644 --- a/Source/Core/VideoCommon/ImageWrite.cpp +++ b/Source/Core/VideoCommon/ImageWrite.cpp @@ -43,7 +43,7 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid File::IOFile fp(filename, "wb"); if (!fp.IsOpen()) { - PanicAlert("Screenshot failed: Could not open file %s %d\n", filename.c_str(), errno); + PanicAlertT("Screenshot failed: Could not open file \"%s\" (error %d)", filename.c_str(), errno); goto finalise; } @@ -51,23 +51,22 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); if (png_ptr == nullptr) { - PanicAlert("Screenshot failed: Could not allocate write struct\n"); + PanicAlert("Screenshot failed: Could not allocate write struct"); goto finalise; - } // Initialize info structure info_ptr = png_create_info_struct(png_ptr); if (info_ptr == nullptr) { - PanicAlert("Screenshot failed: Could not allocate info struct\n"); + PanicAlert("Screenshot failed: Could not allocate info struct"); goto finalise; } // Setup Exception handling if (setjmp(png_jmpbuf(png_ptr))) { - PanicAlert("Screenshot failed: Error during png creation\n"); + PanicAlert("Screenshot failed: Error during PNG creation"); goto finalise; }