Esempio n. 1
0
void CON_Draw(void)
{
    int     line;
    float   y = 0;
    float   x = 0;
    float   inputlen;

    if(oldiwad && !console_enabled)
    {
        Draw_ConsoleText(8, 16, RED, CONFONT_SCALE, "IWAD is out of date. Please use Wadgen to generate a new one");
    }
    
    if(!console_linebuffer)
        return;

    if(!console_enabled)
        return;
    
    GL_SetOrtho(1);
    GL_SetState(GLSTATE_BLEND, 1);

    dglDisable(GL_TEXTURE_2D);
    dglColor4ub(0, 0, 0, 128);
    dglRectf(SCREENWIDTH, CONSOLE_Y + CONFONT_YPAD, 0, 0);

    GL_SetState(GLSTATE_BLEND, 0);
    
    dglColor4f(0, 1, 0, 1);
    dglBegin(GL_LINES);
    dglVertex2f(0, CONSOLE_Y - 1);
    dglVertex2f(SCREENWIDTH, CONSOLE_Y - 1);
    dglVertex2f(0, CONSOLE_Y + CONFONT_YPAD);
    dglVertex2f(SCREENWIDTH, CONSOLE_Y + CONFONT_YPAD);
    dglEnd();
    dglEnable(GL_TEXTURE_2D);
    
    line = console_head;
    
    y = CONSOLE_Y - 2;

    if(line < MAX_CONSOLE_LINES)
    {
        while(console_buffer[line] && y > 0)
        {
            Draw_ConsoleText(0, y, console_buffer[line]->color, CONFONT_SCALE, "%s", console_buffer[line]->line);
            line = (line + 1) & CONSOLETEXT_MASK;
            y -= CONFONT_YPAD;
        }
    }

    Draw_ConsoleText(SCREENWIDTH - (64 * CONFONT_SCALE), CONSOLE_Y - 2,
        RED, CONFONT_SCALE, "rev. %s", PACKAGE_VERSION);
    
    y = CONSOLE_Y + CONFONT_YPAD;

    inputlen = Draw_ConsoleText(x, y, WHITE, CONFONT_SCALE, "%s", console_inputbuffer);
    Draw_ConsoleText(x + inputlen, y, WHITE, CONFONT_SCALE, "_");
}
Esempio n. 2
0
void CON_Draw(void) {
    int     line;
    float   y = 0;
    float   x = 0;
    float   inputlen;

    if(!console_linebuffer) {
        return;
    }

    if(!console_enabled) {
        return;
    }

    GL_SetOrtho(1);
    GL_SetState(GLSTATE_BLEND, 1);

    dglDisable(GL_TEXTURE_2D);
    dglColor4ub(0, 0, 0, 128);
    dglRectf(SCREENWIDTH, CONSOLE_Y + CONFONT_YPAD, 0, 0);

    GL_SetState(GLSTATE_BLEND, 0);

    dglColor4f(0, 1, 0, 1);
    dglBegin(GL_LINES);
    dglVertex2f(0, CONSOLE_Y - 1);
    dglVertex2f(SCREENWIDTH, CONSOLE_Y - 1);
    dglVertex2f(0, CONSOLE_Y + CONFONT_YPAD);
    dglVertex2f(SCREENWIDTH, CONSOLE_Y + CONFONT_YPAD);
    dglEnd();
    dglEnable(GL_TEXTURE_2D);

    line = console_head;

    y = CONSOLE_Y - 2;

    if(line < MAX_CONSOLE_LINES) {
        while(console_buffer[line] && y > 0) {
            Draw_ConsoleText(0, y, console_buffer[line]->color, CONFONT_SCALE, "%s", console_buffer[line]->line);
            line = (line + 1) & CONSOLETEXT_MASK;
            y -= CONFONT_YPAD;
        }
    }

    y = CONSOLE_Y + CONFONT_YPAD;

    inputlen = Draw_ConsoleText(x, y, WHITE, CONFONT_SCALE, "%s", console_inputbuffer);
    Draw_ConsoleText(x + inputlen, y, WHITE, CONFONT_SCALE, "_");
}