diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/MenuScreensCustom.cpp | 4 | ||||
-rw-r--r-- | src/core/main.cpp | 13 | ||||
-rw-r--r-- | src/fakerw/fake.cpp | 37 | ||||
-rw-r--r-- | src/fakerw/rtpng.h | 4 | ||||
-rw-r--r-- | src/skel/glfw/glfw.cpp | 1 | ||||
-rw-r--r-- | src/skel/win/win.cpp | 1 |
6 files changed, 58 insertions, 2 deletions
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp index ed5b149c..069cbdef 100644 --- a/src/core/MenuScreensCustom.cpp +++ b/src/core/MenuScreensCustom.cpp @@ -731,7 +731,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = { MENUACTION_LOADRADIO, "FET_AUD", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS }, MENUACTION_CHANGEMENU, "FET_DIS", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS }, #ifdef GRAPHICS_MENU_OPTIONS - MENUACTION_CHANGEMENU, "FET_GRA", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, + MENUACTION_CHANGEMENU, "FET_GFX", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, #endif MENUACTION_CHANGEMENU, "FET_LAN", { nil, SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS }, MENUACTION_PLAYERSETUP, "FET_PSU", { nil, SAVESLOT_NONE, MENUPAGE_SKIN_SELECT }, @@ -858,7 +858,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = { #ifdef GRAPHICS_MENU_OPTIONS // MENUPAGE_GRAPHICS_SETTINGS - { "FET_GRA", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, + { "FET_GFX", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, new CCustomScreenLayout({MENUSPRITE_MAINMENU, 50, 0, 20, FONT_HEADING, FESCREEN_LEFT_ALIGN, true, MEDIUMTEXT_X_SCALE, MEDIUMTEXT_Y_SCALE}), GraphicsGoBack, MENUACTION_SCREENRES, "FED_RES", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS }, diff --git a/src/core/main.cpp b/src/core/main.cpp index 65ae5290..37a87859 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1,8 +1,10 @@ #include "common.h" +#include <time.h> #include "rpmatfx.h" #include "rphanim.h" #include "rpskin.h" #include "rtbmp.h" +#include "rtpng.h" #ifdef ANISOTROPIC_FILTERING #include "rpanisot.h" #endif @@ -360,7 +362,11 @@ RwGrabScreen(RwCamera *camera, RwChar *filename) strcpy(temp, CFileMgr::GetRootDirName()); strcat(temp, filename); +#ifndef LIBRW if (RtBMPImageWrite(pImage, &temp[0]) == nil) +#else + if (RtPNGImageWrite(pImage, &temp[0]) == nil) +#endif result = false; RwImageDestroy(pImage); return result; @@ -379,6 +385,7 @@ DoRWStuffEndOfFrame(void) RsCameraShowRaster(Scene.camera); #ifndef MASTER char s[48]; +#ifdef THIS_IS_STUPID if (CPad::GetPad(1)->GetLeftShockJustDown()) { // try using both controllers for this thing... crazy bastards if (CPad::GetPad(0)->GetRightStickY() > 0) { @@ -390,6 +397,12 @@ DoRWStuffEndOfFrame(void) RwGrabScreen(Scene.camera, s); } } +#else + if (CPad::GetPad(1)->GetLeftShockJustDown() || CPad::GetPad(0)->GetFJustDown(11)) { + sprintf(s, "screen_%11lld.png", time(nil)); + RwGrabScreen(Scene.camera, s); + } +#endif #endif // !MASTER } diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 366dcf3e..1d4c881f 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -945,6 +945,43 @@ RtBMPImageRead(const RwChar *imageName) #endif } + +RwImage * +RtPNGImageWrite(RwImage *image, const RwChar *imageName) +{ +#ifndef _WIN32 + char *r = casepath(imageName); + if (r) { + rw::writePNG(image, r); + free(r); + } else { + rw::writePNG(image, imageName); + } + +#else + rw::writePNG(image, imageName); +#endif + return image; +} +RwImage * +RtPNGImageRead(const RwChar *imageName) +{ +#ifndef _WIN32 + RwImage *image; + char *r = casepath(imageName); + if (r) { + image = rw::readPNG(r); + free(r); + } else { + image = rw::readPNG(imageName); + } + return image; + +#else + return rw::readPNG(imageName); +#endif +} + #include "rtquat.h" RtQuat *RtQuatRotate(RtQuat * quat, const RwV3d * axis, RwReal angle, RwOpCombineType combineOp) { return (RtQuat*)((rw::Quat*)quat)->rotate(axis, angle/180.0f*3.14159f, (CombineOp)combineOp); } diff --git a/src/fakerw/rtpng.h b/src/fakerw/rtpng.h new file mode 100644 index 00000000..80f29020 --- /dev/null +++ b/src/fakerw/rtpng.h @@ -0,0 +1,4 @@ +#pragma once + +RwImage *RtPNGImageWrite(RwImage * image, const RwChar * imageName); +RwImage *RtPNGImageRead(const RwChar * imageName); diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index b413a1ce..b44e5750 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -204,6 +204,7 @@ psGrabScreen(RwCamera *pCamera) } #else rw::Image *image = RwCameraGetRaster(pCamera)->toImage(); + image->removeMask(); if(image) return image; #endif diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index c00d6075..7317356c 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -259,6 +259,7 @@ psGrabScreen(RwCamera *pCamera) } #else rw::Image *image = RwCameraGetRaster(pCamera)->toImage(); + image->removeMask(); if(image) return image; #endif |