MCPcopy Index your code
hub / github.com/NetHack/NetHack / paintTile

Function paintTile

win/win32/mhmap.c:845–950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845static void
846paintTile(PNHMapWindow data, int i, int j, RECT * rect)
847{
848 short ntile;
849 int t_x, t_y;
850 int glyph, bkglyph;
851 int layer;
852#ifdef USE_PILEMARK
853// int color;
854// unsigned special = 0U;
855// int mgch;
856#endif
857 layer = 0;
858 glyph = data->map[i][j].glyph;
859 bkglyph = data->bkmap[i][j].glyph;
860
861 if (glyph == NO_GLYPH && bkglyph == NO_GLYPH) {
862 HBRUSH blackBrush = CreateSolidBrush(RGB(0, 0, 0));
863 FillRect(data->backBufferDC, rect, blackBrush);
864 DeleteObject(blackBrush);
865 }
866
867
868 if (glyph != NO_GLYPH) {
869 if (bkglyph != NO_GLYPH) {
870 ntile = data->bkmap[i][j].gm.tileidx;
871 t_x = TILEBMP_X(ntile);
872 t_y = TILEBMP_Y(ntile);
873
874 StretchBlt(data->backBufferDC, rect->left, rect->top,
875 data->xBackTile, data->yBackTile, data->tileDC, t_x,
876 t_y, GetNHApp()->mapTile_X, GetNHApp()->mapTile_Y,
877 SRCCOPY);
878 layer++;
879 }
880 if (glyph != bkglyph) {
881 /* rely on tileidx provided by NetHack core */
882 ntile = data->map[i][j].gm.tileidx;
883 t_x = TILEBMP_X(ntile);
884 t_y = TILEBMP_Y(ntile);
885
886 /* Don't use all black GLYPH_UNEXPLORED tile as a background */
887 if (layer > 0 && bkglyph != GLYPH_UNEXPLORED) {
888 (*GetNHApp()->lpfnTransparentBlt)(
889 data->backBufferDC, rect->left, rect->top,
890 data->xBackTile, data->yBackTile, data->tileDC, t_x,
891 t_y, GetNHApp()->mapTile_X,
892 GetNHApp()->mapTile_Y, TILE_BK_COLOR);
893 } else {
894 StretchBlt(data->backBufferDC, rect->left, rect->top,
895 data->xBackTile, data->yBackTile, data->tileDC,
896 t_x, t_y, GetNHApp()->mapTile_X,
897 GetNHApp()->mapTile_Y, SRCCOPY);
898 }
899 layer++;
900 }
901
902#ifdef USE_PILEMARK

Callers 1

paintFunction · 0.85

Calls 2

GetNHAppFunction · 0.70
RGBClass · 0.50

Tested by

no test coverage detected