2017-01-21 17:27:46 +01:00
|
|
|
|
// CPixmap.h
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <ddraw.h>
|
2017-01-26 18:58:14 +01:00
|
|
|
|
#include <SDL.h>
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#define MAXIMAGE 100
|
2017-01-26 18:58:14 +01:00
|
|
|
|
#define MAXCURSORS 14
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
|
|
class CPixmap
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CPixmap();
|
|
|
|
|
~CPixmap();
|
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
|
void SetDebug(bool bDebug);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
2017-02-05 09:15:08 +01:00
|
|
|
|
bool Create(POINT dim, bool bFullScreen, int mouseType);
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool Flush();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
void Fill(RECT rect, COLORREF color);
|
|
|
|
|
|
2017-02-05 09:57:43 +01:00
|
|
|
|
bool Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim);
|
|
|
|
|
bool Cache(int channel, char *pFilename, POINT totalDim);
|
2017-01-29 19:18:18 +01:00
|
|
|
|
bool Cache(int channel, SDL_Surface *surface, POINT totalDim);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
void SetTransparent(int channel, COLORREF color);
|
|
|
|
|
void SetTransparent2(int channel, COLORREF color1, COLORREF color2);
|
|
|
|
|
void SetClipping(RECT clip);
|
|
|
|
|
RECT GetClipping();
|
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool IsIconPixel(int channel, int rank, POINT pos);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool DrawIcon(int chDst, int channel, int rank, POINT pos, int mode=0, bool bMask=false);
|
|
|
|
|
bool DrawIconDemi(int chDst, int channel, int rank, POINT pos, int mode=0, bool bMask=false);
|
|
|
|
|
bool DrawIconPart(int chDst, int channel, int rank, POINT pos, int startY, int endY, int mode=0, bool bMask=false);
|
|
|
|
|
bool DrawPart(int chDst, int channel, POINT dest, RECT rect, int mode=0, bool bMask=false);
|
|
|
|
|
bool DrawImage(int chDst, int channel, RECT rect, int mode=0);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool BuildIconMask(int channelMask, int rankMask,
|
2017-01-21 17:27:46 +01:00
|
|
|
|
int channel, int rankSrc, int rankDst);
|
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool Display();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
|
void SetMouseSprite(int sprite, bool bDemoPlay);
|
|
|
|
|
void MouseShow(bool bShow);
|
2017-01-26 18:58:14 +01:00
|
|
|
|
void LoadCursors ();
|
2017-01-28 23:34:02 +01:00
|
|
|
|
void ChangeSprite (MouseSprites sprite);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
HRESULT BltFast(int chDst, int channel, POINT dst, RECT rcRect, int mode);
|
2017-02-05 09:15:08 +01:00
|
|
|
|
HRESULT BltFast(SDL_Texture *lpSDL,
|
2017-01-21 17:27:46 +01:00
|
|
|
|
int channel, POINT dst, RECT rcRect, int mode);
|
|
|
|
|
|
|
|
|
|
RECT MouseRectSprite();
|
2017-01-26 18:58:14 +01:00
|
|
|
|
SDL_Point GetCursorHotSpot (int sprite);
|
|
|
|
|
SDL_Rect GetCursorRect (int sprite);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
|
|
protected:
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool m_bFullScreen;
|
2017-01-21 17:27:46 +01:00
|
|
|
|
int m_mouseType;
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool m_bDebug;
|
|
|
|
|
bool m_bPalette;
|
2017-01-21 17:27:46 +01:00
|
|
|
|
POINT m_dim; // dimensions totales
|
|
|
|
|
RECT m_clipRect; // rectangle de clipping
|
|
|
|
|
|
|
|
|
|
int m_mouseSprite;
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool m_bBackDisplayed;
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
|
|
LPDIRECTDRAW m_lpDD; // DirectDraw object
|
|
|
|
|
LPDIRECTDRAWSURFACE m_lpDDSPrimary; // DirectDraw primary surface
|
2017-01-23 00:20:27 +01:00
|
|
|
|
SDL_Surface * m_lpSDLPrimary;
|
2017-01-21 17:27:46 +01:00
|
|
|
|
LPDIRECTDRAWSURFACE m_lpDDSBack; // DirectDraw back surface
|
2017-01-23 00:20:27 +01:00
|
|
|
|
SDL_Surface * m_lpSDLBack;
|
2017-01-21 17:27:46 +01:00
|
|
|
|
LPDIRECTDRAWSURFACE m_lpDDSMouse; // DirectDraw back surface
|
2017-01-28 23:34:02 +01:00
|
|
|
|
SDL_Cursor * m_lpCurrentCursor;
|
2017-01-26 18:58:14 +01:00
|
|
|
|
SDL_Cursor * m_lpSDLCursors[MAXCURSORS];
|
|
|
|
|
SDL_Surface * m_lpSDLBlupi;
|
2017-01-23 00:20:27 +01:00
|
|
|
|
SDL_Surface * m_lpSDLSurface[MAXIMAGE];
|
2017-01-25 21:46:51 +01:00
|
|
|
|
SDL_Texture * m_lpSDLTexture[MAXIMAGE];
|
2017-01-21 17:27:46 +01:00
|
|
|
|
COLORREF m_colorSurface[2*MAXIMAGE];
|
|
|
|
|
|
|
|
|
|
char m_filename[MAXIMAGE][20];
|
|
|
|
|
POINT m_totalDim[MAXIMAGE]; // dimensions totale image
|
|
|
|
|
POINT m_iconDim[MAXIMAGE]; // dimensions d'une ic<69>ne
|
|
|
|
|
DDBLTFX m_DDbltfx;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|