diff --git a/include/bimg/bimg.h b/include/bimg/bimg.h index 194e264..318c73a 100644 --- a/include/bimg/bimg.h +++ b/include/bimg/bimg.h @@ -143,6 +143,10 @@ namespace bimg R90, R180, R270, + HFlip, + HFlipR90, + HFlipR270, + VFlip, }; }; diff --git a/src/image.cpp b/src/image.cpp index 3ff970a..0c00f99 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -1995,6 +1995,7 @@ namespace bimg { 16, DDPF_RGB, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }, TextureFormat::R5G6B5 }, { 16, DDPF_RGB, { 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }, TextureFormat::RGB5A1 }, { 24, DDPF_RGB, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::RGB8 }, + { 32, DDPF_RGB, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::BGRA8 }, { 32, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }, TextureFormat::RGBA8 }, { 32, DDPF_BUMPDUDV, { 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }, TextureFormat::RGBA8S }, { 32, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, TextureFormat::BGRA8 }, // D3DFMT_A8R8G8B8 diff --git a/src/image_decode.cpp b/src/image_decode.cpp index 8f93530..1e97282 100644 --- a/src/image_decode.cpp +++ b/src/image_decode.cpp @@ -621,14 +621,14 @@ namespace bimg switch (u16) { default: - case 1: orientation = Orientation::R0; break; // Horizontal (normal) - case 2: orientation = Orientation::R0; break; // Mirror horizontal - case 3: orientation = Orientation::R180; break; // Rotate 180 - case 4: orientation = Orientation::R0; break; // Mirror vertical - case 5: orientation = Orientation::R0; break; // Mirror horizontal and rotate 270 CW - case 6: orientation = Orientation::R90; break; // Rotate 90 CW - case 7: orientation = Orientation::R0; break; // Mirror horizontal and rotate 90 CW - case 8: orientation = Orientation::R270; break; // Rotate 270 CW + case 1: orientation = Orientation::R0; break; // Horizontal (normal) + case 2: orientation = Orientation::HFlip; break; // Mirror horizontal + case 3: orientation = Orientation::R180; break; // Rotate 180 + case 4: orientation = Orientation::VFlip; break; // Mirror vertical + case 5: orientation = Orientation::HFlipR270; break; // Mirror horizontal and rotate 270 CW + case 6: orientation = Orientation::R90; break; // Rotate 90 CW + case 7: orientation = Orientation::HFlipR90; break; // Mirror horizontal and rotate 90 CW + case 8: orientation = Orientation::R270; break; // Rotate 270 CW } } break;