From 166193764bf8328dd6f597575e3b0b0800d3304a Mon Sep 17 00:00:00 2001 From: otya128 Date: Sat, 31 Dec 2016 21:49:20 +0900 Subject: [PATCH] Implement BGSCALE(2) --- SMILEBASIC/bg.d | 5 +++++ SMILEBASIC/builtinfunctions.d | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/SMILEBASIC/bg.d b/SMILEBASIC/bg.d index a572111..8a4d192 100644 --- a/SMILEBASIC/bg.d +++ b/SMILEBASIC/bg.d @@ -187,6 +187,11 @@ class BG this.scalex = x; this.scaley = y; } + void getScale(out double x, out double y) + { + x = this.scalex; + y = this.scaley; + } void rot(int rot) { this.r = rot; diff --git a/SMILEBASIC/builtinfunctions.d b/SMILEBASIC/builtinfunctions.d index 3acbd85..d510c76 100644 --- a/SMILEBASIC/builtinfunctions.d +++ b/SMILEBASIC/builtinfunctions.d @@ -2378,6 +2378,14 @@ class BuiltinFunction } p.getBG(layer).scale(x, y); } + static void BGSCALE(PetitComputer p, int layer, out double x, out double y) + { + if (!p.isValidLayer(layer)) + { + throw new OutOfRange("BGSCALE", 1); + } + p.getBG(layer).getScale(x, y); + } static void BGROT(PetitComputer p, int layer, int rot) { if (!p.isValidLayer(layer))