1 // material.cxx -- class to handle material properties
3 // Written by Curtis Olson, started May 1998.
5 // Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 // (Log is kept at end of this file)
36 #include <Debug/fg_debug.h>
37 #include <Include/fg_zlib.h>
38 #include <Main/options.hxx>
40 #include "material.hxx"
44 fgMATERIAL::fgMATERIAL ( void ) {
49 void fgMATERIAL::init_sort_list( void );
52 int fgMATERIAL::append_sort_list( fgFRAGMENT *object );
56 fgMATERIAL::~fgMATERIAL ( void ) {
61 fgMATERIAL_MGR::fgMATERIAL_MGR ( void ) {
65 // Load a library of material properties
66 int fgMATERIAL_MGR::load_lib ( void ) {
68 char path[256], fgpath[256];
73 // build the path name to the material db
75 strcat(path, o->fg_root);
76 strcat(path, "/Scenery/");
77 strcat(path, "Materials");
79 strcat(fgpath, ".gz");
81 // first try "path.gz"
82 if ( (f = fgopen(fgpath, "rb")) == NULL ) {
84 if ( (f = fgopen(path, "rb")) == NULL ) {
85 fgPrintf(FG_GENERAL, FG_EXIT, "Cannot open file: %s\n", path);
96 fgMATERIAL_MGR::~fgMATERIAL_MGR ( void ) {
101 // Revision 1.2 1998/06/01 17:56:20 curt
102 // Incremental additions to material.cxx (not fully functional)
103 // Tweaked vfc_ratio math to avoid divide by zero.
105 // Revision 1.1 1998/05/30 01:56:45 curt
106 // Added material.cxx material.hxx