-------------------------------------------------------------------------------
| 192 | |
| 193 | //------------------------------------------------------------------------------- |
| 194 | int CMaterialManager::SetDefaultTexture(IDirect3DTexture9** p_ppiOut) { |
| 195 | if (sDefaultTexture) { |
| 196 | sDefaultTexture->AddRef(); |
| 197 | *p_ppiOut = sDefaultTexture; |
| 198 | return 1; |
| 199 | } |
| 200 | |
| 201 | if(FAILED(g_piDevice->CreateTexture( |
| 202 | 256, |
| 203 | 256, |
| 204 | 0, |
| 205 | 0, |
| 206 | D3DFMT_A8R8G8B8, |
| 207 | D3DPOOL_MANAGED, |
| 208 | p_ppiOut, |
| 209 | nullptr))) |
| 210 | { |
| 211 | CLogDisplay::Instance().AddEntry("[ERROR] Unable to create default texture", |
| 212 | D3DCOLOR_ARGB(0xFF,0xFF,0,0)); |
| 213 | |
| 214 | *p_ppiOut = nullptr; |
| 215 | return 0; |
| 216 | } |
| 217 | D3DXFillTexture(*p_ppiOut,&FillFunc,nullptr); |
| 218 | sDefaultTexture = *p_ppiOut; |
| 219 | sDefaultTexture->AddRef(); |
| 220 | |
| 221 | // {9785DA94-1D96-426b-B3CB-BADC36347F5E} |
| 222 | static const GUID guidPrivateData = |
| 223 | { 0x9785da94, 0x1d96, 0x426b, |
| 224 | { 0xb3, 0xcb, 0xba, 0xdc, 0x36, 0x34, 0x7f, 0x5e } }; |
| 225 | |
| 226 | uint32_t iData = 0xFFFFFFFF; |
| 227 | (*p_ppiOut)->SetPrivateData(guidPrivateData,&iData,4,0); |
| 228 | return 1; |
| 229 | } |
| 230 | //------------------------------------------------------------------------------- |
| 231 | bool CMaterialManager::TryLongerPath(char* szTemp,aiString* p_szString) |
| 232 | { |
no test coverage detected