summaryrefslogtreecommitdiffstats
path: root/src/rw/TexRead.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rw/TexRead.cpp')
-rw-r--r--src/rw/TexRead.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp
index 33d9a4cb..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,6 +218,21 @@ WriteVideoCardCapsFile(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)
{
@@ -226,11 +257,12 @@ 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));
CFont::SetBackGroundOnlyTextOff();
- CFont::SetFontStyle(FONT_BANK);
+ CFont::SetFontStyle(FONT_STANDARD);
CFont::PrintString(SCREEN_SCALE_X(170.0f), SCREEN_SCALE_Y(160.0f), TheText.Get(text));
CFont::DrawFonts();
DoRWStuffEndOfFrame();