summaryrefslogtreecommitdiffstats
path: root/screen-display.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-12-06 10:36:01 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-12-06 10:36:01 +0000
commit8ec9b07c839cf1c924687d14c660ffaecca9586a (patch)
treef010ac2b177ba343d8d5d5aa47c559fcbc84e183 /screen-display.c
parent4f44b09195646799e6c639c8bf0fde968eee7a44 (diff)
Screen debugging.
Diffstat (limited to 'screen-display.c')
-rw-r--r--screen-display.c96
1 files changed, 71 insertions, 25 deletions
diff --git a/screen-display.c b/screen-display.c
index d786c19c..66cd4e1d 100644
--- a/screen-display.c
+++ b/screen-display.c
@@ -1,4 +1,4 @@
-/* $Id: screen-display.c,v 1.11 2007-12-06 10:16:36 nicm Exp $ */
+/* $Id: screen-display.c,v 1.12 2007-12-06 10:36:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -34,8 +34,10 @@ screen_display_set_cell(
void
screen_display_make_lines(struct screen *s, u_int py, u_int ny)
{
- if (ny == 0 || !screen_in_y(s, py) || !screen_in_y(s, py + ny - 1))
+ if (ny == 0 || !screen_in_y(s, py) || !screen_in_y(s, py + ny - 1)) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
screen_make_lines(s, screen_y(s, py), ny);
}
@@ -43,8 +45,10 @@ screen_display_make_lines(struct screen *s, u_int py, u_int ny)
void
screen_display_free_lines(struct screen *s, u_int py, u_int ny)
{
- if (ny == 0 || !screen_in_y(s, py) || !screen_in_y(s, py + ny - 1))
+ if (ny == 0 || !screen_in_y(s, py) || !screen_in_y(s, py + ny - 1)) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
screen_free_lines(s, screen_y(s, py), ny);
}
@@ -52,10 +56,14 @@ screen_display_free_lines(struct screen *s, u_int py, u_int ny)
void
screen_display_move_lines(struct screen *s, u_int dy, u_int py, u_int ny)
{
- if (ny == 0 || !screen_in_y(s, py) || !screen_in_y(s, py + ny - 1))
+ if (ny == 0 || !screen_in_y(s, py) || !screen_in_y(s, py + ny - 1)) {
+ SCREEN_DEBUG3(s, dy, py, ny);
return;
- if (!screen_in_y(s, dy) || !screen_in_y(s, dy + ny - 1) || dy == py)
+ }
+ if (!screen_in_y(s, dy) || !screen_in_y(s, dy + ny - 1) || dy == py) {
+ SCREEN_DEBUG3(s, dy, py, ny);
return;
+ }
screen_move_lines(s, screen_y(s, dy), screen_y(s, py), ny);
}
@@ -64,12 +72,18 @@ void
screen_display_fill_area(struct screen *s, u_int px, u_int py,
u_int nx, u_int ny, u_char data, u_char attr, u_char colr)
{
- if (nx == 0 || ny == 0)
+ if (nx == 0 || ny == 0) {
+ SCREEN_DEBUG4(s, px, py, nx, ny);
return;
- if (!screen_in_x(s, px) || !screen_in_y(s, py))
+ }
+ if (!screen_in_x(s, px) || !screen_in_y(s, py)) {
+ SCREEN_DEBUG4(s, px, py, nx, ny);
return;
- if (!screen_in_x(s, px + nx - 1) || !screen_in_y(s, py + ny - 1))
+ }
+ if (!screen_in_x(s, px + nx - 1) || !screen_in_y(s, py + ny - 1)) {
+ SCREEN_DEBUG4(s, px, py, nx, ny);
return;
+ }
screen_fill_area(
s, screen_x(s, px), screen_y(s, py), nx, ny, data, attr, colr);
}
@@ -163,15 +177,21 @@ screen_display_scroll_region_down(struct screen *s)
void
screen_display_insert_lines(struct screen *s, u_int py, u_int ny)
{
- if (!screen_in_y(s, py))
+ if (!screen_in_y(s, py)) {
+ SCREEN_DEBUG2(s, py, ny);
return;
- if (ny == 0)
+ }
+ if (ny == 0) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
if (py + ny > screen_last_y(s))
ny = screen_size_y(s) - py;
- if (ny == 0)
+ if (ny == 0) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
/*
* Insert range of ny lines at py:
@@ -200,15 +220,21 @@ screen_display_insert_lines(struct screen *s, u_int py, u_int ny)
void
screen_display_insert_lines_region(struct screen *s, u_int py, u_int ny)
{
- if (!screen_in_region(s, py))
+ if (!screen_in_region(s, py)) {
+ SCREEN_DEBUG2(s, py, ny);
return;
- if (ny == 0)
+ }
+ if (ny == 0) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
if (py + ny > s->rlower)
ny = (s->rlower + 1) - py;
- if (ny == 0)
+ if (ny == 0) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
/*
* Insert range of ny lines at py:
@@ -237,15 +263,21 @@ screen_display_insert_lines_region(struct screen *s, u_int py, u_int ny)
void
screen_display_delete_lines(struct screen *s, u_int py, u_int ny)
{
- if (!screen_in_y(s, py))
+ if (!screen_in_y(s, py)) {
+ SCREEN_DEBUG2(s, py, ny);
return;
- if (ny == 0)
+ }
+ if (ny == 0) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
if (py + ny > screen_last_y(s))
ny = screen_size_y(s) - py;
- if (ny == 0)
+ if (ny == 0) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
/*
* Delete range of ny lines at py:
@@ -274,10 +306,14 @@ screen_display_delete_lines(struct screen *s, u_int py, u_int ny)
void
screen_display_delete_lines_region(struct screen *s, u_int py, u_int ny)
{
- if (!screen_in_region(s, py))
+ if (!screen_in_region(s, py)) {
+ SCREEN_DEBUG2(s, py, ny);
return;
- if (ny == 0)
+ }
+ if (ny == 0) {
+ SCREEN_DEBUG2(s, py, ny);
return;
+ }
if (py + ny > s->rlower)
ny = (s->rlower + 1) - py;
@@ -313,8 +349,10 @@ screen_display_insert_characters(struct screen *s, u_int px, u_int py, u_int nx)
{
u_int mx;
- if (!screen_in_x(s, px) || !screen_in_y(s, py))
+ if (!screen_in_x(s, px) || !screen_in_y(s, py)) {
+ SCREEN_DEBUG3(s, px, py, nx);
return;
+ }
if (px + nx > screen_last_x(s))
nx = screen_last_x(s) - px;
@@ -350,8 +388,10 @@ screen_display_delete_characters(struct screen *s, u_int px, u_int py, u_int nx)
{
u_int mx;
- if (!screen_in_x(s, px) || !screen_in_y(s, py))
+ if (!screen_in_x(s, px) || !screen_in_y(s, py)) {
+ SCREEN_DEBUG3(s, px, py, nx);
return;
+ }
if (px + nx > screen_last_x(s))
nx = screen_last_x(s) - px;
@@ -389,12 +429,18 @@ screen_display_copy_area(struct screen *dst, struct screen *src,
u_int i, j;
u_char data, attr, colr;
- if (nx == 0 || ny == 0)
- return;
- if (!screen_in_x(dst, px) || !screen_in_y(dst, py))
+ if (nx == 0 || ny == 0) {
+ SCREEN_DEBUG4(dst, px, py, nx, ny);
return;
- if (!screen_in_x(dst, px + nx - 1) || !screen_in_y(dst, py + ny - 1))
+ }
+ if (!screen_in_x(dst, px) || !screen_in_y(dst, py)) {
+ SCREEN_DEBUG4(dst, px, py, nx, ny);
+ return;
+ }
+ if (!screen_in_x(dst, px + nx - 1) || !screen_in_y(dst, py + ny - 1)) {
+ SCREEN_DEBUG4(dst, px, py, nx, ny);
return;
+ }
for (i = py; i < py + ny; i++) {
for (j = px; j < px + nx; j++) {