Fix SPOFS
This commit is contained in:
@@ -1385,27 +1385,26 @@ class BuiltinFunction
|
|||||||
{
|
{
|
||||||
p.sprite.spshow(id);
|
p.sprite.spshow(id);
|
||||||
}
|
}
|
||||||
static void SPOFS(PetitComputer p, int id, DefaultValue!double x, DefaultValue!double y, DefaultValue!(int, false) z)
|
static void SPOFS(PetitComputer p, int id, DefaultValue!double x, DefaultValue!double y, DefaultValue!(double, false) z)
|
||||||
{
|
{
|
||||||
if (x.isDefault || y.isDefault)
|
if (x.isDefault || y.isDefault)
|
||||||
{
|
{
|
||||||
double x_, y_;
|
double x_, y_, z_;
|
||||||
int z_;
|
|
||||||
p.sprite.getspofs(id, x_, y_, z_);
|
p.sprite.getspofs(id, x_, y_, z_);
|
||||||
x.setDefaultValue(x_);
|
x.setDefaultValue(x_);
|
||||||
y.setDefaultValue(y_);
|
y.setDefaultValue(y_);
|
||||||
}
|
}
|
||||||
if(z.isDefault)
|
if(z.isDefault)
|
||||||
{
|
{
|
||||||
p.sprite.spofs(id, cast(int)x, cast(int)y);
|
p.sprite.spofs(id, cast(double)x, cast(double)y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p.sprite.spofs(id, cast(int)x, cast(int)y, cast(int)z);
|
p.sprite.spofs(id, cast(double)x, cast(double)y, cast(double)z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@StartOptional("z")
|
@StartOptional("z")
|
||||||
static void SPOFS(PetitComputer p, int id, out double x, out double y, out int z)
|
static void SPOFS(PetitComputer p, int id, out double x, out double y, out double z)
|
||||||
{
|
{
|
||||||
p.sprite.getspofs(id, x, y, z);
|
p.sprite.getspofs(id, x, y, z);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ struct SpriteData
|
|||||||
int defno;
|
int defno;
|
||||||
double x, y;
|
double x, y;
|
||||||
int homex, homey;
|
int homex, homey;
|
||||||
int z;/*!*/
|
double z;/*!*/
|
||||||
int u, v, w, h;//個々で保持してるみたい,SPSETをして後でSPDEFをしても変化しない
|
int u, v, w, h;//個々で保持してるみたい,SPSETをして後でSPDEFをしても変化しない
|
||||||
uint color;
|
uint color;
|
||||||
double[8] var = 0;
|
double[8] var = 0;
|
||||||
@@ -626,7 +626,7 @@ class Sprite
|
|||||||
foreach(i, ref s; sprites)
|
foreach(i, ref s; sprites)
|
||||||
{
|
{
|
||||||
//if(!s.define) continue;
|
//if(!s.define) continue;
|
||||||
auto zet = s.z + 256;
|
auto zet = cast(int)s.z + 256;
|
||||||
listptr[i].sprite = &s;
|
listptr[i].sprite = &s;
|
||||||
if(bucketsptr[zet])
|
if(bucketsptr[zet])
|
||||||
{
|
{
|
||||||
@@ -895,7 +895,7 @@ class Sprite
|
|||||||
sprites[id].linky = cast(int)(y + (sprites[id].parent ? sprites[id].parent.linky : 0));
|
sprites[id].linky = cast(int)(y + (sprites[id].parent ? sprites[id].parent.linky : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void spofs(int id, double x, double y, int z)
|
void spofs(int id, double x, double y, double z)
|
||||||
{
|
{
|
||||||
id = spid(id);
|
id = spid(id);
|
||||||
synchronized (this)
|
synchronized (this)
|
||||||
@@ -909,7 +909,7 @@ class Sprite
|
|||||||
}
|
}
|
||||||
zChange = true;
|
zChange = true;
|
||||||
}
|
}
|
||||||
void getspofs(int id, out double x, out double y, out int z)
|
void getspofs(int id, out double x, out double y, out double z)
|
||||||
{
|
{
|
||||||
id = spid(id);
|
id = spid(id);
|
||||||
x = sprites[id].x;
|
x = sprites[id].x;
|
||||||
|
|||||||
Reference in New Issue
Block a user