replace explicit crossbar with last_saved_result interface; integrate with DX8
This commit is contained in:
parent
c568c06881
commit
ba139578e0
|
|
@ -249,19 +249,16 @@ get_supports_texture_combine() const {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::get_supports_texture_crossbar
|
||||
// Function: GraphicsStateGuardian::get_supports_texture_saved_result
|
||||
// Access: Published
|
||||
// Description: Returns true if this GSG can use the
|
||||
// TextureStage::CS_crossbar_stage blend source, which
|
||||
// allows you to specify an arbitrary TextureStage as a
|
||||
// source parameter to set_combine_rgb() or
|
||||
// set_combine_alpha(). If this is false, you must use
|
||||
// choose from one of the available enumerated values
|
||||
// for the source of each operand.
|
||||
// TextureStage::CS_last_saved_result source, which
|
||||
// allows you to save the result of a TextureStage and
|
||||
// re-use it for multiple inputs.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool GraphicsStateGuardian::
|
||||
get_supports_texture_crossbar() const {
|
||||
return _supports_texture_crossbar;
|
||||
get_supports_texture_saved_result() const {
|
||||
return _supports_texture_saved_result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ GraphicsStateGuardian(const FrameBufferProperties &properties,
|
|||
// Assume we don't support these fairly advanced texture combiner
|
||||
// modes.
|
||||
_supports_texture_combine = false;
|
||||
_supports_texture_crossbar = false;
|
||||
_supports_texture_saved_result = false;
|
||||
_supports_texture_dot3 = false;
|
||||
|
||||
// Assume no limits on number of lights or clip planes.
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ PUBLISHED:
|
|||
INLINE int get_max_cube_map_dimension() const;
|
||||
|
||||
INLINE bool get_supports_texture_combine() const;
|
||||
INLINE bool get_supports_texture_crossbar() const;
|
||||
INLINE bool get_supports_texture_saved_result() const;
|
||||
INLINE bool get_supports_texture_dot3() const;
|
||||
|
||||
INLINE int get_max_lights() const;
|
||||
|
|
@ -367,7 +367,7 @@ protected:
|
|||
int _max_cube_map_dimension;
|
||||
|
||||
bool _supports_texture_combine;
|
||||
bool _supports_texture_crossbar;
|
||||
bool _supports_texture_saved_result;
|
||||
bool _supports_texture_dot3;
|
||||
|
||||
int _max_lights;
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@ appear before they are referenced.
|
|||
PRIMARY-COLOR
|
||||
PREVIOUS
|
||||
CONSTANT_COLOR_SCALE
|
||||
LAST_SAVED_RESULT
|
||||
|
||||
combine-operand may be one of:
|
||||
|
||||
|
|
@ -525,7 +526,7 @@ appear before they are referenced.
|
|||
(1 1 1 1). The morph-list is an optional list of <DRGBA> entries.
|
||||
|
||||
|
||||
<UV> [name] { u v [morph-list] }
|
||||
<UV> [name] { u v [tangent] [binormal] [morph-list] }
|
||||
|
||||
This gives the texture coordinates of the vertex. This must be
|
||||
specified if a texture is to be mapped onto this geometry. As
|
||||
|
|
@ -536,6 +537,16 @@ appear before they are referenced.
|
|||
support for multitexturing. The name may be omitted to specify
|
||||
the default UV's.
|
||||
|
||||
The UV's also support an optional tangent and binormal. These
|
||||
values are based on the vertex normal and the UV coordinates of
|
||||
connected vertices, and are used to render normal maps and similar
|
||||
lighting effects. They are defined within the <UV> entry because
|
||||
there may be a different set of tangents and binormals for each
|
||||
different UV coordinate set. If present, they have the expected
|
||||
syntax:
|
||||
|
||||
<UV> [name] { u v <Tangent> { x y z } <Binormal> { x y z } }
|
||||
|
||||
|
||||
<DynamicVertexPool> name { vertices }
|
||||
|
||||
|
|
|
|||
|
|
@ -115,10 +115,6 @@ DXGraphicsStateGuardian8(const FrameBufferProperties &properties) :
|
|||
Geom::GR_point_perspective | Geom::GR_point_sprite |
|
||||
Geom::GR_triangle_strip | Geom::GR_triangle_fan |
|
||||
Geom::GR_flat_first_vertex;
|
||||
|
||||
_supports_texture_combine = true;
|
||||
_supports_texture_crossbar = false;
|
||||
_supports_texture_dot3 = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -1519,6 +1515,10 @@ reset() {
|
|||
_max_vertex_transforms = d3d_caps.MaxVertexBlendMatrices;
|
||||
_max_vertex_transform_indices = d3d_caps.MaxVertexBlendMatrixIndex;
|
||||
|
||||
_supports_texture_combine = ((d3d_caps.TextureOpCaps & D3DTEXOPCAPS_LERP) != 0);
|
||||
_supports_texture_saved_result = ((d3d_caps.PrimitiveMiscCaps & D3DPMISCCAPS_TSSARGTEMP) != 0);
|
||||
_supports_texture_dot3 = true;
|
||||
|
||||
ZeroMemory(&_lmodel_ambient, sizeof(Colorf));
|
||||
_d3d_device->SetRenderState(D3DRS_AMBIENT, 0x0);
|
||||
|
||||
|
|
@ -2243,6 +2243,7 @@ do_issue_texture() {
|
|||
bool any_point_sprite = false;
|
||||
switch (mode) {
|
||||
case TexGenAttrib::M_off:
|
||||
case TexGenAttrib::M_light_vector:
|
||||
_d3d_device->SetTextureStageState(i, D3DTSS_TEXCOORDINDEX, texcoord_index);
|
||||
break;
|
||||
|
||||
|
|
@ -2888,6 +2889,12 @@ set_texture_blend_mode(int i, const TextureStage *stage) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (stage->get_saved_result()) {
|
||||
_d3d_device->SetTextureStageState(i, D3DTSS_RESULTARG, D3DTA_TEMP);
|
||||
} else {
|
||||
_d3d_device->SetTextureStageState(i, D3DTSS_RESULTARG, D3DTA_CURRENT);
|
||||
}
|
||||
|
||||
if (stage->uses_color()) {
|
||||
// Set up the constant color for this stage.
|
||||
|
||||
|
|
@ -3299,8 +3306,8 @@ get_texture_argument(TextureStage::CombineSource source,
|
|||
case TextureStage::CS_previous:
|
||||
return D3DTA_CURRENT | get_texture_argument_modifier(operand);
|
||||
|
||||
case TextureStage::CS_crossbar_stage:
|
||||
break;
|
||||
case TextureStage::CS_last_saved_result:
|
||||
return D3DTA_TEMP | get_texture_argument_modifier(operand);
|
||||
}
|
||||
dxgsg8_cat.error()
|
||||
<< "Invalid TextureStage::CombineSource value (" << (int)source << ")\n";
|
||||
|
|
|
|||
|
|
@ -306,6 +306,41 @@ get_combine_operand(CombineChannel channel, int n) const {
|
|||
return _combiner[channel]._ops[n]._operand;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: EggTexture::set_saved_result
|
||||
// Access: Published
|
||||
// Description: Sets the saved_result flag. When this is true, the
|
||||
// output of this stage is not part of the normal
|
||||
// pipeline--that is, it will not be supplied as the
|
||||
// "previous" source for the next texture stage--but it
|
||||
// will instead be supplied as the "last_saved_result"
|
||||
// source for any future stages, until the next
|
||||
// TextureStage with a saved_result set true is
|
||||
// encountered.
|
||||
//
|
||||
// This can be used to reuse the results of this texture
|
||||
// stage as input to more than one stage later in the
|
||||
// pipeline.
|
||||
//
|
||||
// The last texture in the pipeline (the one with the
|
||||
// highest sort value) should not have this flag set.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void EggTexture::
|
||||
set_saved_result(bool saved_result) {
|
||||
_saved_result = saved_result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: EggTexture::get_saved_result
|
||||
// Access: Published
|
||||
// Description: Returns the current setting of the saved_result flag.
|
||||
// See set_saved_result().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool EggTexture::
|
||||
get_saved_result() const {
|
||||
return _saved_result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: EggTexture::set_tex_gen
|
||||
// Access: Published
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ EggTexture(const string &tref_name, const string &filename)
|
|||
_magfilter = FT_unspecified;
|
||||
_anisotropic_degree = 0;
|
||||
_env_type = ET_unspecified;
|
||||
_saved_result = false;
|
||||
_tex_gen = TG_unspecified;
|
||||
_priority = 0;
|
||||
_color.set(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
|
@ -82,6 +83,7 @@ operator = (const EggTexture ©) {
|
|||
_magfilter = copy._magfilter;
|
||||
_anisotropic_degree = copy._anisotropic_degree;
|
||||
_env_type = copy._env_type;
|
||||
_saved_result = copy._saved_result;
|
||||
_tex_gen = copy._tex_gen;
|
||||
_stage_name = copy._stage_name;
|
||||
_priority = copy._priority;
|
||||
|
|
@ -196,6 +198,11 @@ write(ostream &out, int indent_level) const {
|
|||
}
|
||||
}
|
||||
|
||||
if (get_saved_result()) {
|
||||
indent(out, indent_level + 2)
|
||||
<< "<Scalar> saved-result { 1 }\n";
|
||||
}
|
||||
|
||||
if (get_tex_gen() != TG_unspecified) {
|
||||
indent(out, indent_level + 2)
|
||||
<< "<Scalar> tex-gen { " << get_tex_gen() << " }\n";
|
||||
|
|
@ -763,6 +770,9 @@ string_combine_source(const string &string) {
|
|||
} else if (cmp_nocase_uh(string, "constant_color_scale") == 0) {
|
||||
return CS_constant_color_scale;
|
||||
|
||||
} else if (cmp_nocase_uh(string, "last_saved_result") == 0) {
|
||||
return CS_last_saved_result;
|
||||
|
||||
} else {
|
||||
return CS_unspecified;
|
||||
}
|
||||
|
|
@ -1097,6 +1107,9 @@ operator << (ostream &out, EggTexture::CombineSource cs) {
|
|||
|
||||
case EggTexture::CS_constant_color_scale:
|
||||
return out << "constant_color_scale";
|
||||
|
||||
case EggTexture::CS_last_saved_result:
|
||||
return out << "last_saved_result";
|
||||
}
|
||||
|
||||
return out << "**invalid CombineSource(" << (int)cs << ")**";
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ PUBLISHED:
|
|||
CS_primary_color,
|
||||
CS_previous,
|
||||
CS_constant_color_scale,
|
||||
CS_last_saved_result,
|
||||
};
|
||||
enum CombineOperand {
|
||||
CO_unspecified,
|
||||
|
|
@ -180,6 +181,9 @@ PUBLISHED:
|
|||
INLINE void set_combine_operand(CombineChannel channel, int n, CombineOperand co);
|
||||
INLINE CombineOperand get_combine_operand(CombineChannel channel, int n) const;
|
||||
|
||||
INLINE void set_saved_result(bool saved_result);
|
||||
INLINE bool get_saved_result() const;
|
||||
|
||||
INLINE void set_tex_gen(TexGen tex_gen);
|
||||
INLINE TexGen get_tex_gen() const;
|
||||
|
||||
|
|
@ -270,6 +274,7 @@ private:
|
|||
FilterType _minfilter, _magfilter;
|
||||
int _anisotropic_degree;
|
||||
EnvType _env_type;
|
||||
bool _saved_result;
|
||||
TexGen _tex_gen;
|
||||
string _stage_name;
|
||||
int _priority;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,96 +1,224 @@
|
|||
#ifndef BISON_Y_TAB_H
|
||||
# define BISON_Y_TAB_H
|
||||
/* A Bison parser, made by GNU Bison 1.875b. */
|
||||
|
||||
# define NUMBER 257
|
||||
# define ULONG 258
|
||||
# define STRING 259
|
||||
# define BEZIERCURVE 260
|
||||
# define BFACE 261
|
||||
# define BILLBOARD 262
|
||||
# define BILLBOARDCENTER 263
|
||||
# define BINORMAL 264
|
||||
# define BUNDLE 265
|
||||
# define CLOSED 266
|
||||
# define COLLIDE 267
|
||||
# define COMMENT 268
|
||||
# define COMPONENT 269
|
||||
# define COORDSYSTEM 270
|
||||
# define CV 271
|
||||
# define DART 272
|
||||
# define DNORMAL 273
|
||||
# define DRGBA 274
|
||||
# define DUV 275
|
||||
# define DXYZ 276
|
||||
# define DCS 277
|
||||
# define DISTANCE 278
|
||||
# define DTREF 279
|
||||
# define DYNAMICVERTEXPOOL 280
|
||||
# define EXTERNAL_FILE 281
|
||||
# define FLIGHT 282
|
||||
# define GROUP 283
|
||||
# define HIP 284
|
||||
# define INTANGENT 285
|
||||
# define JOINT 286
|
||||
# define KNOTS 287
|
||||
# define INCLUDE 288
|
||||
# define INSTANCE 289
|
||||
# define LINE 290
|
||||
# define LOOP 291
|
||||
# define MATERIAL 292
|
||||
# define MATRIX3 293
|
||||
# define MATRIX4 294
|
||||
# define MODEL 295
|
||||
# define MREF 296
|
||||
# define NORMAL 297
|
||||
# define NURBSCURVE 298
|
||||
# define NURBSSURFACE 299
|
||||
# define OBJECTTYPE 300
|
||||
# define ORDER 301
|
||||
# define OUTTANGENT 302
|
||||
# define POINTLIGHT 303
|
||||
# define POLYGON 304
|
||||
# define REF 305
|
||||
# define RGBA 306
|
||||
# define ROTATE 307
|
||||
# define ROTX 308
|
||||
# define ROTY 309
|
||||
# define ROTZ 310
|
||||
# define SANIM 311
|
||||
# define SCALAR 312
|
||||
# define SCALE 313
|
||||
# define SEQUENCE 314
|
||||
# define SHADING 315
|
||||
# define SWITCH 316
|
||||
# define SWITCHCONDITION 317
|
||||
# define TABLE 318
|
||||
# define TABLE_V 319
|
||||
# define TAG 320
|
||||
# define TANGENT 321
|
||||
# define TEXLIST 322
|
||||
# define TEXTURE 323
|
||||
# define TLENGTHS 324
|
||||
# define TRANSFORM 325
|
||||
# define TRANSLATE 326
|
||||
# define TREF 327
|
||||
# define TRIANGLEFAN 328
|
||||
# define TRIANGLESTRIP 329
|
||||
# define TRIM 330
|
||||
# define TXT 331
|
||||
# define UKNOTS 332
|
||||
# define UV 333
|
||||
# define VKNOTS 334
|
||||
# define VERTEX 335
|
||||
# define VERTEXANIM 336
|
||||
# define VERTEXPOOL 337
|
||||
# define VERTEXREF 338
|
||||
# define XFMANIM 339
|
||||
# define XFMSANIM 340
|
||||
# define START_EGG 341
|
||||
# define START_GROUP_BODY 342
|
||||
# define START_TEXTURE_BODY 343
|
||||
# define START_PRIMITIVE_BODY 344
|
||||
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
This special exception was added by the Free Software Foundation
|
||||
in version 1.24 of Bison. */
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
NUMBER = 258,
|
||||
ULONG = 259,
|
||||
STRING = 260,
|
||||
BEZIERCURVE = 261,
|
||||
BFACE = 262,
|
||||
BILLBOARD = 263,
|
||||
BILLBOARDCENTER = 264,
|
||||
BINORMAL = 265,
|
||||
BUNDLE = 266,
|
||||
CLOSED = 267,
|
||||
COLLIDE = 268,
|
||||
COMMENT = 269,
|
||||
COMPONENT = 270,
|
||||
COORDSYSTEM = 271,
|
||||
CV = 272,
|
||||
DART = 273,
|
||||
DNORMAL = 274,
|
||||
DRGBA = 275,
|
||||
DUV = 276,
|
||||
DXYZ = 277,
|
||||
DCS = 278,
|
||||
DISTANCE = 279,
|
||||
DTREF = 280,
|
||||
DYNAMICVERTEXPOOL = 281,
|
||||
EXTERNAL_FILE = 282,
|
||||
FLIGHT = 283,
|
||||
GROUP = 284,
|
||||
HIP = 285,
|
||||
INTANGENT = 286,
|
||||
JOINT = 287,
|
||||
KNOTS = 288,
|
||||
INCLUDE = 289,
|
||||
INSTANCE = 290,
|
||||
LINE = 291,
|
||||
LOOP = 292,
|
||||
MATERIAL = 293,
|
||||
MATRIX3 = 294,
|
||||
MATRIX4 = 295,
|
||||
MODEL = 296,
|
||||
MREF = 297,
|
||||
NORMAL = 298,
|
||||
NURBSCURVE = 299,
|
||||
NURBSSURFACE = 300,
|
||||
OBJECTTYPE = 301,
|
||||
ORDER = 302,
|
||||
OUTTANGENT = 303,
|
||||
POINTLIGHT = 304,
|
||||
POLYGON = 305,
|
||||
REF = 306,
|
||||
RGBA = 307,
|
||||
ROTATE = 308,
|
||||
ROTX = 309,
|
||||
ROTY = 310,
|
||||
ROTZ = 311,
|
||||
SANIM = 312,
|
||||
SCALAR = 313,
|
||||
SCALE = 314,
|
||||
SEQUENCE = 315,
|
||||
SHADING = 316,
|
||||
SWITCH = 317,
|
||||
SWITCHCONDITION = 318,
|
||||
TABLE = 319,
|
||||
TABLE_V = 320,
|
||||
TAG = 321,
|
||||
TANGENT = 322,
|
||||
TEXLIST = 323,
|
||||
TEXTURE = 324,
|
||||
TLENGTHS = 325,
|
||||
TRANSFORM = 326,
|
||||
TRANSLATE = 327,
|
||||
TREF = 328,
|
||||
TRIANGLEFAN = 329,
|
||||
TRIANGLESTRIP = 330,
|
||||
TRIM = 331,
|
||||
TXT = 332,
|
||||
UKNOTS = 333,
|
||||
UV = 334,
|
||||
VKNOTS = 335,
|
||||
VERTEX = 336,
|
||||
VERTEXANIM = 337,
|
||||
VERTEXPOOL = 338,
|
||||
VERTEXREF = 339,
|
||||
XFMANIM = 340,
|
||||
XFMSANIM = 341,
|
||||
START_EGG = 342,
|
||||
START_GROUP_BODY = 343,
|
||||
START_TEXTURE_BODY = 344,
|
||||
START_PRIMITIVE_BODY = 345
|
||||
};
|
||||
#endif
|
||||
#define NUMBER 258
|
||||
#define ULONG 259
|
||||
#define STRING 260
|
||||
#define BEZIERCURVE 261
|
||||
#define BFACE 262
|
||||
#define BILLBOARD 263
|
||||
#define BILLBOARDCENTER 264
|
||||
#define BINORMAL 265
|
||||
#define BUNDLE 266
|
||||
#define CLOSED 267
|
||||
#define COLLIDE 268
|
||||
#define COMMENT 269
|
||||
#define COMPONENT 270
|
||||
#define COORDSYSTEM 271
|
||||
#define CV 272
|
||||
#define DART 273
|
||||
#define DNORMAL 274
|
||||
#define DRGBA 275
|
||||
#define DUV 276
|
||||
#define DXYZ 277
|
||||
#define DCS 278
|
||||
#define DISTANCE 279
|
||||
#define DTREF 280
|
||||
#define DYNAMICVERTEXPOOL 281
|
||||
#define EXTERNAL_FILE 282
|
||||
#define FLIGHT 283
|
||||
#define GROUP 284
|
||||
#define HIP 285
|
||||
#define INTANGENT 286
|
||||
#define JOINT 287
|
||||
#define KNOTS 288
|
||||
#define INCLUDE 289
|
||||
#define INSTANCE 290
|
||||
#define LINE 291
|
||||
#define LOOP 292
|
||||
#define MATERIAL 293
|
||||
#define MATRIX3 294
|
||||
#define MATRIX4 295
|
||||
#define MODEL 296
|
||||
#define MREF 297
|
||||
#define NORMAL 298
|
||||
#define NURBSCURVE 299
|
||||
#define NURBSSURFACE 300
|
||||
#define OBJECTTYPE 301
|
||||
#define ORDER 302
|
||||
#define OUTTANGENT 303
|
||||
#define POINTLIGHT 304
|
||||
#define POLYGON 305
|
||||
#define REF 306
|
||||
#define RGBA 307
|
||||
#define ROTATE 308
|
||||
#define ROTX 309
|
||||
#define ROTY 310
|
||||
#define ROTZ 311
|
||||
#define SANIM 312
|
||||
#define SCALAR 313
|
||||
#define SCALE 314
|
||||
#define SEQUENCE 315
|
||||
#define SHADING 316
|
||||
#define SWITCH 317
|
||||
#define SWITCHCONDITION 318
|
||||
#define TABLE 319
|
||||
#define TABLE_V 320
|
||||
#define TAG 321
|
||||
#define TANGENT 322
|
||||
#define TEXLIST 323
|
||||
#define TEXTURE 324
|
||||
#define TLENGTHS 325
|
||||
#define TRANSFORM 326
|
||||
#define TRANSLATE 327
|
||||
#define TREF 328
|
||||
#define TRIANGLEFAN 329
|
||||
#define TRIANGLESTRIP 330
|
||||
#define TRIM 331
|
||||
#define TXT 332
|
||||
#define UKNOTS 333
|
||||
#define UV 334
|
||||
#define VKNOTS 335
|
||||
#define VERTEX 336
|
||||
#define VERTEXANIM 337
|
||||
#define VERTEXPOOL 338
|
||||
#define VERTEXREF 339
|
||||
#define XFMANIM 340
|
||||
#define XFMSANIM 341
|
||||
#define START_EGG 342
|
||||
#define START_GROUP_BODY 343
|
||||
#define START_TEXTURE_BODY 344
|
||||
#define START_PRIMITIVE_BODY 345
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||
typedef int YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
extern YYSTYPE eggyylval;
|
||||
|
||||
#endif /* not BISON_Y_TAB_H */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -515,6 +515,9 @@ texture_body:
|
|||
texture->set_combine_operand(EggTexture::CC_alpha, 2, co);
|
||||
}
|
||||
|
||||
} else if (cmp_nocase_uh(name, "saved_result") == 0) {
|
||||
texture->set_saved_result(((int)value) != 0);
|
||||
|
||||
} else if (cmp_nocase_uh(name, "tex_gen") == 0) {
|
||||
EggTexture::TexGen tex_gen = EggTexture::string_tex_gen(strval);
|
||||
if (tex_gen == EggTexture::TG_unspecified) {
|
||||
|
|
|
|||
|
|
@ -1198,6 +1198,8 @@ make_texture_stage(const EggTexture *egg_tex) {
|
|||
stage->set_alpha_scale(egg_tex->get_alpha_scale());
|
||||
}
|
||||
|
||||
stage->set_saved_result(egg_tex->get_saved_result());
|
||||
|
||||
stage->set_sort(egg_tex->get_multitexture_sort() * 10);
|
||||
|
||||
if (egg_tex->has_priority()) {
|
||||
|
|
@ -3155,6 +3157,9 @@ get_combine_source(const EggTexture *egg_tex,
|
|||
|
||||
case EggTexture::CS_constant_color_scale:
|
||||
return TextureStage::CS_constant_color_scale;
|
||||
|
||||
case EggTexture::CS_last_saved_result:
|
||||
return TextureStage::CS_last_saved_result;
|
||||
};
|
||||
|
||||
return TextureStage::CS_undefined;
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ reset() {
|
|||
|
||||
_supports_texture_combine =
|
||||
has_extension("GL_ARB_texture_env_combine") || is_at_least_version(1, 3);
|
||||
_supports_texture_crossbar =
|
||||
_supports_texture_saved_result =
|
||||
has_extension("GL_ARB_texture_env_crossbar") || is_at_least_version(1, 4);
|
||||
_supports_texture_dot3 =
|
||||
has_extension("GL_ARB_texture_env_dot3") || is_at_least_version(1, 3);
|
||||
|
|
@ -3556,40 +3556,40 @@ get_texture_combine_type(TextureStage::CombineMode cm) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
GLint CLP(GraphicsStateGuardian)::
|
||||
get_texture_src_type(TextureStage::CombineSource cs,
|
||||
const TextureStage *source_stage,
|
||||
const TextureAttrib *attrib, int this_stage) const {
|
||||
int last_stage, int last_saved_result,
|
||||
int this_stage) const {
|
||||
switch (cs) {
|
||||
case TextureStage::CS_undefined: // fall through
|
||||
case TextureStage::CS_texture: return GL_TEXTURE;
|
||||
case TextureStage::CS_constant: return GL_CONSTANT;
|
||||
case TextureStage::CS_primary_color: return GL_PRIMARY_COLOR;
|
||||
case TextureStage::CS_previous: return GL_PREVIOUS;
|
||||
case TextureStage::CS_constant_color_scale: return GL_CONSTANT;
|
||||
|
||||
case TextureStage::CS_crossbar_stage:
|
||||
{
|
||||
int n = attrib->find_on_stage(source_stage);
|
||||
if (n >= 0) {
|
||||
if (_supports_texture_crossbar) {
|
||||
return GL_TEXTURE0 + n;
|
||||
|
||||
} else if (n == this_stage) {
|
||||
return GL_TEXTURE;
|
||||
|
||||
} else if (n == this_stage - 1) {
|
||||
return GL_PREVIOUS;
|
||||
|
||||
} else {
|
||||
GLCAT.warning()
|
||||
<< "Crossbar blending not supported\n";
|
||||
return GL_PRIMARY_COLOR;
|
||||
}
|
||||
}
|
||||
GLCAT.warning()
|
||||
<< "TextureStage " << *attrib->get_on_stage(this_stage)
|
||||
<< " sources unused stage: " << *source_stage << "\n";
|
||||
case TextureStage::CS_previous:
|
||||
if (last_stage == this_stage - 1) {
|
||||
return GL_PREVIOUS;
|
||||
} else if (last_stage == -1) {
|
||||
return GL_PRIMARY_COLOR;
|
||||
}
|
||||
} else if (_supports_texture_saved_result) {
|
||||
return GL_TEXTURE0 + last_stage;
|
||||
} else {
|
||||
GLCAT.warning()
|
||||
<< "Current OpenGL driver does not support texture crossbar blending.\n";
|
||||
return GL_PRIMARY_COLOR;
|
||||
}
|
||||
|
||||
case TextureStage::CS_last_saved_result:
|
||||
if (last_saved_result == this_stage - 1) {
|
||||
return GL_PREVIOUS;
|
||||
} else if (last_saved_result == -1) {
|
||||
return GL_PRIMARY_COLOR;
|
||||
} else if (_supports_texture_saved_result) {
|
||||
return GL_TEXTURE0 + last_saved_result;
|
||||
} else {
|
||||
GLCAT.warning()
|
||||
<< "Current OpenGL driver does not support texture crossbar blending.\n";
|
||||
return GL_PRIMARY_COLOR;
|
||||
}
|
||||
}
|
||||
|
||||
GLCAT.error()
|
||||
|
|
@ -4488,6 +4488,8 @@ do_issue_texture() {
|
|||
|
||||
_texture_involves_color_scale = false;
|
||||
|
||||
int last_saved_result = -1;
|
||||
int last_stage = -1;
|
||||
int i;
|
||||
for (i = 0; i < num_stages; i++) {
|
||||
TextureStage *stage = new_texture->get_on_stage(i);
|
||||
|
|
@ -4573,8 +4575,7 @@ do_issue_texture() {
|
|||
case 3:
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC2_RGB,
|
||||
get_texture_src_type(stage->get_combine_rgb_source2(),
|
||||
stage->get_combine_rgb_source2_stage(),
|
||||
new_texture, i));
|
||||
last_stage, last_saved_result, i));
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND2_RGB,
|
||||
get_texture_operand_type(stage->get_combine_rgb_operand2()));
|
||||
// fall through
|
||||
|
|
@ -4582,8 +4583,7 @@ do_issue_texture() {
|
|||
case 2:
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC1_RGB,
|
||||
get_texture_src_type(stage->get_combine_rgb_source1(),
|
||||
stage->get_combine_rgb_source1_stage(),
|
||||
new_texture, i));
|
||||
last_stage, last_saved_result, i));
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND1_RGB,
|
||||
get_texture_operand_type(stage->get_combine_rgb_operand1()));
|
||||
// fall through
|
||||
|
|
@ -4591,8 +4591,7 @@ do_issue_texture() {
|
|||
case 1:
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC0_RGB,
|
||||
get_texture_src_type(stage->get_combine_rgb_source0(),
|
||||
stage->get_combine_rgb_source0_stage(),
|
||||
new_texture, i));
|
||||
last_stage, last_saved_result, i));
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND0_RGB,
|
||||
get_texture_operand_type(stage->get_combine_rgb_operand0()));
|
||||
// fall through
|
||||
|
|
@ -4607,8 +4606,7 @@ do_issue_texture() {
|
|||
case 3:
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC2_ALPHA,
|
||||
get_texture_src_type(stage->get_combine_alpha_source2(),
|
||||
stage->get_combine_alpha_source2_stage(),
|
||||
new_texture, i));
|
||||
last_stage, last_saved_result, i));
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA,
|
||||
get_texture_operand_type(stage->get_combine_alpha_operand2()));
|
||||
// fall through
|
||||
|
|
@ -4616,8 +4614,7 @@ do_issue_texture() {
|
|||
case 2:
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC1_ALPHA,
|
||||
get_texture_src_type(stage->get_combine_alpha_source1(),
|
||||
stage->get_combine_alpha_source1_stage(),
|
||||
new_texture, i));
|
||||
last_stage, last_saved_result, i));
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA,
|
||||
get_texture_operand_type(stage->get_combine_alpha_operand1()));
|
||||
// fall through
|
||||
|
|
@ -4625,8 +4622,7 @@ do_issue_texture() {
|
|||
case 1:
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC0_ALPHA,
|
||||
get_texture_src_type(stage->get_combine_alpha_source0(),
|
||||
stage->get_combine_alpha_source0_stage(),
|
||||
new_texture, i));
|
||||
last_stage, last_saved_result, i));
|
||||
GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA,
|
||||
get_texture_operand_type(stage->get_combine_alpha_operand0()));
|
||||
// fall through
|
||||
|
|
@ -4647,6 +4643,16 @@ do_issue_texture() {
|
|||
GLP(LoadIdentity)();
|
||||
}
|
||||
}
|
||||
|
||||
if (stage->get_saved_result()) {
|
||||
// This texture's result will be "saved" for a future stage's
|
||||
// input.
|
||||
last_saved_result = i;
|
||||
} else {
|
||||
// This is a regular texture stage; it will be the "previous"
|
||||
// input for the next stage.
|
||||
last_stage = i;
|
||||
}
|
||||
}
|
||||
|
||||
// Disable the texture stages that are no longer used.
|
||||
|
|
|
|||
|
|
@ -224,8 +224,8 @@ protected:
|
|||
static GLint get_texture_apply_mode_type(TextureStage::Mode am);
|
||||
static GLint get_texture_combine_type(TextureStage::CombineMode cm);
|
||||
GLint get_texture_src_type(TextureStage::CombineSource cs,
|
||||
const TextureStage *source_stage,
|
||||
const TextureAttrib *attrib, int this_stage) const;
|
||||
int last_stage, int last_saved_result,
|
||||
int this_stage) const;
|
||||
static GLint get_texture_operand_type(TextureStage::CombineOperand co);
|
||||
static GLenum get_fog_mode_type(Fog::Mode m);
|
||||
static GLenum get_blend_equation_type(ColorBlendAttrib::Mode mode);
|
||||
|
|
|
|||
|
|
@ -259,6 +259,41 @@ get_alpha_scale() const {
|
|||
return _alpha_scale;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_saved_result
|
||||
// Access: Published
|
||||
// Description: Sets the saved_result flag. When this is true, the
|
||||
// output of this stage is not part of the normal
|
||||
// pipeline--that is, it will not be supplied as the
|
||||
// "previous" source for the next texture stage--but it
|
||||
// will instead be supplied as the "last_saved_result"
|
||||
// source for any future stages, until the next
|
||||
// TextureStage with a saved_result set true is
|
||||
// encountered.
|
||||
//
|
||||
// This can be used to reuse the results of this texture
|
||||
// stage as input to more than one stage later in the
|
||||
// pipeline.
|
||||
//
|
||||
// The last texture in the pipeline (the one with the
|
||||
// highest sort value) should not have this flag set.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_saved_result(bool saved_result) {
|
||||
_saved_result = saved_result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_saved_result
|
||||
// Access: Published
|
||||
// Description: Returns the current setting of the saved_result flag.
|
||||
// See set_saved_result().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool TextureStage::
|
||||
get_saved_result() const {
|
||||
return _saved_result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
|
|
@ -284,32 +319,6 @@ set_combine_rgb(CombineMode mode,
|
|||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_replace only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 1);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 1;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = CS_crossbar_stage;
|
||||
_combine_rgb_source0_stage = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = CS_undefined;
|
||||
_combine_rgb_operand1 = CO_undefined;
|
||||
_combine_rgb_source2 = CS_undefined;
|
||||
_combine_rgb_operand2 = CO_undefined;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
|
|
@ -338,94 +347,6 @@ set_combine_rgb(CombineMode mode,
|
|||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a two-parameter operation. Specifically,
|
||||
// this is everything except for CM_replace and
|
||||
// CM_interpolate.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 2);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 2;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = CS_crossbar_stage;
|
||||
_combine_rgb_source0_stage = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = CS_undefined;
|
||||
_combine_rgb_operand2 = CO_undefined;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a two-parameter operation. Specifically,
|
||||
// this is everything except for CM_replace and
|
||||
// CM_interpolate.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 2);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 2;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = CS_crossbar_stage;
|
||||
_combine_rgb_source1_stage = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = CS_undefined;
|
||||
_combine_rgb_operand2 = CO_undefined;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a two-parameter operation. Specifically,
|
||||
// this is everything except for CM_replace and
|
||||
// CM_interpolate.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 2);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 2;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = CS_crossbar_stage;
|
||||
_combine_rgb_source0_stage = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = CS_crossbar_stage;
|
||||
_combine_rgb_source1_stage = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = CS_undefined;
|
||||
_combine_rgb_operand2 = CO_undefined;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
|
|
@ -455,221 +376,6 @@ set_combine_rgb(CombineMode mode,
|
|||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
nassertv(operand_valid_for_rgb(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 3;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = CS_crossbar_stage;
|
||||
_combine_rgb_source0_stage = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = source2;
|
||||
_combine_rgb_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
nassertv(operand_valid_for_rgb(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 3;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = CS_crossbar_stage;
|
||||
_combine_rgb_source1_stage = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = source2;
|
||||
_combine_rgb_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
nassertv(operand_valid_for_rgb(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 3;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = CS_crossbar_stage;
|
||||
_combine_rgb_source2_stage = source2;
|
||||
_combine_rgb_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
nassertv(operand_valid_for_rgb(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 3;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = CS_crossbar_stage;
|
||||
_combine_rgb_source1_stage = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = CS_crossbar_stage;
|
||||
_combine_rgb_source2_stage = source2;
|
||||
_combine_rgb_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
nassertv(operand_valid_for_rgb(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 3;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = CS_crossbar_stage;
|
||||
_combine_rgb_source0_stage = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = CS_crossbar_stage;
|
||||
_combine_rgb_source2_stage = source2;
|
||||
_combine_rgb_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
nassertv(operand_valid_for_rgb(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 3;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = CS_crossbar_stage;
|
||||
_combine_rgb_source0_stage = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = CS_crossbar_stage;
|
||||
_combine_rgb_source1_stage = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = source2;
|
||||
_combine_rgb_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_rgb
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_rgb(operand0));
|
||||
nassertv(operand_valid_for_rgb(operand1));
|
||||
nassertv(operand_valid_for_rgb(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_rgb_operands = 3;
|
||||
_combine_rgb_mode = mode;
|
||||
_combine_rgb_source0 = CS_crossbar_stage;
|
||||
_combine_rgb_source0_stage = source0;
|
||||
_combine_rgb_operand0 = operand0;
|
||||
_combine_rgb_source1 = CS_crossbar_stage;
|
||||
_combine_rgb_source1_stage = source1;
|
||||
_combine_rgb_operand1 = operand1;
|
||||
_combine_rgb_source2 = CS_crossbar_stage;
|
||||
_combine_rgb_source2_stage = source2;
|
||||
_combine_rgb_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_rgb_mode
|
||||
// Access: Published
|
||||
|
|
@ -702,21 +408,6 @@ get_combine_rgb_source0() const {
|
|||
return _combine_rgb_source0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_rgb_source0_stage
|
||||
// Access: Published
|
||||
// Description: Get the TextureStage for source0 of combine_rgb_mode.
|
||||
// This is valid only when get_combine_rgb_source0()
|
||||
// returns CS_crossbar_stage, indicating that the source
|
||||
// is from a particular TextureStage (which may or may
|
||||
// not be the immediately preceding stage in the
|
||||
// pipeline).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const TextureStage *TextureStage::
|
||||
get_combine_rgb_source0_stage() const {
|
||||
return _combine_rgb_source0_stage;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_rgb_operand0
|
||||
// Access: Published
|
||||
|
|
@ -737,21 +428,6 @@ get_combine_rgb_source1() const {
|
|||
return _combine_rgb_source1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_rgb_source1_stage
|
||||
// Access: Published
|
||||
// Description: Get the TextureStage for source1 of combine_rgb_mode.
|
||||
// This is valid only when get_combine_rgb_source1()
|
||||
// returns CS_crossbar_stage, indicating that the source
|
||||
// is from a particular TextureStage (which may or may
|
||||
// not be the immediately preceding stage in the
|
||||
// pipeline).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const TextureStage *TextureStage::
|
||||
get_combine_rgb_source1_stage() const {
|
||||
return _combine_rgb_source1_stage;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_rgb_operand1
|
||||
// Access: Published
|
||||
|
|
@ -772,21 +448,6 @@ get_combine_rgb_source2() const {
|
|||
return _combine_rgb_source2;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_rgb_source2_stage
|
||||
// Access: Published
|
||||
// Description: Get the TextureStage for source2 of combine_rgb_mode.
|
||||
// This is valid only when get_combine_rgb_source2()
|
||||
// returns CS_crossbar_stage, indicating that the source
|
||||
// is from a particular TextureStage (which may or may
|
||||
// not be the immediately preceding stage in the
|
||||
// pipeline).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const TextureStage *TextureStage::
|
||||
get_combine_rgb_source2_stage() const {
|
||||
return _combine_rgb_source2_stage;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_rgb_operand2
|
||||
// Access: Published
|
||||
|
|
@ -822,32 +483,6 @@ set_combine_alpha(CombineMode mode,
|
|||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_replace only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 1);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 1;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = CS_crossbar_stage;
|
||||
_combine_alpha_source0_stage = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = CS_undefined;
|
||||
_combine_alpha_operand1 = CO_undefined;
|
||||
_combine_alpha_source2 = CS_undefined;
|
||||
_combine_alpha_operand2 = CO_undefined;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
|
|
@ -876,94 +511,6 @@ set_combine_alpha(CombineMode mode,
|
|||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a two-parameter operation. Specifically,
|
||||
// this is everything except for CM_replace and
|
||||
// CM_interpolate.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 2);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 2;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = CS_crossbar_stage;
|
||||
_combine_alpha_source0_stage = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = CS_undefined;
|
||||
_combine_alpha_operand2 = CO_undefined;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a two-parameter operation. Specifically,
|
||||
// this is everything except for CM_replace and
|
||||
// CM_interpolate.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 2);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 2;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = CS_crossbar_stage;
|
||||
_combine_alpha_source1_stage = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = CS_undefined;
|
||||
_combine_alpha_operand2 = CO_undefined;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a two-parameter operation. Specifically,
|
||||
// this is everything except for CM_replace and
|
||||
// CM_interpolate.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 2);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 2;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = CS_crossbar_stage;
|
||||
_combine_alpha_source0_stage = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = CS_crossbar_stage;
|
||||
_combine_alpha_source1_stage = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = CS_undefined;
|
||||
_combine_alpha_operand2 = CO_undefined;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
|
|
@ -993,221 +540,6 @@ set_combine_alpha(CombineMode mode,
|
|||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
nassertv(operand_valid_for_alpha(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 3;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = CS_crossbar_stage;
|
||||
_combine_alpha_source0_stage = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = source2;
|
||||
_combine_alpha_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
nassertv(operand_valid_for_alpha(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 3;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = CS_crossbar_stage;
|
||||
_combine_alpha_source1_stage = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = source2;
|
||||
_combine_alpha_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
nassertv(operand_valid_for_alpha(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 3;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = CS_crossbar_stage;
|
||||
_combine_alpha_source2_stage = source2;
|
||||
_combine_alpha_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
nassertv(operand_valid_for_alpha(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 3;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = CS_crossbar_stage;
|
||||
_combine_alpha_source1_stage = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = CS_crossbar_stage;
|
||||
_combine_alpha_source2_stage = source2;
|
||||
_combine_alpha_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
nassertv(operand_valid_for_alpha(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 3;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = CS_crossbar_stage;
|
||||
_combine_alpha_source0_stage = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = CS_crossbar_stage;
|
||||
_combine_alpha_source2_stage = source2;
|
||||
_combine_alpha_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
nassertv(operand_valid_for_alpha(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 3;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = CS_crossbar_stage;
|
||||
_combine_alpha_source0_stage = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = CS_crossbar_stage;
|
||||
_combine_alpha_source1_stage = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = source2;
|
||||
_combine_alpha_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::set_combine_alpha
|
||||
// Access: Published
|
||||
// Description: Specifies any of the CombineMode values that
|
||||
// represent a one-parameter operation. Specifically,
|
||||
// this is CM_interpolate only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void TextureStage::
|
||||
set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2) {
|
||||
nassertv(get_expected_num_combine_operands(mode) == 3);
|
||||
nassertv(operand_valid_for_alpha(operand0));
|
||||
nassertv(operand_valid_for_alpha(operand1));
|
||||
nassertv(operand_valid_for_alpha(operand2));
|
||||
_mode = M_combine;
|
||||
_num_combine_alpha_operands = 3;
|
||||
_combine_alpha_mode = mode;
|
||||
_combine_alpha_source0 = CS_crossbar_stage;
|
||||
_combine_alpha_source0_stage = source0;
|
||||
_combine_alpha_operand0 = operand0;
|
||||
_combine_alpha_source1 = CS_crossbar_stage;
|
||||
_combine_alpha_source1_stage = source1;
|
||||
_combine_alpha_operand1 = operand1;
|
||||
_combine_alpha_source2 = CS_crossbar_stage;
|
||||
_combine_alpha_source2_stage = source2;
|
||||
_combine_alpha_operand2 = operand2;
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_alpha
|
||||
// Access: Published
|
||||
|
|
@ -1240,21 +572,6 @@ get_combine_alpha_source0() const {
|
|||
return _combine_alpha_source0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_alpha_source0_stage
|
||||
// Access: Published
|
||||
// Description: Get the TextureStage for source0 of combine_alpha_mode.
|
||||
// This is valid only when get_combine_alpha_source0()
|
||||
// returns CS_crossbar_stage, indicating that the source
|
||||
// is from a particular TextureStage (which may or may
|
||||
// not be the immediately preceding stage in the
|
||||
// pipeline).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const TextureStage *TextureStage::
|
||||
get_combine_alpha_source0_stage() const {
|
||||
return _combine_alpha_source0_stage;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_alpha_operand0
|
||||
// Access: Published
|
||||
|
|
@ -1275,21 +592,6 @@ get_combine_alpha_source1() const {
|
|||
return _combine_alpha_source1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_alpha_source1_stage
|
||||
// Access: Published
|
||||
// Description: Get the TextureStage for source1 of combine_alpha_mode.
|
||||
// This is valid only when get_combine_alpha_source1()
|
||||
// returns CS_crossbar_stage, indicating that the source
|
||||
// is from a particular TextureStage (which may or may
|
||||
// not be the immediately preceding stage in the
|
||||
// pipeline).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const TextureStage *TextureStage::
|
||||
get_combine_alpha_source1_stage() const {
|
||||
return _combine_alpha_source1_stage;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_alpha_operand1
|
||||
// Access: Published
|
||||
|
|
@ -1310,21 +612,6 @@ get_combine_alpha_source2() const {
|
|||
return _combine_alpha_source2;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_alpha_source2_stage
|
||||
// Access: Published
|
||||
// Description: Get the TextureStage for source2 of combine_alpha_mode.
|
||||
// This is valid only when get_combine_alpha_source2()
|
||||
// returns CS_crossbar_stage, indicating that the source
|
||||
// is from a particular TextureStage (which may or may
|
||||
// not be the immediately preceding stage in the
|
||||
// pipeline).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const TextureStage *TextureStage::
|
||||
get_combine_alpha_source2_stage() const {
|
||||
return _combine_alpha_source2_stage;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_combine_alpha_operand2
|
||||
// Access: Published
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ TextureStage(const string &name) {
|
|||
_color.set(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
_rgb_scale = 1;
|
||||
_alpha_scale = 1;
|
||||
_saved_result = false;
|
||||
_combine_rgb_mode = CM_undefined;
|
||||
_num_combine_rgb_operands = 0;
|
||||
_combine_rgb_source0 = CS_undefined;
|
||||
|
|
@ -75,6 +76,7 @@ operator = (const TextureStage &other) {
|
|||
_color = other._color;
|
||||
_rgb_scale = other._rgb_scale;
|
||||
_alpha_scale = other._alpha_scale;
|
||||
_saved_result = other._saved_result;
|
||||
|
||||
_combine_rgb_mode = other._combine_rgb_mode;
|
||||
_combine_rgb_source0 = other._combine_rgb_source0;
|
||||
|
|
@ -114,46 +116,41 @@ write(ostream &out) const {
|
|||
out << "TextureStage " << get_name() << ", sort = " << get_sort() << ", priority = " << get_priority() << "\n"
|
||||
<< " texcoords = " << get_texcoord_name()->get_name()
|
||||
<< ", mode = " << get_mode() << ", color = " << get_color()
|
||||
<< ", scale = " << get_rgb_scale() << ", " << get_alpha_scale() << "\n";
|
||||
<< ", scale = " << get_rgb_scale() << ", " << get_alpha_scale()
|
||||
<< ", saved_result = " << get_saved_result() << "\n";
|
||||
|
||||
if (get_mode() == M_combine) {
|
||||
out << " RGB combine mode = " << get_combine_rgb_mode() << "\n";
|
||||
if (get_num_combine_rgb_operands() >= 1) {
|
||||
write_operand(out, 0, get_combine_rgb_source0(),
|
||||
get_combine_rgb_source0_stage(),
|
||||
get_combine_rgb_operand0());
|
||||
out << " 0: " << get_combine_rgb_source0() << ", "
|
||||
<< get_combine_rgb_operand0() << "\n";
|
||||
}
|
||||
if (get_num_combine_rgb_operands() >= 2) {
|
||||
write_operand(out, 1, get_combine_rgb_source1(),
|
||||
get_combine_rgb_source1_stage(),
|
||||
get_combine_rgb_operand1());
|
||||
out << " 1: " << get_combine_rgb_source1() << ", "
|
||||
<< get_combine_rgb_operand1() << "\n";
|
||||
}
|
||||
if (get_num_combine_rgb_operands() >= 3) {
|
||||
write_operand(out, 2, get_combine_rgb_source2(),
|
||||
get_combine_rgb_source2_stage(),
|
||||
get_combine_rgb_operand2());
|
||||
out << " 2: " << get_combine_rgb_source2() << ", "
|
||||
<< get_combine_rgb_operand2() << "\n";
|
||||
}
|
||||
out << " alpha combine mode = " << get_combine_alpha_mode() << "\n";
|
||||
if (get_num_combine_alpha_operands() >= 1) {
|
||||
write_operand(out, 0, get_combine_alpha_source0(),
|
||||
get_combine_alpha_source0_stage(),
|
||||
get_combine_alpha_operand0());
|
||||
out << " 0: " << get_combine_alpha_source0() << ", "
|
||||
<< get_combine_alpha_operand0() << "\n";
|
||||
}
|
||||
if (get_num_combine_alpha_operands() >= 2) {
|
||||
write_operand(out, 1, get_combine_alpha_source1(),
|
||||
get_combine_alpha_source1_stage(),
|
||||
get_combine_alpha_operand1());
|
||||
out << " 1: " << get_combine_alpha_source1() << ", "
|
||||
<< get_combine_alpha_operand1() << "\n";
|
||||
}
|
||||
if (get_num_combine_alpha_operands() >= 3) {
|
||||
write_operand(out, 2, get_combine_alpha_source2(),
|
||||
get_combine_alpha_source2_stage(),
|
||||
get_combine_alpha_operand2());
|
||||
out << " 2: " << get_combine_alpha_source2() << ", "
|
||||
<< get_combine_alpha_operand2() << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::output
|
||||
// Function: TextureStage::Destructor
|
||||
// Access: Published
|
||||
// Description: Just a single line output
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -162,25 +159,6 @@ output(ostream &out) const {
|
|||
out << "TextureStage " << get_name();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::write_operand
|
||||
// Access: Private, Static
|
||||
// Description: Used by write() to simply describe a single operand
|
||||
// of the CM_combine mode (one of up to 3 defined by the
|
||||
// stage).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void TextureStage::
|
||||
write_operand(ostream &out, int operand_index, CombineSource source,
|
||||
const TextureStage *source_stage, CombineOperand operand) {
|
||||
if (source == CS_crossbar_stage) {
|
||||
out << " " << operand_index << ": "
|
||||
<< *source_stage << ", " << operand << "\n";
|
||||
} else {
|
||||
out << " " << operand_index << ": "
|
||||
<< source << ", " << operand << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TextureStage::get_expected_num_combine_operands
|
||||
// Access: Private, Static
|
||||
|
|
@ -308,7 +286,11 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
|
||||
_rgb_scale = scan.get_uint8();
|
||||
_alpha_scale = scan.get_uint8();
|
||||
|
||||
_saved_result = false;
|
||||
if (manager->get_file_minor_ver() >= 1) {
|
||||
_saved_result = scan.get_bool();
|
||||
}
|
||||
|
||||
_combine_rgb_mode = (TextureStage::CombineMode) scan.get_uint8();
|
||||
_num_combine_rgb_operands = scan.get_uint8();
|
||||
_combine_rgb_source0 = (TextureStage::CombineSource) scan.get_uint8();
|
||||
|
|
@ -327,27 +309,6 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
_combine_alpha_source2 = (TextureStage::CombineSource) scan.get_uint8();
|
||||
_combine_alpha_operand2 = (TextureStage::CombineOperand) scan.get_uint8();
|
||||
|
||||
// We only read these pointers if the source types indicate they are
|
||||
// defined.
|
||||
if (_combine_rgb_source0 == CS_crossbar_stage) {
|
||||
manager->read_pointer(scan);
|
||||
}
|
||||
if (_combine_rgb_source1 == CS_crossbar_stage) {
|
||||
manager->read_pointer(scan);
|
||||
}
|
||||
if (_combine_rgb_source2 == CS_crossbar_stage) {
|
||||
manager->read_pointer(scan);
|
||||
}
|
||||
if (_combine_alpha_source0 == CS_crossbar_stage) {
|
||||
manager->read_pointer(scan);
|
||||
}
|
||||
if (_combine_alpha_source1 == CS_crossbar_stage) {
|
||||
manager->read_pointer(scan);
|
||||
}
|
||||
if (_combine_alpha_source2 == CS_crossbar_stage) {
|
||||
manager->read_pointer(scan);
|
||||
}
|
||||
|
||||
update_color_flags();
|
||||
}
|
||||
|
||||
|
|
@ -364,27 +325,6 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) {
|
|||
|
||||
_texcoord_name = DCAST(InternalName, p_list[pi++]);
|
||||
|
||||
// We only read these pointers if the source types indicate they are
|
||||
// defined.
|
||||
if (_combine_rgb_source0 == CS_crossbar_stage) {
|
||||
_combine_rgb_source0_stage = DCAST(TextureStage, p_list[pi++]);
|
||||
}
|
||||
if (_combine_rgb_source1 == CS_crossbar_stage) {
|
||||
_combine_rgb_source1_stage = DCAST(TextureStage, p_list[pi++]);
|
||||
}
|
||||
if (_combine_rgb_source2 == CS_crossbar_stage) {
|
||||
_combine_rgb_source2_stage = DCAST(TextureStage, p_list[pi++]);
|
||||
}
|
||||
if (_combine_alpha_source0 == CS_crossbar_stage) {
|
||||
_combine_alpha_source0_stage = DCAST(TextureStage, p_list[pi++]);
|
||||
}
|
||||
if (_combine_alpha_source1 == CS_crossbar_stage) {
|
||||
_combine_alpha_source1_stage = DCAST(TextureStage, p_list[pi++]);
|
||||
}
|
||||
if (_combine_alpha_source2 == CS_crossbar_stage) {
|
||||
_combine_alpha_source2_stage = DCAST(TextureStage, p_list[pi++]);
|
||||
}
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
|
|
@ -411,6 +351,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||
_color.write_datagram(me);
|
||||
me.add_uint8(_rgb_scale);
|
||||
me.add_uint8(_alpha_scale);
|
||||
me.add_bool(_saved_result);
|
||||
|
||||
me.add_uint8(_combine_rgb_mode);
|
||||
me.add_uint8(_num_combine_rgb_operands);
|
||||
|
|
@ -429,27 +370,6 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||
me.add_uint8(_combine_alpha_operand1);
|
||||
me.add_uint8(_combine_alpha_source2);
|
||||
me.add_uint8(_combine_alpha_operand2);
|
||||
|
||||
// We only write these pointers if the source types indicate they
|
||||
// are defined.
|
||||
if (_combine_rgb_source0 == CS_crossbar_stage) {
|
||||
manager->write_pointer(me, _combine_rgb_source0_stage);
|
||||
}
|
||||
if (_combine_rgb_source1 == CS_crossbar_stage) {
|
||||
manager->write_pointer(me, _combine_rgb_source1_stage);
|
||||
}
|
||||
if (_combine_rgb_source2 == CS_crossbar_stage) {
|
||||
manager->write_pointer(me, _combine_rgb_source2_stage);
|
||||
}
|
||||
if (_combine_alpha_source0 == CS_crossbar_stage) {
|
||||
manager->write_pointer(me, _combine_alpha_source0_stage);
|
||||
}
|
||||
if (_combine_alpha_source1 == CS_crossbar_stage) {
|
||||
manager->write_pointer(me, _combine_alpha_source1_stage);
|
||||
}
|
||||
if (_combine_alpha_source2 == CS_crossbar_stage) {
|
||||
manager->write_pointer(me, _combine_alpha_source2_stage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -536,8 +456,8 @@ operator << (ostream &out, TextureStage::CombineSource cs) {
|
|||
case TextureStage::CS_constant_color_scale:
|
||||
return out << "constant_color_scale";
|
||||
|
||||
case TextureStage::CS_crossbar_stage:
|
||||
return out << "crossbar_stage";
|
||||
case TextureStage::CS_last_saved_result:
|
||||
return out << "last_saved_result";
|
||||
}
|
||||
|
||||
return out << "**invalid CombineSource(" << (int)cs << ")**";
|
||||
|
|
|
|||
|
|
@ -59,17 +59,17 @@ PUBLISHED:
|
|||
|
||||
enum CombineMode {
|
||||
CM_undefined,
|
||||
CM_replace, // 1 operand
|
||||
CM_modulate, // 2 operands
|
||||
CM_add, // 2 operands
|
||||
CM_add_signed, // 2 operands
|
||||
CM_interpolate, // 3 operands
|
||||
CM_subtract, // 2 operands
|
||||
CM_replace,
|
||||
CM_modulate,
|
||||
CM_add,
|
||||
CM_add_signed,
|
||||
CM_interpolate,
|
||||
CM_subtract,
|
||||
|
||||
// The following are valid only for combine_rgb, not
|
||||
// combine_alpha.
|
||||
CM_dot3_rgb, // 2 operands
|
||||
CM_dot3_rgba, // 2 operands
|
||||
CM_dot3_rgb,
|
||||
CM_dot3_rgba,
|
||||
};
|
||||
|
||||
enum CombineSource {
|
||||
|
|
@ -79,7 +79,7 @@ PUBLISHED:
|
|||
CS_primary_color,
|
||||
CS_previous,
|
||||
CS_constant_color_scale,
|
||||
CS_crossbar_stage,
|
||||
CS_last_saved_result,
|
||||
};
|
||||
|
||||
enum CombineOperand {
|
||||
|
|
@ -117,126 +117,43 @@ PUBLISHED:
|
|||
INLINE void set_alpha_scale(int alpha_scale);
|
||||
INLINE int get_alpha_scale() const;
|
||||
|
||||
INLINE void set_saved_result(bool saved_result);
|
||||
INLINE bool get_saved_result() const;
|
||||
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2);
|
||||
INLINE void set_combine_rgb(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2);
|
||||
|
||||
INLINE CombineMode get_combine_rgb_mode() const;
|
||||
INLINE int get_num_combine_rgb_operands() const;
|
||||
INLINE CombineSource get_combine_rgb_source0() const;
|
||||
INLINE const TextureStage *get_combine_rgb_source0_stage() const;
|
||||
INLINE CombineOperand get_combine_rgb_operand0() const;
|
||||
INLINE CombineSource get_combine_rgb_source1() const;
|
||||
INLINE const TextureStage *get_combine_rgb_source1_stage() const;
|
||||
INLINE CombineOperand get_combine_rgb_operand1() const;
|
||||
INLINE CombineSource get_combine_rgb_source2() const;
|
||||
INLINE const TextureStage *get_combine_rgb_source2_stage() const;
|
||||
INLINE CombineOperand get_combine_rgb_operand2() const;
|
||||
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
CombineSource source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
CombineSource source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
CombineSource source2, CombineOperand operand2);
|
||||
INLINE void set_combine_alpha(CombineMode mode,
|
||||
const TextureStage *source0, CombineOperand operand0,
|
||||
const TextureStage *source1, CombineOperand operand1,
|
||||
const TextureStage *source2, CombineOperand operand2);
|
||||
|
||||
INLINE CombineMode get_combine_alpha_mode() const;
|
||||
INLINE int get_num_combine_alpha_operands() const;
|
||||
INLINE CombineSource get_combine_alpha_source0() const;
|
||||
INLINE const TextureStage *get_combine_alpha_source0_stage() const;
|
||||
INLINE CombineOperand get_combine_alpha_operand0() const;
|
||||
INLINE CombineSource get_combine_alpha_source1() const;
|
||||
INLINE const TextureStage *get_combine_alpha_source1_stage() const;
|
||||
INLINE CombineOperand get_combine_alpha_operand1() const;
|
||||
INLINE CombineSource get_combine_alpha_source2() const;
|
||||
INLINE const TextureStage *get_combine_alpha_source2_stage() const;
|
||||
INLINE CombineOperand get_combine_alpha_operand2() const;
|
||||
|
||||
INLINE bool uses_color() const;
|
||||
|
|
@ -253,11 +170,6 @@ public:
|
|||
private:
|
||||
INLINE void update_color_flags();
|
||||
|
||||
static void write_operand(ostream &out, int operand_index,
|
||||
CombineSource source,
|
||||
const TextureStage *source_stage,
|
||||
CombineOperand operand);
|
||||
|
||||
static int get_expected_num_combine_operands(CombineMode cm);
|
||||
static bool operand_valid_for_rgb(CombineOperand co);
|
||||
static bool operand_valid_for_alpha(CombineOperand co);
|
||||
|
|
@ -270,31 +182,26 @@ private:
|
|||
Colorf _color;
|
||||
int _rgb_scale;
|
||||
int _alpha_scale;
|
||||
bool _saved_result;
|
||||
bool _uses_color;
|
||||
bool _involves_color_scale;
|
||||
|
||||
CombineMode _combine_rgb_mode;
|
||||
int _num_combine_rgb_operands;
|
||||
CombineSource _combine_rgb_source0;
|
||||
CPT(TextureStage) _combine_rgb_source0_stage;
|
||||
CombineOperand _combine_rgb_operand0;
|
||||
CombineSource _combine_rgb_source1;
|
||||
CPT(TextureStage) _combine_rgb_source1_stage;
|
||||
CombineOperand _combine_rgb_operand1;
|
||||
CombineSource _combine_rgb_source2;
|
||||
CPT(TextureStage) _combine_rgb_source2_stage;
|
||||
CombineOperand _combine_rgb_operand2;
|
||||
|
||||
CombineMode _combine_alpha_mode;
|
||||
int _num_combine_alpha_operands;
|
||||
CombineSource _combine_alpha_source0;
|
||||
CPT(TextureStage) _combine_alpha_source0_stage;
|
||||
CombineOperand _combine_alpha_operand0;
|
||||
CombineSource _combine_alpha_source1;
|
||||
CPT(TextureStage) _combine_alpha_source1_stage;
|
||||
CombineOperand _combine_alpha_operand1;
|
||||
CombineSource _combine_alpha_source2;
|
||||
CPT(TextureStage) _combine_alpha_source2_stage;
|
||||
CombineOperand _combine_alpha_operand2;
|
||||
|
||||
static PT(TextureStage) _default_stage;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ static const unsigned short _bam_major_ver = 5;
|
|||
// Bumped to major version 4 on 4/10/02 to store new scene graph.
|
||||
// Bumped to major version 5 on 5/6/05 for new Geom implementation.
|
||||
|
||||
static const unsigned short _bam_minor_ver = 0;
|
||||
static const unsigned short _bam_minor_ver = 1;
|
||||
// Bumped to minor version 1 on 7/14/05 to add TextureStage::_saved_result.
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue