summaryrefslogtreecommitdiff
path: root/thirdparty/etcpak/Bitmap.hpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-04-14 16:45:14 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-04-14 16:50:02 +0200
commit638cfec853cfdbc95b5ccc67477afbaa3a53bc33 (patch)
tree68e408f59de168080efbb5e4ecdb2fca4bf7a1c9 /thirdparty/etcpak/Bitmap.hpp
parent8ce0fb0a946455ed6a7bc8a54fcf90a9d5a9ae4d (diff)
etcpak: We only need the compression code, remove rest of etcpak app
We do our own image loading, threading, and memory management in Godot already, so the only components we need from etcpak (at least as of now) are the `Compress*` methods defined in `ProcessDxtc.cpp` and `ProcessRGB.cpp`. So we don't need to compile or vendor the rest.
Diffstat (limited to 'thirdparty/etcpak/Bitmap.hpp')
-rw-r--r--thirdparty/etcpak/Bitmap.hpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/thirdparty/etcpak/Bitmap.hpp b/thirdparty/etcpak/Bitmap.hpp
deleted file mode 100644
index fae8c936ed..0000000000
--- a/thirdparty/etcpak/Bitmap.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef __DARKRL__BITMAP_HPP__
-#define __DARKRL__BITMAP_HPP__
-
-#include <future>
-#include <memory>
-#include <mutex>
-#include <stdint.h>
-
-#include "Semaphore.hpp"
-#include "Vector.hpp"
-
-enum class Channels
-{
- RGB,
- Alpha
-};
-
-class Bitmap
-{
-public:
- Bitmap( const char* fn, unsigned int lines, bool bgr );
- Bitmap( const v2i& size );
- virtual ~Bitmap();
-
- void Write( const char* fn );
-
- uint32_t* Data() { if( m_load.valid() ) m_load.wait(); return m_data; }
- const uint32_t* Data() const { if( m_load.valid() ) m_load.wait(); return m_data; }
- const v2i& Size() const { return m_size; }
- bool Alpha() const { return m_alpha; }
-
- const uint32_t* NextBlock( unsigned int& lines, bool& done );
-
-protected:
- Bitmap( const Bitmap& src, unsigned int lines );
-
- uint32_t* m_data;
- uint32_t* m_block;
- unsigned int m_lines;
- unsigned int m_linesLeft;
- v2i m_size;
- bool m_alpha;
- Semaphore m_sema;
- std::mutex m_lock;
- std::future<void> m_load;
-};
-
-typedef std::shared_ptr<Bitmap> BitmapPtr;
-
-#endif