mirror of
https://github.com/jorio/Pomme.git
synced 2025-01-15 10:33:03 +00:00
DumpTGA: fix TGA header to account for alpha channel
This commit is contained in:
parent
61d2c01102
commit
ffc5a80b9c
@ -62,7 +62,7 @@ std::ostream& operator<<(std::ostream& s, const Rect& r)
|
||||
void Pomme::Graphics::DumpTGA(const char* path, short width, short height, const char* argbData)
|
||||
{
|
||||
std::ofstream tga(path);
|
||||
short tgaHdr[] = {0, 2, 0, 0, 0, 0, (short) width, (short) height, 0x2020};
|
||||
uint16_t tgaHdr[] = {0, 2, 0, 0, 0, 0, (uint16_t) width, (uint16_t) height, 0x2820};
|
||||
tga.write((const char*) tgaHdr, sizeof(tgaHdr));
|
||||
for (int i = 0; i < 4 * width * height; i += 4)
|
||||
{
|
||||
@ -72,7 +72,6 @@ void Pomme::Graphics::DumpTGA(const char* path, short width, short height, const
|
||||
tga.put(argbData[i + 0]); //a
|
||||
}
|
||||
tga.close();
|
||||
std::cout << "wrote " << path << "\n";
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user