From 4fe34ee6d2fdbb2a43f8ca09375e42f902dea60e Mon Sep 17 00:00:00 2001 From: neil Date: Sun, 20 Jul 2014 23:27:46 +0000 Subject: [PATCH] Removed cut-and-pasted code for clamping of X/Y offsets. These attributes are now clamped by the root bitmap class and kept in sync with the local instance data. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@49125 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- rom/hidds/vesa/bitmap.c | 44 +++++++++----------------------------------- rom/hidds/vesa/hardware.c | 8 ++++---- rom/hidds/vesa/vesagfx.conf | 2 +- 3 files changed, 14 insertions(+), 40 deletions(-) diff --git a/rom/hidds/vesa/bitmap.c b/rom/hidds/vesa/bitmap.c index 70cde70d8c..ba42daee00 100644 --- a/rom/hidds/vesa/bitmap.c +++ b/rom/hidds/vesa/bitmap.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: Bitmap class for Vesa hidd. @@ -111,14 +111,6 @@ VOID MNAME_ROOT(Get)(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg) case aoHidd_BitMap_Visible: *msg->storage = data->disp; return; - - case aoHidd_BitMap_LeftEdge: - *msg->storage = data->xoffset; - return; - - case aoHidd_BitMap_TopEdge: - *msg->storage = data->yoffset; - return; } } OOP_DoSuperMethod(cl, o, (OOP_Msg)msg); @@ -131,9 +123,8 @@ VOID MNAME_ROOT(Set)(OOP_Class *cl, OOP_Object *o, struct pRoot_Set *msg) struct BitmapData *data = OOP_INST_DATA(cl, o); struct TagItem *tag, *tstate; ULONG idx; - LONG xoffset = data->xoffset; - LONG yoffset = data->yoffset; - LONG limit; + IPTR xoffset = data->xoffset; + IPTR yoffset = data->yoffset; tstate = msg->attrList; while((tag = NextTagItem(&tstate))) @@ -150,31 +141,16 @@ VOID MNAME_ROOT(Set)(OOP_Class *cl, OOP_Object *o, struct pRoot_Set *msg) DACLoad(XSD(cl), data->DAC, 0, 256); } break; - case aoHidd_BitMap_LeftEdge: - xoffset = tag->ti_Data; - /* Our bitmap can not be smaller than display size - because of fakegfx.hidd limitations (it can't place - cursor beyond bitmap edges). Otherwize Intuition - will provide strange user experience (mouse cursor will - disappear) */ - limit = data->disp_width - data->width; - if (xoffset > 0) - xoffset = 0; - else if (xoffset < limit) - xoffset = limit; - break; - case aoHidd_BitMap_TopEdge: - yoffset = tag->ti_Data; - limit = data->disp_height - data->height; - if (yoffset > 0) - yoffset = 0; - else if (yoffset < limit) - yoffset = limit; - break; } } } + OOP_DoSuperMethod(cl, o, (OOP_Msg)msg); + + /* Bring local X/Y offsets back into sync with validated values */ + OOP_GetAttr(o, aHidd_BitMap_LeftEdge, &xoffset); + OOP_GetAttr(o, aHidd_BitMap_TopEdge, &yoffset); + if ((xoffset != data->xoffset) || (yoffset != data->yoffset)) { D(bug("[VesaBitMap] Scroll to (%d, %d)\n", xoffset, yoffset)); @@ -188,8 +164,6 @@ VOID MNAME_ROOT(Set)(OOP_Class *cl, OOP_Object *o, struct pRoot_Set *msg) UNLOCK_FRAMEBUFFER(XSD(cl)); } } - - OOP_DoSuperMethod(cl, o, (OOP_Msg)msg); } /*** BitMap::SetColors() *************************************/ diff --git a/rom/hidds/vesa/hardware.c b/rom/hidds/vesa/hardware.c index d0af7fb8c6..5ec639e980 100644 --- a/rom/hidds/vesa/hardware.c +++ b/rom/hidds/vesa/hardware.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: vesa "hardware" functions @@ -108,8 +108,7 @@ void vesaDoRefreshArea(struct HWData *hwdata, struct BitmapData *data, { UBYTE *src, *dst; ULONG srcmod, dstmod; - LONG y, w, h; - LONG sx, sy; + LONG y, w, h, sx, sy; x1 += data->xoffset; y1 += data->yoffset; @@ -132,7 +131,8 @@ void vesaDoRefreshArea(struct HWData *hwdata, struct BitmapData *data, /* Calculate width and height */ w = x2 - x1; h = y2 - y1; - /* Jump back to bitmap coordinatess (adjusted) */ + + /* Jump back to bitmap coordinates (adjusted) */ sx = x1 - data->xoffset; sy = y1 - data->yoffset; diff --git a/rom/hidds/vesa/vesagfx.conf b/rom/hidds/vesa/vesagfx.conf index f37efd8578..37445d2a0e 100644 --- a/rom/hidds/vesa/vesagfx.conf +++ b/rom/hidds/vesa/vesagfx.conf @@ -1,7 +1,7 @@ ##begin config basename PCVesa libbasetype struct VesaGfxBase -version 1.1 +version 1.2 residentpri 9 classptr_field vsd.vesagfxclass classdatatype struct VesaGfx_data -- 2.11.4.GIT