83 iX,iY,
Wdt,
Hgt,
true,pTransform);
122 iX,iY,
Wdt,
Hgt,
true,pTransform);
167 ccgo.
Y += (cgo.
Hgt - ccgo.
Hgt) / 2;
173 ccgo.
X += (cgo.
Wdt - ccgo.
Wdt) / 2;
193 ccgo.
X -= 1; ccgo.
Y -= 1;
194 ccgo.
Wdt += 2; ccgo.
Hgt += 2;
201 ccgo.
X += (cgo.
Wdt - ccgo.
Wdt) / 2;
207 ccgo.
Y += (cgo.
Hgt - ccgo.
Hgt) / 2;
227 DrawX(sfcTarget, iX, iY, iWdt, iHgt);
238 void C4Facet::DrawXR(
C4Surface * sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iSectionX, int32_t iSectionY, int32_t r)
242 rot.
SetRotate(r / 100.0f, (
float) (iX+iX+iWdt)/2, (
float) (iY+iY+iHgt)/2);
244 float(
X+
Wdt*iSectionX),
float(
Y+
Hgt*iSectionY),
float(
Wdt),
float(
Hgt),
254 int32_t iWdt=
Wdt,iHgt=
Hgt;
271 if ((iWdt>
Wdt) || (iHgt>
Hgt))
return fctResult;
288 int32_t iWdt=
Wdt,iHgt=
Hgt;
295 if ((iWdt>
Wdt) || (iHgt>
Hgt))
return fctResult;
311 char ostr[25];
sprintf(ostr,
"%i",iValue);
315 Draw(cgo,
true, iSectionX, iSectionY);
321 int32_t textwdt, texthgt;
326 Draw(cgo,
true, iSectionX, iSectionY);
332 void C4Facet::DrawValue2(
C4Facet &cgo, int32_t iValue1, int32_t iValue2, int32_t iSectionX, int32_t iSectionY, int32_t iAlign, int32_t *piUsedWidth)
335 char ostr[25];
sprintf(ostr,
"%i/%i",iValue1,iValue2);
339 Draw(cgo,
true, iSectionX, iSectionY);
345 int32_t textwdt, texthgt;
351 Draw(cgo,
true, iSectionX, iSectionY);
352 if (piUsedWidth) *piUsedWidth = textwdt;
358 void C4Facet::DrawX(
C4Surface * sfcTarget,
float iX,
float iY,
float iWdt,
float iHgt, int32_t iSectionX, int32_t iSectionY)
const
362 float(
X+
Wdt*iSectionX),
float(
Y+
Hgt*iSectionY),
float(
Wdt),
float(
Hgt),
373 float zx = fWdt / float(
Wdt), zy = fHgt / float(
Hgt);
374 int32_t iX = (int32_t) ceilf(fX), iY = (int32_t) ceilf(fY), iX2 = (int32_t) floorf(fX+fWdt), iY2 = (int32_t) floorf(fY+fHgt);
375 float ox = (-fX+iX)/zx, oy = (-fY+iY)/zy;
376 float oxs = (+fX+fWdt-iX2)/zx, oys = (+fY+fHgt-iY2)/zy;
378 float(
X)+ox, float(
Y)+oy, float(
Wdt)-ox-oxs, float(
Hgt)-oy-oys,
382 zx=(iX2-iX)/(
float(
Wdt)-ox-oxs);
383 zy=(iY2-iY)/(
float(
Hgt)-oy-oys);
407 int32_t yBar =
Hgt - Clamp<int32_t>(iLevel,0,iRange) *
Hgt / std::max<int32_t>(iRange,1);
408 int32_t iY = 0, vidx=0;
414 int32_t dh = (iY >=
Hgt-h) ?
Hgt - iY : h - dy;
421 else if (iY + h >= yBar)
424 if (!vidx && iY && iY + dh > h)
437 if (iY + dh >=
Hgt - h)
452 gfx_draw.
Y = gfx.
Y + vidx*h + dy;
466 X-=iLeft;
Wdt+=iLeft;
487 for (i = 0; i < 6; i++)
496 g_ascii_dtostr(val.
getMData(), G_ASCII_DTOSTR_BUF_SIZE,
mat[i]);
510 mat[i] = g_ascii_strtod (val.
getData(),
nullptr);
512 if (deserializing) sscanf(val.
getData(),
"%g", &
mat[i]);
517 if (!deserializing &&
mat[6] == 0 &&
mat[7] == 0 &&
mat[8] == 1)
return;
519 for (i = 6; i < 9; ++i)
523 mat[i] = (i == 8) ? 1.0f : 0.0f;
536 if (deserializing) sscanf(val.
getData(),
"%g", &
mat[i]);
544 float A = r.
mat[0] + r.
mat[6]*iOffX;
545 float B = r.
mat[1] + r.
mat[7]*iOffX;
546 float D = r.
mat[3] + r.
mat[6]*iOffY;
547 float E = r.
mat[4] + r.
mat[7]*iOffY;
549 A, B, r.
mat[2] - A *iOffX - B *iOffY + r.
mat[8]*iOffX,
550 D, E, r.
mat[5] - D *iOffX - E *iOffY + r.
mat[8]*iOffY,
559 if (percentHgt == 0) percentHgt = percentWdt;
561 int iX =
X, iY =
Y, iWdt = std::max(
Wdt*percentWdt/100, 1.0f), iHgt = std::max(
Hgt*percentHgt/100, 1.0f);
const int32_t C4FCT_Bottom
const int32_t C4FCT_Double
const int32_t C4FCT_Right
const int32_t C4FCT_Triple
const int32_t C4FCT_Alignment
const int32_t C4FCT_Center
C4GraphicsResource GraphicsResource
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
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)
bool BlitUnscaled(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)
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
void DrawValue2(C4Facet &cgo, int32_t iValue1, int32_t iValue2, int32_t iPhaseX=0, int32_t iPhaseY=0, int32_t iAlign=C4FCT_Center, int32_t *piUsedWidth=nullptr)
void Set(C4Surface &rSfc)
void DrawT(C4Surface *sfcTarget, float iX, float iY, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform)
C4Facet GetSection(int32_t iSection)
C4Facet GetPhase(int iPhaseX=0, int iPhaseY=0)
void DrawValue2Clr(C4Facet &cgo, int32_t iValue1, int32_t iValue2, DWORD dwClr)
void DrawFullScreen(C4Facet &cgo)
void Expand(int32_t iLeft=0, int32_t iRight=0, int32_t iTop=0, int32_t iBottom=0)
void DrawTUnscaled(C4Surface *sfcTarget, float iX, float iY, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform)
int32_t GetSectionCount()
void DrawValue(C4Facet &cgo, int32_t iValue, int32_t iPhaseX=0, int32_t iPhaseY=0, int32_t iAlign=C4FCT_Center)
void DrawClr(C4Facet &cgo, bool fAspect=true, DWORD dwClr=0)
C4Facet Truncate(int32_t iAlign, int32_t iSize)
C4Facet TruncateSection(int32_t iAlign=C4FCT_Left)
void DrawEnergyLevelEx(int32_t iLevel, int32_t iRange, const C4Facet &gfx, int32_t bar_idx)
void Draw(C4Facet &cgo, bool fAspect=true, int32_t iPhaseX=0, int32_t iPhaseY=0, bool fTransparent=true)
void DrawXT(C4Surface *sfcTarget, float iX, float iY, int32_t iWdt, int32_t iHgt, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform)
bool GetPhaseNum(int32_t &rX, int32_t &rY)
void DrawX(C4Surface *sfcTarget, float iX, float iY, float iWdt, float iHgt, int32_t iPhaseX=0, int32_t iPhaseY=0) const
void DrawXR(C4Surface *sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iPhaseX=0, int32_t iPhaseY=0, int32_t r=0)
C4Facet GetFraction(int32_t percentWdt, int32_t percentHgt=0, int32_t alignX=C4FCT_Left, int32_t alignY=C4FCT_Top)
void DrawXClr(C4Surface *sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, DWORD dwClr)
void DrawXFloat(C4Surface *sfcTarget, float fX, float fY, float fWdt, float fHgt) const
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup=true)
virtual bool Separator(Sep eSep=SEP_SEP)
void Value(const T &rStruct)
virtual bool isDeserializer()
void SetLength(size_t iLength)
const char * getData() const
void AppendChar(char cChar)
void Append(const char *pnData, size_t iChars)
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O