home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
progmisc
/
ycsped10.zip
/
SPRITED.DOC
< prev
next >
Wrap
Text File
|
1993-03-16
|
21KB
|
566 lines
│ │ ┌──┐
└──┤ │ 's
──┘ └──┘
Sprite Editor 1.0
Copyright 1993 by Curtis Keisler
TABLE OF CONTENTS
1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . 1
2. ACKNOWLEDGMENTS . . . . . . . . . . . . . . . . . . . . . 1
3. DISCLAIMER . . . . . . . . . . . . . . . . . . . . . . . . 1
4. GETTING STARTED . . . . . . . . . . . . . . . . . . . . . 1
5. SCREEN LAYOUT . . . . . . . . . . . . . . . . . . . . . . 2
6. HOW TO USE THE PROGRAM . . . . . . . . . . . . . . . . . . 2
7. THE PALETTE . . . . . . . . . . . . . . . . . . . . . . . 3
8. THE DRAWING PRIMITIVES . . . . . . . . . . . . . . . . . . 3
8.1 Draw . . . . . . . . . . . . . . . . . . . . . . . . 3
8.2 Line . . . . . . . . . . . . . . . . . . . . . . . . 3
8.3 Circle . . . . . . . . . . . . . . . . . . . . . . . 4
8.4 Rectangle . . . . . . . . . . . . . . . . . . . . . 4
8.5 Solid Circles and Rectangles . . . . . . . . . . . . 4
8.6 Paint . . . . . . . . . . . . . . . . . . . . . . . 4
9. SPRITE POSITIONING FEATURES . . . . . . . . . . . . . . . 4
9.1. Up, Down, Left, Right . . . . . . . . . . . . . . . 4
9.2. Rotate . . . . . . . . . . . . . . . . . . . . . . 5
9.3. X-flip, Y-flip . . . . . . . . . . . . . . . . . . 5
9.4. Grid . . . . . . . . . . . . . . . . . . . . . . . 5
9.5. Tile . . . . . . . . . . . . . . . . . . . . . . . 5
9.6. Undo . . . . . . . . . . . . . . . . . . . . . . . 5
10. SAVING, LOADING AND SOURCING . . . . . . . . . . . . . . 6
10.1 Pascal, C . . . . . . . . . . . . . . . . . . . . . 6
10.2 Clear . . . . . . . . . . . . . . . . . . . . . . . 6
10.3 Save, Load . . . . . . . . . . . . . . . . . . . . 7
11. QUIT . . . . . . . . . . . . . . . . . . . . . . . . . . 7
12. GENERAL INFORMATION . . . . . . . . . . . . . . . . . . . 7
13. REGISTRATION . . . . . . . . . . . . . . . . . . . . . . 8
i
1. INTRODUCTION
yc's Sprite Editor is a tool that aids the gaming programmer in
designing sprites used video games for the IBM PC compatible. It
lets you create 32x32x256 color sprites for use in C and Pascal
programs (assembler too!).
The requirements are a SVGA graphics adapter capable of
640x480x256 color in either Vesa, Trident or Video7 mode, a
Microsoft compatible mouse, at least 512k memory and a little
disk space for storing sprite files and/or source code.
I wrote this program to help me in creating sprites for several
games that I am writing. I thought that it would be nice to
provide this tool to other game designers faced with the same
task.
This program has a surprisingly high level of functionality. It
provides simple drawing primitives such as bit level
manipulation, line drawing, circles, rectangles, filled circles,
filled rectangles, flood filling, x and/or y axis mirroring, 90
degree rotations, and a tiled view. It also has an undo feature,
saving, loading, and C and Pascal "const" source output.
2. ACKNOWLEDGMENTS
Thanks to Borland International for providing such great
programming environments. This program was written using Borland
Pascal 7.0. I also use their C++ compiler and I highly recommend
ANYTHING that Borland produces.
Thanks to Steve Holley for requesting of me to write this program
in the first place.
Thanks to Michael Day of Knight Software, P.O. Box 22902,
Milwaukie, OR 97222, CIS [70007,4645] or [73577,2225] for
developing the 640x480x256 BGI's that I used to write this
program. BGI256 V3.00 as of 22 Dec 1992 is Copyright (c)
1991,1992 by Knight Software.
3. DISCLAIMER
If this program kills your computer its not my fault. By running
this program on your computer you are willingly releasing me, the
author, from any responsibility for loss.
4. GETTING STARTED
If you have a Vesa compatible SVGA card all you need to do is
type "sprited". For Trident or Video7 compatibility, type
"sprited TRIDENT" or "sprited VIDEO7" respectively.
1
5. SCREEN LAYOUT
┌───────────────────────┬────────────────────────────┐
│ │ ╔═══════════════╗ ╔═════╗│
│ │ ╚═══════════════╝ ╠═════╣│
│ │ ╠═════╣│
│ │ ┌───┐ ╠═════╣│
│ │ │ 3 │ ╠═════╣│
│ 1 │ └───┘ ╠═════╣│
│ │ ╠═════╣│
│ │ ╠═════╣│
│ │ 4┌────────┐ ╚═════╝│
│ │ └────────┘ 5 │
│ │ ╔═════╗ ╔═════╗ ╔═════╗│
├───────────────────────┤ ╠═════╣ ╠═════╣ ╠═════╣│
│ │ ╠═════╣ ╠═════╣ ╠═════╣│
│ │ ╠═════╣ ╠═════╣ ╠═════╣│
│ │ ╠═════╣ ╠═════╣ ╠═════╣│
│ 2 │ ╚═════╝ ╠═════╣ ╠═════╣│
│┌──────────┐┌─────────┐│ ╠═════╣ ╠═════╣│
│└──────────┘└─────────┘│ ╚═════╝ ╚═════╝│
└───────────────────────┴────────────────────────────┘
(1) This area contains a zoomed version of the sprite. This
area is where ALL of the editing takes place.
(2) This area contains the color palette. This is the resident
palette so no special provisions are necessary for re-
displaying the sprite in your programs, i.e. you don't need
to load and save palettes!
(3) This area shows the actual size of the sprite and reflects
exactly what is represented in area 1.
(4) This area displays in text the current editing mode. This
describes the action that will be taken if the mouse is
clicked inside of area 1, the sprite editing area.
(5) This area contains the buttons that represent various
actions that can be performed on the sprite.
6. HOW TO USE THE PROGRAM
Options are made by positioning the mouse cursor on one of the
graphic buttons on the screen, pressing the left button on the
mouse and then releasing the left mouse button while the graphic
button on the screen is depressed.
The only time keyboard interaction is required is when a filename
is needed to write source code to disk and to save or retrieve a
sprite.
2
7. THE PALETTE
The palette area contains three different components. At the top
of the palette area you will see three collections of color
blocks.
The first row of colors is the standard 16 colors (0-15). The
second row of colors is the 16 shades of gray (16-31). The rest
of the area is the full spectrum with varying hues, saturation
and intensities (32-248).
Beneath the color blocks to the left is a rectangle containing
the foreground color. The rectangle to the right of the
foreground color is the background color.
To change the foreground color, position the mouse pointer on the
color you desire and press the left mouse button. The same can
be done for the background color using the right mouse button.
8. THE DRAWING PRIMITIVES
The drawing primitive buttons are located near the top right side
of the screen. If you initiate a primitive using the left mouse
button, it will be drawn in the current foreground color. If you
initiate a primitive using the right mouse button, it will be
drawn in the current background color. The following is a
description of the drawing primitives and the functions that they
perform.
8.1 Draw
This button places you in draw mode. It allows you to manipulate
the sprite one pixel at a time. To draw on the sprite, place the
mouse cursor in area 1, the zoomed sprite area, and hold down a
mouse button. As you move the mouse cursor within the editing
area, pixels will be placed on the sprite in the relevant color
(left button is the foreground color, right button is the
background color).
8.2 Line
This button places you in line draw mode. It allows you to draw
lines within the sprite. To draw a line on the sprite, place the
mouse cursor in area 1 where you want to start the line. Then,
while pressing a mouse button move the cursor to where you want
the line to be drawn and release the button. As you move the
mouse while holding down a mouse button, the line will be redrawn
to show you what a line to the current position would look like.
This is known as "rubber banding" and is used where appropriate.
3
8.3 Circle
This button places you in circle mode. It allows you to draw
circles within the sprite. To draw a circle on the sprite, place
the mouse cursor in area 1 where you want the circle to be
centered. While pressing a mouse button, move the mouse cursor
away from the center point to expand the radius of the circle or
toward the center to contract the radius. When you have the
desired radius release the mouse button.
8.4 Rectangle
This button places you in rectangle mode. It allows you to draw
rectangles within the sprite. To draw a rectangle on the sprite,
place the mouse cursor in area 1 where you want one of the
corners of the rectangle to be drawn. While pressing a mouse
button, move the cursor to where you want to place the opposite
corner of the rectangle. When you have the rectangle in the
desired location release the mouse button.
8.5 Solid Circles and Rectangles
These buttons function just like the "hollow" version buttons
except the inside of the primitive is solid.
8.6 Paint
This button places you in paint mode. It allows you to "seed
fill" an area of the sprite. To paint an area, position the
mouse cursor INSIDE of the area to be filled and click the
appropriate mouse button.
Every pixel that is the same color as the color of the pixel on
which you clicked will be painted in the appropriate color up to
the point where the area clicked on meets another color. i.e.
this works like PC Paintbrush's paint.
9. SPRITE POSITIONING FEATURES
Near the middle, bottom-half of the screen you will see a few
buttons devoted to manipulating the position of the ENTIRE
sprite. The following is a description of each of these buttons
and what they do:
9.1. Up, Down, Left, Right
These buttons rotate with wrap around the entire sprite in the
direction indicated on the button. This is good for centering a
sprite or for making several positional changes required in
animation.
4
9.2. Rotate
This button rotates the sprite 90 degrees clockwise.
9.3. X-flip, Y-flip
This button mirrors the sprite in the respective cartesian axis
with the origin being in the center of the sprite.
9.4. Grid
This button toggles a grid on and off. The sprite grid can be
useful for placing pixels when a reference is needed for
counting.
9.5. Tile
This button toggles the tile mode on and off. Some sprites will
be used to tile a background. The tile feature places the sprite
in a 3 by 3 matrix so that you can get an idea of how the sprite
will look when tiled with itself.
9.6. Undo
Hey, we all make mistakes. This key will undo the last
destructive action performed on the sprite. That means you can't
undo a rotate (you wouldn't need to undo a rotate anyway). But,
lets say you painted a sprite and it goofed up the sprite. Just
press undo, immediately afterwards, and the sprite will be
restored.
5
10. SAVING, LOADING AND SOURCING
The following is a description of what the rest of the buttons
do:
10.1 Pascal, C
These buttons will write out a "const" declaration, in the
respective programming language, that contains data that can be
directly used with a Borland Language's PutImage. The following
is the format of the source output for the languages
respectively:
Pascal Source
Const { test.pas }
Image: Array[1..1028] Of Byte = (
31,0,31,0,
0,0,0, ...
...,0,0,0
);
C Source
/* test.c */
const unsigned char image[1028]={31,0,31,0,
0,0,0,...
...,0,0,0
};
Sprites written out as source CANNOT be loaded from the source.
You must use the load and save buttons described below.
When you press the "Pascal" or "C" buttons, a simple dialog box
appears in the middle of the screen prompting you for a file
name. You can edit the filename using common editing keys like
[Backspace], the left and right arrows, [Delete], [Home], [End]
and [Ctrl][Backspace] to clear the line out.
Just enter the filename you wish to name the source as and press
enter. You can also click on the "Ok" button to write the source
or the "Cancel" button to abort.
If a disk error occurs, a dialog box will appear stating the
problem and wait for you to press return or click on the "Ok"
button.
10.2 Clear
This button clears the sprite to the current background color.
If you press this button by accident don't panic, just press the
"Undo" button.
6
10.3 Save, Load
These buttons allow you to save and load, to and from disk the
sprites that you have created.
When you press the "Save" or "Load" buttons, a simple dialog box
appears in the middle of the screen prompting you for a file
name. You can edit the filename using common editing keys like
[Backspace], the left and right arrows, [Delete], [Home], [End]
and [Ctrl][Backspace] to clear the line out.
If you are saving the sprite, just enter the filename you wish to
name the sprite. If you are loading a sprite, just enter the
filename of the sprite to be loaded. Then press [Enter]. You can
also click on the "Ok" button to continue or the "Cancel" button
to abort.
If a disk error occurs, a dialog box will appear stating the
problem and wait for you to press return or click on the "Ok"
button.
The format in which the sprites are saved is very simple. It is
just the raw data that is represented in the source output. So,
if you wanted to store sprites on disk for using with Borland's
BGI PutImage function instead of storing the sprite in the
executable, all you need to do is allocate the memory, open the
file, read in the sprite and use the variable in the PutImage
function. Its just that simple!
11. QUIT
This button exits the program. Be sure that you have saved your
work before exiting.
12. GENERAL INFORMATION
I threw this program together in one weekend, including the GUI,
and the SVGA mouse driver, so I would not be surprised if you
found a bug or two in it. If you find that the program does not
function properly, please let me know. I am a regular user of
CompuServe and you can send e-mail to me there at 76424,1521.
Also, if you have any comments or suggestions, especially
negative ones, please feel free to relay them to me on either
CompuServe or at the address supplied below.
7
13. REGISTRATION
If you find yourself using this program often then you need to
register it. You can register this program by sending $10.00 to:
Curtis Keisler
c/o Sprite Editor
Rt. 2 Box 251-K
Williston, SC 29853
Also, I would like it if you would drop me a suggestion or two
along with this filled out form, especially if you are NOT in the
USA and even if you don't register!
(Please print)
Name ____________________________________________________________
Address _________________________________________________________
City ____________________________________________________________
State ___________________________________________________________
Zip _____________________________________________________________
Country _________________________________________________________
Where you obtained this program _________________________________
_________________________________________________________________
Comments _______________________________________________________
_________________________________________________________________
_________________________________________________________________
_________________________________________________________________
Product Qty Total
______________________ ____ __________
yc's Sprite Editor 1.0 ____ @ $10.00 per copy = __________
Have a nice day!
8