diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2025-01-13 09:36:52 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2025-01-13 09:36:52 -0500 |
commit | 54c6831e9dd19489ce3275eb68e5781c5899c26b (patch) | |
tree | 8b17af591db76d298ebeb6fd3d37c8958414d3cd /src/video.adb | |
parent | 3465042dc2a80f4090d6cf6b65ddc33ee4e48b55 (diff) |
wip scroll support
Diffstat (limited to 'src/video.adb')
-rw-r--r-- | src/video.adb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/video.adb b/src/video.adb index f4ddb6b..657d285 100644 --- a/src/video.adb +++ b/src/video.adb @@ -16,6 +16,44 @@ package body Video is end loop; end Clear_Screen; + procedure Scroll_Right is + use Sf.Graphics.Color; + + SS : constant sfUint32 := 4; + Tmp : array (0 .. SS - 1) of sfColor; + begin + for J in 0 .. Height - 1 loop + for I in 0 .. SS - 1 loop + Tmp (I) := Image.getPixel (Pixels, Width - SS + I, J); + end loop; + for I in 0 .. Width - 5 loop + Image.setPixel (Pixels, I + SS, J, Image.getPixel (Pixels, I, J)); + end loop; + for I in 0 .. SS - 1 loop + Image.setPixel (Pixels, I, J, Tmp (I)); + end loop; + end loop; + end Scroll_Right; + + procedure Scroll_Left is + use Sf.Graphics.Color; + + SS : constant sfUint32 := 4; + Tmp : array (0 .. SS - 1) of sfColor; + begin + for J in 0 .. Height - 1 loop + for I in 0 .. SS - 1 loop + Tmp (I) := Image.getPixel (Pixels, I, J); + end loop; + for I in SS .. Width - 1 loop + Image.setPixel (Pixels, I - SS, J, Image.getPixel (Pixels, I, J)); + end loop; + for I in 0 .. SS - 1 loop + Image.setPixel (Pixels, Width - SS + I, J, Tmp (I)); + end loop; + end loop; + end Scroll_Left; + procedure Low_Res is begin Video.Width := 64; |