diff options
author | aap <aap@papnet.eu> | 2020-08-18 11:09:50 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-08-18 11:09:50 +0200 |
commit | e3405f4be4369c98f874a2d477bd6567f1be9381 (patch) | |
tree | 1cdaa079fcb6a6da55d6d5126594b2a1a94bf76d /src/skel | |
parent | update librw (diff) | |
parent | remove CFO (diff) | |
download | re3-e3405f4be4369c98f874a2d477bd6567f1be9381.tar re3-e3405f4be4369c98f874a2d477bd6567f1be9381.tar.gz re3-e3405f4be4369c98f874a2d477bd6567f1be9381.tar.bz2 re3-e3405f4be4369c98f874a2d477bd6567f1be9381.tar.lz re3-e3405f4be4369c98f874a2d477bd6567f1be9381.tar.xz re3-e3405f4be4369c98f874a2d477bd6567f1be9381.tar.zst re3-e3405f4be4369c98f874a2d477bd6567f1be9381.zip |
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 | 21 |
5 files changed, 49 insertions, 1 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index ed442348..920bb8a9 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -181,6 +181,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 0f314b9d..c9a8a11f 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 8191107e..4780316a 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 cf4749b1..e79a8150 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -241,6 +241,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) { @@ -1580,7 +1597,9 @@ psSelectDevice() PSGLOBAL(fullScreen) = FALSE; #endif } - +#ifdef MULTISAMPLING + RwD3D8EngineSetMultiSamplingLevels(1 << FrontEndMenuManager.m_nPrefsMSAALevel); +#endif return TRUE; } |