29 Set(nsfc, nx, ny, nwdt, nhgt, ntx, nty,
Zoom, ntx, nty);
59 if (!Face.
Create(iWdt,iHgt))
return false;
69 Set(&Face,0,0,iWdt2,iHgt2);
94 const char *
const extensions[] = {
"png",
"bmp",
"jpeg",
"jpg",
nullptr };
95 int i = 0;
const char *szExt;
96 while ((szExt = extensions[i++]))
103 if (!Face.
Load(hGroup,szFilename,
false,fNoErrIfNotFound, iFlags))
return false;
113 Set(&Face,0,0,iWdt,iHgt);
120 if (!srcSfc.
Wdt || !srcSfc.
Hgt)
return false;
123 bool fNeedsScale = !(srcSfc.
Wdt <= iMaxSize && srcSfc.
Hgt <= iMaxSize);
124 if (!fNeedsScale && !dwColor)
133 fctSource.
Set(&srcSfc, 0,0,srcSfc.
Wdt,srcSfc.
Hgt);
134 int32_t iTargetWdt, iTargetHgt;
137 if (fctSource.
Wdt > fctSource.
Hgt)
139 iTargetWdt = iMaxSize;
140 iTargetHgt = fctSource.
Hgt * iTargetWdt / fctSource.
Wdt;
144 iTargetHgt = iMaxSize;
145 iTargetWdt = fctSource.
Wdt * iTargetHgt / fctSource.
Hgt;
150 iTargetWdt = fctSource.
Wdt;
151 iTargetHgt = fctSource.
Hgt;
153 if (dwColor) srcSfc.
SetClr(dwColor);
154 Create(iTargetWdt, iTargetHgt);
155 pDraw->
Blit(&srcSfc, 0.0f,0.0f,
float(fctSource.
Wdt),
float(fctSource.
Hgt),
156 &Face, 0,0,iTargetWdt,iTargetHgt);
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
char * GetExtension(char *szFilename)
void EnforceExtension(char *szFilename, const char *szExtension)
bool Blit(C4Surface *sfcSource, float fx, float fy, float fwdt, float fhgt, C4Surface *sfcTarget, float tx, float ty, float twdt, float thgt, bool fSrcColKey=false, const C4BltTransform *pTransform=nullptr)
void Grayscale(C4Surface *sfcSfc, int32_t iOffset=0)
void Set(C4Surface &rSfc)
void Draw(C4Facet &cgo, bool fAspect=true, int32_t iPhaseX=0, int32_t iPhaseY=0, bool fTransparent=true)
bool Load(C4Group &hGroup, const char *szName, int iWdt, int iHgt, bool fNoErrIfNotFound, int iFlags)
bool Create(int iWdt, int iHgt, int iWdt2=C4FCT_Full, int iHgt2=C4FCT_Full)
bool CreateClrByOwner(C4Surface *pBySurface)
void Set(const C4Facet &cpy)
bool CopyFromSfcMaxSize(C4Surface &srcSfc, int32_t iMaxSize, uint32_t dwColor=0u)
void Grayscale(int32_t iOffset=0)
bool FindEntry(const char *wildcard, StdStrBuf *filename=nullptr, size_t *size=nullptr)
bool CreateColorByOwner(C4Surface *pBySurface)
bool Copy(C4Surface &fromSfc)
bool Load(C4Group &hGroup, const char *szFilename, bool fOwnPal, bool fNoErrIfNotFound, int iFlags)
bool Create(int iWdt, int iHgt, int iFlags=0)
void SetRect(C4TargetRect &rSrc)
void Set(const C4Facet &cpy)