From 641ffc4b979d13b1fa2026359a149e6f3f026511 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sun, 5 Feb 2017 09:48:48 +0100 Subject: [PATCH] Remove obsolete function --- pixmap.cpp | 76 ------------------------------------------------------ pixmap.h | 1 - 2 files changed, 77 deletions(-) diff --git a/pixmap.cpp b/pixmap.cpp index b324f6a..d3ce5b8 100644 --- a/pixmap.cpp +++ b/pixmap.cpp @@ -292,82 +292,6 @@ HRESULT CPixmap::BltFast(SDL_Texture *lpSDL, return ddrval; } -// Cherche une couleur dans la palette principale. -// En mode plein écran, il faut chercher dans la palette -// correspondant aux images (obtenue avec SavePalette), -// alors qu'en mode fenêtre, il faut chercher dans la -// palette système (obtenue avec InitSysPalette) !!! - -int CPixmap::SearchColor(int red, int green, int blue) -{ - int i, j, delta, min; - - if ( m_bFullScreen ) - { - for ( i=0 ; i<256 ; i++ ) - { - if ( red == m_pal[i].peRed && - green == m_pal[i].peGreen && - blue == m_pal[i].peBlue ) return i; - } - - // Cherche la couleur la plus proche. - min = 10000; - j = -1; - for ( i=0 ; i<256 ; i++ ) - { - delta = abs(red - m_pal[i].peRed )+ - abs(green - m_pal[i].peGreen)+ - abs(blue - m_pal[i].peBlue ); - - if ( delta < min ) - { - min = delta; - j = i; - } - } - } - else - { - if ( m_bPalette ) - { - for ( i=0 ; i<256 ; i++ ) - { - if ( red == m_sysPal[i].peRed && - green == m_sysPal[i].peGreen && - blue == m_sysPal[i].peBlue ) return i; - } - - // Cherche la couleur la plus proche. - min = 10000; - j = -1; - for ( i=0 ; i<256 ; i++ ) - { - delta = abs(red - m_sysPal[i].peRed )+ - abs(green - m_sysPal[i].peGreen)+ - abs(blue - m_sysPal[i].peBlue ); - - if ( delta < min ) - { - min = delta; - j = i; - } - } - } - else - { - j = (blue >>3) &0x001F; - j |= ((green>>2)<< 5)&0x07E0; - j |= ((red >>3)<<11)&0xF800; // mode 5-6-5 -//? j = (blue >>3) &0x001F; -//? j |= ((green>>3)<< 5)&0x03E0; -//? j |= ((red >>3)<<10)&0x7C00; // mode 5-5-5 - } - } - return j; -} - - // Cache une image contenant des icônes. bool CPixmap::Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim, diff --git a/pixmap.h b/pixmap.h index bf570cc..3b65da3 100644 --- a/pixmap.h +++ b/pixmap.h @@ -22,7 +22,6 @@ public: bool Flush(); void Fill(RECT rect, COLORREF color); - int SearchColor(int red, int green, int blue); bool Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim, bool bUsePalette); bool Cache(int channel, char *pFilename, POINT totalDim, bool bUsePalette); bool Cache(int channel, SDL_Surface *surface, POINT totalDim);