Add a new type of message box (CRITICAL style) which can not be disabled. Then use that message box to display shader compilation errors in the OpenGL backend to maintain consistency with the behaviour of the DirectX backends.
Also fix the wxMessageAlert called from non-gui threads in the WXGTK build to use the passed caption. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7678 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
a154df1e7c
commit
a5a45992ad
|
@ -6,8 +6,8 @@ CPP_FILE_LIST=$(find $SRCDIR \( -name '*.cpp' -o -name '*.h' -o -name '*.c' \) \
|
||||||
-a ! -path '*Debug*')
|
-a ! -path '*Debug*')
|
||||||
xgettext -d dolphin-emu -s --keyword=_ --keyword=wxTRANSLATE --keyword=SuccessAlertT \
|
xgettext -d dolphin-emu -s --keyword=_ --keyword=wxTRANSLATE --keyword=SuccessAlertT \
|
||||||
--keyword=PanicAlertT --keyword=PanicYesNoT --keyword=AskYesNoT --keyword=_trans \
|
--keyword=PanicAlertT --keyword=PanicYesNoT --keyword=AskYesNoT --keyword=_trans \
|
||||||
--add-comments=i18n -p ./Languages/po -o dolphin-emu.pot $CPP_FILE_LIST \
|
--keyword=CriticalAlertT --add-comments=i18n -p ./Languages/po -o dolphin-emu.pot \
|
||||||
--package-name="Dolphin Emu"
|
$CPP_FILE_LIST --package-name="Dolphin Emu"
|
||||||
|
|
||||||
POTFILE=./Languages/po/dolphin-emu.pot
|
POTFILE=./Languages/po/dolphin-emu.pot
|
||||||
PO_FILES=$(find ./Languages/po -name '*.po')
|
PO_FILES=$(find ./Languages/po -name '*.po')
|
||||||
|
|
|
@ -58,12 +58,14 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...)
|
||||||
static std::string info_caption;
|
static std::string info_caption;
|
||||||
static std::string warn_caption;
|
static std::string warn_caption;
|
||||||
static std::string ques_caption;
|
static std::string ques_caption;
|
||||||
|
static std::string crit_caption;
|
||||||
|
|
||||||
if (!info_caption.length())
|
if (!info_caption.length())
|
||||||
{
|
{
|
||||||
info_caption = str_translator(_trans("Information"));
|
info_caption = str_translator(_trans("Information"));
|
||||||
ques_caption = str_translator(_trans("Question"));
|
ques_caption = str_translator(_trans("Question"));
|
||||||
warn_caption = str_translator(_trans("Warning"));
|
warn_caption = str_translator(_trans("Warning"));
|
||||||
|
crit_caption = str_translator(_trans("Critical"));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(Style)
|
switch(Style)
|
||||||
|
@ -77,6 +79,9 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...)
|
||||||
case WARNING:
|
case WARNING:
|
||||||
caption = warn_caption;
|
caption = warn_caption;
|
||||||
break;
|
break;
|
||||||
|
case CRITICAL:
|
||||||
|
caption = crit_caption;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
|
@ -87,7 +92,7 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...)
|
||||||
ERROR_LOG(MASTER_LOG, "%s: %s", caption.c_str(), buffer);
|
ERROR_LOG(MASTER_LOG, "%s: %s", caption.c_str(), buffer);
|
||||||
|
|
||||||
// Don't ignore questions, especially AskYesNo, PanicYesNo could be ignored
|
// Don't ignore questions, especially AskYesNo, PanicYesNo could be ignored
|
||||||
if (msg_handler && (AlertEnabled || Style == QUESTION))
|
if (msg_handler && (AlertEnabled || Style == QUESTION || Style == CRITICAL))
|
||||||
return msg_handler(caption.c_str(), buffer, yes_no, Style);
|
return msg_handler(caption.c_str(), buffer, yes_no, Style);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -26,6 +26,7 @@ enum MSG_TYPE
|
||||||
INFORMATION,
|
INFORMATION,
|
||||||
QUESTION,
|
QUESTION,
|
||||||
WARNING,
|
WARNING,
|
||||||
|
CRITICAL
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef bool (*MsgAlertHandler)(const char* caption, const char* text,
|
typedef bool (*MsgAlertHandler)(const char* caption, const char* text,
|
||||||
|
@ -58,11 +59,13 @@ void SetEnableAlert(bool enable);
|
||||||
#define PanicAlert(format, ...) MsgAlert(false, WARNING, format, ##__VA_ARGS__)
|
#define PanicAlert(format, ...) MsgAlert(false, WARNING, format, ##__VA_ARGS__)
|
||||||
#define PanicYesNo(format, ...) MsgAlert(true, WARNING, format, ##__VA_ARGS__)
|
#define PanicYesNo(format, ...) MsgAlert(true, WARNING, format, ##__VA_ARGS__)
|
||||||
#define AskYesNo(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__)
|
#define AskYesNo(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__)
|
||||||
|
#define CriticalAlert(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__)
|
||||||
// Use these macros (that do the same thing) if the message should be translated.
|
// Use these macros (that do the same thing) if the message should be translated.
|
||||||
#define SuccessAlertT(format, ...) MsgAlert(false, INFORMATION, format, ##__VA_ARGS__)
|
#define SuccessAlertT(format, ...) MsgAlert(false, INFORMATION, format, ##__VA_ARGS__)
|
||||||
#define PanicAlertT(format, ...) MsgAlert(false, WARNING, format, ##__VA_ARGS__)
|
#define PanicAlertT(format, ...) MsgAlert(false, WARNING, format, ##__VA_ARGS__)
|
||||||
#define PanicYesNoT(format, ...) MsgAlert(true, WARNING, format, ##__VA_ARGS__)
|
#define PanicYesNoT(format, ...) MsgAlert(true, WARNING, format, ##__VA_ARGS__)
|
||||||
#define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__)
|
#define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__)
|
||||||
|
#define CriticalAlertT(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
// GEKKO
|
// GEKKO
|
||||||
|
|
|
@ -642,9 +642,13 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
case IDM_PANIC:
|
case IDM_PANIC:
|
||||||
bPanicResult = (wxYES == wxMessageBox(event.GetString(),
|
{
|
||||||
_("Warning"), event.GetInt() ? wxYES_NO : wxOK, wxGetActiveWindow()));
|
wxString caption = event.GetString().BeforeFirst(':');
|
||||||
|
wxString text = event.GetString().AfterFirst(':');
|
||||||
|
bPanicResult = (wxYES == wxMessageBox(text,
|
||||||
|
caption, event.GetInt() ? wxYES_NO : wxOK, wxGetActiveWindow()));
|
||||||
panic_event.Set();
|
panic_event.Set();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -416,7 +416,7 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_PANIC);
|
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_PANIC);
|
||||||
event.SetString(wxString::FromUTF8(text));
|
event.SetString(wxString::FromUTF8(caption) + wxT(":") + wxString::FromUTF8(text));
|
||||||
event.SetInt(yes_no);
|
event.SetInt(yes_no);
|
||||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||||
main_frame->panic_event.Wait();
|
main_frame->panic_event.Wait();
|
||||||
|
|
|
@ -255,10 +255,16 @@ bool PixelShaderCache::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrpr
|
||||||
CGprogram tempprog = cgCreateProgram(g_cgcontext, CG_SOURCE, pstrprogram, g_cgfProf, "main", opts);
|
CGprogram tempprog = cgCreateProgram(g_cgcontext, CG_SOURCE, pstrprogram, g_cgfProf, "main", opts);
|
||||||
|
|
||||||
// handle errors
|
// handle errors
|
||||||
if (!cgIsProgram(tempprog)) {
|
if (!cgIsProgram(tempprog))
|
||||||
|
{
|
||||||
cgDestroyProgram(tempprog);
|
cgDestroyProgram(tempprog);
|
||||||
ERROR_LOG(VIDEO, "Failed to compile ps %s:", cgGetLastListing(g_cgcontext));
|
if (g_ActiveConfig.bShowShaderErrors)
|
||||||
ERROR_LOG(VIDEO, "%s", pstrprogram);
|
{
|
||||||
|
std::string message = cgGetLastListing(g_cgcontext);
|
||||||
|
message += "\n\n";
|
||||||
|
message += pstrprogram;
|
||||||
|
CriticalAlertT("Failed to compile ps %s", message.c_str());
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +279,8 @@ bool PixelShaderCache::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrpr
|
||||||
// It SHOULD not have any nasty side effects though - but you never know...
|
// It SHOULD not have any nasty side effects though - but you never know...
|
||||||
char *pcompiledprog = (char*)cgGetProgramString(tempprog, CG_COMPILED_PROGRAM);
|
char *pcompiledprog = (char*)cgGetProgramString(tempprog, CG_COMPILED_PROGRAM);
|
||||||
char *plocal = strstr(pcompiledprog, "program.local");
|
char *plocal = strstr(pcompiledprog, "program.local");
|
||||||
while (plocal != NULL) {
|
while (plocal != NULL)
|
||||||
|
{
|
||||||
const char *penv = " program.env";
|
const char *penv = " program.env";
|
||||||
memcpy(plocal, penv, 13);
|
memcpy(plocal, penv, 13);
|
||||||
plocal = strstr(plocal+13, "program.local");
|
plocal = strstr(plocal+13, "program.local");
|
||||||
|
|
|
@ -78,7 +78,7 @@ void CreateRgbToYuyvProgram()
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram))
|
if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram))
|
||||||
PanicAlertT("Failed to create RGB to YUYV fragment program\nReport this issue.");
|
ERROR_LOG(VIDEO, "Failed to create RGB to YUYV fragment program.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateYuyvToRgbProgram()
|
void CreateYuyvToRgbProgram()
|
||||||
|
@ -104,7 +104,7 @@ void CreateYuyvToRgbProgram()
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram))
|
if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram))
|
||||||
PanicAlertT("Failed to create YUYV to RGB fragment program\nReport this issue.");
|
ERROR_LOG(VIDEO, "Failed to create YUYV to RGB fragment program.");
|
||||||
}
|
}
|
||||||
|
|
||||||
FRAGMENTSHADER &GetOrCreateEncodingShader(u32 format)
|
FRAGMENTSHADER &GetOrCreateEncodingShader(u32 format)
|
||||||
|
|
Loading…
Reference in New Issue