1
0
Fork 0

Add output type texturepp for pixel-perfect scaling

The new output type `texturepp' was added, which implements
pixel-perfect scaling using SDL's hardware-accelerated texture output.
In pixel-pefect mode, each original pixel is displayed as a rectangle m
by n pixels, so that m:n yields a reasonably good approximation of the
pixel aspect ratio (PAR) of the emulated graphical mode while using as
much screen space as possible. The balance between the precision of
aspect ratio and the utilisation of screen space is specified as the
`parweight' parameter to pp_getscale() and is currently hard-coded in
sdlmain.cpp.

This implementation emulatates pixel-perfect mode as a special case of
nearest-neighbor interpolation when the horisontal and vertical scaling
factors are integers.
This commit is contained in:
Anton Shepelev 2020-01-29 02:41:33 +03:00 committed by Patryk Obara
parent 83f625178a
commit d1be65b105
10 changed files with 398 additions and 39 deletions

View file

@ -30,28 +30,34 @@ typedef enum {
typedef void (*GFX_CallBack_t)( GFX_CallBackFunctions_t function );
#define GFX_CAN_8 0x0001
#define GFX_CAN_15 0x0002
#define GFX_CAN_16 0x0004
#define GFX_CAN_32 0x0008
#define GFX_CAN_8 0x0001
#define GFX_CAN_15 0x0002
#define GFX_CAN_16 0x0004
#define GFX_CAN_32 0x0008
#define GFX_LOVE_8 0x0010
#define GFX_LOVE_15 0x0020
#define GFX_LOVE_16 0x0040
#define GFX_LOVE_32 0x0080
#define GFX_LOVE_8 0x0010
#define GFX_LOVE_15 0x0020
#define GFX_LOVE_16 0x0040
#define GFX_LOVE_32 0x0080
#define GFX_RGBONLY 0x0100
#define GFX_RGBONLY 0x0100
#define GFX_DBL_H 0x0200 /* double-width flag */
#define GFX_DBL_W 0x0400 /* double-height flag */
#define GFX_SCALING 0x1000
#define GFX_HARDWARE 0x2000
#define GFX_CAN_RANDOM 0x4000 //If the interface can also do random access surface
#define GFX_CAN_RANDOM 0x4000 //If the interface can also do random access surface
#define GFX_UNITY_SCALE 0x8000 /* turn of all scaling in render.cpp */
void GFX_Events(void);
Bitu GFX_GetBestMode(Bitu flags);
Bitu GFX_GetRGB(Bit8u red,Bit8u green,Bit8u blue);
Bitu GFX_SetSize(Bitu width,Bitu height,Bitu flags,double scalex,double scaley,GFX_CallBack_t cb);
void GFX_SetShader(const char* src);
Bitu GFX_SetSize(Bitu width, Bitu height, Bitu flags,
double scalex, double scaley,
GFX_CallBack_t callback,
double pixel_aspect);
void GFX_ResetScreen(void);
void GFX_Start(void);