F1RSTex; F1RS texture image extraction and replacement utility v1.2
-------------------------------------------------------------------

This program is Freeware. Use at your own risk. I do not accept any
responsibility for anything that may happen to your system.

Synopsis
========

F1RS implements each car's texture image as a 256 by 256 pixel
image containing all the parts of the car's surface stored as a 256
colour image, 8 bits per pixel. Thus each car can have it's own
palette of 256 colours.

The each car also shares another texture image of the same format
which contains parts of the car that are the same for all cars: the
wheels, engine parts, etc. However for each car this image uses the
car's palette. For this shared image to produce the correct colours
when displayed for each car, it uses only the top 63 colours of the
256 colour palette, and these 63 colours are expected to be the
same 63 colours in all 11 cars' palettes. Also, colour 193 is the
transparent colour, a pixel which is coloured with this transparent
colour will not be rendered. This is how F1RS draws a nice round
tyre from the side view - it just draws a big square where the
square around the round shape of the tyre is coloured with colour
193 and that does not get drawn.

F1RS likes to use bright purple as its transparent colour, with
red = 255, green = 0, blue = 255.

Thus only the lower 193 colours are  available for free selection
for each car's own texture colouring.

A new feature of F1RSTex v1.1 is that it will now recognise a 24
bit image and will automatically convert it down to 256 colours
with an appropriate palette in the process of inserting the new
image into F1RS. This process does take a few seconds, but it is a
good way of testing out your latest and greatest car paintjob in a
minimal amount of time. The 256 colour image is not saved to disk,
it is only temporary. If you actually want the 256 colour bmp file,
for instance if you are going to give other people your new painted
car texture, I recommend using my accompanying F1RSPal utility
which will convert your 24 bit image down to a new 256 colour bmp
file which is then easier (much smaller) to pass around.

The way each car's texture image is structured is different for
each car. The 3D models of each car have texture coordinates at
each vertex which refer to these triangles within these images. In
the current version of this utility nothing is done to alter these
texture coordinates, and thus each car image is somewhat fixed,
you can alter what you are given. This can be a pain, since some
cars have more panels, others less. Some panels on some cars are
symmetrical and thus are only in the texture image once, and this
panel is used on both sides of the car. If you try to draw a non-
symmetrical pattern into one of these panels, it will look correct
on one side of the car and back the front on the other.

So, unfortunately, the car painting process is not as good as it
could be yet, some cars will not be able to be painted how they
should be.

IMPORTANT: Please make sure you have backed up the
  F1RS\F1datab\Voitures\F1tdc.gar file before you go and mangle it
  with my program! Just in case, you can always just copy it back
  off the CD. As far as I am aware this program works, but I can't
  be held responsible if it goes and screws up the file or deletes
  your HD or tells your mother-in-law all your most embaressing
  secrets. I've tried to make sure it won't do anything unusual,
  but you never know!


Usage
=====

F1RSTex requires F1Crypt.dll version 1.2 by Martin Granberg. To
make sure F1RSTex is not finding earlier versions which aren't
entirely compatable, please make sure that the F1Crypt.dll in the
archive is in the same dir as you are running F1RSTex from. Thanks
Martin!!

To locate the F1RS dir:
-----------------------

  F1RSTex d f1rsdir

d:             Command that means "dir"

f1rsdir:       Location of the F1RS main directory.
    This is a required parameter.
    F1RSTex will then check to see if this dir is correct, and if
    it is, F1RSTex will create or update a file in the current
    directory called F1RSUtil.ini, where it will store this F1RS
    dir for future reference. This will save the need to
    continually put the F1RS dir on the command line like in
    F1RSTex v1.0.
    You don't have to put a \ on the end of the directory path.
    F1RSTex shares this file with F1RSCkpt.


To extract textures:
--------------------
(parameters in [square brackets] are optional)

  F1RSTex e [f1rsdir] number/all [filename]

e:             Command that means "extract"

f1rsdir:       Location of the F1RS main directory.
    This is an optional argument.
    This is the directory where you installed F1RS. If you have
    previously configured the F1RSUtil.ini with the F1RS dir
    already (with the "d" command), then this parameter can be
    left out since F1RSTex already knows where to find F1RS.
    If the F1RS dir is not specified either on the command line
    or in F1RSUtil.ini, then F1RSTex will try to find F1tdc.gar
    in the current directory.

number/all:    Image number to extract (0-11 or "all")
    This is a required argument.
    This tells F1RSTex which car texture to extract.
    Numbers 1 to 11 correspond to which car's image you want to
    extract. See the table at the bottom of this document to see
    which numbers correspond to which Teams.
    Number 0 is the common texture, which contains the wheel,
    various mechanical parts of the car, ground shadow, and other
    weird things.
    If you use the word "all" instead, F1RSTex will dump out all 12
    images in one go.
    If no [filename] is specified, F1RSTex will by default output
    the images as files called "carXX.bmp" where the XX is the
    car texture number, such as car00.bmp, car04.bmp, car11.bmp

