
#####################################################
PixStr 2.2 Rev 4 changes by sapper Oct 2014.

~ Fixed a bug in Geometry.pas initizalization section
that caused PixStr to malfunction on some modern CPUs.

~ Minor change to appearance of the loading form. The
complete form on Win7/8.1 wasn't visible due to scrollbars.

~ This version includes code from madExcept which gives
the option to View/Save a bug report whenever the program crashes.
This report may be helpful for finding the error.

#####################################################
PixStr 2.2 Rev 3 changes by sapper July 2010.

~ PixStr will open and save TR4 files that were created from version
130 wads. Version 130 wads create a soundmap of 2048 entries (4096 bytes).
The first 1024 entries are stored in the demo data and the demo data size is
2048 bytes. The second 1024 entries are stored in a soundmap expanded to 2048
bytes. Normally for TR4s the demo data size is 0 and the soundmap is 740 bytes
(370 entries).

~ Added a label above the "Centre Camera" button that will indicate when a
v130 TR4 is opened.

~ Since other tools created with TurboPascal's library will not open v130 TR4s I
have added a routine that cuts the v130 soundmap to 740 bytes. This means the
level will be compatible with the other tools but THE LEVEL WILL NO LONGER
PLAY CORRECTLY SO ALWAYS SAVE TO A DIFFERENT NAME. Any of
TurboPascal's tools that process the sound banks (internal indices and samples)
may not process them correctly since most internal indices will be missing.
Note Paolone's version of TRViewer and Wadmerger 1.98 can open v130 TR4s.

Access this routine from the Special menu item, "V130 TR4 -> mod V130 TR4".
It is only enabled when a V130 TR4 is opened.

~ Also in the Special menu is an item, "mod V130 TR4 -> V130 TR4".
This is only enabled if a TR4 created with "V130 TR4 -> mod V130 TR4" is opened.
The v130 label will indicate when such a level is opened.
This routine hopefully reverses the process but this CANNOT BE GUARANTEED. It
depends on what changes are made to the TR4 by other tools.
Wadmerger will not open the mod V130 TR4s created by this program.

~ When you use "Save as", PixStr now updates the level name in the treeview and
the caption above the texture page bitmap.

~ Loading form now indicates when a v130 TR4 soundmap or mod v130 TR4
soundmap is found.

~ In the DXF import routine texture indices greater than the number of object
textures are made 0.

~ Changed the routine for loading meshes so that it will now only load 1000
vertices or textured quads or textured triangles. Faces which reference the
missing vertices will not be loaded. This means the mesh will be incomplete
since it will be missing vertices and/or faces.
When a mesh is read that is over the limits a warning message box is displayed.
Any mesh selected in the treeview that has the limit of vertices or quads (tex)
or triangles (tex) will cause the statusbar to change colour to red.
IF YOU SAVE THE TR4, THIS MESH WILL BE SAVED INCOMPLETE AND
THE OBJECT IN THE LEVEL WILL BE RUINED.

#####################################################
PixStr 2.2 Rev 2 changes by sapper April 2010.

~ PixStr can now build the Moveables Treeview for moveable object
IDs greater than 462. The new TRNG objects all have IDs greater
than 462. If the file "NGtrcatalog.xml" is in the PixStr folder the
NG Objects will have their correct names (IDs up to 500). If ID
is above 500 or "NGtrcatalog.xml" is not in the folder but "trcatalog.xml"
is, the NG Objects will be given the name "NG Object".
Note: the names are only used for building the treeview and not used
for anything else.

~ Changed the textureID the solid bitmap is given for OpenGL.
Was given ID 3999, so if the level had 4000 textures or more the solid
texture could not be displayed. Now given textureID one greater than
the number of textures in the level.

~ Viewport is centred after defining new texture with mouse.
Solid texture ID has to be updated, so centre the view to redraw textures.

~ igor32 from TRF updated "trcatalog.xml" for TRNG object IDs.
This updated file should be named "NGtrcatalog.xml" and placed in the
folder with PixStr. PixStr2.2 Rev0 and PixStr2.2 Rev1 need the original
trcatalog.xml. Renaming "NGtrcatalog.xml" to "trcatalog.xml" will cause
those two versions to crash.

~ Loading form now shows which xml file is read.

~ Dialog for Recalc Normals now shows which of the new methods will be
applied.

~ Increased limit for vertices in a mesh to 1000 (was 800).

~ Corrected error message for importing a DXF with number of quads or tris
over the limit. Rev1 error message says limit is 800 but limit is in fact
1000 and Rev1 will accept 1000 tris or quads.

~ PixStr will exit the update OpenGL buffers procedure if no level loaded.

#####################################################
PixStr 2.2 Rev 1 changes by sapper Mar 2010.

~ Added Recalc Normals item to Specials menu. This menu item gives access to
PixStr's recalc normals routine and also to two new routines. You can recalc
a whole moveable or an individual mesh. You cannot recalc a static.

To recalc with the new routines select "Yes" at the dialog.
If "Show Box" in the Boxes tab is checked, the normals will be recalculated using
normalised normals (averaged). If unchecked, the normals will be calculated using
non normalised normals (weighted).

Note: imported DXF files will still have the normals recalculated using the
old routine.

~ Increased the limit for the number of vertices in a mesh to 800 (was 500).

~ Increased the limit for the number of textured quads in a mesh to 1000 (was 500).

~ Increased the limit for the number of textured triangles in a mesh to 1000 (was 300).

In PixStr2.2 Rev 0, if you open a TR4 which uses PoYu's archaeologist outfit, you
will notice that the first point of triangle number 301 of the head mesh is moved
to point 0, distorting the mesh. This is why I changed the limits.

Note: The program will still attempt to load an object with more vertices or
textured quads or textured triangles than this, however, and the result will
be unpredictable. The program may crash or the mesh will be distorted.

~ Added some limit checking for quads and tris and vertices when importing DXF
files. The camera is now automatically centred so status bar info is updated.

~ Changed the typo in the DXF import/export dialog, i.e. dfx to dxf.

~ The names for the AI items are now read from the TRCatalog.xml file.
The names were displayed as "1" due to the names for the AI items being in a
different position in the line than the names for the other slots.

~ When a mesh or static is selected in the tree the number of vertices (V) and
number of textured rectangles (Q) and number of textured triangles (T) is 
displayed in the statusbar. You can see whether the mesh is within limits.
Note the limit (300) for coloured triangles and coloured rectangles is unchanged.

~ Displays correct textures in 3D viewer for texture indices above 4095.
PixStr 2.2 Rev0's 3D window can only draw textures from the first 4096 texture
pieces. Meshes that used texture pieces above index 4095 did not look textured
correctly since, for example, the 4097th texture was replaced by the first.

~ Changed the DXF export to save texture indices above 4095 in the DXF file.
