| 98 | } |
| 99 | |
| 100 | void Set(dmhash_t path_hash, uint32_t width, uint32_t height, dmImage::Type type, const void* buffer) |
| 101 | { |
| 102 | for (int i = 0; i < m_Textures.Size(); ++i) |
| 103 | { |
| 104 | if (m_Textures[i]->m_PathHash == path_hash) |
| 105 | { |
| 106 | uint32_t buffer_size = width * height * dmImage::BytesPerPixel(type); |
| 107 | if (m_Textures[i]->m_Buffer) |
| 108 | { |
| 109 | free(m_Textures[i]->m_Buffer); |
| 110 | m_Textures[i]->m_Buffer = (uint8_t*) malloc(buffer_size); |
| 111 | } |
| 112 | m_Textures[i]->m_Width = width; |
| 113 | m_Textures[i]->m_Height = height; |
| 114 | m_Textures[i]->m_Type = type; |
| 115 | memcpy(m_Textures[i]->m_Buffer, buffer, buffer_size); |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | TestDynamicTexture* Get(dmhash_t path_hash) |
| 121 | { |
no test coverage detected