!IF "$(GRAPHICAL)" == "Y"
WINPORT = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \
$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
- $(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o \
+ $(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \
$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
WINPFLAG = -DTILES -DMSWIN_GRAPHICS
NHRES = $(O)winhack.res
@echo Optional tile development utilities are up to date.
!IF "$(GRAPHICAL)"=="Y"
-$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc
+$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \
+ $(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp \
+ $(WIN32)\petmark.bmp $(WIN32)\NetHack.ico $(WIN32)\rip.bmp \
+ $(WIN32)\splash.bmp
@$(rc) -r -fo$@ -i$(WIN32) -dNDEBUG $(WIN32)\winhack.rc
!ELSE
-$(NHRES): $(NTSYS)\console.rc
+$(NHRES): $(NTSYS)\console.rc $(NTSYS)\NetHack.ico
@$(rc) -r -fo$@ -i$(NTSYS) -dNDEBUG $(NTSYS)\console.rc
!ENDIF
$(SRC)\vis_tab.c: $(U)makedefs.exe
$(U)makedefs -z
+#==========================================
+# uudecode utility and uuencoded targets
+#==========================================
+
+$(U)uudecode.exe: $(O)uudecode.o
+ @$(link) $(LFLAGSU) $(startobj) $(O)\uudecode.o, $@,,$(libsmt)
+
+$(O)uudecode.o: $(SSYS)\uudecode.c
+
+$(NTSYS)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
+ chdir $(NTSYS)
+ ..\..\util\uudecode.exe nhico.uu
+ chdir ..\..\src
+
+$(WIN32)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe ../../sys/winnt/nhico.uu
+ chdir ..\..\src
+
+$(WIN32)\mnsel.bmp: $(U)uudecode.exe $(WIN32)\mnsel.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe mnsel.uu
+ chdir ..\..\src
+
+$(WIN32)\mnselcnt.bmp: $(U)uudecode.exe $(WIN32)\mnselcnt.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe mnselcnt.uu
+ chdir ..\..\src
+
+$(WIN32)\mnunsel.bmp: $(U)uudecode.exe $(WIN32)\mnunsel.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe mnunsel.uu
+ chdir ..\..\src
+
+$(WIN32)\petmark.bmp: $(U)uudecode.exe $(WIN32)\petmark.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe petmark.uu
+ chdir ..\..\src
+
+$(WIN32)\rip.bmp: $(U)uudecode.exe $(WIN32)\rip.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe rip.uu
+ chdir ..\..\src
+
+$(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe splash.uu
+ chdir ..\..\src
+
#==========================================
# Level Compiler Stuff
#==========================================
!IF "$(GRAPHICAL)" == "Y"
WINPORT = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \
$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
- $(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o \
+ $(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \
$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
WINPFLAG = -DTILES -DMSWIN_GRAPHICS
NHRES = $(O)winhack.res
!IF "$(GRAPHICAL)"=="Y"
$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \
- $(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp $(WIN32)\petmark.bmp \
- $(WIN32)\NetHack.ico
+ $(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp \
+ $(WIN32)\petmark.bmp $(WIN32)\NetHack.ico $(WIN32)\rip.bmp \
+ $(WIN32)\splash.bmp
@$(rc) -r -fo$@ -i$(WIN32) -dNDEBUG $(WIN32)\winhack.rc
!ELSE
$(NHRES): $(NTSYS)\console.rc $(NTSYS)\NetHack.ico
..\..\util\uudecode.exe petmark.uu
chdir ..\..\src
+$(WIN32)\rip.bmp: $(U)uudecode.exe $(WIN32)\rip.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe rip.uu
+ chdir ..\..\src
+
+$(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu
+ chdir $(WIN32)
+ ..\..\util\uudecode.exe splash.uu
+ chdir ..\..\src
+
#==========================================
# Level Compiler Stuff
#==========================================
HFONT hFont;
} font_table[MAXFONTS] ;
static int font_table_size = 0;
+HFONT version_splash_font;
+HFONT extrainfo_splash_font;
#define NHFONT_CODE(win, attr) (((attr&0xFF)<<8)|(win_type&0xFF))
static void __cdecl font_table_cleanup(void);
+void mswin_init_splashfonts(HWND hWnd)
+{
+ HDC hdc = GetDC(hWnd);
+ HFONT fnt = NULL;
+ LOGFONT lgfnt;
+ ZeroMemory( &lgfnt, sizeof(lgfnt) );
+ lgfnt.lfHeight = -60*GetDeviceCaps(hdc, LOGPIXELSY)/72; // height of font
+ lgfnt.lfWidth = 0; // average character width
+ lgfnt.lfEscapement = 0; // angle of escapement
+ lgfnt.lfOrientation = 0; // base-line orientation angle
+ lgfnt.lfWeight = FW_BOLD; // font weight
+ lgfnt.lfItalic = FALSE; // italic attribute option
+ lgfnt.lfUnderline = FALSE; // underline attribute option
+ lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
+ lgfnt.lfCharSet = OEM_CHARSET; // character set identifier
+ lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
+ lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
+ lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
+ lgfnt.lfPitchAndFamily = DEFAULT_PITCH; // pitch and family
+ NH_A2W( "Times New Roman", lgfnt.lfFaceName, LF_FACESIZE);
+ version_splash_font = CreateFontIndirect(&lgfnt);
+ lgfnt.lfHeight = -12*GetDeviceCaps(hdc, LOGPIXELSY)/72; // height of font
+ extrainfo_splash_font = CreateFontIndirect(&lgfnt);
+ ReleaseDC(hWnd, hdc);
+}
+
+void mswin_destroy_splashfonts()
+{
+ DeleteObject (version_splash_font);
+ DeleteObject (extrainfo_splash_font);
+}
+
/* create font based on window type, charater attributes and
window device context */
HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace)
#include "winMS.h"
HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace);
+void mswin_init_splashfonts(HWND hWnd);
+void mswin_destroy_splashfonts(void);
#endif /* MSWINFont_h */
HWND mswin_init_map_window (void);
void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw);
-
int mswin_map_mode(HWND hWnd, int mode);
#define ROGUE_LEVEL_MAP_MODE MAP_MODE_ASCII12x16
#include "mhmsg.h"
#include "mhfont.h"
+#define RIP_WIDTH 400
+#define RIP_HEIGHT 200
PNHWinApp GetNHApp(void);
TCHAR* rip_text;
} NHRIPWindow, *PNHRIPWindow;
-static WNDPROC editControlWndProc = 0;
-
-BOOL CALLBACK NHRIPWndProc(HWND, UINT, WPARAM, LPARAM);
-LRESULT CALLBACK NHEditHookWndProc(HWND, UINT, WPARAM, LPARAM);
+BOOL CALLBACK NHRIPWndProc(HWND, UINT, WPARAM, LPARAM);
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
-static void LayoutText(HWND hwnd);
HWND mswin_init_RIP_window () {
HWND ret;
PNHRIPWindow data;
HWND mapWnd;
RECT riprt;
- SIZE bmpDims;
RECT clientrect;
RECT textrect;
HDC hdc;
DT_LEFT | DT_NOPREFIX | DT_CALCRECT);
ReleaseDC(hWnd, hdc);
}
- bmpDims.cx = 400;
- bmpDims.cy = 200;
- if (textrect.right - textrect.left > bmpDims.cx)
+ if (textrect.right - textrect.left > RIP_WIDTH)
clientrect.right = textrect.right + 10 - clientrect.right;
else
- clientrect.right = textrect.left + 20 + bmpDims.cx - clientrect.right;
- clientrect.bottom = textrect.bottom + bmpDims.cy + 10 - clientrect.bottom;
+ clientrect.right = textrect.left + 20 + RIP_WIDTH - clientrect.right;
+ clientrect.bottom = textrect.bottom + RIP_HEIGHT + 10 - clientrect.bottom;
GetWindowRect (GetDlgItem(hWnd, IDOK), &textrect);
textrect.right -= textrect.left;
textrect.bottom -= textrect.top;
case WM_PAINT:
{
- SIZE bmpDims;
int bitmap_offset;
RECT clientrect;
RECT textrect;
}
OldBitmap = SelectObject(hdcBitmap, GetNHApp()->bmpRip);
SetBkMode (hdc, OPAQUE);
- bmpDims.cx = 400;
- bmpDims.cy = 200;
- bitmap_offset = (textrect.right - textrect.left - bmpDims.cx) / 2;
- BitBlt (hdc, textrect.left + bitmap_offset, textrect.bottom, bmpDims.cx,
- bmpDims.cy, hdcBitmap, 0, 0, SRCCOPY);
+ bitmap_offset = (textrect.right - textrect.left - RIP_WIDTH) / 2;
+ BitBlt (hdc, textrect.left + bitmap_offset, textrect.bottom, RIP_WIDTH,
+ RIP_HEIGHT, hdcBitmap, 0, 0, SRCCOPY);
SetBkMode (hdc, TRANSPARENT);
if (data->rip_text)
{
#include "mhtext.h"
#include "mhmsgwnd.h"
#include "mhmenu.h"
+#include "mhsplash.h"
#include "mhmsg.h"
#include "mhinput.h"
#include "mhaskyn.h"
SET_IN_GAME
);
+ mswin_display_splash_window();
iflags.window_inited = TRUE;
}
# End Source File
# Begin Source File
+SOURCE=..\win\win32\mhsplash.c
+# End Source File
+# Begin Source File
+
SOURCE=..\win\win32\mhrip.c
# End Source File
# Begin Source File
+SOURCE=..\win\win32\mhsplash.h
+# End Source File
+# Begin Source File
+
SOURCE=..\win\win32\mhrip.h
# End Source File
# Begin Source File
#define IDB_PETMARK 143
#define IDB_MENU_SEL_COUNT 144
#define IDD_NHRIP 145
+#define IDB_SPLASH 146
+#define IDB_RIP 147
+#define IDD_SPLASH 148
#define IDC_TEXT_VIEW 1000
#define IDC_TEXT_CONTROL 1000
#define IDC_CMD_MOVE_NW 1001
#define IDC_PLSEL_GENDER_LIST 1326
#define IDC_ABOUT_VERSION 1327
#define IDC_ABOUT_COPYRIGHT 1328
-#define IDB_RIP 1329
#define IDM_SAVE 32771
#define IDM_HELP_LONG 32772
#define IDM_HELP_COMMANDS 32773
HBITMAP bmpPetMark;
HBITMAP bmpMapTiles; /* custom tiles bitmap */
HBITMAP bmpRip;
+ HBITMAP bmpSplash;
int mapTile_X; /* tile width */
int mapTile_Y; /* tile height */
int mapTilesPerLine; /* number of tile per row in the bitmap */
if( _nethack_app.bmpPetMark==NULL ) panic("cannot load pet mark bitmap");
_nethack_app.bmpRip = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_RIP));
if ( _nethack_app.bmpRip == NULL ) panic("cannot load rip bitmap");
+ _nethack_app.bmpSplash = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_SPLASH));
+ if ( _nethack_app.bmpSplash == NULL ) panic("cannot load splash bitmap");
_nethack_app.bmpMapTiles = _nethack_app.bmpTiles;
_nethack_app.mapTile_X = TILE_X;
_nethack_app.mapTile_Y = TILE_Y;
IDD_NHTEXT DIALOGEX 0, 0, 172, 178
STYLE DS_SETFOREGROUND | WS_POPUP | WS_THICKFRAME
EXSTYLE WS_EX_STATICEDGE
-FONT 8, "MS Sans Serif", 0, 0, 0x1
+FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,54,163,50,14
EDITTEXT IDC_TEXT_CONTROL,0,0,170,160,ES_MULTILINE |
DEFPUSHBUTTON "OK",IDOK,82,188,50,14
END
+IDD_SPLASH DIALOGEX 0, 0, 281, 209
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Welcome to NetHack"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,82,188,50,14
+END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
IDB_PETMARK BITMAP DISCARDABLE "petmark.bmp"
IDB_MENU_SEL_COUNT BITMAP DISCARDABLE "mnselcnt.bmp"
IDB_RIP BITMAP DISCARDABLE "rip.bmp"
+IDB_SPLASH BITMAP DISCARDABLE "splash.bmp"
/////////////////////////////////////////////////////////////////////////////
//