From f7b14f7dfe69252142a4d4e345783da72261e8b1 Mon Sep 17 00:00:00 2001 From: Iliyas Jorio Date: Sat, 14 Nov 2020 19:01:41 +0100 Subject: [PATCH] Implement GetPortBounds --- src/Graphics/Graphics.cpp | 6 ++++++ src/Pomme.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/Graphics/Graphics.cpp b/src/Graphics/Graphics.cpp index 819f0f1..77904c4 100644 --- a/src/Graphics/Graphics.cpp +++ b/src/Graphics/Graphics.cpp @@ -285,6 +285,12 @@ CGrafPtr GetWindowPort(WindowPtr window) return window; } +Rect* GetPortBounds(CGrafPtr port, Rect* rect) +{ + *rect = port->portRect; + return rect; +} + void DumpPortTGA(const char* outPath) { curPort->pixels.WriteTGA(outPath); diff --git a/src/Pomme.h b/src/Pomme.h index a159e5f..296735e 100644 --- a/src/Pomme.h +++ b/src/Pomme.h @@ -124,6 +124,8 @@ void GetPort(GrafPtr* port); CGrafPtr GetWindowPort(WindowPtr window); +Rect* GetPortBounds(CGrafPtr port, Rect* rect); + void MoveTo(short h, short v); void GetForeColor(RGBColor* rgb);