@@ -94,7 +94,9 @@ TextureClass::TextureClass(unsigned width, unsigned height, WW3DFormat format, M
94
94
Name(" " ),
95
95
TextureFormat(format),
96
96
IsCompressionAllowed(false ),
97
- TextureLoadTask(NULL )
97
+ TextureLoadTask(NULL ),
98
+ Width(width),
99
+ Height(height)
98
100
{
99
101
switch (format)
100
102
{
@@ -155,7 +157,9 @@ TextureClass::TextureClass
155
157
IsProcedural(false ),
156
158
TextureFormat(texture_format),
157
159
IsCompressionAllowed(allow_compression),
158
- TextureLoadTask(NULL )
160
+ TextureLoadTask(NULL ),
161
+ Width(0 ),
162
+ Height(0 )
159
163
{
160
164
switch (TextureFormat)
161
165
{
@@ -241,10 +245,14 @@ TextureClass::TextureClass(SurfaceClass *surface, MipCountType mip_level_count)
241
245
IsProcedural(true ),
242
246
TextureFormat(surface->Get_Surface_Format ()),
243
247
IsCompressionAllowed(false ),
244
- TextureLoadTask(NULL )
248
+ TextureLoadTask(NULL ),
249
+ Width(0 ),
250
+ Height(0 )
245
251
{
246
252
SurfaceClass::SurfaceDescription sd;
247
253
surface->Get_Description (sd);
254
+ Width=sd.Width ;
255
+ Height=sd.Height ;
248
256
switch (sd.Format )
249
257
{
250
258
case WW3D_FORMAT_DXT1:
@@ -276,14 +284,18 @@ TextureClass::TextureClass(IDirect3DTexture8* d3d_texture)
276
284
Name(" " ),
277
285
IsProcedural(true ),
278
286
IsCompressionAllowed(false ),
279
- TextureLoadTask(NULL )
287
+ TextureLoadTask(NULL ),
288
+ Width(0 ),
289
+ Height(0 )
280
290
{
281
291
D3DTexture->AddRef ();
282
292
IDirect3DSurface8* surface;
283
293
DX8_ErrorCode (D3DTexture->GetSurfaceLevel (0 ,&surface));
284
294
D3DSURFACE_DESC d3d_desc;
285
295
::ZeroMemory (&d3d_desc, sizeof (D3DSURFACE_DESC));
286
296
DX8_ErrorCode (surface->GetDesc (&d3d_desc));
297
+ Width=d3d_desc.Width ;
298
+ Height=d3d_desc.Height ;
287
299
TextureFormat=D3DFormat_To_WW3DFormat (d3d_desc.Format );
288
300
switch (TextureFormat)
289
301
{
@@ -514,6 +526,8 @@ void TextureClass::Apply_New_Surface(bool initialized)
514
526
DX8_ErrorCode (surface->GetDesc (&d3d_desc));
515
527
// if (TextureFormat==WW3D_FORMAT_UNKNOWN) {
516
528
TextureFormat=D3DFormat_To_WW3DFormat (d3d_desc.Format );
529
+ Width=d3d_desc.Width ;
530
+ Height=d3d_desc.Height ;
517
531
// }
518
532
// else {
519
533
// WWASSERT(D3DFormat_To_WW3DFormat(d3d_desc.Format)==TextureFormat);
0 commit comments