MCPcopy Create free account
hub / github.com/diasurgical/devilution / DrawFlask

Function DrawFlask

Source/control.cpp:595–611  ·  view source on GitHub ↗

* Draws the dome of the flask that protrudes above the panel top line. * It draws a rectangle of fixed width 59 and height 'h' from the source buffer * into the target buffer. * @param pCelBuff The flask cel buffer. * @param w Width of the cel. * @param nSrcOff Offset of the source buffer from where the bytes will start to be copied from. * @param pBuff Target buffer. * @param nDstOf

Source from the content-addressed store, hash-verified

593 * @param h How many lines of the source buffer that will be copied.
594 */
595void DrawFlask(BYTE *pCelBuff, int w, int nSrcOff, BYTE *pBuff, int nDstOff, int h)
596{
597 int wdt, hgt;
598 BYTE *src, *dst;
599
600 src = &pCelBuff[nSrcOff];
601 dst = &pBuff[nDstOff];
602
603 for (hgt = h; hgt; hgt--, src += w - 59, dst += BUFFER_WIDTH - 59) {
604 for (wdt = 59; wdt; wdt--) {
605 if (*src)
606 *dst = *src;
607 src++;
608 dst++;
609 }
610 }
611}
612
613/**
614 * Draws the top dome of the life flask (that part that protrudes out of the control panel).

Callers 2

DrawLifeFlaskFunction · 0.85
DrawManaFlaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected