diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 591e1e762b..7ef492067c 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -1699,13 +1699,6 @@ void CRenderer::BindTexture(int unit,GLuint tex) } } -static inline void CopyTriple(unsigned char* dst,const unsigned char* src) -{ - dst[0]=src[0]; - dst[1]=src[1]; - dst[2]=src[2]; -} - /////////////////////////////////////////////////////////////////////////////////////////////////// // LoadAlphaMaps: load the 14 default alpha maps, pack them into one composite texture and // calculate the coordinate of each alphamap within this packed texture @@ -1755,8 +1748,10 @@ int CRenderer::LoadAlphaMaps() // get its size and make sure they are all equal. // (the packing algo assumes this) - size_t this_width = 0, this_bpp = 0; // fail-safe - (void)ogl_tex_get_size(textures[i], &this_width, 0, &this_bpp); + size_t this_width = 0, this_height = 0, this_bpp = 0; // fail-safe + (void)ogl_tex_get_size(textures[i], &this_width, &this_height, &this_bpp); + if(this_width != this_height) + DEBUG_DISPLAY_ERROR(L"Alpha maps are not square"); // .. first iteration: establish size if(i == 0) { @@ -1775,55 +1770,53 @@ int CRenderer::LoadAlphaMaps() size_t total_w = round_up_to_pow2(tile_w * NumAlphaMaps); size_t total_h = base; debug_assert(is_pow2(total_h)); shared_ptr data; - AllocateAligned(data, total_w*total_h*3, maxSectorSize); + AllocateAligned(data, total_w*total_h, maxSectorSize); // for each tile on row - for(size_t i=0;i