*****************************************************************************

  bmp2map  - A conversion utility to quickly convert 256 color .BMPs
   v.06      into Quake .MAPs complete with texturing and entities.
             Originally written to convert 2D floor/street plans
             into 3D maps.

    Author - Jack Perdue (aka Silicon Slick) - si_slick@cy-net.net
      Date - May 10th, 1997 v.01
             June 13th, 1997 v.02
             July 5th, 1997 v.03
             July 11th, 1997 v.04
             July 22nd, 1997 v.05
             August 23rd, 1997 v.06
  Compiler - Borland TurboC 2.0 for MS-DOS

Copyright(C) 1997 - Silicon Slick's Software, Supplies and Support Services
         http://www2.cy-net.net/~si_slick  si_slick@cy-net.net

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

                 "Quake" is copyright id Software

      The lastest version of this program should be available at either:

                http://www2.cy-net.net/~si_slick/bmp2map/       
       ftp://ftp.cdrom.com/pub/idgames2/utils/level_edit/converters/

*****************************************************************************

    What's new in v.06

    - changed .BMP initialization routine to skip palette entries using the offset
      in the file header as opposed to relying upon the palette in the info header.
      This fixes a problem that is caused by some paint programs not including 
      palette information (eg. number of colors) in the info header.  
      (Thanks to Dirk for pointing out this problem.)
    - cleaned up the code a bit -- cleared out the deadwood.  This should make
      it easier to port to non-DOS environments
    - changed Copyright to "Copyleft".  See GPL.TXT for details.
    - Note: Okay, I orginally said this when I released v.01, but I think I mean
      it this time -- this will be as far as I take this program in its current
      form (except for bug fixes).  I've finished the project I developed it for ( see:
      http://www.cs.tamu.edu/people/jkp2866/BrightCTF/ ) and summer is pretty
      much over so I have to return to the real world. :(  However, when 
      time becomes available, I plan to rewrite the whole thing using a more
      object oriented approach.  For me, this means refining my C++ skills.
      For you, the user, this will mean a much more customizable BMP2MAP.
      That is, instead of being limitted to certain brush types (eg. doors/windows/walls)
      and having limitted control over entity spawnflags, I plan redesigning
      the whole entity/brush definition mechanism so that the user can have more
      control over what is possible.  This will allow, among other things, areas
      with different ceiling/floor heights and the ability to use "prefabs".
      I have no idea when I might have a chance to do this, and I do want to make
      sure I have a solid design of what the program should be before starting
      on the code, so don't look for it anytime soon.  In the meantime, if you
      encounter any bugs with the current version, please let me know, and I'll
      fix them as time makes itself available.  Thanks to all of you who have sent 
      feedback.  I've really enjoyed making this program and I hope that the hundreds
      of people who have downloaded it from my web site (I have no idea how many people
      have downloaded it from ftp.cdrom.com) have found it useful.  
      And, of course, my sincere thanks to id Software for being so open
      with the building blocks for making Quake levels.  Without them, none of
      this would have been possible.  I'm more convinced than ever that the road
      to success in the gaming industry is best maintained by letting the users
      fill in the potholes and setting up detours to their hearts desire.
      Gib'em!!! -- jack (aka Silicon Slick) / si_slick@cy-net.net - 8/23/97

    What's new in v.05?

    - changed the way walls are written.  Now writes a brush from
      the floor to the window bottom, from the window bottom to the
      lower of door/window top, from the lower of door/window top
      to the higher of door/window top, from the higher of door/window
      top to the ceiling.  This has provided a 40% reduction in the
      final brush count of the maps I'm creating (actually, the sample's
      brush count has gone up by 20, so YMMV).  The downside is
      that there are a lot more brushes to compress which detracts
      from the benefits of ...
    - improved brush compression strategy.  Now starts at 64 brushes
      in memory and increases it as needed.  This can be changed using
      the membrushes tag in the .CFG.  Seperated wall brushes (.MP3)
      from everything else (.MP1).  Does one pass compression as brushes
      are read and then a multi pass compression after that point.
      All in all, it's much faster considering the increased brush
      count from above.
    - added sealtopbottom flag for .CFG file.  Set to 0 if you don't
      want a ceiling/floor tacked on to the .MAP.
    - added time started/ended and duration output
    - added logging - most of the output (everything but the repetitive
      brush compression messages) to the console is now echoed
      to <mapname>.LOG.  Each session is appended, so you'll want to
      delete this file on occastion.
    - comments can be placed in the .CFG file now.  Any line beginning
      with a semi-colon (;) will be ignored.
    - and of course... a revised sample
      SAMPLE5.BMP is the same as SAMPLE.BMP from v.04
      SAMPLE5.CFG is much more informative (thanks to comments)
      SAMPLE5.MAP is 340 brushes instead of 323 like v.04's (???)
      SAMPLE5.BSP is the new .BSP from the new .MAP
      SAMPLE5.LOG is the log file generated by BMP2MAP

    What's new in v.04?

    - support for over 40,000 brushes (brush compression on the fly)
    - modified command line
    - eliminated default pixel colors - they must be defined in the .CFG now
    - yet another sample revision with revised .WAD (added sliplite)

    What's new in v.03?

    - bug fix (unchecked array index was trashing memory)
    - teleport destination platforms
    - arrow texture alignment enhancement
    - documentation of features undocumented in last release
    - skyed ceilings (thanks to Excalibur/Curt for this suggestion)
    - CD track/map name
    - worldspawn flag
    - revised sample to show newest features
    - new .WAD (added tele_top)

    What's new in v.02?

    - support for entities
    - default lighting level
    - more control flags (joinents and sealsides)
    - arrow textures on ceiling for CTF
    - carving and trigger textures
    - alternate texturing for door and window frames
    - better configuration checking (still not great)
    - a new sample


    USE: Copy bmp2map.exe to the subdirectory containing the bitmaps
         you want to convert.  .BMPs must be 8-bit (256 color)
         and must be uncompressed (not .RLE).

         Create a .CFG to control the conversion process (details below).
         You can use SAMPLE.CFG as a base.

         The command line is:

                  BMP2MAP <name1.BMP> [<name2.CFG>]

         The .CFG name is optional.  If provided, the output files
         (.MAP and .EN1) will use name2.  Otherwise, they'll use
         name1.  BMP2MAP will first attempt to load configuration
         data from name2.CFG (if provided).  Failing that, it will
         try name1.CFG.  Failing that, it will try BMP2MAP.CFG.
         Failing that, it will quit.

         You _must_ edit the .CFG file to control how the
         conversion is done.  Simply change the value of the
         keys described below.  Important keys include
         the palette indices to use for doors/walls/sky etc.
         You'll need to use a paint program to determine
         the palette index of the colors used.

         The wadfile name is easiest set by looking at a previously
         created .MAP file on your system.

         If you use the autolight, make sure to set the interval
         appropriately.  8000 lights in a level tends to croak
         some editors.

 arrowtexturequnits - size of red/blue arrow textures in Quake units
          autolight - If 1, spread some lights around the level.  If 0, don't.
    autolightqunits - defines spacing, in Quake units, between lights
          autostart - If 1, put an info_player_start in the center of the map
   bluearrowtexture - name of texture for blue arrows (eg. BARROW)
 blueeastarrowcolor - palette index of blue arrow point east
