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

Function DrawInvBelt

Source/inv.cpp:383–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383void DrawInvBelt()
384{
385 int i, frame, frame_width, color;
386 BYTE fi, ff;
387
388 if (talkflag) {
389 return;
390 }
391
392 DrawPanelBox(205, 21, 232, 28, PANEL_X + 205, PANEL_Y + 5);
393
394 for (i = 0; i < MAXBELTITEMS; i++) {
395 if (plr[myplr].SpdList[i]._itype == ITYPE_NONE) {
396 continue;
397 }
398
399 InvDrawSlotBack(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, 28, 28);
400 frame = plr[myplr].SpdList[i]._iCurs + CURSOR_FIRSTITEM;
401 frame_width = InvItemWidth[frame];
402
403 if (pcursinvitem == i + INVITEM_BELT_FIRST) {
404 color = ICOL_WHITE;
405 if (plr[myplr].SpdList[i]._iMagical)
406 color = ICOL_BLUE;
407 if (!plr[myplr].SpdList[i]._iStatFlag)
408 color = ICOL_RED;
409 if (!sgbControllerActive || invflag)
410 CelBlitOutline(color, InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width);
411 }
412
413 if (plr[myplr].SpdList[i]._iStatFlag) {
414 CelClippedDraw(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width);
415 } else {
416 CelDrawLightRed(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 1);
417 }
418
419 if (AllItemsList[plr[myplr].SpdList[i].IDidx].iUsable
420 && plr[myplr].SpdList[i]._iStatFlag
421 && plr[myplr].SpdList[i]._itype != ITYPE_GOLD) {
422 fi = i + 49;
423 ff = fontframe[gbFontTransTbl[fi]];
424 PrintChar(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X + 28 - fontkern[ff], InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, ff, 0);
425 }
426 }
427}
428
429BOOL AutoPlace(int pnum, int ii, int sx, int sy, BOOL saveflag)
430{

Callers 1

DrawAndBlitFunction · 0.85

Calls 6

DrawPanelBoxFunction · 0.85
InvDrawSlotBackFunction · 0.85
CelBlitOutlineFunction · 0.85
CelClippedDrawFunction · 0.85
CelDrawLightRedFunction · 0.85
PrintCharFunction · 0.85

Tested by

no test coverage detected