Subversion Repositories eduke32

Rev

Rev 4609 | Rev 4624 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4609 Rev 4623
Line 1763... Line 1763...
1763
        if (PLUTOPAK)   // JBF 20030804
1763
        if (PLUTOPAK)   // JBF 20030804
1764
            rotatesprite_fs((MENU_MARGIN_CENTER+100)<<16,36<<16,65536L,0,PLUTOPAKSPRITE+2,(sintable[(totalclock<<4)&2047]>>11),0,2+8);
1764
            rotatesprite_fs((MENU_MARGIN_CENTER+100)<<16,36<<16,65536L,0,PLUTOPAKSPRITE+2,(sintable[(totalclock<<4)&2047]>>11),0,2+8);
1765
        break;
1765
        break;
1766
1766
1767
    case MENU_PLAYER:
1767
    case MENU_PLAYER:
1768
        rotatesprite_fs((260)<<16,(24+(tilesizy[APLAYER]>>1))<<16,49152L,0,1441-((((4-(totalclock>>4)))&3)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
1768
        rotatesprite_fs((260)<<16,(24+(tilesiz[APLAYER].y>>1))<<16,49152L,0,1441-((((4-(totalclock>>4)))&3)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
1769
        break;
1769
        break;
1770
1770
1771
    case MENU_MACROS:
1771
    case MENU_MACROS:
1772
        mgametext(160,144,"Activate in-game with Shift-F#",0,2+8+16);
1772
        mgametext(160,144,"Activate in-game with Shift-F#",0,2+8+16);
1773
        break;
1773
        break;
Line 3546... Line 3546...
3546
                case RangeInt32:
3546
                case RangeInt32:
3547
                {
3547
                {
3548
                    MenuRangeInt32_t *object = (MenuRangeInt32_t*)entry->entry;
3548
                    MenuRangeInt32_t *object = (MenuRangeInt32_t*)entry->entry;
3549
3549
3550
                    int32_t s, p;
3550
                    int32_t s, p;
3551
                    const int32_t z = scale(65536, height, tilesizy[SLIDEBAR]<<16);
3551
                    const int32_t z = scale(65536, height, tilesiz[SLIDEBAR].y<<16);
3552
                    M_ShadePal(object->font, status, &s, &p);
3552
                    M_ShadePal(object->font, status, &s, &p);
3553
3553
3554
                    if (status & (1<<3))
3554
                    if (status & (1<<3))
3555
                        x -= scale(tilesizx[SLIDEBAR]<<16, height, tilesizy[SLIDEBAR]<<16);
3555
                        x -= scale(tilesiz[SLIDEBAR].x<<16, height, tilesiz[SLIDEBAR].y<<16);
3556
3556
3557
                    rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, entry->disabled ? 1 : 0, 2|8|16|ROTATESPRITE_FULL16);
3557
                    rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, entry->disabled ? 1 : 0, 2|8|16|ROTATESPRITE_FULL16);
3558
3558
3559
                    rotatesprite_fs(
3559
                    rotatesprite_fs(
3560
                    x + (1<<16) + scale(scale((tilesizx[SLIDEBAR]-2-tilesizx[SLIDEBAR+1])<<16, height, tilesizy[SLIDEBAR]<<16), *object->variable - object->min, object->max - object->min),
3560
                    x + (1<<16) + scale(scale((tilesiz[SLIDEBAR].x-2-tilesiz[SLIDEBAR+1].x)<<16, height, tilesiz[SLIDEBAR].y<<16), *object->variable - object->min, object->max - object->min),
3561
                    y + scale((tilesizy[SLIDEBAR]-tilesizy[SLIDEBAR+1])<<15, height, tilesizy[SLIDEBAR]<<16) - menu->scrollPos,
3561
                    y + scale((tilesiz[SLIDEBAR].y-tilesiz[SLIDEBAR+1].y)<<15, height, tilesiz[SLIDEBAR].y<<16) - menu->scrollPos,
3562
                    z, 0, SLIDEBAR+1, s, entry->disabled ? 1 : 0, 2|8|16|ROTATESPRITE_FULL16);
3562
                    z, 0, SLIDEBAR+1, s, entry->disabled ? 1 : 0, 2|8|16|ROTATESPRITE_FULL16);
3563
3563
3564
                    if (object->displaytype > 0)
3564
                    if (object->displaytype > 0)
3565
                    {
3565
                    {
3566
                        status |= (1<<3);
3566
                        status |= (1<<3);
Line 3592... Line 3592...
3592
                case RangeFloat:
3592
                case RangeFloat:
3593
                {
3593
                {
3594
                    MenuRangeFloat_t *object = (MenuRangeFloat_t*)entry->entry;
3594
                    MenuRangeFloat_t *object = (MenuRangeFloat_t*)entry->entry;
3595
3595
3596
                    int32_t s, p;
3596
                    int32_t s, p;
3597
                    const int32_t z = scale(65536, height, tilesizy[SLIDEBAR]<<16);
3597
                    const int32_t z = scale(65536, height, tilesiz[SLIDEBAR].y<<16);
3598
                    M_ShadePal(object->font, status, &s, &p);
3598
                    M_ShadePal(object->font, status, &s, &p);
3599
3599
3600
                    if (status & (1<<3))
3600
                    if (status & (1<<3))
3601
                        x -= scale(tilesizx[SLIDEBAR]<<16, height, tilesizy[SLIDEBAR]<<16);
3601
                        x -= scale(tilesiz[SLIDEBAR].x<<16, height, tilesiz[SLIDEBAR].y<<16);
3602
3602
3603
                    rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, p, 2|8|16|ROTATESPRITE_FULL16);
3603
                    rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, p, 2|8|16|ROTATESPRITE_FULL16);
3604
3604
3605
                    rotatesprite_fs(
3605
                    rotatesprite_fs(
3606
                    x + (1<<16) + ((float) scale((tilesizx[SLIDEBAR]-2-tilesizx[SLIDEBAR+1])<<16, height, tilesizy[SLIDEBAR]<<16) * (*object->variable - object->min) / (object->max - object->min)),
3606
                    x + (1<<16) + ((float) scale((tilesiz[SLIDEBAR].x-2-tilesiz[SLIDEBAR+1].x)<<16, height, tilesiz[SLIDEBAR].y<<16) * (*object->variable - object->min) / (object->max - object->min)),
3607
                    y + scale((tilesizy[SLIDEBAR]-tilesizy[SLIDEBAR+1])<<15, height, tilesizy[SLIDEBAR]<<16) - menu->scrollPos,
3607
                    y + scale((tilesiz[SLIDEBAR].y-tilesiz[SLIDEBAR+1].y)<<15, height, tilesiz[SLIDEBAR].y<<16) - menu->scrollPos,
3608
                    z, 0, SLIDEBAR+1, s, p, 2|8|16|ROTATESPRITE_FULL16);
3608
                    z, 0, SLIDEBAR+1, s, p, 2|8|16|ROTATESPRITE_FULL16);
3609
3609
3610
                    if (object->displaytype > 0)
3610
                    if (object->displaytype > 0)
3611
                    {
3611
                    {
3612
                        status |= (1<<3);
3612
                        status |= (1<<3);
Line 3638... Line 3638...
3638
                case RangeDouble:
3638
                case RangeDouble:
3639
                {
3639
                {
3640
                    MenuRangeDouble_t *object = (MenuRangeDouble_t*)entry->entry;
3640
                    MenuRangeDouble_t *object = (MenuRangeDouble_t*)entry->entry;
3641
3641
3642
                    int32_t s, p;
3642
                    int32_t s, p;
3643
                    const int32_t z = scale(65536, height, tilesizy[SLIDEBAR]<<16);
3643
                    const int32_t z = scale(65536, height, tilesiz[SLIDEBAR].y<<16);
3644
                    M_ShadePal(object->font, status, &s, &p);
3644
                    M_ShadePal(object->font, status, &s, &p);
3645
3645
3646
                    if (status & (1<<3))
3646
                    if (status & (1<<3))
3647
                        x -= scale(tilesizx[SLIDEBAR]<<16, height, tilesizy[SLIDEBAR]<<16);
3647
                        x -= scale(tilesiz[SLIDEBAR].x<<16, height, tilesiz[SLIDEBAR].y<<16);
3648
3648
3649
                    rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, p, 2|8|16|ROTATESPRITE_FULL16);
3649
                    rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, p, 2|8|16|ROTATESPRITE_FULL16);
3650
3650
3651
                    rotatesprite_fs(
3651
                    rotatesprite_fs(
3652
                    x + (1<<16) + ((double) scale((tilesizx[SLIDEBAR]-2-tilesizx[SLIDEBAR+1])<<16, height, tilesizy[SLIDEBAR]<<16) * (*object->variable - object->min) / (object->max - object->min)),
3652
                    x + (1<<16) + ((double) scale((tilesiz[SLIDEBAR].x-2-tilesiz[SLIDEBAR+1].x)<<16, height, tilesiz[SLIDEBAR].y<<16) * (*object->variable - object->min) / (object->max - object->min)),
3653
                    y + scale((tilesizy[SLIDEBAR]-tilesizy[SLIDEBAR+1])<<15, height, tilesizy[SLIDEBAR]<<16) - menu->scrollPos,
3653
                    y + scale((tilesiz[SLIDEBAR].y-tilesiz[SLIDEBAR+1].y)<<15, height, tilesiz[SLIDEBAR].y<<16) - menu->scrollPos,
3654
                    z, 0, SLIDEBAR+1, s, p, 2|8|16|ROTATESPRITE_FULL16);
3654
                    z, 0, SLIDEBAR+1, s, p, 2|8|16|ROTATESPRITE_FULL16);
3655
3655
3656
                    if (object->displaytype > 0)
3656
                    if (object->displaytype > 0)
3657
                    {
3657
                    {
3658
                        status |= (1<<3);
3658
                        status |= (1<<3);
Line 3688... Line 3688...
3688
                    if (entry == currentry && object->editfield != NULL)
3688
                    if (entry == currentry && object->editfield != NULL)
3689
                    {
3689
                    {
3690
                        const vec2_t dim = M_MenuText(x, y + (height>>1), object->font, object->editfield, status | (1<<5));
3690
                        const vec2_t dim = M_MenuText(x, y + (height>>1), object->font, object->editfield, status | (1<<5));
3691
                        const int32_t h = max(dim.y, entry->font->yline);
3691
                        const int32_t h = max(dim.y, entry->font->yline);
3692
3692
3693
                        rotatesprite_fs(x + dim.x + (1<<16) + scale(tilesizx[SPINNINGNUKEICON]<<15, h, tilesizy[SPINNINGNUKEICON]<<16), y + (height>>1) - menu->scrollPos, scale(65536, h, tilesizy[SPINNINGNUKEICON]<<16), 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10);
3693
                        rotatesprite_fs(x + dim.x + (1<<16) + scale(tilesiz[SPINNINGNUKEICON].x<<15, h, tilesiz[SPINNINGNUKEICON].y<<16), y + (height>>1) - menu->scrollPos, scale(65536, h, tilesiz[SPINNINGNUKEICON].y<<16), 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10);
3694
                    }
3694
                    }
3695
                    else
3695
                    else
3696
                        M_MenuText(x, y + (height>>1) - menu->scrollPos, object->font, object->variable, status);
3696
                        M_MenuText(x, y + (height>>1) - menu->scrollPos, object->font, object->variable, status);
3697
                    break;
3697
                    break;
3698
                }
3698
                }
Line 3713... Line 3713...
3713
    menu->totalHeight = totalextent - menu->ytop;
3713
    menu->totalHeight = totalextent - menu->ytop;
3714
3714
3715
    // draw indicators if applicable
3715
    // draw indicators if applicable
3716
    if (totalextent > menu->bottomcutoff)
3716
    if (totalextent > menu->bottomcutoff)
3717
    {
3717
    {
3718
        rotatesprite((320 - tilesizx[SELECTDIR])<<16, menu->ytop, 65536, 0, SELECTDIR, menu->scrollPos > 0 ? 0 : 20, 0, 26, 0, 0, xdim-1, scale(ydim, menu->ytop + (tilesizy[SELECTDIR]<<15), 200<<16) - 1);
3718
        rotatesprite((320 - tilesiz[SELECTDIR].x)<<16, menu->ytop, 65536, 0, SELECTDIR, menu->scrollPos > 0 ? 0 : 20, 0, 26, 0, 0, xdim-1, scale(ydim, menu->ytop + (tilesiz[SELECTDIR].y<<15), 200<<16) - 1);
3719
        rotatesprite((320 - tilesizx[SELECTDIR])<<16, menu->bottomcutoff - (tilesizy[SELECTDIR]<<16), 65536, 0, SELECTDIR, menu->ytop + menu->totalHeight - menu->scrollPos > menu->bottomcutoff ? 0 : 20, 0, 26, 0, scale(ydim, menu->bottomcutoff - (tilesizy[SELECTDIR]<<15), 200<<16), xdim-1, ydim-1);
3719
        rotatesprite((320 - tilesiz[SELECTDIR].x)<<16, menu->bottomcutoff - (tilesiz[SELECTDIR].y<<16), 65536, 0, SELECTDIR, menu->ytop + menu->totalHeight - menu->scrollPos > menu->bottomcutoff ? 0 : 20, 0, 26, 0, scale(ydim, menu->bottomcutoff - (tilesiz[SELECTDIR].y<<15), 200<<16), xdim-1, ydim-1);
3720
    }
3720
    }
3721
3721
3722
    return menu->totalHeight;
3722
    return menu->totalHeight;
3723
}
3723
}
3724
3724
Line 3773... Line 3773...
3773
    y -= calculatedentryspacing;
3773
    y -= calculatedentryspacing;
3774
3774
3775
    // draw indicators if applicable
3775
    // draw indicators if applicable
3776
    if (y > object->options->list->bottomcutoff)
3776
    if (y > object->options->list->bottomcutoff)
3777
    {
3777
    {
3778
        rotatesprite((320 - tilesizx[SELECTDIR])<<16, object->options->list->pos.y, 65536, 0, SELECTDIR, object->options->scrollPos > 0 ? 0 : 20, 0, 26, 0, 0, xdim-1, scale(ydim, object->options->list->pos.y + (tilesizy[SELECTDIR]<<15), 200<<16) - 1);
3778
        rotatesprite((320 - tilesiz[SELECTDIR].x)<<16, object->options->list->pos.y, 65536, 0, SELECTDIR, object->options->scrollPos > 0 ? 0 : 20, 0, 26, 0, 0, xdim-1, scale(ydim, object->options->list->pos.y + (tilesiz[SELECTDIR].y<<15), 200<<16) - 1);
3779
        rotatesprite((320 - tilesizx[SELECTDIR])<<16, object->options->list->bottomcutoff - (tilesizy[SELECTDIR]<<16), 65536, 0, SELECTDIR, y - object->options->scrollPos > object->options->list->bottomcutoff ? 0 : 20, 0, 26, 0, scale(ydim, object->options->list->bottomcutoff - (tilesizy[SELECTDIR]<<15), 200<<16), xdim-1, ydim-1);
3779
        rotatesprite((320 - tilesiz[SELECTDIR].x)<<16, object->options->list->bottomcutoff - (tilesiz[SELECTDIR].y<<16), 65536, 0, SELECTDIR, y - object->options->scrollPos > object->options->list->bottomcutoff ? 0 : 20, 0, 26, 0, scale(ydim, object->options->list->bottomcutoff - (tilesiz[SELECTDIR].y<<15), 200<<16), xdim-1, ydim-1);
3780
    }
3780
    }
3781
}
3781
}
3782
3782
3783
static void M_RunMenu_AbbreviateNameIntoBuffer(const char* name, int32_t entrylength)
3783
static void M_RunMenu_AbbreviateNameIntoBuffer(const char* name, int32_t entrylength)
3784
{
3784
{