DinkSmallwoodHD/source/video_gl.h
seth 1adfda0aab * (Bugfix) Fixed issue where default .ini animations wouldn't get applied correctly in some cases, this fixed a slight offset problem with Stone Of Balance
* Fixed problem with glitchy black lines during screen transitions
* (Bugfix) Fixed issue with playmidi and filenames that start with numbers over 1000, this fixed a problem with 1812over.mid not playing in Mayhem
* Added 1920X1080 screen mode selector in the Options menu
* No longer applying Dan's checkboard fix to tile screens (they don't need it I think..), and also added a hack so it will ignore main-02 through main-04.bpm (the dialog box) as it made it look weird (it looks perfect in 640X480, but other resolutions have slight artifacts due to sub-pixel accuracy issues
* Fixed some issues related to dynamic 8 bit to 32 bit surface changes (this can happen if you turn on the new shadows after starting to play or the game suddenly hits a 32 bit image)
- Note: Just to be safe, save state version has changed, so old save states won't load

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1490 353e56fe-9613-0410-8469-b96ad8e6f29c
2017-09-19 01:16:24 +00:00

117 lines
No EOL
3.9 KiB
C++

#ifndef video_dx_h__
#define video_dx_h__
#include "PlatformSetup.h"
#include "math/rtRect.h"
class SoftSurface;
class Surface;
typedef struct _DDCOLORKEY
{
uint32 dwColorSpaceLowValue; // low boundary of color space that is to
// be treated as Color Key, inclusive
uint32 dwColorSpaceHighValue; // high boundary of color space that is
// to be treated as Color Key, inclusive
} DDCOLORKEY;
typedef struct _DDBLTFX
{
uint32 dwSize; // size of structure
uint32 dwDDFX; // FX operations
uint32 dwROP; // Win32 raster operations
uint32 dwDDROP; // Raster operations new for DirectDraw
uint32 dwRotationAngle; // Rotation angle for blt
uint32 dwZBufferOpCode; // ZBuffer compares
uint32 dwZBufferLow; // Low limit of Z buffer
uint32 dwZBufferHigh; // High limit of Z buffer
uint32 dwZBufferBaseDest; // Destination base value
uint32 dwZDestConstBitDepth; // Bit depth used to specify Z constant for destination
DDCOLORKEY ddckDestColorkey; // DestColorkey override
DDCOLORKEY ddckSrcColorkey; // SrcColorkey override
uint32 dwFillColor; // color in RGB or Palettized
uint32 dwFillDepth; // depth value for z-buffer
uint32 dwFillPixel; // pixel value for RGBA or RGBZ
} DDBLTFX;
typedef DDBLTFX * LPDDBLTFX;
enum eTransparencyType
{
TRANSPARENT_NONE,
TRANSPARENT_BLACK,
TRANSPARENT_WHITE,
TRANSPARENT_MAGENTA
};
//blt flags
#define DDBLT_KEYSRC 0x00008000l
#define DDBLT_COLORFILL 0x00000400l
#define DDBLT_WAIT 0x01000000l
#define DD_OK 0L
#define DD_FALSE 1L
/****************************************************************************
*
* BLTFAST FLAGS
*
****************************************************************************/
#define DDBLTFAST_NOCOLORKEY 0x00000000
#define DDBLTFAST_SRCCOLORKEY 0x00000001
#define DDBLTFAST_DESTCOLORKEY 0x00000002
#define DDBLTFAST_WAIT 0x00000010
#define DDBLTFAST_DONOTWAIT
//my fake DD wrapper that really uses GL under the hood
class IDirectDrawSurface
{
public:
enum eMode
{
MODE_NORMAL, //8 bit image only
MODE_PRIMARY_GL, //just a dummy surface, blitting to it goes straight to the screen
MODE_SHADOW_GL //keep an 8 bit version but cache a HW GL surface as well
};
IDirectDrawSurface();
~IDirectDrawSurface();
int Blt(rtRect32 *pDestRect, IDirectDrawSurface * pSrcSurf, rtRect32 *pSrcRect, uint32 flags, DDBLTFX *pFX);
int BltFast(int x, int y, IDirectDrawSurface *pSrcSurf, rtRect32 *pSrcRect, uint32 dwTrans);;
void UpdateLastUsedTime();
void UpdateShadowSurface();
Surface * GetGLSuface(); //update it and send back a valid surface if possible
Surface *m_pGLSurf;
eMode m_mode;
SoftSurface *m_pSurf;
int m_gameTickOfLastUse;
};
typedef class IDirectDrawSurface *LPDIRECTDRAWSURFACE;
IDirectDrawSurface * InitOffscreenSurface(int x, int y, IDirectDrawSurface::eMode mode = IDirectDrawSurface::MODE_NORMAL, bool bHiColor = false, SoftSurface * pSurfaceToCopyFrom = NULL);
extern LPDIRECTDRAWSURFACE lpDDSBack;
void dderror(int hErr);
bool InitializeVideoSystem();
void KillVideoEngine();
void GetSizeOfSurface(IDirectDrawSurface *pdds, int *pX, int *pY);
IDirectDrawSurface * LoadBitmapIntoSurface(const char *pName, eTransparencyType trans= TRANSPARENT_NONE, IDirectDrawSurface::eMode mode = IDirectDrawSurface::MODE_SHADOW_GL, byte *pMem = NULL,
bool bUseCheckerboardFix = false);
#endif // video_dx_h__