ColorBetween function. Fail.
#6

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Not an option at the moment.
I always have sucked with shifts. Could you show me what you mean?
I think this page explains it rather well: https://sampwiki.blast.hk/wiki/Binary

Taking your example from earlier:
Код:
FF7F3F1F // hex
11111111 01111111 00111111 00011111
^ Most significant bit (MSB)

Arithmetic right shift by 24:
11111111 11111111 11111111 11111111
^^^^^^^^ ^^^^^^^^ ^^^^^^^^
padding is the value of the MSB (1)

Logical right shift by 24:
00000000 00000000 00000000 11111111
^^^^^^^^ ^^^^^^^^ ^^^^^^^^
padding is just 0
Edit: I didn't pay attention to the "& 0xFF". In any case that should only select the lower 8 bits, no matter what kind of shift is used.
Reply


Messages In This Thread
ColorBetween function. Fail. - by Crayder - 19.03.2015, 07:02
AW: ColorBetween function. Fail. - by Kaliber - 19.03.2015, 07:19
Re: ColorBetween function. Fail. - by Vince - 19.03.2015, 10:22
Re: ColorBetween function. Fail. - by Crayder - 19.03.2015, 12:06
AW: Re: ColorBetween function. Fail. - by Kaliber - 19.03.2015, 12:17
Re: ColorBetween function. Fail. - by Vince - 19.03.2015, 14:41
Re: ColorBetween function. Fail. - by Crayder - 19.03.2015, 20:43

Forum Jump:


Users browsing this thread: 1 Guest(s)