Flamewarder of Hypothermia Presents ùÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù ³ G D Z Algorithm ³ ùÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù Hey! Who needs yet another graphics storage format? Well, I do, for instance. And every other guy who wants to make games without giving everyone access to their artwork by saving it in PCX or RAW format. Well, the best way to pro- tect your data is to compress it like nobody has ever done. And that's why I bring you GDZ. And aside from that, GDZ beats PCX more often than not in data compression and decoding speed. The biggest difference I have recorded is a 320x200 raster of colors 254 and 255, which was 128kb in PCX and about 500 bytes as GDZ. The best possible advantage for PCX is about 64kb vs 96kb. If your data has gradients, ornamentals or such, GDZ bests PCX hands down. GDZ saving might take a while, but loading is fast like any other format. Files included: FILE_ID.DIZ GFXCONV.EXE GFXCONV.CPP C++ 3.0 Source code of GFXCONV.EXE GFXIOL.H C++ 3.0 Header file for the LIB GFXIOL.LIB C++ 3.0 LIB to load and save graphics (Large Model) README.TXT This file *.PCX PCX files *.GDZ GDZ files *.GDT GDT files *.RAW RAW files *.PAL Palette data files for GDT and GDZ I have included 2 pictures in all formats for you to compare. They are drawn before I coded GDZ, so they are not GDZ optimized. You might ask how to use the LIB in your productions. Well, look GFXCONV through. It was quite hastily done, and there are few comments. Anyhow, it should be pretty self-explaining. Let's make it simple: to load a picture you need 64000 bytes allocated memory (or screen adapter). There are four functions to load graphics and three to save them: load_pcx(char near*filename,char far*data) load_gdt(char near*filename,char far*data) load_gdz(char near*filename,void far*data) load_raw(char near*filename,char far*data) save_gdt(char near*filename,char far*data) save_gdz(char near*filename,void far*data) save_raw(char near*filename,char far*data) These functions return 0 when succesful. In addition, there are palette handling functions: loadpalette(char near*filename); savepalette(char near*filename); setpal(int); fadein(); fadeout(); There is an external table: char palette[768] which has all R G B values stored in it. load- and savepalette load and save this table with specified name. setpal outputs the palette into VGA DAC, parameter being a brightness factor. 255 is the normal setting. So, if you'd like to display a PCX image on screen: char far*screen=(char far*)MK_FP(0xa000,0); load_pcx("pcx.pcx",screen); setpal(255); // or fadein(); The same goes for GDT and GDZ files. They do not have a palette specified in their own files, so if you have many pics of same palette you'll only need one palette file. All functions assume their format's logical extension, so you do not need to type PICTURE.PCX. PICTURE is enough. All loaders load from current directory only. GDZ and GDT loaders try to load a palette file with the same name (except for the extension). File not founds are ignored with palette loading. If you have one global palette file, you can name it as PALETTE.DAT (for example), load it after you've changed your screen mode, and you don't need any more palette files. Note! When saving GDT and GDZ files, the converter automatically saves palette file with the same name as the GDT/GDZ file and extension .PAL And the legal stuff.. IMPORTANT!! I grant you a license to use GFXIO library in your productions in any way you want as long as you credit me for GFX packing (if you use my formats, GDT or GDZ) or GFX loader (if you use RAW or PCX). Note that PCX is (C) by ZSoft. If you are making a shareware game, I would appreciate a free registration. That is only fair, since all guys who have done something in the making of the game get at least a free copy.. you can keep the profit for yourself for all I care. At least EMail me, if possible: vnorilo@netti.fi (At the time being) Address where you can send cars, money and SGI supercomputers: Vesa Norilo Hiidenkivent. 17C 04200 Kerava BTW! If you are interested in my graphic routines, email or snail me and ask.. Oh. I almost forgot. Graphics are drawn in DeluxePaint ][ Enchanted. And code written in Borland C++ 3.0 and Borland TASM 4.0.