Implement BGGET
This commit is contained in:
@@ -7,6 +7,10 @@ import derelict.opengl3.gl;
|
||||
struct BGChip
|
||||
{
|
||||
int i;
|
||||
int screenData()
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
//912枚まで描画されるみたい
|
||||
//->899枚まで描画してその後は一番下のみ描画の様子
|
||||
@@ -23,6 +27,8 @@ class BG
|
||||
int rendermax = 899;
|
||||
PetitComputer petitcom;
|
||||
bool show;
|
||||
int chipWidth = 16;
|
||||
int chipHeight = 16;
|
||||
this(PetitComputer pc)
|
||||
{
|
||||
chip[] = BGChip(0);
|
||||
@@ -151,4 +157,15 @@ class BG
|
||||
chip[i + y * width].i = id;
|
||||
}*/
|
||||
}
|
||||
int get(int x, int y, int flag)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
return chip[x / chipWidth + y / chipHeight * width].screenData;
|
||||
}
|
||||
else
|
||||
{
|
||||
return chip[x + y * width].screenData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1615,6 +1615,14 @@ class BuiltinFunction
|
||||
{
|
||||
p.getBG(layer).show = false;
|
||||
}
|
||||
static int BGGET(PetitComputer p, int layer, int x, int y)
|
||||
{
|
||||
return BGGET(p, layer, x, y, 0);
|
||||
}
|
||||
static int BGGET(PetitComputer p, int layer, int x, int y, int flag)
|
||||
{
|
||||
return p.getBG(layer).get(x, y, flag);
|
||||
}
|
||||
static void EFCON()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user