Fix DISPLAY
This commit is contained in:
@@ -414,6 +414,8 @@ class BuiltinFunction
|
|||||||
}
|
}
|
||||||
static void DISPLAY(PetitComputer p, int display)
|
static void DISPLAY(PetitComputer p, int display)
|
||||||
{
|
{
|
||||||
|
if (p.currentDisplay.count <= display || display < 0)
|
||||||
|
throw new OutOfRange("DISPLAY", 1);
|
||||||
p.display(display);
|
p.display(display);
|
||||||
}
|
}
|
||||||
static int DISPLAY(PetitComputer p)
|
static int DISPLAY(PetitComputer p)
|
||||||
|
|||||||
@@ -174,6 +174,10 @@ struct Display
|
|||||||
SDL_Rect[] rect;
|
SDL_Rect[] rect;
|
||||||
Size windowSize;
|
Size windowSize;
|
||||||
int yoffset;
|
int yoffset;
|
||||||
|
int count()
|
||||||
|
{
|
||||||
|
return cast(int)rect.length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
class RingBuffer(T)
|
class RingBuffer(T)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user