Hi Andrew,

On Fri, 27 Jul 2012, Andrew Flegg wrote:

> Hi,
>
> Is there something I've missed which'd allow video scaling (say 2x)
> for modes < 640x480.
>
> It looks like the other ports have something like it, so are there any
> pointers for where to start hacking on it? Presumably, the scaling
> factor and size at which to do scaling should be configurable. Perhaps
> as a "minimum size" option? Anything smaller than that gets (integer)
> scaled to get as close as possible?

For the X11 port, the place to start looking is the 
SDD_Name(Host_ChangeMode)() function, which is actually implemented in two 
places - X/pseudo.c for pseudocolour displays and X/true.c for truecolour 
displays. As you can see there's code in there to set HD.XScale and 
HD.YScale to take into account rectangular pixel modes. So adding support 
for 2x, 3x, 4x, etc. upscaling is just a case of changing HD.XScale, 
HD.YScale, width, and height to the appropriate values.

However, it looks like I didn't fix the mouse pointer image code to take 
into account the scale factors, so you'll be wanting to change that. It 
looks like this will involve:

* Changing the code in DisplayDev_Init() (in X/DisplayDev.c) that deals 
with setting up PD.CursorPane, PD.CursorImageData, PD.CursorImage, 
PD.ShapePixmapData, and PD.shape_mask to allow for cursors wider than 32 
pixels. Adding a global variable or #define for the max cursor width would 
probably make sense! (e.g. to X/platform.h)
* It looks like there's also code in Resize_Window() that deals with 
setting up the above variables, that will need modifying too.
* Then there's RefreshMouse() (in both X/true.c and X/pseudo.c) which 
deals with filling the cursor image with data. The nested for() loops it 
uses to fill the image are a bit nasty, so I'll leave it to you to decide 
how best to tidy them up! (Perhaps that's the reason why I didn't update 
the code...)
* There's also an XCreatePixmapFromBitmapData() call in RefreshMouse() 
that will need to take into account the wider cursor width.
* Finally there's the XPutImage() call at the end of 
SDD_Name(Host_PollDisplay)() (in both X/true.c and X/pseudo.c) which will 
need updating for the wider cursor width.

Good luck!

- Jeffrey


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel

Reply via email to