MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / GetPackedColor

Function GetPackedColor

engine/Poseidon/IO/ParamFileExt.cpp:44–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44PackedColor GetPackedColor(const ParamEntry& entry)
45{
46 if (entry.GetSize() != 4)
47 {
48 return PackedWhite;
49 }
50 int r8 = toInt(entry[0].GetFloat() * 255);
51 int g8 = toInt(entry[1].GetFloat() * 255);
52 int b8 = toInt(entry[2].GetFloat() * 255);
53 int a8 = toInt(entry[3].GetFloat() * 255);
54 saturate(r8, 0, 255);
55 saturate(g8, 0, 255);
56 saturate(b8, 0, 255);
57 saturate(a8, 0, 255);
58 return PackedColor(r8, g8, b8, a8);
59}
60
61Color GetColor(const ParamEntry& entry)
62{

Callers 15

LoadMethod · 0.85
LoadMethod · 0.85
InitMethod · 0.85
OnColorChangedMethod · 0.85
DisplayMPPlayersMethod · 0.85
CMPSideButtonMethod · 0.85
CMPRolesMethod · 0.85
UpdatePictureMethod · 0.85
UIMapMain.cppFile · 0.85
CWarrantMethod · 0.85
SetCursorMethod · 0.85
LoadMethod · 0.85

Calls 5

saturateFunction · 0.85
toIntFunction · 0.50
PackedColorClass · 0.50
GetSizeMethod · 0.45
GetFloatMethod · 0.45

Tested by

no test coverage detected