summaryrefslogtreecommitdiffstats
path: root/src/core/main.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-08-18 11:09:50 +0200
committeraap <aap@papnet.eu>2020-08-18 11:09:50 +0200
commite3405f4be4369c98f874a2d477bd6567f1be9381 (patch)
tree1cdaa079fcb6a6da55d6d5126594b2a1a94bf76d /src/core/main.cpp
parentupdate librw (diff)
parentremove CFO (diff)
downloadre3-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/core/main.cpp')
-rw-r--r--src/core/main.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 7cde9c4d..99868dbd 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -2,6 +2,7 @@
#include "rpmatfx.h"
#include "rphanim.h"
#include "rpskin.h"
+#include "rtbmp.h"
#include "main.h"
#include "CdStream.h"
@@ -61,6 +62,7 @@
#include "MemoryCard.h"
#include "SceneEdit.h"
#include "debugmenu.h"
+#include "Clock.h"
#include "custompipes.h"
GlobalScene Scene;
@@ -289,6 +291,28 @@ DoFade(void)
}
}
+bool
+RwGrabScreen(RwCamera *camera, RwChar *filename)
+{
+ char temp[255];
+ RwImage *pImage = RsGrabScreen(camera);
+ bool result = true;
+
+ if (pImage == nil)
+ return false;
+
+ strcpy(temp, CFileMgr::GetRootDirName());
+ strcat(temp, filename);
+
+ if (RtBMPImageWrite(pImage, &temp[0]) == nil)
+ result = false;
+ RwImageDestroy(pImage);
+ return result;
+}
+
+#define TILE_WIDTH 576
+#define TILE_HEIGHT 432
+
void
DoRWStuffEndOfFrame(void)
{
@@ -297,6 +321,20 @@ DoRWStuffEndOfFrame(void)
FlushObrsPrintfs();
RwCameraEndUpdate(Scene.camera);
RsCameraShowRaster(Scene.camera);
+#ifndef MASTER
+ char s[48];
+ if (CPad::GetPad(1)->GetLeftShockJustDown()) {
+ // try using both controllers for this thing... crazy bastards
+ if (CPad::GetPad(0)->GetRightStickY() > 0) {
+ sprintf(s, "screen%d%d.ras", CClock::ms_nGameClockHours, CClock::ms_nGameClockMinutes);
+ // TODO
+ //RtTileRender(Scene.camera, TILE_WIDTH * 2, TILE_HEIGHT * 2, TILE_WIDTH, TILE_HEIGHT, &NewTileRendererCB, nil, s);
+ } else {
+ sprintf(s, "screen%d%d.bmp", CClock::ms_nGameClockHours, CClock::ms_nGameClockMinutes);
+ RwGrabScreen(Scene.camera, s);
+ }
+ }
+#endif // !MASTER
}
static RwBool