First commit 13/02/1995

This commit is contained in:
2021-09-12 19:56:57 +02:00
commit 0b071899d4
20 changed files with 654 additions and 0 deletions

51
PCX.CPP Normal file
View File

@ -0,0 +1,51 @@
#define RES_X 320
#define RES_Y 200
/**************************************************************************\
|* *|
|* MuestraImagen *|
|* *|
|* Descripci<63>n: *|
|* Descomprime y copia a la pagina indicada un PCX *|
|* *|
|* Entradas: nombre de la imagen *|
|* *|
|* *|
|* Salidas: OK Todo ha ido bien *|
|* ERROR Algo va mal *|
|* *|
\**************************************************************************/
int MuestraImagen( char *file )
{
int alto, ancho, contador;
unsigned char byte;
FILE *fp;
if ( (fp = fopen( file,"rb")) != NULL )
{
// Saltamos la cabecera
fseek( fp, 128, SEEK_SET );
for(alto=0; alto<RES_Y; alto++)
{
for(ancho=0; ancho<RES_X; )
{
byte=getc(fp);
if(byte<=0xC0)
{
set_point (ancho, alto, byte);
ancho++;
} else {
contador=byte&0x3F; byte=getc(fp);
for(; contador>0; contador--)
{
set_point (ancho, alto, byte);
ancho++;
}
}
}
}
fclose(fp);
} else return ERROR;
return OK;
}