PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Blt 16 bit surface with scaling

Hello, I implemented an algorithm which takes a source surface and copies it to a destination surface with 2xSaI scaling. It only works when my source and destination surfaces are forced to 16 bit color depth. Now I'd like to blit the destination surface to the display buffer and stretch it to fit the screen. But when I Blt with the scale parameter set to anything other than 65536, nothing appears on the screen. I don't have this problem when my surfaces are created without the EST_DSPTRUE16 flag, or when the scale param is set to exactly 65536 (or when I use BltFast). Can anyone help me with this please?
Hi,

It's not possible to use Blt() with color conversion. Can you tell me which platform you're targetting? If it's pocket pc, then you don't need to worry (because the native color depth of a pocket pc is 16 bit as well).

To test it on PC, we recommend turning on color depth emulation. Change the emulvideotype configuration option in the OnDisplayConfig callback to EDSP_TRUE16. Emulating a colordepth has an effect on performance, but only if the emulated color depth and the real color depth are not the same.

Using a nice 2xSai filter in combination with stretchblitting could make your image look bad, are you sure this combination is needed?
Hi Edge, thanks for the reply. I'm hoping to target both PC and Windows Mobile. I wanted to give PC users the ability to set scaling and stretching parameters as separate options in my config menu. I agree that 2xSaI + stretchblitting isn't he best looking combo, but I'd prefer to include it as an option for the player. That said, I got it to work by blitting to an intermediary surface with a matching color depth as my source, then bliting that surface unscaled to the display. Thanks again for the help!