]> git.mxchange.org Git - flightgear.git/blob - Scenery/material.cxx
Incremental additions to material.cxx (not fully functional)
[flightgear.git] / Scenery / material.cxx
1 // material.cxx -- class to handle material properties
2 //
3 // Written by Curtis Olson, started May 1998.
4 //
5 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
6 //
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.
11 //
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.
16 //
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.
20 //
21 // $Id$
22 // (Log is kept at end of this file)
23
24
25 #ifdef HAVE_CONFIG_H
26 #  include <config.h>
27 #endif
28
29 #ifdef HAVE_WINDOWS_H
30 #  include <windows.h>
31 #endif
32
33 #include <GL/glut.h>
34 #include <XGL/xgl.h>
35
36 #include <Debug/fg_debug.h>
37 #include <Include/fg_zlib.h>
38 #include <Main/options.hxx>
39
40 #include "material.hxx"
41
42
43 // Constructor
44 fgMATERIAL::fgMATERIAL ( void ) {
45 }
46
47
48 // Sorting routines
49 void fgMATERIAL::init_sort_list( void );
50
51
52 int fgMATERIAL::append_sort_list( fgFRAGMENT *object );
53
54
55 // Destructor
56 fgMATERIAL::~fgMATERIAL ( void ) {
57 }
58
59
60 // Constructor
61 fgMATERIAL_MGR::fgMATERIAL_MGR ( void ) {
62 }
63
64
65 // Load a library of material properties
66 int fgMATERIAL_MGR::load_lib ( void ) {
67     fgOPTIONS *o;
68     char path[256], fgpath[256];
69     fgFile f;
70
71     o = &current_options;
72
73     // build the path name to the material db
74     path[0] = '\0';
75     strcat(path, o->fg_root);
76     strcat(path, "/Scenery/");
77     strcat(path, "Materials");
78     strcpy(fgpath, path);
79     strcat(fgpath, ".gz");
80
81     // first try "path.gz"
82     if ( (f = fgopen(fgpath, "rb")) == NULL ) {
83         // next try "path"    
84         if ( (f = fgopen(path, "rb")) == NULL ) {
85             fgPrintf(FG_GENERAL, FG_EXIT, "Cannot open file: %s\n", path);
86         }       
87     }
88
89     fgclose(f);
90
91     return(1);
92 }
93
94
95 // Destructor
96 fgMATERIAL_MGR::~fgMATERIAL_MGR ( void ) {
97 }
98
99
100 // $Log$
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.
104 //
105 // Revision 1.1  1998/05/30 01:56:45  curt
106 // Added material.cxx material.hxx
107 //