diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-08-15 15:13:46 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-08-15 15:13:46 +0300 |
commit | 9956b277674563015816e1695f05c6bc4a507fda (patch) | |
tree | e0b513c635c57e74aca0346c0bab5eba748f1186 /src/skel | |
parent | 07038ce88ec4056d19f999bab177ad02773c0ef9 (diff) | |
parent | 72088a000b6fc0d641f5b94f6aa6586e9e2d9e8b (diff) |
Merge branch 'master' into miami
# Conflicts:
# src/control/Darkel.cpp
# src/core/main.cpp
Diffstat (limited to 'src/skel')
-rw-r--r-- | src/skel/glfw/glfw.cpp | 16 | ||||
-rw-r--r-- | src/skel/platform.h | 1 | ||||
-rw-r--r-- | src/skel/skeleton.cpp | 9 | ||||
-rw-r--r-- | src/skel/skeleton.h | 3 | ||||
-rw-r--r-- | src/skel/win/win.cpp | 17 |
5 files changed, 46 insertions, 0 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index d94f2e80..21b5c3c0 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -185,6 +185,22 @@ psCameraShowRaster(RwCamera *camera) return; } +/* + ***************************************************************************** + */ +RwImage * +psGrabScreen(RwCamera *pCamera) +{ +#ifndef LIBRW + RwRaster *pRaster = RwCameraGetRaster(pCamera); + if (RwImage *pImage = RwImageCreate(pRaster->width, pRaster->height, 32)) { + RwImageAllocatePixels(pImage); + RwImageSetFromRaster(pImage, pRaster); + return pImage; + } +#endif + return nil; +} /* ***************************************************************************** diff --git a/src/skel/platform.h b/src/skel/platform.h index 806c0a73..0475d20a 100644 --- a/src/skel/platform.h +++ b/src/skel/platform.h @@ -22,6 +22,7 @@ extern void psTerminate(void); extern void psCameraShowRaster(RwCamera *camera); extern RwBool psCameraBeginUpdate(RwCamera *camera); +extern RwImage *psGrabScreen(RwCamera *camera); extern void psMouseSetPos(RwV2d *pos); diff --git a/src/skel/skeleton.cpp b/src/skel/skeleton.cpp index 073155d6..99f44fed 100644 --- a/src/skel/skeleton.cpp +++ b/src/skel/skeleton.cpp @@ -53,6 +53,15 @@ RsCameraBeginUpdate(RwCamera * camera) /* ***************************************************************************** */ +RwImage* +RsGrabScreen(RwCamera *camera) +{ + return psGrabScreen(camera); +} + +/* + ***************************************************************************** + */ RwBool RsRegisterImageLoader(void) { diff --git a/src/skel/skeleton.h b/src/skel/skeleton.h index b5ea5abf..1c468179 100644 --- a/src/skel/skeleton.h +++ b/src/skel/skeleton.h @@ -274,6 +274,9 @@ RsCameraBeginUpdate(RwCamera *camera); //extern void //RsMouseSetVisibility(RwBool visible); +extern RwImage* +RsGrabScreen(RwCamera *camera); + extern void RsMouseSetPos(RwV2d *pos); diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index f758a7fb..0b2b48c9 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -245,6 +245,23 @@ psCameraShowRaster(RwCamera *camera) /* ***************************************************************************** */ +RwImage * +psGrabScreen(RwCamera *pCamera) +{ +#ifndef LIBRW + RwRaster *pRaster = RwCameraGetRaster(pCamera); + if (RwImage *pImage = RwImageCreate(pRaster->width, pRaster->height, 32)) { + RwImageAllocatePixels(pImage); + RwImageSetFromRaster(pImage, pRaster); + return pImage; + } +#endif + return nil; +} + +/* + ***************************************************************************** + */ RwUInt32 psTimer(void) { |