inventory items rendering cleanup (#1938)

This commit is contained in:
qndel 2021-05-14 12:46:16 +02:00 committed by GitHub
commit 89c40eaa7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 39 deletions

View file

@ -647,12 +647,20 @@ void CelClippedDrawLightTo(const CelOutputBuffer &out, int sx, int sy, const Cel
CelBlitSafeTo(out, sx, sy, pRLEBytes, nDataSize, cel.Width(frame));
}
void CelDrawLightRedTo(const CelOutputBuffer &out, int sx, int sy, const CelSprite &cel, int frame, char light)
void CelDrawLightRedTo(const CelOutputBuffer &out, int sx, int sy, const CelSprite &cel, int frame)
{
int nDataSize;
const auto *pRLEBytes = CelGetFrameClipped(cel.Data(), frame, &nDataSize);
const std::uint8_t *tbl = GetLightTable(light);
RenderCelWithLightTable(out, { sx, sy }, pRLEBytes, nDataSize, cel.Width(frame), tbl);
RenderCelWithLightTable(out, { sx, sy }, pRLEBytes, nDataSize, cel.Width(frame), GetLightTable(1));
}
void CelDrawItem(bool usable, const CelOutputBuffer &out, int x, int y, const CelSprite &cel, int frame)
{
if (usable) {
CelDrawLightRedTo(out, x, y, cel, frame);
} else {
CelClippedDrawTo(out, x, y, cel, frame);
}
}
void CelClippedDrawSafeTo(const CelOutputBuffer &out, int sx, int sy, const CelSprite &cel, int frame)
@ -678,11 +686,11 @@ void CelClippedBlitLightTransTo(const CelOutputBuffer &out, int sx, int sy, cons
CelBlitSafeTo(out, sx, sy, pRLEBytes, nDataSize, cel.Width(frame));
}
void CelDrawLightRedSafeTo(const CelOutputBuffer &out, int sx, int sy, const CelSprite &cel, int frame, char light)
void CelDrawLightRedSafeTo(const CelOutputBuffer &out, int sx, int sy, const CelSprite &cel, int frame)
{
int nDataSize;
const auto *pRLEBytes = CelGetFrameClipped(cel.Data(), frame, &nDataSize);
RenderCelWithLightTable(out, { sx, sy }, pRLEBytes, nDataSize, cel.Width(frame), GetLightTable(light));
RenderCelWithLightTable(out, { sx, sy }, pRLEBytes, nDataSize, cel.Width(frame), GetLightTable(1));
}
void CelDrawUnsafeTo(const CelOutputBuffer &out, int x, int y, const CelSprite &cel, int frame)