From 50cde660670bcc7a90211a27d9f8971357c36e8d Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Fri, 22 Jan 2021 00:14:30 +0300 Subject: [PATCH 1/4] fix --- src/peds/PedAI.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp index 3aa9300c..68983dac 100644 --- a/src/peds/PedAI.cpp +++ b/src/peds/PedAI.cpp @@ -6289,7 +6289,6 @@ CPed::PositionAnyPedOutOfCollision(void) int smallestDistNearVeh = 999; int smallestDistSomewhereClose = 999; - CVector vehPos = m_pMyVehicle->GetPosition(); CVector potentialPos; potentialPos.y = GetPosition().y - 3.5f; potentialPos.z = GetPosition().z; From e99589a3ebf32b86046429c025fb0d3db6e44a68 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 21 Jan 2021 22:17:35 +0100 Subject: [PATCH 2/4] fixed anisotropic filtering; updated librw --- src/core/config.h | 1 + src/core/main.cpp | 4 ++-- src/fakerw/fake.cpp | 9 +++++++++ src/rw/TexRead.cpp | 8 ++++---- vendor/librw | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/core/config.h b/src/core/config.h index 2ce692b5..ef282b25 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -263,6 +263,7 @@ enum Config { #define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number #define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time #define DISABLE_VSYNC_ON_TEXTURE_CONVERSION // make texture conversion work faster by disabling vsync +#define ANISOTROPIC_FILTERING // set all textures to max anisotropic filtering //#define USE_TEXTURE_POOL #ifdef LIBRW #define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) diff --git a/src/core/main.cpp b/src/core/main.cpp index a84bd495..a22ba4eb 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -3,7 +3,7 @@ #include "rphanim.h" #include "rpskin.h" #include "rtbmp.h" -#ifndef LIBRW +#ifdef ANISOTROPIC_FILTERING #include "rpanisot.h" #endif @@ -402,7 +402,7 @@ PluginAttach(void) return FALSE; } -#ifndef LIBRW +#ifdef ANISOTROPIC_FILTERING RpAnisotPluginAttach(); #endif #ifdef EXTENDED_PIPELINES diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 863407b9..4a8a945d 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -964,3 +964,12 @@ RtCharset *RtCharsetSetColors(RtCharset * charSet, const RwRGBA * foreGround, RtCharset *RtCharsetGetDesc(RtCharset * charset, RtCharsetDesc * desc) { *desc = charset->desc; return charset; } RtCharset *RtCharsetCreate(const RwRGBA * foreGround, const RwRGBA * backGround) { return Charset::create(foreGround, backGround); } RwBool RtCharsetDestroy(RtCharset * charSet) { charSet->destroy(); return true; } + + + +#include + +RwInt8 RpAnisotGetMaxSupportedMaxAnisotropy(void) { return rw::getMaxSupportedMaxAnisotropy(); } +RwTexture *RpAnisotTextureSetMaxAnisotropy(RwTexture *tex, RwInt8 val) { tex->setMaxAnisotropy(val); return tex; } +RwInt8 RpAnisotTextureGetMaxAnisotropy(RwTexture *tex) { return tex->getMaxAnisotropy(); } +RwBool RpAnisotPluginAttach(void) { rw::registerAnisotropyPlugin(); return true; } diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp index c5252f77..4eb06ad1 100644 --- a/src/rw/TexRead.cpp +++ b/src/rw/TexRead.cpp @@ -5,7 +5,7 @@ #define WITHD3D #endif #include "common.h" -#ifndef LIBRW +#ifdef ANISOTROPIC_FILTERING #include "rpanisot.h" #endif #include "crossplatform.h" @@ -58,9 +58,9 @@ RwTextureGtaStreamRead(RwStream *stream) if(tex == nil) return nil; -#ifndef LIBRW - if(RpAnisotTextureGetMaxAnisotropy(tex) > 1) - RpAnisotTextureSetMaxAnisotropy(tex, RpAnisotTextureGetMaxAnisotropy(tex)); +#ifdef ANISOTROPIC_FILTERING + if(RpAnisotGetMaxSupportedMaxAnisotropy() > 1) // BUG? this was RpAnisotTextureGetMaxAnisotropy, but that doesn't make much sense + RpAnisotTextureSetMaxAnisotropy(tex, RpAnisotGetMaxSupportedMaxAnisotropy()); #endif return tex; diff --git a/vendor/librw b/vendor/librw index 9260bddc..60a5ace1 160000 --- a/vendor/librw +++ b/vendor/librw @@ -1 +1 @@ -Subproject commit 9260bddc66f70eb51adf0749fa835fed1562c178 +Subproject commit 60a5ace16309ccd3d174a3ec14a1062540934066 From 94ff96699477fcbcd0dba949691cbf6641ebb485 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 21 Jan 2021 22:25:14 +0100 Subject: [PATCH 3/4] bletch --- src/rw/TexRead.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp index 4eb06ad1..632cec02 100644 --- a/src/rw/TexRead.cpp +++ b/src/rw/TexRead.cpp @@ -55,11 +55,8 @@ RwTextureGtaStreamRead(RwStream *stream) texNumLoaded++; } - if(tex == nil) - return nil; - #ifdef ANISOTROPIC_FILTERING - if(RpAnisotGetMaxSupportedMaxAnisotropy() > 1) // BUG? this was RpAnisotTextureGetMaxAnisotropy, but that doesn't make much sense + if(tex && RpAnisotGetMaxSupportedMaxAnisotropy() > 1) // BUG? this was RpAnisotTextureGetMaxAnisotropy, but that doesn't make much sense RpAnisotTextureSetMaxAnisotropy(tex, RpAnisotGetMaxSupportedMaxAnisotropy()); #endif From 19994272258279035e62ee6f7da287a1d66c3a02 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 21 Jan 2021 22:26:44 +0100 Subject: [PATCH 4/4] fuck --- src/fakerw/rpanisot.h | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/fakerw/rpanisot.h diff --git a/src/fakerw/rpanisot.h b/src/fakerw/rpanisot.h new file mode 100644 index 00000000..a886512f --- /dev/null +++ b/src/fakerw/rpanisot.h @@ -0,0 +1,6 @@ +#pragma once + +RwInt8 RpAnisotGetMaxSupportedMaxAnisotropy(void); +RwTexture *RpAnisotTextureSetMaxAnisotropy(RwTexture *tex, RwInt8 val); +RwInt8 RpAnisotTextureGetMaxAnisotropy(RwTexture *tex); +RwBool RpAnisotPluginAttach(void);