anchor.diff:      begin
         StepCaption('Reading '+RXData[i].Title+' GFX ...');
         fLog.AppendLog('Reading '+RXData[i].Title+'.rx',LoadRX(ExeDir+'data\gfx\res\'+RXData[i].Title+'.rx',i));
  -      LoadRX7(i);
  -      if i=2 then MakeGFX_AlphaTest(nil,i); //Make alphas for house building
  -      MakeGFX(nil,i); //Call it last cos it will clear RGBA data
  +      LoadRX7(i); //Updated sprites
  +      MakeGFX(i);
  +      //Alpha_tested sprites for houses. They come after MakeGFX cos they will
  +      //replace above data. 
  +      if i=2 then MakeGFX_AlphaTest(i);
  +      ClearUnusedGFX(i);
         StepRefresh();
       end;
   
  
positive.code: begin
    CreateDir(ExeDir+'Export\');
    CreateDir(ExeDir+'Export\'+RXData[RXid].Title+'.rx\');
    MyBitMap:=TBitMap.Create;
    MyBitMap.PixelFormat:=pf24bit;
  
    fResource.LoadRX(ExeDir+'data\gfx\res\'+RXData[RXid].Title+'.rx',RXid);
  
    for id:=1 to RXData[RXid].Qty do begin
  
      sx:=RXData[RXid].Size[id].X;
      sy:=RXData[RXid].Size[id].Y;
      MyBitMap.Width:=sx;
      MyBitMap.Height:=sy;
  
      UsePal:=DEF_PAL;
      if RXid=5 then UsePal:=RX5Pal[id];
      if RXid=6 then UsePal:=RX6Pal[id];
  
      for y:=0 to sy-1 do for x:=0 to sx-1 do begin
        t:=RXData[RXid].Data[id,y*sx+x];
        MyBitMap.Canvas.Pixels[x,y]:=fResource.GetColor32(t,UsePal);
      end;
      if sy>0 then MyBitMap.SaveToFile(ExeDir+'Export\'+RXData[RXid].Title+'.rx\'+RXData[RXid].Title+'_'+int2fix(id,4)+'.bmp');
  
  
negative.code:   Result := GenerateTextureCommon; //Should be called prior to glTexImage2D or gluBuild2DMipmaps
  
    case Mode of
      tm_AlphaTest: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,    DestX, DestY, 0, GL_RGBA, GL_UNSIGNED_BYTE, Data);
      //Base layer
      tm_TexID:     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB5_A1, DestX, DestY, 0, GL_RGBA, GL_UNSIGNED_BYTE, Data);
      //Team color layer
      tm_AltID:     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA2,   DestX, DestY, 0, GL_RGBA, GL_UNSIGNED_BYTE, Data);
    end;
  
    if WriteAllTexturesToBMP then begin
  