From 1aced4d4ec53bd4b61bd8f879ab4d9e30fa773be Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Thu, 5 Sep 2013 21:41:42 -0700 Subject: [PATCH] Cleanup. --- README.md | 8 ++--- include/bgfx.h | 1 - src/bgfx_p.h | 1 - src/image.cpp | 80 +++++++++++++++++++++++++------------------------- src/image.h | 3 ++ 5 files changed, 46 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index aca5cce2..98c7bc7c 100644 --- a/README.md +++ b/README.md @@ -106,9 +106,6 @@ Dependencies [https://github.com/bkaradzic/bx](https://github.com/bkaradzic/bx) -Optional: -[https://github.com/mendsley/tinystl](https://github.com/mendsley/tinystl) - Building -------- @@ -274,10 +271,11 @@ cross-platform shaders. ### Texture Compiler (texturec) -This tool doesn't currently exist. To produce DDS or KTX textures use: +This tool doesn't currently exist. To produce DDS, KTX or PVR textures use: [.dds - nVidia Texture Tools - DDS Utilities](https://developer.nvidia.com/legacy-texture-tools) -[.ktx - Mali GPU Texture Compression Tool](http://malideveloper.arm.com/develop-for-mali/mali-gpu-texture-compression-tool/) +[.ktx - Mali GPU Texture Compression Tool](http://malideveloper.arm.com/develop-for-mali/mali-gpu-texture-compression-tool/) +[.pvr - PowerVR Insider SDK](http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp) ### Geometry Compiler (geometryc) diff --git a/include/bgfx.h b/include/bgfx.h index 5c5bffad..1969bdda 100644 --- a/include/bgfx.h +++ b/include/bgfx.h @@ -525,7 +525,6 @@ namespace bgfx /// /// @param _width Width of input image (pixels). /// @param _height Height of input image (pixels). - /// @param _pitch Pitch of input image (bytes). /// @param _src Source image. /// @param _dst Destination image. Must be the same size as input image. /// _dst might be pointer to the same memory as _src. diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 11ba2fd5..bc4e7591 100755 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -230,7 +230,6 @@ namespace bgfx extern FreeFn g_free; void release(const Memory* _mem); - uint32_t getBitsPerPixel(TextureFormat::Enum _format); const char* getAttribName(Attrib::Enum _attr); bool renderFrame(); diff --git a/src/image.cpp b/src/image.cpp index 78650e2c..92a161c4 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -792,22 +792,22 @@ namespace bgfx } s_translateDdsFormat[] = { - { DDS_DXT1, TextureFormat::BC1 }, - { DDS_DXT2, TextureFormat::BC2 }, - { DDS_DXT3, TextureFormat::BC2 }, - { DDS_DXT4, TextureFormat::BC3 }, - { DDS_DXT5, TextureFormat::BC3 }, - { DDS_ATI1, TextureFormat::BC4 }, - { DDS_BC4U, TextureFormat::BC4 }, - { DDS_ATI2, TextureFormat::BC5 }, - { DDS_BC5U, TextureFormat::BC5 }, - { D3DFMT_A16B16G16R16, TextureFormat::RGBA16 }, - { D3DFMT_A16B16G16R16F, TextureFormat::RGBA16F }, - { DDPF_RGB, TextureFormat::BGRX8 }, - { DDPF_RGB|DDPF_ALPHAPIXELS, TextureFormat::BGRA8 }, - { DDPF_INDEXED, TextureFormat::L8 }, - { DDPF_LUMINANCE, TextureFormat::L8 }, - { DDPF_ALPHA, TextureFormat::L8 }, + { DDS_DXT1, TextureFormat::BC1 }, + { DDS_DXT2, TextureFormat::BC2 }, + { DDS_DXT3, TextureFormat::BC2 }, + { DDS_DXT4, TextureFormat::BC3 }, + { DDS_DXT5, TextureFormat::BC3 }, + { DDS_ATI1, TextureFormat::BC4 }, + { DDS_BC4U, TextureFormat::BC4 }, + { DDS_ATI2, TextureFormat::BC5 }, + { DDS_BC5U, TextureFormat::BC5 }, + { D3DFMT_A16B16G16R16, TextureFormat::RGBA16 }, + { D3DFMT_A16B16G16R16F, TextureFormat::RGBA16F }, + { DDPF_RGB, TextureFormat::BGRX8 }, + { DDPF_RGB|DDPF_ALPHAPIXELS, TextureFormat::BGRA8 }, + { DDPF_INDEXED, TextureFormat::L8 }, + { DDPF_LUMINANCE, TextureFormat::L8 }, + { DDPF_ALPHA, TextureFormat::L8 }, }; bool imageParseDds(ImageContainer& _imageContainer, bx::ReaderSeekerI* _reader) @@ -960,30 +960,30 @@ namespace bgfx } s_translateKtxFormat[] = { - { KTX_COMPRESSED_RGBA_S3TC_DXT1_EXT, TextureFormat::BC1 }, - { KTX_COMPRESSED_RGBA_S3TC_DXT3_EXT, TextureFormat::BC2 }, - { KTX_COMPRESSED_RGBA_S3TC_DXT5_EXT, TextureFormat::BC3 }, - { KTX_COMPRESSED_LUMINANCE_LATC1_EXT, TextureFormat::BC4 }, - { KTX_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, TextureFormat::BC5 }, - { KTX_ETC1_RGB8_OES, TextureFormat::ETC1 }, - { KTX_COMPRESSED_RGB8_ETC2, TextureFormat::ETC2 }, - { KTX_COMPRESSED_RGBA8_ETC2_EAC, TextureFormat::ETC2A }, - { KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, TextureFormat::ETC2A1 }, - { KTX_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, TextureFormat::PTC12 }, - { KTX_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, TextureFormat::PTC12A }, - { KTX_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, TextureFormat::PTC14 }, - { KTX_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, TextureFormat::PTC14A }, - { KTX_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, TextureFormat::PTC22 }, - { KTX_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, TextureFormat::PTC24 }, - { KTX_RGBA16, TextureFormat::RGBA16 }, - { KTX_RGBA16F, TextureFormat::RGBA16F }, - { KTX_COMPRESSED_R11_EAC, TextureFormat::Unknown }, - { KTX_COMPRESSED_SIGNED_R11_EAC, TextureFormat::Unknown }, - { KTX_COMPRESSED_RG11_EAC, TextureFormat::Unknown }, - { KTX_COMPRESSED_SIGNED_RG11_EAC, TextureFormat::Unknown }, - { KTX_COMPRESSED_SRGB8_ETC2, TextureFormat::Unknown }, - { KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, TextureFormat::Unknown }, - { KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, TextureFormat::Unknown }, + { KTX_COMPRESSED_RGBA_S3TC_DXT1_EXT, TextureFormat::BC1 }, + { KTX_COMPRESSED_RGBA_S3TC_DXT3_EXT, TextureFormat::BC2 }, + { KTX_COMPRESSED_RGBA_S3TC_DXT5_EXT, TextureFormat::BC3 }, + { KTX_COMPRESSED_LUMINANCE_LATC1_EXT, TextureFormat::BC4 }, + { KTX_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, TextureFormat::BC5 }, + { KTX_ETC1_RGB8_OES, TextureFormat::ETC1 }, + { KTX_COMPRESSED_RGB8_ETC2, TextureFormat::ETC2 }, + { KTX_COMPRESSED_RGBA8_ETC2_EAC, TextureFormat::ETC2A }, + { KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, TextureFormat::ETC2A1 }, + { KTX_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, TextureFormat::PTC12 }, + { KTX_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, TextureFormat::PTC12A }, + { KTX_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, TextureFormat::PTC14 }, + { KTX_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, TextureFormat::PTC14A }, + { KTX_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, TextureFormat::PTC22 }, + { KTX_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, TextureFormat::PTC24 }, + { KTX_RGBA16, TextureFormat::RGBA16 }, + { KTX_RGBA16F, TextureFormat::RGBA16F }, + { KTX_COMPRESSED_R11_EAC, TextureFormat::Unknown }, + { KTX_COMPRESSED_SIGNED_R11_EAC, TextureFormat::Unknown }, + { KTX_COMPRESSED_RG11_EAC, TextureFormat::Unknown }, + { KTX_COMPRESSED_SIGNED_RG11_EAC, TextureFormat::Unknown }, + { KTX_COMPRESSED_SRGB8_ETC2, TextureFormat::Unknown }, + { KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, TextureFormat::Unknown }, + { KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, TextureFormat::Unknown }, }; bool imageParseKtx(ImageContainer& _imageContainer, bx::ReaderSeekerI* _reader) diff --git a/src/image.h b/src/image.h index 3fff3acd..34f8470e 100644 --- a/src/image.h +++ b/src/image.h @@ -39,6 +39,9 @@ namespace bgfx void decode(uint8_t* _dst); }; + /// + uint32_t getBitsPerPixel(TextureFormat::Enum _format); + /// void imageSolid(uint32_t _width, uint32_t _height, uint32_t _solid, void* _dst);