/*--------------------------------------------------------------------
 * FICHERO:  DbnRefVt.c
 * OBJETIVO: Definir la funcin Dbn_ReflejaHorizontal()
 * AUTOR:    Pedro Reina
 * FECHA:    V.14.7.1995
 *------------------------------------------------------------------*/

/*--------------------------------------------------------------------
 * Ficheros de cabecera
 *------------------------------------------------------------------*/

#include "Diblane.h"

/*--------------------------------------------------------------------
 * Definicin de funciones
 *------------------------------------------------------------------*/

/*--------------------------------------------------------------Olimpo
 * FUNCION:  Dbn_ReflejaHorizontal()
 * OBJETIVO: Reflejar horizontalmente un objeto diblane
 * ENTRADAS: Un diblane
 * SALIDAS:  Ninguna
 * EJEMPLO:  Dbn_ReflejaHorizontal (Dibujo)
 *------------------------------------------------------------------*/
void Dbn_ReflejaHorizontal (Dibujo)
diblane Dibujo;
  {
  contador Inicio, Final, Ancho;
  memoria Aux;

  Ancho = Dbn_AnchoEnOxel(Dibujo);
  Aux = Mem_Crea (Ancho);

  for ( Inicio=0 , Final=Dbn_Alto(Dibujo)-1 ;
        Inicio < Final ; Inicio++ , Final-- )
    {
    Mem_IntercambiaLarga ( Dbn_Dato(Dibujo) + Inicio * Ancho,
                           Dbn_Dato(Dibujo) + Final * Ancho,
                           Aux, Ancho );
    }

  Mem_Destruye (Aux);
  }