x |= 0xFF << 24
#1

Hey.
I saw the code on this forum, can you explain me how it' works? (operator |= and <<)
Код:
x |= 0xFF << 24
Reply
#2

I think you will find more info here:
https://sampforum.blast.hk/showthread.php?tid=177523
Reply
#3

To answer your question: due to operator precedence, first this part is executed:
pawn Код:
0xFF << 24
This shifts 0xFF left by 24 bits. This actually exactly the same as writing 0xFF000000. This value is then OR'd with x. I presume x to be an ARGB color for objects materials, in which case it will make that color completely opaque.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)