Roll back the win/win32 tree to the way it was before x64 attempt

This commit is contained in:
nhmall
2015-02-26 22:09:31 -05:00
parent 18ca81d963
commit e1dfe9c48a
12 changed files with 141 additions and 163 deletions

View File

@@ -18,20 +18,15 @@ struct getlin_data {
size_t result_size;
};
#ifdef _M_X64
INT_PTR
#else
BOOL
#endif
CALLBACK GetlinDlgProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK GetlinDlgProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR mswin_getlin_window (
int mswin_getlin_window (
const char *question,
char *result,
size_t result_size
)
{
INT_PTR ret;
int ret;
struct getlin_data data;
/* initilize dialog data */
@@ -53,12 +48,7 @@ INT_PTR mswin_getlin_window (
return ret;
}
#ifdef _M_X64
INT_PTR
#else
BOOL
#endif
CALLBACK GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
BOOL CALLBACK GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct getlin_data* data;
RECT main_rt, dlg_rt;
@@ -78,7 +68,7 @@ CALLBACK GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
case WM_INITDIALOG:
data = (struct getlin_data*)lParam;
SetWindowText(hWnd, NH_A2W(data->question, wbuf, sizeof(wbuf)));
SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam);
SetWindowLong(hWnd, GWL_USERDATA, lParam);
/* center dialog in the main window */
GetWindowRect(hWnd, &dlg_rt);
@@ -152,7 +142,7 @@ CALLBACK GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
{
/* OK button was pressed */
case IDOK:
data = (struct getlin_data*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (struct getlin_data*)GetWindowLong(hWnd, GWL_USERDATA);
SendDlgItemMessage(hWnd, IDC_GETLIN_EDIT, WM_GETTEXT, (WPARAM)sizeof(wbuf), (LPARAM)wbuf );
NH_W2A(wbuf, data->result, data->result_size);
@@ -176,16 +166,11 @@ struct extcmd_data {
int* selection;
};
#ifdef _M_X64
INT_PTR
#else
BOOL
#endif
CALLBACK ExtCmdDlgProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK ExtCmdDlgProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR mswin_ext_cmd_window (int* selection)
int mswin_ext_cmd_window (int* selection)
{
INT_PTR ret;
int ret;
struct extcmd_data data;
/* init dialog data */
@@ -205,13 +190,7 @@ INT_PTR mswin_ext_cmd_window (int* selection)
return ret;
}
#ifdef _M_X64
INT_PTR
#else
BOOL
#endif
CALLBACK ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
BOOL CALLBACK ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct extcmd_data* data;
RECT main_rt, dlg_rt;
@@ -224,7 +203,7 @@ CALLBACK ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
{
case WM_INITDIALOG:
data = (struct extcmd_data*)lParam;
SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam);
SetWindowLong(hWnd, GWL_USERDATA, lParam);
/* center dialog in the main window */
GetWindowRect(GetNHApp()->hMainWnd, &main_rt);
@@ -256,12 +235,12 @@ CALLBACK ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
break;
case WM_COMMAND:
data = (struct extcmd_data*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (struct extcmd_data*)GetWindowLong(hWnd, GWL_USERDATA);
switch (LOWORD(wParam))
{
/* OK button ws clicked */
case IDOK:
*data->selection = (int)SendDlgItemMessage(hWnd, IDC_EXTCMD_LIST, LB_GETCURSEL, (WPARAM)0, (LPARAM)0 );
*data->selection = SendDlgItemMessage(hWnd, IDC_EXTCMD_LIST, LB_GETCURSEL, (WPARAM)0, (LPARAM)0 );
if( *data->selection==LB_ERR )
*data->selection = -1;
/* Fall through. */
@@ -283,7 +262,7 @@ CALLBACK ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
lParam
Handle to the list box
*/
*data->selection = (int)SendMessage((HWND)lParam, LB_GETCURSEL, (WPARAM)0, (LPARAM)0);
*data->selection = SendMessage((HWND)lParam, LB_GETCURSEL, (WPARAM)0, (LPARAM)0);
if( *data->selection==LB_ERR )
*data->selection = -1;
EndDialog(hWnd, IDOK);
@@ -301,19 +280,14 @@ struct plsel_data {
int* selection;
};
#ifdef _M_X64
INT_PTR
#else
BOOL
#endif
CALLBACK PlayerSelectorDlgProc(HWND, UINT, WPARAM, LONG_PTR);
BOOL CALLBACK PlayerSelectorDlgProc(HWND, UINT, WPARAM, LPARAM);
static void plselInitDialog(HWND hWnd);
static void plselAdjustLists(HWND hWnd, int changed_opt);
static int plselFinalSelection(HWND hWnd, int* selection);
INT_PTR mswin_player_selection_window ( int* selection )
int mswin_player_selection_window ( int* selection )
{
INT_PTR ret;
int ret;
struct plsel_data data;
/* init dialog data */
@@ -333,12 +307,7 @@ static int plselFinalSelection(HWND hWnd, int* selection);
return ret;
}
#ifdef _M_X64
INT_PTR
#else
BOOL
#endif
CALLBACK PlayerSelectorDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
BOOL CALLBACK PlayerSelectorDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct plsel_data* data;
RECT main_rt, dlg_rt;
@@ -348,7 +317,7 @@ CALLBACK PlayerSelectorDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR
{
case WM_INITDIALOG:
data = (struct plsel_data*)lParam;
SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam);
SetWindowLong(hWnd, GWL_USERDATA, lParam);
/* center dialog in the main window */
GetWindowRect(GetNHApp()->hMainWnd, &main_rt);
@@ -378,7 +347,7 @@ CALLBACK PlayerSelectorDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR
break;
case WM_COMMAND:
data = (struct plsel_data*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (struct plsel_data*)GetWindowLong(hWnd, GWL_USERDATA);
switch (LOWORD(wParam)) {
/* OK button was clicked */
@@ -472,7 +441,7 @@ CALLBACK PlayerSelectorDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR
void setComboBoxValue(HWND hWnd, int combo_box, int value)
{
int index_max = (int)SendDlgItemMessage(hWnd, combo_box, CB_GETCOUNT, 0, 0);
int index_max = SendDlgItemMessage(hWnd, combo_box, CB_GETCOUNT, 0, 0);
int index;
int value_to_set = LB_ERR;
for (index = 0; index < index_max; index++) {
@@ -561,7 +530,7 @@ void plselAdjustLists(HWND hWnd, int changed_sel)
HWND control_role, control_race, control_gender, control_align;
int initrole, initrace, initgend, initalign;
int i;
LRESULT ind;
int ind;
int valid_opt;
TCHAR wbuf[255];
@@ -573,16 +542,16 @@ void plselAdjustLists(HWND hWnd, int changed_sel)
/* get current selections */
ind = SendMessage(control_role, CB_GETCURSEL, 0, 0);
initrole = (ind==LB_ERR)? flags.initrole : (int)SendMessage(control_role, CB_GETITEMDATA, ind, 0);
initrole = (ind==LB_ERR)? flags.initrole : SendMessage(control_role, CB_GETITEMDATA, ind, 0);
ind = SendMessage(control_race, CB_GETCURSEL, 0, 0);
initrace = (ind==LB_ERR)? flags.initrace : (int)SendMessage(control_race, CB_GETITEMDATA, ind, 0);
initrace = (ind==LB_ERR)? flags.initrace : SendMessage(control_race, CB_GETITEMDATA, ind, 0);
ind = SendMessage(control_gender, CB_GETCURSEL, 0, 0);
initgend = (ind==LB_ERR)? flags.initgend : (int)SendMessage(control_gender, CB_GETITEMDATA, ind, 0);
initgend = (ind==LB_ERR)? flags.initgend : SendMessage(control_gender, CB_GETITEMDATA, ind, 0);
ind = SendMessage(control_align, CB_GETCURSEL, 0, 0);
initalign = (ind==LB_ERR)? flags.initalign : (int)SendMessage(control_align, CB_GETITEMDATA, ind, 0);
initalign = (ind==LB_ERR)? flags.initalign : SendMessage(control_align, CB_GETITEMDATA, ind, 0);
/* intialize roles list */
if( changed_sel==-1 ) {
@@ -702,35 +671,35 @@ void plselAdjustLists(HWND hWnd, int changed_sel)
/* player made up his mind - get final selection here */
int plselFinalSelection(HWND hWnd, int* selection)
{
LRESULT ind;
int ind;
/* get current selections */
if( SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_RANDOM, BM_GETCHECK, 0, 0)==BST_CHECKED ) {
flags.initrole = ROLE_RANDOM;
} else {
ind = SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_LIST, CB_GETCURSEL, 0, 0);
flags.initrole = (ind==LB_ERR)? ROLE_RANDOM : (int)SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_LIST, CB_GETITEMDATA, ind, 0);
flags.initrole = (ind==LB_ERR)? ROLE_RANDOM : SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_LIST, CB_GETITEMDATA, ind, 0);
}
if( SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_RANDOM, BM_GETCHECK, 0, 0)==BST_CHECKED ) {
flags.initrace = ROLE_RANDOM;
} else {
ind = SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_LIST, CB_GETCURSEL, 0, 0);
flags.initrace = (ind==LB_ERR)? ROLE_RANDOM : (int)SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_LIST, CB_GETITEMDATA, ind, 0);
flags.initrace = (ind==LB_ERR)? ROLE_RANDOM : SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_LIST, CB_GETITEMDATA, ind, 0);
}
if( SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_RANDOM, BM_GETCHECK, 0, 0)==BST_CHECKED ) {
flags.initgend = ROLE_RANDOM;
} else {
ind = SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_LIST, CB_GETCURSEL, 0, 0);
flags.initgend = (ind==LB_ERR)? ROLE_RANDOM : (int)SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_LIST, CB_GETITEMDATA, ind, 0);
flags.initgend = (ind==LB_ERR)? ROLE_RANDOM : SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_LIST, CB_GETITEMDATA, ind, 0);
}
if( SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_RANDOM, BM_GETCHECK, 0, 0)==BST_CHECKED ) {
flags.initalign = ROLE_RANDOM;
} else {
ind = SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_LIST, CB_GETCURSEL, 0, 0);
flags.initalign = (ind==LB_ERR)? ROLE_RANDOM : (int)SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_LIST, CB_GETITEMDATA, ind, 0);
flags.initalign = (ind==LB_ERR)? ROLE_RANDOM : SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_LIST, CB_GETITEMDATA, ind, 0);
}

