chore: Readable shifting of icon_number to create byte array

This commit is contained in:
jonnypower 2018-07-14 23:54:24 -07:00
parent 0eaa1b3ff0
commit 8b9d3d3b8b

View file

@ -133,7 +133,14 @@ void loadImages( const int icon_number, std::vector<vgui::BitmapTGA*>& images )
std::string extension = ".tga";
std::string icon_name;
unsigned char icon_bytes[2] = { static_cast<unsigned char>((icon_number >> 8) & 0xFF), static_cast<unsigned char>(icon_number & 0xFF )};
unsigned char icon_bytes[2] = {
static_cast<unsigned char>(
(icon_number >> 8) & 0xFF
),
static_cast<unsigned char>(
icon_number & 0xFF
)
};
MakeHexPairsFromBytes(icon_bytes,icon_name,2);
icon_name = "0x" + icon_name;