OpenXcom  1.0
Open-source clone of the original X-Com
Static Public Member Functions | List of all members
OpenXcom::Zoom Class Reference

Static Public Member Functions

static void flipWithZoom (SDL_Surface *src, SDL_Surface *dst, int topBlackBand, int bottomBlackBand, int leftBlackBand, int rightBlackBand, OpenGL *glOut)
 Flip screen given src and dst; might use software or OpenGL. More...
 
static int _zoomSurfaceY (SDL_Surface *src, SDL_Surface *dst, int flipx, int flipy)
 Copy src to dst, resizing as needed. Please don't use flipx or flipy as the optimized functions ignore these parameters. More...
 
static bool haveSSE2 ()
 Check for SSE2 instructions using CPUID.
 

Member Function Documentation

◆ _zoomSurfaceY()

int OpenXcom::Zoom::_zoomSurfaceY ( SDL_Surface *  src,
SDL_Surface *  dst,
int  flipx,
int  flipy 
)
static

Copy src to dst, resizing as needed. Please don't use flipx or flipy as the optimized functions ignore these parameters.

Internal 8-bit Zoomer without smoothing.

Source code originally from SDL_gfx (LGPL) with permission by author.

Zooms 8bit palette/Y 'src' surface to 'dst' surface. Assumes src and dst surfaces are of 8-bit depth. Assumes dst surface was allocated with the correct dimensions.

Parameters
srcThe surface to zoom (input).
dstThe zoomed surface (output).
flipxFlag indicating if the image should be horizontally flipped.
flipyFlag indicating if the image should be vertically flipped.
Returns
0 for success or -1 for error.

◆ flipWithZoom()

void OpenXcom::Zoom::flipWithZoom ( SDL_Surface *  src,
SDL_Surface *  dst,
int  topBlackBand,
int  bottomBlackBand,
int  leftBlackBand,
int  rightBlackBand,
OpenGL glOut 
)
static

Flip screen given src and dst; might use software or OpenGL.

Optimized 8-bit zoomer for resizing by a factor of 2.

Doesn't flip. Used internally by _zoomSurfaceY() below. source and dest. widths must be multiples of 8 bytes for 64-bit access

Parameters
srcThe surface to zoom (input).
dstThe zoomed surface (output).
Returns
0 for success or -1 for error. Optimized 8-bit zoomer for resizing by a factor of 2. Doesn't flip. 32-bit version for sad old x86 chips which run out of registers with the 64-bit version. Used internally by _zoomSurfaceY() below. source and dest. widths must be multiples of 4 bytes for 32-bit access
Parameters
srcThe surface to zoom (input).
dstThe zoomed surface (output).
Returns
0 for success or -1 for error. Optimized 8-bit zoomer for resizing by a factor of 4. Doesn't flip. Used internally by _zoomSurfaceY() below. source and dest. widths must be multiples of 8 bytes for 64-bit access
Parameters
srcThe surface to zoom (input).
dstThe zoomed surface (output).
Returns
0 for success or -1 for error. Optimized 8-bit zoomer for resizing by a factor of 4. Doesn't flip. 32-bit version. Used internally by _zoomSurfaceY() below. source and dest. widths must be multiples of 4 bytes for 32-bit access
Parameters
srcThe surface to zoom (input).
dstThe zoomed surface (output).
Returns
0 for success or -1 for error. Optimized 8-bit zoomer for resizing by a factor of 4. Doesn't flip. 32-bit version. Used internally by _zoomSurfaceY() below. source and dest. widths must be multiples of 4 bytes for 32-bit access
Parameters
srcThe surface to zoom (input).
dstThe zoomed surface (output).
Returns
0 for success or -1 for error. Optimized 8-bit zoomer for resizing by a factor of 2. Doesn't flip. 32-bit version. Used internally by _zoomSurfaceY() below. source and dest. widths must be multiples of 4 bytes for 32-bit access
Parameters
srcThe surface to zoom (input).
dstThe zoomed surface (output).
Returns
0 for success or -1 for error. Wrapper around various software and OpenGL screen buffer pushing functions which zoom. Basically called just from Screen::flip()
Parameters
srcThe surface to zoom (input).
dstThe zoomed surface (output).
topBlackBandSize of top black band in pixels (letterboxing).
bottomBlackBandSize of bottom black band in pixels (letterboxing).
leftBlackBandSize of left black band in pixels (letterboxing).
rightBlackBandSize of right black band in pixels (letterboxing).
glOutOpenGL output.

The documentation for this class was generated from the following files: