1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Generate mip levels for DynamicTextMaps

This changeset introduced a new plBitmap flag `kAutoGenMipmap`, which
trickles through the pipeline and becomes `D3DUSAGE_AUTOGENMIPMAP` in
standard DirectX texture creation. This flag is applied to all
DyanmicTextMaps. The end result is that DynamicTextMaps become fuzzy at a
distance, rather than choppy.
This commit is contained in:
2013-01-30 22:10:52 -05:00
parent 33d26ce29f
commit 2b06708915
5 changed files with 28 additions and 30 deletions

View File

@ -90,6 +90,7 @@ class plBitmap : public hsKeyedObject
kUserOwnsBitmap = 0x0200,
kForceRewrite = 0x0400,
kForceNonCompressed = 0x0800,
kAutoGenMipmap = 0x1000, // prompts DirectX to generate mipmaps for us automagically
// For renderTargets:
kIsTexture = 0x1000,
kIsOffscreen = 0x2000,

View File

@ -75,20 +75,12 @@ plProfile_Extern(MemMipmaps);
//// Constructor & Destructor /////////////////////////////////////////////////
plDynamicTextMap::plDynamicTextMap() : plMipmap()
plDynamicTextMap::plDynamicTextMap()
: fVisWidth(0), fVisHeight(0), fHasAlpha(false), fJustify(kLeftJustify),
fInitBuffer(nullptr), fFontFace(nullptr), fFontSize(0), fFontFlags(0),
fFontAntiAliasRGB(false), fFontBlockRGB(false), fHasCreateBeenCalled(false)
{
fVisWidth = fVisHeight = 0;
fHasAlpha = false;
fJustify = kLeftJustify;
fInitBuffer = nil;
fFontFace = nil;
fFontSize = 0;
fFontFlags = 0;
fFontAntiAliasRGB = false;
fFontColor.Set( 0, 0, 0, 1 );
fFontBlockRGB = false;
fHasCreateBeenCalled = false;
fFontColor.Set(0, 0, 0, 1);
}
plDynamicTextMap::~plDynamicTextMap()
@ -96,10 +88,9 @@ plDynamicTextMap::~plDynamicTextMap()
Reset();
}
plDynamicTextMap::plDynamicTextMap( uint32_t width, uint32_t height, bool hasAlpha, uint32_t extraWidth, uint32_t extraHeight ) : plMipmap()
plDynamicTextMap::plDynamicTextMap( uint32_t width, uint32_t height, bool hasAlpha, uint32_t extraWidth, uint32_t extraHeight )
: fInitBuffer(nullptr), fFontFace(nullptr)
{
fInitBuffer = nil;
fFontFace = nil;
Create( width, height, hasAlpha, extraWidth, extraHeight );
}
@ -139,7 +130,7 @@ void plDynamicTextMap::Create( uint32_t width, uint32_t height, bool hasAlpha
fRowBytes = fWidth << 2;
fNumLevels = 1;
fFlags |= plMipmap::kDontThrowAwayImage;
fFlags |= plMipmap::kDontThrowAwayImage | plMipmap::kAutoGenMipmap;
fCompressionType = plMipmap::kUncompressed;
fUncompressedInfo.fType = plMipmap::UncompressedInfo::kRGB8888;