erebus

diff src/console.cc @ 40:9d6368850fe1

minor enhancements and bugfixes to the console stuff
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 10 Jun 2014 10:53:19 +0300
parents 5e27c85e79ca
children 2e817711d0f6
line diff
     1.1 --- a/src/console.cc	Mon Jun 09 23:57:24 2014 +0300
     1.2 +++ b/src/console.cc	Tue Jun 10 10:53:19 2014 +0300
     1.3 @@ -107,7 +107,7 @@
     1.4  		switch(c) {
     1.5  		case '\n':
     1.6  		case '\r':
     1.7 -			if(cmd_handler) {
     1.8 +			if(!input.empty() && cmd_handler) {
     1.9  				cmd_handler(input.c_str());
    1.10  			}
    1.11  
    1.12 @@ -224,6 +224,7 @@
    1.13  
    1.14  	glPushAttrib(GL_ENABLE_BIT);
    1.15  	glEnable(GL_BLEND);
    1.16 +	glDisable(GL_TEXTURE_2D);
    1.17  	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    1.18  
    1.19  	glBegin(GL_QUADS);
    1.20 @@ -234,8 +235,8 @@
    1.21  	glVertex2f(0, 0);
    1.22  
    1.23  	glColor4f(0.5, 0.2, 0.1, 0.7);
    1.24 -	glVertex2f(0, -(outbox_height + line_height));
    1.25 -	glVertex2f(max_width, -(outbox_height + line_height));
    1.26 +	glVertex2f(0, -(outbox_height + line_height * 1.5));
    1.27 +	glVertex2f(max_width, -(outbox_height + line_height * 1.5));
    1.28  	glVertex2f(max_width, -outbox_height);
    1.29  	glVertex2f(0, -outbox_height);
    1.30  	glEnd();
    1.31 @@ -257,8 +258,8 @@
    1.32  	float cursor_x = dtx_char_pos(inpline.c_str(), cursor + 2);
    1.33  	glBegin(GL_QUADS);
    1.34  	glColor4f(1, 1, 1, 0.7);
    1.35 -	glVertex2f(cursor_x, 2);
    1.36 -	glVertex2f(cursor_x + 2, 2);
    1.37 +	glVertex2f(cursor_x, 0);
    1.38 +	glVertex2f(cursor_x + 2, 0);
    1.39  	glVertex2f(cursor_x + 2, line_height - 2);
    1.40  	glVertex2f(cursor_x, line_height - 2);
    1.41  	glEnd();