1
0

Fix DISPLAY

This commit is contained in:
otya128
2016-12-20 21:13:26 +09:00
parent 73d8b5bb5e
commit c03ab93395
2 changed files with 6 additions and 0 deletions

View File

@@ -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)

View File

@@ -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)
{ {