Page 1 of 1

Posted: Thu Mar 28, 2002 1:35 am
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi @ all
Can someone post a working inline asm code (procedure i.e) that return the value of a 24 bit RGB colour (between 0 and 255)..? The orginal command is called Red() for example and stored in MiscLib but i dont have the space to use this lib at the moment... And its not important if the result is R,G,B ... in all three vals is everytime the same val :wink:)

Many thanks to all who try to help me in my actual game project that will be released in this days (if all works fine)...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Thu Mar 28, 2002 8:34 am
by BackupUser
Restored from previous forum. Originally posted by fred.

No need for inline asm here:

Red = Colour & $FF

And you got it :)

For Green:

Green = (Colour >> 8) & $FF

For Blue:

Green = Blue >> 16

Fred - AlphaSND

Posted: Thu Mar 28, 2002 4:25 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.
No need for inline asm here:

Red = Colour & $FF

And you got it :)

For Green:

Green = (Colour >> 8) & $FF

For Blue:

Green = Blue >> 16

Fred - AlphaSND

Suppose the last line must be:

Blue = Green >> 16

BTW: Can't find a the 'Colour' command in the docs, is it new?


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Posted: Thu Mar 28, 2002 10:19 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Colour is your Color

(registered PureBasic user)

Posted: Fri Mar 29, 2002 12:38 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

Shouldn't it be:

Code: Select all

Blue = Colour >> 16
?

Bye,

El_Choni