home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
TILER.ZIP
/
DEMO.ZIP
/
DEMODRAW.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-24
|
2KB
|
51 lines
/*
* When it opens the file it reads drive C.
* If you are running it off a different drive
* then change the drive.
*/
#define TOTAL 256
#include <stdio.h>
#include <graph.h>
#include <conio.h>
FILE *file; /* Define file pointer */
main (void)
{
char pict[TOTAL];
short ctr; /* Define a counter */
short stop;
short width, length;
/* Fill variables */
stop = 0;
width = 16; /* width of tile */
length = 16; /* length of tile */
_setvideomode(_MRES256COLOR); /* This makes the 256 color mode */
file = fopen("C:\\TILER\\DEMO\\FIGHTY.CLP", "r+b"); /* Open file "FIGHTY.CLP" */
if (file == NULL) { /* Checks to see if */
printf ("File not found."); /* the file "FIGHTY.CLP" */
return (-1); /* is actually there. */
} /* End If */
for (ctr = 0; ctr < TOTAL; ctr++) {
pict[ctr] = (char)(fgetc(file)); /* See that the file is */
} /* End For Loop */ /* within array boundaries */
/* and puts the file into */
/* the array. */
_putimage(100, 100, pict, _GPSET); /* Puts image on screen */
fclose(file); /* Close the file */
getch(); /* Wait for person to press a key. */
_setvideomode(_DEFAULTMODE); /* This returns the screen to normal */
} /* End of Main */