From db0bd9758018468ae4060b2229e35a5c56788f1a Mon Sep 17 00:00:00 2001 From: trotFunky Date: Wed, 25 Sep 2019 13:02:24 +0200 Subject: [PATCH] Added loading of a TGA mask image to generate alpha canal --- resources/arbre_masque.tga | Bin 0 -> 197669 bytes src/Texture.cpp | 43 +++++++++++++++++++++++++++++++++++-- src/Texture.h | 2 +- src/displayers.cpp | 4 ++++ src/main.cpp | 6 ++---- 5 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 resources/arbre_masque.tga diff --git a/resources/arbre_masque.tga b/resources/arbre_masque.tga new file mode 100644 index 0000000000000000000000000000000000000000..c495d3cf0aeed9972d1c33015a487b235f571bf8 GIT binary patch literal 197669 zcmeI5NzZjhk>_m#Hlr~ZaN8I#wi#sM62iSeYD=gW)!i0|F1pI45<7&dx_i+Ds;>SL ztoRJ95F6wTn^zvdcz8We*i6l6z-Bh{WT>D0FaH&a%#%0Ix%WPIc=CCr^F~HSL`FtN zW=0O@+;h)4?;QUA!*h>w&OPT`0new#V_0BVU|3*SU|3*SU|3*SU|3*SU|3*SVCxq6 z%L{*7FKHAoEU*g;{P2fAe8I<8{D0wv7ecWM9Y>kN0^72{7ryX?6@LFh_5~MQF#La8 z%`oKd$O2D2_0$Uv-u3^E)EvbQ3v9&#&p!KXm*2lYv=t?W&|!fcS>Oe~?)v|>+iu&D znxoiZfo)mfqKhu-^8Ua4<;f?X+?EnU?y$g)EYRuvkp1XKKiZLwqu61AZCRk-|DSp0 znQbXCY1@>Hj;{auh!-upJ8w|KE;X zht$Kcz@v{o+S3INqcTIwVS$+z`1;qsKKy^C%?A1LSb&SoEB*h>nKQ>z;Zc)efnb4O z{_>YA{U3tBF~DJgMSt)|I{`4sBo~rx#ynS(***@0EY#R!~#G5@sE3)ADSbn@TkVHK(Iik z^AGOZidT?4CJT(ZoLURqe*5kA?N`0(RluEJ0X?-A8x^0jz^{JwD}6=(>8GFm-S2+) z-S2*PigJJOc76cXwlUd;A9&z_{i(&!Wak!m{PD-{x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Y|c zGB&nPDI$6}a;jf$N7~ByC6+kgVS)86aNm9Rl|rgxINyC0rE-}jN=7is)%4->HIUrK zXYltvzbR8$Rha`hEO3$*Ao$lC#~RhW3W&Z+R#hc=c#8R9Ebr%78aqPz=;HXaTGgZj zdBPU3XRf@5iDD4*Gk-j-r1$XgdB*&hWf}mo;|;)Vq}EkFRnH_{ciloJ7N&mQK~xmfA^Q*UAtMA6-N!lH9A0Ol9ISkkHI zAR89go(1qm36}%==Lv9H@bYsJ2yQ>2Og|{2a|E~~Szi|EQV4K58^9Fl7Nc z#e(0bo02y0!vcq80nQZeyz|b((s^h*EHErEEHErEEHErEEHErEEHErEEHErEEHErE zEHErEEHErEEHErEEHErEEHErEEHErEEHErEEHErEEHErEEHErEERZblvvU(-B=^(; zH~gQE{Lg>H8SKRQ=AN{LB-Ai6_#dEm-#=ptGzxy9I z{`KGA@V7Vo_YYqC5C7$c5B&9CoiiL^(pcNbIQN`O&w1j4m!0#U&iRjX#sAGm{`Wus f>lJ_dzdrWyEB@wRJ~o&8-{~(u??ul;r6c?s@#b@V literal 0 HcmV?d00001 diff --git a/src/Texture.cpp b/src/Texture.cpp index 6a1a1a2..7fc4b32 100644 --- a/src/Texture.cpp +++ b/src/Texture.cpp @@ -74,7 +74,46 @@ bool Texture::load_rgb_tga(const std::string& rgb_filename) return load_tga(rgb_filename,image_data); } -bool Texture::load_rgba_tga(const std::string& rgb_filename,const std::string& mask_filename) +bool Texture::load_rgba_tga(const std::string& rgb_filename, const std::string& mask_filename) { - return false; + uint8_t* rgb_data = nullptr; + uint8_t* mask_data = nullptr; + + bool load_successful = true; + // Load rgb and alpha data before merging them + load_successful &= load_tga(rgb_filename, rgb_data); + uint16_t temp_width = width; + uint16_t temp_height = height; + + load_successful &= load_tga(mask_filename, mask_data); + + if (!load_successful) + { + std::cerr << "Error while loading RGBA image" << std::endl; + return false; + } + if (temp_width != width || temp_height != height) + { + std::cerr << "Error while loading RGBA image : image and mask dimensions do no match : " << std::endl; + std::cerr << temp_width << "x" << temp_height << " versus " << width << "x" << height << std::endl; + return false; + } + + + image_data = new uint8_t[width*height*4]; + + // Merge the two images + for(int i = 0;i