bluenortharrowcolor -  "" north
bluesoutharrowcolor - "" south
 bluewestarrowcolor - ""west
  carveceilingcolor - create a brush to carve a hole in the ceiling
     carvebothcolor - like ceiling but also floor
    carvefloorcolor - like ceiling but for floor
            cdtrack - CD track number to play when map starts
            ceiling - Quake coordinates for the ceiling (eg. 64)
     ceilingtexture - Quake texture to use for the ceiling (eg. CEILING1_3)
          doorcolor - palette index of color used to represent doors
     doorframecolor - framed doorway sans door brush
        doortexture - Quake texture to use for doors (eg. DOOR02_03)
            doortop - Quake coordinates for level of door tops (eg. 48)
             entity - entity color,name (eg. entity=104,item_rockets)
              floor - Quake coordinates for the floor (eg. -64)
       floortexture - Quake texture to use for the floor (eg. AFLOOR1_8)
       frametexture - texture for top/bottom of window/door frame brushes
         joinentmap - if 1, copy entity (.EN1) file to end of .MAP file
         lightlevel - intensity for individual light entities put into level
            mapname - level start msg (underscores in name replaced with spaces)
         membrushes - max # of brushes in mem - smaller = quicker compression
        outerqunits - thickness of ceiling,floor and sealing walls (if used)
       qunitsperpel - controls the number of Quake units for each pixel (eg. 16)
    redarrowtexture - name of texture for red arrows (eg. RARROW)
  redeastarrowcolor - palette index of red arrow point east
 rednortharrowcolor -  "" north
 redsoutharrowcolor - "" south
  redwestarrowcolor - ""west
          sealsides - if 1, write wall of sky around level
      sealtopbottom - if 1, write floor/ceiling brushes
    skyceilingcolor - texture ceiling with sky
         skytexture - Quake texture to use for sky (eg. SKY4)
        skywincolor - palette index of color used for windows filled with sky
  teleplatformcolor - palette index for teleport destination platforms
teleplatformtexture - texture for teleport destination platforms
teleplatformtexturequnits
                    - size, in Quake units, of teleport destination texture
       triggercolor - palette index to represent trigger brushes
            wadname - name of .WAD file the textures can be found in
          wallcolor - palette index of color used to represent walls
        walltexture - Quake texture to use for walls (eg. TECH03_2)
           wincolor - palette index of color used to represent empty windows
       windowbottom - Quake coordinates for level of window bottom (eg. -24)
          windowtop - Quake coordinates for level of window top (eg. 24)
         worldspawn - if 1, enclose brushes in "worldspawn"

    Once your map is created, just load it into your favorite editor
    to tweak the directions of the monsters and info_player_*'s.
    Then QBSP/LIGHT/VIS/Quake it.

    Have fun!!!  Impress the kids.  Tell them mommy/daddy can
    turn any picture they draw into a playable Quake map. ;)

                   [Note from first release]
    "This is probably as far as I'm going to take this program."

    Obviously, that was a lie.  I will make no such claim this time. ;)

    If you like this program, please feel free to e-mail me
    and tell me what you're doing with it.  

    I would like to hear about any problems from those who 
    can't get it to work after reading this file.  
        
    jack (aka Silicon Slick)
    si_slick@cy-net.net
    Clan 13th Man - http://http.tamu.edu/~jkp2866/Clan13thMan/

*****************************************************************************
