예제 #1
0
파일: mapedit.c 프로젝트: Jedzia/acm3
void enterfilename(char *text, char *buffer)
{
    int c;
    for (c = strlen(buffer); c < 13; c++) buffer[c] = 0;

    kbd_getascii();

    for (;;)
    {
        int ascii;
        int cursorpos;

        win_getspeed(60);
        key = kbd_getkey();
        ascii = kbd_getascii();
        getmousemove();
        getmousebuttons();

        cursorpos = strlen(buffer);
        if (ascii == 8)
        {
            if (cursorpos)
            {
                buffer[cursorpos-1] = 0;
            }
        }
        if (ascii == 27)
        {
            memset(buffer, 0, 13);
            return;
        }
        if (ascii == 13) return;
        if ((ascii >= 32) && (cursorpos < 12))
        {
            buffer[cursorpos] = ascii;
        }

        gfx_fillscreen(0);
        txt_printcenter(80, SPR_FONTS, text);
        txt_printcenter(90, SPR_FONTS, buffer);
        gfx_updatepage();
    }
}
예제 #2
0
파일: mapedit.c 프로젝트: Jedzia/acm3
void layeroptions(void)
{
    int newsizex = layer[cl].xsize;
    int newsizey = layer[cl].ysize;

    for (;;)
    {
        win_getspeed(60);
        key = kbd_getkey();

        if ((key == KEY_ESC) || (key == KEY_ENTER)) break;
        if (key == KEY_DOWN) layermenusel++;
        if (key == KEY_UP) layermenusel--;
        if (layermenusel < 0) layermenusel = 5;
        if (layermenusel > 5) layermenusel = 0;
        if (key == KEY_I)
        {
            newsizey -= 10;
            if (newsizey < minysize) newsizey = 0;
        }
        if (key == KEY_J)
        {
            newsizex -= 10;
            if (newsizex < minxsize) newsizex = 0;
        }
        if (key == KEY_M)
        {
            if (newsizey) newsizey += 10;
            else newsizey = minysize;
        }
        if (key == KEY_K)
        {
            if (newsizex) newsizex += 10;
            else newsizex = minxsize;
        }
        if (key == KEY_RIGHT)
        {
            switch(layermenusel)
            {
                case 0:
                if (newsizex) newsizex++;
                else newsizex = minxsize;
                break;

                case 1:
                if (newsizey) newsizey++;
                else newsizey = minysize;
                break;

                case 2:
                layer[cl].xdivisor++;
                break;

                case 3:
                layer[cl].ydivisor++;
                break;

                case 4:
                layer[cl].xwrap ^= 1;
                break;

                case 5:
                layer[cl].ywrap ^= 1;
                break;
            }
        }
        if (key == KEY_LEFT)
        {
            switch(layermenusel)
            {
                case 0:
                if (newsizex) newsizex--;
                if (newsizex < minxsize) newsizex = 0;
                break;

                case 1:
                if (newsizey) newsizey--;
                if (newsizey < minysize) newsizey = 0;
                break;

                case 2:
                if (layer[cl].xdivisor) layer[cl].xdivisor--;
                break;

                case 3:
                if (layer[cl].ydivisor) layer[cl].ydivisor--;
                break;

                case 4:
                layer[cl].xwrap ^= 1;
                break;

                case 5:
                layer[cl].ywrap ^= 1;
                break;
            }
        }

        gfx_fillscreen(0);
        sprintf(printbuffer, "LAYER %d OPTIONS", cl+1);
        txt_printcenter(40, SPR_FONTS, printbuffer);
        sprintf(printbuffer, "X SIZE %04d", newsizex);
        txt_printcenter(60, SPR_FONTS, printbuffer);
        sprintf(printbuffer, "Y SIZE %04d", newsizey);
        txt_printcenter(70, SPR_FONTS, printbuffer);
        sprintf(printbuffer, "X DIVISOR %03d", layer[cl].xdivisor);
        txt_printcenter(80, SPR_FONTS, printbuffer);
        sprintf(printbuffer, "Y DIVISOR %03d", layer[cl].ydivisor);
        txt_printcenter(90, SPR_FONTS, printbuffer);
        if (layer[cl].xwrap) txt_printcenter(100, SPR_FONTS, "X WRAP ON");
        else txt_printcenter(100, SPR_FONTS, "X WRAP OFF");
        if (layer[cl].ywrap) txt_printcenter(100, SPR_FONTS, "Y WRAP ON");
        else txt_printcenter(110, SPR_FONTS, "Y WRAP OFF");
        gfx_drawsprite(100, 60+layermenusel*10, 0x00010004);
        gfx_updatepage();

    }

    if ((newsizex != layer[cl].xsize) || (newsizey != layer[cl].ysize))
    {
        resizelayer(cl, newsizex, newsizey);
    }
    mark = 0;
    copybuffer = 0;
}
예제 #3
0
파일: mapedit.c 프로젝트: Jedzia/acm3
void help(void)
{
    gfx_fillscreen(0);
    txt_printcenter(0, SPR_FONTS, "MAP EDITOR HELP");
    txt_printcenter(16, SPR_FONTS, "F1 - LOAD MAP");
    txt_printcenter(24, SPR_FONTS, "F2 - SAVE MAP");
    txt_printcenter(32, SPR_FONTS, "F3 - LOAD BLOCKS");
    txt_printcenter(40, SPR_FONTS, "F4 - LOAD PALETTE");
    txt_printcenter(48, SPR_FONTS, "F10 - THIS SCREEN");
    txt_printcenter(56, SPR_FONTS, "F12 - SWITCH SCREENMODE");
    txt_printcenter(64, SPR_FONTS, "ESC - EXIT PROGRAM");
    txt_printcenter(80, SPR_FONTS, "1,2,3,4 - SELECT LAYER TO WORK ON");
    txt_printcenter(88, SPR_FONTS, "5,6,7,8 - TOGGLE LAYER VISIBILITY");
    txt_printcenter(96, SPR_FONTS, "L - LAYER SIZE & OPTIONS");
    txt_printcenter(104, SPR_FONTS, "G - GRAB BLOCK UNDER CURSOR");
    txt_printcenter(112, SPR_FONTS, "C - COPY MARKED AREA");
    txt_printcenter(120, SPR_FONTS, "F,B - FILL MARKED AREA");
    txt_printcenter(128, SPR_FONTS, "P - PASTE MARKED AREA");
    txt_printcenter(136, SPR_FONTS, "Z,X - SELECT BLOCK");
    txt_printcenter(144, SPR_FONTS, "A,S - SELECT BLOCK FAST");
    txt_printcenter(152, SPR_FONTS, "SCROLLLOCK - TOGGLE MOUSE SCROLLING");
    txt_printcenter(160, SPR_FONTS, "I,J,K,M - CHANGE SIZE FAST IN LAYER OPT.");
    txt_printcenter(176, SPR_FONTS, "USE LEFT MOUSEBUTTON TO DRAW AND RIGHT");
    txt_printcenter(184, SPR_FONTS, "MOUSEBUTTON TO MARK AREAS.");
    gfx_updatepage();

    for (;;)
    {
        win_getspeed(60);
        key = kbd_getkey();
        getmousemove();
        getmousebuttons();
        if ((mouseb) || (key)) break;
    }
}
예제 #4
0
파일: infedit.c 프로젝트: neuromancer/BOFH
void help(void)
{
    gfx_fillscreen(0);
    txt_printcenter(0, SPR_FONTS, "BLOCKINFO EDITOR HELP");
    txt_printcenter(16, SPR_FONTS, "F1 - LOAD BLOCKINFO");
    txt_printcenter(24, SPR_FONTS, "F2 - SAVE BLOCKINFO");
    txt_printcenter(32, SPR_FONTS, "F3 - LOAD MAP");
    txt_printcenter(40, SPR_FONTS, "F4 - SAVE MAP");
    txt_printcenter(48, SPR_FONTS, "F10 - THIS SCREEN");
    txt_printcenter(56, SPR_FONTS, "F12 - SWITCH SCREENMODE");
    txt_printcenter(64, SPR_FONTS, "ESC - EXIT PROGRAM");
    txt_printcenter(80, SPR_FONTS, "Z,X,A,S - SELECT BLOCK");
    txt_printcenter(88, SPR_FONTS, "C - CLEAR BLOCKINFO FOR CURRENT BLOCK");
    txt_printcenter(96, SPR_FONTS, "P,T - PUT/TAKE BLOCKINFO TO COPYBUFFER");
    txt_printcenter(112, SPR_FONTS, "LEFT MOUSEBUTTON SETS A BIT");
    txt_printcenter(120, SPR_FONTS, "RIGHT MOUSEBUTTON CLEARS A BIT");
    gfx_updatepage();

    for (;;)
    {
        win_getspeed(60);
        key = kbd_getkey();
        getmousemove();
        getmousebuttons();
        if ((mouseb) || (key)) break;
    }
}