This commit is contained in:
2017-05-29 13:01:15 +01:00
19 changed files with 170 additions and 26 deletions

View File

@@ -130,6 +130,42 @@ int read_WMI_info()
return 0;
}
INT_PTR g_iLogHandle = -1;
static void SetupExceptionHandler()
{
// Setup exception handler
BT_SetAppName(_T("PanoPainter"));
//BT_SetSupportEMail(_T("your@email.com"));
BT_SetFlags(BTF_DETAILEDMODE | BTF_ATTACHREPORT | BTF_SCREENCAPTURE);
// = BugTrapServer ===========================================
BT_SetSupportServer(_T("omigamedev.ddns.net"), 8088);
// - or -
//BT_SetSupportServer(_T("127.0.0.1"), 9999);
// = BugTrapWebServer ========================================
//BT_SetSupportServer(_T("http://localhost/BugTrapWebServer/RequestHandler.aspx"), BUGTRAP_HTTP_PORT);
//BT_SetSupportServer(_T("http://omigamedev.ddns.net:8088/source/Server/BugTrapWebServer/RequestHandler.aspx"), BUGTRAP_HTTP_PORT);
// required for VS 2005 & 2008
BT_InstallSehFilter();
// Add custom log file using default name
// g_iLogHandle = BT_OpenLogFile(NULL, BTLF_TEXT);
// BT_SetLogSizeInEntries(g_iLogHandle, 100);
// BT_SetLogFlags(g_iLogHandle, BTLF_SHOWTIMESTAMP);
// BT_SetLogEchoMode(g_iLogHandle, BTLE_STDERR | BTLE_DBGOUT);
//
// PCTSTR pszLogFileName = BT_GetLogFileName(g_iLogHandle);
TCHAR wpath[1024];
GetFullPathNameW(L"log.txt", 1024, wpath, nullptr);
BT_AddLogFile(wpath);
BT_SetPreErrHandler([](INT_PTR){
LogRemote::I.file_close();
}, 0);
}
int main()
{
WNDCLASS wc;
@@ -137,6 +173,9 @@ int main()
App::I.initLog();
SetupExceptionHandler();
BT_SetTerminate();
read_WMI_info();
App::I.create();
@@ -281,6 +320,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
{
switch (msg)
{
case WM_CREATE:
BT_SetTerminate();
break;
case WM_CLOSE:
PostQuitMessage(0);
break;
@@ -299,10 +341,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
case WT_PACKET:
WacomTablet::I.handle_message(hWnd, msg, wp, lp);
break;
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
keys[wp] = true;
App::I.key_down(convert_key((int)wp));
break;
case WM_SYSKEYUP:
case WM_KEYUP:
keys[wp] = false;
App::I.key_up(convert_key((int)wp));
@@ -318,6 +362,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
SetCapture(hWnd);
break;
case WM_LBUTTONUP:
WacomTablet::I.reset_pressure();
App::I.mouse_up(0, (float)GET_X_LPARAM(lp), (float)GET_Y_LPARAM(lp));
ReleaseCapture();
break;