Commit d38caa48 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

Added winemine debug channel.

parent 7371c3c5
...@@ -26,12 +26,9 @@ ...@@ -26,12 +26,9 @@
#include "dialog.h" #include "dialog.h"
#include "resource.h" #include "resource.h"
#ifdef DUMB_DEBUG #include <wine/debug.h>
#include <stdio.h>
#define DEBUG(x) fprintf(stderr,x) WINE_DEFAULT_DEBUG_CHANNEL(winemine);
#else
#define DEBUG(x)
#endif
static const DWORD wnd_style = WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX; static const DWORD wnd_style = WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX;
static const char* registry_key = "Software\\Wine\\WineMine"; static const char* registry_key = "Software\\Wine\\WineMine";
...@@ -100,7 +97,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -100,7 +97,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
HDC hMemDC; HDC hMemDC;
DEBUG("WM_PAINT\n"); WINE_TRACE("WM_PAINT\n");
hdc = BeginPaint( hWnd, &ps ); hdc = BeginPaint( hWnd, &ps );
hMemDC = CreateCompatibleDC( hdc ); hMemDC = CreateCompatibleDC( hdc );
...@@ -113,7 +110,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -113,7 +110,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
} }
case WM_MOVE: case WM_MOVE:
DEBUG("WM_MOVE\n"); WINE_TRACE("WM_MOVE\n");
board.pos.x = GET_X_LPARAM(lParam); board.pos.x = GET_X_LPARAM(lParam);
board.pos.y = GET_Y_LPARAM(lParam); board.pos.y = GET_Y_LPARAM(lParam);
return 0; return 0;
...@@ -133,7 +130,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -133,7 +130,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
DEBUG("WM_LBUTTONDOWN\n"); WINE_TRACE("WM_LBUTTONDOWN\n");
if( wParam & MK_RBUTTON ) if( wParam & MK_RBUTTON )
msg = WM_MBUTTONDOWN; msg = WM_MBUTTONDOWN;
TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
...@@ -141,7 +138,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -141,7 +138,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_LBUTTONUP: case WM_LBUTTONUP:
DEBUG("WM_LBUTTONUP\n"); WINE_TRACE("WM_LBUTTONUP\n");
if( wParam & MK_RBUTTON ) if( wParam & MK_RBUTTON )
msg = WM_MBUTTONUP; msg = WM_MBUTTONUP;
TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
...@@ -149,7 +146,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -149,7 +146,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
DEBUG("WM_RBUTTONDOWN\n"); WINE_TRACE("WM_RBUTTONDOWN\n");
if( wParam & MK_LBUTTON ) { if( wParam & MK_LBUTTON ) {
board.press.x = 0; board.press.x = 0;
board.press.y = 0; board.press.y = 0;
...@@ -159,19 +156,19 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -159,19 +156,19 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_RBUTTONUP: case WM_RBUTTONUP:
DEBUG("WM_RBUTTONUP\n"); WINE_TRACE("WM_RBUTTONUP\n");
if( wParam & MK_LBUTTON ) if( wParam & MK_LBUTTON )
msg = WM_MBUTTONUP; msg = WM_MBUTTONUP;
TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
return 0; return 0;
case WM_MBUTTONDOWN: case WM_MBUTTONDOWN:
DEBUG("WM_MBUTTONDOWN\n"); WINE_TRACE("WM_MBUTTONDOWN\n");
TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
return 0; return 0;
case WM_MBUTTONUP: case WM_MBUTTONUP:
DEBUG("WM_MBUTTONUP\n"); WINE_TRACE("WM_MBUTTONUP\n");
TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
return 0; return 0;
...@@ -240,7 +237,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -240,7 +237,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
DialogBox( board.hInst, "DLG_ABOUT", hWnd, AboutDlgProc ); DialogBox( board.hInst, "DLG_ABOUT", hWnd, AboutDlgProc );
return 0; return 0;
default: default:
DEBUG("Unknown WM_COMMAND command message received\n"); WINE_TRACE("Unknown WM_COMMAND command message received\n");
break; break;
} }
} }
...@@ -662,7 +659,7 @@ void DrawMine( HDC hdc, HDC hMemDC, BOARD *p_board, unsigned col, unsigned row, ...@@ -662,7 +659,7 @@ void DrawMine( HDC hdc, HDC hMemDC, BOARD *p_board, unsigned col, unsigned row,
/* Do nothing */ /* Do nothing */
break; break;
default: default:
DEBUG("Unknown FlagType during game over in DrawMine\n"); WINE_TRACE("Unknown FlagType during game over in DrawMine\n");
break; break;
} }
} }
...@@ -687,7 +684,7 @@ void DrawMine( HDC hdc, HDC hMemDC, BOARD *p_board, unsigned col, unsigned row, ...@@ -687,7 +684,7 @@ void DrawMine( HDC hdc, HDC hMemDC, BOARD *p_board, unsigned col, unsigned row,
/* Do nothing */ /* Do nothing */
break; break;
default: default:
DEBUG("Unknown FlagType while playing in DrawMine\n"); WINE_TRACE("Unknown FlagType while playing in DrawMine\n");
break; break;
} }
} }
...@@ -890,7 +887,7 @@ void TestMines( BOARD *p_board, POINT pt, int msg ) ...@@ -890,7 +887,7 @@ void TestMines( BOARD *p_board, POINT pt, int msg )
p_board->status = PLAYING; p_board->status = PLAYING;
break; break;
default: default:
DEBUG("Unknown message type received in TestMines\n"); WINE_TRACE("Unknown message type received in TestMines\n");
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment