mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Remove useless MAXIMAGE define
This commit is contained in:
parent
d652db22e2
commit
c1875fd3ab
@ -89,7 +89,7 @@ void CPixmap::Fill (RECT rect, COLORREF color)
|
|||||||
// Effectue un appel BltFast.
|
// Effectue un appel BltFast.
|
||||||
// Les modes sont 0=transparent, 1=opaque.
|
// Les modes sont 0=transparent, 1=opaque.
|
||||||
|
|
||||||
Sint32 CPixmap::BltFast (Sint32 chDst, Sint32 channel, POINT dst, RECT rcRect)
|
Sint32 CPixmap::BltFast (Sint32 chDst, size_t channel, POINT dst, RECT rcRect)
|
||||||
{
|
{
|
||||||
Sint32 res, limit;
|
Sint32 res, limit;
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ Sint32 CPixmap::BltFast (Sint32 chDst, Sint32 channel, POINT dst, RECT rcRect)
|
|||||||
// Effectue un appel BltFast.
|
// Effectue un appel BltFast.
|
||||||
// Les modes sont 0=transparent, 1=opaque.
|
// Les modes sont 0=transparent, 1=opaque.
|
||||||
|
|
||||||
Sint32 CPixmap::BltFast (SDL_Texture *lpSDL, Sint32 channel, POINT dst,
|
Sint32 CPixmap::BltFast (SDL_Texture *lpSDL, size_t channel, POINT dst,
|
||||||
RECT rcRect)
|
RECT rcRect)
|
||||||
{
|
{
|
||||||
Sint32 res;
|
Sint32 res;
|
||||||
@ -173,12 +173,9 @@ Sint32 CPixmap::BltFast (SDL_Texture *lpSDL, Sint32 channel, POINT dst,
|
|||||||
|
|
||||||
// Cache une image contenant des ic�nes.
|
// Cache une image contenant des ic�nes.
|
||||||
|
|
||||||
bool CPixmap::Cache (Sint32 channel, const char *pFilename, POINT totalDim,
|
bool CPixmap::Cache (size_t channel, const char *pFilename, POINT totalDim,
|
||||||
POINT iconDim)
|
POINT iconDim)
|
||||||
{
|
{
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
std::string file = GetBaseDir() + pFilename;
|
std::string file = GetBaseDir() + pFilename;
|
||||||
SDL_Surface *surface = IMG_Load (file.c_str());
|
SDL_Surface *surface = IMG_Load (file.c_str());
|
||||||
|
|
||||||
@ -233,12 +230,9 @@ bool CPixmap::Cache (Sint32 channel, const char *pFilename, POINT totalDim,
|
|||||||
|
|
||||||
// Cache une image globale.
|
// Cache une image globale.
|
||||||
|
|
||||||
bool CPixmap::Cache (Sint32 channel, const char *pFilename, POINT totalDim)
|
bool CPixmap::Cache (size_t channel, const char *pFilename, POINT totalDim)
|
||||||
{
|
{
|
||||||
POINT iconDim;
|
POINT iconDim;
|
||||||
|
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
iconDim.x = 0;
|
iconDim.x = 0;
|
||||||
iconDim.y = 0;
|
iconDim.y = 0;
|
||||||
@ -248,11 +242,8 @@ bool CPixmap::Cache (Sint32 channel, const char *pFilename, POINT totalDim)
|
|||||||
|
|
||||||
// Cache une image provenant d'un bitmap.
|
// Cache une image provenant d'un bitmap.
|
||||||
|
|
||||||
bool CPixmap::Cache (Sint32 channel, SDL_Surface *surface, POINT totalDim)
|
bool CPixmap::Cache (size_t channel, SDL_Surface *surface, POINT totalDim)
|
||||||
{
|
{
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Create the offscreen surface, by loading our bitmap.
|
// Create the offscreen surface, by loading our bitmap.
|
||||||
if ( m_SDLTextureInfo.find (channel) != m_SDLTextureInfo.end ()
|
if ( m_SDLTextureInfo.find (channel) != m_SDLTextureInfo.end ()
|
||||||
&& m_SDLTextureInfo[channel].texture)
|
&& m_SDLTextureInfo[channel].texture)
|
||||||
@ -286,12 +277,9 @@ RECT CPixmap::GetClipping()
|
|||||||
|
|
||||||
// Teste si un point fait partie d'une ic�ne.
|
// Teste si un point fait partie d'une ic�ne.
|
||||||
|
|
||||||
bool CPixmap::IsIconPixel (Sint32 channel, Sint32 rank, POINT pos)
|
bool CPixmap::IsIconPixel (size_t channel, Sint32 rank, POINT pos)
|
||||||
{
|
{
|
||||||
Sint32 nbx, nby;
|
Sint32 nbx, nby;
|
||||||
|
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto texInfo = m_SDLTextureInfo.find (channel);
|
auto texInfo = m_SDLTextureInfo.find (channel);
|
||||||
if (texInfo == m_SDLTextureInfo.end ())
|
if (texInfo == m_SDLTextureInfo.end ())
|
||||||
@ -328,14 +316,11 @@ bool CPixmap::IsIconPixel (Sint32 channel, Sint32 rank, POINT pos)
|
|||||||
// Dessine une partie d'image rectangulaire.
|
// Dessine une partie d'image rectangulaire.
|
||||||
// Les modes sont 0=transparent, 1=opaque.
|
// Les modes sont 0=transparent, 1=opaque.
|
||||||
|
|
||||||
bool CPixmap::DrawIcon (Sint32 chDst, Sint32 channel, Sint32 rank, POINT pos,
|
bool CPixmap::DrawIcon (Sint32 chDst, size_t channel, Sint32 rank, POINT pos,
|
||||||
bool bMask)
|
bool bMask)
|
||||||
{
|
{
|
||||||
Sint32 nbx, nby;
|
Sint32 nbx, nby;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto texInfo = m_SDLTextureInfo.find (channel);
|
auto texInfo = m_SDLTextureInfo.find (channel);
|
||||||
if (channel != CHMAP && texInfo == m_SDLTextureInfo.end ())
|
if (channel != CHMAP && texInfo == m_SDLTextureInfo.end ())
|
||||||
@ -369,14 +354,11 @@ bool CPixmap::DrawIcon (Sint32 chDst, Sint32 channel, Sint32 rank, POINT pos,
|
|||||||
// 32,32 34,33
|
// 32,32 34,33
|
||||||
// 33,48 35,49
|
// 33,48 35,49
|
||||||
|
|
||||||
bool CPixmap::DrawIconDemi (Sint32 chDst, Sint32 channel, Sint32 rank,
|
bool CPixmap::DrawIconDemi (Sint32 chDst, size_t channel, Sint32 rank,
|
||||||
POINT pos, bool bMask)
|
POINT pos, bool bMask)
|
||||||
{
|
{
|
||||||
Sint32 nbx, nby;
|
Sint32 nbx, nby;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto texInfo = m_SDLTextureInfo.find (channel);
|
auto texInfo = m_SDLTextureInfo.find (channel);
|
||||||
if (texInfo == m_SDLTextureInfo.end ())
|
if (texInfo == m_SDLTextureInfo.end ())
|
||||||
@ -404,15 +386,12 @@ bool CPixmap::DrawIconDemi (Sint32 chDst, Sint32 channel, Sint32 rank,
|
|||||||
|
|
||||||
// Dessine une partie d'image rectangulaire.
|
// Dessine une partie d'image rectangulaire.
|
||||||
|
|
||||||
bool CPixmap::DrawIconPart (Sint32 chDst, Sint32 channel, Sint32 rank,
|
bool CPixmap::DrawIconPart (Sint32 chDst, size_t channel, Sint32 rank,
|
||||||
POINT pos,
|
POINT pos,
|
||||||
Sint32 startY, Sint32 endY, bool bMask)
|
Sint32 startY, Sint32 endY, bool bMask)
|
||||||
{
|
{
|
||||||
Sint32 nbx, nby;
|
Sint32 nbx, nby;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto texInfo = m_SDLTextureInfo.find (channel);
|
auto texInfo = m_SDLTextureInfo.find (channel);
|
||||||
if (texInfo == m_SDLTextureInfo.end ())
|
if (texInfo == m_SDLTextureInfo.end ())
|
||||||
@ -441,12 +420,9 @@ bool CPixmap::DrawIconPart (Sint32 chDst, Sint32 channel, Sint32 rank,
|
|||||||
|
|
||||||
// Dessine une partie d'image n'importe o�.
|
// Dessine une partie d'image n'importe o�.
|
||||||
|
|
||||||
bool CPixmap::DrawPart (Sint32 chDst, Sint32 channel, POINT dest, RECT rect,
|
bool CPixmap::DrawPart (Sint32 chDst, size_t channel, POINT dest, RECT rect,
|
||||||
bool bMask)
|
bool bMask)
|
||||||
{
|
{
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (m_SDLTextureInfo.find (channel) == m_SDLTextureInfo.end ())
|
if (m_SDLTextureInfo.find (channel) == m_SDLTextureInfo.end ())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -455,13 +431,10 @@ bool CPixmap::DrawPart (Sint32 chDst, Sint32 channel, POINT dest, RECT rect,
|
|||||||
|
|
||||||
// Dessine une partie d'image rectangulaire.
|
// Dessine une partie d'image rectangulaire.
|
||||||
|
|
||||||
bool CPixmap::DrawImage (Sint32 chDst, Sint32 channel, RECT rect)
|
bool CPixmap::DrawImage (Sint32 chDst, size_t channel, RECT rect)
|
||||||
{
|
{
|
||||||
POINT dst;
|
POINT dst;
|
||||||
Sint32 res;
|
Sint32 res;
|
||||||
|
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (m_SDLTextureInfo.find (channel) == m_SDLTextureInfo.end ())
|
if (m_SDLTextureInfo.find (channel) == m_SDLTextureInfo.end ())
|
||||||
return false;
|
return false;
|
||||||
@ -483,16 +456,13 @@ bool CPixmap::DrawImage (Sint32 chDst, Sint32 channel, RECT rect)
|
|||||||
|
|
||||||
// Construit une ic�ne en utilisant un masque.
|
// Construit une ic�ne en utilisant un masque.
|
||||||
|
|
||||||
bool CPixmap::BuildIconMask (Sint32 channelMask, Sint32 rankMask,
|
bool CPixmap::BuildIconMask (size_t channelMask, Sint32 rankMask,
|
||||||
Sint32 channel, Sint32 rankSrc, Sint32 rankDst)
|
size_t channel, Sint32 rankSrc, Sint32 rankDst)
|
||||||
{
|
{
|
||||||
Sint32 nbx, nby;
|
Sint32 nbx, nby;
|
||||||
POINT posDst;
|
POINT posDst;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
Sint32 res;
|
Sint32 res;
|
||||||
|
|
||||||
if (channel < 0 || channel >= MAXIMAGE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto texInfo = m_SDLTextureInfo.find (channel);
|
auto texInfo = m_SDLTextureInfo.find (channel);
|
||||||
if (texInfo == m_SDLTextureInfo.end ())
|
if (texInfo == m_SDLTextureInfo.end ())
|
||||||
|
27
src/pixmap.h
27
src/pixmap.h
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include "blupi.h"
|
#include "blupi.h"
|
||||||
|
|
||||||
#define MAXIMAGE 100
|
|
||||||
#define MAXCURSORS 14
|
#define MAXCURSORS 14
|
||||||
|
|
||||||
struct TextureInfo
|
struct TextureInfo
|
||||||
@ -33,27 +32,27 @@ public:
|
|||||||
bool Create (POINT dim, Sint32 mouseType);
|
bool Create (POINT dim, Sint32 mouseType);
|
||||||
void Fill (RECT rect, COLORREF color);
|
void Fill (RECT rect, COLORREF color);
|
||||||
|
|
||||||
bool Cache (Sint32 channel, const char *pFilename, POINT totalDim,
|
bool Cache (size_t channel, const char *pFilename, POINT totalDim,
|
||||||
POINT iconDim);
|
POINT iconDim);
|
||||||
bool Cache (Sint32 channel, const char *pFilename, POINT totalDim);
|
bool Cache (size_t channel, const char *pFilename, POINT totalDim);
|
||||||
bool Cache (Sint32 channel, SDL_Surface *surface, POINT totalDim);
|
bool Cache (size_t channel, SDL_Surface *surface, POINT totalDim);
|
||||||
void SetClipping (RECT clip);
|
void SetClipping (RECT clip);
|
||||||
RECT GetClipping();
|
RECT GetClipping();
|
||||||
|
|
||||||
bool IsIconPixel (Sint32 channel, Sint32 rank, POINT pos);
|
bool IsIconPixel (size_t channel, Sint32 rank, POINT pos);
|
||||||
|
|
||||||
bool DrawIcon (Sint32 chDst, Sint32 channel, Sint32 rank, POINT pos,
|
bool DrawIcon (Sint32 chDst, size_t channel, Sint32 rank, POINT pos,
|
||||||
bool bMask = false);
|
bool bMask = false);
|
||||||
bool DrawIconDemi (Sint32 chDst, Sint32 channel, Sint32 rank, POINT pos,
|
bool DrawIconDemi (Sint32 chDst, size_t channel, Sint32 rank, POINT pos,
|
||||||
bool bMask = false);
|
bool bMask = false);
|
||||||
bool DrawIconPart (Sint32 chDst, Sint32 channel, Sint32 rank, POINT pos,
|
bool DrawIconPart (Sint32 chDst, size_t channel, Sint32 rank, POINT pos,
|
||||||
Sint32 startY, Sint32 endY, bool bMask = false);
|
Sint32 startY, Sint32 endY, bool bMask = false);
|
||||||
bool DrawPart (Sint32 chDst, Sint32 channel, POINT dest, RECT rect,
|
bool DrawPart (Sint32 chDst, size_t channel, POINT dest, RECT rect,
|
||||||
bool bMask = false);
|
bool bMask = false);
|
||||||
bool DrawImage (Sint32 chDst, Sint32 channel, RECT rect);
|
bool DrawImage (Sint32 chDst, size_t channel, RECT rect);
|
||||||
|
|
||||||
bool BuildIconMask (Sint32 channelMask, Sint32 rankMask,
|
bool BuildIconMask (size_t channelMask, Sint32 rankMask,
|
||||||
Sint32 channel, Sint32 rankSrc, Sint32 rankDst);
|
size_t channel, Sint32 rankSrc, Sint32 rankDst);
|
||||||
|
|
||||||
bool Display();
|
bool Display();
|
||||||
|
|
||||||
@ -63,8 +62,8 @@ public:
|
|||||||
void ChangeSprite (MouseSprites sprite);
|
void ChangeSprite (MouseSprites sprite);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Sint32 BltFast (Sint32 chDst, Sint32 channel, POINT dst, RECT rcRect);
|
Sint32 BltFast (Sint32 chDst, size_t channel, POINT dst, RECT rcRect);
|
||||||
Sint32 BltFast (SDL_Texture *lpSDL, Sint32 channel, POINT dst, RECT rcRect);
|
Sint32 BltFast (SDL_Texture *lpSDL, size_t channel, POINT dst, RECT rcRect);
|
||||||
|
|
||||||
RECT MouseRectSprite();
|
RECT MouseRectSprite();
|
||||||
SDL_Point GetCursorHotSpot (Sint32 sprite);
|
SDL_Point GetCursorHotSpot (Sint32 sprite);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user