| 860 | } |
| 861 | |
| 862 | static void* MakeDynamicTextureData(uint32_t width, uint32_t height, dmImage::Type type, bool flip, const void* buffer, uint32_t buffer_size) |
| 863 | { |
| 864 | void* data = malloc(buffer_size); |
| 865 | |
| 866 | if (flip) |
| 867 | { |
| 868 | if (!CopyImageBufferFlipped(width, height, (uint8_t*)buffer, buffer_size, type, (uint8_t*) data)) |
| 869 | { |
| 870 | free(data); |
| 871 | return 0; |
| 872 | } |
| 873 | } |
| 874 | else |
| 875 | { |
| 876 | memcpy(data, buffer, buffer_size); |
| 877 | } |
| 878 | return data; |
| 879 | } |
| 880 | |
| 881 | Result NewDynamicTexture(HScene scene, const dmhash_t path, uint32_t width, uint32_t height, dmImage::Type type, dmImage::CompressionType compression_type, bool flip, const void* buffer, uint32_t buffer_size) |
| 882 | { |
no test coverage detected