diff --git a/CMakeLists.txt b/CMakeLists.txt index fe099ef..ec7eb9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,8 @@ endif() ############################################################################## +add_definitions(-D__STDC__=1 -D_USE_MATH_DEFINES) + subdirs(mojiben1 mojiben2 mojiben3 mojiben4) ############################################################################## diff --git a/mojiben2/mojiben2.cpp b/mojiben2/mojiben2.cpp index 9daa294..9fa278e 100644 --- a/mojiben2/mojiben2.cpp +++ b/mojiben2/mojiben2.cpp @@ -365,14 +365,14 @@ unsigned __stdcall ThreadProc( void * ) sint = sin(v[i].angle0 * M_PI / 180); for(k = -200; k < 200; k += 30) { - apt[0].x = 150 + k * cost + 150 * sint; - apt[0].y = 150 + k * sint - 150 * cost; - apt[1].x = 150 + k * cost - 150 * sint; - apt[1].y = 150 + k * sint + 150 * cost; - apt[2].x = 150 + (k + 30) * cost - 150 * sint; - apt[2].y = 150 + (k + 30) * sint + 150 * cost; - apt[3].x = 150 + (k + 30) * cost + 150 * sint; - apt[3].y = 150 + (k + 30) * sint - 150 * cost; + apt[0].x = LONG(150 + k * cost + 150 * sint); + apt[0].y = LONG(150 + k * sint - 150 * cost); + apt[1].x = LONG(150 + k * cost - 150 * sint); + apt[1].y = LONG(150 + k * sint + 150 * cost); + apt[2].x = LONG(150 + (k + 30) * cost - 150 * sint); + apt[2].y = LONG(150 + (k + 30) * sint + 150 * cost); + apt[3].x = LONG(150 + (k + 30) * cost + 150 * sint); + apt[3].y = LONG(150 + (k + 30) * sint - 150 * cost); BeginPath(hdcMem); Polygon(hdcMem, apt, 4); EndPath(hdcMem); @@ -400,14 +400,14 @@ unsigned __stdcall ThreadProc( void * ) FillRgn(hdcMem, hRgn, (HBRUSH)GetStockObject(BLACK_BRUSH)); - apt[0].x = 150 + k * cost + 150 * sint; - apt[0].y = 150 + k * sint - 150 * cost; - apt[1].x = 150 + k * cost - 150 * sint; - apt[1].y = 150 + k * sint + 150 * cost; - apt[2].x = 150 + (k + 30) * cost - 150 * sint; - apt[2].y = 150 + (k + 30) * sint + 150 * cost; - apt[3].x = 150 + (k + 30) * cost + 150 * sint; - apt[3].y = 150 + (k + 30) * sint - 150 * cost; + apt[0].x = LONG(150 + k * cost + 150 * sint); + apt[0].y = LONG(150 + k * sint - 150 * cost); + apt[1].x = LONG(150 + k * cost - 150 * sint); + apt[1].y = LONG(150 + k * sint + 150 * cost); + apt[2].x = LONG(150 + (k + 30) * cost - 150 * sint); + apt[2].y = LONG(150 + (k + 30) * sint + 150 * cost); + apt[3].x = LONG(150 + (k + 30) * cost + 150 * sint); + apt[3].y = LONG(150 + (k + 30) * sint - 150 * cost); BeginPath(hdcMem); Polygon(hdcMem, apt, 4); EndPath(hdcMem); @@ -474,10 +474,10 @@ unsigned __stdcall ThreadProc( void * ) FillRgn(hdcMem, hRgn, (HBRUSH)GetStockObject(BLACK_BRUSH)); - apt[0].x = v[i].cx + 200 * cost; - apt[0].y = v[i].cy + 200 * sint; - apt[1].x = v[i].cx + 200 * cost2; - apt[1].y = v[i].cy + 200 * sint2; + apt[0].x = LONG(v[i].cx + 200 * cost); + apt[0].y = LONG(v[i].cy + 200 * sint); + apt[1].x = LONG(v[i].cx + 200 * cost2); + apt[1].y = LONG(v[i].cy + 200 * sint2); apt[2].x = v[i].cx; apt[2].y = v[i].cy; BeginPath(hdcMem); @@ -520,10 +520,10 @@ unsigned __stdcall ThreadProc( void * ) FillRgn(hdcMem, hRgn, (HBRUSH)GetStockObject(BLACK_BRUSH)); - apt[0].x = v[i].cx + 200 * cost; - apt[0].y = v[i].cy + 200 * sint; - apt[1].x = v[i].cx + 200 * cost2; - apt[1].y = v[i].cy + 200 * sint2; + apt[0].x = LONG(v[i].cx + 200 * cost); + apt[0].y = LONG(v[i].cy + 200 * sint); + apt[1].x = LONG(v[i].cx + 200 * cost2); + apt[1].y = LONG(v[i].cy + 200 * sint2); apt[2].x = v[i].cx; apt[2].y = v[i].cy; BeginPath(hdcMem); @@ -752,9 +752,6 @@ void Kakijun_OnPaint(HWND hwnd) LRESULT CALLBACK KakijunWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - HDC hdc; - PAINTSTRUCT ps; - switch(uMsg) { HANDLE_MSG(hwnd, WM_ERASEBKGND, Kakijun_OnEraseBkgnd); diff --git a/mojiben3/mojiben3.cpp b/mojiben3/mojiben3.cpp index 80a570d..e6b85e1 100644 --- a/mojiben3/mojiben3.cpp +++ b/mojiben3/mojiben3.cpp @@ -654,9 +654,6 @@ void Kakijun_OnDestroy(HWND hwnd) LRESULT CALLBACK KakijunWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - HDC hdc; - PAINTSTRUCT ps; - switch (uMsg) { HANDLE_MSG(hwnd, WM_CREATE, Kakijun_OnCreate); diff --git a/mojiben4/mojiben4.cpp b/mojiben4/mojiben4.cpp index c7c8a55..e480381 100644 --- a/mojiben4/mojiben4.cpp +++ b/mojiben4/mojiben4.cpp @@ -709,9 +709,6 @@ void Kakijun_OnDestroy(HWND hwnd) LRESULT CALLBACK KakijunWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - HDC hdc; - PAINTSTRUCT ps; - switch (uMsg) { HANDLE_MSG(hwnd, WM_CREATE, Kakijun_OnCreate);