mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- made adjustments to FGLBitmap for the changes in its base class.
This commit is contained in:
parent
371225858d
commit
685385635f
2 changed files with 11 additions and 7 deletions
|
@ -51,28 +51,30 @@
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T>
|
template<class T>
|
||||||
void iCopyColors(unsigned char * pout, const unsigned char * pin, int count, int step)
|
void iCopyColors(unsigned char * pout, const unsigned char * pin, int count, int step, BYTE tr, BYTE tg, BYTE tb)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
unsigned char a;
|
||||||
|
|
||||||
for(i=0;i<count;i++)
|
for(i=0;i<count;i++)
|
||||||
{
|
{
|
||||||
if (T::A(pin) != 0)
|
if ((a = T::A(pin, tr, tg, tb)) != 0)
|
||||||
{
|
{
|
||||||
pout[0]=T::R(pin);
|
pout[0]=T::R(pin);
|
||||||
pout[1]=T::G(pin);
|
pout[1]=T::G(pin);
|
||||||
pout[2]=T::B(pin);
|
pout[2]=T::B(pin);
|
||||||
pout[3]=T::A(pin);
|
pout[3]=a;
|
||||||
}
|
}
|
||||||
pout+=4;
|
pout+=4;
|
||||||
pin+=step;
|
pin+=step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (*CopyFunc)(unsigned char * pout, const unsigned char * pin, int count, int step);
|
typedef void (*CopyFunc)(unsigned char * pout, const unsigned char * pin, int count, int step, BYTE tr, BYTE tg, BYTE tb);
|
||||||
|
|
||||||
static CopyFunc copyfuncs[]={
|
static CopyFunc copyfuncs[]={
|
||||||
iCopyColors<cRGB>,
|
iCopyColors<cRGB>,
|
||||||
|
iCopyColors<cRGBT>,
|
||||||
iCopyColors<cRGBA>,
|
iCopyColors<cRGBA>,
|
||||||
iCopyColors<cIA>,
|
iCopyColors<cIA>,
|
||||||
iCopyColors<cCMYK>,
|
iCopyColors<cCMYK>,
|
||||||
|
@ -92,14 +94,14 @@ static CopyFunc copyfuncs[]={
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
void FGLBitmap::CopyPixelDataRGB(int originx, int originy,
|
void FGLBitmap::CopyPixelDataRGB(int originx, int originy,
|
||||||
const BYTE * patch, int srcwidth, int srcheight, int step_x, int step_y,
|
const BYTE * patch, int srcwidth, int srcheight, int step_x, int step_y,
|
||||||
int rotate, int ct, FCopyInfo *inf)
|
int rotate, int ct, FCopyInfo *inf, int r, int g, int b)
|
||||||
{
|
{
|
||||||
if (ClipCopyPixelRect(&ClipRect, originx, originy, patch, srcwidth, srcheight, step_x, step_y, rotate))
|
if (ClipCopyPixelRect(&ClipRect, originx, originy, patch, srcwidth, srcheight, step_x, step_y, rotate))
|
||||||
{
|
{
|
||||||
BYTE *buffer = GetPixels() + 4*originx + Pitch*originy;
|
BYTE *buffer = GetPixels() + 4*originx + Pitch*originy;
|
||||||
for (int y=0;y<srcheight;y++)
|
for (int y=0;y<srcheight;y++)
|
||||||
{
|
{
|
||||||
copyfuncs[ct](&buffer[y*Pitch], &patch[y*step_y], srcwidth, step_x);
|
copyfuncs[ct](&buffer[y*Pitch], &patch[y*step_y], srcwidth, step_x, (BYTE)r, (BYTE)g, (BYTE)b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void CopyPixelDataRGB(int originx, int originy, const BYTE *patch, int srcwidth,
|
virtual void CopyPixelDataRGB(int originx, int originy, const BYTE *patch, int srcwidth,
|
||||||
int srcheight, int step_x, int step_y, int rotate, int ct, FCopyInfo *inf = NULL);
|
int srcheight, int step_x, int step_y, int rotate, int ct, FCopyInfo *inf = NULL,
|
||||||
|
/* for PNG tRNS */ int r=0, int g=0, int b=0);
|
||||||
|
|
||||||
virtual void CopyPixelData(int originx, int originy, const BYTE * patch, int srcwidth, int srcheight,
|
virtual void CopyPixelData(int originx, int originy, const BYTE * patch, int srcwidth, int srcheight,
|
||||||
int step_x, int step_y, int rotate, PalEntry * palette, FCopyInfo *inf = NULL);
|
int step_x, int step_y, int rotate, PalEntry * palette, FCopyInfo *inf = NULL);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue