comparison Texture.cpp @ 6:82f81d5b7221

Слияние
author Серик@ПончиК
date Tue, 09 Oct 2012 20:00:24 +0600
parents ac0fb48cd27a
children 93bf1d5f6a6d 77de07f99e03
comparison
equal deleted inserted replaced
5:ca90d9e499b3 6:82f81d5b7221
304 for ( i = uIconID; ; ++i ) 304 for ( i = uIconID; ; ++i )
305 { 305 {
306 v3->pTextures[i].uTextureID = pBitmaps_LOD->LoadTexture(v3->pTextures[i].pTextureName, TEXTURE_DEFAULT); 306 v3->pTextures[i].uTextureID = pBitmaps_LOD->LoadTexture(v3->pTextures[i].pTextureName, TEXTURE_DEFAULT);
307 auto pTex = (v3->pTextures[i].uTextureID != -1 ? &pBitmaps_LOD->pTextures[v3->pTextures[i].uTextureID] : 0); 307 auto pTex = (v3->pTextures[i].uTextureID != -1 ? &pBitmaps_LOD->pTextures[v3->pTextures[i].uTextureID] : 0);
308 if (pTex) 308 if (pTex)
309 pTex->palette = pPaletteManager->LoadPalette(pTex->palette); 309 pTex->palette_id2 = pPaletteManager->LoadPalette(pTex->palette_id1);
310 result = (unsigned int)v3->pTextures; 310 result = (unsigned int)v3->pTextures;
311 if ( !(*(char *)(result + i * 20 + 18) & 1) ) 311 if ( !(*(char *)(result + i * 20 + 18) & 1) )
312 break; 312 break;
313 } 313 }
314 } 314 }
400 } 400 }
401 401
402 //----- (0040F77C) -------------------------------------------------------- 402 //----- (0040F77C) --------------------------------------------------------
403 void Texture::Release() 403 void Texture::Release()
404 { 404 {
405 Texture *v1; // esi@1 405 if (this)
406 char v2; // zf@2 406 {
407 407 pName[0] = 0;
408 v1 = this; 408
409 if ( this ) 409 if (pBits & 0x0400)
410 {
411 v2 = (pBits & 0x0400) == 0;
412 this->pName[0] = 0;
413 if ( v2 )
414 { 410 {
415 pAllocator->FreeChunk(pLevelOfDetail0); 411 pAllocator->FreeChunk(pLevelOfDetail0);
416 pAllocator->FreeChunk(pPalette16); 412 pAllocator->FreeChunk(pPalette16);
417 pAllocator->FreeChunk(pPalette24); 413 pAllocator->FreeChunk(pPalette24);
418 } 414 }
419 v1->pLevelOfDetail0 = 0; 415
420 v1->pLevelOfDetail1 = 0; 416 pLevelOfDetail0 = nullptr;
421 v1->pLevelOfDetail2 = 0; 417 pLevelOfDetail1 = nullptr;
422 v1->pLevelOfDetail3 = 0; 418 pLevelOfDetail2 = nullptr;
423 v1->pPalette16 = 0; 419 pLevelOfDetail3 = nullptr;
424 v1->pPalette24 = 0; 420
425 v1->uSizeOfMaxLevelOfDetail = 0; 421 pPalette16 = nullptr;
426 v1->uTextureSize = 0; 422 pPalette24 = nullptr;
427 v1->uTextureHeight = 0; 423
428 v1->uTextureWidth = 0; 424 uSizeOfMaxLevelOfDetail = 0;
429 v1->uHeightLn2 = 0; 425 uTextureSize = 0;
430 v1->uWidthLn2 = 0; 426 uTextureHeight = 0;
431 v1->palette = 0; 427 uTextureWidth = 0;
432 LOWORD(v1->pBits) = 0; 428 uHeightLn2 = 0;
429 uWidthLn2 = 0;
430 palette_id1 = 0;
431 palette_id2 = 0;
432 pBits &= 0xFFFF0000;
433 } 433 }
434 } 434 }
435 435
436 //----- (0040F5F5) -------------------------------------------------------- 436 //----- (0040F5F5) --------------------------------------------------------
437 int RGBTexture::Reload(const char *pContainer) 437 int RGBTexture::Reload(const char *pContainer)
504 } 504 }
505 505
506 //----- (0040F5BE) -------------------------------------------------------- 506 //----- (0040F5BE) --------------------------------------------------------
507 Texture::Texture() 507 Texture::Texture()
508 { 508 {
509 this->pName[0] = 0; 509 pName[0] = 0;
510 this->uSizeOfMaxLevelOfDetail = 0; 510 uSizeOfMaxLevelOfDetail = 0;
511 this->uTextureSize = 0; 511 uTextureSize = 0;
512 this->uTextureHeight = 0; 512 uTextureHeight = 0;
513 this->uTextureWidth = 0; 513 uTextureWidth = 0;
514 this->uHeightLn2 = 0; 514 uHeightLn2 = 0;
515 this->uWidthLn2 = 0; 515 uWidthLn2 = 0;
516 this->palette = 0; 516 palette_id1 = 0;
517 this->pLevelOfDetail0 = 0; 517 palette_id2 = 0;
518 this->pLevelOfDetail3 = 0; 518 pLevelOfDetail0 = 0;
519 this->pLevelOfDetail2 = 0; 519 pLevelOfDetail3 = 0;
520 this->pLevelOfDetail1 = 0; 520 pLevelOfDetail2 = 0;
521 this->pPalette16 = 0; 521 pLevelOfDetail1 = 0;
522 this->pPalette24 = 0; 522 pPalette16 = 0;
523 pPalette24 = 0;
523 } 524 }
524 525
525 //----- (0040F414) -------------------------------------------------------- 526 //----- (0040F414) --------------------------------------------------------
526 int RGBTexture::Load(const char *pContainer, int mode) 527 int RGBTexture::Load(const char *pContainer, int mode)
527 { 528 {