Implement RGBREAD
This commit is contained in:
@@ -737,6 +737,15 @@ class BuiltinFunction
|
|||||||
}
|
}
|
||||||
return PetitComputer.RGB(cast(ubyte)R, cast(ubyte)G, cast(ubyte)B);
|
return PetitComputer.RGB(cast(ubyte)R, cast(ubyte)G, cast(ubyte)B);
|
||||||
}
|
}
|
||||||
|
static pure nothrow void RGBREAD(int color, out int R, out int G, out int B)
|
||||||
|
{
|
||||||
|
int _;
|
||||||
|
PetitComputer.RGBRead(color, R, G, B, _);
|
||||||
|
}
|
||||||
|
static pure nothrow void RGBREAD(int color, out int A, out int R, out int G, out int B)
|
||||||
|
{
|
||||||
|
PetitComputer.RGBRead(color, R, G, B, A);
|
||||||
|
}
|
||||||
static int RND(int max)
|
static int RND(int max)
|
||||||
{
|
{
|
||||||
import std.random;
|
import std.random;
|
||||||
|
|||||||
@@ -1698,7 +1698,7 @@ class PetitComputer
|
|||||||
throw new Exception("unsuport enviroment");
|
throw new Exception("unsuport enviroment");
|
||||||
}
|
}
|
||||||
//プチコンと違って[A,]R,G,Bじゃない
|
//プチコンと違って[A,]R,G,Bじゃない
|
||||||
static pure nothrow void RGBRead(uint color, out ubyte r, out ubyte g, out ubyte b, out ubyte a)
|
static pure nothrow void RGBRead(T)(uint color, out T r, out T g, out T b, out T a)
|
||||||
{
|
{
|
||||||
//エンディアン関係ない
|
//エンディアン関係ない
|
||||||
a = color >> 24;
|
a = color >> 24;
|
||||||
|
|||||||
Reference in New Issue
Block a user