Blancmange's Files
Delphi Libraries
These libraries are written by me and are placed in the public domain.
- VMQMaths.pas (zipped) —
Vector, Matrix and Quaternion maths. The vector, matrix and quaternion
objects can be treated like records. The conventions used are mutually
consistent and are independent of left or right handedness. Column vector
notation is assumed. Column-major storage is also used, in order to be
directly compatible with OpenGL and to allow efficient assignment of
column vector components in matrices.
- HexSpace.pas (zipped) —
Defines a 'hex vector', useful for use in hex-mapped strategy games.
Supports basic vector arithmetic and the means to convert between hex space,
(isotropic) cartesian space and the ansisotropic space necessary for displaying
hex tiles that must have integral pixel dimensions. Features exquisite comments
and ASCII art.
Requires VMQMaths.pas
- RGBTypes.pas (zipped) —
Defines RGB, RGBA, BGR, BGRA colour triple and quad bytes and RGB and RGBA
floating point types. Each of the byte-per-channel formats can be converted
to many of the machine-word formats required by little-endian
platforms.
- LinearLight.pas (zipped) —
Converts between linear and nonlinear forms of RGB colours according to
the Rec 709 standard. Includes toe slope for noise reduction at low levels.
- VegeIFF.pas (zipped) —
IFF reader and writer for vegetables. Includes comments on making well
behaved IFF file formats and a procedure method to strip all but the first
FORM of an IFF file, assembling data from PROP chunks as necessary, thus
allowing even a simple one-FORM reader and writer to extract known data from
unknown FORM, CAT or LIST types.
- URList.zip —
Update Rectangle List. Merges update rectangles so that no area need be updated more
than once. The list of independent rectangles format does not guarantee perfect
conditioning, but is robust, quick and still facilitates a lazy kind of conditioning.
The horizontal and vertical bounds quantisation adjustment can be used to facilitate
list conditioning and efficient access to video memory. Contains two versions, one
for use with tRect (Windows), one for use with tSDL_Rect (SDL). The SDL version
depends on the SDL library, if only
for the SDL_Rect structure.
- ConfigRW.zip —
Config File Reader and Writer. Use this library to read and write human readable
configuration scripts. Supports the notion of nested blocks, the elements of which
may be manipulated in a similar fashion to a standard list object. Source lines,
their line numbers, comments and extra line spaces are separated from the code to
allow easy high-level parsing, but are retained for the purposes of error reporting
and preserving comments when writing back to a file or stream.
- ComboCalendar.zip —
A seriously overengineered Julian/Gregorian/civil calendar unit that represents dates
as a 64-bit Chronological Julian Day number. The tComboCal object features a rich
set of date string formatting tokens and a date string converter that interprets
a wide variety of short and long date formats (wholly numeric middle-endian formats
and implied century formats are excluded). The object also supports the ISO 8601
leap week calendar and Julian/Gregorian dates in year-month-day and
year-month-occurrence-weekday formats. I wrote this 11,000 line epic because
dealing with Delphi's floating point DateTime format was just too much hard work.
- ZLibDLL.zip —
Provides access to the functions in the zlib DLL, which happens to be lying around
anyway if you're using SDL_Image.
C Libraries
These libraries are written by me and are placed in the public domain.
- Global.zip —
A bunch of C and header files useful in nearly any C project:
- Sugar.h – Syntactic sugar. Defines the ASCII NUL character,
the NULL and INVALID pointer values (the latter is
useful for trashing pointer values in freed objects), the Boolean type, some
Boolean operators and the Assigned() and Unassigned() macros for safely testing a
pointer without the risk of changing it.
- AnnoMem.c, ~h – Annotated Memory allocation and tools for eliminating
memory leaks. Provides the AllocMem() and FreeMem() macros to allocate and free
blocks of memory augmented by a string that describes the block. RelabelMem()
can be used to give a higher level of meaning to a block allocated by a lower
level function. Depends on the SDL library,
particularly for the mutual exclusion control required for safe multithreading.
- SafeStr.c, ~h – Safe String handling. Provides a means to create, copy,
assign and concatenate strings represented by a pointer to char
without fear of string buffer overflow or NULL pointer intolerance. Case handling
functions work for the ISO 8859-1 character set.
- ErrMsg.c, ~h – Simple (as in crude) error status and message structure.
- ErrCodes.h – Defines a few error codes.
- WeeCOW.zip —
Wee Console Output Window.
WeeCOW takes a font image (a Windows BMP) that defines characters 32 to 127
and draws characters or lines of text to its own SDL Surface which is ultimately
blitted to where the user can see it. The size of the characters is determined
by the dimensions of the COWFont image.
Depends on the SDL library.
- C_URList.zip —
Update Rectangle List. Merges update rectangles so that no area need be updated more
than once. The list of independent rectangles format does not guarantee perfect
conditioning, but is robust, quick and still facilitates a lazy kind of conditioning.
The horizontal and vertical bounds quantisation adjustment can be used to facilitate
list conditioning and efficient access to video memory.
Depends on the SDL library, if only
for the SDL_Rect structure.
- SDLMisc.zip —
Just some vaguely handy functions for blitting tiled images and a rectangle clipping
function. Depends on the SDL library.
- CfgReadr.zip —
Line parser, block parser and keyword-and-value reading functions to read from
human readable configuration files. Most importantly, blocks from a config file
can be extracted and stored for later use. Thus a screen mode config block can be
interpreted immediately and the blocks that refer to graphics that must be
converted to the cuurent screen format can be interpreted later, when the
graphics system has been fully configured.
Toy applications
- ICM (zipped) —
Infinite Chattering Monkeys (see screenshot).
This progam plays multiple lists of WAV files, each list directed
to one or more channels of one or more sound cards. It was written to provide
sound for imformation kiosks in the Canterbury Museum. The program features:
- User defined Play and Stop keys for each play list;
- The ability to be configured even when the required sound hardware is not present;
- Saving and loading of device options, programme data and both together;
- Sound card device ID mapping to allow background music to be played independently
of programme tracks (requires a decent sound card – an SBLive! or an AC97 chipset
will do nicely);
- Play and Stop key indicators to test for keyboard ghosting or jamming;
- Automatic format conversion (but not rate conversion);
- Automatic start for unattended operation; and
- Shameless advertising for Fitznik.
- LCDTester (zipped) —
Displays a variety of test patterns. I wrote it in order to stress test an LCD
monitor I might be buying in case defective pixels were more sutble than the
always-on or always-off variety. This program features colour ramps, a fine chequer
pattern and a nice gamma test chart.
Depends on the SDL library.
- CalGen 1.1.0.0 (zipped) —
Web page calendar generator (see screenshot).
This program was designed to generate the event calendar used by the
Barony of Southron Gaard. Features include:
- Reasonably complex date patterns for events;
- Editable holidays and commemorative days;
- User-defined
Aliases
which expand to longer strings in the output;
- Julian, Gregorian, Civil and ISO 8601 Leap Week Calendar formats;
- Rich tagging of HTML output to facilitate extensive CSS customisation;
- Auto-save (and more importantly) Auto-backup;
- A
decimate
feature for auto-deleting 9 out of 10 backup files of each type;
Restore Mode,
which allows you to rummage through backups without being
annoyed by incessant confirmation popups and without fear of holding an external file
hostage to the Save and Save As commands;
- Strict HTML 4.01 and CSS 2.1 generation;
- Classic, grid-like calendar, detailed listing and next-future-event listing output; and
- The ability to run an external program, such as wput.
The zip file Includes the executable, Delphi source files, output examples, and
the library files VegeIFF.pas and
ComboCalendar.pas, both of which
are included in the zip.
- Ripples water tile generator —
This was my first Delphi project. It's a tool to render top-down views of
rippling water that tile seamlessly. It features:
- Environment mapping from a longitude-latitude map;
- The option to load a background image for the 'floor';
- Angle-dependent reflectivity and transmission;
- Linear light representation using floating point values for intensity.
- Rendering of wave caustics (though only wave slope rather than slope
and displacement);
- Cheesy camera filter simulation by means of convolution;
- Animation format and quality selection; and
- Shameless advertising for Fitznik.
- Celtic Knot Toy —
A simple editor for laying out and assembling Celtic knots from a small set of bitmaps for
the edge, line body, background line cutting mask and the bi-level mask that defines the
background/foreground status of the short diagonal line between knot crossing points.
Special features of this program include the ability to draw very fat knot lines and
the automatic selection of chooses circular arcs for knot lines that curve though 90
degrees or more.
BuggerIM Icons
I created a nice icon set originally for
BuggerIM, but have since extended it to go with Miranda IM, Psi, Gajim,
Pidgin and other instant messengers.
Donations
If you like the code Blancmange has offered to the public, you feel enlightened
by his vector maths notes, or you just think he's cool because he's got long hair
and a big willy, feel free to give him a
paypal donation.