new icon and set on windows, new layout for brush preset

This commit is contained in:
2017-10-02 08:09:40 +01:00
parent 9ec1768acc
commit db55a055fd
9 changed files with 71 additions and 8 deletions

View File

@@ -6,8 +6,7 @@
#include "image.h"
#include "app.h"
#include "keymap.h"
#ifdef _WIN32
#include "../resource.h"
#pragma comment (lib, "opengl32.lib")
#pragma comment (lib, "glew32.lib")
@@ -158,7 +157,7 @@ static void SetupExceptionHandler()
//
// PCTSTR pszLogFileName = BT_GetLogFileName(g_iLogHandle);
TCHAR wpath[1024];
GetFullPathNameW(L"log.txt", 1024, wpath, nullptr);
GetFullPathNameW(L"panopainter-log.txt", 1024, wpath, nullptr);
BT_AddLogFile(wpath);
BT_SetPreErrHandler([](INT_PTR){
@@ -166,7 +165,7 @@ static void SetupExceptionHandler()
}, 0);
}
int main()
int main(int argc, char** argv)
{
WNDCLASS wc;
PIXELFORMATDESCRIPTOR pfd;
@@ -200,7 +199,7 @@ int main()
RegisterClass(&wc);
AdjustWindowRect(&clientRect, WS_OVERLAPPEDWINDOW, false);
hWnd = CreateWindow(wc.lpszClassName, L"New Engine", WS_OVERLAPPEDWINDOW,
hWnd = CreateWindow(wc.lpszClassName, L"PanoPainter", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, clientRect.right - clientRect.left,
clientRect.bottom - clientRect.top, 0, 0, hInst, 0);
@@ -279,6 +278,9 @@ int main()
ShowWindow(hWnd, SW_NORMAL);
WacomTablet::I.init(hWnd);
SendMessage(hWnd, WM_SETICON, ICON_SMALL,
(LPARAM)LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(IDI_ICON1)));
MSG msg;
bool running = true;
unsigned long t0 = GetTickCount();
@@ -514,4 +516,29 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
return DefWindowProc(hWnd, msg, wp, lp);
}
#endif
int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine, _In_ int nShowCmd)
{
LPWSTR *szArgList{ nullptr };
int argc{ 0 };
char** argv{ nullptr };
szArgList = CommandLineToArgvW(GetCommandLine(), &argc);
if (szArgList == NULL)
{
MessageBox(NULL, L"Unable to parse command line", L"Error", MB_OK);
return 10;
}
argv = new char*[argc + 1];
for (int i = 0; i < argc; i++)
{
auto len = wcslen(szArgList[i]) + 1;
argv[i] = new char[len];
wcstombs_s(nullptr, argv[i], len, szArgList[i], len);
}
LocalFree(szArgList);
return main(argc, argv);
}