home *** CD-ROM | disk | FTP | other *** search
/ Game Developers Magazine 3 / GDM003.ZIP / SPRITED.DOC < prev    next >
Text File  |  1993-03-16  |  21KB  |  566 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.                                      │  │ ┌──┐   
  31.                                      └──┤ │    's
  32.                                       ──┘ └──┘   
  33.  
  34.                                   Sprite Editor 1.0
  35.                            Copyright 1993 by Curtis Keisler
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                                   TABLE OF CONTENTS
  42.  
  43.           1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . .   1
  44.  
  45.           2. ACKNOWLEDGMENTS  . . . . . . . . . . . . . . . . . . . . .   1
  46.  
  47.           3. DISCLAIMER . . . . . . . . . . . . . . . . . . . . . . . .   1
  48.  
  49.           4. GETTING STARTED  . . . . . . . . . . . . . . . . . . . . .   1
  50.  
  51.           5. SCREEN LAYOUT  . . . . . . . . . . . . . . . . . . . . . .   2
  52.  
  53.           6. HOW TO USE THE PROGRAM . . . . . . . . . . . . . . . . . .   2
  54.  
  55.           7. THE PALETTE  . . . . . . . . . . . . . . . . . . . . . . .   3
  56.  
  57.           8. THE DRAWING PRIMITIVES . . . . . . . . . . . . . . . . . .   3
  58.                8.1 Draw . . . . . . . . . . . . . . . . . . . . . . . .   3
  59.                8.2 Line . . . . . . . . . . . . . . . . . . . . . . . .   3
  60.                8.3 Circle . . . . . . . . . . . . . . . . . . . . . . .   4
  61.                8.4 Rectangle  . . . . . . . . . . . . . . . . . . . . .   4
  62.                8.5 Solid Circles and Rectangles . . . . . . . . . . . .   4
  63.                8.6 Paint  . . . . . . . . . . . . . . . . . . . . . . .   4
  64.  
  65.           9. SPRITE POSITIONING FEATURES  . . . . . . . . . . . . . . .   4
  66.                9.1. Up, Down, Left, Right . . . . . . . . . . . . . . .   4
  67.                9.2. Rotate  . . . . . . . . . . . . . . . . . . . . . .   5
  68.                9.3. X-flip, Y-flip  . . . . . . . . . . . . . . . . . .   5
  69.                9.4. Grid  . . . . . . . . . . . . . . . . . . . . . . .   5
  70.                9.5. Tile  . . . . . . . . . . . . . . . . . . . . . . .   5
  71.                9.6. Undo  . . . . . . . . . . . . . . . . . . . . . . .   5
  72.  
  73.           10. SAVING, LOADING AND SOURCING  . . . . . . . . . . . . . .   6
  74.                10.1 Pascal, C . . . . . . . . . . . . . . . . . . . . .   6
  75.                10.2 Clear . . . . . . . . . . . . . . . . . . . . . . .   6
  76.                10.3 Save, Load  . . . . . . . . . . . . . . . . . . . .   7
  77.  
  78.           11. QUIT  . . . . . . . . . . . . . . . . . . . . . . . . . .   7
  79.  
  80.           12. GENERAL INFORMATION . . . . . . . . . . . . . . . . . . .   7
  81.  
  82.           13. REGISTRATION  . . . . . . . . . . . . . . . . . . . . . .   8
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.                                                                           i
  95.  
  96.  
  97.  
  98.  
  99.  
  100.           1. INTRODUCTION
  101.  
  102.           yc's Sprite Editor is a tool that aids the gaming programmer in
  103.           designing sprites used video games for the IBM PC compatible.  It
  104.           lets you create 32x32x256 color sprites for use in C and Pascal
  105.           programs (assembler too!).
  106.  
  107.           The requirements are a SVGA graphics adapter capable of
  108.           640x480x256 color in either Vesa, Trident or Video7 mode, a
  109.           Microsoft compatible mouse, at least 512k memory and a little
  110.           disk space for storing sprite files and/or source code.
  111.  
  112.           I wrote this program to help me in creating sprites for several
  113.           games that I am writing. I thought that it would be nice to
  114.           provide this tool to other game designers faced with the same
  115.           task.
  116.  
  117.           This program has a surprisingly high level of functionality.  It
  118.           provides simple drawing primitives such as bit level
  119.           manipulation, line drawing, circles, rectangles, filled circles,
  120.           filled rectangles, flood filling, x and/or y axis mirroring, 90
  121.           degree rotations, and a tiled view.  It also has an undo feature,
  122.           saving, loading, and C and Pascal "const" source output.
  123.  
  124.           2. ACKNOWLEDGMENTS
  125.  
  126.           Thanks to Borland International for providing such great
  127.           programming environments.  This program was written using Borland
  128.           Pascal 7.0.  I also use their C++ compiler and I highly recommend
  129.           ANYTHING that Borland produces.
  130.  
  131.           Thanks to Steve Holley for requesting of me to write this program
  132.           in the first place.
  133.  
  134.           Thanks to Michael Day of Knight Software, P.O. Box 22902,
  135.           Milwaukie, OR 97222, CIS [70007,4645] or [73577,2225] for
  136.           developing the 640x480x256 BGI's that I used to write this
  137.           program.  BGI256 V3.00 as of 22 Dec 1992 is Copyright (c)
  138.           1991,1992 by Knight Software.
  139.  
  140.           3. DISCLAIMER
  141.  
  142.           If this program kills your computer its not my fault.  By running
  143.           this program on your computer you are willingly releasing me, the
  144.           author, from any responsibility for loss.
  145.  
  146.           4. GETTING STARTED
  147.  
  148.           If you have a Vesa compatible SVGA card all you need to do is
  149.           type "sprited".  For Trident or Video7 compatibility, type
  150.           "sprited TRIDENT" or "sprited VIDEO7" respectively.
  151.  
  152.  
  153.                                                                           1
  154.  
  155.  
  156.  
  157.  
  158.  
  159.           5. SCREEN LAYOUT 
  160.  
  161.                 ┌───────────────────────┬────────────────────────────┐
  162.                 │                       │   ╔═══════════════╗ ╔═════╗│
  163.                 │                       │   ╚═══════════════╝ ╠═════╣│
  164.                 │                       │                     ╠═════╣│
  165.                 │                       │         ┌───┐       ╠═════╣│
  166.                 │                       │         │ 3 │       ╠═════╣│
  167.                 │          1            │         └───┘       ╠═════╣│
  168.                 │                       │                     ╠═════╣│
  169.                 │                       │                     ╠═════╣│
  170.                 │                       │      4┌────────┐    ╚═════╝│
  171.                 │                       │       └────────┘     5     │
  172.                 │                       │     ╔═════╗ ╔═════╗ ╔═════╗│
  173.                 ├───────────────────────┤     ╠═════╣ ╠═════╣ ╠═════╣│
  174.                 │                       │     ╠═════╣ ╠═════╣ ╠═════╣│
  175.                 │                       │     ╠═════╣ ╠═════╣ ╠═════╣│
  176.                 │                       │     ╠═════╣ ╠═════╣ ╠═════╣│
  177.                 │          2            │     ╚═════╝ ╠═════╣ ╠═════╣│
  178.                 │┌──────────┐┌─────────┐│             ╠═════╣ ╠═════╣│
  179.                 │└──────────┘└─────────┘│             ╚═════╝ ╚═════╝│
  180.                 └───────────────────────┴────────────────────────────┘
  181.  
  182.           (1)  This area contains a zoomed version of the sprite.  This
  183.                area is where ALL of the editing takes place.
  184.  
  185.           (2)  This area contains the color palette.  This is the resident
  186.                palette so no special provisions are necessary for re-
  187.                displaying the sprite in your programs, i.e. you don't need
  188.                to load and save palettes!
  189.  
  190.           (3)  This area shows the actual size of the sprite and reflects
  191.                exactly what is represented in area 1.
  192.  
  193.           (4)  This area displays in text the current editing mode.  This
  194.                describes the action that will be taken if the mouse is
  195.                clicked inside of area 1, the sprite editing area.
  196.  
  197.           (5)  This area contains the buttons that represent various
  198.                actions that can be performed on the sprite.
  199.  
  200.  
  201.           6. HOW TO USE THE PROGRAM
  202.  
  203.           Options are made by positioning the mouse cursor on one of the
  204.           graphic buttons on the screen, pressing the left button on the
  205.           mouse and then releasing the left mouse button while the graphic
  206.           button on the screen is depressed.
  207.  
  208.           The only time keyboard interaction is required is when a filename
  209.           is needed to write source code to disk and to save or retrieve a
  210.           sprite.
  211.  
  212.                                                                           2
  213.  
  214.  
  215.  
  216.  
  217.  
  218.           7. THE PALETTE
  219.  
  220.           The palette area contains three different components.  At the top
  221.           of the palette area you will see three collections of color
  222.           blocks.
  223.  
  224.           The first row of colors is the standard 16 colors (0-15). The
  225.           second row of colors is the 16 shades of gray (16-31).  The rest
  226.           of the area is the full spectrum with varying hues, saturation
  227.           and intensities (32-248).
  228.  
  229.           Beneath the color blocks to the left is a rectangle containing
  230.           the foreground color.  The rectangle to the right of the
  231.           foreground color is the background color.
  232.  
  233.           To change the foreground color, position the mouse pointer on the
  234.           color you desire and press the left mouse button.  The same can
  235.           be done for the background color using the right mouse button.
  236.  
  237.           8. THE DRAWING PRIMITIVES
  238.  
  239.           The drawing primitive buttons are located near the top right side
  240.           of the screen.  If you initiate a primitive using the left mouse
  241.           button, it will be drawn in the current foreground color.  If you
  242.           initiate a primitive using the right mouse button, it will be
  243.           drawn in the current background color. The following is a
  244.           description of the drawing primitives and the functions that they
  245.           perform. 
  246.  
  247.           8.1 Draw
  248.  
  249.           This button places you in draw mode.  It allows you to manipulate
  250.           the sprite one pixel at a time.  To draw on the sprite, place the
  251.           mouse cursor in area 1, the zoomed sprite area, and hold down a
  252.           mouse button.  As you move the mouse cursor within the editing
  253.           area, pixels will be placed on the sprite in the relevant color
  254.           (left button is the foreground color, right button is the
  255.           background color).
  256.  
  257.  
  258.           8.2 Line
  259.  
  260.           This button places you in line draw mode.  It allows you to draw
  261.           lines within the sprite. To draw a line on the sprite, place the
  262.           mouse cursor in area 1 where you want to start the line. Then,
  263.           while pressing a mouse button move the cursor to where you want
  264.           the line to be drawn and release the button.  As you move the
  265.           mouse while holding down a mouse button, the line will be redrawn
  266.           to show you what a line to the current position would look like. 
  267.           This is known as "rubber banding" and is used where appropriate.
  268.  
  269.  
  270.  
  271.                                                                           3
  272.  
  273.  
  274.  
  275.  
  276.  
  277.           8.3 Circle
  278.  
  279.           This button places you in circle mode.  It allows you to draw
  280.           circles within the sprite.  To draw a circle on the sprite, place
  281.           the mouse cursor in area 1 where you want the circle to be
  282.           centered.  While pressing a mouse button, move the mouse cursor
  283.           away from the center point to expand the radius of the circle or
  284.           toward the center to contract the radius.  When you have the
  285.           desired radius release the mouse button.
  286.  
  287.           8.4 Rectangle
  288.  
  289.           This button places you in rectangle mode. It allows you to draw
  290.           rectangles within the sprite.  To draw a rectangle on the sprite,
  291.           place the mouse cursor in area 1 where you want one of the
  292.           corners of the rectangle to be drawn.  While pressing a mouse
  293.           button, move the cursor to where you want to place the opposite
  294.           corner of the rectangle.  When you have the rectangle in the
  295.           desired location release the mouse button.
  296.  
  297.           8.5 Solid Circles and Rectangles
  298.  
  299.           These buttons function just like the "hollow" version buttons
  300.           except the inside of the primitive is solid.
  301.  
  302.           8.6 Paint
  303.  
  304.           This button places you in paint mode. It allows you to "seed
  305.           fill" an area of the sprite.  To paint an area, position the
  306.           mouse cursor INSIDE of the area to be filled and click the
  307.           appropriate mouse button.
  308.  
  309.           Every pixel that is the same color as the color of the pixel on
  310.           which you clicked will be painted in the appropriate color up to
  311.           the point where the area clicked on meets another color. i.e.
  312.           this works like PC Paintbrush's paint.
  313.  
  314.           9. SPRITE POSITIONING FEATURES
  315.  
  316.           Near the middle, bottom-half of the screen you will see a few
  317.           buttons devoted to manipulating the position of the ENTIRE
  318.           sprite.  The following is a description of each of these buttons
  319.           and what they do:
  320.  
  321.           9.1. Up, Down, Left, Right
  322.  
  323.           These buttons rotate with wrap around the entire sprite in the
  324.           direction indicated on the button.  This is good for centering a
  325.           sprite or for making several positional changes required in
  326.           animation.
  327.  
  328.  
  329.  
  330.                                                                           4
  331.  
  332.  
  333.  
  334.  
  335.  
  336.           9.2. Rotate
  337.  
  338.           This button rotates the sprite 90 degrees clockwise.
  339.  
  340.           9.3. X-flip, Y-flip
  341.  
  342.           This button mirrors the sprite in the respective cartesian axis
  343.           with the origin being in the center of the sprite.
  344.  
  345.           9.4. Grid
  346.  
  347.           This button toggles a grid on and off.  The sprite grid can be
  348.           useful for placing pixels when a reference is needed for
  349.           counting.
  350.  
  351.           9.5. Tile
  352.  
  353.           This button toggles the tile mode on and off.  Some sprites will
  354.           be used to tile a background. The tile feature places the sprite
  355.           in a 3 by 3 matrix so that you can get an idea of how the sprite
  356.           will look when tiled with itself.
  357.  
  358.           9.6. Undo
  359.  
  360.           Hey, we all make mistakes. This key will undo the last
  361.           destructive action performed on the sprite.  That means you can't
  362.           undo a rotate (you wouldn't need to undo a rotate anyway).  But,
  363.           lets say you painted a sprite and it goofed up the sprite.  Just
  364.           press undo, immediately afterwards, and the sprite will be
  365.           restored. 
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.                                                                           5
  390.  
  391.  
  392.  
  393.  
  394.  
  395.           10. SAVING, LOADING AND SOURCING
  396.  
  397.           The following is a description of what the rest of the buttons
  398.           do:
  399.  
  400.           10.1 Pascal, C
  401.  
  402.           These buttons will write out a "const" declaration, in the
  403.           respective programming language, that contains data that can be
  404.           directly used with a Borland Language's PutImage.  The following
  405.           is the format of the source output for the languages
  406.           respectively:
  407.  
  408.                Pascal Source
  409.  
  410.                     Const { test.pas }
  411.                       Image: Array[1..1028] Of Byte = (
  412.                         31,0,31,0,
  413.                         0,0,0, ...
  414.                         ...,0,0,0
  415.                       );
  416.  
  417.                C Source
  418.  
  419.                     /* test.c */
  420.                     const unsigned char image[1028]={31,0,31,0,
  421.                         0,0,0,...
  422.                         ...,0,0,0
  423.                     };
  424.  
  425.           Sprites written out as source CANNOT be loaded from the source. 
  426.           You must use the load and save buttons described below.
  427.  
  428.           When you press the "Pascal" or "C" buttons, a simple dialog box
  429.           appears in the middle of the screen prompting you for a file
  430.           name.  You can edit the filename using common editing keys like
  431.           [Backspace], the left and right arrows, [Delete], [Home], [End]
  432.           and [Ctrl][Backspace] to clear the line out.
  433.  
  434.           Just enter the filename you wish to name the source as and press
  435.           enter. You can also click on the "Ok" button to write the source
  436.           or the "Cancel" button to abort.
  437.  
  438.           If a disk error occurs, a dialog box will appear stating the
  439.           problem and wait for you to press return or click on the "Ok"
  440.           button.
  441.  
  442.           10.2 Clear
  443.  
  444.           This button clears the sprite to the current background color. 
  445.           If you press this button by accident don't panic, just press the
  446.           "Undo" button.
  447.  
  448.                                                                           6
  449.  
  450.  
  451.  
  452.  
  453.  
  454.           10.3 Save, Load
  455.  
  456.           These buttons allow you to save and load, to and from disk the
  457.           sprites that you have created.  
  458.  
  459.           When you press the "Save" or "Load" buttons, a simple dialog box
  460.           appears in the middle of the screen prompting you for a file
  461.           name.  You can edit the filename using common editing keys like
  462.           [Backspace], the left and right arrows, [Delete], [Home], [End]
  463.           and [Ctrl][Backspace] to clear the line out.
  464.  
  465.           If you are saving the sprite, just enter the filename you wish to
  466.           name the sprite.  If you are loading a sprite, just enter the
  467.           filename of the sprite to be loaded. Then press [Enter]. You can
  468.           also click on the "Ok" button to continue or the "Cancel" button
  469.           to abort.
  470.  
  471.           If a disk error occurs, a dialog box will appear stating the
  472.           problem and wait for you to press return or click on the "Ok"
  473.           button.
  474.  
  475.           The format in which the sprites are saved is very simple. It is
  476.           just the raw data that is represented in the source output.  So,
  477.           if you wanted to store sprites on disk for using with Borland's
  478.           BGI PutImage function instead of storing the sprite in the
  479.           executable, all you need to do is allocate the memory, open the
  480.           file, read in the sprite and use the variable in the PutImage
  481.           function. Its just that simple!
  482.  
  483.           11. QUIT
  484.  
  485.           This button exits the program.  Be sure that you have saved your
  486.           work before exiting.
  487.  
  488.           12. GENERAL INFORMATION
  489.  
  490.           I threw this program together in one weekend, including the GUI,
  491.           and the SVGA mouse driver, so I would not be surprised if you
  492.           found a bug or two in it.  If you find that the program does not
  493.           function properly, please let me know.  I am a regular user of
  494.           CompuServe and you can send e-mail to me there at 76424,1521.
  495.  
  496.           Also, if you have any comments or suggestions, especially
  497.           negative ones, please feel free to relay them to me on either
  498.           CompuServe or at the address supplied below.
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.                                                                           7
  508.  
  509.  
  510.  
  511.  
  512.  
  513.           13. REGISTRATION
  514.  
  515.           If you find yourself using this program often then you need to
  516.           register it.  You can register this program by sending $10.00 to:
  517.  
  518.                               Curtis Keisler
  519.                               c/o Sprite Editor
  520.                               Rt. 2 Box 251-K
  521.                               Williston, SC 29853
  522.  
  523.  
  524.           Also, I would like it if you would drop me a suggestion or two
  525.           along with this filled out form, especially if you are NOT in the
  526.           USA and even if you don't register!
  527.  
  528.           (Please print)
  529.  
  530.  
  531.           Name ____________________________________________________________
  532.  
  533.           Address _________________________________________________________
  534.  
  535.           City ____________________________________________________________
  536.  
  537.           State ___________________________________________________________
  538.  
  539.           Zip _____________________________________________________________
  540.  
  541.           Country _________________________________________________________
  542.  
  543.           Where you obtained this program _________________________________
  544.  
  545.           _________________________________________________________________
  546.  
  547.           Comments  _______________________________________________________
  548.  
  549.           _________________________________________________________________
  550.  
  551.           _________________________________________________________________
  552.  
  553.           _________________________________________________________________
  554.  
  555.  
  556.  
  557.           Product                  Qty                      Total
  558.           ______________________   ____                     __________
  559.  
  560.           yc's Sprite Editor 1.0   ____  @ $10.00 per copy = __________
  561.  
  562.  
  563.           Have a nice day!
  564.  
  565.  
  566.                                                                           8