1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-05 10:35:54 +00:00

make screendrops independent of neo.txd; enable new rendering by default

This commit is contained in:
aap 2020-12-26 14:48:55 +01:00
parent b41f93fcd6
commit 7613528e7e
3 changed files with 38 additions and 25 deletions

View file

@ -260,17 +260,14 @@ enum Config {
#define DISABLE_VSYNC_ON_TEXTURE_CONVERSION // make texture conversion work faster by disabling vsync
//#define USE_TEXTURE_POOL
#ifdef LIBRW
//#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)
//#define EXTENDED_PIPELINES // custom render pipelines (includes Neo)
//#define SCREEN_DROPLETS // neo water droplets
//#define NEW_RENDERER // leeds-like world rendering, needs librw
#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)
#define EXTENDED_PIPELINES // custom render pipelines (includes Neo)
#define SCREEN_DROPLETS // neo water droplets
#define NEW_RENDERER // leeds-like world rendering, needs librw
#endif
#ifndef EXTENDED_COLOURFILTER
#undef SCREEN_DROPLETS // we need the front- (or back-)buffer for this effect
#endif
#ifndef EXTENDED_PIPELINES
#undef SCREEN_DROPLETS // we need neo.txd
#undef SCREEN_DROPLETS // we need the backbuffer for this effect
#endif
// Water & Particle

View file

@ -76,13 +76,36 @@ ScreenDroplets::Initialise(void)
ms_splashObject = nil;
}
// Create white circle mask for rain drops
static RwTexture*
CreateDropMask(int32 size)
{
RwImage *img = RwImageCreate(size, size, 32);
RwImageAllocatePixels(img);
uint8 *pixels = RwImageGetPixels(img);
int32 stride = RwImageGetStride(img);
for(int y = 0; y < size; y++){
float yf = ((y + 0.5f)/size - 0.5f)*2.0f;
for(int x = 0; x < size; x++){
float xf = ((x + 0.5f)/size - 0.5f)*2.0f;
memset(&pixels[y*stride + x*4], xf*xf + yf*yf < 1.0f ? 0xFF : 0x00, 4);
}
}
int32 width, height, depth, format;
RwImageFindRasterFormat(img, rwRASTERTYPETEXTURE, &width, &height, &depth, &format);
RwRaster *ras = RwRasterCreate(width, height, depth, format);
RwRasterSetFromImage(ras, img);
RwImageDestroy(img);
return RwTextureCreate(ras);
}
void
ScreenDroplets::InitDraw(void)
{
if(CustomPipes::neoTxd == nil)
return;
ms_maskTex = CustomPipes::neoTxd->find("dropmask");
ms_maskTex = CreateDropMask(64);
ms_screenTex = RwTextureCreate(nil);
RwTextureSetFilterMode(ms_screenTex, rwFILTERLINEAR);
@ -138,10 +161,6 @@ ScreenDroplets::Shutdown(void)
void
ScreenDroplets::Process(void)
{
// no need to do anything if we can't render
if(CustomPipes::neoTxd == nil)
return;
ProcessCameraMovement();
SprayDrops();
ProcessMoving();
@ -179,9 +198,6 @@ ScreenDroplets::Render(void)
{
ScreenDrop *drop;
if(CustomPipes::neoTxd == nil)
return;
DefinedState();
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(ms_maskTex));
RwRenderStateSet(rwRENDERSTATEFOGENABLE, FALSE);

View file

@ -171,8 +171,8 @@ RwFrame *RwCameraGetFrame(const RwCamera *camera) { return camera->getFrame(
RwImage *RwImageCreate(RwInt32 width, RwInt32 height, RwInt32 depth) { return Image::create(width, height, depth); }
RwBool RwImageDestroy(RwImage * image) { image->destroy(); return true; }
RwImage *RwImageAllocatePixels(RwImage * image);
RwImage *RwImageFreePixels(RwImage * image);
RwImage *RwImageAllocatePixels(RwImage * image) { image->allocate(); return image; }
RwImage *RwImageFreePixels(RwImage * image) { image->free(); return image; }
RwImage *RwImageCopy(RwImage * destImage, const RwImage * sourceImage);
RwImage *RwImageResize(RwImage * image, RwInt32 width, RwInt32 height);
RwImage *RwImageApplyMask(RwImage * image, const RwImage * mask);
@ -187,10 +187,10 @@ RwImage *RwImageSetPixels(RwImage * image, RwUInt8 * pixels) { image->pixels
RwImage *RwImageSetPalette(RwImage * image, RwRGBA * palette) { image->palette = (uint8*)palette; return image; }
RwInt32 RwImageGetWidth(const RwImage * image) { return image->width; }
RwInt32 RwImageGetHeight(const RwImage * image) { return image->height; }
RwInt32 RwImageGetDepth(const RwImage * image);
RwInt32 RwImageGetStride(const RwImage * image);
RwUInt8 *RwImageGetPixels(const RwImage * image);
RwRGBA *RwImageGetPalette(const RwImage * image);
RwInt32 RwImageGetDepth(const RwImage * image) { return image->depth; }
RwInt32 RwImageGetStride(const RwImage * image) { return image->stride; }
RwUInt8 *RwImageGetPixels(const RwImage * image) { return image->pixels; }
RwRGBA *RwImageGetPalette(const RwImage * image) { return (RwRGBA*)image->palette; }
RwUInt32 RwRGBAToPixel(RwRGBA * rgbIn, RwInt32 rasterFormat);
RwRGBA *RwRGBASetFromPixel(RwRGBA * rgbOut, RwUInt32 pixelValue, RwInt32 rasterFormat);
RwBool RwImageSetGamma(RwReal gammaValue);