|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Image Formats
What about,
char * buf; /* If buf points to vd mem */
FILE * pout;
int ctr;
fout=fopen("bitmap.raw", "wb");
for(ctr=0;ctr<(320*200);c++)
{
fwrite( (buf+ctr), 1, sizeof(char), fout );
//Can't remeber exeact order of params */
}
fclose(fout);
At 02:09 pm 07/07/80 +0000, you wrote:
>Hi,
>
>Can somebody tell me about a quick routine to convert a 256-color bitmap
(or other common format) into a raw data file? What I mean by raw data
file, is that it doesn't include anything like the resolution of the file,
and colors, and everything, it automatically assumes that it's 320x200x256
and uses a predetermined palette (which I already created in a file called
'palette.dat', and written a routine to set it up). All it should contain
is the exact data that should be sent to the video card. The first byte of
the file should be the start of the video memory at a000:0000. If anybody
knows of a better way to do this, I would appreciate it.
>
>Lionel
>
>P.s. I think I can tell my game how to read from the raw data file, I just
don't know how to read the bitmap file and write it to the raw data file,
since I no almost nothing about bitmaps - except that you can use GIMP to
create them, etc. :-)
>=================================================================
>The GameProgrammer.Com mailing list is for the open discussion
>of any topic related to the art, science, and business of
>programming games. This list is especially tolerant of beginners.
>We were all beginners once
>
>To SUBSCRIBE or UNSUBSCRIBE please visit:
>http://gameprogrammer.com/mailinglist.html
>
****
*Evan Marchant
*ICQ#15055534
*"Once one problems solved, ten are around the corner"
****
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html
|
|