summaryrefslogtreecommitdiff
path: root/hw/tcx.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-24 19:29:13 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-24 19:29:13 +0000
commit0e1f5a0c495dd7a5c72c9321a29541bdde8f423a (patch)
tree374c5da7054c16f764a1cb2b5079d612cf417dac /hw/tcx.c
parentcab3bee2d6f1d6eb6ad74006b8a63562cda9ba4d (diff)
downloadqemu-0e1f5a0c495dd7a5c72c9321a29541bdde8f423a.tar.gz
Introduce accessors for DisplayState (Stefano Stabellini)
Introducing some accessors: ds_get_linesize ds_get_bits_per_pixel ds_get_width ds_get_height ds_get_data Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5789 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/tcx.c')
-rw-r--r--hw/tcx.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/tcx.c b/hw/tcx.c
index 260635a5fc..de4fda0b42 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -55,7 +55,7 @@ static void update_palette_entries(TCXState *s, int start, int end)
{
int i;
for(i = start; i < end; i++) {
- switch(s->ds->depth) {
+ switch(ds_get_bits_per_pixel(s->ds)) {
default:
case 8:
s->palette[i] = rgb_to_pixel8(s->r[i], s->g[i], s->b[i]);
@@ -200,18 +200,18 @@ static void tcx_update_display(void *opaque)
uint8_t *d, *s;
void (*f)(TCXState *s1, uint8_t *dst, const uint8_t *src, int width);
- if (ts->ds->depth == 0)
+ if (ds_get_bits_per_pixel(ts->ds) == 0)
return;
page = ts->vram_offset;
y_start = -1;
page_min = 0xffffffff;
page_max = 0;
- d = ts->ds->data;
+ d = ds_get_data(ts->ds);
s = ts->vram;
- dd = ts->ds->linesize;
+ dd = ds_get_linesize(ts->ds);
ds = 1024;
- switch (ts->ds->depth) {
+ switch (ds_get_bits_per_pixel(ts->ds)) {
case 32:
f = tcx_draw_line32;
break;
@@ -278,7 +278,7 @@ static void tcx24_update_display(void *opaque)
uint8_t *d, *s;
uint32_t *cptr, *s24;
- if (ts->ds->depth != 32)
+ if (ds_get_bits_per_pixel(ts->ds) != 32)
return;
page = ts->vram_offset;
page24 = ts->vram24_offset;
@@ -286,11 +286,11 @@ static void tcx24_update_display(void *opaque)
y_start = -1;
page_min = 0xffffffff;
page_max = 0;
- d = ts->ds->data;
+ d = ds_get_data(ts->ds);
s = ts->vram;
s24 = ts->vram24;
cptr = ts->cplane;
- dd = ts->ds->linesize;
+ dd = ds_get_linesize(ts->ds);
ds = 1024;
for(y = 0; y < ts->height; y += 4, page += TARGET_PAGE_SIZE,