{
    This file is part of Chentrah,
    Copyright (C) 2004-2008 Anton Rzheshevski (chebmaster@mail.ru).

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/

 **********************************************************************

    This file contains the mipmap building code.

 **********************************************************************}


  //temporary:
  {$include cle_alphamip_asm.inc}
 { function MixPix(p1, p2, p3, p4: dword): dword;
  var
    v, r1, g1, b1, a1, r2, g2, b2, a2: float;
  begin
    r:=(p1 and $000000FF) + (p2 and $000000FF) + (p3 and $000000FF) + (p4 and $000000FF);
    g:=(p1 and $0000FF00) + (p2 and $0000FF00) + (p3 and $0000FF00) + (p4 and $0000FF00);
    b:=(p1 and $00FF0000) + (p2 and $00FF0000) + (p3 and $00FF0000) + (p4 and $00FF0000);
    a:=(p1 and $FF000000) + (p2 and $FF000000) + (p3 and $FF000000) + (p4 and $FF000000);
    if a = 0
  end;


  procedure ScaleHalf(p: pointer; w, h: integer);
  begin
  
  end;



  procedure cgeBuildAlphaMipmaps(Width, Height: integer; Data: pointer);
  var i: integer;
  begin
    i:=0;
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, Data);
    While (Height > 1) and (Width > 1) do begin
      ScaleHalf(Data, Width, Height);
      Width:=Width div 2;
      Height:=Height div 2;
      inc(i);
      glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA, Width, Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, Data);
    end;
  end;}
