- text mode window dimension variables renamed to text_cols and text_rows.

The variables are now updated in function dimension_update() and used in
  function text_update()
This commit is contained in:
Volker Ruppert 2003-05-18 18:54:02 +00:00
parent 1f65f19d42
commit 9d36d1287f

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: x.cc,v 1.66 2003-05-14 16:09:53 vruppert Exp $
// $Id: x.cc,v 1.67 2003-05-18 18:54:02 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -77,7 +77,7 @@ static unsigned long white_pixel=0, black_pixel=0;
static char *progname; /* name this program was invoked by */
static unsigned int rows=25, columns=80;
static unsigned int text_rows=25, text_cols=80;
static Window win;
static GC gc, gc_inv, gc_headerbar, gc_headerbar_inv;
@ -377,8 +377,8 @@ bx_x_gui_c::specific_init(int argc, char **argv, unsigned tilewidth, unsigned ti
font_width = 8;
font_height = 16;
dimension_x = columns * font_width;
dimension_y = rows * font_height + headerbar_y;
dimension_x = text_cols * font_width;
dimension_y = text_rows * font_height + headerbar_y;
/* create opaque window */
win = XCreateSimpleWindow(bx_x_display, RootWindow(bx_x_display,bx_x_screen_num),
@ -1071,6 +1071,7 @@ bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
bx_bool force_update=0;
unsigned char cell[64];
UNUSED(nrows);
if (charmap_updated) {
BX_INFO(("charmap update. Font Height is %d",font_height));
for (unsigned c = 0; c<256; c++) {
@ -1107,7 +1108,7 @@ bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
}
// first draw over character at original block cursor location
if ( (prev_block_cursor_y < nrows) && (prev_block_cursor_x < columns) ) {
if ( (prev_block_cursor_y < text_rows) && (prev_block_cursor_x < text_cols) ) {
curs = prev_block_cursor_y * tm_info.line_offset + prev_block_cursor_x * 2;
cChar = new_text[curs];
XSetForeground(bx_x_display, gc, col_vals[DEV_vga_get_actl_pal_idx(new_text[curs+1] & 0x0f)]);
@ -1118,10 +1119,10 @@ bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
}
new_start = new_text;
rows = nrows;
rows = text_rows;
y = 0;
do {
hchars = columns;
hchars = text_cols;
new_line = new_text;
old_line = old_text;
x = 0;
@ -1152,7 +1153,7 @@ bx_x_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
prev_block_cursor_y = cursor_y;
// now draw character at new block cursor location in reverse
if ( (cursor_y < nrows) && (cursor_x < columns ) && (tm_info.cs_start <= tm_info.cs_end) ) {
if ( (cursor_y < text_rows) && (cursor_x < text_cols ) && (tm_info.cs_start <= tm_info.cs_end) ) {
curs = cursor_y * tm_info.line_offset + cursor_x * 2;
cChar = new_start[curs];
XSetForeground(bx_x_display, gc, col_vals[DEV_vga_get_actl_pal_idx((new_start[curs+1] & 0xf0) >> 4)]);
@ -1303,7 +1304,8 @@ bx_x_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned
if (fheight > 0) {
font_height = fheight;
font_width = fwidth;
columns = x / font_width;
text_cols = x / font_width;
text_rows = y / font_height;
}
if ( (x != dimension_x) || (y != (dimension_y-bx_headerbar_y)) ) {
XSizeHints hints;