1
0

BGを実装.

This commit is contained in:
otya128
2015-08-23 14:44:01 +09:00
parent 009c6deb61
commit 268abd0a29
5 changed files with 68 additions and 100 deletions

View File

@@ -588,6 +588,44 @@ class BuiltinFunction
static void TALK(wstring a1)
{
}
static void BGCLR(PetitComputer p, DefaultValue!(int, false) layer)
{
if(layer.isDefault)
{
foreach(bg; p.bg)
{
bg.clear;
}
return;
}
p.bg[cast(int)layer].clear;
}
static void BGSCREEN(PetitComputer p, int layer, int w, int h)
{
p.bg[layer].screen(w, h);
}
static void BGOFS(PetitComputer p, int layer, int x, int y, DefaultValue!(int, false) z)
{
z.setDefaultValue(p.bg[layer].offsetz);
p.bg[layer].ofs(x, y, cast(int)z);
}
static void BGCLIP(PetitComputer p, int layer, DefaultValue!(int, false) x, DefaultValue!(int, false) y,
DefaultValue!(int, false) x2, DefaultValue!(int, false) y2)
{
if(x.isDefault && y.isDefault && x2.isDefault && y2.isDefault)
{
p.bg[layer].clip();
}
if(x.isDefault || y.isDefault || x2.isDefault || y2.isDefault)
{
throw new IllegalFunctionCall("BGCLIP");
}
p.bg[layer].clip(cast(int)x, cast(int)y, cast(int)x2, cast(int)y2);
}
static void BGPUT(PetitComputer p, int layer, int x, int y, int screendata)
{
p.bg[layer].put(x, y, screendata);
}
//alias void function(PetitComputer, Value[], Value[]) BuiltinFunc;
static BuiltinFunction[wstring] builtinFunctions;
static this()