jka@niksula.hut.fi (Jari Petri Karjala) (04/15/91)
We are designing a general purpose library of sprite routines. As a product of the design we have produced a document which describes a proposed format for storing sprite data in a disk file and an application programming interface for basic sprite functions. The document also describes some of the problems with various sprite implementations and possible solutions. The document describes the subject in quite a hardware independent way, but our emphasis is towards PC environment and thus software sprites. The actual source code needed to display the sprite, video mode manipulation etc is NOT included (or even written, yet). We are now seeking for comments from the Net community. The whole document is not included in this article, only the table of contents. If you are interested in the subject, send us mail and we'll send you the whole document. The next goal of our project will be to actually implement this sprite library for use with both C and (turbo)pascal in PC environment. This library would be released as FreeWare package. Authors: J.C. Kessels Philips de Goedelaan 7 5615 PN Eindhoven The Netherlands jeroenk@cnps.philips.nl J.P. Karjala Veropellontie 11 00780 Helsinki Finland jka@niksula.hut.fi The Table of Contents (3rd level omitted): 1. Sprites: an analysis. . . . . . . . . . . . . . . . . . 1 1.1. What is a sprite. . . . . . . . . . . . . . . . . 1 1.2. Displaying a sprite. . . . . . . . . . . . . . . . 2 1.3. Sprite flicker. . . . . . . . . . . . . . . . . . 6 1.4. Flicker reduction methods. . . . . . . . . . . . . 8 1.5. Storage of sprites on disk. . . . . . . . . . . . 11 2. Kessels Karjala Knapsack (KKK) proposal. . . . . . . . 15 2.1. Construction of KKK file. . . . . . . . . . . . . 15 2.2. KKK Application Programmers Interface. . . . . . . 18 3. Sprite LiBrary (SLB) format proposal. . . . . . . . . . 22 3.1. KKK data field definitions. . . . . . . . . . . . 23 3.2. Initialize sprite system. . . . . . . . . . . . . 30 3.3. Create and delete sprites. . . . . . . . . . . . . 31 3.4. Display sprites. . . . . . . . . . . . . . . . . . 36 3.5. Get or Set sprite information. . . . . . . . . . . 43 3.6. Collision detection. . . . . . . . . . . . . . . . 45 3.7. Program layout. . . . . . . . . . . . . . . . . . 47 Appendix A. The sprite library project. . . . . . . . . . 48 Appendix B. The SPRITE data type. . . . . . . . . . . . . 49 Appendix C. Lists. . . . . . . . . . . . . . . . . . . . 52 1. The list datatype. . . . . . . . . . . . . . . . . 52 2. Insert item into list. . . . . . . . . . . . . . . 54 3. Drop item from list. . . . . . . . . . . . . . . . 54 4. Move item to "here". . . . . . . . . . . . . . . . 55 5. Goto top of list. . . . . . . . . . . . . . . . . 55 6. Goto bottom of list. . . . . . . . . . . . . . . . 56 7. Get next item from list. . . . . . . . . . . . . . 56 8. Get previous item from list. . . . . . . . . . . . 57 9. Count items in list. . . . . . . . . . . . . . . . 57