mirror of
https://github.com/halpz/re3.git
synced 2025-06-28 14:06:21 +00:00
imrove readme; enable screenshots with F12
This commit is contained in:
@ -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
|
||||
@ -354,7 +356,11 @@ RwGrabScreen(RwCamera *camera, RwChar *filename)
|
||||
strcpy(temp, CFileMgr::GetRootDirName());
|
||||
strcat(temp, filename);
|
||||
|
||||
#ifdef THIS_IS_STUPID
|
||||
if (RtBMPImageWrite(pImage, &temp[0]) == nil)
|
||||
#else
|
||||
if (RtPNGImageWrite(pImage, &temp[0]) == nil)
|
||||
#endif
|
||||
result = false;
|
||||
RwImageDestroy(pImage);
|
||||
return result;
|
||||
@ -373,6 +379,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) {
|
||||
@ -384,6 +391,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
|
||||
}
|
||||
|
||||
|
@ -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); }
|
||||
|
4
src/fakerw/rtpng.h
Normal file
4
src/fakerw/rtpng.h
Normal file
@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
RwImage *RtPNGImageWrite(RwImage * image, const RwChar * imageName);
|
||||
RwImage *RtPNGImageRead(const RwChar * imageName);
|
@ -204,6 +204,7 @@ psGrabScreen(RwCamera *pCamera)
|
||||
}
|
||||
#else
|
||||
rw::Image *image = RwCameraGetRaster(pCamera)->toImage();
|
||||
image->removeMask();
|
||||
if(image)
|
||||
return image;
|
||||
#endif
|
||||
|
@ -259,6 +259,7 @@ psGrabScreen(RwCamera *pCamera)
|
||||
}
|
||||
#else
|
||||
rw::Image *image = RwCameraGetRaster(pCamera)->toImage();
|
||||
image->removeMask();
|
||||
if(image)
|
||||
return image;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user