MCPcopy Create free account
hub / github.com/NetHack/NetHack / WinMain

Function WinMain

win/win32/NetHackW.c:80–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78static char *argv[MAX_CMDLINE_PARAM];
79
80int APIENTRY
81WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
82 int nCmdShow)
83{
84 INITCOMMONCONTROLSEX InitCtrls;
85 int argc;
86 size_t len;
87 TCHAR *p;
88 TCHAR wbuf[BUFSZ];
89 char buf[BUFSZ];
90
91 DWORD major, minor;
92 /* OSVERSIONINFO osvi; */
93
94 UNREFERENCED_PARAMETER(hPrevInstance);
95 UNREFERENCED_PARAMETER(lpCmdLine);
96 UNREFERENCED_PARAMETER(nCmdShow);
97
98 win10_init();
99 early_init(0, NULL); /* Change as needed to support CRASHREPORT */
100
101 /* init application structure */
102 _nethack_app.hApp = hInstance;
103 _nethack_app.hAccelTable =
104 LoadAccelerators(hInstance, (LPCTSTR) IDC_NETHACKW);
105 _nethack_app.hMainWnd = NULL;
106 _nethack_app.hPopupWnd = NULL;
107 _nethack_app.bmpTiles = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TILES));
108 if (_nethack_app.bmpTiles == NULL)
109 panic("cannot load tiles bitmap");
110 _nethack_app.bmpPetMark =
111 LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_PETMARK));
112 if (_nethack_app.bmpPetMark == NULL)
113 panic("cannot load pet mark bitmap");
114#ifdef USE_PILEMARK
115 _nethack_app.bmpPileMark =
116 LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_PILEMARK));
117 if (_nethack_app.bmpPileMark == NULL)
118 panic("cannot load pile mark bitmap");
119#endif
120 _nethack_app.bmpRip = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_RIP));
121 if (_nethack_app.bmpRip == NULL)
122 panic("cannot load rip bitmap");
123 _nethack_app.bmpSplash =
124 LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_SPLASH));
125 if (_nethack_app.bmpSplash == NULL)
126 panic("cannot load splash bitmap");
127 _nethack_app.bmpMapTiles = _nethack_app.bmpTiles;
128 _nethack_app.mapTile_X = TILE_X;
129 _nethack_app.mapTile_Y = TILE_Y;
130 _nethack_app.mapTilesPerLine = TILES_PER_LINE;
131
132 _nethack_app.bNoHScroll = FALSE;
133 _nethack_app.bNoVScroll = FALSE;
134 if (_nethack_app.saved_text)
135 free(_nethack_app.saved_text), _nethack_app.saved_text = 0;
136 _nethack_app.saved_text = strdup("");
137

Callers

nothing calls this directly

Calls 5

win10_initFunction · 0.85
early_initFunction · 0.85
GetComCtlVersionFunction · 0.85
_get_cmd_argFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected