some Windows fixes
remove a couple of extraneous files from visual studio project remove several trailing whitespace at end of line remove an address sanitizer bounds error during player dialog init rework fix for darkened lit tiles (fix issue #997)
This commit is contained in:
@@ -219,7 +219,6 @@
|
||||
<ClInclude Include="$(IncDir)artifact.h" />
|
||||
<ClInclude Include="$(IncDir)artilist.h" />
|
||||
<ClInclude Include="$(IncDir)attrib.h" />
|
||||
<ClInclude Include="$(IncDir)bitmfile.h" />
|
||||
<ClInclude Include="$(IncDir)botl.h" />
|
||||
<ClInclude Include="$(IncDir)color.h" />
|
||||
<ClInclude Include="$(IncDir)config.h" />
|
||||
@@ -237,7 +236,6 @@
|
||||
<ClInclude Include="$(IncDir)flag.h" />
|
||||
<ClInclude Include="$(IncDir)fnamesiz.h" />
|
||||
<ClInclude Include="$(IncDir)func_tab.h" />
|
||||
<ClInclude Include="$(IncDir)gem_rsc.h" />
|
||||
<ClInclude Include="$(IncDir)global.h" />
|
||||
<ClInclude Include="$(IncDir)hack.h" />
|
||||
<ClInclude Include="$(IncDir)integer.h" />
|
||||
@@ -308,9 +306,6 @@
|
||||
<Image Include="$(WinWin32Dir)splash.bmp" />
|
||||
<Image Include="$(WinWin32Dir)tiles.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<MSBuild Projects="$(vsDir)NetHack\afternethack.proj" Targets="Build" Properties="Configuration=$(Configuration)" />
|
||||
|
||||
+6
-3
@@ -574,6 +574,7 @@ plselInitDialog(struct plsel_data * data)
|
||||
{
|
||||
TCHAR wbuf[BUFSZ];
|
||||
LVCOLUMN lvcol;
|
||||
control_t *control;
|
||||
|
||||
SetWindowLongPtr(data->dialog, GWLP_USERDATA, (LONG_PTR) data);
|
||||
|
||||
@@ -654,10 +655,12 @@ plselInitDialog(struct plsel_data * data)
|
||||
plselAdjustSelections(data->dialog);
|
||||
|
||||
/* set tab order */
|
||||
control_t * control = &data->controls[psc_quit_button];
|
||||
for(int i = psc_quit_button; i >= psc_name_box; i--, control++)
|
||||
SetWindowPos(control->hWnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||
|
||||
for (int i = psc_quit_button; i >= psc_name_box; i--) {
|
||||
control = &data->controls[i];
|
||||
SetWindowPos(control->hWnd, NULL, 0, 0, 0, 0,
|
||||
SWP_NOMOVE | SWP_NOSIZE);
|
||||
}
|
||||
do_player_selector_layout(data);
|
||||
|
||||
center_dialog(data->dialog);
|
||||
|
||||
+65
-65
@@ -861,85 +861,85 @@ paintTile(PNHMapWindow data, int i, int j, RECT * rect)
|
||||
DeleteObject(blackBrush);
|
||||
}
|
||||
|
||||
if (bkglyph != NO_GLYPH
|
||||
/* Don't use all black GLYPH_UNEXPLORED tile as a background */
|
||||
&& bkglyph != GLYPH_UNEXPLORED) {
|
||||
ntile = data->bkmap[i][j].gm.tileidx;
|
||||
t_x = TILEBMP_X(ntile);
|
||||
t_y = TILEBMP_Y(ntile);
|
||||
|
||||
StretchBlt(data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, data->tileDC,
|
||||
t_x, t_y, GetNHApp()->mapTile_X,
|
||||
GetNHApp()->mapTile_Y, SRCCOPY);
|
||||
layer++;
|
||||
}
|
||||
if (glyph != NO_GLYPH) {
|
||||
if (bkglyph != NO_GLYPH) {
|
||||
ntile = data->bkmap[i][j].gm.tileidx;
|
||||
t_x = TILEBMP_X(ntile);
|
||||
t_y = TILEBMP_Y(ntile);
|
||||
|
||||
if ((glyph != NO_GLYPH) && (glyph != bkglyph)) {
|
||||
/* rely on NetHack core helper routine */
|
||||
ntile = data->map[i][j].gm.tileidx;
|
||||
t_x = TILEBMP_X(ntile);
|
||||
t_y = TILEBMP_Y(ntile);
|
||||
|
||||
if (layer > 0) {
|
||||
(*GetNHApp()->lpfnTransparentBlt)(
|
||||
data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, data->tileDC, t_x,
|
||||
t_y, GetNHApp()->mapTile_X,
|
||||
GetNHApp()->mapTile_Y, TILE_BK_COLOR);
|
||||
} else {
|
||||
StretchBlt(data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, data->tileDC,
|
||||
t_x, t_y, GetNHApp()->mapTile_X,
|
||||
GetNHApp()->mapTile_Y, SRCCOPY);
|
||||
data->xBackTile, data->yBackTile, data->tileDC, t_x,
|
||||
t_y, GetNHApp()->mapTile_X, GetNHApp()->mapTile_Y,
|
||||
SRCCOPY);
|
||||
layer++;
|
||||
}
|
||||
if (glyph != bkglyph) {
|
||||
/* rely on tileidx provided by NetHack core */
|
||||
ntile = data->map[i][j].gm.tileidx;
|
||||
t_x = TILEBMP_X(ntile);
|
||||
t_y = TILEBMP_Y(ntile);
|
||||
|
||||
/* Don't use all black GLYPH_UNEXPLORED tile as a background */
|
||||
if (layer > 0 && bkglyph != GLYPH_UNEXPLORED) {
|
||||
(*GetNHApp()->lpfnTransparentBlt)(
|
||||
data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, data->tileDC, t_x,
|
||||
t_y, GetNHApp()->mapTile_X,
|
||||
GetNHApp()->mapTile_Y, TILE_BK_COLOR);
|
||||
} else {
|
||||
StretchBlt(data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, data->tileDC,
|
||||
t_x, t_y, GetNHApp()->mapTile_X,
|
||||
GetNHApp()->mapTile_Y, SRCCOPY);
|
||||
}
|
||||
layer++;
|
||||
}
|
||||
|
||||
layer++;
|
||||
}
|
||||
|
||||
#ifdef USE_PILEMARK
|
||||
if ((glyph != NO_GLYPH) && (data->map[i][j].gm.glyphflags & MG_PET)
|
||||
if ((data->map[i][j].gm.glyphflags & MG_PET) != 0
|
||||
#else
|
||||
if ((glyph != NO_GLYPH) && glyph_is_pet(glyph)
|
||||
if (glyph_is_pet(glyph)
|
||||
#endif
|
||||
&& iflags.wc_hilite_pet) {
|
||||
/* apply pet mark transparently over
|
||||
pet image */
|
||||
HDC hdcPetMark;
|
||||
HBITMAP bmPetMarkOld;
|
||||
&& iflags.wc_hilite_pet) {
|
||||
/* apply pet mark transparently over
|
||||
pet image */
|
||||
HDC hdcPetMark;
|
||||
HBITMAP bmPetMarkOld;
|
||||
|
||||
/* this is DC for petmark bitmap */
|
||||
hdcPetMark = CreateCompatibleDC(data->backBufferDC);
|
||||
bmPetMarkOld =
|
||||
SelectObject(hdcPetMark, GetNHApp()->bmpPetMark);
|
||||
/* this is DC for petmark bitmap */
|
||||
hdcPetMark = CreateCompatibleDC(data->backBufferDC);
|
||||
bmPetMarkOld =
|
||||
SelectObject(hdcPetMark, GetNHApp()->bmpPetMark);
|
||||
|
||||
(*GetNHApp()->lpfnTransparentBlt)(
|
||||
data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, hdcPetMark, 0, 0,
|
||||
TILE_X, TILE_Y, TILE_BK_COLOR);
|
||||
SelectObject(hdcPetMark, bmPetMarkOld);
|
||||
DeleteDC(hdcPetMark);
|
||||
}
|
||||
(*GetNHApp()->lpfnTransparentBlt)(
|
||||
data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, hdcPetMark, 0, 0,
|
||||
TILE_X, TILE_Y, TILE_BK_COLOR);
|
||||
SelectObject(hdcPetMark, bmPetMarkOld);
|
||||
DeleteDC(hdcPetMark);
|
||||
}
|
||||
#ifdef USE_PILEMARK
|
||||
if ((glyph != NO_GLYPH) && (data->map[i][j].gm.glyphflags & MG_OBJPILE)
|
||||
&& iflags.hilite_pile) {
|
||||
/* apply pilemark transparently over other image */
|
||||
HDC hdcPileMark;
|
||||
HBITMAP bmPileMarkOld;
|
||||
if ((data->map[i][j].gm.glyphflags & MG_OBJPILE) != 0
|
||||
&& iflags.hilite_pile) {
|
||||
/* apply pilemark transparently over other image */
|
||||
HDC hdcPileMark;
|
||||
HBITMAP bmPileMarkOld;
|
||||
|
||||
/* this is DC for pilemark bitmap */
|
||||
hdcPileMark = CreateCompatibleDC(data->backBufferDC);
|
||||
bmPileMarkOld = SelectObject(hdcPileMark,
|
||||
GetNHApp()->bmpPileMark);
|
||||
/* this is DC for pilemark bitmap */
|
||||
hdcPileMark = CreateCompatibleDC(data->backBufferDC);
|
||||
bmPileMarkOld = SelectObject(hdcPileMark,
|
||||
GetNHApp()->bmpPileMark);
|
||||
|
||||
(*GetNHApp()->lpfnTransparentBlt)(
|
||||
data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, hdcPileMark, 0, 0,
|
||||
TILE_X, TILE_Y, TILE_BK_COLOR);
|
||||
SelectObject(hdcPileMark, bmPileMarkOld);
|
||||
DeleteDC(hdcPileMark);
|
||||
}
|
||||
(*GetNHApp()->lpfnTransparentBlt)(
|
||||
data->backBufferDC, rect->left, rect->top,
|
||||
data->xBackTile, data->yBackTile, hdcPileMark, 0, 0,
|
||||
TILE_X, TILE_Y, TILE_BK_COLOR);
|
||||
SelectObject(hdcPileMark, bmPileMarkOld);
|
||||
DeleteDC(hdcPileMark);
|
||||
}
|
||||
#endif
|
||||
} /* glyph != NO_GLYPH */
|
||||
|
||||
if (i == data->xCur && j == data->yCur &&
|
||||
(data->cursorOn || !win32_cursorblink))
|
||||
|
||||
Reference in New Issue
Block a user