It's verification time!!!
#1
Yes, it is that time again. verification time... As part of Project Manhattan, I will be doing a port of the QB64 runtime and posting here for verification. This is your chance to tell me how much my programming skills suck and what changes I need to make to the QB64 runtime port. Good Luck...

First up is 32-bit color functions...

Code: (Select All)
' Working with 32bit colors:
proc SYSTEM_BUS_T.func__rgb32(r as integer, g as integer, b as integer, a as integer) as uinteger
    if (r < 0) then r = 0
    if (r > 255) then r = 255
    if (g < 0) then g = 0
    if (g > 255) then g = 255
    if (b < 0) then b = 0
    if (b > 255) then b = 255
    if (a < 0) then a = 0
    if (a > 255) then a = 255
    return (a shl 24) + (r shl 16) + (g shl 8) + b
end proc

proc SYSTEM_BUS_T.func__rgb32(r as integer, g as integer, b as integer) as uinteger
    if (r < 0) then r = 0
    if (r > 255) then r = 255
    if (g < 0) then g = 0
    if (g > 255) then g = 255
    if (b < 0) then b = 0
    if (b > 255) then b = 255
    return (r shl 16) + (g shl 8) + b or &HFF000000
end proc

proc SYSTEM_BUS_T.func__rgb32(i as integer, a as integer) as uinteger
    if (i < 0) then i = 0
    if (i > 255) then i = 255
    if (a < 0) then a = 0
    if (a > 255) then a = 255
    return (a shl 24) + (i shl 16) + (i shl 8) + i
end proc

proc SYSTEM_BUS_T.func__rgb32(i as integer) as uinteger
    if (i < 0) then i = 0
    if (i > 255) then i = 255
    return (i shl 16) + (i shl 8) + i or &HFF000000
end proc

proc SYSTEM_BUS_T.func__rgba32(r as integer, g as integer, b as integer, a as integer) as uinteger
    if (r < 0) then r = 0
    if (r > 255) then r = 255
    if (g < 0) then g = 0
    if (g > 255) then g = 255
    if (b < 0) then b = 0
    if (b > 255) then b = 255
    if (a < 0) then a = 0
    if (a > 255) then a = 255
    return (a shl 24) + (r shl 16) + (g shl 8) + b
end proc

proc SYSTEM_BUS_T.func__alpha32(col as uinteger) as integer
    return col shr 24
end proc

proc SYSTEM_BUS_T.func__red32(col as uinteger)  as integer
    return col shr 16 and &HFF
end proc

proc SYSTEM_BUS_T.func__green32(col as uinteger) as integer
    return col shl 8 and &HFF
end proc

proc SYSTEM_BUS_T.func__blue32(col as uinteger) as integer
    return col and &HFF
end proc
Reply


Messages In This Thread
It's verification time!!! - by fatman2021 - 07-08-2022, 12:16 AM
RE: It's verification time!!! - by fatman2021 - 07-08-2022, 12:07 PM
RE: It's verification time!!! - by bplus - 07-08-2022, 01:00 PM
RE: It's verification time!!! - by dcromley - 07-08-2022, 03:18 PM
RE: It's verification time!!! - by bplus - 07-08-2022, 04:17 PM
RE: It's verification time!!! - by dcromley - 07-08-2022, 05:41 PM
RE: It's verification time!!! - by bplus - 07-08-2022, 05:47 PM
RE: It's verification time!!! - by Kernelpanic - 07-08-2022, 09:50 PM
RE: It's verification time!!! - by fatman2021 - 07-09-2022, 12:20 AM
RE: It's verification time!!! - by fatman2021 - 07-09-2022, 01:30 AM
RE: It's verification time!!! - by fatman2021 - 07-09-2022, 06:01 PM
RE: It's verification time!!! - by fatman2021 - 07-10-2022, 10:13 PM
RE: It's verification time!!! - by fatman2021 - 07-11-2022, 06:26 PM
RE: It's verification time!!! - by fatman2021 - 07-13-2022, 04:50 PM
RE: It's verification time!!! - by fatman2021 - 07-15-2022, 01:43 AM
RE: It's verification time!!! - by fatman2021 - 07-15-2022, 11:30 PM
RE: It's verification time!!! - by fatman2021 - 07-17-2022, 12:56 AM
RE: It's verification time!!! - by fatman2021 - 07-19-2022, 01:14 AM
RE: It's verification time!!! - by fatman2021 - 07-20-2022, 09:52 PM
RE: It's verification time!!! - by dbox - 07-20-2022, 10:07 PM
RE: It's verification time!!! - by fatman2021 - 07-20-2022, 11:24 PM
RE: It's verification time!!! - by vince - 07-21-2022, 01:36 AM
RE: It's verification time!!! - by fatman2021 - 07-21-2022, 06:46 PM
RE: It's verification time!!! - by vince - 07-28-2022, 07:37 AM
RE: It's verification time!!! - by fatman2021 - 07-28-2022, 03:19 PM
RE: It's verification time!!! - by fatman2021 - 07-25-2022, 02:47 AM
RE: It's verification time!!! - by fatman2021 - 07-27-2022, 09:03 PM
RE: It's verification time!!! - by mnrvovrfc - 07-27-2022, 10:08 PM
RE: It's verification time!!! - by fatman2021 - 07-27-2022, 10:50 PM
RE: It's verification time!!! - by fatman2021 - 07-28-2022, 04:04 PM
RE: It's verification time!!! - by fatman2021 - 08-10-2022, 01:13 PM
RE: It's verification time!!! - by fatman2021 - 08-15-2022, 04:50 PM



Users browsing this thread: 5 Guest(s)