diff options
Diffstat (limited to 'src/rw/TexRead.cpp')
-rw-r--r-- | src/rw/TexRead.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp index 4087029b..ad7d8fec 100644 --- a/src/rw/TexRead.cpp +++ b/src/rw/TexRead.cpp @@ -1,7 +1,13 @@ #pragma warning( push ) #pragma warning( disable : 4005) #pragma warning( pop ) +#ifndef LIBRW +#define WITHD3D +#endif #include "common.h" +#ifndef LIBRW +#include "rpanisot.h" +#endif #include "crossplatform.h" #include "platform.h" @@ -47,6 +53,15 @@ RwTextureGtaStreamRead(RwStream *stream) texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1); texNumLoaded++; } + + if(tex == nil) + return nil; + +#ifndef LIBRW + if(RpAnisotTextureGetMaxAnisotropy(tex) > 1) + RpAnisotTextureSetMaxAnisotropy(tex, RpAnisotTextureGetMaxAnisotropy(tex)); +#endif + return tex; } @@ -152,6 +167,7 @@ RwTexDictionaryGtaStreamRead2(RwStream *stream, RwTexDictionary *texDict) #ifdef GTA_PC #ifdef RWLIBS extern "C" RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags); +extern "C" RwBool _rwD3D8CheckValidTextureFormat(RwInt32 format); #else RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags); #endif @@ -202,8 +218,20 @@ WriteVideoCardCapsFile(void) } } -bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha); -void DoRWStuffEndOfFrame(void); +bool +CanVideoCardDoDXT(void) +{ +#ifdef LIBRW + // TODO +#ifdef RW_OPENGL + return false; +#else + return true; +#endif +#else + return _rwD3D8CheckValidTextureFormat(D3DFMT_DXT1) && _rwD3D8CheckValidTextureFormat(D3DFMT_DXT3); +#endif +} void ConvertingTexturesScreen(uint32 num, uint32 count, const char *text) @@ -229,6 +257,7 @@ ConvertingTexturesScreen(uint32 num, uint32 count, const char *text) CFont::SetBackgroundOff(); CFont::SetPropOn(); CFont::SetScale(SCREEN_SCALE_X(0.45f), SCREEN_SCALE_Y(0.7f)); + CFont::SetCentreOff(); CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(170.0f)); CFont::SetJustifyOff(); CFont::SetColor(CRGBA(255, 217, 106, 255)); @@ -289,6 +318,11 @@ CreateTxdImageForVideoCard() ConvertingTexturesScreen(i, TXDSTORESIZE, "CVT_MSG"); if (CTxdStore::GetSlot(i) != nil && CStreaming::IsObjectInCdImage(i + STREAM_OFFSET_TXD)) { +#ifdef FIX_BUGS + if(strcmp(CTxdStore::GetTxdName(i), "generic") == 0) + continue; +#endif + CStreaming::RequestTxd(i, STREAMFLAGS_KEEP_IN_MEMORY); CStreaming::RequestModelStream(0); CStreaming::FlushChannels(); |