Panda3D
loaderOptions.I
1 // Filename: loaderOptions.I
2 // Created by: drose (05Oct05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: LoaderOptions::Constructor
18 // Access: Published
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE LoaderOptions::
22 LoaderOptions(int flags, int texture_flags) :
23  _flags(flags),
24  _texture_flags(texture_flags),
25  _texture_num_views(0),
26  _auto_texture_scale(ATS_unspecified)
27 {
28 }
29 
30 ////////////////////////////////////////////////////////////////////
31 // Function: LoaderOptions::Copy Constructor
32 // Access: Published
33 // Description:
34 ////////////////////////////////////////////////////////////////////
35 INLINE LoaderOptions::
36 LoaderOptions(const LoaderOptions &copy) :
37  _flags(copy._flags),
38  _texture_flags(copy._texture_flags),
39  _texture_num_views(copy._texture_num_views),
40  _auto_texture_scale(copy._auto_texture_scale)
41 {
42 }
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function: LoaderOptions::Copy Assignment Operator
46 // Access: Published
47 // Description:
48 ////////////////////////////////////////////////////////////////////
49 INLINE void LoaderOptions::
50 operator = (const LoaderOptions &copy) {
51  _flags = copy._flags;
52  _texture_flags = copy._texture_flags;
53  _texture_num_views = copy._texture_num_views;
54  _auto_texture_scale = copy._auto_texture_scale;
55 }
56 
57 ////////////////////////////////////////////////////////////////////
58 // Function: LoaderOptions::set_flags
59 // Access: Published
60 // Description:
61 ////////////////////////////////////////////////////////////////////
62 INLINE void LoaderOptions::
63 set_flags(int flags) {
64  _flags = flags;
65 }
66 
67 ////////////////////////////////////////////////////////////////////
68 // Function: LoaderOptions::get_flags
69 // Access: Published
70 // Description:
71 ////////////////////////////////////////////////////////////////////
72 INLINE int LoaderOptions::
73 get_flags() const {
74  return _flags;
75 }
76 
77 ////////////////////////////////////////////////////////////////////
78 // Function: LoaderOptions::set_texture_flags
79 // Access: Published
80 // Description:
81 ////////////////////////////////////////////////////////////////////
82 INLINE void LoaderOptions::
83 set_texture_flags(int texture_flags) {
84  _texture_flags = texture_flags;
85 }
86 
87 ////////////////////////////////////////////////////////////////////
88 // Function: LoaderOptions::get_texture_flags
89 // Access: Published
90 // Description:
91 ////////////////////////////////////////////////////////////////////
92 INLINE int LoaderOptions::
93 get_texture_flags() const {
94  return _texture_flags;
95 }
96 
97 ////////////////////////////////////////////////////////////////////
98 // Function: LoaderOptions::set_texture_num_views
99 // Access: Published
100 // Description: Specifies the expected number of views to load for
101 // the texture. This is ignored unless TF_multiview is
102 // included in texture_flags. This must be specified
103 // when loading a 3-d multiview texture, in which case
104 // it is used to differentiate z levels from separate
105 // views; it may be zero in the case of 2-d textures or
106 // cube maps, in which case the number of views can be
107 // inferred from the number of images found on disk.
108 ////////////////////////////////////////////////////////////////////
109 INLINE void LoaderOptions::
110 set_texture_num_views(int texture_num_views) {
111  _texture_num_views = texture_num_views;
112 }
113 
114 ////////////////////////////////////////////////////////////////////
115 // Function: LoaderOptions::get_texture_num_views
116 // Access: Published
117 // Description: See set_texture_num_views().
118 ////////////////////////////////////////////////////////////////////
119 INLINE int LoaderOptions::
121  return _texture_num_views;
122 }
123 
124 ////////////////////////////////////////////////////////////////////
125 // Function: LoaderOptions::set_auto_texture_scale
126 // Access: Published
127 // Description: Set this flag to ATS_none, ATS_up, ATS_down, or
128 // ATS_pad to control how a texture is scaled from
129 // disk when it is subsequently loaded. Set it to
130 // ATS_unspecified to restore the default behavior.
131 ////////////////////////////////////////////////////////////////////
132 INLINE void LoaderOptions::
133 set_auto_texture_scale(AutoTextureScale scale) {
134  _auto_texture_scale = scale;
135 }
136 
137 ////////////////////////////////////////////////////////////////////
138 // Function: LoaderOptions::get_auto_texture_scale
139 // Access: Published
140 // Description: See set_auto_texture_scale().
141 ////////////////////////////////////////////////////////////////////
142 INLINE AutoTextureScale LoaderOptions::
144  return _auto_texture_scale;
145 }
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:26
void set_texture_num_views(int num_views)
Specifies the expected number of views to load for the texture.
int get_texture_num_views() const
See set_texture_num_views().
void set_auto_texture_scale(AutoTextureScale scale)
Set this flag to ATS_none, ATS_up, ATS_down, or ATS_pad to control how a texture is scaled from disk ...
AutoTextureScale get_auto_texture_scale() const
See set_auto_texture_scale().