View File

@@ -9,9 +9,9 @@
#include "config.h"
#include "global.h"
INT_PTR mswin_getlin_window (const char *question, char *result, size_t result_size);
INT_PTR mswin_ext_cmd_window (int* selection);
INT_PTR mswin_player_selection_window(int* selection);
int mswin_getlin_window (const char *question, char *result, size_t result_size);
int mswin_ext_cmd_window (int* selection);
int mswin_player_selection_window(int* selection);
#endif /* MSWINDlgWindow_h */

View File

@@ -25,7 +25,7 @@ static TCHAR szMainWindowClass[] = TEXT("MSNHMainWndClass");
static TCHAR szTitle[MAX_LOADSTRING];
extern void mswin_display_splash_window(BOOL);
LRESULT CALLBACK MainWndProc(HWND, UINT, UINT, LPARAM);
LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
static LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
@@ -175,7 +175,7 @@ static const char scanmap[] = { /* ... */
//
// PURPOSE: Processes messages for the main window.
*/
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam)
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PNHMainWindow data;
@@ -187,7 +187,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam
if( !data ) panic("out of memory");
ZeroMemory(data, sizeof(NHMainWindow));
data->mapAcsiiModeSave = MAP_MODE_ASCII12x16;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)data);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
/* update menu items */
CheckMenuItem(
@@ -213,7 +213,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam
case WM_KEYDOWN:
{
data = (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMainWindow)GetWindowLong(hWnd, GWL_USERDATA);
/* translate arrow keys into nethack commands */
switch (wParam)
@@ -524,8 +524,8 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam
WM_QUIT somehow */
/* clean up */
free( (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA) );
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
free( (PNHMainWindow)GetWindowLong(hWnd, GWL_USERDATA) );
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
// PostQuitMessage(0);
exit(1);
@@ -584,7 +584,7 @@ void mswin_layout_main_window(HWND changed_child)
if( GetNHApp()->bAutoLayout ) {
GetClientRect(GetNHApp()->hMainWnd, &client_rt);
data = (PNHMainWindow)GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA);
data = (PNHMainWindow)GetWindowLong(GetNHApp()->hMainWnd, GWL_USERDATA);
/* get sizes of child windows */
wnd_status = mswin_hwnd_from_winid(WIN_STATUS);
@@ -754,7 +754,7 @@ LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
int wmId, wmEvent;
PNHMainWindow data;
data = (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMainWindow)GetWindowLong(hWnd, GWL_USERDATA);
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
@@ -986,8 +986,7 @@ LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
NH_A2W(
COPYRIGHT_BANNER_A "\n"
COPYRIGHT_BANNER_B "\n"
COPYRIGHT_BANNER_C "\n"
COPYRIGHT_BANNER_D,
COPYRIGHT_BANNER_C,
wbuf,
BUFSZ
) );
@@ -1039,7 +1038,7 @@ void mswin_select_map_mode(int mode)
winid map_id;
map_id = WIN_MAP;
data = (PNHMainWindow)GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA);
data = (PNHMainWindow)GetWindowLong(GetNHApp()->hMainWnd, GWL_USERDATA);
/* override for Rogue level */
#ifdef REINCARNATION
@@ -1130,10 +1129,10 @@ void nhlock_windows( BOOL lock )
for( i=0; i<MAXWINDOWS; i++ ) {
if( IsWindow(GetNHApp()->windowlist[i].win) && !GetNHApp()->windowlist[i].dead) {
DWORD style;
style = (DWORD)GetWindowLongPtr(GetNHApp()->windowlist[i].win, GWL_STYLE);
style = GetWindowLong(GetNHApp()->windowlist[i].win, GWL_STYLE);
if( lock ) style &= ~WS_CAPTION;
else style |= WS_CAPTION;
SetWindowLongPtr(GetNHApp()->windowlist[i].win, GWL_STYLE, style);
SetWindowLong(GetNHApp()->windowlist[i].win, GWL_STYLE, style);
SetWindowPos(
GetNHApp()->windowlist[i].win,
NULL,

View File

@@ -106,7 +106,7 @@ void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw)
wnd_size.cy = client_rt.bottom - client_rt.top;
/* set new screen tile size */
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMapWindow)GetWindowLong(hWnd, GWL_USERDATA);
data->xScrTile =
max(1, (data->bFitToScreenMode? wnd_size.cx : lpsz->cx) / COLNO);
data->yScrTile =
@@ -200,7 +200,7 @@ int mswin_map_mode(HWND hWnd, int mode)
int oldMode;
SIZE mapSize;
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMapWindow)GetWindowLong(hWnd, GWL_USERDATA);
if( mode == data->mapMode ) return mode;
oldMode = data->mapMode;
@@ -333,7 +333,7 @@ LRESULT CALLBACK MapWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
{
PNHMapWindow data;
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMapWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch (message)
{
case WM_CREATE:
@@ -412,7 +412,7 @@ LRESULT CALLBACK MapWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
case WM_DESTROY:
if( data->hMapFont ) DeleteObject(data->hMapFont);
free(data);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
break;
default:
@@ -427,7 +427,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
PNHMapWindow data;
RECT rt;
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMapWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch(wParam) {
case MSNH_MSG_PRINT_GLYPH:
{
@@ -575,7 +575,7 @@ void onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
data->xScrTile = GetNHApp()->mapTile_X;
data->yScrTile = GetNHApp()->mapTile_Y;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)data);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
}
/* on WM_PAINT */
@@ -590,7 +590,7 @@ void onPaint(HWND hWnd)
int i, j;
/* get window data */
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMapWindow)GetWindowLong(hWnd, GWL_USERDATA);
hDC = BeginPaint(hWnd, &ps);
@@ -750,7 +750,7 @@ void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
int yDelta;
/* get window data */
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMapWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch(LOWORD (wParam))
{
@@ -808,7 +808,7 @@ void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
int xDelta;
/* get window data */
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMapWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch(LOWORD (wParam))
{

View File

@@ -74,7 +74,7 @@ static WNDPROC editControlWndProc = NULL;
#define NHMENU_IS_SELECTED(item) ((item).count!=0)
#define NHMENU_HAS_GLYPH(item) ((item).glyph!=NO_GLYPH)
LRESULT CALLBACK MenuWndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK MenuWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK NHMenuListWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK NHMenuTextWndProc(HWND, UINT, WPARAM, LPARAM);
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
@@ -121,9 +121,9 @@ HWND mswin_init_menu_window (int type) {
if( !GetNHApp()->bWindowsLocked ) {
DWORD style;
style = (DWORD)GetWindowLongPtr(ret, GWL_STYLE);
style = GetWindowLong(ret, GWL_STYLE);
style |= WS_CAPTION;
SetWindowLongPtr(ret, GWL_STYLE, style);
SetWindowLong(ret, GWL_STYLE, style);
SetWindowPos(ret, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
}
@@ -143,7 +143,7 @@ int mswin_menu_window_select_menu (HWND hWnd, int how, MENU_ITEM_P ** _selected,
*_selected = NULL;
ret_val = -1;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
/* force activate for certain menu types */
if( data->type == MENU_TYPE_MENU &&
@@ -246,7 +246,7 @@ int mswin_menu_window_select_menu (HWND hWnd, int how, MENU_ITEM_P ** _selected,
return ret_val;
}
/*-----------------------------------------------------------------------------*/
LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PNHMenuWindow data;
HWND control;
@@ -254,7 +254,7 @@ LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
TCHAR title[MAX_LOADSTRING];
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch (message)
{
case WM_INITDIALOG:
@@ -268,7 +268,7 @@ LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
data->bmpCheckedCount = LoadBitmap(GetNHApp()->hApp, MAKEINTRESOURCE(IDB_MENU_SEL_COUNT));
data->bmpNotChecked = LoadBitmap(GetNHApp()->hApp, MAKEINTRESOURCE(IDB_MENU_UNSEL));
data->is_active = FALSE;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)data);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
/* set font for the text cotrol */
control = GetDlgItem(hWnd, IDC_MENU_TEXT);
@@ -277,8 +277,8 @@ LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
ReleaseDC(control, hdc);
/* subclass edit control */
editControlWndProc = (WNDPROC)GetWindowLongPtr(control, GWLP_WNDPROC);
SetWindowLongPtr(control,GWLP_WNDPROC, (LONG)NHMenuTextWndProc);
editControlWndProc = (WNDPROC)GetWindowLong(control, GWL_WNDPROC);
SetWindowLong(control, GWL_WNDPROC, (LONG)NHMenuTextWndProc);
/* Even though the dialog has no caption, you can still set the title
which shows on Alt-Tab */
@@ -490,7 +490,7 @@ LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
if( data->text.text ) free(data->text.text);
}
free(data);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
}
return TRUE;
}
@@ -501,7 +501,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
PNHMenuWindow data;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch( wParam ) {
case MSNH_MSG_PUTSTR:
{
@@ -659,7 +659,7 @@ void LayoutMenu(HWND hWnd)
POINT pt_elem, pt_ok, pt_cancel;
SIZE sz_elem, sz_ok, sz_cancel;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
menu_ok = GetDlgItem(hWnd, IDOK);
menu_cancel = GetDlgItem(hWnd, IDCANCEL);
@@ -729,7 +729,7 @@ void SetMenuType(HWND hWnd, int type)
PNHMenuWindow data;
HWND list, text;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
data->type = type;
@@ -764,7 +764,7 @@ void SetMenuListType(HWND hWnd, int how)
LVCOLUMN lvcol;
LRESULT fnt;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
if( data->type != MENU_TYPE_MENU ) return;
data->how = how;
@@ -807,8 +807,8 @@ void SetMenuListType(HWND hWnd, int how)
if( !control ) panic( "cannot create menu control" );
/* install the hook for the control window procedure */
wndProcListViewOrig = (WNDPROC)GetWindowLongPtr(control, GWLP_WNDPROC);
SetWindowLongPtr(control, GWLP_WNDPROC, (LONG)NHMenuListWndProc);
wndProcListViewOrig = (WNDPROC)GetWindowLong(control, GWL_WNDPROC);
SetWindowLong(control, GWL_WNDPROC, (LONG)NHMenuListWndProc);
/* set control colors */
ListView_SetBkColor(control,
@@ -841,7 +841,7 @@ void SetMenuListType(HWND hWnd, int how)
lvitem.state = data->menu.items[i].presel? LVIS_SELECTED : 0;
lvitem.pszText = NH_A2W(buf, wbuf, BUFSZ);
lvitem.lParam = (LPARAM)&data->menu.items[i];
nItem = (int)SendMessage(control, LB_ADDSTRING, (WPARAM)0, (LPARAM) buf);
nItem = SendMessage(control, LB_ADDSTRING, (WPARAM)0, (LPARAM) buf);
if( ListView_InsertItem(control, &lvitem)==-1 ) {
panic("cannot insert menu item");
}
@@ -853,7 +853,7 @@ HWND GetMenuControl(HWND hWnd)
{
PNHMenuWindow data;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
if(data->type==MENU_TYPE_TEXT) {
return GetDlgItem(hWnd, IDC_MENU_TEXT);
@@ -873,7 +873,7 @@ BOOL onMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
int i;
lpmis = (LPMEASUREITEMSTRUCT) lParam;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
GetClientRect(GetMenuControl(hWnd), &list_rect);
hdc = GetDC(GetMenuControl(hWnd));
@@ -921,7 +921,7 @@ BOOL onDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* If there are no list box items, skip this message. */
if (lpdis->itemID == -1) return FALSE;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
item = &data->menu.items[lpdis->itemID];
@@ -1118,7 +1118,7 @@ BOOL onListChar(HWND hWnd, HWND hwndList, WORD ch)
int curIndex, topIndex, pageSize;
boolean is_accelerator = FALSE;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch( ch ) {
case MENU_FIRST_PAGE:
@@ -1435,7 +1435,7 @@ void mswin_menu_window_size (HWND hWnd, LPSIZE sz)
RECT rt, wrt;
int extra_cx;
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
if(data) {
control = GetMenuControl(hWnd);

View File

@@ -160,9 +160,9 @@ LRESULT CALLBACK NHMessageWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
case WM_DESTROY:
{
PNHMessageWindow data;
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
free(data);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
} break;
case WM_SIZE:
@@ -173,7 +173,7 @@ LRESULT CALLBACK NHMessageWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
PNHMessageWindow data;
RECT rt;
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
xNewSize = LOWORD(lParam);
yNewSize = HIWORD(lParam);
@@ -238,7 +238,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
PNHMessageWindow data;
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch( wParam ) {
case MSNH_MSG_PUTSTR:
{
@@ -382,7 +382,7 @@ void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
int yInc;
/* get window data */
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
ZeroMemory(&si, sizeof(si));
si.cbSize = sizeof(si);
@@ -459,7 +459,7 @@ void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
int xInc;
/* get window data */
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
ZeroMemory(&si, sizeof(si));
si.cbSize = sizeof(si);
@@ -570,7 +570,7 @@ void onPaint(HWND hWnd)
OldBg = SetBkColor(hdc, message_bg_brush ? message_bg_color : (COLORREF)GetSysColor(DEFAULT_COLOR_BG_MSG));
OldFg = setMsgTextColor(hdc, 0);
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
GetClientRect(hWnd, &client_rt);
@@ -659,7 +659,7 @@ void onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
if( !data ) panic("out of memory");
ZeroMemory(data, sizeof(NHMessageWindow));
data->max_text = MAXWINDOWTEXT;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)data);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
/* re-calculate window size (+ font size) */
mswin_message_window_size(hWnd, &dummy);
@@ -673,7 +673,7 @@ void mswin_message_window_size (HWND hWnd, LPSIZE sz)
PNHMessageWindow data;
RECT rt, client_rt;
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
if( !data ) return;
/* -- Calculate the font size -- */
@@ -714,7 +714,7 @@ BOOL can_append_text(HWND hWnd, int attr, const char* text )
RECT draw_rt;
BOOL retval = FALSE;
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
/* cannot append if lines_not_seen is 0 (beginning of the new turn */
if( data->lines_not_seen==0 ) return FALSE;
@@ -765,7 +765,7 @@ BOOL more_prompt_check(HWND hWnd)
int remaining_height;
char tmptext[MAXWINDOWTEXT+1];
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
if( data->lines_not_seen==0 ) return FALSE; /* don't bother checking - nothig to "more" */
if( data->lines_not_seen>=MSG_LINES ) return TRUE; /* history size exceeded - always more */

View File

@@ -27,7 +27,7 @@ typedef struct mswin_nethack_text_window {
TCHAR* rip_text;
} NHRIPWindow, *PNHRIPWindow;
LRESULT CALLBACK NHRIPWndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK NHRIPWndProc(HWND, UINT, WPARAM, LPARAM);
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
HWND mswin_init_RIP_window () {
@@ -46,7 +46,7 @@ HWND mswin_init_RIP_window () {
if( !data ) panic("out of memory");
ZeroMemory(data, sizeof(NHRIPWindow));
SetWindowLongPtr(ret, GWLP_USERDATA, (LONG)data);
SetWindowLong(ret, GWL_USERDATA, (LONG)data);
return ret;
}
@@ -62,7 +62,7 @@ void mswin_display_RIP_window (HWND hWnd)
HDC hdc;
HFONT OldFont;
data = (PNHRIPWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHRIPWindow)GetWindowLong(hWnd, GWL_USERDATA);
GetNHApp()->hPopupWnd = hWnd;
mapWnd = mswin_hwnd_from_winid(WIN_MAP);
@@ -117,12 +117,12 @@ void mswin_display_RIP_window (HWND hWnd)
GetNHApp()->hPopupWnd = NULL;
}
LRESULT CALLBACK NHRIPWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL CALLBACK NHRIPWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PNHRIPWindow data;
data = (PNHRIPWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHRIPWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch (message)
{
case WM_INITDIALOG:
@@ -217,7 +217,7 @@ LRESULT CALLBACK NHRIPWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
if( data->rip_text ) free(data->rip_text);
if (data->rip_bmp != NULL) DeleteObject(data->rip_bmp);
free(data);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
}
break;
@@ -229,7 +229,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
PNHRIPWindow data;
static int InRipText = 1;
data = (PNHRIPWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHRIPWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch( wParam ) {
case MSNH_MSG_PUTSTR: {
PMSNHMsgPutstr msg_data = (PMSNHMsgPutstr)lParam;

View File

@@ -7,7 +7,6 @@
#include "mhsplash.h"
#include "mhmsg.h"
#include "mhfont.h"
#include "date.h"
#include "patchlevel.h"
#include "dlb.h"
@@ -15,7 +14,7 @@
PNHWinApp GetNHApp(void);
LRESULT CALLBACK NHSplashWndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK NHSplashWndProc(HWND, UINT, WPARAM, LPARAM);
#define SPLASH_WIDTH 440
#define SPLASH_HEIGHT 322
@@ -85,8 +84,8 @@ void mswin_display_splash_window (BOOL show_ver)
clientrt.right - 2 * SPLASH_OFFSET_X, controlrt.bottom, TRUE);
/* Fill the text control */
Sprintf (buf, "%s\r\n%s\r\n%s\r\n%s\r\n\r\n", COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B,
COPYRIGHT_BANNER_C, COPYRIGHT_BANNER_D);
Sprintf (buf, "%s\r\n%s\r\n%s\r\n\r\n", COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B,
COPYRIGHT_BANNER_C);
strsize = strlen(buf);
if (show_ver) {
@@ -176,7 +175,7 @@ void mswin_display_splash_window (BOOL show_ver)
mswin_destroy_splashfonts();
}
LRESULT CALLBACK NHSplashWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL CALLBACK NHSplashWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
switch (message)

View File

@@ -63,7 +63,7 @@ HWND mswin_init_status_window () {
if( !data ) panic("out of memory");
ZeroMemory(data, sizeof(NHStatusWindow));
SetWindowLongPtr(ret, GWLP_USERDATA, (LONG)data);
SetWindowLong(ret, GWL_USERDATA, (LONG)data);
return ret;
}
@@ -95,7 +95,7 @@ LRESULT CALLBACK StatusWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
HDC hdc;
PNHStatusWindow data;
data = (PNHStatusWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHStatusWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch (message)
{
case WM_MSNH_COMMAND: {
@@ -173,7 +173,7 @@ LRESULT CALLBACK StatusWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
case WM_DESTROY:
free(data);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
break;
case WM_SETFOCUS:
@@ -197,7 +197,7 @@ void mswin_status_window_size (HWND hWnd, LPSIZE sz)
sz->cx = rt.right - rt.left;
sz->cy = rt.bottom - rt.top;
data = (PNHStatusWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHStatusWindow)GetWindowLong(hWnd, GWL_USERDATA);
if(data) {
hdc = GetDC(hWnd);
saveFont = SelectObject(hdc, mswin_get_font(NHW_STATUS, ATR_NONE, hdc, FALSE));

View File

@@ -18,7 +18,7 @@ static WNDPROC editControlWndProc = 0;
#define DEFAULT_COLOR_BG_TEXT COLOR_WINDOW
#define DEFAULT_COLOR_FG_TEXT COLOR_WINDOWTEXT
LRESULT CALLBACK NHTextWndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK NHTextWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK NHEditHookWndProc(HWND, UINT, WPARAM, LPARAM);
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
static void LayoutText(HWND hwnd);
@@ -53,9 +53,9 @@ HWND mswin_init_text_window () {
SetWindowText(ret, "Text");
if( !GetNHApp()->bWindowsLocked ) {
DWORD style;
style = (DWORD)GetWindowLongPtr(ret, GWL_STYLE);
style = GetWindowLong(ret, GWL_STYLE);
style |= WS_CAPTION;
SetWindowLongPtr(ret, GWL_STYLE, style);
SetWindowLong(ret, GWL_STYLE, style);
SetWindowPos(ret, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
}
@@ -63,7 +63,7 @@ HWND mswin_init_text_window () {
data = (PNHTextWindow)malloc(sizeof(NHTextWindow));
if( !data ) panic("out of memory");
ZeroMemory(data, sizeof(NHTextWindow));
SetWindowLongPtr(ret, GWLP_USERDATA, (LONG)data);
SetWindowLong(ret, GWL_USERDATA, (LONG)data);
return ret;
}
@@ -71,7 +71,7 @@ void mswin_display_text_window (HWND hWnd)
{
PNHTextWindow data;
data = (PNHTextWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHTextWindow)GetWindowLong(hWnd, GWL_USERDATA);
if( data && data->window_text ) {
HWND control;
control = GetDlgItem(hWnd, IDC_TEXT_CONTROL);
@@ -83,14 +83,14 @@ void mswin_display_text_window (HWND hWnd)
mswin_popup_destroy(hWnd);
}
LRESULT CALLBACK NHTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL CALLBACK NHTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND control;
HDC hdc;
PNHTextWindow data;
TCHAR title[MAX_LOADSTRING];
data = (PNHTextWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHTextWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch (message)
{
case WM_INITDIALOG:
@@ -105,8 +105,8 @@ LRESULT CALLBACK NHTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
ReleaseDC(control, hdc);
/* subclass edit control */
editControlWndProc = (WNDPROC)GetWindowLongPtr(control, GWLP_WNDPROC);
SetWindowLongPtr(control, GWLP_WNDPROC, (LONG)NHEditHookWndProc);
editControlWndProc = (WNDPROC)GetWindowLong(control, GWL_WNDPROC);
SetWindowLong(control, GWL_WNDPROC, (LONG)NHEditHookWndProc);
SetFocus(control);
@@ -179,7 +179,7 @@ LRESULT CALLBACK NHTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
if( data ) {
if( data->window_text ) free(data->window_text);
free(data);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
}
break;
@@ -191,7 +191,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
PNHTextWindow data;
data = (PNHTextWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
data = (PNHTextWindow)GetWindowLong(hWnd, GWL_USERDATA);
switch( wParam ) {
case MSNH_MSG_PUTSTR: {
PMSNHMsgPutstr msg_data = (PMSNHMsgPutstr)lParam;

View File

@@ -28,6 +28,7 @@
#define LLEN 128
extern const char *killed_by_prefix[];
extern winid WIN_STATUS;
#ifdef _DEBUG
@@ -134,7 +135,6 @@ struct window_procs mswin_procs = {
genl_status_threshold,
# endif
#endif
genl_can_suspend_yes,
};
@@ -216,7 +216,7 @@ void mswin_init_nhwindows(int* argc, char** argv)
* write output to a window or stdout. stdout doesn't make sense on Windows
* non-console applications
*/
iflags.toptenwin = 1;
flags.toptenwin = 1;
set_option_mod_status("toptenwin", SET_IN_FILE);
set_option_mod_status("perm_invent", SET_IN_FILE);
@@ -1773,17 +1773,16 @@ void mswin_end_screen()
}
/*
outrip(winid, int, when)
outrip(winid, int)
-- The tombstone code. If you want the traditional code use
genl_outrip for the value and check the #if in rip.c.
*/
#define STONE_LINE_LEN 16
void mswin_outrip(winid wid, int how, time_t when)
void mswin_outrip(winid wid, int how)
{
char buf[BUFSZ];
long year;
logDebug("mswin_outrip(%d, %d, %ld)\n", wid, how, (long)when);
logDebug("mswin_outrip(%d)\n", wid, how);
if ((wid >= 0) && (wid < MAXWINDOWS) ) {
DestroyWindow(GetNHApp()->windowlist[wid].win);
GetNHApp()->windowlist[wid].win = mswin_init_RIP_window();
@@ -1806,14 +1805,26 @@ void mswin_outrip(winid wid, int how, time_t when)
putstr(wid, 0, buf);
/* Put together death description */
formatkiller(buf, sizeof buf, how);
switch (killer.format) {
default: impossible("bad killer format?");
case KILLED_BY_AN:
Strcpy(buf, killed_by_prefix[how]);
Strcat(buf, an(killer.name));
break;
case KILLED_BY:
Strcpy(buf, killed_by_prefix[how]);
Strcat(buf, killer.name);
break;
case NO_KILLER_PREFIX:
Strcpy(buf, killer.name);
break;
}
/* Put death type on stone */
putstr(wid, 0, buf);
/* Put year on stone */
year = yyyymmdd(when) / 10000L;
Sprintf(buf, "%4ld", year);
Sprintf(buf, "%4d", getyear());
putstr(wid, 0, buf);
mswin_finish_rip_text(wid);
}
@@ -2475,17 +2486,17 @@ static void mswin_color_from_string(char *colorstring, HBRUSH* brushptr, COLORRE
if (*colorstring == '#') {
if (strlen(++colorstring) != 6) return;
red_value = (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals);
red_value = index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
red_value *= 16;
red_value += (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals);
red_value += index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
green_value = (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals);
green_value = index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
green_value *= 16;
green_value += (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals);
green_value += index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
blue_value = (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals);
blue_value = index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
blue_value *= 16;
blue_value += (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals);
blue_value += index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
*colorptr = RGB(red_value, green_value, blue_value);
} else {

View File

@@ -158,7 +158,7 @@ void mswin_change_color(void);
char *mswin_get_color_string(void);
void mswin_start_screen(void);
void mswin_end_screen(void);
void mswin_outrip(winid wid, int how, time_t when);
void mswin_outrip(winid wid, int how);
void mswin_preference_update(const char *pref);
char *mswin_getmsghistory(BOOLEAN_P init);
void mswin_putmsghistory(const char * msg,BOOLEAN_P);