[comp.sys.amiga] I would love some advice...

manes@xanth.cs.odu.edu (Mark Manes) (08/08/88)

All right you amiga guru's you.  I have a question, or rather I would like
some advice.

I am working a program that will display a chess board on the screen.  I 
am wondering if the best way to approach something like this is to:
   
    #1  Use Deluxe Paint, draw my chess board

    #2  Use NGI or some utility to convert it to image data

    #3  Use the Intuition routine DrawImage() to put it up.

I have done this on a smaller scale with other images, but what about the
size of this image?  Also, if I wanted to place individual chess pieces on
the board, how would I display them, and how would I move them?

This is most intriquing to me.  I would appreciate any answers that you 
might have.

Also, if you know a small IFF reader that can be included in a program, 
I would be interested in that as well.
 
Thanks net!       

-mark=
 
---------------------------------------------------------------------------
Mark D. Manes                                          "In Amiga We Trust"  
Programmer of Fortune, have compiler will travel

"C is the Only programming Language that would compile a Ronald Reagan 
 Speech" - the masked programmer
===========================================================================

koster@cory.Berkeley.EDU (Herbert West) (08/09/88)

(He wants to do a chess display, and wants to know about doing the graphics)
Use a painting program like Deluxe Paint II and draw the figures. Put them
in some order, and perhaps draw boxes around them.

Then in your program, read in that file every time you want the program to
run. Treat it as an IFF, grab the graphics and keep them in your own
format, whatever is handiest.

This way, if you want to change the graphics, all you have to do is change
the picture file, not re-compile/assemble your program. Also it makes
end-users happy as they can costomize the graphics if you intend this for
distribution.

I suggest the following in your program:

Create a bitmap of whatever resolution the picture file will be. Have it
look exactly like a bitmap(you must initialize fields like bytes per row and
numrows and the bitplane pointers). Then read in the IFF file, into this
bitmap, and use the BltBitmap() function to copy from this hidden bitmap
to a visible one, created say with an OpenScreen().

For an IFF reader, look at FF16 and later updates. These provide source in
'C'. Also someone wrote a program called MicroShow which reads and displays
an IFF file. I think he will give out the source for some money or pleading
or something.

Good luck!