SA-MP Forums Archive
x |= 0xFF << 24 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: x |= 0xFF << 24 (/showthread.php?tid=576764)



x |= 0xFF << 24 - seler - 06.06.2015

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



Re: x |= 0xFF << 24 - dominik523 - 06.06.2015

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


Re: x |= 0xFF << 24 - Vince - 06.06.2015

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.