filename:      Filename to save output bmp files as
    This is an optional argument.
    This isn't really the whole filename. F1RSTex will
    automatically attach "XX.bmp" to the end of this filename
    parameter, so in effect this parameter is just the start of
    the final bmp file's name. If you don't specify this parameter
    F1RSTex will use a default value of "car", thus producing the
    "car04.bmp" type of filenames.
    If you speficy, for example, a value of "frog" then F1RSTex
    will output bmp files named like "frog09.bmp".
    If you put a ".bmp" on the end of the filename parameter,
    F1RSTex will strip that off before using it. ie: if you used
    "frog.bmp" as the filename parameter, then F1RSTex will remove
    the .bmp part and will end up with "frog" and the results will
    be just like my previous example.


To replace textures:
--------------------

  F1RSTex r [f1rsdir] number/all [filename]

r:             Command that means "replace"

f1rsdir:       Location of the F1RS main directory.
    This is an optional argument.
    This is the directory where you installed F1RS. If you have
    previously configured the F1RSUtil.ini with the F1RS dir
    already (with the "d" command), then this parameter can be
    left out since F1RSTex already knows where to find F1RS.
    If the F1RS dir is not specified either on the command line
    or in F1RSUtil.ini, then F1RSTex will try to find F1tdc.gar
    in the current directory.

number/all:    Image number to replace (0-11 or "all")
    This is a required argument.
    This tells F1RSTex which car texture to replace.
    Numbers 1 to 11 correspond to which car's image you want to
    replace. See the table at the bottom of this document to see
    which numbers correspond to which Teams.
    Number 0 is the common texture, which contains the wheel,
    various mechanical parts of the car, ground shadow, and other
    weird things. Since this image should use ONLY the fixed part
    of the palette, colours 193 to 255, I suggest if you want to
    edit this image that you edit in 256 colour mode to ensure that
    you don't go and start using colours that are out of this
    range.
    If you use the word "all" instead, F1RSTex will try to replace
    all 12 images in one go. It will expect to find the files
    filename00.bmp through to filename11.bmp in the current dir,
    but it's OK if some are not there - F1RSTex will replace just
    the images it can find, and leave any missing ones as they
    were. This is handy if you are just replacing a selected
    number of cars at once.
    If no [filename] is specified, F1RSTex will by default try to
    load the images as files called "carXX.bmp".

filename:      Filename of bmp files to load
    This is an optional argument.
    This isn't really the whole filename, although it can be.
    If you are replacing just one single car texture, F1RSTex will
    not attach "XX.bmp" to the rest of the filename like it
    usually does - this is the one situation where it will only
    make sure that the filename ends in ".bmp". This allows you
    to load any bmp at all into F1RS. So if for example you want
    used "F1RSTex r 6 car03" it would work fine, and not try to
    load a file called "car0306.bmp"
    However if you don't specify this filename while replacing a
    single image, F1RSTex will still look for "carXX.bmp" by
    default, where XX is the number of the car texture you are
    replacing.
    If you are replacing all images, F1RSTex will automatically
    attach "XX.bmp" to the end of this filename parameter.
    If you put a ".bmp" on the end of the filename parameter,
    F1RSTex will strip that off before using it.


Reference: number to F1 team table
==================================

   number      team

      0        common textures
      1        Benneton
      2        Ferrari
      3        Williams
      4        Arrows
      5        Forti
      6        Ligier
      7        Jordan
      8        McLaren
      9        Minardi
     10        Sauber
     11        Tyrrell

*Note: The order of these images in F1tdc.gar are jumbled. They
don't match the order of the teams anywhere else. So you will
notice that this list does not match the order of teams in the
game, and neither does it match the order of teams in the cockpit
image data file.


History
=======

V1.2     31/3/1998
  * Fixed a totally pathetic little bug that would cause a screwup
    if you used a long path for the [filename] parameter, eg:
      F1RSTex r 1 q:\this\is\a\really\long\path\fiat_bambino.bmp

V1.1     29/3/1998
  * Rewrote the command line interface.
  * Added support for F1RSUtil.ini to store the F1RS dir.
  * Added error checking for incorrectly sized .bmp files.
  * Included the 24bit->8bit image reduction algorithm from
    F1RSPal so that F1RSTex can handle both 8bit and 24bit .bmps
  * Uses F1Crypt v1.2 now.

V1.0     19/1/1998
    First release.


Contact details
===============

Author: Grant Reeve
Email:  magefire@ihug.co.nz
