MCPcopy Create free account
hub / github.com/NetHack/NetHack / DrawCol

Function DrawCol

sys/amiga/winreq.c:650–730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

648}
649
650void
651DrawCol(struct Window *w, int idx, UWORD *colors)
652{
653 int bxorx, bxory, bxxlen, bxylen;
654 int i, incx, incy, r, g, b;
655 long mflags;
656
657 bxylen = Col_Okay.TopEdge - (Col_BluePen.TopEdge + Col_BluePen.Height) - 1
658 - txheight - 3;
659 bxxlen = Col_BluePen.Width - 2;
660 bxorx = Col_BluePen.LeftEdge + 1;
661 bxory = Col_BluePen.TopEdge + Col_BluePen.Height + 2;
662
663 incx = bxxlen / amii_numcolors;
664 incy = bxylen - 2;
665
666 bxxlen /= incx;
667 bxxlen *= incx;
668 bxxlen += 2;
669
670 for (i = 0; i < amii_numcolors; ++i) {
671 int x, y;
672 x = bxorx + 2 + (i * incx);
673 y = bxory + 2;
674
675 if (i == idx) {
676 SetAPen(w->RPort, sysflags.amii_dripens[SHADOWPEN]);
677 Move(w->RPort, x, y + bxylen - 4);
678 Draw(w->RPort, x, y);
679 Draw(w->RPort, x + incx - 1, y);
680
681 Move(w->RPort, x + 1, y + bxylen - 5);
682 Draw(w->RPort, x + 1, y + 1);
683 Draw(w->RPort, x + incx - 2, y + 1);
684
685 SetAPen(w->RPort, sysflags.amii_dripens[SHINEPEN]);
686 Move(w->RPort, x + incx - 1, y + 1);
687 Draw(w->RPort, x + incx - 1, y + bxylen - 4);
688 Draw(w->RPort, x, y + bxylen - 4);
689
690 Move(w->RPort, x + incx - 2, y + 2);
691 Draw(w->RPort, x + incx - 2, y + bxylen - 5);
692 Draw(w->RPort, x + 1, y + bxylen - 5);
693 } else {
694 SetAPen(w->RPort, C_BLACK);
695 Move(w->RPort, x, y);
696 Draw(w->RPort, x + incx - 1, y);
697 Draw(w->RPort, x + incx - 1, y + bxylen - 4);
698 Draw(w->RPort, x, y + bxylen - 4);
699 Draw(w->RPort, x, y);
700 SetAPen(w->RPort, C_BLACK);
701 Move(w->RPort, x + 1, y + 1);
702 Draw(w->RPort, x + incx - 2, y + 1);
703 Draw(w->RPort, x + incx - 2, y + bxylen - 6);
704 Draw(w->RPort, x + 1, y + bxylen - 6);
705 Draw(w->RPort, x + 1, y + 1);
706 }
707

Callers 1

EditColorFunction · 0.85

Calls 1

DispColFunction · 0.85

Tested by

no test coverage detected