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

77 lines
2.2 KiB
C
Raw Normal View History

2017-01-21 17:27:46 +01:00
// CPixmap.h
#pragma once
2017-02-10 23:03:33 +01:00
#include <SDL2/SDL.h>
2017-01-21 17:27:46 +01:00
2017-02-10 00:14:28 +01:00
#include "blupi.h"
2017-01-21 17:27:46 +01:00
#define MAXIMAGE 100
#define MAXCURSORS 14
2017-01-21 17:27:46 +01:00
class CPixmap
{
public:
CPixmap();
~CPixmap();
bool Create(POINT dim, bool bFullScreen, Sint32 mouseType);
bool Flush();
2017-01-21 17:27:46 +01:00
void Fill(RECT rect, COLORREF color);
2017-02-10 23:03:33 +01:00
bool Cache(Sint32 channel, const char *pFilename, POINT totalDim, POINT iconDim);
bool Cache(Sint32 channel, const char *pFilename, POINT totalDim);
bool Cache(Sint32 channel, SDL_Surface *surface, POINT totalDim);
2017-01-21 17:27:46 +01:00
void SetClipping(RECT clip);
RECT GetClipping();
bool IsIconPixel(Sint32 channel, Sint32 rank, POINT pos);
2017-01-21 17:27:46 +01:00
bool DrawIcon(Sint32 chDst, Sint32 channel, Sint32 rank, POINT pos, bool bMask=false);
bool DrawIconDemi(Sint32 chDst, Sint32 channel, Sint32 rank, POINT pos, bool bMask=false);
bool DrawIconPart(Sint32 chDst, Sint32 channel, Sint32 rank, POINT pos, Sint32 startY, Sint32 endY, bool bMask=false);
bool DrawPart(Sint32 chDst, Sint32 channel, POINT dest, RECT rect, bool bMask=false);
bool DrawImage(Sint32 chDst, Sint32 channel, RECT rect);
2017-01-21 17:27:46 +01:00
bool BuildIconMask(Sint32 channelMask, Sint32 rankMask,
Sint32 channel, Sint32 rankSrc, Sint32 rankDst);
2017-02-10 23:03:33 +01:00
bool Display();
2017-01-21 17:27:46 +01:00
void SetMouseSprite(Sint32 sprite, bool bDemoPlay);
void MouseShow(bool bShow);
void LoadCursors ();
2017-01-28 23:34:02 +01:00
void ChangeSprite (MouseSprites sprite);
2017-01-21 17:27:46 +01:00
protected:
Sint32 BltFast(Sint32 chDst, Sint32 channel, POINT dst, RECT rcRect);
Sint32 BltFast(SDL_Texture *lpSDL, Sint32 channel, POINT dst, RECT rcRect);
2017-01-21 17:27:46 +01:00
RECT MouseRectSprite();
SDL_Point GetCursorHotSpot (Sint32 sprite);
SDL_Rect GetCursorRect (Sint32 sprite);
2017-01-21 17:27:46 +01:00
protected:
bool m_bFullScreen;
Sint32 m_mouseType;
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
Sint32 m_mouseSprite;
bool m_bBackDisplayed;
2017-01-21 17:27:46 +01:00
2017-01-28 23:34:02 +01:00
SDL_Cursor * m_lpCurrentCursor;
SDL_Cursor * m_lpSDLCursors[MAXCURSORS];
SDL_Surface * m_lpSDLBlupi;
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
2017-02-12 00:44:46 +01:00
POINT m_iconDim[MAXIMAGE]; // dimensions d'une ic�ne
2017-01-21 17:27:46 +01:00
};
/////////////////////////////////////////////////////////////////////////////