|
|
|
|
@ -27,6 +27,7 @@
|
|
|
|
|
#include "towners.h" |
|
|
|
|
#include "trigs.h" |
|
|
|
|
#include "utils/language.h" |
|
|
|
|
#include "utils/sdl_geometry.h" |
|
|
|
|
|
|
|
|
|
namespace devilution { |
|
|
|
|
namespace { |
|
|
|
|
@ -545,12 +546,7 @@ void ClearPanel()
|
|
|
|
|
|
|
|
|
|
void DrawPanelBox(const CelOutputBuffer &out, SDL_Rect srcRect, Point targetPosition) |
|
|
|
|
{ |
|
|
|
|
const BYTE *src = pBtmBuff.at(srcRect.x, srcRect.y); |
|
|
|
|
BYTE *dst = &out[targetPosition]; |
|
|
|
|
|
|
|
|
|
for (int hgt = srcRect.h; hgt != 0; hgt--, src += pBtmBuff.pitch(), dst += out.pitch()) { |
|
|
|
|
memcpy(dst, src, srcRect.w); |
|
|
|
|
} |
|
|
|
|
out.BlitFrom(pBtmBuff, srcRect, targetPosition); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -565,11 +561,7 @@ void DrawPanelBox(const CelOutputBuffer &out, SDL_Rect srcRect, Point targetPosi
|
|
|
|
|
*/ |
|
|
|
|
static void DrawFlaskTop(const CelOutputBuffer &out, Point position, const CelOutputBuffer &celBuf, int y0, int y1) |
|
|
|
|
{ |
|
|
|
|
const BYTE *src = celBuf.at(0, y0); |
|
|
|
|
BYTE *dst = &out[position]; |
|
|
|
|
|
|
|
|
|
for (int h = y1 - y0; h != 0; --h, src += celBuf.pitch(), dst += out.pitch()) |
|
|
|
|
memcpy(dst, src, celBuf.w()); |
|
|
|
|
out.BlitFrom(celBuf, SDL_Rect { 0, static_cast<decltype(SDL_Rect {}.y)>(y0), celBuf.w(), y1 - y0 }, position); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -584,17 +576,8 @@ static void DrawFlaskTop(const CelOutputBuffer &out, Point position, const CelOu
|
|
|
|
|
*/ |
|
|
|
|
static void DrawFlask(const CelOutputBuffer &out, const CelOutputBuffer &celBuf, Point sourcePosition, Point targetPosition, int h) |
|
|
|
|
{ |
|
|
|
|
const BYTE *src = &celBuf[sourcePosition]; |
|
|
|
|
BYTE *dst = &out[targetPosition]; |
|
|
|
|
|
|
|
|
|
for (int hgt = h; hgt != 0; hgt--, src += celBuf.pitch() - 59, dst += out.pitch() - 59) { |
|
|
|
|
for (int wdt = 59; wdt != 0; wdt--) { |
|
|
|
|
if (*src != 0) |
|
|
|
|
*dst = *src; |
|
|
|
|
src++; |
|
|
|
|
dst++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
constexpr int FlaskWidth = 59; |
|
|
|
|
out.BlitFromSkipColorIndexZero(celBuf, MakeSdlRect(sourcePosition.x, sourcePosition.y, FlaskWidth, h), targetPosition); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DrawLifeFlask(const CelOutputBuffer &out) |
|
|
|
|
|