1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00
planetblupi/pixmap.h
2017-02-05 10:04:05 +01:00

87 lines
2.6 KiB
C++
Raw Blame History

// CPixmap.h
#pragma once
#include <ddraw.h>
#include <SDL.h>
/////////////////////////////////////////////////////////////////////////////
#define MAXIMAGE 100
#define MAXCURSORS 14
class CPixmap
{
public:
CPixmap();
~CPixmap();
void SetDebug(bool bDebug);
bool Create(POINT dim, bool bFullScreen, int mouseType);
bool Flush();
void Fill(RECT rect, COLORREF color);
bool Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim);
bool Cache(int channel, char *pFilename, POINT totalDim);
bool Cache(int channel, SDL_Surface *surface, POINT totalDim);
void SetClipping(RECT clip);
RECT GetClipping();
bool IsIconPixel(int channel, int rank, POINT pos);
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);
bool BuildIconMask(int channelMask, int rankMask,
int channel, int rankSrc, int rankDst);
bool Display();
void SetMouseSprite(int sprite, bool bDemoPlay);
void MouseShow(bool bShow);
void LoadCursors ();
void ChangeSprite (MouseSprites sprite);
protected:
HRESULT BltFast(int chDst, int channel, POINT dst, RECT rcRect, int mode);
HRESULT BltFast(SDL_Texture *lpSDL,
int channel, POINT dst, RECT rcRect, int mode);
RECT MouseRectSprite();
SDL_Point GetCursorHotSpot (int sprite);
SDL_Rect GetCursorRect (int sprite);
protected:
bool m_bFullScreen;
int m_mouseType;
bool m_bDebug;
bool m_bPalette;
POINT m_dim; // dimensions totales
RECT m_clipRect; // rectangle de clipping
int m_mouseSprite;
bool m_bBackDisplayed;
LPDIRECTDRAW m_lpDD; // DirectDraw object
LPDIRECTDRAWSURFACE m_lpDDSPrimary; // DirectDraw primary surface
SDL_Surface * m_lpSDLPrimary;
LPDIRECTDRAWSURFACE m_lpDDSBack; // DirectDraw back surface
SDL_Surface * m_lpSDLBack;
SDL_Cursor * m_lpCurrentCursor;
SDL_Cursor * m_lpSDLCursors[MAXCURSORS];
SDL_Surface * m_lpSDLBlupi;
SDL_Texture * m_lpSDLTexture[MAXIMAGE];
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;
};
/////////////////////////////////////////////////////////////////////////////