Changeset 26774
- Timestamp:
- Apr 11, 2022, 6:28:41 PM (2 years ago)
- Location:
- ps/trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/graphics/TextureConverter.cpp
r25766 r26774 1 /* Copyright (C) 202 1Wildfire Games.1 /* Copyright (C) 202 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * … … 20 20 #include "TextureConverter.h" 21 21 22 23 22 24 #include "lib/regex.h" 25 23 26 #include "lib/timer.h" 24 #include "lib/allocators/shared_ptr.h"25 #include "lib/tex/tex.h"26 27 #include "maths/MD5.h" 27 28 #include "ps/CLogger.h" … … 348 349 } 349 350 351 352 353 354 355 356 357 350 358 �� // Check whether there's any alpha channel 351 359 bool hasAlpha = ((tex.m_Flags & TEX_ALPHA) != 0); -
ps/trunk/source/graphics/TextureManager.cpp
r26588 r26774 23 23 #include "graphics/TextureConverter.h" 24 24 #include "lib/allocators/shared_ptr.h" 25 25 26 #include "lib/file/vfs/vfs_tree.h" 26 27 #include "lib/hash.h" … … 409 410 texture->ResetBackendTexture( 410 411 nullptr, m_ErrorTexture.GetTexture()->GetBackendTexture()); 412 413 414 415 416 417 418 419 420 421 422 411 423 return; 412 424 } … … 443 455 texture->ResetBackendTexture( 444 456 nullptr, m_ErrorTexture.GetTexture()->GetBackendTexture()); 457 445 458 return; 446 459 } … … 558 571 void ConvertTexture(const CTexturePtr& texture) 559 572 { 560 VfsPath sourcePath = texture->m_Properties.m_Path;573 VfsPath sourcePath = texture->m_Properties.m_Path; 561 574 562 575 PROFILE2("convert texture"); … … 566 579 u32 version; 567 580 PrepareCacheKey(texture, hash, version); 568 VfsPath looseCachePath = m_CacheLoader.LooseCachePath(sourcePath, hash, version); 569 570 // LOGWARNING("Converting texture \"%s\"", srcPath.c_str()); 581 const VfsPath looseCachePath = m_CacheLoader.LooseCachePath(sourcePath, hash, version); 571 582 572 583 CTextureConverter::Settings settings = GetConverterSettings(texture); … … 855 866 if (!IsLoaded()) 856 867 return; 857 else if (!m_TextureData )868 else if (!m_TextureData) 858 869 { 859 870 ResetBackendTexture(nullptr, m_TextureManager->GetErrorTexture()->GetBackendTexture()); -
ps/trunk/source/graphics/tests/test_TextureConverter.h
r26122 r26774 1 /* Copyright (C) 202 1Wildfire Games.1 /* Copyright (C) 202 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * … … 86 86 TS_ASSERT_EQUALS(texdata[8*4], texdata[16*4]); 87 87 TS_ASSERT_DIFFERS(texdata[16*4], texdata[24*4]); 88 88 89 89 // for (size_t i = 0; i < tex.dataSize; ++i) 90 // { 91 // if (i % 4 == 0) printf("\n"); 92 // printf("%02x ", texdata[i]); 93 // } 90 void test_not_pot() 91 { 92 // CTextureConverter prints to logs in case of an error. 93 TestLogger logger; 94 95 const VfsPath path = L"art/textures/b/npot.png"; 96 97 CTextureConverter converter(m_VFS, false); 98 CTextureConverter::Settings settings = 99 converter.ComputeSettings(L"", std::vector<CTextureConverter::SettingsFile*>()); 100 TS_ASSERT(!converter.ConvertTexture(CTexturePtr(), path, L"cache/npot.png", settings)); 101 TS_ASSERT(logger.GetOutput().find("be power of two") != std::string::npos); 94 102 } 95 103 }; -
ps/trunk/source/ps/Profiler2GPU.cpp
r26760 r26774 287 287 #else // CONFIG2_GLES 288 288 289 290 291 292 293 289 294 CProfiler2GPU::CProfiler2GPU(CProfiler2& profiler) : 290 295 m_Profiler(profiler)
Note:
See TracChangeset
for help on using the changeset viewer.