mirror of
https://github.com/ENSL/NS.git
synced 2024-11-25 22:11:04 +00:00
chore: Readable shifting of icon_number to create byte array
This commit is contained in:
parent
0eaa1b3ff0
commit
8b9d3d3b8b
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue