MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / DDSFile

Method DDSFile

Engine/source/gfx/bitmap/ddsLoader.cpp:84–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82#define FOURCC_DXT5 (MakeFourCC('D','X','T','5'))
83
84DDSFile::DDSFile( const DDSFile &dds )
85 : mFlags( dds.mFlags ),
86 mHeight( dds.mHeight ),
87 mWidth( dds.mWidth ),
88 mDepth( dds.mDepth ),
89 mPitchOrLinearSize( dds.mPitchOrLinearSize ),
90 mMipMapCount( dds.mMipMapCount ),
91 mFormat( dds.mFormat ),
92 mBytesPerPixel( dds.mBytesPerPixel ),
93 mFourCC( dds.mFourCC ),
94 mCacheString( dds.mCacheString ),
95 mSourcePath( dds.mSourcePath ),
96 mHasTransparency( dds.mHasTransparency )
97{
98 VECTOR_SET_ASSOCIATION( mSurfaces );
99 smActiveCopies++;
100
101 for ( U32 i=0; i < dds.mSurfaces.size(); i++ )
102 {
103 SurfaceData *surface = NULL;
104 if ( dds.mSurfaces[i] )
105 surface = new SurfaceData;
106
107 mSurfaces.push_back( surface );
108
109 if ( !surface )
110 continue;
111
112 for ( U32 m=0; m < dds.mSurfaces[i]->mMips.size(); m++ )
113 {
114 U32 size = dds.getSurfaceSize( m );
115 surface->mMips.push_back(new U8[size]);
116 dMemcpy( surface->mMips.last(), dds.mSurfaces[i]->mMips[m], size );
117 }
118 }
119}
120
121void DDSFile::clear()
122{

Callers

nothing calls this directly

Calls 5

lastMethod · 0.80
dMemcpyFunction · 0.50
sizeMethod · 0.45
push_backMethod · 0.45
getSurfaceSizeMethod · 0.45

Tested by

no test coverage detected