Skip to main content
gamedev.net
🔒 Locked

Problems with Bitmap

Started by remybar Dec 6, 2001 at 8:11 AM 1 replies 400+ views
Original Post
remybar
remybar
I develop a 2D engine for my game. I would like to create a file which contains all data of the game. So, i would like to add to this file, all of bitmaps that represents Tile. For this, i try to load a Bitmap with BITMAPs structures like BITMAPINFOHEADER, but i don''t find any function that be able to use these structures for creating an offscreen direct draw surface. If you have some ideas about how create this kind of file (that regruops all of data), or about loading Bitmap in structures (not in HBITMAP because i know this function but it work only if the bitmap is in a bitmap file.) and using this structures to do an offscreen direct draw surface, i will be very happy. Thanks. email : r.baranx@libertysurf.fr
JOL
JOL
Just write a small function that takes a width a height ,a pointer to a array containing the bitmap data and a file stream.
make the function read width*height from the stream into the array. or write height*width from array to the stream.

- was this what you asked for ?
look at www.wotsit.org for bitmap file structure - you can easily create a small converter from .bmp to your own format .yof


to create the surface - create a surface with the right height and with and lock it, use the pointer to the data in the surface (cant remember the name (probably starts with lpDD ) and read width of data into it height times...

and last - make the file into a tagged format ...
sprites might be saved as
SPRT[...sprite data....]
Bitmaps
BMP_[....bitmap data...]

to read such a file.
first - find a TAG
the TAG SPRT identifies that a sprite is the next thing in the file, read in the sprite and check for the next TAG. read that info and continue...
inside the SPRT there might be other tags that belongs to SPRT such as ANIM (animation frame) or DIR_ (direction)

you write a parser for raeding/loading and a tool to create the files ...
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I'm looking for work
remybar
remybar
I have tryed this but it don''t work. Do you know where i can find some tutorials about this.
Thank you for your precision.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.