diff --git a/include/niflib.h b/include/niflib.h index 91ae6c2f3f606f93c174bed3ac8e21a592006882..654f1d17ceaa2c1897082b9a805dd29f7295553b 100644 --- a/include/niflib.h +++ b/include/niflib.h @@ -259,7 +259,7 @@ If you need help to do this, there is information about it on our main website h Visual Studio 2005 is the preferred compiler for Niflib as this is the platform that all development is done on. The instructions in this guide assume that you are using this compiler. If you do not have a copy, you can <a href="http://msdn.microsoft.com/vstudio/express/downloads/default.aspx">download Microsoft Visual C++ 2005 Express</a> for free from Microsoft. Niflib should work on other compilers, and is tested on GCC from time to time, but you will have to figure out how to use those compilers on your own. -You need to make some changes to the project settings of your project before you can build a program that uses Niflib. These settings are available when right-clicking the project in the Solution Explorer and clicking “Properties.” You want to use Niflib in Release or Debug mode, or as a static or dynamic library. +You need to make some changes to the project settings of your project before you can build a program that uses Niflib. These settings are available when right-clicking the project in the Solution Explorer and clicking Properties. You want to use Niflib in Release or Debug mode, or as a static or dynamic library. Debug mode means that Visual C++ will put a bunch of extra data in your program to enable you to use the Visual Debugger and see the real code when you set break points or experience a crash. This adds bloat to your program and slows it down, however, so you should always compile in Release mode when you plan on creating the final version for distribution. @@ -378,13 +378,13 @@ Each object type has member functions which allow you to get and set data, adjus You do not access the classes directly, however. Niflib uses reference counting to determine when objects are destroyed, so you always access a class through a Ref smart pointer. This is a template which takes the class as its template argument, such as Ref<NiNode>. For each type of Ref a typedef has been provided in the form of [class name]Ref, so Ref<NiNode> has the typedef NiNodeRef, and this name can be used instead of the more unusual template syntax. When the last Ref smart pointer that points to a particular object is reassigned or goes out of scope, that object will take care of cleaning itself up automatically. -Objects use Ref smart pointers internally as well, so you don't have to worry about objects that are referenced by other objects destroying themselves unexpectedly. Also, any function that takes a pointer to a NIF object, such as “NiObject*” will also take appropriate Ref versions of compatible objects. Compatible objects are those that can be converted to the correct type via a static cast. That is, a derived type can be substituted for a type that it inherits from. +Objects use Ref smart pointers internally as well, so you don't have to worry about objects that are referenced by other objects destroying themselves unexpectedly. Also, any function that takes a pointer to a NIF object, such as NiObject* will also take appropriate Ref versions of compatible objects. Compatible objects are those that can be converted to the correct type via a static cast. That is, a derived type can be substituted for a type that it inherits from. \section rw_files Reading and Writing NIF Files -To check whether a file is really a NIF file, call the CheckNifVersion() function. You can then call the IsSupportedVersion() function to determine whether the data in the file may not be well understood. There are two ways to read in a NIF file – as a list of objects in the order they appear in the file and as a single Ref pointing to the root of the scene graph tree from which all other objects can be found by following the links between objects. Most of the time you will probably want to use the tree method, as this is the only one eligible for writing. The list method is provided for uses such as Niflyze that need to retrieve all objects, regardless of whether we fully understand the links that keep them from destroying themselves. Unsupported objects may not be included in the tree representation if no other objects reference them. So most of the time, you're going to want to call the ReadNifTree() function. +To check whether a file is really a NIF file, call the CheckNifVersion() function. You can then call the IsSupportedVersion() function to determine whether the data in the file may not be well understood. There are two ways to read in a NIF file - as a list of objects in the order they appear in the file and as a single Ref pointing to the root of the scene graph tree from which all other objects can be found by following the links between objects. Most of the time you will probably want to use the tree method, as this is the only one eligible for writing. The list method is provided for uses such as Niflyze that need to retrieve all objects, regardless of whether we fully understand the links that keep them from destroying themselves. Unsupported objects may not be included in the tree representation if no other objects reference them. So most of the time, you're going to want to call the ReadNifTree() function. -That's all there is to reading in a NIF file. If all goes well with the reading process (no exception was thrown), you will have at least one NIF object in memory – the root object of the tree. You can pass this same object to the WriteNifTree() function to create a new NIF file from the representation in memory. +That's all there is to reading in a NIF file. If all goes well with the reading process (no exception was thrown), you will have at least one NIF object in memory - the root object of the tree. You can pass this same object to the WriteNifTree() function to create a new NIF file from the representation in memory. WARNING: Some features of the NIF format are still unsupported by Niflib, therefore in some cases the exported NIF may either be different from the original, or completely unusable. DO NOT OVERWRITE THE ORIGINAL NIF FILE.