OpenClonk
C4StartupPlrSelDlg.cpp File Reference
Include dependency graph for C4StartupPlrSelDlg.cpp:

Go to the source code of this file.

Classes

struct  C4StartupPlrSelDlg_CrewSortDataEntry
 
class  C4StartupPlrSelDlg_CrewSortDataMatchType
 
class  C4StartupPlrColorPickerDlg
 

Typedefs

typedef std::vector< C4StartupPlrSelDlg_CrewSortDataEntryC4StartupPlrSelDlg_CrewSortData
 

Functions

StdStrBuf TimeString (int iSeconds)
 
StdStrBuf DateString (int iTime)
 
bool IsColorConflict (DWORD dwClr1, DWORD dwClr2)
 

Variables

const uint32_t ClrPlayerItem = 0xffffffff
 
const uint32_t PlayerColorValueLowBound = 64
 

Typedef Documentation

◆ C4StartupPlrSelDlg_CrewSortData

Function Documentation

◆ DateString()

StdStrBuf DateString ( int  iTime)

Definition at line 48 of file C4StartupPlrSelDlg.cpp.

49 {
50  if (!iTime) return StdStrBuf("", true);
51  time_t tTime = iTime;
52  struct tm *pLocalTime;
53  pLocalTime=localtime(&tTime);
54  return FormatString( "%02d.%02d.%d %02d:%02d",
55  pLocalTime->tm_mday,
56  pLocalTime->tm_mon+1,
57  pLocalTime->tm_year+1900,
58  pLocalTime->tm_hour,
59  pLocalTime->tm_min);
60 }
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270

References FormatString().

Referenced by C4StartupPlrSelDlg::PlayerListItem::SetSelectionInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsColorConflict()

bool IsColorConflict ( DWORD  dwClr1,
DWORD  dwClr2 
)

Definition at line 39 of file C4PlayerInfoConflicts.cpp.

40 {
41  // NEW COLOR CONFLICT METHOD: u'v'-distance
42  int R1 = 0xff & (dwClr1 >> 16);
43  int G1 = 0xff & (dwClr1 >> 8);
44  int B1 = 0xff & (dwClr1 );
45  int R2 = 0xff & (dwClr2 >> 16);
46  int G2 = 0xff & (dwClr2 >> 8);
47  int B2 = 0xff & (dwClr2 );
48  double r1=0,g1=0,b1=0,r2=0,g2=0,b2=0,x1=0,y1=0,Y1=0,x2=0,y2=0,Y2=0,u1=0,v1=0,u2=0,v2=0;
49  RGB2rgb(R1, G1, B1, &r1, &g1, &b1);
50  RGB2rgb(R2, G2, B2, &r2, &g2, &b2);
51  rgb2xyY(r1, g1, b1, &x1, &y1, &Y1);
52  rgb2xyY(r2, g2, b2, &x2, &y2, &Y2);
53  xy2upvp(x1, y1, &u1, &v1);
54  xy2upvp(x2, y2, &u2, &v2);
55  double Y = (Y1+Y2)/2.0;
56  double clrdiff = sqrt((u2-u1)*(u2-u1) + (v2-v1)*(v2-v1)) * Y*Y * 150;
57  double lumdiff = (Abs<double>(Y2-Y1) / std::max<double>(Y*Y*5, 0.5)) / 0.10;
58  return clrdiff + lumdiff < 1.0;
59 }
bool rgb2xyY(double r, double g, double b, double *px, double *py, double *pY)
Definition: StdColors.h:148
bool xy2upvp(double x, double y, double *pu, double *pv)
Definition: StdColors.h:166
bool RGB2rgb(int R, int G, int B, double *pr, double *pg, double *pb, double gamma=2.2)
Definition: StdColors.h:175

References RGB2rgb(), rgb2xyY(), and xy2upvp().

Here is the call graph for this function:

◆ TimeString()

StdStrBuf TimeString ( int  iSeconds)

Definition at line 41 of file C4StartupPlrSelDlg.cpp.

42 {
43  int iHours = iSeconds / 3600; iSeconds -= 3600*iHours;
44  int iMinutes = iSeconds / 60; iSeconds -= 60*iMinutes;
45  return FormatString("%02d:%02d:%02d",iHours,iMinutes,iSeconds);
46 }

References FormatString().

Referenced by C4StartupPlrSelDlg::PlayerListItem::GetDelWarning(), and C4StartupPlrSelDlg::PlayerListItem::SetSelectionInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ClrPlayerItem

const uint32_t ClrPlayerItem = 0xffffffff

◆ PlayerColorValueLowBound

const uint32_t PlayerColorValueLowBound = 64

Definition at line 37 of file C4StartupPlrSelDlg.cpp.