Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sprite Editor
#1
I have a listing (N5 or N6 ?) for a sprite editor that I am trying to convert to N7.

There is a command that is used in converting the colour detected by the mouse into an RGB format... That command is 'SHR' (SHift register Right).

Reason: Using pixeli(x, y), to detect the colour, produces a number like:
black = 4278190080
white = 4294967295
red = 4294901760
green = 4278255360
blue = 4278190335

To convert to RGB three functions were used: n_c is the colour detected

rem    ---------------------------------------------------
rem        Convert to RGB format
rem    ---------------------------------------------------
function getB(n_c)
    return n_c AND 255
endfunc   

function getG(n_c)
    return (n_c SHR 8) AND 255
endfunc   

function getR(n_c)
    return (n_c SHR 16) AND 255
endfunc

I need to know if there is a method to replace SHR.
Logic is the beginning of wisdom.
Reply


Messages In This Thread
Sprite Editor - by johnno56 - 12-24-2024, 08:55 AM
RE: Sprite Editor - by Marcus - 12-25-2024, 09:48 AM
RE: Sprite Editor - by johnno56 - 12-25-2024, 08:24 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)